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.
- package/dist/components/PlatformLabel.js +62 -0
- package/dist/core/components/lexical/GradientNode.js +126 -0
- package/dist/core/components/lexical/InlineLexicalEditor.js +37 -56
- package/dist/core/components/lexical/InlineStylesPlugin.js +183 -0
- package/dist/core/components/lexical/SelectionBroadcaster.js +49 -46
- package/dist/core/components/lexical/SidebarLexicalEditor.js +197 -151
- package/dist/core/components/lexical/editorConfig.js +25 -7
- package/dist/core/components/lexical/selectTextLink.js +21 -0
- package/dist/core/createApp.d.ts +30 -17
- package/dist/core/createApp.js +14 -3
- package/dist/core/createBlock.d.ts +2 -2
- package/dist/core/createBlock.js +17 -28
- package/dist/core/createLayout.d.ts +48 -4
- package/dist/core/createLayout.js +51 -23
- package/dist/core/derivedRoutes.js +36 -0
- package/dist/core/editing/BlockEditingRuntime.js +4 -4
- package/dist/core/editing/CompleteBlockEditingRuntime.js +5 -5
- package/dist/core/editing/createEditableBlock.d.ts +9 -8
- package/dist/core/editing/createEditableBlock.js +265 -403
- package/dist/core/hooks/useIsEditable.js +4 -7
- package/dist/core/hooks/useRequireDraftSource.js +7 -11
- package/dist/core/lib/lexicalReact.d.ts +1 -26
- package/dist/core/lib/lexicalReact.js +46 -60
- package/dist/core/lib/lexicalState.js +164 -81
- package/dist/core/lib/modifierFormats.js +4 -15
- package/dist/core/lib/textStyles.d.ts +27 -0
- package/dist/core/lib/textStyles.js +47 -0
- package/dist/features/navigation/navigation.d.ts +2 -0
- package/dist/features/navigation/navigation.js +51 -46
- package/dist/features/page/DerivedPageContent.js +61 -0
- package/dist/features/page/PublishedPageContent.js +52 -83
- package/dist/features/page/SharedLayoutContent.js +66 -0
- package/dist/features/preview/CamoxPreview.d.ts +16 -1
- package/dist/features/preview/CamoxPreview.js +246 -290
- package/dist/features/preview/DerivedPreview.js +134 -0
- package/dist/features/preview/EditablePageExperience.js +25 -8
- package/dist/features/preview/components/AddBlockSidebar.js +43 -33
- package/dist/features/preview/components/AssetLightbox.js +1 -1
- package/dist/features/preview/components/BlockActionsPopover.js +8 -8
- package/dist/features/preview/components/BlockThumbnail.js +192 -0
- package/dist/features/preview/components/CreatePageModal.js +123 -115
- package/dist/features/preview/components/DerivedLayoutDialog.js +100 -0
- package/dist/features/preview/components/DerivedLayoutSidebar.d.ts +5 -0
- package/dist/features/preview/components/DerivedLayoutSidebar.js +160 -0
- package/dist/features/preview/components/DerivedPageInfoSidebar.js +57 -0
- package/dist/features/preview/components/FieldToolbar.js +42 -20
- package/dist/features/preview/components/Frame.js +133 -140
- package/dist/features/preview/components/LeftSidebar.js +42 -38
- package/dist/features/preview/components/LinkFieldEditor.js +3 -4
- package/dist/features/preview/components/MobilePreviewDrawer.js +4 -4
- package/dist/features/preview/components/Overlays.js +59 -47
- package/dist/features/preview/components/PageEditorSidebar.js +194 -203
- package/dist/features/preview/components/PageInfoSidebar.js +63 -55
- package/dist/features/preview/components/PageNavigatorSidebar.js +34 -483
- package/dist/features/preview/components/PagePicker.js +205 -153
- package/dist/features/preview/components/PageTree.js +366 -340
- package/dist/features/preview/components/PreviewActivation.js +78 -0
- package/dist/features/preview/components/PreviewPanel.js +98 -68
- package/dist/features/preview/components/PreviewToolbar.js +224 -241
- package/dist/features/preview/components/PreviewToolbarSpacer.js +43 -0
- package/dist/features/preview/components/PublicationRow.js +425 -0
- package/dist/features/preview/components/PublishDialog.js +180 -97
- package/dist/features/preview/components/RightSidebar.js +19 -34
- package/dist/features/preview/components/previewStyles.js +8 -0
- package/dist/features/preview/components/useUpdateBlockPosition.js +7 -13
- package/dist/features/preview/previewConstants.js +8 -0
- package/dist/features/preview/previewStore.js +18 -39
- package/dist/features/preview/publication.js +71 -0
- package/dist/features/provider/AuthenticatedCamoxProvider.js +2 -1
- package/dist/features/provider/CoreCamoxProvider.js +11 -2
- package/dist/features/provider/LocalhostPreviewProvider.js +6 -7
- package/dist/features/provider/useAdminShortcuts.js +5 -4
- package/dist/features/routes/pageRuntime.d.ts +10 -0
- package/dist/features/routes/pageRuntime.js +7 -9
- package/dist/features/runtime/PreviewDocumentContext.js +7 -0
- package/dist/features/runtime/RuntimeChrome.js +149 -0
- package/dist/features/runtime/SharedChromeContext.js +7 -0
- package/dist/features/runtime/navigationRequest.js +21 -0
- package/dist/features/runtime/navigationTarget.js +23 -0
- package/dist/features/runtime/pageApp.js +196 -121
- package/dist/features/runtime/pageNavigation.js +79 -130
- package/dist/features/runtime/runtime.d.ts +11 -0
- package/dist/features/runtime/runtime.js +183 -47
- package/dist/features/runtime/studioApp.d.ts +2 -11
- package/dist/features/runtime/studioApp.js +14 -177
- package/dist/features/studio/CamoxStudio.js +27 -13
- package/dist/features/studio/components/Navbar.js +80 -74
- package/dist/features/studio/components/UserButton.js +4 -4
- package/dist/features/studio/studioTheme.js +25 -0
- package/dist/features/studio/useTheme.js +94 -109
- package/dist/features/vite/appGeneration.js +12 -3
- package/dist/features/vite/definitionsSync.js +4 -2
- package/dist/features/vite/layoutGeneration.js +38 -0
- package/dist/features/vite/runtimeDev.js +3 -1
- package/dist/lib/auth.js +15 -13
- package/dist/lib/normalized-data.js +4 -4
- package/dist/lib/platform.js +13 -0
- package/dist/lib/utils.js +90 -38
- package/dist/studio-overlays.css +5 -40
- package/dist/studio.css +1 -1
- package/package.json +8 -4
- package/skills/camox/SKILL.md +2 -0
- package/skills/camox/references/block-definitions.md +31 -12
- package/skills/camox/references/layout-definitions.md +2 -0
- package/dist/core/lib/modifiers.js +0 -24
- package/dist/features/preview/components/DraftSwitchDialog.js +0 -66
- package/dist/features/preview/previewQueryFns.js +0 -23
- 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] !== "
|
|
24
|
+
if ($[0] !== "471c3efab23632ac0a363f528fa97ab43f3bcb61e240c961d3c95d63897d691d") {
|
|
25
25
|
for (let $i = 0; $i < 1; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
|
|
26
|
-
$[0] = "
|
|
26
|
+
$[0] = "471c3efab23632ac0a363f528fa97ab43f3bcb61e240c961d3c95d63897d691d";
|
|
27
27
|
}
|
|
28
|
-
return useSelector(previewStore,
|
|
28
|
+
return useSelector(previewStore, selectPreviewSource);
|
|
29
29
|
};
|
|
30
30
|
function useBlockTreeItem(block, t0) {
|
|
31
31
|
const $ = c(17);
|
|
32
|
-
if ($[0] !== "
|
|
32
|
+
if ($[0] !== "471c3efab23632ac0a363f528fa97ab43f3bcb61e240c961d3c95d63897d691d") {
|
|
33
33
|
for (let $i = 0; $i < 17; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
|
|
34
|
-
$[0] = "
|
|
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,
|
|
39
|
-
const iframeElement = useSelector(previewStore,
|
|
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
|
|
109
|
+
function _temp2(state_0) {
|
|
110
110
|
return state_0.context.iframeElement;
|
|
111
111
|
}
|
|
112
|
-
function
|
|
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] !== "
|
|
117
|
+
if ($[0] !== "471c3efab23632ac0a363f528fa97ab43f3bcb61e240c961d3c95d63897d691d") {
|
|
118
118
|
for (let $i = 0; $i < 17; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
|
|
119
|
-
$[0] = "
|
|
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] !== "
|
|
172
|
+
if ($[0] !== "471c3efab23632ac0a363f528fa97ab43f3bcb61e240c961d3c95d63897d691d") {
|
|
173
173
|
for (let $i = 0; $i < 5; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
|
|
174
|
-
$[0] = "
|
|
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] !== "
|
|
199
|
+
if ($[0] !== "471c3efab23632ac0a363f528fa97ab43f3bcb61e240c961d3c95d63897d691d") {
|
|
200
200
|
for (let $i = 0; $i < 12; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
|
|
201
|
-
$[0] = "
|
|
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(
|
|
252
|
-
if ($[0] !== "
|
|
253
|
-
for (let $i = 0; $i <
|
|
254
|
-
$[0] = "
|
|
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] !==
|
|
260
|
+
if ($[1] !== t1) {
|
|
264
261
|
t2 = {
|
|
265
262
|
id: t1,
|
|
266
|
-
animateLayoutChanges
|
|
267
|
-
disabled: isReadOnly
|
|
263
|
+
animateLayoutChanges
|
|
268
264
|
};
|
|
269
|
-
$[1] =
|
|
270
|
-
$[2] =
|
|
271
|
-
|
|
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 ($[
|
|
270
|
+
if ($[3] !== transform) {
|
|
276
271
|
t3 = CSS.Transform.toString(transform);
|
|
277
|
-
$[
|
|
278
|
-
$[
|
|
279
|
-
} else t3 = $[
|
|
272
|
+
$[3] = transform;
|
|
273
|
+
$[4] = t3;
|
|
274
|
+
} else t3 = $[4];
|
|
280
275
|
const t4 = isDragging ? 0 : 1;
|
|
281
276
|
let t5;
|
|
282
|
-
if ($[
|
|
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
|
-
$[
|
|
289
|
-
$[
|
|
290
|
-
$[
|
|
291
|
-
$[
|
|
292
|
-
} else t5 = $[
|
|
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
|
-
|
|
290
|
+
let t6;
|
|
296
291
|
let t7;
|
|
297
|
-
if ($[
|
|
298
|
-
|
|
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
|
-
|
|
335
|
-
$[
|
|
336
|
-
$[
|
|
297
|
+
t7 = /* @__PURE__ */ jsx(GripVertical, { className: "h-4 w-4" });
|
|
298
|
+
$[9] = t6;
|
|
299
|
+
$[10] = t7;
|
|
337
300
|
} else {
|
|
338
|
-
|
|
339
|
-
|
|
301
|
+
t6 = $[9];
|
|
302
|
+
t7 = $[10];
|
|
340
303
|
}
|
|
341
|
-
let
|
|
342
|
-
if ($[
|
|
343
|
-
|
|
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:
|
|
347
|
-
...
|
|
348
|
-
...
|
|
349
|
-
|
|
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
|
-
$[
|
|
353
|
-
$[
|
|
354
|
-
$[
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
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
|
-
$[
|
|
368
|
-
$[
|
|
369
|
-
$[
|
|
370
|
-
$[
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
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
|
-
$[
|
|
381
|
-
$[
|
|
382
|
-
$[
|
|
383
|
-
} else
|
|
384
|
-
let
|
|
385
|
-
if ($[
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
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:
|
|
355
|
+
children: t12
|
|
398
356
|
});
|
|
399
|
-
$[
|
|
400
|
-
$[
|
|
401
|
-
$[
|
|
402
|
-
$[
|
|
403
|
-
$[
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
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
|
-
|
|
418
|
-
|
|
419
|
-
|
|
374
|
+
t9,
|
|
375
|
+
t11,
|
|
376
|
+
t13
|
|
420
377
|
]
|
|
421
378
|
});
|
|
422
|
-
$[
|
|
423
|
-
$[
|
|
424
|
-
$[
|
|
425
|
-
$[
|
|
426
|
-
$[
|
|
427
|
-
$[
|
|
428
|
-
$[
|
|
429
|
-
$[
|
|
430
|
-
$[
|
|
431
|
-
$[
|
|
432
|
-
} else
|
|
433
|
-
return
|
|
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(
|
|
437
|
-
if ($[0] !== "
|
|
438
|
-
for (let $i = 0; $i <
|
|
439
|
-
$[0] = "
|
|
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
|
|
401
|
+
let t2;
|
|
444
402
|
if ($[1] !== block.type || $[2] !== camoxApp) {
|
|
445
|
-
|
|
403
|
+
t2 = camoxApp.getBlockById(block.type);
|
|
446
404
|
$[1] = block.type;
|
|
447
405
|
$[2] = camoxApp;
|
|
448
|
-
$[3] =
|
|
449
|
-
} else
|
|
450
|
-
const blockDef =
|
|
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
|
-
|
|
419
|
+
t4 = /* @__PURE__ */ jsx("span", {
|
|
464
420
|
className: "font-semibold",
|
|
465
421
|
children: layoutName
|
|
466
422
|
});
|
|
467
423
|
$[5] = layoutName;
|
|
468
|
-
$[6] =
|
|
469
|
-
} else
|
|
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 ($[
|
|
477
|
-
t5 = /* @__PURE__ */ jsx("
|
|
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: [
|
|
436
|
+
children: /* @__PURE__ */ jsxs(Tooltip, { children: [t3, /* @__PURE__ */ jsxs(TooltipContent, { children: [
|
|
480
437
|
"From ",
|
|
481
|
-
t3,
|
|
482
|
-
" layout.",
|
|
483
438
|
t4,
|
|
484
|
-
"
|
|
439
|
+
" layout.",
|
|
440
|
+
t5,
|
|
441
|
+
t6
|
|
485
442
|
] })] })
|
|
486
443
|
});
|
|
487
|
-
$[8] =
|
|
488
|
-
$[9] =
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
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
|
-
$[
|
|
497
|
-
$[
|
|
498
|
-
$[
|
|
499
|
-
} else
|
|
500
|
-
let
|
|
501
|
-
if ($[
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
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
|
-
$[
|
|
518
|
-
$[
|
|
519
|
-
$[
|
|
520
|
-
$[
|
|
521
|
-
$[
|
|
522
|
-
$[
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
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
|
-
|
|
534
|
-
|
|
535
|
-
|
|
498
|
+
t7,
|
|
499
|
+
t8,
|
|
500
|
+
t9
|
|
536
501
|
]
|
|
537
502
|
});
|
|
538
|
-
$[
|
|
539
|
-
$[
|
|
540
|
-
$[
|
|
541
|
-
$[
|
|
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
|
-
|
|
547
|
-
|
|
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(
|
|
551
|
-
if ($[0] !== "
|
|
552
|
-
for (let $i = 0; $i <
|
|
553
|
-
$[0] = "
|
|
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] !==
|
|
647
|
+
if ($[13] !== pageBlocks || $[14] !== peekedBlockPosition) {
|
|
646
648
|
let t7;
|
|
647
|
-
if ($[16] !==
|
|
648
|
-
t7 = (block_1) =>
|
|
649
|
-
|
|
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 =
|
|
656
|
-
$[13] =
|
|
657
|
-
$[14] =
|
|
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]
|
|
662
|
-
|
|
663
|
-
$[
|
|
664
|
-
|
|
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 ($[
|
|
667
|
-
t8 =
|
|
668
|
-
$[
|
|
669
|
-
|
|
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 ($[
|
|
683
|
+
if ($[24] !== pageBlocks) {
|
|
673
684
|
t9 = pageBlocks.map(_temp5);
|
|
674
|
-
$[
|
|
675
|
-
$[
|
|
676
|
-
} else t9 = $[
|
|
685
|
+
$[24] = pageBlocks;
|
|
686
|
+
$[25] = t9;
|
|
687
|
+
} else t9 = $[25];
|
|
677
688
|
let t10;
|
|
678
|
-
if ($[
|
|
679
|
-
|
|
680
|
-
|
|
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:
|
|
716
|
+
children: [t10, t11]
|
|
683
717
|
});
|
|
684
|
-
$[
|
|
685
|
-
$[
|
|
686
|
-
$[
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
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
|
-
$[
|
|
705
|
-
$[
|
|
706
|
-
$[
|
|
707
|
-
} else
|
|
708
|
-
let
|
|
709
|
-
if ($[
|
|
710
|
-
|
|
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:
|
|
747
|
+
children: t13
|
|
713
748
|
});
|
|
714
|
-
$[
|
|
715
|
-
$[
|
|
716
|
-
} else
|
|
717
|
-
let
|
|
718
|
-
if ($[
|
|
719
|
-
|
|
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:
|
|
726
|
-
children: [
|
|
760
|
+
modifiers: t8,
|
|
761
|
+
children: [t12, t14]
|
|
727
762
|
});
|
|
728
|
-
$[
|
|
729
|
-
$[
|
|
730
|
-
$[
|
|
731
|
-
$[
|
|
732
|
-
$[
|
|
733
|
-
} else
|
|
734
|
-
let
|
|
735
|
-
if ($[
|
|
736
|
-
let
|
|
737
|
-
if ($[
|
|
738
|
-
|
|
739
|
-
block:
|
|
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(
|
|
742
|
-
$[
|
|
743
|
-
$[
|
|
744
|
-
} else
|
|
745
|
-
|
|
746
|
-
$[
|
|
747
|
-
$[
|
|
748
|
-
$[
|
|
749
|
-
} else
|
|
750
|
-
let
|
|
751
|
-
if ($[
|
|
752
|
-
|
|
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
|
-
|
|
756
|
-
|
|
757
|
-
|
|
790
|
+
t7,
|
|
791
|
+
t15,
|
|
792
|
+
t16
|
|
758
793
|
]
|
|
759
794
|
});
|
|
760
|
-
$[
|
|
761
|
-
$[
|
|
762
|
-
$[
|
|
763
|
-
$[
|
|
764
|
-
} else
|
|
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 ($[
|
|
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
|
-
$[
|
|
782
|
-
$[
|
|
783
|
-
} else t18 = $[
|
|
809
|
+
$[60] = requireDraft;
|
|
810
|
+
$[61] = t18;
|
|
811
|
+
} else t18 = $[61];
|
|
784
812
|
let t19;
|
|
785
|
-
if ($[
|
|
813
|
+
if ($[62] === Symbol.for("react.memo_cache_sentinel")) {
|
|
786
814
|
t19 = /* @__PURE__ */ jsx(Plus, {});
|
|
787
|
-
$[
|
|
788
|
-
} else t19 = $[
|
|
815
|
+
$[62] = t19;
|
|
816
|
+
} else t19 = $[62];
|
|
789
817
|
let t20;
|
|
790
|
-
if ($[
|
|
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
|
-
$[
|
|
798
|
-
$[
|
|
799
|
-
|
|
800
|
-
} else t20 = $[52];
|
|
824
|
+
$[63] = t18;
|
|
825
|
+
$[64] = t20;
|
|
826
|
+
} else t20 = $[64];
|
|
801
827
|
let t21;
|
|
802
|
-
if ($[
|
|
803
|
-
t21 = /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
804
|
-
$[
|
|
805
|
-
$[
|
|
806
|
-
$[
|
|
807
|
-
} else t21 = $[
|
|
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
|
|
811
|
-
return state.context.
|
|
836
|
+
function _temp3(state) {
|
|
837
|
+
return state.context.isAddBlockSidebarOpen;
|
|
812
838
|
}
|
|
813
|
-
function _temp4(
|
|
814
|
-
return
|
|
839
|
+
function _temp4(state_0) {
|
|
840
|
+
return state_0.context.peekedBlockPosition;
|
|
815
841
|
}
|
|
816
842
|
function _temp5(block_3) {
|
|
817
|
-
return
|
|
843
|
+
return String(block_3.id);
|
|
818
844
|
}
|
|
819
845
|
|
|
820
846
|
//#endregion
|
|
821
|
-
export { PageTree };
|
|
847
|
+
export { LayoutBlockItem, PageTree };
|