camox 0.38.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.
@@ -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] !== "08efc24964e6f71a0b75d26676e04d8253640e7adc88fa9c6e2293e86440c27a") {
74
+ if ($[0] !== "29f1dc43006b541048efc4a08454742012d6157baa9fc62d4636c9c9d20b2ab3") {
55
75
  for (let $i = 0; $i < 26; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
56
- $[0] = "08efc24964e6f71a0b75d26676e04d8253640e7adc88fa9c6e2293e86440c27a";
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, _temp);
62
- const previewSource = useSelector(previewStore, _temp2);
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 _temp2(state_0) {
165
+ function _temp3(state_0) {
146
166
  return state_0.context.previewSource;
147
167
  }
148
- function _temp(state) {
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] !== "08efc24964e6f71a0b75d26676e04d8253640e7adc88fa9c6e2293e86440c27a") {
173
+ if ($[0] !== "29f1dc43006b541048efc4a08454742012d6157baa9fc62d4636c9c9d20b2ab3") {
154
174
  for (let $i = 0; $i < 23; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
155
- $[0] = "08efc24964e6f71a0b75d26676e04d8253640e7adc88fa9c6e2293e86440c27a";
175
+ $[0] = "29f1dc43006b541048efc4a08454742012d6157baa9fc62d4636c9c9d20b2ab3";
156
176
  }
157
177
  const { blockId, mode, showAddBlockTop, showAddBlockBottom } = t0;
158
- const previewSource = useSelector(previewStore, _temp3);
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] !== "08efc24964e6f71a0b75d26676e04d8253640e7adc88fa9c6e2293e86440c27a") {
318
+ if ($[0] !== "29f1dc43006b541048efc4a08454742012d6157baa9fc62d4636c9c9d20b2ab3") {
299
319
  for (let $i = 0; $i < 7; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
300
- $[0] = "08efc24964e6f71a0b75d26676e04d8253640e7adc88fa9c6e2293e86440c27a";
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(_temp4);
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 _temp4() {}
368
+ function _temp5() {}
349
369
  const CamoxPreview = (t0) => {
350
- const $ = c(40);
351
- if ($[0] !== "08efc24964e6f71a0b75d26676e04d8253640e7adc88fa9c6e2293e86440c27a") {
352
- for (let $i = 0; $i < 40; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
353
- $[0] = "08efc24964e6f71a0b75d26676e04d8253640e7adc88fa9c6e2293e86440c27a";
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 isEditMode = useSelector(previewStore, _temp5);
358
- const isToolbarHidden = useSelector(previewStore, _temp6);
359
- const isAddBlockSidebarOpen = useSelector(previewStore, _temp7);
360
- const previewSource = useSelector(previewStore, _temp8);
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] !== hasLiveCheckpoint || $[2] !== isAuthenticated || $[3] !== isEditMode || $[4] !== previewSource) {
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: _temp9,
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: _temp0,
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: _temp1,
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: _temp10,
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: _temp11,
440
- execute: _temp12,
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(_temp13)
489
+ ids: actions.map(_temp14)
452
490
  });
453
491
  };
454
492
  };
455
- t2 = [
493
+ t4 = [
456
494
  isEditMode,
457
495
  isAuthenticated,
496
+ isMobileStudio,
458
497
  previewSource,
459
498
  hasLiveCheckpoint
460
499
  ];
461
- $[1] = hasLiveCheckpoint;
462
- $[2] = isAuthenticated;
463
- $[3] = isEditMode;
464
- $[4] = previewSource;
465
- $[5] = t1;
466
- $[6] = t2;
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
- t1 = $[5];
469
- t2 = $[6];
508
+ t3 = $[9];
509
+ t4 = $[10];
470
510
  }
471
- React.useEffect(t1, t2);
511
+ React.useEffect(t3, t4);
472
512
  if (!isAuthenticated) {
473
- let t3;
474
- if ($[7] !== children) {
475
- t3 = /* @__PURE__ */ jsx(Fragment, { children });
476
- $[7] = children;
477
- $[8] = t3;
478
- } else t3 = $[8];
479
- return t3;
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 t3 = !isEditMode && "bg-black";
482
- let t4;
483
- if ($[9] !== t3) {
484
- t4 = cn("bg-background flex h-screen flex-col overflow-hidden", t3);
485
- $[9] = t3;
486
- $[10] = t4;
487
- } else t4 = $[10];
488
- let t5;
489
- if ($[11] !== isAddBlockSidebarOpen || $[12] !== isToolbarHidden) {
490
- t5 = !isToolbarHidden && /* @__PURE__ */ jsxs("div", {
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: _temp14
535
+ onClick: _temp15
496
536
  })]
497
537
  });
498
- $[11] = isAddBlockSidebarOpen;
499
- $[12] = isToolbarHidden;
500
- $[13] = t5;
501
- } else t5 = $[13];
502
- let t6;
503
- if ($[14] !== isEditMode || $[15] !== pageData.page) {
504
- t6 = isEditMode && /* @__PURE__ */ jsx(LeftSidebar, { page: pageData.page });
505
- $[14] = isEditMode;
506
- $[15] = pageData.page;
507
- $[16] = t6;
508
- } else t6 = $[16];
509
- let t7;
510
- if ($[17] !== hasLiveCheckpoint || $[18] !== pageData.page.status) {
511
- t7 = {
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
- $[17] = hasLiveCheckpoint;
516
- $[18] = pageData.page.status;
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] !== pageData.page.id) {
541
- t10 = isEditMode && /* @__PURE__ */ jsx(RightSidebar, { pageId: pageData.page.id });
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] = pageData.page.id;
568
+ $[27] = isMobileStudio;
544
569
  $[28] = t10;
545
570
  } else t10 = $[28];
546
571
  let t11;
