camox 0.32.0 → 0.33.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.
Files changed (58) hide show
  1. package/dist/core/createBlock.d.ts +1 -1
  2. package/dist/core/createBlock.js +88 -108
  3. package/dist/core/hooks/useIsEditable.js +6 -10
  4. package/dist/core/lib/fieldTypes.js +10 -219
  5. package/dist/features/agent-chat/components/AgentChatSidebar.js +172 -0
  6. package/dist/features/agent-chat/components/AgentChatThread.js +9 -9
  7. package/dist/features/preview/CamoxPreview.js +137 -729
  8. package/dist/features/preview/components/{AddBlockSheet.js → AddBlockSidebar.js} +121 -131
  9. package/dist/features/preview/components/AssetFieldEditor.js +107 -82
  10. package/dist/features/preview/components/AssetLightbox.js +4 -4
  11. package/dist/features/preview/components/AssetPickerModal.js +277 -0
  12. package/dist/features/preview/components/BlockActionsPopover.js +18 -24
  13. package/dist/features/preview/components/CreatePageModal.js +6 -6
  14. package/dist/features/preview/components/FieldToolbar.js +64 -127
  15. package/dist/features/preview/components/ItemFieldsEditor.js +98 -125
  16. package/dist/features/preview/components/LeftSidebar.js +64 -0
  17. package/dist/features/preview/components/LinkFieldEditor.js +1 -1
  18. package/dist/features/preview/components/MultipleAssetFieldEditor.js +94 -56
  19. package/dist/features/preview/components/OverlayTracker.js +15 -15
  20. package/dist/features/preview/components/Overlays.js +12 -12
  21. package/dist/features/preview/components/PageEditorSidebar.js +563 -0
  22. package/dist/features/preview/components/PageInfoSidebar.js +1453 -0
  23. package/dist/features/preview/components/PageNavigatorSidebar.js +590 -0
  24. package/dist/features/preview/components/PagePicker.js +3 -3
  25. package/dist/features/preview/components/PageStatusBadge.js +1 -1
  26. package/dist/features/preview/components/PageTree.js +204 -564
  27. package/dist/features/preview/components/PreviewPanel.js +123 -158
  28. package/dist/features/preview/components/PreviewToolbar.js +260 -256
  29. package/dist/features/preview/components/PublishDialog.js +2 -2
  30. package/dist/features/preview/components/RepeatableItemsList.js +2 -2
  31. package/dist/features/preview/components/RightSidebar.js +109 -0
  32. package/dist/features/preview/components/UnlinkAssetButton.js +2 -2
  33. package/dist/features/preview/components/useRepeatableItemActions.js +3 -138
  34. package/dist/features/preview/components/useUpdateBlockPosition.js +1 -1
  35. package/dist/features/preview/previewQueryFns.js +23 -0
  36. package/dist/features/preview/previewStore.js +46 -63
  37. package/dist/features/provider/CamoxProvider.js +255 -70
  38. package/dist/features/provider/useAdminShortcuts.js +5 -48
  39. package/dist/features/routes/pageRoute.js +1 -1
  40. package/dist/features/studio/CamoxStudio.js +6 -5
  41. package/dist/features/studio/components/EnvironmentMenu.js +2 -2
  42. package/dist/features/studio/components/Navbar.js +53 -71
  43. package/dist/features/studio/components/ProjectMenu.js +1 -1
  44. package/dist/features/studio/components/UserButton.js +1 -1
  45. package/dist/features/studio/routes.js +7 -0
  46. package/dist/features/studio/useTheme.js +67 -33
  47. package/dist/features/vite/routeGeneration.js +68 -66
  48. package/dist/hooks/use-file-upload.js +1 -1
  49. package/dist/lib/auth.js +23 -22
  50. package/dist/lib/utils.js +1 -1
  51. package/dist/studio-overlays.css +1 -1
  52. package/dist/studio.css +1 -1
  53. package/package.json +4 -4
  54. package/dist/features/agent-chat/components/AgentChatSheet.js +0 -207
  55. package/dist/features/preview/components/AssetPickerGrid.js +0 -236
  56. package/dist/features/preview/components/PageContentSheet.js +0 -608
  57. package/dist/features/preview/components/PageMetadataModal.js +0 -908
  58. package/dist/features/preview/components/PreviewSideSheet.js +0 -76
@@ -1,279 +1,48 @@
1
- import { previewStore } from "../previewStore.js";
2
- import { blockQueries } from "../../../lib/queries.js";
3
1
  import { cn } from "../../../lib/utils.js";
2
+ import { previewStore } from "../previewStore.js";
4
3
  import { usePageBlocks } from "../../../lib/normalized-data.js";
5
4
  import { useCamoxApp } from "../../provider/components/CamoxAppContext.js";
6
5
  import { useRequireDraftSource } from "../../../core/hooks/useRequireDraftSource.js";
7
- import { fieldTypesDictionary } from "../../../core/lib/fieldTypes.js";
8
6
  import { useUpdateBlockPosition } from "./useUpdateBlockPosition.js";
9
7
  import { BlockActionsPopover } from "./BlockActionsPopover.js";
10
8
  import { usePreviewedPage } from "../CamoxPreview.js";
11
9
  import { c } from "react/compiler-runtime";
12
- import { useQuery } from "@tanstack/react-query";
13
10
  import { useSelector } from "@xstate/store-react";
14
11
  import * as React from "react";
15
12
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
16
13
  import { Button } from "@camox/ui/button";
14
+ import { Ellipsis, GripVertical, LayoutTemplate, Plus } from "lucide-react";
17
15
  import { Tooltip, TooltipContent, TooltipTrigger } from "@camox/ui/tooltip";
18
- import { Ellipsis, GripVertical, LayoutTemplate, Plus, Type } from "lucide-react";
19
16
  import { DndContext, DragOverlay, KeyboardSensor, PointerSensor, closestCenter, useSensor, useSensors } from "@dnd-kit/core";
20
17
  import { restrictToVerticalAxis } from "@dnd-kit/modifiers";
21
18
  import { SortableContext, defaultAnimateLayoutChanges, sortableKeyboardCoordinates, useSortable, verticalListSortingStrategy } from "@dnd-kit/sortable";
