camox 0.40.0 → 0.41.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.
Files changed (108) hide show
  1. package/dist/components/PlatformLabel.js +62 -0
  2. package/dist/core/components/lexical/GradientNode.js +126 -0
  3. package/dist/core/components/lexical/InlineLexicalEditor.js +37 -56
  4. package/dist/core/components/lexical/InlineStylesPlugin.js +183 -0
  5. package/dist/core/components/lexical/SelectionBroadcaster.js +49 -46
  6. package/dist/core/components/lexical/SidebarLexicalEditor.js +197 -151
  7. package/dist/core/components/lexical/editorConfig.js +25 -7
  8. package/dist/core/components/lexical/selectTextLink.js +21 -0
  9. package/dist/core/createApp.d.ts +30 -17
  10. package/dist/core/createApp.js +14 -3
  11. package/dist/core/createBlock.d.ts +2 -2
  12. package/dist/core/createBlock.js +17 -28
  13. package/dist/core/createLayout.d.ts +48 -4
  14. package/dist/core/createLayout.js +51 -23
  15. package/dist/core/derivedRoutes.js +36 -0
  16. package/dist/core/editing/BlockEditingRuntime.js +4 -4
  17. package/dist/core/editing/CompleteBlockEditingRuntime.js +5 -5
  18. package/dist/core/editing/createEditableBlock.d.ts +9 -8
  19. package/dist/core/editing/createEditableBlock.js +265 -403
  20. package/dist/core/hooks/useIsEditable.js +4 -7
  21. package/dist/core/hooks/useRequireDraftSource.js +7 -11
  22. package/dist/core/lib/lexicalReact.d.ts +1 -26
  23. package/dist/core/lib/lexicalReact.js +46 -60
  24. package/dist/core/lib/lexicalState.js +164 -81
  25. package/dist/core/lib/modifierFormats.js +4 -15
  26. package/dist/core/lib/textStyles.d.ts +27 -0
  27. package/dist/core/lib/textStyles.js +47 -0
  28. package/dist/features/navigation/navigation.d.ts +2 -0
  29. package/dist/features/navigation/navigation.js +51 -46
  30. package/dist/features/page/DerivedPageContent.js +61 -0
  31. package/dist/features/page/PublishedPageContent.js +52 -83
  32. package/dist/features/page/SharedLayoutContent.js +66 -0
  33. package/dist/features/preview/CamoxPreview.d.ts +16 -1
  34. package/dist/features/preview/CamoxPreview.js +246 -290
  35. package/dist/features/preview/DerivedPreview.js +134 -0
  36. package/dist/features/preview/EditablePageExperience.js +25 -8
  37. package/dist/features/preview/components/AddBlockSidebar.js +43 -33
  38. package/dist/features/preview/components/AssetLightbox.js +1 -1
  39. package/dist/features/preview/components/BlockActionsPopover.js +8 -8
  40. package/dist/features/preview/components/BlockThumbnail.js +192 -0
  41. package/dist/features/preview/components/CreatePageModal.js +123 -115
  42. package/dist/features/preview/components/DerivedLayoutDialog.js +100 -0
  43. package/dist/features/preview/components/DerivedLayoutSidebar.d.ts +5 -0
  44. package/dist/features/preview/components/DerivedLayoutSidebar.js +160 -0
  45. package/dist/features/preview/components/DerivedPageInfoSidebar.js +57 -0
  46. package/dist/features/preview/components/FieldToolbar.js +42 -20
  47. package/dist/features/preview/components/Frame.js +133 -140
  48. package/dist/features/preview/components/LeftSidebar.js +42 -38
  49. package/dist/features/preview/components/LinkFieldEditor.js +3 -4
  50. package/dist/features/preview/components/MobilePreviewDrawer.js +4 -4
  51. package/dist/features/preview/components/Overlays.js +59 -47
  52. package/dist/features/preview/components/PageEditorSidebar.js +194 -203
  53. package/dist/features/preview/components/PageInfoSidebar.js +63 -55
  54. package/dist/features/preview/components/PageNavigatorSidebar.js +34 -483
  55. package/dist/features/preview/components/PagePicker.js +205 -153
  56. package/dist/features/preview/components/PageTree.js +366 -340
  57. package/dist/features/preview/components/PreviewActivation.js +78 -0
  58. package/dist/features/preview/components/PreviewPanel.js +98 -68
  59. package/dist/features/preview/components/PreviewToolbar.js +224 -241
  60. package/dist/features/preview/components/PreviewToolbarSpacer.js +43 -0
  61. package/dist/features/preview/components/PublicationRow.js +425 -0
  62. package/dist/features/preview/components/PublishDialog.js +180 -97
  63. package/dist/features/preview/components/RightSidebar.js +19 -34
  64. package/dist/features/preview/components/previewStyles.js +8 -0
  65. package/dist/features/preview/components/useUpdateBlockPosition.js +7 -13
  66. package/dist/features/preview/previewConstants.js +8 -0
  67. package/dist/features/preview/previewStore.js +18 -39
  68. package/dist/features/preview/publication.js +71 -0
  69. package/dist/features/provider/AuthenticatedCamoxProvider.js +2 -1
  70. package/dist/features/provider/CoreCamoxProvider.js +11 -2
  71. package/dist/features/provider/LocalhostPreviewProvider.js +6 -7
  72. package/dist/features/provider/useAdminShortcuts.js +5 -4
  73. package/dist/features/routes/pageRuntime.d.ts +10 -0
  74. package/dist/features/routes/pageRuntime.js +7 -9
  75. package/dist/features/runtime/PreviewDocumentContext.js +7 -0
  76. package/dist/features/runtime/RuntimeChrome.js +149 -0
  77. package/dist/features/runtime/SharedChromeContext.js +7 -0
  78. package/dist/features/runtime/navigationRequest.js +21 -0
  79. package/dist/features/runtime/navigationTarget.js +23 -0
  80. package/dist/features/runtime/pageApp.js +196 -121
  81. package/dist/features/runtime/pageNavigation.js +79 -130
  82. package/dist/features/runtime/runtime.d.ts +11 -0
  83. package/dist/features/runtime/runtime.js +183 -47
  84. package/dist/features/runtime/studioApp.d.ts +2 -11
  85. package/dist/features/runtime/studioApp.js +14 -177
  86. package/dist/features/studio/CamoxStudio.js +27 -13
  87. package/dist/features/studio/components/Navbar.js +80 -74
  88. package/dist/features/studio/components/UserButton.js +4 -4
  89. package/dist/features/studio/studioTheme.js +25 -0
  90. package/dist/features/studio/useTheme.js +94 -109
  91. package/dist/features/vite/appGeneration.js +12 -3
  92. package/dist/features/vite/definitionsSync.js +4 -2
  93. package/dist/features/vite/layoutGeneration.js +38 -0
  94. package/dist/features/vite/runtimeDev.js +3 -1
  95. package/dist/lib/auth.js +15 -13
  96. package/dist/lib/normalized-data.js +4 -4
  97. package/dist/lib/platform.js +13 -0
  98. package/dist/lib/utils.js +90 -38
  99. package/dist/studio-overlays.css +5 -40
  100. package/dist/studio.css +1 -1
  101. package/package.json +8 -4
  102. package/skills/camox/SKILL.md +2 -0
  103. package/skills/camox/references/block-definitions.md +31 -12
  104. package/skills/camox/references/layout-definitions.md +2 -0
  105. package/dist/core/lib/modifiers.js +0 -24
  106. package/dist/features/preview/components/DraftSwitchDialog.js +0 -66
  107. package/dist/features/preview/previewQueryFns.js +0 -23
  108. package/dist/features/runtime/studioNavigation.js +0 -120
