camox 0.39.0 → 0.40.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/features/preview/CamoxPreview.js +202 -151
- package/dist/features/preview/components/MobilePreviewDrawer.js +303 -0
- package/dist/features/preview/components/PageInfoSidebar.js +283 -246
- package/dist/features/preview/components/PageNavigatorSidebar.js +46 -37
- package/dist/features/preview/components/PreviewPanel.js +93 -48
- package/dist/features/provider/AuthenticatedCamoxProvider.js +1 -1
- package/dist/features/studio/CamoxStudio.js +1 -1
- package/dist/features/studio/components/ProjectMenu.js +4 -4
- package/dist/features/studio/components/UserButton.js +21 -3
- package/dist/studio.css +1 -1
- package/package.json +4 -4
|
@@ -7,8 +7,8 @@ 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 { Navbar } from "../studio/components/Navbar.js";
|
|
11
10
|
import { previewStore } from "./previewStore.js";
|
|
11
|
+
import { Navbar } from "../studio/components/Navbar.js";
|
|
12
12
|
import { CreatePageModal } from "./components/CreatePageModal.js";
|
|
13
13
|
import { DraftSwitchDialog } from "./components/DraftSwitchDialog.js";
|
|
14
14
|
import { LeftSidebar } from "./components/LeftSidebar.js";
|
|
@@ -24,6 +24,23 @@ import { useSelector } from "@xstate/store-react";
|
|
|
24
24
|
import { queryKeys } from "@camox/api-contract/query-keys";
|
|
25
25
|
|
|
26
26
|
//#region src/features/preview/CamoxPreview.tsx
|
|
27
|
+
const MOBILE_STUDIO_QUERY = "(max-width: 767px)";
|
|
28
|
+
function subscribeToMobileStudio(callback) {
|
|
29
|
+
const mediaQuery = window.matchMedia(MOBILE_STUDIO_QUERY);
|
|
30
|
+
mediaQuery.addEventListener("change", callback);
|
|
31
|
+
return () => mediaQuery.removeEventListener("change", callback);
|
|
32
|
+
}
|
|
33
|
+
function getMobileStudioSnapshot() {
|
|
34
|
+
return window.matchMedia(MOBILE_STUDIO_QUERY).matches;
|
|
35
|
+
}
|
|
36
|
+
function useIsMobileStudio() {
|
|
37
|
+
const $ = c(1);
|
|
38
|
+
if ($[0] !== "29f1dc43006b541048efc4a08454742012d6157baa9fc62d4636c9c9d20b2ab3") {
|
|
39
|
+
for (let $i = 0; $i < 1; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
|
|
40
|
+
$[0] = "29f1dc43006b541048efc4a08454742012d6157baa9fc62d4636c9c9d20b2ab3";
|
|
41
|
+
}
|
|
42
|
+
return React.useSyncExternalStore(subscribeToMobileStudio, getMobileStudioSnapshot, _temp);
|
|
43
|
+
}
|
|
27
44
|
/**
|
|
28
45
|
* Fetches the current page being previewed, with live updates for authenticated users.
|
|
29
46
|
* Also will switch to peeked page data if there is one.
|
|
@@ -42,6 +59,9 @@ import { queryKeys } from "@camox/api-contract/query-keys";
|
|
|
42
59
|
* this query function doesn't run for them — they stay on the SSR-seeded
|
|
43
60
|
* 'live' data.
|
|
44
61
|
*/
|
|
62
|
+
function _temp() {
|
|
63
|
+
return false;
|
|
64
|
+
}
|
|
45
65
|
function pageStructureQueryFn(path, projectSlug, source) {
|
|
46
66
|
return () => getApiClient().pages.getStructure({
|
|
47
67
|
path,
|
|
@@ -51,15 +71,15 @@ function pageStructureQueryFn(path, projectSlug, source) {
|
|
|
51
71
|
}
|
|
52
72
|
function usePreviewedPage() {
|
|
53
73
|
const $ = c(26);
|
|
54
|
-
if ($[0] !== "
|
|
74
|
+
if ($[0] !== "29f1dc43006b541048efc4a08454742012d6157baa9fc62d4636c9c9d20b2ab3") {
|
|
55
75
|
for (let $i = 0; $i < 26; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
|
|
56
|
-
$[0] = "
|
|
76
|
+
$[0] = "29f1dc43006b541048efc4a08454742012d6157baa9fc62d4636c9c9d20b2ab3";
|
|
57
77
|
}
|
|
58
78
|
const { pathname } = useLocation();
|
|
59
79
|
const queryClient = useQueryClient();
|
|
60
80
|
const projectSlug = useProjectSlug();
|
|
61
|
-
const peekedPagePathname = useSelector(previewStore,
|
|
62
|
-
const previewSource = useSelector(previewStore,
|
|
81
|
+
const peekedPagePathname = useSelector(previewStore, _temp2);
|
|
82
|
+
const previewSource = useSelector(previewStore, _temp3);
|
|
63
83
|
const prevPathnameRef = React.useRef(pathname);
|
|
64
84
|
let t0;
|
|
65
85
|
let t1;
|
|
@@ -142,20 +162,20 @@ function usePreviewedPage() {
|
|
|
142
162
|
const { data: peekedPage } = useQuery(t9);
|
|
143
163
|
return peekedPagePathname ? peekedPage ?? currentPage : currentPage;
|
|
144
164
|
}
|
|
145
|
-
function
|
|
165
|
+
function _temp3(state_0) {
|
|
146
166
|
return state_0.context.previewSource;
|
|
147
167
|
}
|
|
148
|
-
function
|
|
168
|
+
function _temp2(state) {
|
|
149
169
|
return state.context.peekedPagePathname;
|
|
150
170
|
}
|
|
151
171
|
const BlockRenderer = (t0) => {
|
|
152
172
|
const $ = c(23);
|
|
153
|
-
if ($[0] !== "
|
|
173
|
+
if ($[0] !== "29f1dc43006b541048efc4a08454742012d6157baa9fc62d4636c9c9d20b2ab3") {
|
|
154
174
|
for (let $i = 0; $i < 23; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
|
|
155
|
-
$[0] = "
|
|
175
|
+
$[0] = "29f1dc43006b541048efc4a08454742012d6157baa9fc62d4636c9c9d20b2ab3";
|
|
156
176
|
}
|
|
157
177
|
const { blockId, mode, showAddBlockTop, showAddBlockBottom } = t0;
|
|
158
|
-
const previewSource = useSelector(previewStore,
|
|
178
|
+
const previewSource = useSelector(previewStore, _temp4);
|
|
159
179
|
let t1;
|
|
160
180
|
if ($[1] !== blockId || $[2] !== previewSource) {
|
|
161
181
|
t1 = blockQueries.get(blockId, previewSource);
|
|
@@ -295,9 +315,9 @@ const PageContent = () => {
|
|
|
295
315
|
};
|
|
296
316
|
function useHydrateDraftCache() {
|
|
297
317
|
const $ = c(7);
|
|
298
|
-
if ($[0] !== "
|
|
318
|
+
if ($[0] !== "29f1dc43006b541048efc4a08454742012d6157baa9fc62d4636c9c9d20b2ab3") {
|
|
299
319
|
for (let $i = 0; $i < 7; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
|
|
300
|
-
$[0] = "
|
|
320
|
+
$[0] = "29f1dc43006b541048efc4a08454742012d6157baa9fc62d4636c9c9d20b2ab3";
|
|
301
321
|
}
|
|
302
322
|
const isAuthenticated = useIsAuthenticated();
|
|
303
323
|
const queryClient = useQueryClient();
|
|
@@ -322,7 +342,7 @@ function useHydrateDraftCache() {
|
|
|
322
342
|
projectName: data.projectName,
|
|
323
343
|
project: data.project
|
|
324
344
|
});
|
|
325
|
-
}).catch(
|
|
345
|
+
}).catch(_temp5);
|
|
326
346
|
return () => {
|
|
327
347
|
cancelled = true;
|
|
328
348
|
};
|
|
@@ -345,26 +365,44 @@ function useHydrateDraftCache() {
|
|
|
345
365
|
}
|
|
346
366
|
React.useEffect(t0, t1);
|
|
347
367
|
}
|
|
348
|
-
function
|
|
368
|
+
function _temp5() {}
|
|
349
369
|
const CamoxPreview = (t0) => {
|
|
350
|
-
const $ = c(
|
|
351
|
-
if ($[0] !== "
|
|
352
|
-
for (let $i = 0; $i <
|
|
353
|
-
$[0] = "
|
|
370
|
+
const $ = c(52);
|
|
371
|
+
if ($[0] !== "29f1dc43006b541048efc4a08454742012d6157baa9fc62d4636c9c9d20b2ab3") {
|
|
372
|
+
for (let $i = 0; $i < 52; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
|
|
373
|
+
$[0] = "29f1dc43006b541048efc4a08454742012d6157baa9fc62d4636c9c9d20b2ab3";
|
|
354
374
|
}
|
|
355
375
|
const { children } = t0;
|
|
356
376
|
const isAuthenticated = useIsAuthenticated();
|
|
357
|
-
const
|
|
358
|
-
const
|
|
359
|
-
const
|
|
360
|
-
const
|
|
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);
|
|
361
382
|
const pageData = usePreviewedPage();
|
|
362
383
|
useHydrateDraftCache();
|
|
363
384
|
const hasLiveCheckpoint = pageData.page.livePublishedCheckpointId != null;
|
|
364
385
|
let t1;
|
|
365
386
|
let t2;
|
|
366
|
-
if ($[1] !==
|
|
387
|
+
if ($[1] !== isMobileStudio) {
|
|
367
388
|
t1 = () => {
|
|
389
|
+
if (!isMobileStudio) return;
|
|
390
|
+
previewStore.send({ type: "exitEditMode" });
|
|
391
|
+
previewStore.send({ type: "closeAddBlockSidebar" });
|
|
392
|
+
};
|
|
393
|
+
t2 = [isMobileStudio];
|
|
394
|
+
$[1] = isMobileStudio;
|
|
395
|
+
$[2] = t1;
|
|
396
|
+
$[3] = t2;
|
|
397
|
+
} else {
|
|
398
|
+
t1 = $[2];
|
|
399
|
+
t2 = $[3];
|
|
400
|
+
}
|
|
401
|
+
React.useEffect(t1, t2);
|
|
402
|
+
let t3;
|
|
403
|
+
let t4;
|
|
404
|
+
if ($[4] !== hasLiveCheckpoint || $[5] !== isAuthenticated || $[6] !== isEditMode || $[7] !== isMobileStudio || $[8] !== previewSource) {
|
|
405
|
+
t3 = () => {
|
|
368
406
|
const actions = [
|
|
369
407
|
{
|
|
370
408
|
id: "exit-edit-mode",
|
|
@@ -377,7 +415,7 @@ const CamoxPreview = (t0) => {
|
|
|
377
415
|
],
|
|
378
416
|
groupLabel: "Preview",
|
|
379
417
|
checkIfAvailable: () => isAuthenticated && isEditMode,
|
|
380
|
-
execute:
|
|
418
|
+
execute: _temp0,
|
|
381
419
|
shortcut: {
|
|
382
420
|
key: "Enter",
|
|
383
421
|
withMeta: true
|
|
@@ -392,8 +430,8 @@ const CamoxPreview = (t0) => {
|
|
|
392
430
|
"Edit mode"
|
|
393
431
|
],
|
|
394
432
|
groupLabel: "Preview",
|
|
395
|
-
checkIfAvailable: () => isAuthenticated && !isEditMode,
|
|
396
|
-
execute:
|
|
433
|
+
checkIfAvailable: () => isAuthenticated && !isEditMode && !isMobileStudio,
|
|
434
|
+
execute: _temp1,
|
|
397
435
|
shortcut: {
|
|
398
436
|
key: "Enter",
|
|
399
437
|
withMeta: true
|
|
@@ -409,7 +447,7 @@ const CamoxPreview = (t0) => {
|
|
|
409
447
|
],
|
|
410
448
|
groupLabel: "Preview",
|
|
411
449
|
checkIfAvailable: () => isAuthenticated && previewSource === "draft" && hasLiveCheckpoint,
|
|
412
|
-
execute:
|
|
450
|
+
execute: _temp10,
|
|
413
451
|
shortcut: {
|
|
414
452
|
key: "d",
|
|
415
453
|
withAlt: true
|
|
@@ -425,7 +463,7 @@ const CamoxPreview = (t0) => {
|
|
|
425
463
|
],
|
|
426
464
|
groupLabel: "Preview",
|
|
427
465
|
checkIfAvailable: () => isAuthenticated && previewSource === "live",
|
|
428
|
-
execute:
|
|
466
|
+
execute: _temp11,
|
|
429
467
|
shortcut: {
|
|
430
468
|
key: "d",
|
|
431
469
|
withAlt: true
|
|
@@ -436,8 +474,8 @@ const CamoxPreview = (t0) => {
|
|
|
436
474
|
label: "Clear selection",
|
|
437
475
|
aliases: ["Deselect", "Unselect"],
|
|
438
476
|
groupLabel: "Preview",
|
|
439
|
-
checkIfAvailable:
|
|
440
|
-
execute:
|
|
477
|
+
checkIfAvailable: _temp12,
|
|
478
|
+
execute: _temp13,
|
|
441
479
|
shortcut: { key: "Escape" }
|
|
442
480
|
}
|
|
443
481
|
];
|
|
@@ -448,145 +486,158 @@ const CamoxPreview = (t0) => {
|
|
|
448
486
|
return () => {
|
|
449
487
|
actionsStore.send({
|
|
450
488
|
type: "unregisterManyActions",
|
|
451
|
-
ids: actions.map(
|
|
489
|
+
ids: actions.map(_temp14)
|
|
452
490
|
});
|
|
453
491
|
};
|
|
454
492
|
};
|
|
455
|
-
|
|
493
|
+
t4 = [
|
|
456
494
|
isEditMode,
|
|
457
495
|
isAuthenticated,
|
|
496
|
+
isMobileStudio,
|
|
458
497
|
previewSource,
|
|
459
498
|
hasLiveCheckpoint
|
|
460
499
|
];
|
|
461
|
-
$[
|
|
462
|
-
$[
|
|
463
|
-
$[
|
|
464
|
-
$[
|
|
465
|
-
$[
|
|
466
|
-
$[
|
|
500
|
+
$[4] = hasLiveCheckpoint;
|
|
501
|
+
$[5] = isAuthenticated;
|
|
502
|
+
$[6] = isEditMode;
|
|
503
|
+
$[7] = isMobileStudio;
|
|
504
|
+
$[8] = previewSource;
|
|
505
|
+
$[9] = t3;
|
|
506
|
+
$[10] = t4;
|
|
467
507
|
} else {
|
|
468
|
-
|
|
469
|
-
|
|
508
|
+
t3 = $[9];
|
|
509
|
+
t4 = $[10];
|
|
470
510
|
}
|
|
471
|
-
React.useEffect(
|
|
511
|
+
React.useEffect(t3, t4);
|
|
472
512
|
if (!isAuthenticated) {
|
|
473
|
-
let
|
|
474
|
-
if ($[
|
|
475
|
-
|
|
476
|
-
$[
|
|
477
|
-
$[
|
|
478
|
-
} else
|
|
479
|
-
return
|
|
513
|
+
let t5;
|
|
514
|
+
if ($[11] !== children) {
|
|
515
|
+
t5 = /* @__PURE__ */ jsx(Fragment, { children });
|
|
516
|
+
$[11] = children;
|
|
517
|
+
$[12] = t5;
|
|
518
|
+
} else t5 = $[12];
|
|
519
|
+
return t5;
|
|
480
520
|
}
|
|
481
|
-
const
|
|
482
|
-
let
|
|
483
|
-
if ($[
|
|
484
|
-
|
|
485
|
-
$[
|
|
486
|
-
$[
|
|
487
|
-
} else
|
|
488
|
-
let
|
|
489
|
-
if ($[
|
|
490
|
-
|
|
521
|
+
const t5 = !isEditMode && "bg-black";
|
|
522
|
+
let t6;
|
|
523
|
+
if ($[13] !== t5) {
|
|
524
|
+
t6 = cn("bg-background flex h-screen flex-col overflow-hidden", t5);
|
|
525
|
+
$[13] = t5;
|
|
526
|
+
$[14] = t6;
|
|
527
|
+
} else t6 = $[14];
|
|
528
|
+
let t7;
|
|
529
|
+
if ($[15] !== isAddBlockSidebarOpen || $[16] !== isMobileStudio || $[17] !== isToolbarHidden) {
|
|
530
|
+
t7 = !isMobileStudio && !isToolbarHidden && /* @__PURE__ */ jsxs("div", {
|
|
491
531
|
className: "relative",
|
|
492
532
|
children: [/* @__PURE__ */ jsx(Navbar, {}), isAddBlockSidebarOpen && /* @__PURE__ */ jsx("div", {
|
|
493
533
|
className: "absolute inset-0 z-20",
|
|
494
534
|
style: { background: "rgba(0, 0, 0, 0.66)" },
|
|
495
|
-
onClick:
|
|
535
|
+
onClick: _temp15
|
|
496
536
|
})]
|
|
497
537
|
});
|
|
498
|
-
$[
|
|
499
|
-
$[
|
|
500
|
-
$[
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
$[
|
|
507
|
-
$[
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
538
|
+
$[15] = isAddBlockSidebarOpen;
|
|
539
|
+
$[16] = isMobileStudio;
|
|
540
|
+
$[17] = isToolbarHidden;
|
|
541
|
+
$[18] = t7;
|
|
542
|
+
} else t7 = $[18];
|
|
543
|
+
let t8;
|
|
544
|
+
if ($[19] !== isEditMode || $[20] !== isMobileStudio || $[21] !== pageData.page) {
|
|
545
|
+
t8 = !isMobileStudio && isEditMode && /* @__PURE__ */ jsx(LeftSidebar, { page: pageData.page });
|
|
546
|
+
$[19] = isEditMode;
|
|
547
|
+
$[20] = isMobileStudio;
|
|
548
|
+
$[21] = pageData.page;
|
|
549
|
+
$[22] = t8;
|
|
550
|
+
} else t8 = $[22];
|
|
551
|
+
let t9;
|
|
552
|
+
if ($[23] !== hasLiveCheckpoint || $[24] !== pageData.page.status) {
|
|
553
|
+
t9 = {
|
|
512
554
|
pageStatus: pageData.page.status,
|
|
513
555
|
hasLiveVersion: hasLiveCheckpoint
|
|
514
556
|
};
|
|
515
|
-
$[
|
|
516
|
-
$[
|
|
517
|
-
$[19] = t7;
|
|
518
|
-
} else t7 = $[19];
|
|
519
|
-
let t8;
|
|
520
|
-
if ($[20] !== isEditMode) {
|
|
521
|
-
t8 = isEditMode && /* @__PURE__ */ jsx("div", { style: {
|
|
522
|
-
height: "80px",
|
|
523
|
-
background: "transparent"
|
|
524
|
-
} });
|
|
525
|
-
$[20] = isEditMode;
|
|
526
|
-
$[21] = t8;
|
|
527
|
-
} else t8 = $[21];
|
|
528
|
-
let t9;
|
|
529
|
-
if ($[22] !== children || $[23] !== t7 || $[24] !== t8) {
|
|
530
|
-
t9 = /* @__PURE__ */ jsxs(PreviewPanel, {
|
|
531
|
-
toolbarProps: t7,
|
|
532
|
-
children: [children, t8]
|
|
533
|
-
});
|
|
534
|
-
$[22] = children;
|
|
535
|
-
$[23] = t7;
|
|
536
|
-
$[24] = t8;
|
|
557
|
+
$[23] = hasLiveCheckpoint;
|
|
558
|
+
$[24] = pageData.page.status;
|
|
537
559
|
$[25] = t9;
|
|
538
560
|
} else t9 = $[25];
|
|
539
561
|
let t10;
|
|
540
|
-
if ($[26] !== isEditMode || $[27] !==
|
|
541
|
-
t10 = isEditMode && /* @__PURE__ */ jsx(
|
|
562
|
+
if ($[26] !== isEditMode || $[27] !== isMobileStudio) {
|
|
563
|
+
t10 = !isMobileStudio && isEditMode && /* @__PURE__ */ jsx("div", { style: {
|
|
564
|
+
height: "80px",
|
|
565
|
+
background: "transparent"
|
|
566
|
+
} });
|
|
542
567
|
$[26] = isEditMode;
|
|
543
|
-
$[27] =
|
|
568
|
+
$[27] = isMobileStudio;
|
|
544
569
|
$[28] = t10;
|
|
545
570
|
} else t10 = $[28];
|
|
546
571
|
let t11;
|
|
547
|
-
if ($[29] !==
|
|
548
|
-
t11 = /* @__PURE__ */ jsxs(
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
]
|
|
572
|
+
if ($[29] !== children || $[30] !== isMobileStudio || $[31] !== pageData.page || $[32] !== pageData.projectName || $[33] !== t10 || $[34] !== t9) {
|
|
573
|
+
t11 = /* @__PURE__ */ jsxs(PreviewPanel, {
|
|
574
|
+
isMobileExperience: isMobileStudio,
|
|
575
|
+
page: pageData.page,
|
|
576
|
+
projectName: pageData.projectName,
|
|
577
|
+
toolbarProps: t9,
|
|
578
|
+
children: [children, t10]
|
|
555
579
|
});
|
|
556
|
-
$[29] =
|
|
557
|
-
$[30] =
|
|
558
|
-
$[31] =
|
|
559
|
-
$[32] =
|
|
560
|
-
|
|
580
|
+
$[29] = children;
|
|
581
|
+
$[30] = isMobileStudio;
|
|
582
|
+
$[31] = pageData.page;
|
|
583
|
+
$[32] = pageData.projectName;
|
|
584
|
+
$[33] = t10;
|
|
585
|
+
$[34] = t9;
|
|
586
|
+
$[35] = t11;
|
|
587
|
+
} else t11 = $[35];
|
|
561
588
|
let t12;
|
|
562
|
-
if ($[
|
|
563
|
-
t12 =
|
|
564
|
-
$[
|
|
565
|
-
$[
|
|
566
|
-
|
|
589
|
+
if ($[36] !== isEditMode || $[37] !== isMobileStudio || $[38] !== pageData.page.id) {
|
|
590
|
+
t12 = !isMobileStudio && isEditMode && /* @__PURE__ */ jsx(RightSidebar, { pageId: pageData.page.id });
|
|
591
|
+
$[36] = isEditMode;
|
|
592
|
+
$[37] = isMobileStudio;
|
|
593
|
+
$[38] = pageData.page.id;
|
|
594
|
+
$[39] = t12;
|
|
595
|
+
} else t12 = $[39];
|
|
567
596
|
let t13;
|
|
568
|
-
if ($[
|
|
597
|
+
if ($[40] !== t11 || $[41] !== t12 || $[42] !== t8) {
|
|
569
598
|
t13 = /* @__PURE__ */ jsxs("div", {
|
|
570
|
-
className:
|
|
599
|
+
className: "flex h-full flex-row items-stretch",
|
|
571
600
|
children: [
|
|
572
|
-
|
|
601
|
+
t8,
|
|
573
602
|
t11,
|
|
574
603
|
t12
|
|
575
604
|
]
|
|
576
605
|
});
|
|
577
|
-
$[
|
|
578
|
-
$[
|
|
579
|
-
$[
|
|
580
|
-
$[
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
606
|
+
$[40] = t11;
|
|
607
|
+
$[41] = t12;
|
|
608
|
+
$[42] = t8;
|
|
609
|
+
$[43] = t13;
|
|
610
|
+
} else t13 = $[43];
|
|
611
|
+
let t14;
|
|
612
|
+
if ($[44] !== isEditMode || $[45] !== isMobileStudio) {
|
|
613
|
+
t14 = (isMobileStudio || isEditMode) && /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(CreatePageModal, {}), /* @__PURE__ */ jsx(DraftSwitchDialog, {})] });
|
|
614
|
+
$[44] = isEditMode;
|
|
615
|
+
$[45] = isMobileStudio;
|
|
616
|
+
$[46] = t14;
|
|
617
|
+
} else t14 = $[46];
|
|
618
|
+
let t15;
|
|
619
|
+
if ($[47] !== t13 || $[48] !== t14 || $[49] !== t6 || $[50] !== t7) {
|
|
620
|
+
t15 = /* @__PURE__ */ jsxs("div", {
|
|
621
|
+
className: t6,
|
|
622
|
+
children: [
|
|
623
|
+
t7,
|
|
624
|
+
t13,
|
|
625
|
+
t14
|
|
626
|
+
]
|
|
627
|
+
});
|
|
628
|
+
$[47] = t13;
|
|
629
|
+
$[48] = t14;
|
|
630
|
+
$[49] = t6;
|
|
631
|
+
$[50] = t7;
|
|
632
|
+
$[51] = t15;
|
|
633
|
+
} else t15 = $[51];
|
|
634
|
+
return t15;
|
|
584
635
|
};
|
|
585
636
|
function usePreviewPagesActions() {
|
|
586
637
|
const $ = c(13);
|
|
587
|
-
if ($[0] !== "
|
|
638
|
+
if ($[0] !== "29f1dc43006b541048efc4a08454742012d6157baa9fc62d4636c9c9d20b2ab3") {
|
|
588
639
|
for (let $i = 0; $i < 13; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
|
|
589
|
-
$[0] = "
|
|
640
|
+
$[0] = "29f1dc43006b541048efc4a08454742012d6157baa9fc62d4636c9c9d20b2ab3";
|
|
590
641
|
}
|
|
591
642
|
const navigate = useNavigate();
|
|
592
643
|
const { pathname } = useLocation();
|
|
@@ -627,8 +678,8 @@ function usePreviewPagesActions() {
|
|
|
627
678
|
label: "Create page",
|
|
628
679
|
aliases: ["New page", "Add page"],
|
|
629
680
|
groupLabel: "Preview",
|
|
630
|
-
checkIfAvailable:
|
|
631
|
-
execute:
|
|
681
|
+
checkIfAvailable: _temp16,
|
|
682
|
+
execute: _temp17
|
|
632
683
|
},
|
|
633
684
|
{
|
|
634
685
|
id: "edit-current-page",
|
|
@@ -659,14 +710,14 @@ function usePreviewPagesActions() {
|
|
|
659
710
|
groupLabel: "Preview",
|
|
660
711
|
checkIfAvailable: () => !!pages,
|
|
661
712
|
hasChildren: true,
|
|
662
|
-
execute:
|
|
713
|
+
execute: _temp18
|
|
663
714
|
},
|
|
664
715
|
...pages ? pages.map((page) => ({
|
|
665
716
|
id: `go-to-page-${page.id}`,
|
|
666
717
|
parentActionId: "go-to-page",
|
|
667
718
|
label: `Go to "${page.nickname}"`,
|
|
668
719
|
groupLabel: "Preview",
|
|
669
|
-
checkIfAvailable:
|
|
720
|
+
checkIfAvailable: _temp19,
|
|
670
721
|
execute: () => navigate({ to: page.fullPath })
|
|
671
722
|
})) : []
|
|
672
723
|
];
|
|
@@ -677,7 +728,7 @@ function usePreviewPagesActions() {
|
|
|
677
728
|
return () => {
|
|
678
729
|
actionsStore.send({
|
|
679
730
|
type: "unregisterManyActions",
|
|
680
|
-
ids: actions.map(
|
|
731
|
+
ids: actions.map(_temp20)
|
|
681
732
|
});
|
|
682
733
|
};
|
|
683
734
|
};
|
|
@@ -697,62 +748,62 @@ function usePreviewPagesActions() {
|
|
|
697
748
|
}
|
|
698
749
|
React.useEffect(t4, t5);
|
|
699
750
|
}
|
|
700
|
-
function
|
|
751
|
+
function _temp20(a) {
|
|
701
752
|
return a.id;
|
|
702
753
|
}
|
|
703
|
-
function
|
|
754
|
+
function _temp19() {
|
|
704
755
|
return true;
|
|
705
756
|
}
|
|
706
|
-
function
|
|
707
|
-
function
|
|
757
|
+
function _temp18() {}
|
|
758
|
+
function _temp17() {
|
|
708
759
|
return previewStore.send({ type: "openCreatePageModal" });
|
|
709
760
|
}
|
|
710
|
-
function
|
|
761
|
+
function _temp16() {
|
|
711
762
|
return true;
|
|
712
763
|
}
|
|
713
|
-
function
|
|
764
|
+
function _temp4(state) {
|
|
714
765
|
return state.context.previewSource;
|
|
715
766
|
}
|
|
716
|
-
function
|
|
767
|
+
function _temp6(state) {
|
|
717
768
|
return state.context.isEditMode;
|
|
718
769
|
}
|
|
719
|
-
function
|
|
770
|
+
function _temp7(state_0) {
|
|
720
771
|
return state_0.context.isToolbarHidden;
|
|
721
772
|
}
|
|
722
|
-
function
|
|
773
|
+
function _temp8(state_1) {
|
|
723
774
|
return state_1.context.isAddBlockSidebarOpen;
|
|
724
775
|
}
|
|
725
|
-
function
|
|
776
|
+
function _temp9(state_2) {
|
|
726
777
|
return state_2.context.previewSource;
|
|
727
778
|
}
|
|
728
|
-
function
|
|
779
|
+
function _temp0() {
|
|
729
780
|
return previewStore.send({ type: "exitEditMode" });
|
|
730
781
|
}
|
|
731
|
-
function
|
|
782
|
+
function _temp1() {
|
|
732
783
|
return previewStore.send({ type: "enterEditMode" });
|
|
733
784
|
}
|
|
734
|
-
function
|
|
785
|
+
function _temp10() {
|
|
735
786
|
return previewStore.send({
|
|
736
787
|
type: "setPreviewSource",
|
|
737
788
|
source: "live"
|
|
738
789
|
});
|
|
739
790
|
}
|
|
740
|
-
function
|
|
791
|
+
function _temp11() {
|
|
741
792
|
return previewStore.send({
|
|
742
793
|
type: "setPreviewSource",
|
|
743
794
|
source: "draft"
|
|
744
795
|
});
|
|
745
796
|
}
|
|
746
|
-
function
|
|
797
|
+
function _temp12() {
|
|
747
798
|
return true;
|
|
748
799
|
}
|
|
749
|
-
function
|
|
800
|
+
function _temp13() {
|
|
750
801
|
previewStore.send({ type: "clearSelection" });
|
|
751
802
|
}
|
|
752
|
-
function
|
|
803
|
+
function _temp14(a) {
|
|
753
804
|
return a.id;
|
|
754
805
|
}
|
|
755
|
-
function
|
|
806
|
+
function _temp15() {
|
|
756
807
|
return previewStore.send({ type: "closeAddBlockSidebar" });
|
|
757
808
|
}
|
|
758
809
|
|