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.
Files changed (77) hide show
  1. package/dist/core/components/AddBlockControlBar.d.ts.map +1 -1
  2. package/dist/core/components/AddBlockControlBar.js +51 -117
  3. package/dist/core/components/lexical/InlineLexicalEditor.js +1 -1
  4. package/dist/core/components/lexical/SidebarLexicalEditor.js +1 -1
  5. package/dist/core/createApp.d.ts +314 -44
  6. package/dist/core/createApp.d.ts.map +1 -1
  7. package/dist/core/createBlock.d.ts +160 -22
  8. package/dist/core/createBlock.d.ts.map +1 -1
  9. package/dist/core/createBlock.js +467 -579
  10. package/dist/features/content/components/AssetCard.js +1 -1
  11. package/dist/features/preview/CamoxPreview.d.ts.map +1 -1
  12. package/dist/features/preview/CamoxPreview.js +12 -16
  13. package/dist/features/preview/components/AddBlockSheet.d.ts.map +1 -1
  14. package/dist/features/preview/components/AddBlockSheet.js +1 -2
  15. package/dist/features/preview/components/AssetLightbox.d.ts.map +1 -1
  16. package/dist/features/preview/components/AssetLightbox.js +13 -15
  17. package/dist/features/preview/components/BlockActionsPopover.d.ts.map +1 -1
  18. package/dist/features/preview/components/BlockActionsPopover.js +19 -22
  19. package/dist/features/preview/components/CreatePageSheet.d.ts.map +1 -1
  20. package/dist/features/preview/components/CreatePageSheet.js +10 -4
  21. package/dist/features/preview/components/EditPageSheet.d.ts +1 -1
  22. package/dist/features/preview/components/EditPageSheet.d.ts.map +1 -1
  23. package/dist/features/preview/components/EditPageSheet.js +20 -17
  24. package/dist/features/preview/components/FieldOverlayStyles.d.ts +2 -0
  25. package/dist/features/preview/components/FieldOverlayStyles.d.ts.map +1 -0
  26. package/dist/features/preview/components/FieldOverlayStyles.js +15 -0
  27. package/dist/features/preview/components/Frame.d.ts +20 -0
  28. package/dist/features/preview/components/Frame.d.ts.map +1 -0
  29. package/dist/features/preview/components/Frame.js +162 -0
  30. package/dist/features/preview/components/LinkFieldEditor.d.ts.map +1 -1
  31. package/dist/features/preview/components/LinkFieldEditor.js +11 -12
  32. package/dist/features/preview/components/OverlayTracker.js +1 -1
  33. package/dist/features/preview/components/PageContentSheet.d.ts.map +1 -1
  34. package/dist/features/preview/components/PageContentSheet.js +3 -3
  35. package/dist/features/preview/components/PageLocationFieldset.d.ts.map +1 -1
  36. package/dist/features/preview/components/PageLocationFieldset.js +9 -11
  37. package/dist/features/preview/components/PagePicker.d.ts.map +1 -1
  38. package/dist/features/preview/components/PagePicker.js +15 -15
  39. package/dist/features/preview/components/PageTree.d.ts.map +1 -1
  40. package/dist/features/preview/components/PageTree.js +215 -203
  41. package/dist/features/preview/components/PreviewPanel.d.ts.map +1 -1
  42. package/dist/features/preview/components/PreviewPanel.js +21 -15
  43. package/dist/features/preview/components/PreviewSideSheet.d.ts.map +1 -1
  44. package/dist/features/preview/components/PreviewSideSheet.js +42 -26
  45. package/dist/features/preview/components/PreviewToolbar.d.ts.map +1 -1
  46. package/dist/features/preview/components/PreviewToolbar.js +191 -171
  47. package/dist/features/preview/components/RepeatableItemsList.d.ts.map +1 -1
  48. package/dist/features/preview/components/RepeatableItemsList.js +4 -5
  49. package/dist/features/preview/components/TextFormatToolbar.d.ts.map +1 -1
  50. package/dist/features/preview/components/TextFormatToolbar.js +5 -6
  51. package/dist/features/preview/components/UnlinkAssetButton.d.ts.map +1 -1
  52. package/dist/features/preview/components/UnlinkAssetButton.js +70 -91
  53. package/dist/features/preview/studio-overlays.css?inline.js +4 -0
  54. package/dist/features/provider/components/CamoxAppContext.d.ts +314 -44
  55. package/dist/features/provider/components/CamoxAppContext.d.ts.map +1 -1
  56. package/dist/features/provider/components/CommandPalette.d.ts.map +1 -1
  57. package/dist/features/provider/components/CommandPalette.js +22 -14
  58. package/dist/features/studio/CamoxStudio.d.ts +2 -3
  59. package/dist/features/studio/CamoxStudio.d.ts.map +1 -1
  60. package/dist/features/studio/components/EnvironmentMenu.d.ts.map +1 -1
  61. package/dist/features/studio/components/EnvironmentMenu.js +39 -35
  62. package/dist/features/studio/components/Navbar.js +2 -2
  63. package/dist/features/studio/components/ProjectMenu.d.ts.map +1 -1
  64. package/dist/features/studio/components/ProjectMenu.js +143 -129
  65. package/dist/features/studio/components/UserButton.d.ts.map +1 -1
  66. package/dist/features/studio/components/UserButton.js +8 -9
  67. package/dist/features/vite/vite.d.ts +2 -0
  68. package/dist/features/vite/vite.d.ts.map +1 -1
  69. package/dist/features/vite/vite.js +26 -30
  70. package/dist/lib/api-client.d.ts +17 -17
  71. package/dist/lib/queries.d.ts +7 -7
  72. package/dist/studio.css +1 -1
  73. package/package.json +5 -6
  74. package/skills/camox-block/SKILL.md +55 -28
  75. package/dist/features/preview/overlayConstants.d.ts +0 -19
  76. package/dist/features/preview/overlayConstants.d.ts.map +0 -1
  77. 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 * as Accordion from "@radix-ui/react-accordion";
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-[state=open]:rounded-b-none", className);
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
- asChild: true,
376
- children: /* @__PURE__ */ jsx("button", {
377
- className: t1,
378
- title: displayText,
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.Content, {
440
- className: "data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down text-muted-foreground data-[state=open]:bg-accent/25 overflow-hidden rounded-b-lg text-sm",
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(47);
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
- const t6 = isSelected ? String(block.id) : "";
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 ($[8] === Symbol.for("react.memo_cache_sentinel")) {
494
- t8 = /* @__PURE__ */ jsx("span", {
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
- t9 = /* @__PURE__ */ jsx(GripVertical, { className: "h-4 w-4" });
499
- $[8] = t8;
500
- $[9] = t9;
506
+ t10 = /* @__PURE__ */ jsx(GripVertical, { className: "h-4 w-4" });
507
+ $[12] = t10;
508
+ $[13] = t9;
501
509
  } else {
502
- t8 = $[8];
503
- t9 = $[9];
510
+ t10 = $[12];
511
+ t9 = $[13];
504
512
  }
505
- let t10;
506
- if ($[10] !== attributes || $[11] !== listeners) {
507
- t10 = /* @__PURE__ */ jsxs(Button, {
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: [t8, t9]
521
+ children: [t9, t10]
514
522
  });
515
- $[10] = attributes;
516
- $[11] = listeners;
517
- $[12] = t10;
518
- } else t10 = $[12];
519
- let t11;
520
- if ($[13] !== block || $[14] !== gripPopoverOpen || $[15] !== t10) {
521
- t11 = /* @__PURE__ */ jsx(BlockActionsPopover, {
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: t10
533
+ children: t11
526
534
  });
527
- $[13] = block;
528
- $[14] = gripPopoverOpen;
529
- $[15] = t10;
530
- $[16] = t11;
531
- } else t11 = $[16];
532
- const t12 = block.summary || block.type;
533
- let t13;
534
- if ($[17] !== ctx.toggleSelection || $[18] !== t12) {
535
- t13 = /* @__PURE__ */ jsx(BlockTreeItemTrigger, {
536
- displayText: t12,
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
- $[17] = ctx.toggleSelection;
540
- $[18] = t12;
541
- $[19] = t13;
542
- } else t13 = $[19];
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 ($[22] !== block || $[23] !== ctx.ellipsisPopoverOpen || $[24] !== ctx.setEllipsisPopoverOpen || $[25] !== t14) {
551
- t15 = /* @__PURE__ */ jsx(BlockActionsPopover, {
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: t14
563
+ children: t15
556
564
  });
557
- $[22] = block;
558
- $[23] = ctx.ellipsisPopoverOpen;
559
- $[24] = ctx.setEllipsisPopoverOpen;
560
- $[25] = t14;
561
- $[26] = t15;
562
- } else t15 = $[26];
563
- let t16;
564
- if ($[27] !== ctx.isParentOfSelection || $[28] !== ctx.shouldShowActive || $[29] !== ctx.shouldShowHover || $[30] !== t11 || $[31] !== t13 || $[32] !== t15) {
565
- t16 = /* @__PURE__ */ jsx(Accordion.Header, {
566
- asChild: true,
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
- t11,
573
- t13,
574
- t15
580
+ t12,
581
+ t14,
582
+ t16
575
583
  ]
576
584
  })
577
585
  });
578
- $[27] = ctx.isParentOfSelection;
579
- $[28] = ctx.shouldShowActive;
580
- $[29] = ctx.shouldShowHover;
581
- $[30] = t11;
582
- $[31] = t13;
583
- $[32] = t15;
584
- $[33] = t16;
585
- } else t16 = $[33];
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 ($[36] !== ctx.handleBlockMouseEnter || $[37] !== ctx.handleBlockMouseLeave || $[38] !== setNodeRef || $[39] !== style || $[40] !== t16 || $[41] !== t17 || $[42] !== t7) {
594
- t18 = /* @__PURE__ */ jsxs(Accordion.Item, {
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: [t16, t17]
609
+ children: [t17, t18]
602
610
  });
603
- $[36] = ctx.handleBlockMouseEnter;
604
- $[37] = ctx.handleBlockMouseLeave;
605
- $[38] = setNodeRef;
606
- $[39] = style;
607
- $[40] = t16;
608
- $[41] = t17;
609
- $[42] = t7;
610
- $[43] = t18;
611
- } else t18 = $[43];
612
- let t19;
613
- if ($[44] !== t18 || $[45] !== t6) {
614
- t19 = /* @__PURE__ */ jsx(Accordion.Root, {
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: t18
624
+ children: t19
619
625
  });
620
- $[44] = t18;
621
- $[45] = t6;
622
- $[46] = t19;
623
- } else t19 = $[46];
624
- return t19;
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(38);
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
- const t2 = isSelected ? String(block.id) : "";
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 ($[3] === Symbol.for("react.memo_cache_sentinel")) {
644
- t4 = /* @__PURE__ */ jsx(TooltipTrigger, { children: /* @__PURE__ */ jsx(LayoutTemplate, { className: "h-4 w-4" }) });
645
- $[3] = t4;
646
- } else t4 = $[3];
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 ($[4] !== layoutName) {
649
- t5 = /* @__PURE__ */ jsx("span", {
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
- $[4] = layoutName;
654
- $[5] = t5;
655
- } else t5 = $[5];
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 ($[7] !== t5) {
663
- t7 = /* @__PURE__ */ jsx("div", {
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
- delayDuration: 500,
667
- children: [t4, /* @__PURE__ */ jsxs(TooltipContent, { children: [
668
- "From ",
669
- t5,
670
- " layout.",
671
- t6,
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
- $[7] = t5;
677
- $[8] = t7;
678
- } else t7 = $[8];
679
- let t8;
680
- if ($[9] !== ctx.toggleSelection || $[10] !== displayText) {
681
- t8 = /* @__PURE__ */ jsx(BlockTreeItemTrigger, {
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
- $[9] = ctx.toggleSelection;
686
- $[10] = displayText;
687
- $[11] = t8;
688
- } else t8 = $[11];
689
- const t9 = block.placement;
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 ($[14] !== block || $[15] !== ctx.ellipsisPopoverOpen || $[16] !== ctx.setEllipsisPopoverOpen || $[17] !== t10 || $[18] !== t9) {
698
- t11 = /* @__PURE__ */ jsx(BlockActionsPopover, {
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: t9,
704
- children: t10
717
+ layoutPlacement: t10,
718
+ children: t11
705
719
  });
706
- $[14] = block;
707
- $[15] = ctx.ellipsisPopoverOpen;
708
- $[16] = ctx.setEllipsisPopoverOpen;
709
- $[17] = t10;
710
- $[18] = t9;
711
- $[19] = t11;
712
- } else t11 = $[19];
713
- let t12;
714
- if ($[20] !== ctx.isParentOfSelection || $[21] !== ctx.shouldShowActive || $[22] !== ctx.shouldShowHover || $[23] !== t11 || $[24] !== t7 || $[25] !== t8) {
715
- t12 = /* @__PURE__ */ jsx(Accordion.Header, {
716
- asChild: true,
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
- t11
737
+ t9,
738
+ t12
725
739
  ]
726
740
  })
727
741
  });
728
- $[20] = ctx.isParentOfSelection;
729
- $[21] = ctx.shouldShowActive;
730
- $[22] = ctx.shouldShowHover;
731
- $[23] = t11;
732
- $[24] = t7;
733
- $[25] = t8;
734
- $[26] = t12;
735
- } else t12 = $[26];
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 ($[29] !== ctx.handleBlockMouseEnter || $[30] !== ctx.handleBlockMouseLeave || $[31] !== t12 || $[32] !== t13 || $[33] !== t3) {
744
- t14 = /* @__PURE__ */ jsxs(Accordion.Item, {
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: [t12, t13]
763
+ children: [t13, t14]
750
764
  });
751
- $[29] = ctx.handleBlockMouseEnter;
752
- $[30] = ctx.handleBlockMouseLeave;
753
- $[31] = t12;
754
- $[32] = t13;
755
- $[33] = t3;
756
- $[34] = t14;
757
- } else t14 = $[34];
758
- let t15;
759
- if ($[35] !== t14 || $[36] !== t2) {
760
- t15 = /* @__PURE__ */ jsx(Accordion.Root, {
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: t14
776
+ children: t15
765
777
  });
766
- $[35] = t14;
767
- $[36] = t2;
768
- $[37] = t15;
769
- } else t15 = $[37];
770
- return t15;
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":"AAGA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAmB/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,4CAQA,CAAC;AAmFF,QAAA,MAAM,YAAY,GAAI,cAAc;IAAE,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;CAAE,4CAoHhE,CAAC;AAEF,OAAO,EAAE,YAAY,EAAE,CAAC"}
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(7);
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(KeyDownForwarder, {});
24
- t2 = /* @__PURE__ */ jsx(OverlayTracker, {});
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 t3;
32
- if ($[2] !== children || $[3] !== className || $[4] !== onIframeReady || $[5] !== style) {
33
- t3 = /* @__PURE__ */ jsxs(Frame, {
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
- $[2] = children;
44
- $[3] = className;
45
- $[4] = onIframeReady;
46
- $[5] = style;
47
- $[6] = t3;
48
- } else t3 = $[6];
49
- return t3;
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,4CAcvB,CAAC;AAEF,wBAAgB,qBAAqB,YAYpC;AAED,OAAO,EAAE,gBAAgB,EAAE,KAAK,IAAI,UAAU,EAAE,CAAC"}
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"}