@@ -1,7 +1,7 @@
1
1
  import { usePageBlocks } from "../../../lib/normalized-data.js";
2
2
  import { cn } from "../../../lib/utils.js";
3
3
  import { useCamoxApp } from "../../provider/components/CamoxAppContext.js";
4
- import { previewStore } from "../previewStore.js";
4
+ import { previewStore, selectPreviewSource } from "../previewStore.js";
5
5
  import { useRequireDraftSource } from "../../../core/hooks/useRequireDraftSource.js";
6
6
  import { useUpdateBlockPosition } from "./useUpdateBlockPosition.js";
7
7
  import { BlockActionsPopover } from "./BlockActionsPopover.js";
@@ -11,7 +11,7 @@ import * as React from "react";
11
11
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
12
12
  import { useSelector } from "@xstate/store-react";
13
13
  import { Button } from "@camox/ui/button";
14
- import { Ellipsis, GripVertical, LayoutTemplate, Plus } from "lucide-react";
14
+ import { Ellipsis, GripVertical, LayoutTemplate, Pencil, Plus } from "lucide-react";
15
15
  import { Tooltip, TooltipContent, TooltipTrigger } from "@camox/ui/tooltip";
16
16
  import { DndContext, DragOverlay, KeyboardSensor, PointerSensor, closestCenter, useSensor, useSensors } from "@dnd-kit/core";
17
17
  import { restrictToVerticalAxis } from "@dnd-kit/modifiers";
@@ -21,22 +21,22 @@ import { CSS } from "@dnd-kit/utilities";
21
21
  //#region src/features/preview/components/PageTree.tsx
