camox 0.32.0 → 0.33.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/components/AuthGate.js +5 -4
- package/dist/core/createBlock.d.ts +1 -1
- package/dist/core/createBlock.js +88 -108
- package/dist/core/hooks/useIsEditable.js +6 -10
- package/dist/core/lib/fieldTypes.js +10 -219
- package/dist/features/agent-chat/components/AgentChatSidebar.js +172 -0
- package/dist/features/agent-chat/components/AgentChatThread.js +14 -15
- package/dist/features/preview/CamoxPreview.js +137 -729
- package/dist/features/preview/components/{AddBlockSheet.js → AddBlockSidebar.js} +121 -131
- package/dist/features/preview/components/AssetFieldEditor.js +107 -82
- package/dist/features/preview/components/AssetLightbox.js +14 -13
- package/dist/features/preview/components/AssetPickerModal.js +277 -0
- package/dist/features/preview/components/BlockActionsPopover.js +18 -24
- package/dist/features/preview/components/CreatePageModal.js +6 -6
- package/dist/features/preview/components/FieldToolbar.js +64 -127
- package/dist/features/preview/components/ItemFieldsEditor.js +98 -125
- package/dist/features/preview/components/LeftSidebar.js +64 -0
- package/dist/features/preview/components/LinkFieldEditor.js +1 -1
- package/dist/features/preview/components/MultipleAssetFieldEditor.js +94 -56
- package/dist/features/preview/components/OverlayTracker.js +15 -15
- package/dist/features/preview/components/Overlays.js +12 -12
- package/dist/features/preview/components/PageEditorSidebar.js +563 -0
- package/dist/features/preview/components/PageInfoSidebar.js +1453 -0
- package/dist/features/preview/components/PageNavigatorSidebar.js +590 -0
- package/dist/features/preview/components/PagePicker.js +3 -3
- package/dist/features/preview/components/PageStatusBadge.js +1 -1
- package/dist/features/preview/components/PageTree.js +204 -564
- package/dist/features/preview/components/PreviewPanel.js +123 -158
- package/dist/features/preview/components/PreviewToolbar.js +260 -256
- package/dist/features/preview/components/PublishDialog.js +2 -2
- package/dist/features/preview/components/RepeatableItemsList.js +2 -2
- package/dist/features/preview/components/RightSidebar.js +109 -0
- package/dist/features/preview/components/UnlinkAssetButton.js +2 -2
- package/dist/features/preview/components/useRepeatableItemActions.js +3 -138
- package/dist/features/preview/components/useUpdateBlockPosition.js +1 -1
- package/dist/features/preview/previewQueryFns.js +23 -0
- package/dist/features/preview/previewStore.js +46 -63
- package/dist/features/provider/CamoxProvider.js +255 -70
- package/dist/features/provider/useAdminShortcuts.js +5 -48
- package/dist/features/routes/pageRoute.js +1 -1
- package/dist/features/studio/CamoxStudio.js +6 -5
- package/dist/features/studio/components/EnvironmentMenu.js +2 -2
- package/dist/features/studio/components/Navbar.js +53 -71
- package/dist/features/studio/components/ProjectMenu.js +1 -1
- package/dist/features/studio/components/UserButton.js +1 -1
- package/dist/features/studio/routes.js +7 -0
- package/dist/features/studio/useTheme.js +67 -33
- package/dist/features/vite/routeGeneration.js +68 -66
- package/dist/hooks/use-file-upload.js +4 -2
- package/dist/lib/api-client.js +6 -3
- package/dist/lib/auth.js +29 -25
- package/dist/lib/queries.js +6 -4
- package/dist/lib/utils.js +1 -1
- package/dist/studio-overlays.css +1 -1
- package/dist/studio.css +1 -1
- package/package.json +4 -4
- package/dist/features/agent-chat/components/AgentChatSheet.js +0 -207
- package/dist/features/preview/components/AssetPickerGrid.js +0 -236
- package/dist/features/preview/components/PageContentSheet.js +0 -608
- package/dist/features/preview/components/PageMetadataModal.js +0 -908
- package/dist/features/preview/components/PreviewSideSheet.js +0 -76
|
@@ -1,42 +1,27 @@
|
|
|
1
|
-
import { trackClientEvent } from "../../lib/telemetry-client.js";
|
|
2
|
-
import { previewStore } from "./previewStore.js";
|
|
3
1
|
import { actionsStore } from "../provider/actionsStore.js";
|
|
4
2
|
import { useIsAuthenticated, useProjectSlug } from "../../lib/auth.js";
|
|
5
3
|
import { getApiClient } from "../../lib/api-client.js";
|
|
6
|
-
import { blockQueries,
|
|
4
|
+
import { blockQueries, pageQueries, projectQueries } from "../../lib/queries.js";
|
|
7
5
|
import { cn } from "../../lib/utils.js";
|
|
6
|
+
import { previewStore } from "./previewStore.js";
|
|
8
7
|
import { NormalizedDataProvider, seedBlockCaches, usePageBlocks } from "../../lib/normalized-data.js";
|
|
9
8
|
import { BlockErrorBoundary } from "./components/BlockErrorBoundary.js";
|
|
10
|
-
import { AgentChatSheet } from "../agent-chat/components/AgentChatSheet.js";
|
|
11
9
|
import { useCamoxApp } from "../provider/components/CamoxAppContext.js";
|
|
12
10
|
import { Navbar } from "../studio/components/Navbar.js";
|
|
13
|
-
import { AddBlockSheet } from "./components/AddBlockSheet.js";
|
|
14
11
|
import { CreatePageModal } from "./components/CreatePageModal.js";
|
|
15
12
|
import { DraftSwitchDialog } from "./components/DraftSwitchDialog.js";
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import { PagePicker } from "./components/PagePicker.js";
|
|
19
|
-
import { PageTree } from "./components/PageTree.js";
|
|
13
|
+
import { pageFullQueryFn } from "./previewQueryFns.js";
|
|
14
|
+
import { LeftSidebar } from "./components/LeftSidebar.js";
|
|
20
15
|
import { PeekedBlock } from "./components/PeekedBlock.js";
|
|
21
|
-
import {
|
|
22
|
-
import {
|
|
16
|
+
import { PreviewPanel } from "./components/PreviewPanel.js";
|
|
17
|
+
import { RightSidebar } from "./components/RightSidebar.js";
|
|
23
18
|
import { c } from "react/compiler-runtime";
|
|
24
|
-
import {
|
|
25
|
-
import { toast } from "@camox/ui/toaster";
|
|
26
|
-
import { keepPreviousData, useMutation, useQuery, useQueryClient, useSuspenseQuery } from "@tanstack/react-query";
|
|
19
|
+
import { keepPreviousData, useQuery, useQueryClient, useSuspenseQuery } from "@tanstack/react-query";
|
|
27
20
|
import { useLocation, useNavigate } from "@tanstack/react-router";
|
|
28
21
|
import { useSelector } from "@xstate/store-react";
|
|
29
22
|
import * as React from "react";
|
|
30
|
-
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
31
23
|
import { queryKeys } from "@camox/api-contract/query-keys";
|
|
32
|
-
import {
|
|
33
|
-
import { Button } from "@camox/ui/button";
|
|
34
|
-
import { ButtonGroup } from "@camox/ui/button-group";
|
|
35
|
-
import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuTrigger } from "@camox/ui/dropdown-menu";
|
|
36
|
-
import { PanelContent, PanelHeader } from "@camox/ui/panel";
|
|
37
|
-
import { Switch } from "@camox/ui/switch";
|
|
38
|
-
import { Tooltip, TooltipContent, TooltipTrigger } from "@camox/ui/tooltip";
|
|
39
|
-
import { Info, MoreHorizontal } from "lucide-react";
|
|
24
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
40
25
|
|
|
41
26
|
//#region src/features/preview/CamoxPreview.tsx
|
|
42
27
|
/**
|
|
@@ -64,31 +49,11 @@ function pageStructureQueryFn(path, projectSlug, source) {
|
|
|
64
49
|
source
|
|
65
50
|
});
|
|
66
51
|
}
|
|
67
|
-
/**
|
|
68
|
-
* Full queryFn that fetches all page data and seeds block caches.
|
|
69
|
-
* Used for peeked pages where block caches may not be populated yet.
|
|
70
|
-
*/
|
|
71
|
-
function pageFullQueryFn(queryClient, path, projectSlug, source) {
|
|
72
|
-
return async () => {
|
|
73
|
-
const data = await getApiClient().pages.getByPath({
|
|
74
|
-
path,
|
|
75
|
-
projectSlug,
|
|
76
|
-
source
|
|
77
|
-
});
|
|
78
|
-
seedBlockCaches(queryClient, data, source);
|
|
79
|
-
return {
|
|
80
|
-
page: data.page,
|
|
81
|
-
layout: data.layout,
|
|
82
|
-
projectName: data.projectName,
|
|
83
|
-
project: data.project
|
|
84
|
-
};
|
|
85
|
-
};
|
|
86
|
-
}
|
|
87
52
|
function usePreviewedPage() {
|
|
88
53
|
const $ = c(26);
|
|
89
|
-
if ($[0] !== "
|
|
54
|
+
if ($[0] !== "368878cc357f559a41241bfa8387ebbcf6457dabf75b71445e9ead672ed8deb3") {
|
|
90
55
|
for (let $i = 0; $i < 26; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
|
|
91
|
-
$[0] = "
|
|
56
|
+
$[0] = "368878cc357f559a41241bfa8387ebbcf6457dabf75b71445e9ead672ed8deb3";
|
|
92
57
|
}
|
|
93
58
|
const { pathname } = useLocation();
|
|
94
59
|
const queryClient = useQueryClient();
|
|
@@ -185,9 +150,9 @@ function _temp(state) {
|
|
|
185
150
|
}
|
|
186
151
|
const BlockRenderer = (t0) => {
|
|
187
152
|
const $ = c(23);
|
|
188
|
-
if ($[0] !== "
|
|
153
|
+
if ($[0] !== "368878cc357f559a41241bfa8387ebbcf6457dabf75b71445e9ead672ed8deb3") {
|
|
189
154
|
for (let $i = 0; $i < 23; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
|
|
190
|
-
$[0] = "
|
|
155
|
+
$[0] = "368878cc357f559a41241bfa8387ebbcf6457dabf75b71445e9ead672ed8deb3";
|
|
191
156
|
}
|
|
192
157
|
const { blockId, mode, showAddBlockTop, showAddBlockBottom } = t0;
|
|
193
158
|
const previewSource = useSelector(previewStore, _temp3);
|
|
@@ -328,504 +293,11 @@ const PageContent = () => {
|
|
|
328
293
|
children: pageBlocksContent
|
|
329
294
|
});
|
|
330
295
|
};
|
|
331
|
-
const SidebarPublishRow = (t0) => {
|
|
332
|
-
const $ = c(102);
|
|
333
|
-
if ($[0] !== "1f8b3d930e363e9f026de778e54437825e294d4a0094b6a999e795efbcd37f98") {
|
|
334
|
-
for (let $i = 0; $i < 102; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
|
|
335
|
-
$[0] = "1f8b3d930e363e9f026de778e54437825e294d4a0094b6a999e795efbcd37f98";
|
|
336
|
-
}
|
|
337
|
-
const { page } = t0;
|
|
338
|
-
const previewSource = useSelector(previewStore, _temp4);
|
|
339
|
-
const queryClient = useQueryClient();
|
|
340
|
-
const projectSlug = useProjectSlug();
|
|
341
|
-
const { pathname } = useLocation();
|
|
342
|
-
const [isPublishDialogOpen, setIsPublishDialogOpen] = React.useState(false);
|
|
343
|
-
const [isUnpublishDialogOpen, setIsUnpublishDialogOpen] = React.useState(false);
|
|
344
|
-
const [isDiscardDialogOpen, setIsDiscardDialogOpen] = React.useState(false);
|
|
345
|
-
let t1;
|
|
346
|
-
if ($[1] === Symbol.for("react.memo_cache_sentinel")) {
|
|
347
|
-
t1 = pageMutations.unpublish();
|
|
348
|
-
$[1] = t1;
|
|
349
|
-
} else t1 = $[1];
|
|
350
|
-
const unpublishPage = useMutation(t1);
|
|
351
|
-
let t2;
|
|
352
|
-
if ($[2] === Symbol.for("react.memo_cache_sentinel")) {
|
|
353
|
-
t2 = pageMutations.discardChanges();
|
|
354
|
-
$[2] = t2;
|
|
355
|
-
} else t2 = $[2];
|
|
356
|
-
const discardChanges = useMutation(t2);
|
|
357
|
-
const hasLiveCheckpoint = page.livePublishedCheckpointId != null;
|
|
358
|
-
const isHomePage = page.fullPath === "/";
|
|
359
|
-
const otherSource = previewSource === "draft" ? "live" : "draft";
|
|
360
|
-
const canPrefetchOther = otherSource === "draft" || hasLiveCheckpoint;
|
|
361
|
-
let t3;
|
|
362
|
-
if ($[3] !== canPrefetchOther || $[4] !== otherSource || $[5] !== pathname || $[6] !== projectSlug || $[7] !== queryClient) {
|
|
363
|
-
t3 = () => {
|
|
364
|
-
if (!canPrefetchOther) return;
|
|
365
|
-
queryClient.prefetchQuery({
|
|
366
|
-
queryKey: queryKeys.pages.getByPath(pathname, otherSource),
|
|
367
|
-
queryFn: pageFullQueryFn(queryClient, pathname, projectSlug, otherSource),
|
|
368
|
-
staleTime: Infinity
|
|
369
|
-
});
|
|
370
|
-
};
|
|
371
|
-
$[3] = canPrefetchOther;
|
|
372
|
-
$[4] = otherSource;
|
|
373
|
-
$[5] = pathname;
|
|
374
|
-
$[6] = projectSlug;
|
|
375
|
-
$[7] = queryClient;
|
|
376
|
-
$[8] = t3;
|
|
377
|
-
} else t3 = $[8];
|
|
378
|
-
const prefetchOtherSource = t3;
|
|
379
|
-
const canPublish = (page.status === "draft" || page.status === "modified") && previewSource === "draft";
|
|
380
|
-
const canDiscardChanges = page.status === "modified";
|
|
381
|
-
let t4;
|
|
382
|
-
if ($[9] !== page.modifiedReason) {
|
|
383
|
-
t4 = page.modifiedReason && (page.modifiedReason.reason === "layout" || page.modifiedReason.reason === "both") ? {
|
|
384
|
-
layoutHandle: page.modifiedReason.layoutHandle,
|
|
385
|
-
affectedPagesCount: page.modifiedReason.affectedPagesCount
|
|
386
|
-
} : null;
|
|
387
|
-
$[9] = page.modifiedReason;
|
|
388
|
-
$[10] = t4;
|
|
389
|
-
} else t4 = $[10];
|
|
390
|
-
const layoutCascade = t4;
|
|
391
|
-
const publishLabel = page.status === "modified" ? "Publish changes" : "Publish page";
|
|
392
|
-
let t5;
|
|
393
|
-
let t6;
|
|
394
|
-
if ($[11] !== canDiscardChanges || $[12] !== canPublish || $[13] !== discardChanges.isPending || $[14] !== hasLiveCheckpoint || $[15] !== isHomePage || $[16] !== publishLabel || $[17] !== unpublishPage.isPending) {
|
|
395
|
-
t5 = () => {
|
|
396
|
-
const actions = [
|
|
397
|
-
{
|
|
398
|
-
id: "publish-current-page",
|
|
399
|
-
label: publishLabel,
|
|
400
|
-
aliases: [
|
|
401
|
-
"Publish",
|
|
402
|
-
"Publish page",
|
|
403
|
-
"Make live"
|
|
404
|
-
],
|
|
405
|
-
groupLabel: "Preview",
|
|
406
|
-
checkIfAvailable: () => canPublish,
|
|
407
|
-
execute: () => setIsPublishDialogOpen(true)
|
|
408
|
-
},
|
|
409
|
-
{
|
|
410
|
-
id: "unpublish-current-page",
|
|
411
|
-
label: "Unpublish page",
|
|
412
|
-
aliases: [
|
|
413
|
-
"Take offline",
|
|
414
|
-
"Remove from live",
|
|
415
|
-
"Hide page"
|
|
416
|
-
],
|
|
417
|
-
groupLabel: "Preview",
|
|
418
|
-
checkIfAvailable: () => hasLiveCheckpoint && !isHomePage && !unpublishPage.isPending,
|
|
419
|
-
execute: () => setIsUnpublishDialogOpen(true)
|
|
420
|
-
},
|
|
421
|
-
{
|
|
422
|
-
id: "discard-current-page-changes",
|
|
423
|
-
label: "Discard page changes",
|
|
424
|
-
aliases: [
|
|
425
|
-
"Revert page",
|
|
426
|
-
"Reset page",
|
|
427
|
-
"Discard draft"
|
|
428
|
-
],
|
|
429
|
-
groupLabel: "Preview",
|
|
430
|
-
checkIfAvailable: () => canDiscardChanges && !discardChanges.isPending,
|
|
431
|
-
execute: () => setIsDiscardDialogOpen(true)
|
|
432
|
-
}
|
|
433
|
-
];
|
|
434
|
-
actionsStore.send({
|
|
435
|
-
type: "registerManyActions",
|
|
436
|
-
actions
|
|
437
|
-
});
|
|
438
|
-
return () => {
|
|
439
|
-
actionsStore.send({
|
|
440
|
-
type: "unregisterManyActions",
|
|
441
|
-
ids: actions.map(_temp5)
|
|
442
|
-
});
|
|
443
|
-
};
|
|
444
|
-
};
|
|
445
|
-
t6 = [
|
|
446
|
-
canDiscardChanges,
|
|
447
|
-
canPublish,
|
|
448
|
-
discardChanges.isPending,
|
|
449
|
-
hasLiveCheckpoint,
|
|
450
|
-
isHomePage,
|
|
451
|
-
publishLabel,
|
|
452
|
-
unpublishPage.isPending
|
|
453
|
-
];
|
|
454
|
-
$[11] = canDiscardChanges;
|
|
455
|
-
$[12] = canPublish;
|
|
456
|
-
$[13] = discardChanges.isPending;
|
|
457
|
-
$[14] = hasLiveCheckpoint;
|
|
458
|
-
$[15] = isHomePage;
|
|
459
|
-
$[16] = publishLabel;
|
|
460
|
-
$[17] = unpublishPage.isPending;
|
|
461
|
-
$[18] = t5;
|
|
462
|
-
$[19] = t6;
|
|
463
|
-
} else {
|
|
464
|
-
t5 = $[18];
|
|
465
|
-
t6 = $[19];
|
|
466
|
-
}
|
|
467
|
-
React.useEffect(t5, t6);
|
|
468
|
-
let t7;
|
|
469
|
-
if ($[20] !== isHomePage || $[21] !== page.id || $[22] !== pathname || $[23] !== queryClient || $[24] !== unpublishPage) {
|
|
470
|
-
t7 = async () => {
|
|
471
|
-
if (isHomePage) return;
|
|
472
|
-
try {
|
|
473
|
-
await unpublishPage.mutateAsync({ id: page.id });
|
|
474
|
-
queryClient.setQueryData(queryKeys.pages.getByPath(pathname, "draft"), _temp6);
|
|
475
|
-
queryClient.setQueryData(queryKeys.pages.list, (current_0) => current_0?.map((item) => item.id === page.id ? {
|
|
476
|
-
...item,
|
|
477
|
-
livePublishedCheckpointId: null,
|
|
478
|
-
status: "draft",
|
|
479
|
-
modifiedReason: null
|
|
480
|
-
} : item));
|
|
481
|
-
previewStore.send({
|
|
482
|
-
type: "setPreviewSource",
|
|
483
|
-
source: "draft"
|
|
484
|
-
});
|
|
485
|
-
trackClientEvent("page_unpublished", { pageId: page.id });
|
|
486
|
-
toast.success("Unpublished this page");
|
|
487
|
-
setIsUnpublishDialogOpen(false);
|
|
488
|
-
} catch (t8) {
|
|
489
|
-
console.error("Failed to unpublish page:", t8);
|
|
490
|
-
toast.error("Could not unpublish this page");
|
|
491
|
-
}
|
|
492
|
-
};
|
|
493
|
-
$[20] = isHomePage;
|
|
494
|
-
$[21] = page.id;
|
|
495
|
-
$[22] = pathname;
|
|
496
|
-
$[23] = queryClient;
|
|
497
|
-
$[24] = unpublishPage;
|
|
498
|
-
$[25] = t7;
|
|
499
|
-
} else t7 = $[25];
|
|
500
|
-
const handleUnpublish = t7;
|
|
501
|
-
let t8;
|
|
502
|
-
if ($[26] !== discardChanges || $[27] !== page.id) {
|
|
503
|
-
t8 = async () => {
|
|
504
|
-
try {
|
|
505
|
-
await discardChanges.mutateAsync({ id: page.id });
|
|
506
|
-
previewStore.send({
|
|
507
|
-
type: "setPreviewSource",
|
|
508
|
-
source: "draft"
|
|
509
|
-
});
|
|
510
|
-
trackClientEvent("page_changes_discarded", { pageId: page.id });
|
|
511
|
-
toast.success("Discarded draft changes");
|
|
512
|
-
setIsDiscardDialogOpen(false);
|
|
513
|
-
} catch (t9) {
|
|
514
|
-
console.error("Failed to discard page changes:", t9);
|
|
515
|
-
toast.error("Could not discard draft changes");
|
|
516
|
-
}
|
|
517
|
-
};
|
|
518
|
-
$[26] = discardChanges;
|
|
519
|
-
$[27] = page.id;
|
|
520
|
-
$[28] = t8;
|
|
521
|
-
} else t8 = $[28];
|
|
522
|
-
const handleDiscardChanges = t8;
|
|
523
|
-
const t9 = !canPublish;
|
|
524
|
-
let t10;
|
|
525
|
-
if ($[29] === Symbol.for("react.memo_cache_sentinel")) {
|
|
526
|
-
t10 = () => setIsPublishDialogOpen(true);
|
|
527
|
-
$[29] = t10;
|
|
528
|
-
} else t10 = $[29];
|
|
529
|
-
let t11;
|
|
530
|
-
if ($[30] !== publishLabel || $[31] !== t9) {
|
|
531
|
-
t11 = /* @__PURE__ */ jsx(Button, {
|
|
532
|
-
variant: "outline",
|
|
533
|
-
type: "button",
|
|
534
|
-
disabled: t9,
|
|
535
|
-
onClick: t10,
|
|
536
|
-
className: "flex-1",
|
|
537
|
-
children: publishLabel
|
|
538
|
-
});
|
|
539
|
-
$[30] = publishLabel;
|
|
540
|
-
$[31] = t9;
|
|
541
|
-
$[32] = t11;
|
|
542
|
-
} else t11 = $[32];
|
|
543
|
-
let t12;
|
|
544
|
-
if ($[33] === Symbol.for("react.memo_cache_sentinel")) {
|
|
545
|
-
t12 = /* @__PURE__ */ jsx(DropdownMenuTrigger, {
|
|
546
|
-
render: /* @__PURE__ */ jsx(Button, {
|
|
547
|
-
type: "button",
|
|
548
|
-
variant: "outline",
|
|
549
|
-
size: "icon",
|
|
550
|
-
"aria-label": "More publish actions"
|
|
551
|
-
}),
|
|
552
|
-
children: /* @__PURE__ */ jsx(MoreHorizontal, { className: "text-muted-foreground" })
|
|
553
|
-
});
|
|
554
|
-
$[33] = t12;
|
|
555
|
-
} else t12 = $[33];
|
|
556
|
-
const t13 = !hasLiveCheckpoint || isHomePage || unpublishPage.isPending;
|
|
557
|
-
let t14;
|
|
558
|
-
if ($[34] === Symbol.for("react.memo_cache_sentinel")) {
|
|
559
|
-
t14 = () => setIsUnpublishDialogOpen(true);
|
|
560
|
-
$[34] = t14;
|
|
561
|
-
} else t14 = $[34];
|
|
562
|
-
let t15;
|
|
563
|
-
if ($[35] !== t13) {
|
|
564
|
-
t15 = /* @__PURE__ */ jsx(DropdownMenuItem, {
|
|
565
|
-
disabled: t13,
|
|
566
|
-
onClick: t14,
|
|
567
|
-
children: "Unpublish"
|
|
568
|
-
});
|
|
569
|
-
$[35] = t13;
|
|
570
|
-
$[36] = t15;
|
|
571
|
-
} else t15 = $[36];
|
|
572
|
-
const t16 = !canDiscardChanges || discardChanges.isPending;
|
|
573
|
-
let t17;
|
|
574
|
-
if ($[37] === Symbol.for("react.memo_cache_sentinel")) {
|
|
575
|
-
t17 = () => setIsDiscardDialogOpen(true);
|
|
576
|
-
$[37] = t17;
|
|
577
|
-
} else t17 = $[37];
|
|
578
|
-
let t18;
|
|
579
|
-
if ($[38] !== t16) {
|
|
580
|
-
t18 = /* @__PURE__ */ jsx(DropdownMenuItem, {
|
|
581
|
-
disabled: t16,
|
|
582
|
-
onClick: t17,
|
|
583
|
-
children: "Discard changes"
|
|
584
|
-
});
|
|
585
|
-
$[38] = t16;
|
|
586
|
-
$[39] = t18;
|
|
587
|
-
} else t18 = $[39];
|
|
588
|
-
let t19;
|
|
589
|
-
if ($[40] !== t15 || $[41] !== t18) {
|
|
590
|
-
t19 = /* @__PURE__ */ jsxs(DropdownMenu, { children: [t12, /* @__PURE__ */ jsxs(DropdownMenuContent, {
|
|
591
|
-
align: "end",
|
|
592
|
-
className: "w-42",
|
|
593
|
-
children: [t15, t18]
|
|
594
|
-
})] });
|
|
595
|
-
$[40] = t15;
|
|
596
|
-
$[41] = t18;
|
|
597
|
-
$[42] = t19;
|
|
598
|
-
} else t19 = $[42];
|
|
599
|
-
let t20;
|
|
600
|
-
if ($[43] !== t11 || $[44] !== t19) {
|
|
601
|
-
t20 = /* @__PURE__ */ jsxs(ButtonGroup, {
|
|
602
|
-
className: "w-full",
|
|
603
|
-
children: [t11, t19]
|
|
604
|
-
});
|
|
605
|
-
$[43] = t11;
|
|
606
|
-
$[44] = t19;
|
|
607
|
-
$[45] = t20;
|
|
608
|
-
} else t20 = $[45];
|
|
609
|
-
const t21 = !hasLiveCheckpoint;
|
|
610
|
-
const t22 = previewSource === "draft";
|
|
611
|
-
let t23;
|
|
612
|
-
if ($[46] !== t21 || $[47] !== t22) {
|
|
613
|
-
t23 = /* @__PURE__ */ jsx(Switch, {
|
|
614
|
-
id: "draft-content",
|
|
615
|
-
disabled: t21,
|
|
616
|
-
checked: t22,
|
|
617
|
-
onCheckedChange: _temp7
|
|
618
|
-
});
|
|
619
|
-
$[46] = t21;
|
|
620
|
-
$[47] = t22;
|
|
621
|
-
$[48] = t23;
|
|
622
|
-
} else t23 = $[48];
|
|
623
|
-
let t24;
|
|
624
|
-
if ($[49] === Symbol.for("react.memo_cache_sentinel")) {
|
|
625
|
-
t24 = /* @__PURE__ */ jsx(Label, {
|
|
626
|
-
htmlFor: "draft-content",
|
|
627
|
-
children: "Draft content"
|
|
628
|
-
});
|
|
629
|
-
$[49] = t24;
|
|
630
|
-
} else t24 = $[49];
|
|
631
|
-
let t25;
|
|
632
|
-
if ($[50] !== prefetchOtherSource || $[51] !== t23) {
|
|
633
|
-
t25 = /* @__PURE__ */ jsxs("div", {
|
|
634
|
-
className: "mt-1 flex items-center gap-2",
|
|
635
|
-
onMouseEnter: prefetchOtherSource,
|
|
636
|
-
onFocus: prefetchOtherSource,
|
|
637
|
-
children: [t23, t24]
|
|
638
|
-
});
|
|
639
|
-
$[50] = prefetchOtherSource;
|
|
640
|
-
$[51] = t23;
|
|
641
|
-
$[52] = t25;
|
|
642
|
-
} else t25 = $[52];
|
|
643
|
-
let t26;
|
|
644
|
-
if ($[53] !== t20 || $[54] !== t25) {
|
|
645
|
-
t26 = /* @__PURE__ */ jsxs("div", {
|
|
646
|
-
className: "flex flex-col gap-2",
|
|
647
|
-
children: [t20, t25]
|
|
648
|
-
});
|
|
649
|
-
$[53] = t20;
|
|
650
|
-
$[54] = t25;
|
|
651
|
-
$[55] = t26;
|
|
652
|
-
} else t26 = $[55];
|
|
653
|
-
const t27 = isPublishDialogOpen ? page : null;
|
|
654
|
-
let t28;
|
|
655
|
-
if ($[56] !== isPublishDialogOpen || $[57] !== layoutCascade || $[58] !== page.status || $[59] !== t27) {
|
|
656
|
-
t28 = /* @__PURE__ */ jsx(PublishDialog, {
|
|
657
|
-
page: t27,
|
|
658
|
-
pageStatus: page.status,
|
|
659
|
-
alsoPublishLayout: layoutCascade,
|
|
660
|
-
open: isPublishDialogOpen,
|
|
661
|
-
onOpenChange: setIsPublishDialogOpen
|
|
662
|
-
});
|
|
663
|
-
$[56] = isPublishDialogOpen;
|
|
664
|
-
$[57] = layoutCascade;
|
|
665
|
-
$[58] = page.status;
|
|
666
|
-
$[59] = t27;
|
|
667
|
-
$[60] = t28;
|
|
668
|
-
} else t28 = $[60];
|
|
669
|
-
let t29;
|
|
670
|
-
if ($[61] === Symbol.for("react.memo_cache_sentinel")) {
|
|
671
|
-
t29 = /* @__PURE__ */ jsx(AlertDialogTitle, { children: "Unpublish page" });
|
|
672
|
-
$[61] = t29;
|
|
673
|
-
} else t29 = $[61];
|
|
674
|
-
let t30;
|
|
675
|
-
if ($[62] !== page.fullPath) {
|
|
676
|
-
t30 = /* @__PURE__ */ jsxs(AlertDialogHeader, { children: [t29, /* @__PURE__ */ jsxs(AlertDialogDescription, { children: [
|
|
677
|
-
"Visitors at",
|
|
678
|
-
" ",
|
|
679
|
-
/* @__PURE__ */ jsx("code", {
|
|
680
|
-
className: "bg-muted rounded px-1 py-0.5 font-mono text-xs",
|
|
681
|
-
children: page.fullPath
|
|
682
|
-
}),
|
|
683
|
-
" ",
|
|
684
|
-
"will get a 404. The draft stays available in Camox Studio."
|
|
685
|
-
] })] });
|
|
686
|
-
$[62] = page.fullPath;
|
|
687
|
-
$[63] = t30;
|
|
688
|
-
} else t30 = $[63];
|
|
689
|
-
let t31;
|
|
690
|
-
if ($[64] !== unpublishPage.isPending) {
|
|
691
|
-
t31 = /* @__PURE__ */ jsx(AlertDialogCancel, {
|
|
692
|
-
variant: "outline",
|
|
693
|
-
size: "default",
|
|
694
|
-
disabled: unpublishPage.isPending,
|
|
695
|
-
children: "Cancel"
|
|
696
|
-
});
|
|
697
|
-
$[64] = unpublishPage.isPending;
|
|
698
|
-
$[65] = t31;
|
|
699
|
-
} else t31 = $[65];
|
|
700
|
-
const t32 = isHomePage || unpublishPage.isPending;
|
|
701
|
-
const t33 = unpublishPage.isPending ? "Unpublishing…" : "Unpublish";
|
|
702
|
-
let t34;
|
|
703
|
-
if ($[66] !== handleUnpublish || $[67] !== t32 || $[68] !== t33) {
|
|
704
|
-
t34 = /* @__PURE__ */ jsx(AlertDialogAction, {
|
|
705
|
-
onClick: handleUnpublish,
|
|
706
|
-
disabled: t32,
|
|
707
|
-
children: t33
|
|
708
|
-
});
|
|
709
|
-
$[66] = handleUnpublish;
|
|
710
|
-
$[67] = t32;
|
|
711
|
-
$[68] = t33;
|
|
712
|
-
$[69] = t34;
|
|
713
|
-
} else t34 = $[69];
|
|
714
|
-
let t35;
|
|
715
|
-
if ($[70] !== t31 || $[71] !== t34) {
|
|
716
|
-
t35 = /* @__PURE__ */ jsxs(AlertDialogFooter, { children: [t31, t34] });
|
|
717
|
-
$[70] = t31;
|
|
718
|
-
$[71] = t34;
|
|
719
|
-
$[72] = t35;
|
|
720
|
-
} else t35 = $[72];
|
|
721
|
-
let t36;
|
|
722
|
-
if ($[73] !== t30 || $[74] !== t35) {
|
|
723
|
-
t36 = /* @__PURE__ */ jsxs(AlertDialogContent, { children: [t30, t35] });
|
|
724
|
-
$[73] = t30;
|
|
725
|
-
$[74] = t35;
|
|
726
|
-
$[75] = t36;
|
|
727
|
-
} else t36 = $[75];
|
|
728
|
-
let t37;
|
|
729
|
-
if ($[76] !== isUnpublishDialogOpen || $[77] !== t36) {
|
|
730
|
-
t37 = /* @__PURE__ */ jsx(AlertDialog, {
|
|
731
|
-
open: isUnpublishDialogOpen,
|
|
732
|
-
onOpenChange: setIsUnpublishDialogOpen,
|
|
733
|
-
children: t36
|
|
734
|
-
});
|
|
735
|
-
$[76] = isUnpublishDialogOpen;
|
|
736
|
-
$[77] = t36;
|
|
737
|
-
$[78] = t37;
|
|
738
|
-
} else t37 = $[78];
|
|
739
|
-
let t38;
|
|
740
|
-
if ($[79] === Symbol.for("react.memo_cache_sentinel")) {
|
|
741
|
-
t38 = /* @__PURE__ */ jsx(AlertDialogTitle, { children: "Discard draft changes" });
|
|
742
|
-
$[79] = t38;
|
|
743
|
-
} else t38 = $[79];
|
|
744
|
-
let t39;
|
|
745
|
-
if ($[80] !== page.fullPath) {
|
|
746
|
-
t39 = /* @__PURE__ */ jsxs(AlertDialogHeader, { children: [t38, /* @__PURE__ */ jsxs(AlertDialogDescription, { children: [
|
|
747
|
-
"The draft for",
|
|
748
|
-
" ",
|
|
749
|
-
/* @__PURE__ */ jsx("code", {
|
|
750
|
-
className: "bg-muted rounded px-1 py-0.5 font-mono text-xs",
|
|
751
|
-
children: page.fullPath
|
|
752
|
-
}),
|
|
753
|
-
" ",
|
|
754
|
-
"will be reset to match the currently published version. This does not change what visitors see."
|
|
755
|
-
] })] });
|
|
756
|
-
$[80] = page.fullPath;
|
|
757
|
-
$[81] = t39;
|
|
758
|
-
} else t39 = $[81];
|
|
759
|
-
let t40;
|
|
760
|
-
if ($[82] !== discardChanges.isPending) {
|
|
761
|
-
t40 = /* @__PURE__ */ jsx(AlertDialogCancel, {
|
|
762
|
-
variant: "outline",
|
|
763
|
-
size: "default",
|
|
764
|
-
disabled: discardChanges.isPending,
|
|
765
|
-
children: "Cancel"
|
|
766
|
-
});
|
|
767
|
-
$[82] = discardChanges.isPending;
|
|
768
|
-
$[83] = t40;
|
|
769
|
-
} else t40 = $[83];
|
|
770
|
-
const t41 = discardChanges.isPending ? "Discarding…" : "Discard changes";
|
|
771
|
-
let t42;
|
|
772
|
-
if ($[84] !== discardChanges.isPending || $[85] !== handleDiscardChanges || $[86] !== t41) {
|
|
773
|
-
t42 = /* @__PURE__ */ jsx(AlertDialogAction, {
|
|
774
|
-
onClick: handleDiscardChanges,
|
|
775
|
-
disabled: discardChanges.isPending,
|
|
776
|
-
children: t41
|
|
777
|
-
});
|
|
778
|
-
$[84] = discardChanges.isPending;
|
|
779
|
-
$[85] = handleDiscardChanges;
|
|
780
|
-
$[86] = t41;
|
|
781
|
-
$[87] = t42;
|
|
782
|
-
} else t42 = $[87];
|
|
783
|
-
let t43;
|
|
784
|
-
if ($[88] !== t40 || $[89] !== t42) {
|
|
785
|
-
t43 = /* @__PURE__ */ jsxs(AlertDialogFooter, { children: [t40, t42] });
|
|
786
|
-
$[88] = t40;
|
|
787
|
-
$[89] = t42;
|
|
788
|
-
$[90] = t43;
|
|
789
|
-
} else t43 = $[90];
|
|
790
|
-
let t44;
|
|
791
|
-
if ($[91] !== t39 || $[92] !== t43) {
|
|
792
|
-
t44 = /* @__PURE__ */ jsxs(AlertDialogContent, { children: [t39, t43] });
|
|
793
|
-
$[91] = t39;
|
|
794
|
-
$[92] = t43;
|
|
795
|
-
$[93] = t44;
|
|
796
|
-
} else t44 = $[93];
|
|
797
|
-
let t45;
|
|
798
|
-
if ($[94] !== isDiscardDialogOpen || $[95] !== t44) {
|
|
799
|
-
t45 = /* @__PURE__ */ jsx(AlertDialog, {
|
|
800
|
-
open: isDiscardDialogOpen,
|
|
801
|
-
onOpenChange: setIsDiscardDialogOpen,
|
|
802
|
-
children: t44
|
|
803
|
-
});
|
|
804
|
-
$[94] = isDiscardDialogOpen;
|
|
805
|
-
$[95] = t44;
|
|
806
|
-
$[96] = t45;
|
|
807
|
-
} else t45 = $[96];
|
|
808
|
-
let t46;
|
|
809
|
-
if ($[97] !== t26 || $[98] !== t28 || $[99] !== t37 || $[100] !== t45) {
|
|
810
|
-
t46 = /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
811
|
-
t26,
|
|
812
|
-
t28,
|
|
813
|
-
t37,
|
|
814
|
-
t45
|
|
815
|
-
] });
|
|
816
|
-
$[97] = t26;
|
|
817
|
-
$[98] = t28;
|
|
818
|
-
$[99] = t37;
|
|
819
|
-
$[100] = t45;
|
|
820
|
-
$[101] = t46;
|
|
821
|
-
} else t46 = $[101];
|
|
822
|
-
return t46;
|
|
823
|
-
};
|
|
824
296
|
function useHydrateDraftCache() {
|
|
825
297
|
const $ = c(7);
|
|
826
|
-
if ($[0] !== "
|
|
298
|
+
if ($[0] !== "368878cc357f559a41241bfa8387ebbcf6457dabf75b71445e9ead672ed8deb3") {
|
|
827
299
|
for (let $i = 0; $i < 7; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
|
|
828
|
-
$[0] = "
|
|
300
|
+
$[0] = "368878cc357f559a41241bfa8387ebbcf6457dabf75b71445e9ead672ed8deb3";
|
|
829
301
|
}
|
|
830
302
|
const isAuthenticated = useIsAuthenticated();
|
|
831
303
|
const queryClient = useQueryClient();
|
|
@@ -850,7 +322,7 @@ function useHydrateDraftCache() {
|
|
|
850
322
|
projectName: data.projectName,
|
|
851
323
|
project: data.project
|
|
852
324
|
});
|
|
853
|
-
}).catch(
|
|
325
|
+
}).catch(_temp4);
|
|
854
326
|
return () => {
|
|
855
327
|
cancelled = true;
|
|
856
328
|
};
|
|
@@ -873,53 +345,53 @@ function useHydrateDraftCache() {
|
|
|
873
345
|
}
|
|
874
346
|
React.useEffect(t0, t1);
|
|
875
347
|
}
|
|
876
|
-
function
|
|
348
|
+
function _temp4() {}
|
|
877
349
|
const CamoxPreview = (t0) => {
|
|
878
|
-
const $ = c(
|
|
879
|
-
if ($[0] !== "
|
|
880
|
-
for (let $i = 0; $i <
|
|
881
|
-
$[0] = "
|
|
350
|
+
const $ = c(35);
|
|
351
|
+
if ($[0] !== "368878cc357f559a41241bfa8387ebbcf6457dabf75b71445e9ead672ed8deb3") {
|
|
352
|
+
for (let $i = 0; $i < 35; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
|
|
353
|
+
$[0] = "368878cc357f559a41241bfa8387ebbcf6457dabf75b71445e9ead672ed8deb3";
|
|
882
354
|
}
|
|
883
355
|
const { children } = t0;
|
|
884
356
|
const isAuthenticated = useIsAuthenticated();
|
|
885
|
-
const
|
|
886
|
-
const
|
|
887
|
-
const previewSource = useSelector(previewStore, _temp1);
|
|
357
|
+
const isEditMode = useSelector(previewStore, _temp5);
|
|
358
|
+
const previewSource = useSelector(previewStore, _temp6);
|
|
888
359
|
const pageData = usePreviewedPage();
|
|
889
360
|
useHydrateDraftCache();
|
|
890
361
|
const hasLiveCheckpoint = pageData.page.livePublishedCheckpointId != null;
|
|
891
362
|
let t1;
|
|
892
363
|
let t2;
|
|
893
|
-
if ($[1] !== hasLiveCheckpoint || $[2] !== isAuthenticated || $[3] !==
|
|
364
|
+
if ($[1] !== hasLiveCheckpoint || $[2] !== isAuthenticated || $[3] !== isEditMode || $[4] !== previewSource) {
|
|
894
365
|
t1 = () => {
|
|
895
366
|
const actions = [
|
|
896
367
|
{
|
|
897
|
-
id: "
|
|
898
|
-
label: "
|
|
368
|
+
id: "exit-edit-mode",
|
|
369
|
+
label: "Exit edit mode",
|
|
899
370
|
aliases: [
|
|
371
|
+
"Hide Camox Studio",
|
|
900
372
|
"Hide studio",
|
|
901
373
|
"Preview only",
|
|
902
|
-
"
|
|
374
|
+
"View mode"
|
|
903
375
|
],
|
|
904
376
|
groupLabel: "Preview",
|
|
905
|
-
checkIfAvailable: () => isAuthenticated &&
|
|
906
|
-
execute:
|
|
377
|
+
checkIfAvailable: () => isAuthenticated && isEditMode,
|
|
378
|
+
execute: _temp7,
|
|
907
379
|
shortcut: {
|
|
908
380
|
key: "Enter",
|
|
909
381
|
withMeta: true
|
|
910
382
|
}
|
|
911
383
|
},
|
|
912
384
|
{
|
|
913
|
-
id: "
|
|
914
|
-
label: "
|
|
385
|
+
id: "enter-edit-mode",
|
|
386
|
+
label: "Enter edit mode",
|
|
915
387
|
aliases: [
|
|
388
|
+
"Show Camox Studio",
|
|
916
389
|
"Show studio",
|
|
917
|
-
"Exit presentation",
|
|
918
390
|
"Edit mode"
|
|
919
391
|
],
|
|
920
392
|
groupLabel: "Preview",
|
|
921
|
-
checkIfAvailable: () => isAuthenticated &&
|
|
922
|
-
execute:
|
|
393
|
+
checkIfAvailable: () => isAuthenticated && !isEditMode,
|
|
394
|
+
execute: _temp8,
|
|
923
395
|
shortcut: {
|
|
924
396
|
key: "Enter",
|
|
925
397
|
withMeta: true
|
|
@@ -935,7 +407,7 @@ const CamoxPreview = (t0) => {
|
|
|
935
407
|
],
|
|
936
408
|
groupLabel: "Preview",
|
|
937
409
|
checkIfAvailable: () => isAuthenticated && previewSource === "draft" && hasLiveCheckpoint,
|
|
938
|
-
execute:
|
|
410
|
+
execute: _temp9,
|
|
939
411
|
shortcut: {
|
|
940
412
|
key: "d",
|
|
941
413
|
withAlt: true
|
|
@@ -951,7 +423,7 @@ const CamoxPreview = (t0) => {
|
|
|
951
423
|
],
|
|
952
424
|
groupLabel: "Preview",
|
|
953
425
|
checkIfAvailable: () => isAuthenticated && previewSource === "live",
|
|
954
|
-
execute:
|
|
426
|
+
execute: _temp0,
|
|
955
427
|
shortcut: {
|
|
956
428
|
key: "d",
|
|
957
429
|
withAlt: true
|
|
@@ -962,8 +434,8 @@ const CamoxPreview = (t0) => {
|
|
|
962
434
|
label: "Clear selection",
|
|
963
435
|
aliases: ["Deselect", "Unselect"],
|
|
964
436
|
groupLabel: "Preview",
|
|
965
|
-
checkIfAvailable:
|
|
966
|
-
execute:
|
|
437
|
+
checkIfAvailable: _temp1,
|
|
438
|
+
execute: _temp10,
|
|
967
439
|
shortcut: { key: "Escape" }
|
|
968
440
|
}
|
|
969
441
|
];
|
|
@@ -974,19 +446,19 @@ const CamoxPreview = (t0) => {
|
|
|
974
446
|
return () => {
|
|
975
447
|
actionsStore.send({
|
|
976
448
|
type: "unregisterManyActions",
|
|
977
|
-
ids: actions.map(
|
|
449
|
+
ids: actions.map(_temp11)
|
|
978
450
|
});
|
|
979
451
|
};
|
|
980
452
|
};
|
|
981
453
|
t2 = [
|
|
982
|
-
|
|
454
|
+
isEditMode,
|
|
983
455
|
isAuthenticated,
|
|
984
456
|
previewSource,
|
|
985
457
|
hasLiveCheckpoint
|
|
986
458
|
];
|
|
987
459
|
$[1] = hasLiveCheckpoint;
|
|
988
460
|
$[2] = isAuthenticated;
|
|
989
|
-
$[3] =
|
|
461
|
+
$[3] = isEditMode;
|
|
990
462
|
$[4] = previewSource;
|
|
991
463
|
$[5] = t1;
|
|
992
464
|
$[6] = t2;
|
|
@@ -995,141 +467,103 @@ const CamoxPreview = (t0) => {
|
|
|
995
467
|
t2 = $[6];
|
|
996
468
|
}
|
|
997
469
|
React.useEffect(t1, t2);
|
|
998
|
-
if (
|
|
470
|
+
if (!isAuthenticated) {
|
|
999
471
|
let t3;
|
|
1000
472
|
if ($[7] !== children) {
|
|
1001
|
-
t3 = /* @__PURE__ */ jsx(
|
|
1002
|
-
className: "h-screen w-full",
|
|
1003
|
-
children
|
|
1004
|
-
});
|
|
473
|
+
t3 = /* @__PURE__ */ jsx(Fragment, { children });
|
|
1005
474
|
$[7] = children;
|
|
1006
475
|
$[8] = t3;
|
|
1007
476
|
} else t3 = $[8];
|
|
1008
477
|
return t3;
|
|
1009
478
|
}
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
if ($[9] !== children) {
|
|
1013
|
-
t3 = /* @__PURE__ */ jsx(Fragment, { children });
|
|
1014
|
-
$[9] = children;
|
|
1015
|
-
$[10] = t3;
|
|
1016
|
-
} else t3 = $[10];
|
|
1017
|
-
return t3;
|
|
1018
|
-
}
|
|
1019
|
-
let t3;
|
|
1020
|
-
if ($[11] === Symbol.for("react.memo_cache_sentinel")) {
|
|
1021
|
-
t3 = /* @__PURE__ */ jsx(Navbar, {});
|
|
1022
|
-
$[11] = t3;
|
|
1023
|
-
} else t3 = $[11];
|
|
479
|
+
const shouldShowStudioChrome = isEditMode;
|
|
480
|
+
const t3 = !isEditMode && "bg-black";
|
|
1024
481
|
let t4;
|
|
1025
|
-
if ($[
|
|
1026
|
-
t4 =
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
children: [/* @__PURE__ */ jsxs(ButtonGroup, {
|
|
1031
|
-
className: "w-full",
|
|
1032
|
-
children: [/* @__PURE__ */ jsx(PagePicker, {}), /* @__PURE__ */ jsxs(Tooltip, { children: [/* @__PURE__ */ jsx(TooltipTrigger, {
|
|
1033
|
-
render: /* @__PURE__ */ jsx(Button, {
|
|
1034
|
-
type: "button",
|
|
1035
|
-
variant: "outline",
|
|
1036
|
-
size: "icon",
|
|
1037
|
-
onClick: () => previewStore.send({
|
|
1038
|
-
type: "openEditPageModal",
|
|
1039
|
-
pageId: pageData.page.id
|
|
1040
|
-
})
|
|
1041
|
-
}),
|
|
1042
|
-
children: /* @__PURE__ */ jsx(Info, { className: "text-muted-foreground size-4" })
|
|
1043
|
-
}), /* @__PURE__ */ jsx(TooltipContent, { children: "Page metadata" })] })]
|
|
1044
|
-
}), /* @__PURE__ */ jsx(SidebarPublishRow, { page: pageData.page })]
|
|
1045
|
-
}), /* @__PURE__ */ jsx(PanelContent, {
|
|
1046
|
-
className: "flex grow basis-0 flex-col gap-2 overflow-auto p-2",
|
|
1047
|
-
children: /* @__PURE__ */ jsx(PageTree, {})
|
|
1048
|
-
})]
|
|
1049
|
-
});
|
|
1050
|
-
$[12] = isSidebarOpen;
|
|
1051
|
-
$[13] = pageData.page;
|
|
1052
|
-
$[14] = t4;
|
|
1053
|
-
} else t4 = $[14];
|
|
482
|
+
if ($[9] !== t3) {
|
|
483
|
+
t4 = cn("bg-background flex h-screen flex-col overflow-hidden", t3);
|
|
484
|
+
$[9] = t3;
|
|
485
|
+
$[10] = t4;
|
|
486
|
+
} else t4 = $[10];
|
|
1054
487
|
let t5;
|
|
1055
|
-
if ($[
|
|
1056
|
-
t5 =
|
|
488
|
+
if ($[11] !== shouldShowStudioChrome) {
|
|
489
|
+
t5 = shouldShowStudioChrome && /* @__PURE__ */ jsx(Navbar, {});
|
|
490
|
+
$[11] = shouldShowStudioChrome;
|
|
491
|
+
$[12] = t5;
|
|
492
|
+
} else t5 = $[12];
|
|
493
|
+
let t6;
|
|
494
|
+
if ($[13] !== pageData.page || $[14] !== shouldShowStudioChrome) {
|
|
495
|
+
t6 = shouldShowStudioChrome && /* @__PURE__ */ jsx(LeftSidebar, { page: pageData.page });
|
|
496
|
+
$[13] = pageData.page;
|
|
497
|
+
$[14] = shouldShowStudioChrome;
|
|
498
|
+
$[15] = t6;
|
|
499
|
+
} else t6 = $[15];
|
|
500
|
+
let t7;
|
|
501
|
+
if ($[16] !== shouldShowStudioChrome) {
|
|
502
|
+
t7 = shouldShowStudioChrome && /* @__PURE__ */ jsx("div", { style: {
|
|
1057
503
|
height: "80px",
|
|
1058
504
|
background: "transparent"
|
|
1059
505
|
} });
|
|
1060
|
-
$[
|
|
1061
|
-
$[
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
t6 = /* @__PURE__ */ jsxs(PreviewPanel, { children: [children, t5] });
|
|
506
|
+
$[16] = shouldShowStudioChrome;
|
|
507
|
+
$[17] = t7;
|
|
508
|
+
} else t7 = $[17];
|
|
509
|
+
let t8;
|
|
510
|
+
if ($[18] !== children || $[19] !== t7) {
|
|
511
|
+
t8 = /* @__PURE__ */ jsxs(PreviewPanel, { children: [children, t7] });
|
|
1067
512
|
$[18] = children;
|
|
1068
|
-
$[19] =
|
|
1069
|
-
$[20] =
|
|
1070
|
-
} else
|
|
1071
|
-
let
|
|
1072
|
-
if ($[21] !==
|
|
1073
|
-
|
|
513
|
+
$[19] = t7;
|
|
514
|
+
$[20] = t8;
|
|
515
|
+
} else t8 = $[20];
|
|
516
|
+
let t9;
|
|
517
|
+
if ($[21] !== pageData.page.id || $[22] !== shouldShowStudioChrome) {
|
|
518
|
+
t9 = shouldShowStudioChrome && /* @__PURE__ */ jsx(RightSidebar, { pageId: pageData.page.id });
|
|
519
|
+
$[21] = pageData.page.id;
|
|
520
|
+
$[22] = shouldShowStudioChrome;
|
|
521
|
+
$[23] = t9;
|
|
522
|
+
} else t9 = $[23];
|
|
523
|
+
let t10;
|
|
524
|
+
if ($[24] !== t6 || $[25] !== t8 || $[26] !== t9) {
|
|
525
|
+
t10 = /* @__PURE__ */ jsxs("div", {
|
|
1074
526
|
className: "flex h-full flex-row items-stretch",
|
|
1075
|
-
children: [
|
|
527
|
+
children: [
|
|
528
|
+
t6,
|
|
529
|
+
t8,
|
|
530
|
+
t9
|
|
531
|
+
]
|
|
1076
532
|
});
|
|
1077
|
-
$[
|
|
1078
|
-
$[
|
|
1079
|
-
$[
|
|
1080
|
-
|
|
1081
|
-
|
|
533
|
+
$[24] = t6;
|
|
534
|
+
$[25] = t8;
|
|
535
|
+
$[26] = t9;
|
|
536
|
+
$[27] = t10;
|
|
537
|
+
} else t10 = $[27];
|
|
1082
538
|
let t11;
|
|
539
|
+
if ($[28] !== shouldShowStudioChrome) {
|
|
540
|
+
t11 = shouldShowStudioChrome && /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(CreatePageModal, {}), /* @__PURE__ */ jsx(DraftSwitchDialog, {})] });
|
|
541
|
+
$[28] = shouldShowStudioChrome;
|
|
542
|
+
$[29] = t11;
|
|
543
|
+
} else t11 = $[29];
|
|
1083
544
|
let t12;
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
if ($[24] === Symbol.for("react.memo_cache_sentinel")) {
|
|
1088
|
-
t8 = /* @__PURE__ */ jsx(PageContentSheet, {});
|
|
1089
|
-
t9 = /* @__PURE__ */ jsx(AddBlockSheet, {});
|
|
1090
|
-
t10 = /* @__PURE__ */ jsx(AgentChatSheet, {});
|
|
1091
|
-
t11 = /* @__PURE__ */ jsx(CreatePageModal, {});
|
|
1092
|
-
t12 = /* @__PURE__ */ jsx(PageMetadataModal, {});
|
|
1093
|
-
t13 = /* @__PURE__ */ jsx(DraftSwitchDialog, {});
|
|
1094
|
-
$[24] = t10;
|
|
1095
|
-
$[25] = t11;
|
|
1096
|
-
$[26] = t12;
|
|
1097
|
-
$[27] = t13;
|
|
1098
|
-
$[28] = t8;
|
|
1099
|
-
$[29] = t9;
|
|
1100
|
-
} else {
|
|
1101
|
-
t10 = $[24];
|
|
1102
|
-
t11 = $[25];
|
|
1103
|
-
t12 = $[26];
|
|
1104
|
-
t13 = $[27];
|
|
1105
|
-
t8 = $[28];
|
|
1106
|
-
t9 = $[29];
|
|
1107
|
-
}
|
|
1108
|
-
let t14;
|
|
1109
|
-
if ($[30] !== t7) {
|
|
1110
|
-
t14 = /* @__PURE__ */ jsxs("div", {
|
|
1111
|
-
className: "bg-background flex h-screen flex-col overflow-hidden",
|
|
545
|
+
if ($[30] !== t10 || $[31] !== t11 || $[32] !== t4 || $[33] !== t5) {
|
|
546
|
+
t12 = /* @__PURE__ */ jsxs("div", {
|
|
547
|
+
className: t4,
|
|
1112
548
|
children: [
|
|
1113
|
-
|
|
1114
|
-
t7,
|
|
1115
|
-
t8,
|
|
1116
|
-
t9,
|
|
549
|
+
t5,
|
|
1117
550
|
t10,
|
|
1118
|
-
t11
|
|
1119
|
-
t12,
|
|
1120
|
-
t13
|
|
551
|
+
t11
|
|
1121
552
|
]
|
|
1122
553
|
});
|
|
1123
|
-
$[30] =
|
|
1124
|
-
$[31] =
|
|
1125
|
-
|
|
1126
|
-
|
|
554
|
+
$[30] = t10;
|
|
555
|
+
$[31] = t11;
|
|
556
|
+
$[32] = t4;
|
|
557
|
+
$[33] = t5;
|
|
558
|
+
$[34] = t12;
|
|
559
|
+
} else t12 = $[34];
|
|
560
|
+
return t12;
|
|
1127
561
|
};
|
|
1128
562
|
function usePreviewPagesActions() {
|
|
1129
563
|
const $ = c(13);
|
|
1130
|
-
if ($[0] !== "
|
|
564
|
+
if ($[0] !== "368878cc357f559a41241bfa8387ebbcf6457dabf75b71445e9ead672ed8deb3") {
|
|
1131
565
|
for (let $i = 0; $i < 13; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
|
|
1132
|
-
$[0] = "
|
|
566
|
+
$[0] = "368878cc357f559a41241bfa8387ebbcf6457dabf75b71445e9ead672ed8deb3";
|
|
1133
567
|
}
|
|
1134
568
|
const navigate = useNavigate();
|
|
1135
569
|
const { pathname } = useLocation();
|
|
@@ -1170,8 +604,8 @@ function usePreviewPagesActions() {
|
|
|
1170
604
|
label: "Create page",
|
|
1171
605
|
aliases: ["New page", "Add page"],
|
|
1172
606
|
groupLabel: "Preview",
|
|
1173
|
-
checkIfAvailable:
|
|
1174
|
-
execute:
|
|
607
|
+
checkIfAvailable: _temp12,
|
|
608
|
+
execute: _temp13
|
|
1175
609
|
},
|
|
1176
610
|
{
|
|
1177
611
|
id: "edit-current-page",
|
|
@@ -1202,14 +636,14 @@ function usePreviewPagesActions() {
|
|
|
1202
636
|
groupLabel: "Preview",
|
|
1203
637
|
checkIfAvailable: () => !!pages,
|
|
1204
638
|
hasChildren: true,
|
|
1205
|
-
execute:
|
|
639
|
+
execute: _temp14
|
|
1206
640
|
},
|
|
1207
641
|
...pages ? pages.map((page) => ({
|
|
1208
642
|
id: `go-to-page-${page.id}`,
|
|
1209
643
|
parentActionId: "go-to-page",
|
|
1210
644
|
label: `Go to "${page.nickname}"`,
|
|
1211
645
|
groupLabel: "Preview",
|
|
1212
|
-
checkIfAvailable:
|
|
646
|
+
checkIfAvailable: _temp15,
|
|
1213
647
|
execute: () => navigate({ to: page.fullPath })
|
|
1214
648
|
})) : []
|
|
1215
649
|
];
|
|
@@ -1220,7 +654,7 @@ function usePreviewPagesActions() {
|
|
|
1220
654
|
return () => {
|
|
1221
655
|
actionsStore.send({
|
|
1222
656
|
type: "unregisterManyActions",
|
|
1223
|
-
ids: actions.map(
|
|
657
|
+
ids: actions.map(_temp16)
|
|
1224
658
|
});
|
|
1225
659
|
};
|
|
1226
660
|
};
|
|
@@ -1240,79 +674,53 @@ function usePreviewPagesActions() {
|
|
|
1240
674
|
}
|
|
1241
675
|
React.useEffect(t4, t5);
|
|
1242
676
|
}
|
|
1243
|
-
function
|
|
677
|
+
function _temp16(a) {
|
|
1244
678
|
return a.id;
|
|
1245
679
|
}
|
|
1246
|
-
function
|
|
680
|
+
function _temp15() {
|
|
1247
681
|
return true;
|
|
1248
682
|
}
|
|
1249
|
-
function
|
|
1250
|
-
function
|
|
683
|
+
function _temp14() {}
|
|
684
|
+
function _temp13() {
|
|
1251
685
|
return previewStore.send({ type: "openCreatePageModal" });
|
|
1252
686
|
}
|
|
1253
|
-
function
|
|
687
|
+
function _temp12() {
|
|
1254
688
|
return true;
|
|
1255
689
|
}
|
|
1256
690
|
function _temp3(state) {
|
|
1257
691
|
return state.context.previewSource;
|
|
1258
692
|
}
|
|
1259
|
-
function
|
|
1260
|
-
return state.context.
|
|
1261
|
-
}
|
|
1262
|
-
function _temp5(action) {
|
|
1263
|
-
return action.id;
|
|
1264
|
-
}
|
|
1265
|
-
function _temp6(current) {
|
|
1266
|
-
return current ? {
|
|
1267
|
-
...current,
|
|
1268
|
-
page: {
|
|
1269
|
-
...current.page,
|
|
1270
|
-
livePublishedCheckpointId: null,
|
|
1271
|
-
status: "draft",
|
|
1272
|
-
modifiedReason: null
|
|
1273
|
-
}
|
|
1274
|
-
} : current;
|
|
1275
|
-
}
|
|
1276
|
-
function _temp7(checked) {
|
|
1277
|
-
previewStore.send({
|
|
1278
|
-
type: "setPreviewSource",
|
|
1279
|
-
source: checked ? "draft" : "live"
|
|
1280
|
-
});
|
|
1281
|
-
}
|
|
1282
|
-
function _temp9(state) {
|
|
1283
|
-
return state.context.isPresentationMode;
|
|
693
|
+
function _temp5(state) {
|
|
694
|
+
return state.context.isEditMode;
|
|
1284
695
|
}
|
|
1285
|
-
function
|
|
1286
|
-
return state_0.context.
|
|
1287
|
-
}
|
|
1288
|
-
function _temp1(state_1) {
|
|
1289
|
-
return state_1.context.previewSource;
|
|
696
|
+
function _temp6(state_0) {
|
|
697
|
+
return state_0.context.previewSource;
|
|
1290
698
|
}
|
|
1291
|
-
function
|
|
1292
|
-
return previewStore.send({ type: "
|
|
699
|
+
function _temp7() {
|
|
700
|
+
return previewStore.send({ type: "exitEditMode" });
|
|
1293
701
|
}
|
|
1294
|
-
function
|
|
1295
|
-
return previewStore.send({ type: "
|
|
702
|
+
function _temp8() {
|
|
703
|
+
return previewStore.send({ type: "enterEditMode" });
|
|
1296
704
|
}
|
|
1297
|
-
function
|
|
705
|
+
function _temp9() {
|
|
1298
706
|
return previewStore.send({
|
|
1299
707
|
type: "setPreviewSource",
|
|
1300
708
|
source: "live"
|
|
1301
709
|
});
|
|
1302
710
|
}
|
|
1303
|
-
function
|
|
711
|
+
function _temp0() {
|
|
1304
712
|
return previewStore.send({
|
|
1305
713
|
type: "setPreviewSource",
|
|
1306
714
|
source: "draft"
|
|
1307
715
|
});
|
|
1308
716
|
}
|
|
1309
|
-
function
|
|
717
|
+
function _temp1() {
|
|
1310
718
|
return true;
|
|
1311
719
|
}
|
|
1312
|
-
function
|
|
1313
|
-
|
|
720
|
+
function _temp10() {
|
|
721
|
+
previewStore.send({ type: "clearSelection" });
|
|
1314
722
|
}
|
|
1315
|
-
function
|
|
723
|
+
function _temp11(a) {
|
|
1316
724
|
return a.id;
|
|
1317
725
|
}
|
|
1318
726
|
|