547
- if ($[29] !== t10 || $[30] !== t6 || $[31] !== t9) {
548
- t11 = /* @__PURE__ */ jsxs("div", {
549
- className: "flex h-full flex-row items-stretch",
550
- children: [
551
- t6,
552
- t9,
553
- t10
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] = t10;
557
- $[30] = t6;
558
- $[31] = t9;
559
- $[32] = t11;
560
- } else t11 = $[32];
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 ($[33] !== isEditMode) {
563
- t12 = isEditMode && /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(CreatePageModal, {}), /* @__PURE__ */ jsx(DraftSwitchDialog, {})] });
564
- $[33] = isEditMode;
565
- $[34] = t12;
566
- } else t12 = $[34];
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 ($[35] !== t11 || $[36] !== t12 || $[37] !== t4 || $[38] !== t5) {
597
+ if ($[40] !== t11 || $[41] !== t12 || $[42] !== t8) {
569
598
  t13 = /* @__PURE__ */ jsxs("div", {
570
- className: t4,
599
+ className: "flex h-full flex-row items-stretch",
571
600
  children: [
572
- t5,
601
+ t8,
573
602
  t11,
574
603
  t12
575
604
  ]
576
605
  });
577
- $[35] = t11;
578
- $[36] = t12;
579
- $[37] = t4;
580
- $[38] = t5;
581
- $[39] = t13;
582
- } else t13 = $[39];
583
- return t13;
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] !== "08efc24964e6f71a0b75d26676e04d8253640e7adc88fa9c6e2293e86440c27a") {
638
+ if ($[0] !== "29f1dc43006b541048efc4a08454742012d6157baa9fc62d4636c9c9d20b2ab3") {
588
639
  for (let $i = 0; $i < 13; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
589
- $[0] = "08efc24964e6f71a0b75d26676e04d8253640e7adc88fa9c6e2293e86440c27a";
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: _temp15,
631
- execute: _temp16
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: _temp17
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: _temp18,
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(_temp19)
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 _temp19(a) {
751
+ function _temp20(a) {
701
752
  return a.id;
702
753
  }
703
- function _temp18() {
754
+ function _temp19() {
704
755
  return true;
705
756
  }
706
- function _temp17() {}
707
- function _temp16() {
757
+ function _temp18() {}
758
+ function _temp17() {
708
759
  return previewStore.send({ type: "openCreatePageModal" });
709
760
  }
710
- function _temp15() {
761
+ function _temp16() {
711
762
  return true;
712
763
  }
713
- function _temp3(state) {
764
+ function _temp4(state) {
714
765
  return state.context.previewSource;
715
766
  }
716
- function _temp5(state) {
767
+ function _temp6(state) {
717
768
  return state.context.isEditMode;
718
769
  }
719
- function _temp6(state_0) {
770
+ function _temp7(state_0) {
720
771
  return state_0.context.isToolbarHidden;
721
772
  }
722
- function _temp7(state_1) {
773
+ function _temp8(state_1) {
723
774
  return state_1.context.isAddBlockSidebarOpen;
724
775
  }
725
- function _temp8(state_2) {
776
+ function _temp9(state_2) {
726
777
  return state_2.context.previewSource;
727
778
  }
728
- function _temp9() {
779
+ function _temp0() {
729
780
  return previewStore.send({ type: "exitEditMode" });
730
781
  }
731
- function _temp0() {
782
+ function _temp1() {
732
783
  return previewStore.send({ type: "enterEditMode" });
733
784
  }
734
- function _temp1() {
785
+ function _temp10() {
735
786
  return previewStore.send({
736
787
  type: "setPreviewSource",
737
788
  source: "live"
738
789
  });
739
790
  }
740
- function _temp10() {
791
+ function _temp11() {
741
792
  return previewStore.send({
742
793
  type: "setPreviewSource",
743
794
  source: "draft"
744
795
  });
745
796
  }
746
- function _temp11() {
797
+ function _temp12() {
747
798
  return true;
748
799
  }
749
- function _temp12() {
800
+ function _temp13() {
750
801
  previewStore.send({ type: "clearSelection" });
751
802
  }
752
- function _temp13(a) {
803
+ function _temp14(a) {
753
804
  return a.id;
754
805
  }
755
- function _temp14() {
806
+ function _temp15() {
756
807
  return previewStore.send({ type: "closeAddBlockSidebar" });
757
808
  }
758
809
 
@@ -27,9 +27,9 @@ const slugifyPathSegment = (nickname) => {
27
27
  };
28
28
  const CreatePageModal = () => {
29
29
  const $ = c(56);
30
- if ($[0] !== "195c3824082641033afd94300951785a25a5c10bf582f4f474c373a01e440e23") {
30
+ if ($[0] !== "1b629d2817a68910dcd0da1c3da2fc0aac9482f6f60a2348db493c3af333db39") {
31
31
  for (let $i = 0; $i < 56; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
32
- $[0] = "195c3824082641033afd94300951785a25a5c10bf582f4f474c373a01e440e23";
32
+ $[0] = "1b629d2817a68910dcd0da1c3da2fc0aac9482f6f60a2348db493c3af333db39";
33
33
  }
34
34
  const projectSlug = useProjectSlug();
35
35
  const open = useSelector(previewStore, _temp);
@@ -129,13 +129,6 @@ const CreatePageModal = () => {
129
129
  form.reset();
130
130
  await new Promise(_temp2);
131
131
  await navigate({ to: fullPath });
132
- previewStore.send({
133
- type: "openAgentChatSidebar",
134
- pageScaffoldContext: {
135
- nickname,
136
- fullPath
137
- }
138
- });
139
132
  } catch (t9) {
140
133
  console.error("Failed to create page:", t9);
141
134
  toast.error("Could not create page");