22
22
  const usePreviewSource = () => {
23
23
  const $ = c(1);
24
- if ($[0] !== "e2e18e0d8166e0ab2847dfaad4af267e4cb38ede982af367ff19b699a6d19a10") {
24
+ if ($[0] !== "471c3efab23632ac0a363f528fa97ab43f3bcb61e240c961d3c95d63897d691d") {
25
25
  for (let $i = 0; $i < 1; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
26
- $[0] = "e2e18e0d8166e0ab2847dfaad4af267e4cb38ede982af367ff19b699a6d19a10";
26
+ $[0] = "471c3efab23632ac0a363f528fa97ab43f3bcb61e240c961d3c95d63897d691d";
27
27
  }
28
- return useSelector(previewStore, _temp);
28
+ return useSelector(previewStore, selectPreviewSource);
29
29
  };
30
30
  function useBlockTreeItem(block, t0) {
31
31
  const $ = c(17);
32
- if ($[0] !== "e2e18e0d8166e0ab2847dfaad4af267e4cb38ede982af367ff19b699a6d19a10") {
32
+ if ($[0] !== "471c3efab23632ac0a363f528fa97ab43f3bcb61e240c961d3c95d63897d691d") {
33
33
  for (let $i = 0; $i < 17; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
34
- $[0] = "e2e18e0d8166e0ab2847dfaad4af267e4cb38ede982af367ff19b699a6d19a10";
34
+ $[0] = "471c3efab23632ac0a363f528fa97ab43f3bcb61e240c961d3c95d63897d691d";
35
35
  }
36
36
  const isDragging = t0 === void 0 ? false : t0;
37
37
  const [ellipsisPopoverOpen, setEllipsisPopoverOpen] = React.useState(false);
38
- const selection = useSelector(previewStore, _temp2);
39
- const iframeElement = useSelector(previewStore, _temp3);
38
+ const selection = useSelector(previewStore, _temp);
39
+ const iframeElement = useSelector(previewStore, _temp2);
40
40
  const isBlockActive = selection?.blockId === block.id;
41
41
  const isBlockSelected = selection?.type === "block" && selection.blockId === block.id;
42
42
  const shouldShowHover = !isDragging && !isBlockActive;
@@ -106,17 +106,17 @@ function useBlockTreeItem(block, t0) {
106
106
  } else t4 = $[16];
107
107
  return t4;
108
108
  }
109
- function _temp3(state_0) {
109
+ function _temp2(state_0) {
110
110
  return state_0.context.iframeElement;
111
111
  }
112
- function _temp2(state) {
112
+ function _temp(state) {
113
113
  return state.context.selection;
114
114
  }
115
115
  const BlockTreeItemHeader = (t0) => {
116
116
  const $ = c(17);
117
- if ($[0] !== "e2e18e0d8166e0ab2847dfaad4af267e4cb38ede982af367ff19b699a6d19a10") {
117
+ if ($[0] !== "471c3efab23632ac0a363f528fa97ab43f3bcb61e240c961d3c95d63897d691d") {
118
118
  for (let $i = 0; $i < 17; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
119
- $[0] = "e2e18e0d8166e0ab2847dfaad4af267e4cb38ede982af367ff19b699a6d19a10";
119
+ $[0] = "471c3efab23632ac0a363f528fa97ab43f3bcb61e240c961d3c95d63897d691d";
120
120
  }
121
121
  let children;
122
122
  let className;
@@ -169,9 +169,9 @@ const BlockTreeItemHeader = (t0) => {
169
169
  };
170
170
  const BlockTreeItemTrigger = (t0) => {
171
171
  const $ = c(5);
172
- if ($[0] !== "e2e18e0d8166e0ab2847dfaad4af267e4cb38ede982af367ff19b699a6d19a10") {
172
+ if ($[0] !== "471c3efab23632ac0a363f528fa97ab43f3bcb61e240c961d3c95d63897d691d") {
173
173
  for (let $i = 0; $i < 5; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
174
- $[0] = "e2e18e0d8166e0ab2847dfaad4af267e4cb38ede982af367ff19b699a6d19a10";
174
+ $[0] = "471c3efab23632ac0a363f528fa97ab43f3bcb61e240c961d3c95d63897d691d";
175
175
  }
176
176
  const { displayText, onClick } = t0;
177
177
  let t1;
@@ -196,9 +196,9 @@ const BlockTreeItemTrigger = (t0) => {
196
196
  };
197
197
  const BlockTreeItemEllipsis = (t0) => {
198
198
  const $ = c(12);
199
- if ($[0] !== "e2e18e0d8166e0ab2847dfaad4af267e4cb38ede982af367ff19b699a6d19a10") {
199
+ if ($[0] !== "471c3efab23632ac0a363f528fa97ab43f3bcb61e240c961d3c95d63897d691d") {
200
200
  for (let $i = 0; $i < 12; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
201
- $[0] = "e2e18e0d8166e0ab2847dfaad4af267e4cb38ede982af367ff19b699a6d19a10";
201
+ $[0] = "471c3efab23632ac0a363f528fa97ab43f3bcb61e240c961d3c95d63897d691d";
202
202
  }
203
203
  let className;
204
204
  let open;
@@ -248,164 +248,121 @@ const animateLayoutChanges = (args) => {
248
248
  return defaultAnimateLayoutChanges(args);
249
249
  };
250
250
  const SortableBlock = (t0) => {
251
- const $ = c(52);
252
- if ($[0] !== "e2e18e0d8166e0ab2847dfaad4af267e4cb38ede982af367ff19b699a6d19a10") {
253
- for (let $i = 0; $i < 52; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
254
- $[0] = "e2e18e0d8166e0ab2847dfaad4af267e4cb38ede982af367ff19b699a6d19a10";
251
+ const $ = c(38);
252
+ if ($[0] !== "471c3efab23632ac0a363f528fa97ab43f3bcb61e240c961d3c95d63897d691d") {
253
+ for (let $i = 0; $i < 38; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
254
+ $[0] = "471c3efab23632ac0a363f528fa97ab43f3bcb61e240c961d3c95d63897d691d";
255
255
  }
256
256
  const { block } = t0;
257
257
  const [gripPopoverOpen, setGripPopoverOpen] = React.useState(false);
258
- const previewSource = usePreviewSource();
259
- const requireDraft = useRequireDraftSource();
260
- const isReadOnly = previewSource !== "draft";
261
258
  const t1 = String(block.id);
262
259
  let t2;
263
- if ($[1] !== isReadOnly || $[2] !== t1) {
260
+ if ($[1] !== t1) {
264
261
  t2 = {
265
262
  id: t1,
266
- animateLayoutChanges,
267
- disabled: isReadOnly
263
+ animateLayoutChanges
268
264
  };
269
- $[1] = isReadOnly;
270
- $[2] = t1;
271
- $[3] = t2;
272
- } else t2 = $[3];
265
+ $[1] = t1;
266
+ $[2] = t2;
267
+ } else t2 = $[2];
273
268
  const { attributes, listeners, setNodeRef, transform, transition, isDragging } = useSortable(t2);
274
269
  let t3;
275
- if ($[4] !== transform) {
270
+ if ($[3] !== transform) {
276
271
  t3 = CSS.Transform.toString(transform);
277
- $[4] = transform;
278
- $[5] = t3;
279
- } else t3 = $[5];
272
+ $[3] = transform;
273
+ $[4] = t3;
274
+ } else t3 = $[4];
280
275
  const t4 = isDragging ? 0 : 1;
281
276
  let t5;
282
- if ($[6] !== t3 || $[7] !== t4 || $[8] !== transition) {
277
+ if ($[5] !== t3 || $[6] !== t4 || $[7] !== transition) {
283
278
  t5 = {
284
279
  transform: t3,
285
280
  transition,
286
281
  opacity: t4
287
282
  };
288
- $[6] = t3;
289
- $[7] = t4;
290
- $[8] = transition;
291
- $[9] = t5;
292
- } else t5 = $[9];
283
+ $[5] = t3;
284
+ $[6] = t4;
285
+ $[7] = transition;
286
+ $[8] = t5;
287
+ } else t5 = $[8];
293
288
  const style = t5;
294
289
  const ctx = useBlockTreeItem(block, isDragging);
295
- const t6 = isReadOnly ? "cursor-not-allowed opacity-50" : "cursor-grab active:cursor-grabbing";
290
+ let t6;
296
291
  let t7;
297
- if ($[10] !== t6) {
298
- t7 = cn("text-muted-foreground hover:text-foreground flex", t6);
299
- $[10] = t6;
300
- $[11] = t7;
301
- } else t7 = $[11];
302
- let t8;
303
- if ($[12] !== attributes || $[13] !== isReadOnly) {
304
- t8 = isReadOnly ? {} : attributes;
305
- $[12] = attributes;
306
- $[13] = isReadOnly;
307
- $[14] = t8;
308
- } else t8 = $[14];
309
- let t9;
310
- if ($[15] !== isReadOnly || $[16] !== listeners) {
311
- t9 = isReadOnly ? {} : listeners;
312
- $[15] = isReadOnly;
313
- $[16] = listeners;
314
- $[17] = t9;
315
- } else t9 = $[17];
316
- let t10;
317
- if ($[18] !== isReadOnly || $[19] !== requireDraft) {
318
- t10 = isReadOnly ? (e) => {
319
- e.preventDefault();
320
- e.stopPropagation();
321
- requireDraft();
322
- } : void 0;
323
- $[18] = isReadOnly;
324
- $[19] = requireDraft;
325
- $[20] = t10;
326
- } else t10 = $[20];
327
- let t11;
328
- let t12;
329
- if ($[21] === Symbol.for("react.memo_cache_sentinel")) {
330
- t11 = /* @__PURE__ */ jsx("span", {
292
+ if ($[9] === Symbol.for("react.memo_cache_sentinel")) {
293
+ t6 = /* @__PURE__ */ jsx("span", {
331
294
  className: "sr-only",
332
295
  children: "Click and use arrow keys to reorder"
333
296
  });
334
- t12 = /* @__PURE__ */ jsx(GripVertical, { className: "h-4 w-4" });
335
- $[21] = t11;
336
- $[22] = t12;
297
+ t7 = /* @__PURE__ */ jsx(GripVertical, { className: "h-4 w-4" });
298
+ $[9] = t6;
299
+ $[10] = t7;
337
300
  } else {
338
- t11 = $[21];
339
- t12 = $[22];
301
+ t6 = $[9];
302
+ t7 = $[10];
340
303
  }
341
- let t13;
342
- if ($[23] !== t10 || $[24] !== t7 || $[25] !== t8 || $[26] !== t9) {
343
- t13 = /* @__PURE__ */ jsxs(Button, {
304
+ let t8;
305
+ if ($[11] !== attributes || $[12] !== listeners) {
306
+ t8 = /* @__PURE__ */ jsxs(Button, {
344
307
  variant: "ghost",
345
308
  size: "icon-sm",
346
- className: t7,
347
- ...t8,
348
- ...t9,
349
- onClick: t10,
350
- children: [t11, t12]
309
+ className: "text-muted-foreground hover:text-foreground flex cursor-grab active:cursor-grabbing",
310
+ ...attributes,
311
+ ...listeners,
312
+ children: [t6, t7]
351
313
  });
352
- $[23] = t10;
353
- $[24] = t7;
354
- $[25] = t8;
355
- $[26] = t9;
356
- $[27] = t13;
357
- } else t13 = $[27];
358
- const gripButton = t13;
359
- let t14;
360
- if ($[28] !== block || $[29] !== gripButton || $[30] !== gripPopoverOpen || $[31] !== isReadOnly) {
361
- t14 = isReadOnly ? gripButton : /* @__PURE__ */ jsx(BlockActionsPopover, {
314
+ $[11] = attributes;
315
+ $[12] = listeners;
316
+ $[13] = t8;
317
+ } else t8 = $[13];
318
+ const gripButton = t8;
319
+ let t9;
320
+ if ($[14] !== block || $[15] !== gripButton || $[16] !== gripPopoverOpen) {
321
+ t9 = /* @__PURE__ */ jsx(BlockActionsPopover, {
362
322
  block,
363
323
  open: gripPopoverOpen,
364
324
  onOpenChange: setGripPopoverOpen,
365
325
  children: gripButton
366
326
  });
367
- $[28] = block;
368
- $[29] = gripButton;
369
- $[30] = gripPopoverOpen;
370
- $[31] = isReadOnly;
371
- $[32] = t14;
372
- } else t14 = $[32];
373
- const t15 = block.summary || block.type;
374
- let t16;
375
- if ($[33] !== ctx.toggleSelection || $[34] !== t15) {
376
- t16 = /* @__PURE__ */ jsx(BlockTreeItemTrigger, {
377
- displayText: t15,
327
+ $[14] = block;
328
+ $[15] = gripButton;
329
+ $[16] = gripPopoverOpen;
330
+ $[17] = t9;
331
+ } else t9 = $[17];
332
+ const t10 = block.summary || block.type;
333
+ let t11;
334
+ if ($[18] !== ctx.toggleSelection || $[19] !== t10) {
335
+ t11 = /* @__PURE__ */ jsx(BlockTreeItemTrigger, {
336
+ displayText: t10,
378
337
  onClick: ctx.toggleSelection
379
338
  });
380
- $[33] = ctx.toggleSelection;
381
- $[34] = t15;
382
- $[35] = t16;
383
- } else t16 = $[35];
384
- let t17;
385
- if ($[36] !== block || $[37] !== ctx.ellipsisPopoverOpen || $[38] !== ctx.setEllipsisPopoverOpen || $[39] !== isReadOnly || $[40] !== requireDraft) {
386
- t17 = isReadOnly ? /* @__PURE__ */ jsx(BlockTreeItemEllipsis, {
387
- open: false,
388
- onClick: (e_0) => {
389
- e_0.preventDefault();
390
- e_0.stopPropagation();
391
- requireDraft();
392
- }
393
- }) : /* @__PURE__ */ jsx(BlockActionsPopover, {
339
+ $[18] = ctx.toggleSelection;
340
+ $[19] = t10;
341
+ $[20] = t11;
342
+ } else t11 = $[20];
343
+ let t12;
344
+ if ($[21] !== ctx.ellipsisPopoverOpen) {
345
+ t12 = /* @__PURE__ */ jsx(BlockTreeItemEllipsis, { open: ctx.ellipsisPopoverOpen });
346
+ $[21] = ctx.ellipsisPopoverOpen;
347
+ $[22] = t12;
348
+ } else t12 = $[22];
349
+ let t13;
350
+ if ($[23] !== block || $[24] !== ctx.ellipsisPopoverOpen || $[25] !== ctx.setEllipsisPopoverOpen || $[26] !== t12) {
351
+ t13 = /* @__PURE__ */ jsx(BlockActionsPopover, {
394
352
  block,
395
353
  open: ctx.ellipsisPopoverOpen,
396
354
  onOpenChange: ctx.setEllipsisPopoverOpen,
397
- children: /* @__PURE__ */ jsx(BlockTreeItemEllipsis, { open: ctx.ellipsisPopoverOpen })
355
+ children: t12
398
356
  });
399
- $[36] = block;
400
- $[37] = ctx.ellipsisPopoverOpen;
401
- $[38] = ctx.setEllipsisPopoverOpen;
402
- $[39] = isReadOnly;
403
- $[40] = requireDraft;
404
- $[41] = t17;
405
- } else t17 = $[41];
406
- let t18;
407
- if ($[42] !== ctx.handleBlockMouseEnter || $[43] !== ctx.handleBlockMouseLeave || $[44] !== ctx.shouldShowActive || $[45] !== ctx.shouldShowHover || $[46] !== setNodeRef || $[47] !== style || $[48] !== t14 || $[49] !== t16 || $[50] !== t17) {
408
- t18 = /* @__PURE__ */ jsxs(BlockTreeItemHeader, {
357
+ $[23] = block;
358
+ $[24] = ctx.ellipsisPopoverOpen;
359
+ $[25] = ctx.setEllipsisPopoverOpen;
360
+ $[26] = t12;
361
+ $[27] = t13;
362
+ } else t13 = $[27];
363
+ let t14;
364
+ if ($[28] !== ctx.handleBlockMouseEnter || $[29] !== ctx.handleBlockMouseLeave || $[30] !== ctx.shouldShowActive || $[31] !== ctx.shouldShowHover || $[32] !== setNodeRef || $[33] !== style || $[34] !== t11 || $[35] !== t13 || $[36] !== t9) {
365
+ t14 = /* @__PURE__ */ jsxs(BlockTreeItemHeader, {
409
366
  ref: setNodeRef,
410
367
  style,
411
368
  className: "group",
@@ -414,98 +371,105 @@ const SortableBlock = (t0) => {
414
371
  onMouseEnter: ctx.handleBlockMouseEnter,
415
372
  onMouseLeave: ctx.handleBlockMouseLeave,
416
373
  children: [
417
- t14,
418
- t16,
419
- t17
374
+ t9,
375
+ t11,
376
+ t13
420
377
  ]
421
378
  });
422
- $[42] = ctx.handleBlockMouseEnter;
423
- $[43] = ctx.handleBlockMouseLeave;
424
- $[44] = ctx.shouldShowActive;
425
- $[45] = ctx.shouldShowHover;
426
- $[46] = setNodeRef;
427
- $[47] = style;
428
- $[48] = t14;
429
- $[49] = t16;
430
- $[50] = t17;
431
- $[51] = t18;
432
- } else t18 = $[51];
433
- return t18;
379
+ $[28] = ctx.handleBlockMouseEnter;
380
+ $[29] = ctx.handleBlockMouseLeave;
381
+ $[30] = ctx.shouldShowActive;
382
+ $[31] = ctx.shouldShowHover;
383
+ $[32] = setNodeRef;
384
+ $[33] = style;
385
+ $[34] = t11;
386
+ $[35] = t13;
387
+ $[36] = t9;
388
+ $[37] = t14;
389
+ } else t14 = $[37];
390
+ return t14;
434
391
  };
435
392
  const LayoutBlockItem = (t0) => {
436
- const $ = c(27);
437
- if ($[0] !== "e2e18e0d8166e0ab2847dfaad4af267e4cb38ede982af367ff19b699a6d19a10") {
438
- for (let $i = 0; $i < 27; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
439
- $[0] = "e2e18e0d8166e0ab2847dfaad4af267e4cb38ede982af367ff19b699a6d19a10";
393
+ const $ = c(29);
394
+ if ($[0] !== "471c3efab23632ac0a363f528fa97ab43f3bcb61e240c961d3c95d63897d691d") {
395
+ for (let $i = 0; $i < 29; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
396
+ $[0] = "471c3efab23632ac0a363f528fa97ab43f3bcb61e240c961d3c95d63897d691d";
440
397
  }
441
- const { block, layoutName } = t0;
398
+ const { block, layoutName, derived: t1 } = t0;
399
+ const derived = t1 === void 0 ? false : t1;
442
400
  const camoxApp = useCamoxApp();
443
- let t1;
401
+ let t2;
444
402
  if ($[1] !== block.type || $[2] !== camoxApp) {
445
- t1 = camoxApp.getBlockById(block.type);
403
+ t2 = camoxApp.getBlockById(block.type);
446
404
  $[1] = block.type;
447
405
  $[2] = camoxApp;
448
- $[3] = t1;
449
- } else t1 = $[3];
450
- const blockDef = t1;
406
+ $[3] = t2;
407
+ } else t2 = $[3];
408
+ const blockDef = t2;
451
409
  const ctx = useBlockTreeItem(block);
452
- const previewSource = usePreviewSource();
453
410
  const requireDraft = useRequireDraftSource();
454
- const isReadOnly = previewSource !== "draft";
455
411
  const displayText = blockDef?._internal.title ?? block.type;
456
- let t2;
457
- if ($[4] === Symbol.for("react.memo_cache_sentinel")) {
458
- t2 = /* @__PURE__ */ jsx(TooltipTrigger, { children: /* @__PURE__ */ jsx(LayoutTemplate, { className: "h-4 w-4" }) });
459
- $[4] = t2;
460
- } else t2 = $[4];
461
412
  let t3;
413
+ if ($[4] === Symbol.for("react.memo_cache_sentinel")) {
414
+ t3 = /* @__PURE__ */ jsx(TooltipTrigger, { children: /* @__PURE__ */ jsx(LayoutTemplate, { className: "h-4 w-4" }) });
415
+ $[4] = t3;
416
+ } else t3 = $[4];
417
+ let t4;
462
418
  if ($[5] !== layoutName) {
463
- t3 = /* @__PURE__ */ jsx("span", {
419
+ t4 = /* @__PURE__ */ jsx("span", {
464
420
  className: "font-semibold",
465
421
  children: layoutName
466
422
  });
467
423
  $[5] = layoutName;
468
- $[6] = t3;
469
- } else t3 = $[6];
470
- let t4;
471
- if ($[7] === Symbol.for("react.memo_cache_sentinel")) {
472
- t4 = /* @__PURE__ */ jsx("br", {});
473
- $[7] = t4;
474
- } else t4 = $[7];
424
+ $[6] = t4;
425
+ } else t4 = $[6];
475
426
  let t5;
476
- if ($[8] !== t3) {
477
- t5 = /* @__PURE__ */ jsx("div", {
427
+ if ($[7] === Symbol.for("react.memo_cache_sentinel")) {
428
+ t5 = /* @__PURE__ */ jsx("br", {});
429
+ $[7] = t5;
430
+ } else t5 = $[7];
431
+ const t6 = blockDef?._internal.synced ? "Synced: editing this block updates it across all layouts and pages" : "Changing the content may affect other pages";
432
+ let t7;
433
+ if ($[8] !== t4 || $[9] !== t6) {
434
+ t7 = /* @__PURE__ */ jsx("div", {
478
435
  className: "text-muted-foreground flex size-8 shrink-0 items-center justify-center",
479
- children: /* @__PURE__ */ jsxs(Tooltip, { children: [t2, /* @__PURE__ */ jsxs(TooltipContent, { children: [
436
+ children: /* @__PURE__ */ jsxs(Tooltip, { children: [t3, /* @__PURE__ */ jsxs(TooltipContent, { children: [
480
437
  "From ",
481
- t3,
482
- " layout.",
483
438
  t4,
484
- "Changing the content may affect other pages"
439
+ " layout.",
440
+ t5,
441
+ t6
485
442
  ] })] })
486
443
  });
487
- $[8] = t3;
488
- $[9] = t5;
489
- } else t5 = $[9];
490
- let t6;
491
- if ($[10] !== ctx.toggleSelection || $[11] !== displayText) {
492
- t6 = /* @__PURE__ */ jsx(BlockTreeItemTrigger, {
444
+ $[8] = t4;
445
+ $[9] = t6;
446
+ $[10] = t7;
447
+ } else t7 = $[10];
448
+ let t8;
449
+ if ($[11] !== ctx.toggleSelection || $[12] !== displayText) {
450
+ t8 = /* @__PURE__ */ jsx(BlockTreeItemTrigger, {
493
451
  displayText,
494
452
  onClick: ctx.toggleSelection
495
453
  });
496
- $[10] = ctx.toggleSelection;
497
- $[11] = displayText;
498
- $[12] = t6;
499
- } else t6 = $[12];
500
- let t7;
501
- if ($[13] !== block || $[14] !== ctx.ellipsisPopoverOpen || $[15] !== ctx.setEllipsisPopoverOpen || $[16] !== isReadOnly || $[17] !== requireDraft) {
502
- t7 = isReadOnly ? /* @__PURE__ */ jsx(BlockTreeItemEllipsis, {
503
- open: false,
504
- onClick: (e) => {
505
- e.preventDefault();
506
- e.stopPropagation();
507
- requireDraft();
508
- }
454
+ $[11] = ctx.toggleSelection;
455
+ $[12] = displayText;
456
+ $[13] = t8;
457
+ } else t8 = $[13];
458
+ let t9;
459
+ if ($[14] !== block || $[15] !== ctx.ellipsisPopoverOpen || $[16] !== ctx.setEllipsisPopoverOpen || $[17] !== derived || $[18] !== displayText || $[19] !== requireDraft) {
460
+ t9 = derived ? /* @__PURE__ */ jsx(Button, {
461
+ variant: "ghost",
462
+ size: "icon-sm",
463
+ className: "text-muted-foreground hidden group-focus-within:flex group-hover:flex",
464
+ "aria-label": `Edit ${displayText} in form`,
465
+ onClick: () => {
466
+ if (!requireDraft()) return;
467
+ previewStore.send({
468
+ type: "openBlockContentSheet",
469
+ blockId: block.id
470
+ });
471
+ },
472
+ children: /* @__PURE__ */ jsx(Pencil, { className: "size-4" })
509
473
  }) : /* @__PURE__ */ jsx(BlockActionsPopover, {
510
474
  block,
511
475
  open: ctx.ellipsisPopoverOpen,
@@ -514,48 +478,86 @@ const LayoutBlockItem = (t0) => {
514
478
  layoutPlacement: block.placement,
515
479
  children: /* @__PURE__ */ jsx(BlockTreeItemEllipsis, { open: ctx.ellipsisPopoverOpen })
516
480
  });
517
- $[13] = block;
518
- $[14] = ctx.ellipsisPopoverOpen;
519
- $[15] = ctx.setEllipsisPopoverOpen;
520
- $[16] = isReadOnly;
521
- $[17] = requireDraft;
522
- $[18] = t7;
523
- } else t7 = $[18];
524
- let t8;
525
- if ($[19] !== ctx.handleBlockMouseEnter || $[20] !== ctx.handleBlockMouseLeave || $[21] !== ctx.shouldShowActive || $[22] !== ctx.shouldShowHover || $[23] !== t5 || $[24] !== t6 || $[25] !== t7) {
526
- t8 = /* @__PURE__ */ jsxs(BlockTreeItemHeader, {
481
+ $[14] = block;
482
+ $[15] = ctx.ellipsisPopoverOpen;
483
+ $[16] = ctx.setEllipsisPopoverOpen;
484
+ $[17] = derived;
485
+ $[18] = displayText;
486
+ $[19] = requireDraft;
487
+ $[20] = t9;
488
+ } else t9 = $[20];
489
+ let t10;
490
+ if ($[21] !== ctx.handleBlockMouseEnter || $[22] !== ctx.handleBlockMouseLeave || $[23] !== ctx.shouldShowActive || $[24] !== ctx.shouldShowHover || $[25] !== t7 || $[26] !== t8 || $[27] !== t9) {
491
+ t10 = /* @__PURE__ */ jsxs(BlockTreeItemHeader, {
527
492
  className: "group",
528
493
  shouldShowHover: ctx.shouldShowHover,
529
494
  shouldShowActive: ctx.shouldShowActive,
530
495
  onMouseEnter: ctx.handleBlockMouseEnter,
531
496
  onMouseLeave: ctx.handleBlockMouseLeave,
532
497
  children: [
533
- t5,
534
- t6,
535
- t7
498
+ t7,
499
+ t8,
500
+ t9
536
501
  ]
537
502
  });
538
- $[19] = ctx.handleBlockMouseEnter;
539
- $[20] = ctx.handleBlockMouseLeave;
540
- $[21] = ctx.shouldShowActive;
541
- $[22] = ctx.shouldShowHover;
542
- $[23] = t5;
543
- $[24] = t6;
503
+ $[21] = ctx.handleBlockMouseEnter;
504
+ $[22] = ctx.handleBlockMouseLeave;
505
+ $[23] = ctx.shouldShowActive;
506
+ $[24] = ctx.shouldShowHover;
544
507
  $[25] = t7;
545
508
  $[26] = t8;
546
- } else t8 = $[26];
547
- return t8;
509
+ $[27] = t9;
510
+ $[28] = t10;
511
+ } else t10 = $[28];
512
+ return t10;
513
+ };
514
+ const BlockInsertionIndicator = () => {
515
+ const $ = c(4);
516
+ if ($[0] !== "471c3efab23632ac0a363f528fa97ab43f3bcb61e240c961d3c95d63897d691d") {
517
+ for (let $i = 0; $i < 4; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
518
+ $[0] = "471c3efab23632ac0a363f528fa97ab43f3bcb61e240c961d3c95d63897d691d";
519
+ }
520
+ const ref = React.useRef(null);
521
+ let t0;
522
+ let t1;
523
+ if ($[1] === Symbol.for("react.memo_cache_sentinel")) {
524
+ t0 = () => {
525
+ ref.current?.scrollIntoView({ block: "nearest" });
526
+ };
527
+ t1 = [];
528
+ $[1] = t0;
529
+ $[2] = t1;
530
+ } else {
531
+ t0 = $[1];
532
+ t1 = $[2];
533
+ }
534
+ React.useEffect(t0, t1);
535
+ let t2;
536
+ if ($[3] === Symbol.for("react.memo_cache_sentinel")) {
537
+ t2 = /* @__PURE__ */ jsx("div", {
538
+ ref,
539
+ className: "pointer-events-none relative z-30 h-2 shrink-0",
540
+ "aria-hidden": "true",
541
+ children: /* @__PURE__ */ jsx("div", {
542
+ className: "bg-primary absolute inset-x-1 top-1/2 h-0.5 -translate-y-1/2 rounded-full motion-safe:animate-pulse",
543
+ children: /* @__PURE__ */ jsx("div", { className: "bg-primary absolute -top-0.5 -left-0.5 size-1.5 rounded-full" })
544
+ })
545
+ });
546
+ $[3] = t2;
547
+ } else t2 = $[3];
548
+ return t2;
548
549
  };
549
550
  const PageTree = () => {
550
- const $ = c(56);
551
- if ($[0] !== "e2e18e0d8166e0ab2847dfaad4af267e4cb38ede982af367ff19b699a6d19a10") {
552
- for (let $i = 0; $i < 56; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
553
- $[0] = "e2e18e0d8166e0ab2847dfaad4af267e4cb38ede982af367ff19b699a6d19a10";
551
+ const $ = c(68);
552
+ if ($[0] !== "471c3efab23632ac0a363f528fa97ab43f3bcb61e240c961d3c95d63897d691d") {
553
+ for (let $i = 0; $i < 68; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
554
+ $[0] = "471c3efab23632ac0a363f528fa97ab43f3bcb61e240c961d3c95d63897d691d";
554
555
  }
555
556
  const page = usePreviewedPage();
557
+ const isAddBlockSidebarOpen = useSelector(previewStore, _temp3);
558
+ const peekedBlockPosition = useSelector(previewStore, _temp4);
556
559
  const previewSource = usePreviewSource();
557
560
  const requireDraft = useRequireDraftSource();
558
- const isReadOnly = previewSource !== "draft";
559
561
  const { pageBlocks, beforeBlocks: layoutBeforeBlocks, afterBlocks: layoutAfterBlocks } = usePageBlocks(page, previewSource);
560
562
  const camoxApp = useCamoxApp();
561
563
  const updatePosition = useUpdateBlockPosition();
@@ -642,52 +644,85 @@ const PageTree = () => {
642
644
  } else t5 = $[12];
643
645
  const layout = t5;
644
646
  let t6;
645
- if ($[13] !== layout?._internal || $[14] !== layoutBeforeBlocks) {
647
+ if ($[13] !== pageBlocks || $[14] !== peekedBlockPosition) {
646
648
  let t7;
647
- if ($[16] !== layout?._internal) {
648
- t7 = (block_1) => /* @__PURE__ */ jsx(LayoutBlockItem, {
649
- block: block_1,
650
- layoutName: layout?._internal.title ?? "Unknown"
651
- }, String(block_1.id));
652
- $[16] = layout?._internal;
649
+ if ($[16] !== peekedBlockPosition) {
650
+ t7 = (block_1) => peekedBlockPosition != null && block_1.position > peekedBlockPosition;
651
+ $[16] = peekedBlockPosition;
653
652
  $[17] = t7;
654
653
  } else t7 = $[17];
655
- t6 = layoutBeforeBlocks.map(t7);
656
- $[13] = layout?._internal;
657
- $[14] = layoutBeforeBlocks;
654
+ t6 = pageBlocks.findIndex(t7);
655
+ $[13] = pageBlocks;
656
+ $[14] = peekedBlockPosition;
658
657
  $[15] = t6;
659
658
  } else t6 = $[15];
659
+ const nextBlockIndex = t6;
660
+ const insertionIndex = peekedBlockPosition === "" ? 0 : nextBlockIndex === -1 ? pageBlocks.length : nextBlockIndex;
660
661
  let t7;
661
- if ($[18] === Symbol.for("react.memo_cache_sentinel")) {
662
- t7 = [restrictToVerticalAxis];
663
- $[18] = t7;
664
- } else t7 = $[18];
662
+ if ($[18] !== layout?._internal || $[19] !== layoutBeforeBlocks) {
663
+ let t8;
664
+ if ($[21] !== layout?._internal) {
665
+ t8 = (block_2) => /* @__PURE__ */ jsx(LayoutBlockItem, {
666
+ block: block_2,
667
+ layoutName: layout?._internal.title ?? "Unknown"
668
+ }, String(block_2.id));
669
+ $[21] = layout?._internal;
670
+ $[22] = t8;
671
+ } else t8 = $[22];
672
+ t7 = layoutBeforeBlocks.map(t8);
673
+ $[18] = layout?._internal;
674
+ $[19] = layoutBeforeBlocks;
675
+ $[20] = t7;
676
+ } else t7 = $[20];
665
677
  let t8;
666
- if ($[19] !== pageBlocks) {
667
- t8 = pageBlocks.map(_temp4);
668
- $[19] = pageBlocks;
669
- $[20] = t8;
670
- } else t8 = $[20];
678
+ if ($[23] === Symbol.for("react.memo_cache_sentinel")) {
679
+ t8 = [restrictToVerticalAxis];
680
+ $[23] = t8;
681
+ } else t8 = $[23];
671
682
  let t9;
672
- if ($[21] !== pageBlocks) {
683
+ if ($[24] !== pageBlocks) {
673
684
  t9 = pageBlocks.map(_temp5);
674
- $[21] = pageBlocks;
675
- $[22] = t9;
676
- } else t9 = $[22];
685
+ $[24] = pageBlocks;
686
+ $[25] = t9;
687
+ } else t9 = $[25];
677
688
  let t10;
678
- if ($[23] !== t8 || $[24] !== t9) {
679
- t10 = /* @__PURE__ */ jsx(SortableContext, {
680
- items: t8,
689
+ if ($[26] !== insertionIndex || $[27] !== isAddBlockSidebarOpen || $[28] !== pageBlocks) {
690
+ let t11;
691
+ if ($[30] !== insertionIndex || $[31] !== isAddBlockSidebarOpen) {
692
+ t11 = (block_4, index) => /* @__PURE__ */ jsxs(React.Fragment, { children: [isAddBlockSidebarOpen && index === insertionIndex && /* @__PURE__ */ jsx(BlockInsertionIndicator, {}), /* @__PURE__ */ jsx(SortableBlock, { block: block_4 })] }, String(block_4.id));
693
+ $[30] = insertionIndex;
694
+ $[31] = isAddBlockSidebarOpen;
695
+ $[32] = t11;
696
+ } else t11 = $[32];
697
+ t10 = pageBlocks.map(t11);
698
+ $[26] = insertionIndex;
699
+ $[27] = isAddBlockSidebarOpen;
700
+ $[28] = pageBlocks;
701
+ $[29] = t10;
702
+ } else t10 = $[29];
703
+ let t11;
704
+ if ($[33] !== insertionIndex || $[34] !== isAddBlockSidebarOpen || $[35] !== pageBlocks.length) {
705
+ t11 = isAddBlockSidebarOpen && insertionIndex === pageBlocks.length && /* @__PURE__ */ jsx(BlockInsertionIndicator, {});
706
+ $[33] = insertionIndex;
707
+ $[34] = isAddBlockSidebarOpen;
708
+ $[35] = pageBlocks.length;
709
+ $[36] = t11;
710
+ } else t11 = $[36];
711
+ let t12;
712
+ if ($[37] !== t10 || $[38] !== t11 || $[39] !== t9) {
713
+ t12 = /* @__PURE__ */ jsxs(SortableContext, {
714
+ items: t9,
681
715
  strategy: verticalListSortingStrategy,
682
- children: t9
716
+ children: [t10, t11]
683
717
  });
684
- $[23] = t8;
685
- $[24] = t9;
686
- $[25] = t10;
687
- } else t10 = $[25];
688
- let t11;
689
- if ($[26] !== activeId || $[27] !== pageBlocks) {
690
- t11 = activeId ? (() => {
718
+ $[37] = t10;
719
+ $[38] = t11;
720
+ $[39] = t9;
721
+ $[40] = t12;
722
+ } else t12 = $[40];
723
+ let t13;
724
+ if ($[41] !== activeId || $[42] !== pageBlocks) {
725
+ t13 = activeId ? (() => {
691
726
  const activeBlock = pageBlocks.find((b) => String(b.id) === activeId);
692
727
  if (!activeBlock) return null;
693
728
  return /* @__PURE__ */ jsx("div", {
@@ -701,76 +736,69 @@ const PageTree = () => {
701
736
  })
702
737
  });
703
738
  })() : null;
704
- $[26] = activeId;
705
- $[27] = pageBlocks;
706
- $[28] = t11;
707
- } else t11 = $[28];
708
- let t12;
709
- if ($[29] !== t11) {
710
- t12 = /* @__PURE__ */ jsx(DragOverlay, {
739
+ $[41] = activeId;
740
+ $[42] = pageBlocks;
741
+ $[43] = t13;
742
+ } else t13 = $[43];
743
+ let t14;
744
+ if ($[44] !== t13) {
745
+ t14 = /* @__PURE__ */ jsx(DragOverlay, {
711
746
  dropAnimation: null,
712
- children: t11
747
+ children: t13
713
748
  });
714
- $[29] = t11;
715
- $[30] = t12;
716
- } else t12 = $[30];
717
- let t13;
718
- if ($[31] !== handleDragEnd || $[32] !== sensors || $[33] !== t10 || $[34] !== t12) {
719
- t13 = /* @__PURE__ */ jsxs(DndContext, {
749
+ $[44] = t13;
750
+ $[45] = t14;
751
+ } else t14 = $[45];
752
+ let t15;
753
+ if ($[46] !== handleDragEnd || $[47] !== sensors || $[48] !== t12 || $[49] !== t14) {
754
+ t15 = /* @__PURE__ */ jsxs(DndContext, {
720
755
  sensors,
721
756
  collisionDetection: closestCenter,
722
757
  onDragStart: handleDragStart,
723
758
  onDragEnd: handleDragEnd,
724
759
  onDragCancel: handleDragCancel,
725
- modifiers: t7,
726
- children: [t10, t12]
760
+ modifiers: t8,
761
+ children: [t12, t14]
727
762
  });
728
- $[31] = handleDragEnd;
729
- $[32] = sensors;
730
- $[33] = t10;
731
- $[34] = t12;
732
- $[35] = t13;
733
- } else t13 = $[35];
734
- let t14;
735
- if ($[36] !== layout?._internal || $[37] !== layoutAfterBlocks) {
736
- let t15;
737
- if ($[39] !== layout?._internal) {
738
- t15 = (block_4) => /* @__PURE__ */ jsx(LayoutBlockItem, {
739
- block: block_4,
763
+ $[46] = handleDragEnd;
764
+ $[47] = sensors;
765
+ $[48] = t12;
766
+ $[49] = t14;
767
+ $[50] = t15;
768
+ } else t15 = $[50];
769
+ let t16;
770
+ if ($[51] !== layout?._internal || $[52] !== layoutAfterBlocks) {
771
+ let t17;
772
+ if ($[54] !== layout?._internal) {
773
+ t17 = (block_5) => /* @__PURE__ */ jsx(LayoutBlockItem, {
774
+ block: block_5,
740
775
  layoutName: layout?._internal.title ?? "Unknown"
741
- }, String(block_4.id));
742
- $[39] = layout?._internal;
743
- $[40] = t15;
744
- } else t15 = $[40];
745
- t14 = layoutAfterBlocks.map(t15);
746
- $[36] = layout?._internal;
747
- $[37] = layoutAfterBlocks;
748
- $[38] = t14;
749
- } else t14 = $[38];
750
- let t15;
751
- if ($[41] !== t13 || $[42] !== t14 || $[43] !== t6) {
752
- t15 = /* @__PURE__ */ jsxs("div", {
776
+ }, String(block_5.id));
777
+ $[54] = layout?._internal;
778
+ $[55] = t17;
779
+ } else t17 = $[55];
780
+ t16 = layoutAfterBlocks.map(t17);
781
+ $[51] = layout?._internal;
782
+ $[52] = layoutAfterBlocks;
783
+ $[53] = t16;
784
+ } else t16 = $[53];
785
+ let t17;
786
+ if ($[56] !== t15 || $[57] !== t16 || $[58] !== t7) {
787
+ t17 = /* @__PURE__ */ jsxs("div", {
753
788
  className: "flex flex-col gap-0.5",
754
789
  children: [
755
- t6,
756
- t13,
757
- t14
790
+ t7,
791
+ t15,
792
+ t16
758
793
  ]
759
794
  });
760
- $[41] = t13;
761
- $[42] = t14;
762
- $[43] = t6;
763
- $[44] = t15;
764
- } else t15 = $[44];
765
- const t16 = isReadOnly && "opacity-50 cursor-not-allowed";
766
- let t17;
767
- if ($[45] !== t16) {
768
- t17 = cn(t16);
769
- $[45] = t16;
770
- $[46] = t17;
771
- } else t17 = $[46];
795
+ $[56] = t15;
796
+ $[57] = t16;
797
+ $[58] = t7;
798
+ $[59] = t17;
799
+ } else t17 = $[59];
772
800
  let t18;
773
- if ($[47] !== requireDraft) {
801
+ if ($[60] !== requireDraft) {
774
802
  t18 = () => {
775
803
  if (!requireDraft()) return;
776
804
  previewStore.send({
@@ -778,44 +806,42 @@ const PageTree = () => {
778
806
  via: "page-tree"
779
807
  });
780
808
  };
781
- $[47] = requireDraft;
782
- $[48] = t18;
783
- } else t18 = $[48];
809
+ $[60] = requireDraft;
810
+ $[61] = t18;
811
+ } else t18 = $[61];
784
812
  let t19;
785
- if ($[49] === Symbol.for("react.memo_cache_sentinel")) {
813
+ if ($[62] === Symbol.for("react.memo_cache_sentinel")) {
786
814
  t19 = /* @__PURE__ */ jsx(Plus, {});
787
- $[49] = t19;
788
- } else t19 = $[49];
815
+ $[62] = t19;
816
+ } else t19 = $[62];
789
817
  let t20;
790
- if ($[50] !== t17 || $[51] !== t18) {
818
+ if ($[63] !== t18) {
791
819
  t20 = /* @__PURE__ */ jsxs(Button, {
792
820
  variant: "secondary",
793
- className: t17,
794
821
  onClick: t18,
795
822
  children: [t19, "Add block"]
796
823
  });
797
- $[50] = t17;
798
- $[51] = t18;
799
- $[52] = t20;
800
- } else t20 = $[52];
824
+ $[63] = t18;
825
+ $[64] = t20;
826
+ } else t20 = $[64];
801
827
  let t21;
802
- if ($[53] !== t15 || $[54] !== t20) {
803
- t21 = /* @__PURE__ */ jsxs(Fragment, { children: [t15, t20] });
804
- $[53] = t15;
805
- $[54] = t20;
806
- $[55] = t21;
807
- } else t21 = $[55];
828
+ if ($[65] !== t17 || $[66] !== t20) {
829
+ t21 = /* @__PURE__ */ jsxs(Fragment, { children: [t17, t20] });
830
+ $[65] = t17;
831
+ $[66] = t20;
832
+ $[67] = t21;
833
+ } else t21 = $[67];
808
834
  return t21;
809
835
  };
810
- function _temp(state) {
811
- return state.context.previewSource;
836
+ function _temp3(state) {
837
+ return state.context.isAddBlockSidebarOpen;
812
838
  }
813
- function _temp4(block_2) {
814
- return String(block_2.id);
839
+ function _temp4(state_0) {
840
+ return state_0.context.peekedBlockPosition;
815
841
  }
816
842
  function _temp5(block_3) {
817
- return /* @__PURE__ */ jsx(SortableBlock, { block: block_3 }, String(block_3.id));
843
+ return String(block_3.id);
818
844
  }
819
845
 
820
846
  //#endregion
821
- export { PageTree };
847
+ export { LayoutBlockItem, PageTree };