22
19
  import { CSS } from "@dnd-kit/utilities";
23
- import { Accordion } from "@base-ui/react/accordion";
24
20
 
25
21
  //#region src/features/preview/components/PageTree.tsx
26
22
  const usePreviewSource = () => {
27
23
  const $ = c(1);
28
- if ($[0] !== "4252672317e9d976c47102ba1a26a55d6393ec9a518eb0503aaa3be0355ffab7") {
24
+ if ($[0] !== "e2e18e0d8166e0ab2847dfaad4af267e4cb38ede982af367ff19b699a6d19a10") {
29
25
  for (let $i = 0; $i < 1; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
30
- $[0] = "4252672317e9d976c47102ba1a26a55d6393ec9a518eb0503aaa3be0355ffab7";
26
+ $[0] = "e2e18e0d8166e0ab2847dfaad4af267e4cb38ede982af367ff19b699a6d19a10";
31
27
  }
32
28
  return useSelector(previewStore, _temp);
33
29
  };
34
- function useEmbedTitle(url) {
35
- const $ = c(4);
36
- if ($[0] !== "4252672317e9d976c47102ba1a26a55d6393ec9a518eb0503aaa3be0355ffab7") {
37
- for (let $i = 0; $i < 4; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
38
- $[0] = "4252672317e9d976c47102ba1a26a55d6393ec9a518eb0503aaa3be0355ffab7";
39
- }
40
- const [title, setTitle] = React.useState(null);
41
- let t0;
42
- let t1;
43
- if ($[1] !== url) {
44
- t0 = () => {
45
- if (!url) return;
46
- setTitle(null);
47
- const controller = new AbortController();
48
- fetch(url, { signal: controller.signal }).then(_temp2).then((html) => {
49
- const match = html.match(/<title[^>]*>([^<]*)<\/title>/i);
50
- if (match?.[1]) setTitle(match[1].trim());
51
- }).catch(_temp3);
52
- return () => controller.abort();
53
- };
54
- t1 = [url];
55
- $[1] = url;
56
- $[2] = t0;
57
- $[3] = t1;
58
- } else {
59
- t0 = $[2];
60
- t1 = $[3];
61
- }
62
- React.useEffect(t0, t1);
63
- return title;
64
- }
65
- function _temp3() {}
66
- function _temp2(res) {
67
- return res.text();
68
- }
69
- const FieldItem = (t0) => {
70
- const $ = c(29);
71
- if ($[0] !== "4252672317e9d976c47102ba1a26a55d6393ec9a518eb0503aaa3be0355ffab7") {
72
- for (let $i = 0; $i < 29; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
73
- $[0] = "4252672317e9d976c47102ba1a26a55d6393ec9a518eb0503aaa3be0355ffab7";
74
- }
75
- const { fieldName, value, fieldType, schemaTitle, isSelected, onFieldClick, onFieldDoubleClick, onMouseEnter, onMouseLeave } = t0;
76
- const fetchedEmbedTitle = useEmbedTitle(fieldType === "Embed" ? value : null);
77
- const fieldDef = fieldType != null ? fieldTypesDictionary[fieldType] : null;
78
- let t1;
79
- if ($[1] !== fetchedEmbedTitle || $[2] !== fieldDef || $[3] !== fieldName || $[4] !== schemaTitle || $[5] !== value) {
80
- t1 = fieldDef ? fieldDef.getLabel(value, {
81
- schemaTitle,
82
- fieldName,
83
- fetchedTitle: fetchedEmbedTitle
84
- }) : JSON.stringify(value);
85
- $[1] = fetchedEmbedTitle;
86
- $[2] = fieldDef;
87
- $[3] = fieldName;
88
- $[4] = schemaTitle;
89
- $[5] = value;
90
- $[6] = t1;
91
- } else t1 = $[6];
92
- const displayValue = t1;
93
- let t2;
94
- if ($[7] !== fieldDef) {
95
- t2 = fieldDef?.getIcon() ?? Type;
96
- $[7] = fieldDef;
97
- $[8] = t2;
98
- } else t2 = $[8];
99
- const FieldIcon = t2;
100
- const t3 = isSelected ? "bg-accent" : "hover:bg-accent/75";
101
- let t4;
102
- if ($[9] !== t3) {
103
- t4 = cn("flex items-center gap-1.5 rounded-lg pl-2 pr-1 py-2 cursor-default group/field", t3);
104
- $[9] = t3;
105
- $[10] = t4;
106
- } else t4 = $[10];
107
- let t5;
108
- if ($[11] !== fieldType || $[12] !== onFieldClick) {
109
- t5 = () => fieldType && onFieldClick();
110
- $[11] = fieldType;
111
- $[12] = onFieldClick;
112
- $[13] = t5;
113
- } else t5 = $[13];
114
- let t6;
115
- if ($[14] !== fieldType || $[15] !== onFieldDoubleClick) {
116
- t6 = () => fieldType && onFieldDoubleClick();
117
- $[14] = fieldType;
118
- $[15] = onFieldDoubleClick;
119
- $[16] = t6;
120
- } else t6 = $[16];
121
- let t7;
122
- if ($[17] !== FieldIcon) {
123
- t7 = /* @__PURE__ */ jsx(FieldIcon, { className: "size-4 shrink-0" });
124
- $[17] = FieldIcon;
125
- $[18] = t7;
126
- } else t7 = $[18];
127
- let t8;
128
- if ($[19] !== displayValue) {
129
- t8 = /* @__PURE__ */ jsx("span", {
130
- className: "text-accent-foreground truncate select-none",
131
- children: displayValue
132
- });
133
- $[19] = displayValue;
134
- $[20] = t8;
135
- } else t8 = $[20];
136
- let t9;
137
- if ($[21] !== onMouseEnter || $[22] !== onMouseLeave || $[23] !== t4 || $[24] !== t5 || $[25] !== t6 || $[26] !== t7 || $[27] !== t8) {
138
- t9 = /* @__PURE__ */ jsxs("li", {
139
- className: t4,
140
- onClick: t5,
141
- onDoubleClick: t6,
142
- onMouseEnter,
143
- onMouseLeave,
144
- children: [t7, t8]
145
- });
146
- $[21] = onMouseEnter;
147
- $[22] = onMouseLeave;
148
- $[23] = t4;
149
- $[24] = t5;
150
- $[25] = t6;
151
- $[26] = t7;
152
- $[27] = t8;
153
- $[28] = t9;
154
- } else t9 = $[28];
155
- return t9;
156
- };
157
- const BlockFields = (t0) => {
158
- const $ = c(6);
159
- if ($[0] !== "4252672317e9d976c47102ba1a26a55d6393ec9a518eb0503aaa3be0355ffab7") {
160
- for (let $i = 0; $i < 6; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
161
- $[0] = "4252672317e9d976c47102ba1a26a55d6393ec9a518eb0503aaa3be0355ffab7";
162
- }
163
- const { block } = t0;
164
- const schemaProperties = useCamoxApp().getBlockById(block.type)?._internal.contentSchema.properties;
165
- const selection = useSelector(previewStore, _temp4);
166
- const iframeElement = useSelector(previewStore, _temp5);
167
- const previewSource = usePreviewSource();
168
- let t1;
169
- if ($[1] !== block.id || $[2] !== previewSource) {
170
- t1 = blockQueries.get(block.id, previewSource);
171
- $[1] = block.id;
172
- $[2] = previewSource;
173
- $[3] = t1;
174
- } else t1 = $[3];
175
- const { data: blockBundle } = useQuery(t1);
176
- let selectedFieldName = null;
177
- if (selection?.type === "block-field" && selection.blockId === block.id) selectedFieldName = selection.fieldName;
178
- else if ((selection?.type === "item" || selection?.type === "item-field") && selection.blockId === block.id && blockBundle) {
179
- const itemsById = new Map(blockBundle.repeatableItems.map(_temp6));
180
- let current = itemsById.get(selection.itemId);
181
- while (current?.parentItemId != null) current = itemsById.get(current.parentItemId);
182
- selectedFieldName = current?.fieldName ?? null;
183
- }
184
- const handleFieldClick = (fieldName, fieldType) => {
185
- previewStore.send({
186
- type: "selectBlockField",
187
- blockId: block.id,
188
- fieldName,
189
- fieldType
190
- });
191
- };
192
- const handleFieldDoubleClick = (fieldName_0, fieldType_0) => {
193
- fieldTypesDictionary[fieldType_0].onTreeDoubleClick({
194
- blockId: block.id,
195
- fieldName: fieldName_0
196
- });
197
- };
198
- const handleFieldMouseEnter = (fieldName_1, isRepeatable) => {
199
- if (!iframeElement?.contentWindow) return;
200
- if (isRepeatable) {
201
- const message = {
202
- type: "CAMOX_HOVER_REPEATER",
203
- blockId: String(block.id),
204
- fieldName: fieldName_1
205
- };
206
- iframeElement.contentWindow.postMessage(message, "*");
207
- } else {
208
- const message_0 = {
209
- type: "CAMOX_HOVER_FIELD",
210
- fieldId: `${String(block.id)}__${fieldName_1}`
211
- };
212
- iframeElement.contentWindow.postMessage(message_0, "*");
213
- }
214
- };
215
- const handleFieldMouseLeave = (fieldName_2, isRepeatable_0) => {
216
- if (!iframeElement?.contentWindow) return;
217
- if (isRepeatable_0) {
218
- const message_1 = {
219
- type: "CAMOX_HOVER_REPEATER_END",
220
- blockId: String(block.id),
221
- fieldName: fieldName_2
222
- };
223
- iframeElement.contentWindow.postMessage(message_1, "*");
224
- } else {
225
- const message_2 = {
226
- type: "CAMOX_HOVER_FIELD_END",
227
- fieldId: `${String(block.id)}__${fieldName_2}`
228
- };
229
- iframeElement.contentWindow.postMessage(message_2, "*");
230
- }
231
- };
232
- const t2 = "my-1 space-y-1 pl-7";
233
- const t3 = Object.keys(schemaProperties ?? {}).map((fieldName_3) => {
234
- const value = block.content[fieldName_3];
235
- const fieldSchema = schemaProperties?.[fieldName_3];
236
- if (!fieldSchema) return null;
237
- const fieldType_1 = fieldSchema.fieldType;
238
- const isRepeatable_1 = fieldType_1 === "Repeater";
239
- return /* @__PURE__ */ jsx(FieldItem, {
240
- fieldName: fieldName_3,
241
- value,
242
- fieldType: fieldType_1,
243
- schemaTitle: fieldSchema?.title,
244
- isSelected: selectedFieldName === fieldName_3,
245
- onFieldClick: () => handleFieldClick(fieldName_3, fieldType_1),
246
- onFieldDoubleClick: () => handleFieldDoubleClick(fieldName_3, fieldType_1),
247
- onMouseEnter: () => handleFieldMouseEnter(fieldName_3, isRepeatable_1),
248
- onMouseLeave: () => handleFieldMouseLeave(fieldName_3, isRepeatable_1)
249
- }, fieldName_3);
250
- });
251
- let t4;
252
- if ($[4] !== t3) {
253
- t4 = /* @__PURE__ */ jsx("ul", {
254
- className: t2,
255
- children: t3
256
- });
257
- $[4] = t3;
258
- $[5] = t4;
259
- } else t4 = $[5];
260
- return t4;
261
- };
262
30
  function useBlockTreeItem(block, t0) {
263
31
  const $ = c(17);
264
- if ($[0] !== "4252672317e9d976c47102ba1a26a55d6393ec9a518eb0503aaa3be0355ffab7") {
32
+ if ($[0] !== "e2e18e0d8166e0ab2847dfaad4af267e4cb38ede982af367ff19b699a6d19a10") {
265
33
  for (let $i = 0; $i < 17; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
266
- $[0] = "4252672317e9d976c47102ba1a26a55d6393ec9a518eb0503aaa3be0355ffab7";
34
+ $[0] = "e2e18e0d8166e0ab2847dfaad4af267e4cb38ede982af367ff19b699a6d19a10";
267
35
  }
268
36
  const isDragging = t0 === void 0 ? false : t0;
269
37
  const [ellipsisPopoverOpen, setEllipsisPopoverOpen] = React.useState(false);
270
- const selection = useSelector(previewStore, _temp7);
271
- const iframeElement = useSelector(previewStore, _temp8);
38
+ const selection = useSelector(previewStore, _temp2);
39
+ const iframeElement = useSelector(previewStore, _temp3);
40
+ const isBlockActive = selection?.blockId === block.id;
272
41
  const isBlockSelected = selection?.type === "block" && selection.blockId === block.id;
273
- const shouldShowHover = !isDragging && !isBlockSelected;
274
- const shouldShowActive = isDragging || isBlockSelected;
42
+ const shouldShowHover = !isDragging && !isBlockActive;
43
+ const shouldShowActive = isDragging || isBlockActive;
275
44
  let t1;
276
- if ($[1] !== block || $[2] !== iframeElement) {
45
+ if ($[1] !== block.id || $[2] !== iframeElement) {
277
46
  t1 = () => {
278
47
  if (!iframeElement?.contentWindow) return;
279
48
  const message = {
@@ -282,13 +51,13 @@ function useBlockTreeItem(block, t0) {
282
51
  };
283
52
  iframeElement.contentWindow.postMessage(message, "*");
284
53
  };
285
- $[1] = block;
54
+ $[1] = block.id;
286
55
  $[2] = iframeElement;
287
56
  $[3] = t1;
288
57
  } else t1 = $[3];
289
58
  const handleBlockMouseEnter = t1;
290
59
  let t2;
291
- if ($[4] !== block || $[5] !== iframeElement) {
60
+ if ($[4] !== block.id || $[5] !== iframeElement) {
292
61
  t2 = () => {
293
62
  if (!iframeElement?.contentWindow) return;
294
63
  const message_0 = {
@@ -297,13 +66,13 @@ function useBlockTreeItem(block, t0) {
297
66
  };
298
67
  iframeElement.contentWindow.postMessage(message_0, "*");
299
68
  };
300
- $[4] = block;
69
+ $[4] = block.id;
301
70
  $[5] = iframeElement;
302
71
  $[6] = t2;
303
72
  } else t2 = $[6];
304
73
  const handleBlockMouseLeave = t2;
305
74
  let t3;
306
- if ($[7] !== block || $[8] !== isBlockSelected) {
75
+ if ($[7] !== block.id || $[8] !== isBlockSelected) {
307
76
  t3 = () => {
308
77
  if (isBlockSelected) previewStore.send({ type: "clearSelection" });
309
78
  else previewStore.send({
@@ -311,7 +80,7 @@ function useBlockTreeItem(block, t0) {
311
80
  blockId: block.id
312
81
  });
313
82
  };
314
- $[7] = block;
83
+ $[7] = block.id;
315
84
  $[8] = isBlockSelected;
316
85
  $[9] = t3;
317
86
  } else t3 = $[9];
@@ -337,17 +106,17 @@ function useBlockTreeItem(block, t0) {
337
106
  } else t4 = $[16];
338
107
  return t4;
339
108
  }
340
- function _temp8(state_0) {
109
+ function _temp3(state_0) {
341
110
  return state_0.context.iframeElement;
342
111
  }
343
- function _temp7(state) {
112
+ function _temp2(state) {
344
113
  return state.context.selection;
345
114
  }
346
115
  const BlockTreeItemHeader = (t0) => {
347
116
  const $ = c(17);
348
- if ($[0] !== "4252672317e9d976c47102ba1a26a55d6393ec9a518eb0503aaa3be0355ffab7") {
117
+ if ($[0] !== "e2e18e0d8166e0ab2847dfaad4af267e4cb38ede982af367ff19b699a6d19a10") {
349
118
  for (let $i = 0; $i < 17; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
350
- $[0] = "4252672317e9d976c47102ba1a26a55d6393ec9a518eb0503aaa3be0355ffab7";
119
+ $[0] = "e2e18e0d8166e0ab2847dfaad4af267e4cb38ede982af367ff19b699a6d19a10";
351
120
  }
352
121
  let children;
353
122
  let className;
@@ -376,7 +145,7 @@ const BlockTreeItemHeader = (t0) => {
376
145
  const t2 = shouldShowActive && "bg-accent text-accent-foreground";
377
146
  let t3;
378
147
  if ($[8] !== className || $[9] !== t1 || $[10] !== t2) {
379
- t3 = cn("flex flex-row justify-between items-center gap-1 px-1 max-w-full rounded-lg text-foreground transition-all hover:transition-none", t1, t2, "data-open:rounded-b-none", className);
148
+ t3 = cn("flex flex-row justify-between items-center gap-1 px-1 max-w-full rounded-lg text-foreground transition-all hover:transition-none", t1, t2, className);
380
149
  $[8] = className;
381
150
  $[9] = t1;
382
151
  $[10] = t2;
@@ -400,26 +169,24 @@ const BlockTreeItemHeader = (t0) => {
400
169
  };
401
170
  const BlockTreeItemTrigger = (t0) => {
402
171
  const $ = c(5);
403
- if ($[0] !== "4252672317e9d976c47102ba1a26a55d6393ec9a518eb0503aaa3be0355ffab7") {
172
+ if ($[0] !== "e2e18e0d8166e0ab2847dfaad4af267e4cb38ede982af367ff19b699a6d19a10") {
404
173
  for (let $i = 0; $i < 5; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
405
- $[0] = "4252672317e9d976c47102ba1a26a55d6393ec9a518eb0503aaa3be0355ffab7";
174
+ $[0] = "e2e18e0d8166e0ab2847dfaad4af267e4cb38ede982af367ff19b699a6d19a10";
406
175
  }
407
176
  const { displayText, onClick } = t0;
408
177
  let t1;
409
178
  if ($[1] === Symbol.for("react.memo_cache_sentinel")) {
410
- t1 = cn("cursor-default flex-1 truncate py-2 text-sm text-left rounded-sm", "focus-visible:underline outline-none focus-visible:decoration-ring/50 focus-visible:decoration-4");
179
+ t1 = cn("cursor-default flex-1 truncate py-2 text-sm text-left rounded-sm min-w-0", "focus-visible:underline outline-none focus-visible:decoration-ring/50 focus-visible:decoration-4");
411
180
  $[1] = t1;
412
181
  } else t1 = $[1];
413
182
  let t2;
414
183
  if ($[2] !== displayText || $[3] !== onClick) {
415
- t2 = /* @__PURE__ */ jsx("div", {
416
- className: "flex flex-1 items-center gap-1 overflow-x-hidden",
417
- children: /* @__PURE__ */ jsx(Accordion.Trigger, {
418
- className: t1,
419
- title: displayText,
420
- onClick,
421
- children: displayText
422
- })
184
+ t2 = /* @__PURE__ */ jsx("button", {
185
+ type: "button",
186
+ className: t1,
187
+ title: displayText,
188
+ onClick,
189
+ children: displayText
423
190
  });
424
191
  $[2] = displayText;
425
192
  $[3] = onClick;
@@ -429,9 +196,9 @@ const BlockTreeItemTrigger = (t0) => {
429
196
  };
430
197
  const BlockTreeItemEllipsis = (t0) => {
431
198
  const $ = c(12);
432
- if ($[0] !== "4252672317e9d976c47102ba1a26a55d6393ec9a518eb0503aaa3be0355ffab7") {
199
+ if ($[0] !== "e2e18e0d8166e0ab2847dfaad4af267e4cb38ede982af367ff19b699a6d19a10") {
433
200
  for (let $i = 0; $i < 12; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
434
- $[0] = "4252672317e9d976c47102ba1a26a55d6393ec9a518eb0503aaa3be0355ffab7";
201
+ $[0] = "e2e18e0d8166e0ab2847dfaad4af267e4cb38ede982af367ff19b699a6d19a10";
435
202
  }
436
203
  let className;
437
204
  let open;
@@ -475,34 +242,16 @@ const BlockTreeItemEllipsis = (t0) => {
475
242
  } else t4 = $[11];
476
243
  return t4;
477
244
  };
478
- const BlockTreeItemContent = (t0) => {
479
- const $ = c(3);
480
- if ($[0] !== "4252672317e9d976c47102ba1a26a55d6393ec9a518eb0503aaa3be0355ffab7") {
481
- for (let $i = 0; $i < 3; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
482
- $[0] = "4252672317e9d976c47102ba1a26a55d6393ec9a518eb0503aaa3be0355ffab7";
483
- }
484
- const { block } = t0;
485
- let t1;
486
- if ($[1] !== block) {
487
- t1 = /* @__PURE__ */ jsx(Accordion.Panel, {
488
- className: "text-muted-foreground h-[var(--accordion-panel-height)] overflow-hidden rounded-b-lg text-sm transition-[height] duration-200 data-[ending-style]:h-0 data-[starting-style]:h-0",
489
- children: /* @__PURE__ */ jsx(BlockFields, { block })
490
- });
491
- $[1] = block;
492
- $[2] = t1;
493
- } else t1 = $[2];
494
- return t1;
495
- };
496
245
  const animateLayoutChanges = (args) => {
497
246
  const { isSorting, wasDragging } = args;
498
247
  if (isSorting || wasDragging) return false;
499
248
  return defaultAnimateLayoutChanges(args);
500
249
  };
501
250
  const SortableBlock = (t0) => {
502
- const $ = c(67);
503
- if ($[0] !== "4252672317e9d976c47102ba1a26a55d6393ec9a518eb0503aaa3be0355ffab7") {
504
- for (let $i = 0; $i < 67; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
505
- $[0] = "4252672317e9d976c47102ba1a26a55d6393ec9a518eb0503aaa3be0355ffab7";
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";
506
255
  }
507
256
  const { block } = t0;
508
257
  const [gripPopoverOpen, setGripPopoverOpen] = React.useState(false);
@@ -543,118 +292,98 @@ const SortableBlock = (t0) => {
543
292
  } else t5 = $[9];
544
293
  const style = t5;
545
294
  const ctx = useBlockTreeItem(block, isDragging);
546
- let t6;
547
- if ($[10] !== block.id) {
548
- t6 = (state) => state.context.selection?.blockId === block.id;
549
- $[10] = block.id;
550
- $[11] = t6;
551
- } else t6 = $[11];
552
- const isBlockFocused = useSelector(previewStore, t6);
553
- const t7 = isReadOnly ? "cursor-not-allowed opacity-50" : "cursor-grab active:cursor-grabbing";
295
+ const t6 = isReadOnly ? "cursor-not-allowed opacity-50" : "cursor-grab active:cursor-grabbing";
296
+ 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];
554
302
  let t8;
555
- if ($[12] !== t7) {
556
- t8 = cn("text-muted-foreground hover:text-foreground flex", t7);
557
- $[12] = t7;
558
- $[13] = t8;
559
- } else t8 = $[13];
303
+ if ($[12] !== attributes || $[13] !== isReadOnly) {
304
+ t8 = isReadOnly ? {} : attributes;
305
+ $[12] = attributes;
306
+ $[13] = isReadOnly;
307
+ $[14] = t8;
308
+ } else t8 = $[14];
560
309
  let t9;
561
- if ($[14] !== attributes || $[15] !== isReadOnly) {
562
- t9 = isReadOnly ? {} : attributes;
563
- $[14] = attributes;
310
+ if ($[15] !== isReadOnly || $[16] !== listeners) {
311
+ t9 = isReadOnly ? {} : listeners;
564
312
  $[15] = isReadOnly;
565
- $[16] = t9;
566
- } else t9 = $[16];
313
+ $[16] = listeners;
314
+ $[17] = t9;
315
+ } else t9 = $[17];
567
316
  let t10;
568
- if ($[17] !== isReadOnly || $[18] !== listeners) {
569
- t10 = isReadOnly ? {} : listeners;
570
- $[17] = isReadOnly;
571
- $[18] = listeners;
572
- $[19] = t10;
573
- } else t10 = $[19];
574
- let t11;
575
- if ($[20] !== isReadOnly || $[21] !== requireDraft) {
576
- t11 = isReadOnly ? (e) => {
317
+ if ($[18] !== isReadOnly || $[19] !== requireDraft) {
318
+ t10 = isReadOnly ? (e) => {
577
319
  e.preventDefault();
578
320
  e.stopPropagation();
579
321
  requireDraft();
580
322
  } : void 0;
581
- $[20] = isReadOnly;
582
- $[21] = requireDraft;
583
- $[22] = t11;
584
- } else t11 = $[22];
323
+ $[18] = isReadOnly;
324
+ $[19] = requireDraft;
325
+ $[20] = t10;
326
+ } else t10 = $[20];
327
+ let t11;
585
328
  let t12;
586
- let t13;
587
- if ($[23] === Symbol.for("react.memo_cache_sentinel")) {
588
- t12 = /* @__PURE__ */ jsx("span", {
329
+ if ($[21] === Symbol.for("react.memo_cache_sentinel")) {
330
+ t11 = /* @__PURE__ */ jsx("span", {
589
331
  className: "sr-only",
590
332
  children: "Click and use arrow keys to reorder"
591
333
  });
592
- t13 = /* @__PURE__ */ jsx(GripVertical, { className: "h-4 w-4" });
593
- $[23] = t12;
594
- $[24] = t13;
334
+ t12 = /* @__PURE__ */ jsx(GripVertical, { className: "h-4 w-4" });
335
+ $[21] = t11;
336
+ $[22] = t12;
595
337
  } else {
596
- t12 = $[23];
597
- t13 = $[24];
338
+ t11 = $[21];
339
+ t12 = $[22];
598
340
  }
599
- let t14;
600
- if ($[25] !== t10 || $[26] !== t11 || $[27] !== t8 || $[28] !== t9) {
601
- t14 = /* @__PURE__ */ jsxs(Button, {
341
+ let t13;
342
+ if ($[23] !== t10 || $[24] !== t7 || $[25] !== t8 || $[26] !== t9) {
343
+ t13 = /* @__PURE__ */ jsxs(Button, {
602
344
  variant: "ghost",
603
345
  size: "icon-sm",
604
- className: t8,
346
+ className: t7,
347
+ ...t8,
605
348
  ...t9,
606
- ...t10,
607
- onClick: t11,
608
- children: [t12, t13]
349
+ onClick: t10,
350
+ children: [t11, t12]
609
351
  });
610
- $[25] = t10;
611
- $[26] = t11;
612
- $[27] = t8;
613
- $[28] = t9;
614
- $[29] = t14;
615
- } else t14 = $[29];
616
- const gripButton = t14;
617
- let t15;
618
- if ($[30] !== block.id || $[31] !== isBlockFocused) {
619
- t15 = isBlockFocused ? [String(block.id)] : [];
620
- $[30] = block.id;
621
- $[31] = isBlockFocused;
622
- $[32] = t15;
623
- } else t15 = $[32];
624
- const t16 = String(block.id);
625
- let t17;
626
- if ($[33] === Symbol.for("react.memo_cache_sentinel")) {
627
- t17 = /* @__PURE__ */ jsx("div", {});
628
- $[33] = t17;
629
- } else t17 = $[33];
630
- let t18;
631
- if ($[34] !== block || $[35] !== gripButton || $[36] !== gripPopoverOpen || $[37] !== isReadOnly) {
632
- t18 = isReadOnly ? gripButton : /* @__PURE__ */ jsx(BlockActionsPopover, {
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, {
633
362
  block,
634
363
  open: gripPopoverOpen,
635
364
  onOpenChange: setGripPopoverOpen,
636
365
  children: gripButton
637
366
  });
638
- $[34] = block;
639
- $[35] = gripButton;
640
- $[36] = gripPopoverOpen;
641
- $[37] = isReadOnly;
642
- $[38] = t18;
643
- } else t18 = $[38];
644
- const t19 = block.summary || block.type;
645
- let t20;
646
- if ($[39] !== ctx.toggleSelection || $[40] !== t19) {
647
- t20 = /* @__PURE__ */ jsx(BlockTreeItemTrigger, {
648
- displayText: t19,
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,
649
378
  onClick: ctx.toggleSelection
650
379
  });
651
- $[39] = ctx.toggleSelection;
652
- $[40] = t19;
653
- $[41] = t20;
654
- } else t20 = $[41];
655
- let t21;
656
- if ($[42] !== block || $[43] !== ctx.ellipsisPopoverOpen || $[44] !== ctx.setEllipsisPopoverOpen || $[45] !== isReadOnly || $[46] !== requireDraft) {
657
- t21 = isReadOnly ? /* @__PURE__ */ jsx(BlockTreeItemEllipsis, {
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, {
658
387
  open: false,
659
388
  onClick: (e_0) => {
660
389
  e_0.preventDefault();
@@ -667,77 +396,47 @@ const SortableBlock = (t0) => {
667
396
  onOpenChange: ctx.setEllipsisPopoverOpen,
668
397
  children: /* @__PURE__ */ jsx(BlockTreeItemEllipsis, { open: ctx.ellipsisPopoverOpen })
669
398
  });
670
- $[42] = block;
671
- $[43] = ctx.ellipsisPopoverOpen;
672
- $[44] = ctx.setEllipsisPopoverOpen;
673
- $[45] = isReadOnly;
674
- $[46] = requireDraft;
675
- $[47] = t21;
676
- } else t21 = $[47];
677
- let t22;
678
- if ($[48] !== ctx.shouldShowActive || $[49] !== ctx.shouldShowHover || $[50] !== t18 || $[51] !== t20 || $[52] !== t21) {
679
- t22 = /* @__PURE__ */ jsx(Accordion.Header, {
680
- render: t17,
681
- children: /* @__PURE__ */ jsxs(BlockTreeItemHeader, {
682
- shouldShowHover: ctx.shouldShowHover,
683
- shouldShowActive: ctx.shouldShowActive,
684
- children: [
685
- t18,
686
- t20,
687
- t21
688
- ]
689
- })
690
- });
691
- $[48] = ctx.shouldShowActive;
692
- $[49] = ctx.shouldShowHover;
693
- $[50] = t18;
694
- $[51] = t20;
695
- $[52] = t21;
696
- $[53] = t22;
697
- } else t22 = $[53];
698
- let t23;
699
- if ($[54] !== block) {
700
- t23 = /* @__PURE__ */ jsx(BlockTreeItemContent, { block });
701
- $[54] = block;
702
- $[55] = t23;
703
- } else t23 = $[55];
704
- let t24;
705
- if ($[56] !== ctx.handleBlockMouseEnter || $[57] !== ctx.handleBlockMouseLeave || $[58] !== setNodeRef || $[59] !== style || $[60] !== t16 || $[61] !== t22 || $[62] !== t23) {
706
- t24 = /* @__PURE__ */ jsxs(Accordion.Item, {
707
- value: t16,
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, {
708
409
  ref: setNodeRef,
709
410
  style,
710
411
  className: "group",
412
+ shouldShowHover: ctx.shouldShowHover,
413
+ shouldShowActive: ctx.shouldShowActive,
711
414
  onMouseEnter: ctx.handleBlockMouseEnter,
712
415
  onMouseLeave: ctx.handleBlockMouseLeave,
713
- children: [t22, t23]
714
- });
715
- $[56] = ctx.handleBlockMouseEnter;
716
- $[57] = ctx.handleBlockMouseLeave;
717
- $[58] = setNodeRef;
718
- $[59] = style;
719
- $[60] = t16;
720
- $[61] = t22;
721
- $[62] = t23;
722
- $[63] = t24;
723
- } else t24 = $[63];
724
- let t25;
725
- if ($[64] !== t15 || $[65] !== t24) {
726
- t25 = /* @__PURE__ */ jsx(Accordion.Root, {
727
- value: t15,
728
- children: t24
416
+ children: [
417
+ t14,
418
+ t16,
419
+ t17
420
+ ]
729
421
  });
730
- $[64] = t15;
731
- $[65] = t24;
732
- $[66] = t25;
733
- } else t25 = $[66];
734
- return t25;
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;
735
434
  };
736
435
  const LayoutBlockItem = (t0) => {
737
- const $ = c(42);
738
- if ($[0] !== "4252672317e9d976c47102ba1a26a55d6393ec9a518eb0503aaa3be0355ffab7") {
739
- for (let $i = 0; $i < 42; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
740
- $[0] = "4252672317e9d976c47102ba1a26a55d6393ec9a518eb0503aaa3be0355ffab7";
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";
741
440
  }
742
441
  const { block, layoutName } = t0;
743
442
  const camoxApp = useCamoxApp();
@@ -755,72 +454,52 @@ const LayoutBlockItem = (t0) => {
755
454
  const isReadOnly = previewSource !== "draft";
756
455
  const displayText = blockDef?._internal.title ?? block.type;
757
456
  let t2;
758
- if ($[4] !== block.id) {
759
- t2 = (state) => state.context.selection?.blockId === block.id;
760
- $[4] = block.id;
761
- $[5] = t2;
762
- } else t2 = $[5];
763
- const isBlockFocused = useSelector(previewStore, 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];
764
461
  let t3;
765
- if ($[6] !== block.id || $[7] !== isBlockFocused) {
766
- t3 = isBlockFocused ? [String(block.id)] : [];
767
- $[6] = block.id;
768
- $[7] = isBlockFocused;
769
- $[8] = t3;
770
- } else t3 = $[8];
771
- const t4 = String(block.id);
772
- let t5;
773
- if ($[9] === Symbol.for("react.memo_cache_sentinel")) {
774
- t5 = /* @__PURE__ */ jsx("div", {});
775
- $[9] = t5;
776
- } else t5 = $[9];
777
- let t6;
778
- if ($[10] === Symbol.for("react.memo_cache_sentinel")) {
779
- t6 = /* @__PURE__ */ jsx(TooltipTrigger, { children: /* @__PURE__ */ jsx(LayoutTemplate, { className: "h-4 w-4" }) });
780
- $[10] = t6;
781
- } else t6 = $[10];
782
- let t7;
783
- if ($[11] !== layoutName) {
784
- t7 = /* @__PURE__ */ jsx("span", {
462
+ if ($[5] !== layoutName) {
463
+ t3 = /* @__PURE__ */ jsx("span", {
785
464
  className: "font-semibold",
786
465
  children: layoutName
787
466
  });
788
- $[11] = layoutName;
789
- $[12] = t7;
790
- } else t7 = $[12];
791
- let t8;
792
- if ($[13] === Symbol.for("react.memo_cache_sentinel")) {
793
- t8 = /* @__PURE__ */ jsx("br", {});
794
- $[13] = t8;
795
- } else t8 = $[13];
796
- let t9;
797
- if ($[14] !== t7) {
798
- t9 = /* @__PURE__ */ jsx("div", {
467
+ $[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];
475
+ let t5;
476
+ if ($[8] !== t3) {
477
+ t5 = /* @__PURE__ */ jsx("div", {
799
478
  className: "text-muted-foreground flex size-8 shrink-0 items-center justify-center",
800
- children: /* @__PURE__ */ jsxs(Tooltip, { children: [t6, /* @__PURE__ */ jsxs(TooltipContent, { children: [
479
+ children: /* @__PURE__ */ jsxs(Tooltip, { children: [t2, /* @__PURE__ */ jsxs(TooltipContent, { children: [
801
480
  "From ",
802
- t7,
481
+ t3,
803
482
  " layout.",
804
- t8,
483
+ t4,
805
484
  "Changing the content may affect other pages"
806
485
  ] })] })
807
486
  });
808
- $[14] = t7;
809
- $[15] = t9;
810
- } else t9 = $[15];
811
- let t10;
812
- if ($[16] !== ctx.toggleSelection || $[17] !== displayText) {
813
- t10 = /* @__PURE__ */ jsx(BlockTreeItemTrigger, {
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, {
814
493
  displayText,
815
494
  onClick: ctx.toggleSelection
816
495
  });
817
- $[16] = ctx.toggleSelection;
818
- $[17] = displayText;
819
- $[18] = t10;
820
- } else t10 = $[18];
821
- let t11;
822
- if ($[19] !== block || $[20] !== ctx.ellipsisPopoverOpen || $[21] !== ctx.setEllipsisPopoverOpen || $[22] !== isReadOnly || $[23] !== requireDraft) {
823
- t11 = isReadOnly ? /* @__PURE__ */ jsx(BlockTreeItemEllipsis, {
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, {
824
503
  open: false,
825
504
  onClick: (e) => {
826
505
  e.preventDefault();
@@ -835,73 +514,43 @@ const LayoutBlockItem = (t0) => {
835
514
  layoutPlacement: block.placement,
836
515
  children: /* @__PURE__ */ jsx(BlockTreeItemEllipsis, { open: ctx.ellipsisPopoverOpen })
837
516
  });
838
- $[19] = block;
839
- $[20] = ctx.ellipsisPopoverOpen;
840
- $[21] = ctx.setEllipsisPopoverOpen;
841
- $[22] = isReadOnly;
842
- $[23] = requireDraft;
843
- $[24] = t11;
844
- } else t11 = $[24];
845
- let t12;
846
- if ($[25] !== ctx.shouldShowActive || $[26] !== ctx.shouldShowHover || $[27] !== t10 || $[28] !== t11 || $[29] !== t9) {
847
- t12 = /* @__PURE__ */ jsx(Accordion.Header, {
848
- render: t5,
849
- children: /* @__PURE__ */ jsxs(BlockTreeItemHeader, {
850
- shouldShowHover: ctx.shouldShowHover,
851
- shouldShowActive: ctx.shouldShowActive,
852
- children: [
853
- t9,
854
- t10,
855
- t11
856
- ]
857
- })
858
- });
859
- $[25] = ctx.shouldShowActive;
860
- $[26] = ctx.shouldShowHover;
861
- $[27] = t10;
862
- $[28] = t11;
863
- $[29] = t9;
864
- $[30] = t12;
865
- } else t12 = $[30];
866
- let t13;
867
- if ($[31] !== block) {
868
- t13 = /* @__PURE__ */ jsx(BlockTreeItemContent, { block });
869
- $[31] = block;
870
- $[32] = t13;
871
- } else t13 = $[32];
872
- let t14;
873
- if ($[33] !== ctx.handleBlockMouseEnter || $[34] !== ctx.handleBlockMouseLeave || $[35] !== t12 || $[36] !== t13 || $[37] !== t4) {
874
- t14 = /* @__PURE__ */ jsxs(Accordion.Item, {
875
- value: t4,
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, {
876
527
  className: "group",
528
+ shouldShowHover: ctx.shouldShowHover,
529
+ shouldShowActive: ctx.shouldShowActive,
877
530
  onMouseEnter: ctx.handleBlockMouseEnter,
878
531
  onMouseLeave: ctx.handleBlockMouseLeave,
879
- children: [t12, t13]
880
- });
881
- $[33] = ctx.handleBlockMouseEnter;
882
- $[34] = ctx.handleBlockMouseLeave;
883
- $[35] = t12;
884
- $[36] = t13;
885
- $[37] = t4;
886
- $[38] = t14;
887
- } else t14 = $[38];
888
- let t15;
889
- if ($[39] !== t14 || $[40] !== t3) {
890
- t15 = /* @__PURE__ */ jsx(Accordion.Root, {
891
- value: t3,
892
- children: t14
532
+ children: [
533
+ t5,
534
+ t6,
535
+ t7
536
+ ]
893
537
  });
894
- $[39] = t14;
895
- $[40] = t3;
896
- $[41] = t15;
897
- } else t15 = $[41];
898
- return t15;
538
+ $[19] = ctx.handleBlockMouseEnter;
539
+ $[20] = ctx.handleBlockMouseLeave;
540
+ $[21] = ctx.shouldShowActive;
541
+ $[22] = ctx.shouldShowHover;
542
+ $[23] = t5;
543
+ $[24] = t6;
544
+ $[25] = t7;
545
+ $[26] = t8;
546
+ } else t8 = $[26];
547
+ return t8;
899
548
  };
900
549
  const PageTree = () => {
901
550
  const $ = c(56);
902
- if ($[0] !== "4252672317e9d976c47102ba1a26a55d6393ec9a518eb0503aaa3be0355ffab7") {
551
+ if ($[0] !== "e2e18e0d8166e0ab2847dfaad4af267e4cb38ede982af367ff19b699a6d19a10") {
903
552
  for (let $i = 0; $i < 56; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
904
- $[0] = "4252672317e9d976c47102ba1a26a55d6393ec9a518eb0503aaa3be0355ffab7";
553
+ $[0] = "e2e18e0d8166e0ab2847dfaad4af267e4cb38ede982af367ff19b699a6d19a10";
905
554
  }
906
555
  const page = usePreviewedPage();
907
556
  const previewSource = usePreviewSource();
@@ -1015,13 +664,13 @@ const PageTree = () => {
1015
664
  } else t7 = $[18];
1016
665
  let t8;
1017
666
  if ($[19] !== pageBlocks) {
1018
- t8 = pageBlocks.map(_temp9);
667
+ t8 = pageBlocks.map(_temp4);
1019
668
  $[19] = pageBlocks;
1020
669
  $[20] = t8;
1021
670
  } else t8 = $[20];
1022
671
  let t9;
1023
672
  if ($[21] !== pageBlocks) {
1024
- t9 = pageBlocks.map(_temp0);
673
+ t9 = pageBlocks.map(_temp5);
1025
674
  $[21] = pageBlocks;
1026
675
  $[22] = t9;
1027
676
  } else t9 = $[22];
@@ -1125,7 +774,7 @@ const PageTree = () => {
1125
774
  t18 = () => {
1126
775
  if (!requireDraft()) return;
1127
776
  previewStore.send({
1128
- type: "openAddBlockSheet",
777
+ type: "openAddBlockSidebar",
1129
778
  via: "page-tree"
1130
779
  });
1131
780
  };
@@ -1161,19 +810,10 @@ const PageTree = () => {
1161
810
  function _temp(state) {
1162
811
  return state.context.previewSource;
1163
812
  }
1164
- function _temp4(state) {
1165
- return state.context.selection;
1166
- }
1167
- function _temp5(state_0) {
1168
- return state_0.context.iframeElement;
1169
- }
1170
- function _temp6(i) {
1171
- return [i.id, i];
1172
- }
1173
- function _temp9(block_2) {
813
+ function _temp4(block_2) {
1174
814
  return String(block_2.id);
1175
815
  }
1176
- function _temp0(block_3) {
816
+ function _temp5(block_3) {
1177
817
  return /* @__PURE__ */ jsx(SortableBlock, { block: block_3 }, String(block_3.id));
1178
818
  }
1179
819