camox 0.6.1 → 0.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/core/components/AddBlockControlBar.d.ts.map +1 -1
- package/dist/core/components/AddBlockControlBar.js +51 -117
- package/dist/core/components/lexical/InlineLexicalEditor.js +1 -1
- package/dist/core/components/lexical/SidebarLexicalEditor.js +1 -1
- package/dist/core/createApp.d.ts +314 -44
- package/dist/core/createApp.d.ts.map +1 -1
- package/dist/core/createBlock.d.ts +160 -22
- package/dist/core/createBlock.d.ts.map +1 -1
- package/dist/core/createBlock.js +467 -579
- package/dist/features/content/components/AssetCard.js +1 -1
- package/dist/features/preview/CamoxPreview.d.ts.map +1 -1
- package/dist/features/preview/CamoxPreview.js +12 -16
- package/dist/features/preview/components/AddBlockSheet.d.ts.map +1 -1
- package/dist/features/preview/components/AddBlockSheet.js +1 -2
- package/dist/features/preview/components/AssetLightbox.d.ts.map +1 -1
- package/dist/features/preview/components/AssetLightbox.js +13 -15
- package/dist/features/preview/components/BlockActionsPopover.d.ts.map +1 -1
- package/dist/features/preview/components/BlockActionsPopover.js +19 -22
- package/dist/features/preview/components/CreatePageSheet.d.ts.map +1 -1
- package/dist/features/preview/components/CreatePageSheet.js +10 -4
- package/dist/features/preview/components/EditPageSheet.d.ts +1 -1
- package/dist/features/preview/components/EditPageSheet.d.ts.map +1 -1
- package/dist/features/preview/components/EditPageSheet.js +20 -17
- package/dist/features/preview/components/FieldOverlayStyles.d.ts +2 -0
- package/dist/features/preview/components/FieldOverlayStyles.d.ts.map +1 -0
- package/dist/features/preview/components/FieldOverlayStyles.js +15 -0
- package/dist/features/preview/components/Frame.d.ts +20 -0
- package/dist/features/preview/components/Frame.d.ts.map +1 -0
- package/dist/features/preview/components/Frame.js +162 -0
- package/dist/features/preview/components/LinkFieldEditor.d.ts.map +1 -1
- package/dist/features/preview/components/LinkFieldEditor.js +11 -12
- package/dist/features/preview/components/OverlayTracker.js +1 -1
- package/dist/features/preview/components/PageContentSheet.d.ts.map +1 -1
- package/dist/features/preview/components/PageContentSheet.js +3 -3
- package/dist/features/preview/components/PageLocationFieldset.d.ts.map +1 -1
- package/dist/features/preview/components/PageLocationFieldset.js +9 -11
- package/dist/features/preview/components/PagePicker.d.ts.map +1 -1
- package/dist/features/preview/components/PagePicker.js +15 -15
- package/dist/features/preview/components/PageTree.d.ts.map +1 -1
- package/dist/features/preview/components/PageTree.js +215 -203
- package/dist/features/preview/components/PreviewPanel.d.ts.map +1 -1
- package/dist/features/preview/components/PreviewPanel.js +21 -15
- package/dist/features/preview/components/PreviewSideSheet.d.ts.map +1 -1
- package/dist/features/preview/components/PreviewSideSheet.js +42 -26
- package/dist/features/preview/components/PreviewToolbar.d.ts.map +1 -1
- package/dist/features/preview/components/PreviewToolbar.js +191 -171
- package/dist/features/preview/components/RepeatableItemsList.d.ts.map +1 -1
- package/dist/features/preview/components/RepeatableItemsList.js +4 -5
- package/dist/features/preview/components/TextFormatToolbar.d.ts.map +1 -1
- package/dist/features/preview/components/TextFormatToolbar.js +5 -6
- package/dist/features/preview/components/UnlinkAssetButton.d.ts.map +1 -1
- package/dist/features/preview/components/UnlinkAssetButton.js +70 -91
- package/dist/features/preview/studio-overlays.css?inline.js +4 -0
- package/dist/features/provider/components/CamoxAppContext.d.ts +314 -44
- package/dist/features/provider/components/CamoxAppContext.d.ts.map +1 -1
- package/dist/features/provider/components/CommandPalette.d.ts.map +1 -1
- package/dist/features/provider/components/CommandPalette.js +22 -14
- package/dist/features/studio/CamoxStudio.d.ts +2 -3
- package/dist/features/studio/CamoxStudio.d.ts.map +1 -1
- package/dist/features/studio/components/EnvironmentMenu.d.ts.map +1 -1
- package/dist/features/studio/components/EnvironmentMenu.js +39 -35
- package/dist/features/studio/components/Navbar.js +2 -2
- package/dist/features/studio/components/ProjectMenu.d.ts.map +1 -1
- package/dist/features/studio/components/ProjectMenu.js +143 -129
- package/dist/features/studio/components/UserButton.d.ts.map +1 -1
- package/dist/features/studio/components/UserButton.js +8 -9
- package/dist/features/vite/vite.d.ts +2 -0
- package/dist/features/vite/vite.d.ts.map +1 -1
- package/dist/features/vite/vite.js +26 -30
- package/dist/lib/api-client.d.ts +17 -17
- package/dist/lib/queries.d.ts +7 -7
- package/dist/studio.css +1 -1
- package/package.json +5 -6
- package/skills/camox-block/SKILL.md +55 -28
- package/dist/features/preview/overlayConstants.d.ts +0 -19
- package/dist/features/preview/overlayConstants.d.ts.map +0 -1
- package/dist/features/preview/overlayConstants.js +0 -21
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { previewStore } from "../previewStore.js";
|
|
2
|
-
import { usePageBlocks } from "../../../lib/normalized-data.js";
|
|
3
2
|
import { cn } from "../../../lib/utils.js";
|
|
3
|
+
import { usePageBlocks } from "../../../lib/normalized-data.js";
|
|
4
4
|
import { useCamoxApp } from "../../provider/components/CamoxAppContext.js";
|
|
5
5
|
import { fieldTypesDictionary } from "../../../core/lib/fieldTypes.js";
|
|
6
6
|
import { useUpdateBlockPosition } from "./useUpdateBlockPosition.js";
|
|
@@ -17,7 +17,7 @@ import { DndContext, DragOverlay, KeyboardSensor, PointerSensor, closestCenter,
|
|
|
17
17
|
import { restrictToVerticalAxis } from "@dnd-kit/modifiers";
|
|
18
18
|
import { SortableContext, defaultAnimateLayoutChanges, sortableKeyboardCoordinates, useSortable, verticalListSortingStrategy } from "@dnd-kit/sortable";
|
|
19
19
|
import { CSS } from "@dnd-kit/utilities";
|
|
20
|
-
import
|
|
20
|
+
import { Accordion } from "@base-ui/react/accordion";
|
|
21
21
|
//#region src/features/preview/components/PageTree.tsx
|
|
22
22
|
function useEmbedTitle(url) {
|
|
23
23
|
const $ = c(3);
|
|
@@ -336,7 +336,7 @@ var BlockTreeItemHeader = (t0) => {
|
|
|
336
336
|
const t3 = isParentOfSelection && "bg-accent/25";
|
|
337
337
|
let t4;
|
|
338
338
|
if ($[8] !== className || $[9] !== t1 || $[10] !== t2 || $[11] !== t3) {
|
|
339
|
-
t4 = 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, t3, "data-[
|
|
339
|
+
t4 = 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, t3, "data-[open]:rounded-b-none", className);
|
|
340
340
|
$[8] = className;
|
|
341
341
|
$[9] = t1;
|
|
342
342
|
$[10] = t2;
|
|
@@ -372,13 +372,10 @@ var BlockTreeItemTrigger = (t0) => {
|
|
|
372
372
|
t2 = /* @__PURE__ */ jsx("div", {
|
|
373
373
|
className: "flex flex-1 items-center gap-1 overflow-x-hidden",
|
|
374
374
|
children: /* @__PURE__ */ jsx(Accordion.Trigger, {
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
onClick,
|
|
380
|
-
children: displayText
|
|
381
|
-
})
|
|
375
|
+
className: t1,
|
|
376
|
+
title: displayText,
|
|
377
|
+
onClick,
|
|
378
|
+
children: displayText
|
|
382
379
|
})
|
|
383
380
|
});
|
|
384
381
|
$[1] = displayText;
|
|
@@ -436,8 +433,8 @@ var BlockTreeItemContent = (t0) => {
|
|
|
436
433
|
const { block } = t0;
|
|
437
434
|
let t1;
|
|
438
435
|
if ($[0] !== block) {
|
|
439
|
-
t1 = /* @__PURE__ */ jsx(Accordion.
|
|
440
|
-
className: "
|
|
436
|
+
t1 = /* @__PURE__ */ jsx(Accordion.Panel, {
|
|
437
|
+
className: "text-muted-foreground data-[open]:bg-accent/25 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",
|
|
441
438
|
children: /* @__PURE__ */ jsx(BlockFields, { block })
|
|
442
439
|
});
|
|
443
440
|
$[0] = block;
|
|
@@ -451,7 +448,7 @@ var animateLayoutChanges = (args) => {
|
|
|
451
448
|
return defaultAnimateLayoutChanges(args);
|
|
452
449
|
};
|
|
453
450
|
var SortableBlock = (t0) => {
|
|
454
|
-
const $ = c(
|
|
451
|
+
const $ = c(51);
|
|
455
452
|
const { block, isSelected } = t0;
|
|
456
453
|
const [gripPopoverOpen, setGripPopoverOpen] = React.useState(false);
|
|
457
454
|
const t1 = String(block.id);
|
|
@@ -486,145 +483,154 @@ var SortableBlock = (t0) => {
|
|
|
486
483
|
} else t5 = $[7];
|
|
487
484
|
const style = t5;
|
|
488
485
|
const ctx = useBlockTreeItem(block, isSelected, isDragging);
|
|
489
|
-
|
|
486
|
+
let t6;
|
|
487
|
+
if ($[8] !== block.id || $[9] !== isSelected) {
|
|
488
|
+
t6 = isSelected ? [String(block.id)] : [];
|
|
489
|
+
$[8] = block.id;
|
|
490
|
+
$[9] = isSelected;
|
|
491
|
+
$[10] = t6;
|
|
492
|
+
} else t6 = $[10];
|
|
490
493
|
const t7 = String(block.id);
|
|
491
494
|
let t8;
|
|
495
|
+
if ($[11] === Symbol.for("react.memo_cache_sentinel")) {
|
|
496
|
+
t8 = /* @__PURE__ */ jsx("div", {});
|
|
497
|
+
$[11] = t8;
|
|
498
|
+
} else t8 = $[11];
|
|
499
|
+
let t10;
|
|
492
500
|
let t9;
|
|
493
|
-
if ($[
|
|
494
|
-
|
|
501
|
+
if ($[12] === Symbol.for("react.memo_cache_sentinel")) {
|
|
502
|
+
t9 = /* @__PURE__ */ jsx("span", {
|
|
495
503
|
className: "sr-only",
|
|
496
504
|
children: "Click and use arrow keys to reorder"
|
|
497
505
|
});
|
|
498
|
-
|
|
499
|
-
$[
|
|
500
|
-
$[
|
|
506
|
+
t10 = /* @__PURE__ */ jsx(GripVertical, { className: "h-4 w-4" });
|
|
507
|
+
$[12] = t10;
|
|
508
|
+
$[13] = t9;
|
|
501
509
|
} else {
|
|
502
|
-
|
|
503
|
-
t9 = $[
|
|
510
|
+
t10 = $[12];
|
|
511
|
+
t9 = $[13];
|
|
504
512
|
}
|
|
505
|
-
let
|
|
506
|
-
if ($[
|
|
507
|
-
|
|
513
|
+
let t11;
|
|
514
|
+
if ($[14] !== attributes || $[15] !== listeners) {
|
|
515
|
+
t11 = /* @__PURE__ */ jsxs(Button, {
|
|
508
516
|
variant: "ghost",
|
|
509
517
|
size: "icon-sm",
|
|
510
518
|
className: "text-muted-foreground hover:text-foreground flex cursor-grab active:cursor-grabbing",
|
|
511
519
|
...attributes,
|
|
512
520
|
...listeners,
|
|
513
|
-
children: [
|
|
521
|
+
children: [t9, t10]
|
|
514
522
|
});
|
|
515
|
-
$[
|
|
516
|
-
$[
|
|
517
|
-
$[
|
|
518
|
-
} else
|
|
519
|
-
let
|
|
520
|
-
if ($[
|
|
521
|
-
|
|
523
|
+
$[14] = attributes;
|
|
524
|
+
$[15] = listeners;
|
|
525
|
+
$[16] = t11;
|
|
526
|
+
} else t11 = $[16];
|
|
527
|
+
let t12;
|
|
528
|
+
if ($[17] !== block || $[18] !== gripPopoverOpen || $[19] !== t11) {
|
|
529
|
+
t12 = /* @__PURE__ */ jsx(BlockActionsPopover, {
|
|
522
530
|
block,
|
|
523
531
|
open: gripPopoverOpen,
|
|
524
532
|
onOpenChange: setGripPopoverOpen,
|
|
525
|
-
children:
|
|
533
|
+
children: t11
|
|
526
534
|
});
|
|
527
|
-
$[
|
|
528
|
-
$[
|
|
529
|
-
$[
|
|
530
|
-
$[
|
|
531
|
-
} else
|
|
532
|
-
const
|
|
533
|
-
let
|
|
534
|
-
if ($[
|
|
535
|
-
|
|
536
|
-
displayText:
|
|
535
|
+
$[17] = block;
|
|
536
|
+
$[18] = gripPopoverOpen;
|
|
537
|
+
$[19] = t11;
|
|
538
|
+
$[20] = t12;
|
|
539
|
+
} else t12 = $[20];
|
|
540
|
+
const t13 = block.summary || block.type;
|
|
541
|
+
let t14;
|
|
542
|
+
if ($[21] !== ctx.toggleSelection || $[22] !== t13) {
|
|
543
|
+
t14 = /* @__PURE__ */ jsx(BlockTreeItemTrigger, {
|
|
544
|
+
displayText: t13,
|
|
537
545
|
onClick: ctx.toggleSelection
|
|
538
546
|
});
|
|
539
|
-
$[
|
|
540
|
-
$[
|
|
541
|
-
$[
|
|
542
|
-
} else
|
|
543
|
-
let t14;
|
|
544
|
-
if ($[20] !== ctx.ellipsisPopoverOpen) {
|
|
545
|
-
t14 = /* @__PURE__ */ jsx(BlockTreeItemEllipsis, { open: ctx.ellipsisPopoverOpen });
|
|
546
|
-
$[20] = ctx.ellipsisPopoverOpen;
|
|
547
|
-
$[21] = t14;
|
|
548
|
-
} else t14 = $[21];
|
|
547
|
+
$[21] = ctx.toggleSelection;
|
|
548
|
+
$[22] = t13;
|
|
549
|
+
$[23] = t14;
|
|
550
|
+
} else t14 = $[23];
|
|
549
551
|
let t15;
|
|
550
|
-
if ($[
|
|
551
|
-
t15 = /* @__PURE__ */ jsx(
|
|
552
|
+
if ($[24] !== ctx.ellipsisPopoverOpen) {
|
|
553
|
+
t15 = /* @__PURE__ */ jsx(BlockTreeItemEllipsis, { open: ctx.ellipsisPopoverOpen });
|
|
554
|
+
$[24] = ctx.ellipsisPopoverOpen;
|
|
555
|
+
$[25] = t15;
|
|
556
|
+
} else t15 = $[25];
|
|
557
|
+
let t16;
|
|
558
|
+
if ($[26] !== block || $[27] !== ctx.ellipsisPopoverOpen || $[28] !== ctx.setEllipsisPopoverOpen || $[29] !== t15) {
|
|
559
|
+
t16 = /* @__PURE__ */ jsx(BlockActionsPopover, {
|
|
552
560
|
block,
|
|
553
561
|
open: ctx.ellipsisPopoverOpen,
|
|
554
562
|
onOpenChange: ctx.setEllipsisPopoverOpen,
|
|
555
|
-
children:
|
|
563
|
+
children: t15
|
|
556
564
|
});
|
|
557
|
-
$[
|
|
558
|
-
$[
|
|
559
|
-
$[
|
|
560
|
-
$[
|
|
561
|
-
$[
|
|
562
|
-
} else
|
|
563
|
-
let
|
|
564
|
-
if ($[
|
|
565
|
-
|
|
566
|
-
|
|
565
|
+
$[26] = block;
|
|
566
|
+
$[27] = ctx.ellipsisPopoverOpen;
|
|
567
|
+
$[28] = ctx.setEllipsisPopoverOpen;
|
|
568
|
+
$[29] = t15;
|
|
569
|
+
$[30] = t16;
|
|
570
|
+
} else t16 = $[30];
|
|
571
|
+
let t17;
|
|
572
|
+
if ($[31] !== ctx.isParentOfSelection || $[32] !== ctx.shouldShowActive || $[33] !== ctx.shouldShowHover || $[34] !== t12 || $[35] !== t14 || $[36] !== t16) {
|
|
573
|
+
t17 = /* @__PURE__ */ jsx(Accordion.Header, {
|
|
574
|
+
render: t8,
|
|
567
575
|
children: /* @__PURE__ */ jsxs(BlockTreeItemHeader, {
|
|
568
576
|
shouldShowHover: ctx.shouldShowHover,
|
|
569
577
|
shouldShowActive: ctx.shouldShowActive,
|
|
570
578
|
isParentOfSelection: ctx.isParentOfSelection,
|
|
571
579
|
children: [
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
580
|
+
t12,
|
|
581
|
+
t14,
|
|
582
|
+
t16
|
|
575
583
|
]
|
|
576
584
|
})
|
|
577
585
|
});
|
|
578
|
-
$[
|
|
579
|
-
$[
|
|
580
|
-
$[
|
|
581
|
-
$[
|
|
582
|
-
$[
|
|
583
|
-
$[
|
|
584
|
-
$[
|
|
585
|
-
} else
|
|
586
|
-
let t17;
|
|
587
|
-
if ($[34] !== block) {
|
|
588
|
-
t17 = /* @__PURE__ */ jsx(BlockTreeItemContent, { block });
|
|
589
|
-
$[34] = block;
|
|
590
|
-
$[35] = t17;
|
|
591
|
-
} else t17 = $[35];
|
|
586
|
+
$[31] = ctx.isParentOfSelection;
|
|
587
|
+
$[32] = ctx.shouldShowActive;
|
|
588
|
+
$[33] = ctx.shouldShowHover;
|
|
589
|
+
$[34] = t12;
|
|
590
|
+
$[35] = t14;
|
|
591
|
+
$[36] = t16;
|
|
592
|
+
$[37] = t17;
|
|
593
|
+
} else t17 = $[37];
|
|
592
594
|
let t18;
|
|
593
|
-
if ($[
|
|
594
|
-
t18 = /* @__PURE__ */
|
|
595
|
+
if ($[38] !== block) {
|
|
596
|
+
t18 = /* @__PURE__ */ jsx(BlockTreeItemContent, { block });
|
|
597
|
+
$[38] = block;
|
|
598
|
+
$[39] = t18;
|
|
599
|
+
} else t18 = $[39];
|
|
600
|
+
let t19;
|
|
601
|
+
if ($[40] !== ctx.handleBlockMouseEnter || $[41] !== ctx.handleBlockMouseLeave || $[42] !== setNodeRef || $[43] !== style || $[44] !== t17 || $[45] !== t18 || $[46] !== t7) {
|
|
602
|
+
t19 = /* @__PURE__ */ jsxs(Accordion.Item, {
|
|
595
603
|
value: t7,
|
|
596
604
|
ref: setNodeRef,
|
|
597
605
|
style,
|
|
598
606
|
className: "group",
|
|
599
607
|
onMouseEnter: ctx.handleBlockMouseEnter,
|
|
600
608
|
onMouseLeave: ctx.handleBlockMouseLeave,
|
|
601
|
-
children: [
|
|
609
|
+
children: [t17, t18]
|
|
602
610
|
});
|
|
603
|
-
$[
|
|
604
|
-
$[
|
|
605
|
-
$[
|
|
606
|
-
$[
|
|
607
|
-
$[
|
|
608
|
-
$[
|
|
609
|
-
$[
|
|
610
|
-
$[
|
|
611
|
-
} else
|
|
612
|
-
let
|
|
613
|
-
if ($[
|
|
614
|
-
|
|
615
|
-
type: "single",
|
|
616
|
-
collapsible: true,
|
|
611
|
+
$[40] = ctx.handleBlockMouseEnter;
|
|
612
|
+
$[41] = ctx.handleBlockMouseLeave;
|
|
613
|
+
$[42] = setNodeRef;
|
|
614
|
+
$[43] = style;
|
|
615
|
+
$[44] = t17;
|
|
616
|
+
$[45] = t18;
|
|
617
|
+
$[46] = t7;
|
|
618
|
+
$[47] = t19;
|
|
619
|
+
} else t19 = $[47];
|
|
620
|
+
let t20;
|
|
621
|
+
if ($[48] !== t19 || $[49] !== t6) {
|
|
622
|
+
t20 = /* @__PURE__ */ jsx(Accordion.Root, {
|
|
617
623
|
value: t6,
|
|
618
|
-
children:
|
|
624
|
+
children: t19
|
|
619
625
|
});
|
|
620
|
-
$[
|
|
621
|
-
$[
|
|
622
|
-
$[
|
|
623
|
-
} else
|
|
624
|
-
return
|
|
626
|
+
$[48] = t19;
|
|
627
|
+
$[49] = t6;
|
|
628
|
+
$[50] = t20;
|
|
629
|
+
} else t20 = $[50];
|
|
630
|
+
return t20;
|
|
625
631
|
};
|
|
626
632
|
var LayoutBlockItem = (t0) => {
|
|
627
|
-
const $ = c(
|
|
633
|
+
const $ = c(42);
|
|
628
634
|
const { block, isSelected, layoutName } = t0;
|
|
629
635
|
const camoxApp = useCamoxApp();
|
|
630
636
|
let t1;
|
|
@@ -637,137 +643,143 @@ var LayoutBlockItem = (t0) => {
|
|
|
637
643
|
const blockDef = t1;
|
|
638
644
|
const ctx = useBlockTreeItem(block, isSelected);
|
|
639
645
|
const displayText = blockDef?.title ?? block.type;
|
|
640
|
-
|
|
646
|
+
let t2;
|
|
647
|
+
if ($[3] !== block.id || $[4] !== isSelected) {
|
|
648
|
+
t2 = isSelected ? [String(block.id)] : [];
|
|
649
|
+
$[3] = block.id;
|
|
650
|
+
$[4] = isSelected;
|
|
651
|
+
$[5] = t2;
|
|
652
|
+
} else t2 = $[5];
|
|
641
653
|
const t3 = String(block.id);
|
|
642
654
|
let t4;
|
|
643
|
-
if ($[
|
|
644
|
-
t4 = /* @__PURE__ */ jsx(
|
|
645
|
-
$[
|
|
646
|
-
} else t4 = $[
|
|
655
|
+
if ($[6] === Symbol.for("react.memo_cache_sentinel")) {
|
|
656
|
+
t4 = /* @__PURE__ */ jsx("div", {});
|
|
657
|
+
$[6] = t4;
|
|
658
|
+
} else t4 = $[6];
|
|
647
659
|
let t5;
|
|
648
|
-
if ($[
|
|
649
|
-
t5 = /* @__PURE__ */ jsx("
|
|
660
|
+
if ($[7] === Symbol.for("react.memo_cache_sentinel")) {
|
|
661
|
+
t5 = /* @__PURE__ */ jsx(TooltipTrigger, { children: /* @__PURE__ */ jsx(LayoutTemplate, { className: "h-4 w-4" }) });
|
|
662
|
+
$[7] = t5;
|
|
663
|
+
} else t5 = $[7];
|
|
664
|
+
let t6;
|
|
665
|
+
if ($[8] !== layoutName) {
|
|
666
|
+
t6 = /* @__PURE__ */ jsx("span", {
|
|
650
667
|
className: "font-semibold",
|
|
651
668
|
children: layoutName
|
|
652
669
|
});
|
|
653
|
-
$[
|
|
654
|
-
$[
|
|
655
|
-
} else
|
|
656
|
-
let t6;
|
|
657
|
-
if ($[6] === Symbol.for("react.memo_cache_sentinel")) {
|
|
658
|
-
t6 = /* @__PURE__ */ jsx("br", {});
|
|
659
|
-
$[6] = t6;
|
|
660
|
-
} else t6 = $[6];
|
|
670
|
+
$[8] = layoutName;
|
|
671
|
+
$[9] = t6;
|
|
672
|
+
} else t6 = $[9];
|
|
661
673
|
let t7;
|
|
662
|
-
if ($[
|
|
663
|
-
t7 = /* @__PURE__ */ jsx("
|
|
674
|
+
if ($[10] === Symbol.for("react.memo_cache_sentinel")) {
|
|
675
|
+
t7 = /* @__PURE__ */ jsx("br", {});
|
|
676
|
+
$[10] = t7;
|
|
677
|
+
} else t7 = $[10];
|
|
678
|
+
let t8;
|
|
679
|
+
if ($[11] !== t6) {
|
|
680
|
+
t8 = /* @__PURE__ */ jsx("div", {
|
|
664
681
|
className: "text-muted-foreground flex size-7 shrink-0 items-center justify-center",
|
|
665
|
-
children: /* @__PURE__ */ jsxs(Tooltip, {
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
"Changing the content may affect other pages"
|
|
673
|
-
] })]
|
|
674
|
-
})
|
|
682
|
+
children: /* @__PURE__ */ jsxs(Tooltip, { children: [t5, /* @__PURE__ */ jsxs(TooltipContent, { children: [
|
|
683
|
+
"From ",
|
|
684
|
+
t6,
|
|
685
|
+
" layout.",
|
|
686
|
+
t7,
|
|
687
|
+
"Changing the content may affect other pages"
|
|
688
|
+
] })] })
|
|
675
689
|
});
|
|
676
|
-
$[
|
|
677
|
-
$[
|
|
678
|
-
} else
|
|
679
|
-
let
|
|
680
|
-
if ($[
|
|
681
|
-
|
|
690
|
+
$[11] = t6;
|
|
691
|
+
$[12] = t8;
|
|
692
|
+
} else t8 = $[12];
|
|
693
|
+
let t9;
|
|
694
|
+
if ($[13] !== ctx.toggleSelection || $[14] !== displayText) {
|
|
695
|
+
t9 = /* @__PURE__ */ jsx(BlockTreeItemTrigger, {
|
|
682
696
|
displayText,
|
|
683
697
|
onClick: ctx.toggleSelection
|
|
684
698
|
});
|
|
685
|
-
$[
|
|
686
|
-
$[
|
|
687
|
-
$[
|
|
688
|
-
} else
|
|
689
|
-
const
|
|
690
|
-
let t10;
|
|
691
|
-
if ($[12] !== ctx.ellipsisPopoverOpen) {
|
|
692
|
-
t10 = /* @__PURE__ */ jsx(BlockTreeItemEllipsis, { open: ctx.ellipsisPopoverOpen });
|
|
693
|
-
$[12] = ctx.ellipsisPopoverOpen;
|
|
694
|
-
$[13] = t10;
|
|
695
|
-
} else t10 = $[13];
|
|
699
|
+
$[13] = ctx.toggleSelection;
|
|
700
|
+
$[14] = displayText;
|
|
701
|
+
$[15] = t9;
|
|
702
|
+
} else t9 = $[15];
|
|
703
|
+
const t10 = block.placement;
|
|
696
704
|
let t11;
|
|
697
|
-
if ($[
|
|
698
|
-
t11 = /* @__PURE__ */ jsx(
|
|
705
|
+
if ($[16] !== ctx.ellipsisPopoverOpen) {
|
|
706
|
+
t11 = /* @__PURE__ */ jsx(BlockTreeItemEllipsis, { open: ctx.ellipsisPopoverOpen });
|
|
707
|
+
$[16] = ctx.ellipsisPopoverOpen;
|
|
708
|
+
$[17] = t11;
|
|
709
|
+
} else t11 = $[17];
|
|
710
|
+
let t12;
|
|
711
|
+
if ($[18] !== block || $[19] !== ctx.ellipsisPopoverOpen || $[20] !== ctx.setEllipsisPopoverOpen || $[21] !== t10 || $[22] !== t11) {
|
|
712
|
+
t12 = /* @__PURE__ */ jsx(BlockActionsPopover, {
|
|
699
713
|
block,
|
|
700
714
|
open: ctx.ellipsisPopoverOpen,
|
|
701
715
|
onOpenChange: ctx.setEllipsisPopoverOpen,
|
|
702
716
|
isLayoutBlock: true,
|
|
703
|
-
layoutPlacement:
|
|
704
|
-
children:
|
|
717
|
+
layoutPlacement: t10,
|
|
718
|
+
children: t11
|
|
705
719
|
});
|
|
706
|
-
$[
|
|
707
|
-
$[
|
|
708
|
-
$[
|
|
709
|
-
$[
|
|
710
|
-
$[
|
|
711
|
-
$[
|
|
712
|
-
} else
|
|
713
|
-
let
|
|
714
|
-
if ($[
|
|
715
|
-
|
|
716
|
-
|
|
720
|
+
$[18] = block;
|
|
721
|
+
$[19] = ctx.ellipsisPopoverOpen;
|
|
722
|
+
$[20] = ctx.setEllipsisPopoverOpen;
|
|
723
|
+
$[21] = t10;
|
|
724
|
+
$[22] = t11;
|
|
725
|
+
$[23] = t12;
|
|
726
|
+
} else t12 = $[23];
|
|
727
|
+
let t13;
|
|
728
|
+
if ($[24] !== ctx.isParentOfSelection || $[25] !== ctx.shouldShowActive || $[26] !== ctx.shouldShowHover || $[27] !== t12 || $[28] !== t8 || $[29] !== t9) {
|
|
729
|
+
t13 = /* @__PURE__ */ jsx(Accordion.Header, {
|
|
730
|
+
render: t4,
|
|
717
731
|
children: /* @__PURE__ */ jsxs(BlockTreeItemHeader, {
|
|
718
732
|
shouldShowHover: ctx.shouldShowHover,
|
|
719
733
|
shouldShowActive: ctx.shouldShowActive,
|
|
720
734
|
isParentOfSelection: ctx.isParentOfSelection,
|
|
721
735
|
children: [
|
|
722
|
-
t7,
|
|
723
736
|
t8,
|
|
724
|
-
|
|
737
|
+
t9,
|
|
738
|
+
t12
|
|
725
739
|
]
|
|
726
740
|
})
|
|
727
741
|
});
|
|
728
|
-
$[
|
|
729
|
-
$[
|
|
730
|
-
$[
|
|
731
|
-
$[
|
|
732
|
-
$[
|
|
733
|
-
$[
|
|
734
|
-
$[
|
|
735
|
-
} else
|
|
736
|
-
let t13;
|
|
737
|
-
if ($[27] !== block) {
|
|
738
|
-
t13 = /* @__PURE__ */ jsx(BlockTreeItemContent, { block });
|
|
739
|
-
$[27] = block;
|
|
740
|
-
$[28] = t13;
|
|
741
|
-
} else t13 = $[28];
|
|
742
|
+
$[24] = ctx.isParentOfSelection;
|
|
743
|
+
$[25] = ctx.shouldShowActive;
|
|
744
|
+
$[26] = ctx.shouldShowHover;
|
|
745
|
+
$[27] = t12;
|
|
746
|
+
$[28] = t8;
|
|
747
|
+
$[29] = t9;
|
|
748
|
+
$[30] = t13;
|
|
749
|
+
} else t13 = $[30];
|
|
742
750
|
let t14;
|
|
743
|
-
if ($[
|
|
744
|
-
t14 = /* @__PURE__ */
|
|
751
|
+
if ($[31] !== block) {
|
|
752
|
+
t14 = /* @__PURE__ */ jsx(BlockTreeItemContent, { block });
|
|
753
|
+
$[31] = block;
|
|
754
|
+
$[32] = t14;
|
|
755
|
+
} else t14 = $[32];
|
|
756
|
+
let t15;
|
|
757
|
+
if ($[33] !== ctx.handleBlockMouseEnter || $[34] !== ctx.handleBlockMouseLeave || $[35] !== t13 || $[36] !== t14 || $[37] !== t3) {
|
|
758
|
+
t15 = /* @__PURE__ */ jsxs(Accordion.Item, {
|
|
745
759
|
value: t3,
|
|
746
760
|
className: "group",
|
|
747
761
|
onMouseEnter: ctx.handleBlockMouseEnter,
|
|
748
762
|
onMouseLeave: ctx.handleBlockMouseLeave,
|
|
749
|
-
children: [
|
|
763
|
+
children: [t13, t14]
|
|
750
764
|
});
|
|
751
|
-
$[
|
|
752
|
-
$[
|
|
753
|
-
$[
|
|
754
|
-
$[
|
|
755
|
-
$[
|
|
756
|
-
$[
|
|
757
|
-
} else
|
|
758
|
-
let
|
|
759
|
-
if ($[
|
|
760
|
-
|
|
761
|
-
type: "single",
|
|
762
|
-
collapsible: true,
|
|
765
|
+
$[33] = ctx.handleBlockMouseEnter;
|
|
766
|
+
$[34] = ctx.handleBlockMouseLeave;
|
|
767
|
+
$[35] = t13;
|
|
768
|
+
$[36] = t14;
|
|
769
|
+
$[37] = t3;
|
|
770
|
+
$[38] = t15;
|
|
771
|
+
} else t15 = $[38];
|
|
772
|
+
let t16;
|
|
773
|
+
if ($[39] !== t15 || $[40] !== t2) {
|
|
774
|
+
t16 = /* @__PURE__ */ jsx(Accordion.Root, {
|
|
763
775
|
value: t2,
|
|
764
|
-
children:
|
|
776
|
+
children: t15
|
|
765
777
|
});
|
|
766
|
-
$[
|
|
767
|
-
$[
|
|
768
|
-
$[
|
|
769
|
-
} else
|
|
770
|
-
return
|
|
778
|
+
$[39] = t15;
|
|
779
|
+
$[40] = t2;
|
|
780
|
+
$[41] = t16;
|
|
781
|
+
} else t16 = $[41];
|
|
782
|
+
return t16;
|
|
771
783
|
};
|
|
772
784
|
var PageTree = () => {
|
|
773
785
|
const $ = c(53);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PreviewPanel.d.ts","sourceRoot":"","sources":["../../../../src/features/preview/components/PreviewPanel.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"PreviewPanel.d.ts","sourceRoot":"","sources":["../../../../src/features/preview/components/PreviewPanel.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAqB/B,eAAO,MAAM,YAAY,GAAI,gDAK1B;IACD,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IAC5B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,aAAa,CAAC,EAAE,CAAC,MAAM,EAAE,iBAAiB,KAAK,IAAI,CAAC;CACrD,4CASA,CAAC;AAmFF,QAAA,MAAM,YAAY,GAAI,cAAc;IAAE,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;CAAE,4CAoHhE,CAAC;AAEF,OAAO,EAAE,YAAY,EAAE,CAAC"}
|
|
@@ -2,51 +2,57 @@ import { previewStore } from "../previewStore.js";
|
|
|
2
2
|
import { useIsPreviewSheetOpen } from "./PreviewSideSheet.js";
|
|
3
3
|
import { actionsStore } from "../../provider/actionsStore.js";
|
|
4
4
|
import { checkIfInputFocused } from "../../../lib/utils.js";
|
|
5
|
+
import { Frame, useFrame } from "./Frame.js";
|
|
5
6
|
import { useBlockActionsShortcuts } from "./BlockActionsPopover.js";
|
|
7
|
+
import { FieldOverlayStyles } from "./FieldOverlayStyles.js";
|
|
6
8
|
import { Overlays } from "./Overlays.js";
|
|
7
9
|
import { OverlayTracker } from "./OverlayTracker.js";
|
|
8
10
|
import { PreviewToolbar } from "./PreviewToolbar.js";
|
|
9
11
|
import { TextFormatToolbar } from "./TextFormatToolbar.js";
|
|
10
12
|
import { c } from "react/compiler-runtime";
|
|
11
|
-
import { Frame, useFrame } from "@camox/ui/frame";
|
|
12
13
|
import { useSelector } from "@xstate/store/react";
|
|
13
14
|
import * as React from "react";
|
|
14
15
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
15
16
|
import { PanelContent } from "@camox/ui/panel";
|
|
16
17
|
//#region src/features/preview/components/PreviewPanel.tsx
|
|
17
18
|
var PreviewFrame = (t0) => {
|
|
18
|
-
const $ = c(
|
|
19
|
+
const $ = c(8);
|
|
19
20
|
const { children, style, className, onIframeReady } = t0;
|
|
20
21
|
let t1;
|
|
21
22
|
let t2;
|
|
23
|
+
let t3;
|
|
22
24
|
if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
|
|
23
|
-
t1 = /* @__PURE__ */ jsx(
|
|
24
|
-
t2 = /* @__PURE__ */ jsx(
|
|
25
|
+
t1 = /* @__PURE__ */ jsx(FieldOverlayStyles, {});
|
|
26
|
+
t2 = /* @__PURE__ */ jsx(KeyDownForwarder, {});
|
|
27
|
+
t3 = /* @__PURE__ */ jsx(OverlayTracker, {});
|
|
25
28
|
$[0] = t1;
|
|
26
29
|
$[1] = t2;
|
|
30
|
+
$[2] = t3;
|
|
27
31
|
} else {
|
|
28
32
|
t1 = $[0];
|
|
29
33
|
t2 = $[1];
|
|
34
|
+
t3 = $[2];
|
|
30
35
|
}
|
|
31
|
-
let
|
|
32
|
-
if ($[
|
|
33
|
-
|
|
36
|
+
let t4;
|
|
37
|
+
if ($[3] !== children || $[4] !== className || $[5] !== onIframeReady || $[6] !== style) {
|
|
38
|
+
t4 = /* @__PURE__ */ jsxs(Frame, {
|
|
34
39
|
className,
|
|
35
40
|
style,
|
|
36
41
|
onIframeReady,
|
|
37
42
|
children: [
|
|
38
43
|
children,
|
|
39
44
|
t1,
|
|
40
|
-
t2
|
|
45
|
+
t2,
|
|
46
|
+
t3
|
|
41
47
|
]
|
|
42
48
|
});
|
|
43
|
-
$[
|
|
44
|
-
$[
|
|
45
|
-
$[
|
|
46
|
-
$[
|
|
47
|
-
$[
|
|
48
|
-
} else
|
|
49
|
-
return
|
|
49
|
+
$[3] = children;
|
|
50
|
+
$[4] = className;
|
|
51
|
+
$[5] = onIframeReady;
|
|
52
|
+
$[6] = style;
|
|
53
|
+
$[7] = t4;
|
|
54
|
+
} else t4 = $[7];
|
|
55
|
+
return t4;
|
|
50
56
|
};
|
|
51
57
|
var KeyDownForwarder = () => {
|
|
52
58
|
const $ = c(4);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PreviewSideSheet.d.ts","sourceRoot":"","sources":["../../../../src/features/preview/components/PreviewSideSheet.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,iBAAiB,CAAC;AAEzC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAK/B,UAAU,qBAAqB;IAC7B,IAAI,EAAE,OAAO,CAAC;IACd,YAAY,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;IACtC,eAAe,CAAC,EAAE,CAAC,CAAC,EAAE,KAAK,KAAK,IAAI,CAAC;IACrC,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,QAAA,MAAM,gBAAgB,GAAI,+DAMvB,qBAAqB,
|
|
1
|
+
{"version":3,"file":"PreviewSideSheet.d.ts","sourceRoot":"","sources":["../../../../src/features/preview/components/PreviewSideSheet.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,iBAAiB,CAAC;AAEzC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAK/B,UAAU,qBAAqB;IAC7B,IAAI,EAAE,OAAO,CAAC;IACd,YAAY,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;IACtC,eAAe,CAAC,EAAE,CAAC,CAAC,EAAE,KAAK,KAAK,IAAI,CAAC;IACrC,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,QAAA,MAAM,gBAAgB,GAAI,+DAMvB,qBAAqB,4CAsBvB,CAAC;AAEF,wBAAgB,qBAAqB,YAYpC;AAED,OAAO,EAAE,gBAAgB,EAAE,KAAK,IAAI,UAAU,EAAE,CAAC"}
|