camox 0.14.2 → 0.16.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 (75) hide show
  1. package/dist/components/AuthGate.js +6 -0
  2. package/dist/core/components/AddBlockControlBar.js +30 -26
  3. package/dist/core/components/lexical/InlineContentEditable.js +19 -15
  4. package/dist/core/components/lexical/InlineLexicalEditor.js +62 -42
  5. package/dist/core/components/lexical/SelectionBroadcaster.js +25 -21
  6. package/dist/core/components/lexical/SidebarLexicalEditor.js +33 -21
  7. package/dist/core/createBlock.js +524 -488
  8. package/dist/core/createLayout.js +40 -28
  9. package/dist/core/hooks/useFieldSelection.js +12 -8
  10. package/dist/core/hooks/useIsEditable.js +6 -0
  11. package/dist/core/hooks/useOverlayMessage.js +19 -15
  12. package/dist/core/lib/contentType.d.ts +8 -8
  13. package/dist/core/lib/contentType.js +63 -0
  14. package/dist/features/content/CamoxContent.js +92 -88
  15. package/dist/features/content/components/AssetCard.js +46 -42
  16. package/dist/features/content/components/AssetCardSkeleton.js +8 -4
  17. package/dist/features/content/components/ContentSidebar.js +8 -4
  18. package/dist/features/content/components/UploadDropZone.js +31 -27
  19. package/dist/features/content/components/UploadProgressDrawer.js +98 -90
  20. package/dist/features/preview/CamoxPreview.js +162 -146
  21. package/dist/features/preview/components/AddBlockSheet.js +105 -101
  22. package/dist/features/preview/components/AgentChatSheet.js +74 -21
  23. package/dist/features/preview/components/AssetFieldEditor.js +98 -90
  24. package/dist/features/preview/components/AssetLightbox.js +21 -17
  25. package/dist/features/preview/components/AssetPickerGrid.js +84 -80
  26. package/dist/features/preview/components/BlockActionsPopover.js +35 -31
  27. package/dist/features/preview/components/BlockErrorBoundary.js +12 -8
  28. package/dist/features/preview/components/CreatePageModal.js +1 -1
  29. package/dist/features/preview/components/DebouncedFieldEditor.js +41 -37
  30. package/dist/features/preview/components/EditPageModal.js +114 -98
  31. package/dist/features/preview/components/FieldOverlayStyles.js +8 -4
  32. package/dist/features/preview/components/FieldToolbar.js +95 -54
  33. package/dist/features/preview/components/Frame.js +50 -46
  34. package/dist/features/preview/components/ItemFieldsEditor.js +81 -79
  35. package/dist/features/preview/components/LinkFieldEditor.js +138 -134
  36. package/dist/features/preview/components/MultipleAssetFieldEditor.js +105 -97
  37. package/dist/features/preview/components/OverlayTracker.js +19 -15
  38. package/dist/features/preview/components/Overlays.js +27 -23
  39. package/dist/features/preview/components/PageContentSheet.js +54 -4
  40. package/dist/features/preview/components/PageLocationFieldset.js +113 -109
  41. package/dist/features/preview/components/PagePicker.js +1 -1
  42. package/dist/features/preview/components/PageTree.js +443 -399
  43. package/dist/features/preview/components/PeekedBlock.js +69 -65
  44. package/dist/features/preview/components/PreviewPanel.js +64 -52
  45. package/dist/features/preview/components/PreviewSideSheet.js +25 -16
  46. package/dist/features/preview/components/PreviewToolbar.js +127 -123
  47. package/dist/features/preview/components/RepeatableItemsList.js +176 -171
  48. package/dist/features/preview/components/ShikiMarkdown.js +18 -14
  49. package/dist/features/preview/components/UnlinkAssetButton.js +74 -70
  50. package/dist/features/preview/components/useRepeatableItemActions.js +266 -0
  51. package/dist/features/preview/components/useUpdateBlockPosition.js +13 -9
  52. package/dist/features/provider/CamoxProvider.js +60 -52
  53. package/dist/features/provider/components/CamoxAppContext.js +10 -6
  54. package/dist/features/provider/components/CommandPalette.js +77 -69
  55. package/dist/features/provider/useAdminShortcuts.js +11 -7
  56. package/dist/features/routes/pageRoute.js +8 -4
  57. package/dist/features/studio/CamoxStudio.js +23 -19
  58. package/dist/features/studio/components/EnvironmentMenu.js +32 -28
  59. package/dist/features/studio/components/Navbar.js +62 -54
  60. package/dist/features/studio/components/ProjectMenu.js +131 -123
  61. package/dist/features/studio/components/UserButton.js +15 -11
  62. package/dist/features/studio/useTheme.js +82 -42
  63. package/dist/features/vite/definitionsSync.js +5 -5
  64. package/dist/features/vite/skillGeneration.js +43 -8
  65. package/dist/features/vite/vite.d.ts +1 -1
  66. package/dist/features/vite/vite.js +20 -2
  67. package/dist/hooks/use-marquee-selection.js +36 -32
  68. package/dist/lib/auth.js +49 -22
  69. package/dist/lib/normalized-data.js +55 -47
  70. package/dist/lib/use-project-room.js +22 -18
  71. package/dist/studio.css +1 -1
  72. package/package.json +10 -11
  73. package/skills/camox-block/SKILL.md +4 -0
  74. package/skills/camox-cli/SKILL.md +142 -0
  75. package/skills/camox-layout/SKILL.md +4 -0
@@ -274,7 +274,11 @@ function createBlock(options) {
274
274
  }, fieldData) });
275
275
  };
276
276
  const Embed = (t0) => {
277
- const $ = c(58);
277
+ const $ = c(59);
278
+ if ($[0] !== "8cc8be56750b20682f66c3aa201873fa6c45d7eaa41d36f57252a78bdb19fa7e") {
279
+ for (let $i = 0; $i < 59; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
280
+ $[0] = "8cc8be56750b20682f66c3aa201873fa6c45d7eaa41d36f57252a78bdb19fa7e";
281
+ }
278
282
  const { name, children } = t0;
279
283
  const blockContext = React.use(Context);
280
284
  if (!blockContext) throw new Error("Embed must be used within a Block Component");
@@ -285,84 +289,84 @@ function createBlock(options) {
285
289
  const fieldValue = repeaterContext ? repeaterContext.itemContent[name] : content[name];
286
290
  const t1 = String(name);
287
291
  let t2;
288
- if ($[0] !== blockId || $[1] !== repeaterContext || $[2] !== t1) {
292
+ if ($[1] !== blockId || $[2] !== repeaterContext || $[3] !== t1) {
289
293
  t2 = getOverlayFieldId(blockId, repeaterContext, t1);
290
- $[0] = blockId;
291
- $[1] = repeaterContext;
292
- $[2] = t1;
293
- $[3] = t2;
294
- } else t2 = $[3];
294
+ $[1] = blockId;
295
+ $[2] = repeaterContext;
296
+ $[3] = t1;
297
+ $[4] = t2;
298
+ } else t2 = $[4];
295
299
  const fieldId = t2;
296
300
  const [isOpen, setIsOpen] = React.useState(false);
297
301
  const [urlValue, setUrlValue] = React.useState(fieldValue);
298
302
  const [isHovered, setIsHovered] = React.useState(false);
299
303
  const timerRef = React.useRef(null);
300
304
  let t3;
301
- if ($[4] !== fieldId) {
305
+ if ($[5] !== fieldId) {
302
306
  t3 = { fieldId };
303
- $[4] = fieldId;
304
- $[5] = t3;
305
- } else t3 = $[5];
307
+ $[5] = fieldId;
308
+ $[6] = t3;
309
+ } else t3 = $[6];
306
310
  const isHoveredFromSidebar = useOverlayMessage(iframeWindow, isContentEditable, "CAMOX_HOVER_FIELD", "CAMOX_HOVER_FIELD_END", t3);
307
311
  let t4;
308
312
  let t5;
309
- if ($[6] !== isHoveredFromSidebar) {
313
+ if ($[7] !== isHoveredFromSidebar) {
310
314
  t4 = () => {
311
315
  setIsHovered(isHoveredFromSidebar);
312
316
  };
313
317
  t5 = [isHoveredFromSidebar];
314
- $[6] = isHoveredFromSidebar;
315
- $[7] = t4;
316
- $[8] = t5;
318
+ $[7] = isHoveredFromSidebar;
319
+ $[8] = t4;
320
+ $[9] = t5;
317
321
  } else {
318
- t4 = $[7];
319
- t5 = $[8];
322
+ t4 = $[8];
323
+ t5 = $[9];
320
324
  }
321
325
  React.useEffect(t4, t5);
322
326
  let t6;
323
- if ($[9] === Symbol.for("react.memo_cache_sentinel")) {
327
+ if ($[10] === Symbol.for("react.memo_cache_sentinel")) {
324
328
  t6 = blockMutations.updateContent();
325
- $[9] = t6;
326
- } else t6 = $[9];
329
+ $[10] = t6;
330
+ } else t6 = $[10];
327
331
  const updateBlockContent = useMutation(t6);
328
332
  let t7;
329
- if ($[10] === Symbol.for("react.memo_cache_sentinel")) {
333
+ if ($[11] === Symbol.for("react.memo_cache_sentinel")) {
330
334
  t7 = repeatableItemMutations.updateContent();
331
- $[10] = t7;
332
- } else t7 = $[10];
335
+ $[11] = t7;
336
+ } else t7 = $[11];
333
337
  const updateRepeatableContent = useMutation(t7);
334
338
  let t8;
335
339
  let t9;
336
- if ($[11] !== fieldValue || $[12] !== isOpen) {
340
+ if ($[12] !== fieldValue || $[13] !== isOpen) {
337
341
  t8 = () => {
338
342
  if (!isOpen) setUrlValue(fieldValue);
339
343
  };
340
344
  t9 = [fieldValue, isOpen];
341
- $[11] = fieldValue;
342
- $[12] = isOpen;
343
- $[13] = t8;
344
- $[14] = t9;
345
+ $[12] = fieldValue;
346
+ $[13] = isOpen;
347
+ $[14] = t8;
348
+ $[15] = t9;
345
349
  } else {
346
- t8 = $[13];
347
- t9 = $[14];
350
+ t8 = $[14];
351
+ t9 = $[15];
348
352
  }
349
353
  React.useEffect(t8, t9);
350
354
  let t10;
351
355
  let t11;
352
- if ($[15] === Symbol.for("react.memo_cache_sentinel")) {
356
+ if ($[16] === Symbol.for("react.memo_cache_sentinel")) {
353
357
  t10 = () => () => {
354
358
  if (timerRef.current) clearTimeout(timerRef.current);
355
359
  };
356
360
  t11 = [];
357
- $[15] = t10;
358
- $[16] = t11;
361
+ $[16] = t10;
362
+ $[17] = t11;
359
363
  } else {
360
- t10 = $[15];
361
- t11 = $[16];
364
+ t10 = $[16];
365
+ t11 = $[17];
362
366
  }
363
367
  React.useEffect(t10, t11);
364
368
  let t12;
365
- if ($[17] !== blockId || $[18] !== name || $[19] !== repeaterContext || $[20] !== updateBlockContent || $[21] !== updateRepeatableContent) {
369
+ if ($[18] !== blockId || $[19] !== name || $[20] !== repeaterContext || $[21] !== updateBlockContent || $[22] !== updateRepeatableContent) {
366
370
  t12 = (e) => {
367
371
  const newValue = e.target.value;
368
372
  setUrlValue(newValue);
@@ -378,16 +382,16 @@ function createBlock(options) {
378
382
  });
379
383
  }, 500);
380
384
  };
381
- $[17] = blockId;
382
- $[18] = name;
383
- $[19] = repeaterContext;
384
- $[20] = updateBlockContent;
385
- $[21] = updateRepeatableContent;
386
- $[22] = t12;
387
- } else t12 = $[22];
385
+ $[18] = blockId;
386
+ $[19] = name;
387
+ $[20] = repeaterContext;
388
+ $[21] = updateBlockContent;
389
+ $[22] = updateRepeatableContent;
390
+ $[23] = t12;
391
+ } else t12 = $[23];
388
392
  const handleUrlChange = t12;
389
393
  let t13;
390
- if ($[23] !== blockId || $[24] !== name || $[25] !== repeaterContext) {
394
+ if ($[24] !== blockId || $[25] !== name || $[26] !== repeaterContext) {
391
395
  t13 = (open, _eventDetails) => {
392
396
  setIsOpen(open);
393
397
  if (open) if (repeaterContext?.itemId != null) previewStore.send({
@@ -404,11 +408,11 @@ function createBlock(options) {
404
408
  fieldType: "Embed"
405
409
  });
406
410
  };
407
- $[23] = blockId;
408
- $[24] = name;
409
- $[25] = repeaterContext;
410
- $[26] = t13;
411
- } else t13 = $[26];
411
+ $[24] = blockId;
412
+ $[25] = name;
413
+ $[26] = repeaterContext;
414
+ $[27] = t13;
415
+ } else t13 = $[27];
412
416
  const handleOpenChange = t13;
413
417
  const t14 = isContentEditable ? isOpen : false;
414
418
  const t15 = isContentEditable ? handleOpenChange : void 0;
@@ -418,19 +422,19 @@ function createBlock(options) {
418
422
  const t19 = isContentEditable && isOpen || void 0;
419
423
  const t20 = mode === "layout" ? "layout" : void 0;
420
424
  let t21;
421
- if ($[27] !== isContentEditable) {
425
+ if ($[28] !== isContentEditable) {
422
426
  t21 = isContentEditable ? () => setIsHovered(true) : void 0;
423
- $[27] = isContentEditable;
424
- $[28] = t21;
425
- } else t21 = $[28];
427
+ $[28] = isContentEditable;
428
+ $[29] = t21;
429
+ } else t21 = $[29];
426
430
  let t22;
427
- if ($[29] !== isContentEditable) {
431
+ if ($[30] !== isContentEditable) {
428
432
  t22 = isContentEditable ? () => setIsHovered(false) : void 0;
429
- $[29] = isContentEditable;
430
- $[30] = t22;
431
- } else t22 = $[30];
433
+ $[30] = isContentEditable;
434
+ $[31] = t22;
435
+ } else t22 = $[31];
432
436
  let t23;
433
- if ($[31] !== t16 || $[32] !== t17 || $[33] !== t18 || $[34] !== t19 || $[35] !== t20 || $[36] !== t21 || $[37] !== t22) {
437
+ if ($[32] !== t16 || $[33] !== t17 || $[34] !== t18 || $[35] !== t19 || $[36] !== t20 || $[37] !== t21 || $[38] !== t22) {
434
438
  t23 = /* @__PURE__ */ jsx("div", {
435
439
  "data-camox-field-id": t16,
436
440
  "data-camox-field-type": t17,
@@ -440,24 +444,24 @@ function createBlock(options) {
440
444
  onMouseEnter: t21,
441
445
  onMouseLeave: t22
442
446
  });
443
- $[31] = t16;
444
- $[32] = t17;
445
- $[33] = t18;
446
- $[34] = t19;
447
- $[35] = t20;
448
- $[36] = t21;
449
- $[37] = t22;
450
- $[38] = t23;
451
- } else t23 = $[38];
447
+ $[32] = t16;
448
+ $[33] = t17;
449
+ $[34] = t18;
450
+ $[35] = t19;
451
+ $[36] = t20;
452
+ $[37] = t21;
453
+ $[38] = t22;
454
+ $[39] = t23;
455
+ } else t23 = $[39];
452
456
  let t24;
453
- if ($[39] !== children || $[40] !== fieldValue) {
457
+ if ($[40] !== children || $[41] !== fieldValue) {
454
458
  t24 = children({ src: fieldValue }, { url: fieldValue });
455
- $[39] = children;
456
- $[40] = fieldValue;
457
- $[41] = t24;
458
- } else t24 = $[41];
459
+ $[40] = children;
460
+ $[41] = fieldValue;
461
+ $[42] = t24;
462
+ } else t24 = $[42];
459
463
  let t25;
460
- if ($[42] !== isContentEditable) {
464
+ if ($[43] !== isContentEditable) {
461
465
  t25 = isContentEditable && /* @__PURE__ */ jsx("div", {
462
466
  style: {
463
467
  position: "absolute",
@@ -466,23 +470,23 @@ function createBlock(options) {
466
470
  },
467
471
  onClick: _temp
468
472
  });
469
- $[42] = isContentEditable;
470
- $[43] = t25;
471
- } else t25 = $[43];
473
+ $[43] = isContentEditable;
474
+ $[44] = t25;
475
+ } else t25 = $[44];
472
476
  let t26;
473
- if ($[44] !== t23 || $[45] !== t24 || $[46] !== t25) {
477
+ if ($[45] !== t23 || $[46] !== t24 || $[47] !== t25) {
474
478
  t26 = /* @__PURE__ */ jsxs(PopoverTrigger, {
475
479
  render: t23,
476
480
  nativeButton: false,
477
481
  children: [t24, t25]
478
482
  });
479
- $[44] = t23;
480
- $[45] = t24;
481
- $[46] = t25;
482
- $[47] = t26;
483
- } else t26 = $[47];
483
+ $[45] = t23;
484
+ $[46] = t24;
485
+ $[47] = t25;
486
+ $[48] = t26;
487
+ } else t26 = $[48];
484
488
  let t27;
485
- if ($[48] !== handleUrlChange || $[49] !== isContentEditable || $[50] !== name || $[51] !== urlValue) {
489
+ if ($[49] !== handleUrlChange || $[50] !== isContentEditable || $[51] !== name || $[52] !== urlValue) {
486
490
  t27 = isContentEditable && /* @__PURE__ */ jsx(PopoverContent, {
487
491
  className: "w-96 gap-2",
488
492
  children: /* @__PURE__ */ jsxs("form", {
@@ -498,29 +502,33 @@ function createBlock(options) {
498
502
  })]
499
503
  })
500
504
  });
501
- $[48] = handleUrlChange;
502
- $[49] = isContentEditable;
503
- $[50] = name;
504
- $[51] = urlValue;
505
- $[52] = t27;
506
- } else t27 = $[52];
505
+ $[49] = handleUrlChange;
506
+ $[50] = isContentEditable;
507
+ $[51] = name;
508
+ $[52] = urlValue;
509
+ $[53] = t27;
510
+ } else t27 = $[53];
507
511
  let t28;
508
- if ($[53] !== t14 || $[54] !== t15 || $[55] !== t26 || $[56] !== t27) {
512
+ if ($[54] !== t14 || $[55] !== t15 || $[56] !== t26 || $[57] !== t27) {
509
513
  t28 = /* @__PURE__ */ jsxs(Popover, {
510
514
  open: t14,
511
515
  onOpenChange: t15,
512
516
  children: [t26, t27]
513
517
  });
514
- $[53] = t14;
515
- $[54] = t15;
516
- $[55] = t26;
517
- $[56] = t27;
518
- $[57] = t28;
519
- } else t28 = $[57];
518
+ $[54] = t14;
519
+ $[55] = t15;
520
+ $[56] = t26;
521
+ $[57] = t27;
522
+ $[58] = t28;
523
+ } else t28 = $[58];
520
524
  return t28;
521
525
  };
522
526
  const Link = (t0) => {
523
- const $ = c(37);
527
+ const $ = c(38);
528
+ if ($[0] !== "8cc8be56750b20682f66c3aa201873fa6c45d7eaa41d36f57252a78bdb19fa7e") {
529
+ for (let $i = 0; $i < 38; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
530
+ $[0] = "8cc8be56750b20682f66c3aa201873fa6c45d7eaa41d36f57252a78bdb19fa7e";
531
+ }
524
532
  const { name, children } = t0;
525
533
  const blockContext = React.use(Context);
526
534
  if (!blockContext) throw new Error("Link must be used within a Block Component");
@@ -531,48 +539,48 @@ function createBlock(options) {
531
539
  const repeaterContext = React.use(RepeaterItemContext);
532
540
  const fieldValue = normalizeLinkValue(repeaterContext ? repeaterContext.itemContent[name] : content[name]);
533
541
  let t1;
534
- if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
542
+ if ($[1] === Symbol.for("react.memo_cache_sentinel")) {
535
543
  t1 = blockMutations.updateContent();
536
- $[0] = t1;
537
- } else t1 = $[0];
544
+ $[1] = t1;
545
+ } else t1 = $[1];
538
546
  const updateBlockContent = useMutation(t1);
539
547
  let t2;
540
- if ($[1] === Symbol.for("react.memo_cache_sentinel")) {
548
+ if ($[2] === Symbol.for("react.memo_cache_sentinel")) {
541
549
  t2 = repeatableItemMutations.updateContent();
542
- $[1] = t2;
543
- } else t2 = $[1];
550
+ $[2] = t2;
551
+ } else t2 = $[2];
544
552
  const updateRepeatableContent = useMutation(t2);
545
553
  const projectSlug = useProjectSlug();
546
554
  let t3;
547
- if ($[2] !== projectSlug) {
555
+ if ($[3] !== projectSlug) {
548
556
  t3 = projectQueries.getBySlug(projectSlug);
549
- $[2] = projectSlug;
550
- $[3] = t3;
551
- } else t3 = $[3];
557
+ $[3] = projectSlug;
558
+ $[4] = t3;
559
+ } else t3 = $[4];
552
560
  const { data: project } = useQuery(t3);
553
561
  let t4;
554
- if ($[4] !== project?.id) {
562
+ if ($[5] !== project?.id) {
555
563
  t4 = pageQueries.list(project?.id ?? 0);
556
- $[4] = project?.id;
557
- $[5] = t4;
558
- } else t4 = $[5];
564
+ $[5] = project?.id;
565
+ $[6] = t4;
566
+ } else t4 = $[6];
559
567
  const t5 = !!project;
560
568
  let t6;
561
- if ($[6] !== t4 || $[7] !== t5) {
569
+ if ($[7] !== t4 || $[8] !== t5) {
562
570
  t6 = {
563
571
  ...t4,
564
572
  enabled: t5
565
573
  };
566
- $[6] = t4;
567
- $[7] = t5;
568
- $[8] = t6;
569
- } else t6 = $[8];
574
+ $[7] = t4;
575
+ $[8] = t5;
576
+ $[9] = t6;
577
+ } else t6 = $[9];
570
578
  const { data: pages } = useQuery(t6);
571
579
  let t7;
572
- if ($[9] === Symbol.for("react.memo_cache_sentinel")) {
580
+ if ($[10] === Symbol.for("react.memo_cache_sentinel")) {
573
581
  t7 = { select: _temp2 };
574
- $[9] = t7;
575
- } else t7 = $[9];
582
+ $[10] = t7;
583
+ } else t7 = $[10];
576
584
  const resolvedHref = resolveLinkHref(fieldValue, pages, useLocation(t7));
577
585
  const fieldId = getOverlayFieldId(blockId, repeaterContext, String(name));
578
586
  const [isEditing, setIsEditing] = React.useState(false);
@@ -587,21 +595,21 @@ function createBlock(options) {
587
595
  const isHoveredFromSidebar = useOverlayMessage(iframeWindow, isContentEditable, "CAMOX_HOVER_FIELD", "CAMOX_HOVER_FIELD_END", { fieldId });
588
596
  let t8;
589
597
  let t9;
590
- if ($[10] !== isHoveredFromSidebar) {
598
+ if ($[11] !== isHoveredFromSidebar) {
591
599
  t8 = () => {
592
600
  setIsHovered(isHoveredFromSidebar);
593
601
  };
594
602
  t9 = [isHoveredFromSidebar];
595
- $[10] = isHoveredFromSidebar;
596
- $[11] = t8;
597
- $[12] = t9;
603
+ $[11] = isHoveredFromSidebar;
604
+ $[12] = t8;
605
+ $[13] = t9;
598
606
  } else {
599
- t8 = $[11];
600
- t9 = $[12];
607
+ t8 = $[12];
608
+ t9 = $[13];
601
609
  }
602
610
  React.useEffect(t8, t9);
603
611
  let t10;
604
- if ($[13] !== blockId || $[14] !== name || $[15] !== repeaterContext || $[16] !== updateBlockContent || $[17] !== updateRepeatableContent) {
612
+ if ($[14] !== blockId || $[15] !== name || $[16] !== repeaterContext || $[17] !== updateBlockContent || $[18] !== updateRepeatableContent) {
605
613
  t10 = (newLinkValue) => {
606
614
  if (repeaterContext?.itemId != null) updateRepeatableContent.mutate({
607
615
  id: repeaterContext.itemId,
@@ -612,13 +620,13 @@ function createBlock(options) {
612
620
  content: { [name]: newLinkValue }
613
621
  });
614
622
  };
615
- $[13] = blockId;
616
- $[14] = name;
617
- $[15] = repeaterContext;
618
- $[16] = updateBlockContent;
619
- $[17] = updateRepeatableContent;
620
- $[18] = t10;
621
- } else t10 = $[18];
623
+ $[14] = blockId;
624
+ $[15] = name;
625
+ $[16] = repeaterContext;
626
+ $[17] = updateBlockContent;
627
+ $[18] = updateRepeatableContent;
628
+ $[19] = t10;
629
+ } else t10 = $[19];
622
630
  const saveLinkValue = t10;
623
631
  const handleInput = (e) => {
624
632
  const newText = e.target.textContent || "";
@@ -628,7 +636,7 @@ function createBlock(options) {
628
636
  });
629
637
  };
630
638
  let t11;
631
- if ($[19] !== blockId || $[20] !== name || $[21] !== repeaterContext) {
639
+ if ($[20] !== blockId || $[21] !== name || $[22] !== repeaterContext) {
632
640
  t11 = () => {
633
641
  setIsEditing(true);
634
642
  setIsEditorFocused(true);
@@ -646,31 +654,31 @@ function createBlock(options) {
646
654
  fieldType: "Link"
647
655
  });
648
656
  };
649
- $[19] = blockId;
650
- $[20] = name;
651
- $[21] = repeaterContext;
652
- $[22] = t11;
653
- } else t11 = $[22];
657
+ $[20] = blockId;
658
+ $[21] = name;
659
+ $[22] = repeaterContext;
660
+ $[23] = t11;
661
+ } else t11 = $[23];
654
662
  const handleFocus = t11;
655
663
  let t12;
656
- if ($[23] === Symbol.for("react.memo_cache_sentinel")) {
664
+ if ($[24] === Symbol.for("react.memo_cache_sentinel")) {
657
665
  t12 = () => {
658
666
  setIsEditing(false);
659
667
  setIsEditorFocused(false);
660
668
  };
661
- $[23] = t12;
662
- } else t12 = $[23];
669
+ $[24] = t12;
670
+ } else t12 = $[24];
663
671
  const handleBlur = t12;
664
672
  let t13;
665
- if ($[24] === Symbol.for("react.memo_cache_sentinel")) {
673
+ if ($[25] === Symbol.for("react.memo_cache_sentinel")) {
666
674
  t13 = (e_0) => {
667
675
  e_0.stopPropagation();
668
676
  previewStore.send({ type: "toggleContentSheet" });
669
677
  setIsEditorFocused(false);
670
678
  setIsEditing(false);
671
679
  };
672
- $[24] = t13;
673
- } else t13 = $[24];
680
+ $[25] = t13;
681
+ } else t13 = $[25];
674
682
  const handleEditLink = t13;
675
683
  const linkData = {
676
684
  text: displayText,
@@ -685,14 +693,14 @@ function createBlock(options) {
685
693
  }, linkData) });
686
694
  let t14;
687
695
  let t15;
688
- if ($[25] === Symbol.for("react.memo_cache_sentinel")) {
696
+ if ($[26] === Symbol.for("react.memo_cache_sentinel")) {
689
697
  t14 = () => setIsHovered(true);
690
698
  t15 = () => setIsHovered(false);
691
- $[25] = t14;
692
- $[26] = t15;
699
+ $[26] = t14;
700
+ $[27] = t15;
693
701
  } else {
694
- t14 = $[25];
695
- t15 = $[26];
702
+ t14 = $[26];
703
+ t15 = $[27];
696
704
  }
697
705
  const linkProps = {
698
706
  ref: elementRef,
@@ -718,7 +726,7 @@ function createBlock(options) {
718
726
  const T0 = Popover;
719
727
  const t16 = children(linkProps, linkData);
720
728
  let t17;
721
- if ($[27] !== handleEditLink) {
729
+ if ($[28] !== handleEditLink) {
722
730
  t17 = /* @__PURE__ */ jsx("button", {
723
731
  type: "button",
724
732
  className: "hover:bg-accent flex items-center gap-1.5 rounded-md px-2 py-1 text-sm transition-colors",
@@ -726,11 +734,11 @@ function createBlock(options) {
726
734
  onClick: handleEditLink,
727
735
  children: "Edit link"
728
736
  });
729
- $[27] = handleEditLink;
730
- $[28] = t17;
731
- } else t17 = $[28];
737
+ $[28] = handleEditLink;
738
+ $[29] = t17;
739
+ } else t17 = $[29];
732
740
  let t18;
733
- if ($[29] !== elementRef || $[30] !== t17) {
741
+ if ($[30] !== elementRef || $[31] !== t17) {
734
742
  t18 = /* @__PURE__ */ jsx(PopoverContent, {
735
743
  className: "w-auto p-2",
736
744
  initialFocus: false,
@@ -738,26 +746,30 @@ function createBlock(options) {
738
746
  align: "end",
739
747
  children: t17
740
748
  });
741
- $[29] = elementRef;
742
- $[30] = t17;
743
- $[31] = t18;
744
- } else t18 = $[31];
749
+ $[30] = elementRef;
750
+ $[31] = t17;
751
+ $[32] = t18;
752
+ } else t18 = $[32];
745
753
  let t19;
746
- if ($[32] !== T0 || $[33] !== isEditorFocused || $[34] !== t16 || $[35] !== t18) {
754
+ if ($[33] !== T0 || $[34] !== isEditorFocused || $[35] !== t16 || $[36] !== t18) {
747
755
  t19 = /* @__PURE__ */ jsxs(T0, {
748
756
  open: isEditorFocused,
749
757
  children: [t16, t18]
750
758
  });
751
- $[32] = T0;
752
- $[33] = isEditorFocused;
753
- $[34] = t16;
754
- $[35] = t18;
755
- $[36] = t19;
756
- } else t19 = $[36];
759
+ $[33] = T0;
760
+ $[34] = isEditorFocused;
761
+ $[35] = t16;
762
+ $[36] = t18;
763
+ $[37] = t19;
764
+ } else t19 = $[37];
757
765
  return t19;
758
766
  };
759
767
  const Image = (t0) => {
760
- const $ = c(25);
768
+ const $ = c(22);
769
+ if ($[0] !== "8cc8be56750b20682f66c3aa201873fa6c45d7eaa41d36f57252a78bdb19fa7e") {
770
+ for (let $i = 0; $i < 22; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
771
+ $[0] = "8cc8be56750b20682f66c3aa201873fa6c45d7eaa41d36f57252a78bdb19fa7e";
772
+ }
761
773
  const { name, children } = t0;
762
774
  const blockContext = React.use(Context);
763
775
  if (!blockContext) throw new Error("Image must be used within a Block Component");
@@ -770,115 +782,112 @@ function createBlock(options) {
770
782
  const rawValue = isFileMarker(rawSource) ? resolveFileMarker(rawSource, filesMap) : rawSource;
771
783
  const defaultValue = repeaterContext ? repeatableItemDefaults[repeaterContext.arrayFieldName]?.[String(name)] : contentDefaults[String(name)];
772
784
  const fieldValue = rawValue ?? defaultValue;
773
- const t1 = String(name);
774
- let t2;
775
- if ($[0] !== blockId || $[1] !== repeaterContext || $[2] !== t1) {
776
- t2 = getOverlayFieldId(blockId, repeaterContext, t1);
777
- $[0] = blockId;
778
- $[1] = repeaterContext;
779
- $[2] = t1;
780
- $[3] = t2;
781
- } else t2 = $[3];
782
- const fieldId = t2;
785
+ const isInlineArrayItem = repeaterContext != null && repeaterContext.itemId == null;
786
+ const overlayFieldName = isInlineArrayItem ? repeaterContext.arrayFieldName : String(name);
787
+ const overlayItemId = isInlineArrayItem ? repeaterContext.containerItemId : repeaterContext?.itemId;
788
+ const fieldId = overlayItemId != null ? `${blockId}__${overlayItemId}__${overlayFieldName}` : `${blockId}__${overlayFieldName}`;
783
789
  const [isHovered, setIsHovered] = React.useState(false);
784
- const isFocused = useFieldSelection(blockId, String(name), "Image", repeaterContext?.itemId);
790
+ const isFocused = useFieldSelection(blockId, overlayFieldName, "Image", overlayItemId);
791
+ let t1;
792
+ if ($[1] !== fieldId) {
793
+ t1 = { fieldId };
794
+ $[1] = fieldId;
795
+ $[2] = t1;
796
+ } else t1 = $[2];
797
+ const isHoveredFromSidebar = useOverlayMessage(iframeWindow, isContentEditable, "CAMOX_HOVER_FIELD", "CAMOX_HOVER_FIELD_END", t1);
798
+ let t2;
785
799
  let t3;
786
- if ($[4] !== fieldId) {
787
- t3 = { fieldId };
788
- $[4] = fieldId;
789
- $[5] = t3;
790
- } else t3 = $[5];
791
- const isHoveredFromSidebar = useOverlayMessage(iframeWindow, isContentEditable, "CAMOX_HOVER_FIELD", "CAMOX_HOVER_FIELD_END", t3);
792
- let t4;
793
- let t5;
794
- if ($[6] !== isHoveredFromSidebar) {
795
- t4 = () => {
800
+ if ($[3] !== isHoveredFromSidebar) {
801
+ t2 = () => {
796
802
  setIsHovered(isHoveredFromSidebar);
797
803
  };
798
- t5 = [isHoveredFromSidebar];
799
- $[6] = isHoveredFromSidebar;
800
- $[7] = t4;
801
- $[8] = t5;
804
+ t3 = [isHoveredFromSidebar];
805
+ $[3] = isHoveredFromSidebar;
806
+ $[4] = t2;
807
+ $[5] = t3;
802
808
  } else {
803
- t4 = $[7];
804
- t5 = $[8];
809
+ t2 = $[4];
810
+ t3 = $[5];
805
811
  }
806
- React.useEffect(t4, t5);
807
- let t6;
808
- if ($[9] !== blockId || $[10] !== isContentEditable || $[11] !== name || $[12] !== repeaterContext) {
809
- t6 = () => {
812
+ React.useEffect(t2, t3);
813
+ let t4;
814
+ if ($[6] !== blockId || $[7] !== isContentEditable || $[8] !== overlayFieldName || $[9] !== overlayItemId) {
815
+ t4 = () => {
810
816
  if (!isContentEditable) return;
811
- const imageFieldName = repeaterContext && repeaterContext.itemId == null ? repeaterContext.arrayFieldName : String(name);
812
- if (repeaterContext?.itemId != null) previewStore.send({
817
+ if (overlayItemId != null) previewStore.send({
813
818
  type: "selectItemField",
814
819
  blockId,
815
- itemId: repeaterContext.itemId,
816
- fieldName: imageFieldName,
820
+ itemId: overlayItemId,
821
+ fieldName: overlayFieldName,
817
822
  fieldType: "Image"
818
823
  });
819
824
  else previewStore.send({
820
825
  type: "selectBlockField",
821
826
  blockId,
822
- fieldName: imageFieldName,
827
+ fieldName: overlayFieldName,
823
828
  fieldType: "Image"
824
829
  });
825
830
  previewStore.send({ type: "toggleContentSheet" });
826
831
  };
827
- $[9] = blockId;
828
- $[10] = isContentEditable;
829
- $[11] = name;
830
- $[12] = repeaterContext;
831
- $[13] = t6;
832
- } else t6 = $[13];
833
- const handleClick = t6;
832
+ $[6] = blockId;
833
+ $[7] = isContentEditable;
834
+ $[8] = overlayFieldName;
835
+ $[9] = overlayItemId;
836
+ $[10] = t4;
837
+ } else t4 = $[10];
838
+ const handleClick = t4;
834
839
  const imageProps = {
835
840
  src: fieldValue.url,
836
841
  alt: fieldValue.alt
837
842
  };
838
843
  if (!isContentEditable) return /* @__PURE__ */ jsx(Fragment, { children: children(imageProps, fieldValue) });
839
- const t7 = "image";
840
- const t8 = isHovered || void 0;
841
- const t9 = isFocused || void 0;
842
- const t10 = mode === "layout" ? "layout" : void 0;
843
- let t11;
844
- let t12;
845
- if ($[14] === Symbol.for("react.memo_cache_sentinel")) {
846
- t11 = () => setIsHovered(true);
847
- t12 = () => setIsHovered(false);
848
- $[14] = t11;
849
- $[15] = t12;
844
+ const t5 = "image";
845
+ const t6 = isHovered || void 0;
846
+ const t7 = isFocused || void 0;
847
+ const t8 = mode === "layout" ? "layout" : void 0;
848
+ let t10;
849
+ let t9;
850
+ if ($[11] === Symbol.for("react.memo_cache_sentinel")) {
851
+ t9 = () => setIsHovered(true);
852
+ t10 = () => setIsHovered(false);
853
+ $[11] = t10;
854
+ $[12] = t9;
850
855
  } else {
851
- t11 = $[14];
852
- t12 = $[15];
856
+ t10 = $[11];
857
+ t9 = $[12];
853
858
  }
854
- const t13 = children(imageProps, fieldValue);
855
- let t14;
856
- if ($[16] !== fieldId || $[17] !== handleClick || $[18] !== t10 || $[19] !== t11 || $[20] !== t12 || $[21] !== t13 || $[22] !== t8 || $[23] !== t9) {
857
- t14 = /* @__PURE__ */ jsx("div", {
859
+ const t11 = children(imageProps, fieldValue);
860
+ let t12;
861
+ if ($[13] !== fieldId || $[14] !== handleClick || $[15] !== t10 || $[16] !== t11 || $[17] !== t6 || $[18] !== t7 || $[19] !== t8 || $[20] !== t9) {
862
+ t12 = /* @__PURE__ */ jsx("div", {
858
863
  "data-camox-field-id": fieldId,
859
- "data-camox-field-type": t7,
860
- "data-camox-hovered": t8,
861
- "data-camox-focused": t9,
862
- "data-camox-overlay-mode": t10,
863
- onMouseEnter: t11,
864
- onMouseLeave: t12,
864
+ "data-camox-field-type": t5,
865
+ "data-camox-hovered": t6,
866
+ "data-camox-focused": t7,
867
+ "data-camox-overlay-mode": t8,
868
+ onMouseEnter: t9,
869
+ onMouseLeave: t10,
865
870
  onClick: handleClick,
866
- children: t13
871
+ children: t11
867
872
  });
868
- $[16] = fieldId;
869
- $[17] = handleClick;
870
- $[18] = t10;
871
- $[19] = t11;
872
- $[20] = t12;
873
- $[21] = t13;
874
- $[22] = t8;
875
- $[23] = t9;
876
- $[24] = t14;
877
- } else t14 = $[24];
878
- return t14;
873
+ $[13] = fieldId;
874
+ $[14] = handleClick;
875
+ $[15] = t10;
876
+ $[16] = t11;
877
+ $[17] = t6;
878
+ $[18] = t7;
879
+ $[19] = t8;
880
+ $[20] = t9;
881
+ $[21] = t12;
882
+ } else t12 = $[21];
883
+ return t12;
879
884
  };
880
885
  const File = (t0) => {
881
- const $ = c(8);
886
+ const $ = c(9);
887
+ if ($[0] !== "8cc8be56750b20682f66c3aa201873fa6c45d7eaa41d36f57252a78bdb19fa7e") {
888
+ for (let $i = 0; $i < 9; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
889
+ $[0] = "8cc8be56750b20682f66c3aa201873fa6c45d7eaa41d36f57252a78bdb19fa7e";
890
+ }
882
891
  const { name, children } = t0;
883
892
  const blockContext = React.use(Context);
884
893
  if (!blockContext) throw new Error("File must be used within a Block Component");
@@ -887,7 +896,7 @@ function createBlock(options) {
887
896
  const { filesMap } = useNormalizedData();
888
897
  const rawSource = repeaterContext ? repeaterContext.itemContent[name] : content[name];
889
898
  let t1;
890
- if ($[0] !== children || $[1] !== filesMap || $[2] !== name || $[3] !== rawSource || $[4] !== repeaterContext) {
899
+ if ($[1] !== children || $[2] !== filesMap || $[3] !== name || $[4] !== rawSource || $[5] !== repeaterContext) {
891
900
  const rawValue = isFileMarker(rawSource) ? resolveFileMarker(rawSource, filesMap) : rawSource;
892
901
  const defaultValue = repeaterContext ? repeatableItemDefaults[repeaterContext.arrayFieldName]?.[String(name)] : contentDefaults[String(name)];
893
902
  const fieldValue = rawValue ?? defaultValue;
@@ -895,23 +904,27 @@ function createBlock(options) {
895
904
  href: fieldValue.url,
896
905
  download: fieldValue.filename
897
906
  }, fieldValue);
898
- $[0] = children;
899
- $[1] = filesMap;
900
- $[2] = name;
901
- $[3] = rawSource;
902
- $[4] = repeaterContext;
903
- $[5] = t1;
904
- } else t1 = $[5];
907
+ $[1] = children;
908
+ $[2] = filesMap;
909
+ $[3] = name;
910
+ $[4] = rawSource;
911
+ $[5] = repeaterContext;
912
+ $[6] = t1;
913
+ } else t1 = $[6];
905
914
  let t2;
906
- if ($[6] !== t1) {
915
+ if ($[7] !== t1) {
907
916
  t2 = /* @__PURE__ */ jsx(Fragment, { children: t1 });
908
- $[6] = t1;
909
- $[7] = t2;
910
- } else t2 = $[7];
917
+ $[7] = t1;
918
+ $[8] = t2;
919
+ } else t2 = $[8];
911
920
  return t2;
912
921
  };
913
922
  const RepeaterItemWrapper = (t0) => {
914
- const $ = c(8);
923
+ const $ = c(9);
924
+ if ($[0] !== "8cc8be56750b20682f66c3aa201873fa6c45d7eaa41d36f57252a78bdb19fa7e") {
925
+ for (let $i = 0; $i < 9; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
926
+ $[0] = "8cc8be56750b20682f66c3aa201873fa6c45d7eaa41d36f57252a78bdb19fa7e";
927
+ }
915
928
  const { itemId, blockId, mode, children } = t0;
916
929
  const isContentEditable = useIsEditable(mode);
917
930
  const { window: iframeWindow } = useFrame();
@@ -919,67 +932,75 @@ function createBlock(options) {
919
932
  const t1 = String(blockId);
920
933
  const t2 = String(itemId);
921
934
  let t3;
922
- if ($[0] !== t1 || $[1] !== t2) {
935
+ if ($[1] !== t1 || $[2] !== t2) {
923
936
  t3 = {
924
937
  blockId: t1,
925
938
  itemId: t2
926
939
  };
927
- $[0] = t1;
928
- $[1] = t2;
929
- $[2] = t3;
930
- } else t3 = $[2];
940
+ $[1] = t1;
941
+ $[2] = t2;
942
+ $[3] = t3;
943
+ } else t3 = $[3];
931
944
  const isHovered = useOverlayMessage(iframeWindow, isContentEditable, "CAMOX_HOVER_REPEATER_ITEM", "CAMOX_HOVER_REPEATER_ITEM_END", t3);
932
945
  const showOverlay = isContentEditable && (isHovered || isRepeaterHovered);
933
946
  const t4 = isContentEditable ? itemId : void 0;
934
947
  const t5 = showOverlay || void 0;
935
948
  const t6 = mode === "layout" ? "layout" : void 0;
936
949
  let t7;
937
- if ($[3] !== children || $[4] !== t4 || $[5] !== t5 || $[6] !== t6) {
950
+ if ($[4] !== children || $[5] !== t4 || $[6] !== t5 || $[7] !== t6) {
938
951
  t7 = /* @__PURE__ */ jsx("div", {
939
952
  "data-camox-repeater-item-id": t4,
940
953
  "data-camox-hovered": t5,
941
954
  "data-camox-overlay-mode": t6,
942
955
  children
943
956
  });
944
- $[3] = children;
945
- $[4] = t4;
946
- $[5] = t5;
947
- $[6] = t6;
948
- $[7] = t7;
949
- } else t7 = $[7];
957
+ $[4] = children;
958
+ $[5] = t4;
959
+ $[6] = t5;
960
+ $[7] = t6;
961
+ $[8] = t7;
962
+ } else t7 = $[8];
950
963
  return t7;
951
964
  };
952
965
  const RepeaterHoverProvider = (t0) => {
953
- const $ = c(6);
966
+ const $ = c(7);
967
+ if ($[0] !== "8cc8be56750b20682f66c3aa201873fa6c45d7eaa41d36f57252a78bdb19fa7e") {
968
+ for (let $i = 0; $i < 7; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
969
+ $[0] = "8cc8be56750b20682f66c3aa201873fa6c45d7eaa41d36f57252a78bdb19fa7e";
970
+ }
954
971
  const { blockId, fieldName, children } = t0;
955
972
  const isContentEditable = useIsEditable("site");
956
973
  const { window: iframeWindow } = useFrame();
957
974
  const t1 = String(blockId);
958
975
  let t2;
959
- if ($[0] !== fieldName || $[1] !== t1) {
976
+ if ($[1] !== fieldName || $[2] !== t1) {
960
977
  t2 = {
961
978
  blockId: t1,
962
979
  fieldName
963
980
  };
964
- $[0] = fieldName;
965
- $[1] = t1;
966
- $[2] = t2;
967
- } else t2 = $[2];
981
+ $[1] = fieldName;
982
+ $[2] = t1;
983
+ $[3] = t2;
984
+ } else t2 = $[3];
968
985
  const isHovered = useOverlayMessage(iframeWindow, isContentEditable, "CAMOX_HOVER_REPEATER", "CAMOX_HOVER_REPEATER_END", t2);
969
986
  let t3;
970
- if ($[3] !== children || $[4] !== isHovered) {
987
+ if ($[4] !== children || $[5] !== isHovered) {
971
988
  t3 = /* @__PURE__ */ jsx(RepeaterHoverContext.Provider, {
972
989
  value: isHovered,
973
990
  children
974
991
  });
975
- $[3] = children;
976
- $[4] = isHovered;
977
- $[5] = t3;
978
- } else t3 = $[5];
992
+ $[4] = children;
993
+ $[5] = isHovered;
994
+ $[6] = t3;
995
+ } else t3 = $[6];
979
996
  return t3;
980
997
  };
981
998
  const Repeater = (t0) => {
982
- const $ = c(28);
999
+ const $ = c(30);
1000
+ if ($[0] !== "8cc8be56750b20682f66c3aa201873fa6c45d7eaa41d36f57252a78bdb19fa7e") {
1001
+ for (let $i = 0; $i < 30; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
1002
+ $[0] = "8cc8be56750b20682f66c3aa201873fa6c45d7eaa41d36f57252a78bdb19fa7e";
1003
+ }
983
1004
  const { name, children } = t0;
984
1005
  const blockContext = React.use(Context);
985
1006
  if (!blockContext) throw new Error("Repeater must be used within a Block Component");
@@ -998,18 +1019,18 @@ function createBlock(options) {
998
1019
  let t1;
999
1020
  let t2;
1000
1021
  let t3;
1001
- if ($[0] !== blockId || $[1] !== children || $[2] !== fieldName || $[3] !== itemsMap || $[4] !== mode || $[5] !== name || $[6] !== parentRepeaterContext || $[7] !== source) {
1022
+ if ($[1] !== blockId || $[2] !== children || $[3] !== fieldName || $[4] !== itemsMap || $[5] !== mode || $[6] !== name || $[7] !== parentRepeaterContext || $[8] !== source) {
1002
1023
  let arrayValue = source ?? [];
1003
1024
  if (!Array.isArray(arrayValue)) throw new Error(`Field "${String(name)}" is not an array`);
1004
1025
  let t4;
1005
- if ($[12] !== itemsMap) {
1026
+ if ($[13] !== itemsMap) {
1006
1027
  t4 = (item) => {
1007
1028
  if (isItemMarker(item)) return itemsMap.get(item._itemId) ?? null;
1008
1029
  return item;
1009
1030
  };
1010
- $[12] = itemsMap;
1011
- $[13] = t4;
1012
- } else t4 = $[13];
1031
+ $[13] = itemsMap;
1032
+ $[14] = t4;
1033
+ } else t4 = $[14];
1013
1034
  arrayValue = arrayValue.map(t4).filter(Boolean);
1014
1035
  if (arrayValue.length === 0) {
1015
1036
  const fieldSchema = parentRepeaterContext ? typeboxSchema.properties[parentRepeaterContext.arrayFieldName]?.items?.properties?.[fieldName] : typeboxSchema.properties[fieldName];
@@ -1019,14 +1040,14 @@ function createBlock(options) {
1019
1040
  const itemProps = fieldSchema.items?.properties;
1020
1041
  if (defaultCount > 0 && itemProps) {
1021
1042
  let t5;
1022
- if ($[14] !== defaultCount || $[15] !== itemProps) {
1043
+ if ($[15] !== defaultCount || $[16] !== itemProps) {
1023
1044
  const itemContent = {};
1024
1045
  for (const [propName, propSchema] of Object.entries(itemProps)) if (propSchema && typeof propSchema === "object" && "default" in propSchema) itemContent[propName] = propSchema.default;
1025
1046
  t5 = Array.from({ length: defaultCount }, () => ({ ...itemContent }));
1026
- $[14] = defaultCount;
1027
- $[15] = itemProps;
1028
- $[16] = t5;
1029
- } else t5 = $[16];
1047
+ $[15] = defaultCount;
1048
+ $[16] = itemProps;
1049
+ $[17] = t5;
1050
+ } else t5 = $[17];
1030
1051
  arrayValue = t5;
1031
1052
  }
1032
1053
  }
@@ -1036,7 +1057,7 @@ function createBlock(options) {
1036
1057
  t1 = blockId;
1037
1058
  t2 = fieldName;
1038
1059
  let t5;
1039
- if ($[17] !== blockId || $[18] !== children || $[19] !== fieldName || $[20] !== mode || $[21] !== settingsDefaultsForField) {
1060
+ if ($[18] !== blockId || $[19] !== children || $[20] !== fieldName || $[21] !== mode || $[22] !== parentRepeaterContext?.containerItemId || $[23] !== settingsDefaultsForField) {
1040
1061
  t5 = (item_0, index) => {
1041
1062
  const isDbItem = item_0.content !== void 0 && item_0.id != null;
1042
1063
  const itemContent_0 = {
@@ -1045,7 +1066,7 @@ function createBlock(options) {
1045
1066
  };
1046
1067
  const itemSettings = {
1047
1068
  ...settingsDefaultsForField,
1048
- ...(isDbItem ? item_0.settings : null) ?? {}
1069
+ ...isDbItem ? item_0.settings : null
1049
1070
  };
1050
1071
  const itemId = isDbItem ? item_0.id : void 0;
1051
1072
  const useItemSetting = (settingName) => itemSettings[settingName];
@@ -1064,7 +1085,8 @@ function createBlock(options) {
1064
1085
  itemIndex: index,
1065
1086
  itemContent: itemContent_0,
1066
1087
  itemSettings,
1067
- itemId
1088
+ itemId,
1089
+ containerItemId: itemId ?? parentRepeaterContext?.containerItemId
1068
1090
  },
1069
1091
  children: /* @__PURE__ */ jsx(RepeaterItemWrapper, {
1070
1092
  itemId,
@@ -1074,49 +1096,54 @@ function createBlock(options) {
1074
1096
  })
1075
1097
  }, itemId ?? index);
1076
1098
  };
1077
- $[17] = blockId;
1078
- $[18] = children;
1079
- $[19] = fieldName;
1080
- $[20] = mode;
1081
- $[21] = settingsDefaultsForField;
1082
- $[22] = t5;
1083
- } else t5 = $[22];
1099
+ $[18] = blockId;
1100
+ $[19] = children;
1101
+ $[20] = fieldName;
1102
+ $[21] = mode;
1103
+ $[22] = parentRepeaterContext?.containerItemId;
1104
+ $[23] = settingsDefaultsForField;
1105
+ $[24] = t5;
1106
+ } else t5 = $[24];
1084
1107
  t3 = arrayValue.map(t5);
1085
- $[0] = blockId;
1086
- $[1] = children;
1087
- $[2] = fieldName;
1088
- $[3] = itemsMap;
1089
- $[4] = mode;
1090
- $[5] = name;
1091
- $[6] = parentRepeaterContext;
1092
- $[7] = source;
1093
- $[8] = T0;
1094
- $[9] = t1;
1095
- $[10] = t2;
1096
- $[11] = t3;
1108
+ $[1] = blockId;
1109
+ $[2] = children;
1110
+ $[3] = fieldName;
1111
+ $[4] = itemsMap;
1112
+ $[5] = mode;
1113
+ $[6] = name;
1114
+ $[7] = parentRepeaterContext;
1115
+ $[8] = source;
1116
+ $[9] = T0;
1117
+ $[10] = t1;
1118
+ $[11] = t2;
1119
+ $[12] = t3;
1097
1120
  } else {
1098
- T0 = $[8];
1099
- t1 = $[9];
1100
- t2 = $[10];
1101
- t3 = $[11];
1121
+ T0 = $[9];
1122
+ t1 = $[10];
1123
+ t2 = $[11];
1124
+ t3 = $[12];
1102
1125
  }
1103
1126
  let t4;
1104
- if ($[23] !== T0 || $[24] !== t1 || $[25] !== t2 || $[26] !== t3) {
1127
+ if ($[25] !== T0 || $[26] !== t1 || $[27] !== t2 || $[28] !== t3) {
1105
1128
  t4 = /* @__PURE__ */ jsx(T0, {
1106
1129
  blockId: t1,
1107
1130
  fieldName: t2,
1108
1131
  children: t3
1109
1132
  });
1110
- $[23] = T0;
1111
- $[24] = t1;
1112
- $[25] = t2;
1113
- $[26] = t3;
1114
- $[27] = t4;
1115
- } else t4 = $[27];
1133
+ $[25] = T0;
1134
+ $[26] = t1;
1135
+ $[27] = t2;
1136
+ $[28] = t3;
1137
+ $[29] = t4;
1138
+ } else t4 = $[29];
1116
1139
  return t4;
1117
1140
  };
1118
1141
  const BlockComponent = (t0) => {
1119
- const $ = c(69);
1142
+ const $ = c(70);
1143
+ if ($[0] !== "8cc8be56750b20682f66c3aa201873fa6c45d7eaa41d36f57252a78bdb19fa7e") {
1144
+ for (let $i = 0; $i < 70; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
1145
+ $[0] = "8cc8be56750b20682f66c3aa201873fa6c45d7eaa41d36f57252a78bdb19fa7e";
1146
+ }
1120
1147
  const { blockData, mode, isFirstBlock, showAddBlockTop, showAddBlockBottom, addBlockAfterPosition } = t0;
1121
1148
  const isContentEditable = useIsEditable(mode);
1122
1149
  const { window: iframeWindow } = useFrame();
@@ -1130,80 +1157,80 @@ function createBlock(options) {
1130
1157
  const [isFirstRender, setIsFirstRender] = React.useState(true);
1131
1158
  let t1;
1132
1159
  let t2;
1133
- if ($[0] !== isFirstRender) {
1160
+ if ($[1] !== isFirstRender) {
1134
1161
  t1 = () => {
1135
1162
  if (isFirstRender) setIsFirstRender(false);
1136
1163
  };
1137
1164
  t2 = [isFirstRender];
1138
- $[0] = isFirstRender;
1139
- $[1] = t1;
1140
- $[2] = t2;
1165
+ $[1] = isFirstRender;
1166
+ $[2] = t1;
1167
+ $[3] = t2;
1141
1168
  } else {
1142
- t1 = $[1];
1143
- t2 = $[2];
1169
+ t1 = $[2];
1170
+ t2 = $[3];
1144
1171
  }
1145
1172
  React.useEffect(t1, t2);
1146
1173
  let t3;
1147
- if ($[3] !== isBlockSelected || $[4] !== isFirstRender) {
1174
+ if ($[4] !== isBlockSelected || $[5] !== isFirstRender) {
1148
1175
  t3 = () => {
1149
1176
  if (isBlockSelected && ref.current) ref.current.scrollIntoView({
1150
1177
  behavior: isFirstRender ? "instant" : "smooth",
1151
1178
  block: isFirstRender ? "start" : "nearest"
1152
1179
  });
1153
1180
  };
1154
- $[3] = isBlockSelected;
1155
- $[4] = isFirstRender;
1156
- $[5] = t3;
1157
- } else t3 = $[5];
1181
+ $[4] = isBlockSelected;
1182
+ $[5] = isFirstRender;
1183
+ $[6] = t3;
1184
+ } else t3 = $[6];
1158
1185
  let t4;
1159
- if ($[6] !== isBlockSelected || $[7] !== isFirstRender || $[8] !== isPageContentSheetOpen) {
1186
+ if ($[7] !== isBlockSelected || $[8] !== isFirstRender || $[9] !== isPageContentSheetOpen) {
1160
1187
  t4 = [
1161
1188
  isBlockSelected,
1162
1189
  isFirstRender,
1163
1190
  isPageContentSheetOpen
1164
1191
  ];
1165
- $[6] = isBlockSelected;
1166
- $[7] = isFirstRender;
1167
- $[8] = isPageContentSheetOpen;
1168
- $[9] = t4;
1169
- } else t4 = $[9];
1192
+ $[7] = isBlockSelected;
1193
+ $[8] = isFirstRender;
1194
+ $[9] = isPageContentSheetOpen;
1195
+ $[10] = t4;
1196
+ } else t4 = $[10];
1170
1197
  React.useEffect(t3, t4);
1171
1198
  const t5 = String(blockData._id);
1172
1199
  let t6;
1173
- if ($[10] !== t5) {
1200
+ if ($[11] !== t5) {
1174
1201
  t6 = { blockId: t5 };
1175
- $[10] = t5;
1176
- $[11] = t6;
1177
- } else t6 = $[11];
1202
+ $[11] = t5;
1203
+ $[12] = t6;
1204
+ } else t6 = $[12];
1178
1205
  const isHoveredFromSidebar = useOverlayMessage(iframeWindow, isContentEditable, "CAMOX_HOVER_BLOCK", "CAMOX_HOVER_BLOCK_END", t6);
1179
1206
  let t7;
1180
1207
  let t8;
1181
- if ($[12] !== isHoveredFromSidebar) {
1208
+ if ($[13] !== isHoveredFromSidebar) {
1182
1209
  t7 = () => {
1183
1210
  setIsHovered(isHoveredFromSidebar);
1184
1211
  };
1185
1212
  t8 = [isHoveredFromSidebar];
1186
- $[12] = isHoveredFromSidebar;
1187
- $[13] = t7;
1188
- $[14] = t8;
1213
+ $[13] = isHoveredFromSidebar;
1214
+ $[14] = t7;
1215
+ $[15] = t8;
1189
1216
  } else {
1190
- t7 = $[13];
1191
- t8 = $[14];
1217
+ t7 = $[14];
1218
+ t8 = $[15];
1192
1219
  }
1193
1220
  React.useEffect(t7, t8);
1194
1221
  let result;
1195
- if ($[15] !== blockData.content) {
1222
+ if ($[16] !== blockData.content) {
1196
1223
  result = { ...blockData.content };
1197
1224
  for (const key in result) {
1198
1225
  const value = result[key];
1199
1226
  if (Array.isArray(value) && value.length > 0 && value[0]?.content !== void 0) result[key] = value.map(_temp9);
1200
1227
  }
1201
- $[15] = blockData.content;
1202
- $[16] = result;
1203
- } else result = $[16];
1228
+ $[16] = blockData.content;
1229
+ $[17] = result;
1230
+ } else result = $[17];
1204
1231
  const normalizedContent = result;
1205
1232
  let t9;
1206
- if ($[17] !== blockData._id || $[18] !== isContentEditable) {
1233
+ if ($[18] !== blockData._id || $[19] !== isContentEditable) {
1207
1234
  t9 = (e) => {
1208
1235
  if (!isContentEditable) return;
1209
1236
  if (e.target.closest("[data-camox-field-id]")) return;
@@ -1212,31 +1239,31 @@ function createBlock(options) {
1212
1239
  blockId: blockData._id
1213
1240
  });
1214
1241
  };
1215
- $[17] = blockData._id;
1216
- $[18] = isContentEditable;
1217
- $[19] = t9;
1218
- } else t9 = $[19];
1242
+ $[18] = blockData._id;
1243
+ $[19] = isContentEditable;
1244
+ $[20] = t9;
1245
+ } else t9 = $[20];
1219
1246
  const handleClick = t9;
1220
1247
  let t10;
1221
- if ($[20] !== isContentEditable) {
1248
+ if ($[21] !== isContentEditable) {
1222
1249
  t10 = () => {
1223
1250
  if (isContentEditable) setIsHovered(true);
1224
1251
  };
1225
- $[20] = isContentEditable;
1226
- $[21] = t10;
1227
- } else t10 = $[21];
1252
+ $[21] = isContentEditable;
1253
+ $[22] = t10;
1254
+ } else t10 = $[22];
1228
1255
  const handleMouseEnter = t10;
1229
1256
  let t11;
1230
- if ($[22] !== isContentEditable) {
1257
+ if ($[23] !== isContentEditable) {
1231
1258
  t11 = () => {
1232
1259
  if (isContentEditable) setIsHovered(false);
1233
1260
  };
1234
- $[22] = isContentEditable;
1235
- $[23] = t11;
1236
- } else t11 = $[23];
1261
+ $[23] = isContentEditable;
1262
+ $[24] = t11;
1263
+ } else t11 = $[24];
1237
1264
  const handleMouseLeave = t11;
1238
1265
  let t12;
1239
- if ($[24] !== addBlockAfterPosition || $[25] !== blockData.position) {
1266
+ if ($[25] !== addBlockAfterPosition || $[26] !== blockData.position) {
1240
1267
  t12 = (insertPosition) => {
1241
1268
  postOverlayMessage({
1242
1269
  type: "CAMOX_ADD_BLOCK_REQUEST",
@@ -1245,70 +1272,70 @@ function createBlock(options) {
1245
1272
  ...addBlockAfterPosition !== void 0 && { afterPosition: addBlockAfterPosition }
1246
1273
  });
1247
1274
  };
1248
- $[24] = addBlockAfterPosition;
1249
- $[25] = blockData.position;
1250
- $[26] = t12;
1251
- } else t12 = $[26];
1275
+ $[25] = addBlockAfterPosition;
1276
+ $[26] = blockData.position;
1277
+ $[27] = t12;
1278
+ } else t12 = $[27];
1252
1279
  const handleAddBlockClick = t12;
1253
1280
  const shouldShowOverlay = isContentEditable && (isHovered || isBlockSelected) && !isAddBlockSheetOpen;
1254
1281
  const shouldShowSheetOverlay = isAddBlockSheetOpen && mode !== "peek" || isPageContentSheetOpen && !isBlockSelected;
1255
1282
  let t13;
1256
- if ($[27] === Symbol.for("react.memo_cache_sentinel")) {
1283
+ if ($[28] === Symbol.for("react.memo_cache_sentinel")) {
1257
1284
  t13 = {
1258
1285
  position: "relative",
1259
1286
  scrollMargin: "5rem",
1260
1287
  background: "var(--background)"
1261
1288
  };
1262
- $[27] = t13;
1263
- } else t13 = $[27];
1289
+ $[28] = t13;
1290
+ } else t13 = $[28];
1264
1291
  const t14 = isContentEditable ? blockData._id : void 0;
1265
1292
  const t15 = shouldShowOverlay && !isBlockSelected || void 0;
1266
1293
  const t16 = shouldShowOverlay && isBlockSelected || void 0;
1267
1294
  const t17 = mode === "layout" ? "layout" : void 0;
1268
1295
  const t18 = blockData._id;
1269
1296
  let t19;
1270
- if ($[28] !== blockData.content) {
1297
+ if ($[29] !== blockData.content) {
1271
1298
  t19 = {
1272
1299
  ...contentDefaults,
1273
1300
  ...blockData.content
1274
1301
  };
1275
- $[28] = blockData.content;
1276
- $[29] = t19;
1277
- } else t19 = $[29];
1302
+ $[29] = blockData.content;
1303
+ $[30] = t19;
1304
+ } else t19 = $[30];
1278
1305
  const merged = t19;
1279
1306
  let overrides;
1280
- if ($[30] !== merged) {
1307
+ if ($[31] !== merged) {
1281
1308
  overrides = {};
1282
1309
  for (const key_0 in merged) {
1283
1310
  const val = merged[key_0];
1284
1311
  if (val && typeof val === "object" && "url" in val && !val.url && contentDefaults[key_0]) overrides[key_0] = contentDefaults[key_0];
1285
1312
  }
1286
- $[30] = merged;
1287
- $[31] = overrides;
1288
- } else overrides = $[31];
1313
+ $[31] = merged;
1314
+ $[32] = overrides;
1315
+ } else overrides = $[32];
1289
1316
  let t20;
1290
- if ($[32] !== merged || $[33] !== overrides) {
1317
+ if ($[33] !== merged || $[34] !== overrides) {
1291
1318
  t20 = {
1292
1319
  ...merged,
1293
1320
  ...overrides
1294
1321
  };
1295
- $[32] = merged;
1296
- $[33] = overrides;
1297
- $[34] = t20;
1298
- } else t20 = $[34];
1322
+ $[33] = merged;
1323
+ $[34] = overrides;
1324
+ $[35] = t20;
1325
+ } else t20 = $[35];
1299
1326
  const t21 = t20;
1300
1327
  let t22;
1301
- if ($[35] !== blockData.settings) {
1328
+ if ($[36] !== blockData.settings) {
1302
1329
  t22 = {
1303
1330
  ...settingsDefaults,
1304
1331
  ...blockData.settings
1305
1332
  };
1306
- $[35] = blockData.settings;
1307
- $[36] = t22;
1308
- } else t22 = $[36];
1333
+ $[36] = blockData.settings;
1334
+ $[37] = t22;
1335
+ } else t22 = $[37];
1309
1336
  const t23 = t22;
1310
1337
  let t24;
1311
- if ($[37] !== blockData._id || $[38] !== isHovered || $[39] !== mode || $[40] !== t21 || $[41] !== t23) {
1338
+ if ($[38] !== blockData._id || $[39] !== isHovered || $[40] !== mode || $[41] !== t21 || $[42] !== t23) {
1312
1339
  t24 = {
1313
1340
  blockId: t18,
1314
1341
  content: t21,
@@ -1317,40 +1344,40 @@ function createBlock(options) {
1317
1344
  isHovered,
1318
1345
  setIsHovered
1319
1346
  };
1320
- $[37] = blockData._id;
1321
- $[38] = isHovered;
1322
- $[39] = mode;
1323
- $[40] = t21;
1324
- $[41] = t23;
1325
- $[42] = t24;
1326
- } else t24 = $[42];
1347
+ $[38] = blockData._id;
1348
+ $[39] = isHovered;
1349
+ $[40] = mode;
1350
+ $[41] = t21;
1351
+ $[42] = t23;
1352
+ $[43] = t24;
1353
+ } else t24 = $[43];
1327
1354
  let t25;
1328
- if ($[43] !== normalizedContent) {
1355
+ if ($[44] !== normalizedContent) {
1329
1356
  t25 = /* @__PURE__ */ jsx(options.component, { content: normalizedContent });
1330
- $[43] = normalizedContent;
1331
- $[44] = t25;
1332
- } else t25 = $[44];
1357
+ $[44] = normalizedContent;
1358
+ $[45] = t25;
1359
+ } else t25 = $[45];
1333
1360
  let t26;
1334
- if ($[45] !== t24 || $[46] !== t25) {
1361
+ if ($[46] !== t24 || $[47] !== t25) {
1335
1362
  t26 = /* @__PURE__ */ jsx(Context.Provider, {
1336
1363
  value: t24,
1337
1364
  children: t25
1338
1365
  });
1339
- $[45] = t24;
1340
- $[46] = t25;
1341
- $[47] = t26;
1342
- } else t26 = $[47];
1366
+ $[46] = t24;
1367
+ $[47] = t25;
1368
+ $[48] = t26;
1369
+ } else t26 = $[48];
1343
1370
  let t27;
1344
- if ($[48] !== shouldShowSheetOverlay) {
1371
+ if ($[49] !== shouldShowSheetOverlay) {
1345
1372
  t27 = /* @__PURE__ */ jsx("div", {
1346
1373
  className: "camox-sheet-overlay",
1347
1374
  ...shouldShowSheetOverlay ? { "data-camox-visible": "" } : {}
1348
1375
  });
1349
- $[48] = shouldShowSheetOverlay;
1350
- $[49] = t27;
1351
- } else t27 = $[49];
1376
+ $[49] = shouldShowSheetOverlay;
1377
+ $[50] = t27;
1378
+ } else t27 = $[50];
1352
1379
  let t28;
1353
- if ($[50] !== handleAddBlockClick || $[51] !== isAnySideSheetOpen || $[52] !== isFirstBlock || $[53] !== mode || $[54] !== shouldShowOverlay || $[55] !== showAddBlockBottom || $[56] !== showAddBlockTop) {
1380
+ if ($[51] !== handleAddBlockClick || $[52] !== isAnySideSheetOpen || $[53] !== isFirstBlock || $[54] !== mode || $[55] !== shouldShowOverlay || $[56] !== showAddBlockBottom || $[57] !== showAddBlockTop) {
1354
1381
  t28 = shouldShowOverlay && /* @__PURE__ */ jsxs(Fragment, { children: [(showAddBlockTop ?? (mode !== "layout" && !isFirstBlock)) && /* @__PURE__ */ jsx(AddBlockControlBar, {
1355
1382
  position: "top",
1356
1383
  hidden: isAnySideSheetOpen,
@@ -1362,17 +1389,17 @@ function createBlock(options) {
1362
1389
  onMouseLeave: () => setIsHovered(false),
1363
1390
  onClick: () => handleAddBlockClick("after")
1364
1391
  })] });
1365
- $[50] = handleAddBlockClick;
1366
- $[51] = isAnySideSheetOpen;
1367
- $[52] = isFirstBlock;
1368
- $[53] = mode;
1369
- $[54] = shouldShowOverlay;
1370
- $[55] = showAddBlockBottom;
1371
- $[56] = showAddBlockTop;
1372
- $[57] = t28;
1373
- } else t28 = $[57];
1392
+ $[51] = handleAddBlockClick;
1393
+ $[52] = isAnySideSheetOpen;
1394
+ $[53] = isFirstBlock;
1395
+ $[54] = mode;
1396
+ $[55] = shouldShowOverlay;
1397
+ $[56] = showAddBlockBottom;
1398
+ $[57] = showAddBlockTop;
1399
+ $[58] = t28;
1400
+ } else t28 = $[58];
1374
1401
  let t29;
1375
- if ($[58] !== handleClick || $[59] !== handleMouseEnter || $[60] !== handleMouseLeave || $[61] !== t14 || $[62] !== t15 || $[63] !== t16 || $[64] !== t17 || $[65] !== t26 || $[66] !== t27 || $[67] !== t28) {
1402
+ if ($[59] !== handleClick || $[60] !== handleMouseEnter || $[61] !== handleMouseLeave || $[62] !== t14 || $[63] !== t15 || $[64] !== t16 || $[65] !== t17 || $[66] !== t26 || $[67] !== t27 || $[68] !== t28) {
1376
1403
  t29 = /* @__PURE__ */ jsxs("div", {
1377
1404
  className: "group visual-editing-block",
1378
1405
  ref,
@@ -1390,18 +1417,18 @@ function createBlock(options) {
1390
1417
  t28
1391
1418
  ]
1392
1419
  });
1393
- $[58] = handleClick;
1394
- $[59] = handleMouseEnter;
1395
- $[60] = handleMouseLeave;
1396
- $[61] = t14;
1397
- $[62] = t15;
1398
- $[63] = t16;
1399
- $[64] = t17;
1400
- $[65] = t26;
1401
- $[66] = t27;
1402
- $[67] = t28;
1403
- $[68] = t29;
1404
- } else t29 = $[68];
1420
+ $[59] = handleClick;
1421
+ $[60] = handleMouseEnter;
1422
+ $[61] = handleMouseLeave;
1423
+ $[62] = t14;
1424
+ $[63] = t15;
1425
+ $[64] = t16;
1426
+ $[65] = t17;
1427
+ $[66] = t26;
1428
+ $[67] = t27;
1429
+ $[68] = t28;
1430
+ $[69] = t29;
1431
+ } else t29 = $[69];
1405
1432
  return t29;
1406
1433
  };
1407
1434
  const useSetting = (name) => {
@@ -1414,7 +1441,11 @@ function createBlock(options) {
1414
1441
  * Provides the same hover, selection, and sheet overlays as the main BlockComponent.
1415
1442
  */
1416
1443
  const Detached = (t0) => {
1417
- const $ = c(30);
1444
+ const $ = c(31);
1445
+ if ($[0] !== "8cc8be56750b20682f66c3aa201873fa6c45d7eaa41d36f57252a78bdb19fa7e") {
1446
+ for (let $i = 0; $i < 31; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
1447
+ $[0] = "8cc8be56750b20682f66c3aa201873fa6c45d7eaa41d36f57252a78bdb19fa7e";
1448
+ }
1418
1449
  const { children } = t0;
1419
1450
  const ctx = React.use(Context);
1420
1451
  if (!ctx) throw new Error("Detached must be used within a Block Component");
@@ -1427,32 +1458,32 @@ function createBlock(options) {
1427
1458
  const isBlockSelected = selection?.blockId === blockId;
1428
1459
  const t1 = String(blockId);
1429
1460
  let t2;
1430
- if ($[0] !== t1) {
1461
+ if ($[1] !== t1) {
1431
1462
  t2 = { blockId: t1 };
1432
- $[0] = t1;
1433
- $[1] = t2;
1434
- } else t2 = $[1];
1463
+ $[1] = t1;
1464
+ $[2] = t2;
1465
+ } else t2 = $[2];
1435
1466
  const isHoveredFromSidebar = useOverlayMessage(iframeWindow, isContentEditable, "CAMOX_HOVER_BLOCK", "CAMOX_HOVER_BLOCK_END", t2);
1436
1467
  let t3;
1437
1468
  let t4;
1438
- if ($[2] !== isHoveredFromSidebar || $[3] !== setIsHovered) {
1469
+ if ($[3] !== isHoveredFromSidebar || $[4] !== setIsHovered) {
1439
1470
  t3 = () => {
1440
1471
  setIsHovered(isHoveredFromSidebar);
1441
1472
  };
1442
1473
  t4 = [isHoveredFromSidebar, setIsHovered];
1443
- $[2] = isHoveredFromSidebar;
1444
- $[3] = setIsHovered;
1445
- $[4] = t3;
1446
- $[5] = t4;
1474
+ $[3] = isHoveredFromSidebar;
1475
+ $[4] = setIsHovered;
1476
+ $[5] = t3;
1477
+ $[6] = t4;
1447
1478
  } else {
1448
- t3 = $[4];
1449
- t4 = $[5];
1479
+ t3 = $[5];
1480
+ t4 = $[6];
1450
1481
  }
1451
1482
  React.useEffect(t3, t4);
1452
1483
  const shouldShowOverlay = isContentEditable && (isHovered || isBlockSelected) && !isAddBlockSheetOpen;
1453
1484
  const shouldShowSheetOverlay = isAddBlockSheetOpen && mode !== "peek" || isPageContentSheetOpen && !isBlockSelected;
1454
1485
  let t5;
1455
- if ($[6] !== blockId || $[7] !== isContentEditable) {
1486
+ if ($[7] !== blockId || $[8] !== isContentEditable) {
1456
1487
  t5 = (e) => {
1457
1488
  if (!isContentEditable) return;
1458
1489
  e.stopPropagation();
@@ -1461,35 +1492,35 @@ function createBlock(options) {
1461
1492
  blockId
1462
1493
  });
1463
1494
  };
1464
- $[6] = blockId;
1465
- $[7] = isContentEditable;
1466
- $[8] = t5;
1467
- } else t5 = $[8];
1495
+ $[7] = blockId;
1496
+ $[8] = isContentEditable;
1497
+ $[9] = t5;
1498
+ } else t5 = $[9];
1468
1499
  const handleClick = t5;
1469
1500
  let t6;
1470
- if ($[9] !== isContentEditable || $[10] !== setIsHovered) {
1501
+ if ($[10] !== isContentEditable || $[11] !== setIsHovered) {
1471
1502
  t6 = () => {
1472
1503
  if (isContentEditable) setIsHovered(true);
1473
1504
  };
1474
- $[9] = isContentEditable;
1475
- $[10] = setIsHovered;
1476
- $[11] = t6;
1477
- } else t6 = $[11];
1505
+ $[10] = isContentEditable;
1506
+ $[11] = setIsHovered;
1507
+ $[12] = t6;
1508
+ } else t6 = $[12];
1478
1509
  const handleMouseEnter = t6;
1479
1510
  let t7;
1480
- if ($[12] !== isContentEditable || $[13] !== setIsHovered) {
1511
+ if ($[13] !== isContentEditable || $[14] !== setIsHovered) {
1481
1512
  t7 = () => {
1482
1513
  if (isContentEditable) setIsHovered(false);
1483
1514
  };
1484
- $[12] = isContentEditable;
1485
- $[13] = setIsHovered;
1486
- $[14] = t7;
1487
- } else t7 = $[14];
1515
+ $[13] = isContentEditable;
1516
+ $[14] = setIsHovered;
1517
+ $[15] = t7;
1518
+ } else t7 = $[15];
1488
1519
  const handleMouseLeave = t7;
1489
1520
  const [container, setContainer] = React.useState(null);
1490
1521
  const t8 = shouldShowSheetOverlay ? 0 : 1;
1491
1522
  let t9;
1492
- if ($[15] !== children || $[16] !== handleClick || $[17] !== handleMouseEnter || $[18] !== handleMouseLeave || $[19] !== t8) {
1523
+ if ($[16] !== children || $[17] !== handleClick || $[18] !== handleMouseEnter || $[19] !== handleMouseLeave || $[20] !== t8) {
1493
1524
  t9 = children({
1494
1525
  ref: setContainer,
1495
1526
  style: { opacity: t8 },
@@ -1497,15 +1528,15 @@ function createBlock(options) {
1497
1528
  onMouseEnter: handleMouseEnter,
1498
1529
  onMouseLeave: handleMouseLeave
1499
1530
  });
1500
- $[15] = children;
1501
- $[16] = handleClick;
1502
- $[17] = handleMouseEnter;
1503
- $[18] = handleMouseLeave;
1504
- $[19] = t8;
1505
- $[20] = t9;
1506
- } else t9 = $[20];
1531
+ $[16] = children;
1532
+ $[17] = handleClick;
1533
+ $[18] = handleMouseEnter;
1534
+ $[19] = handleMouseLeave;
1535
+ $[20] = t8;
1536
+ $[21] = t9;
1537
+ } else t9 = $[21];
1507
1538
  let t10;
1508
- if ($[21] !== blockId || $[22] !== container || $[23] !== isBlockSelected || $[24] !== mode || $[25] !== shouldShowOverlay) {
1539
+ if ($[22] !== blockId || $[23] !== container || $[24] !== isBlockSelected || $[25] !== mode || $[26] !== shouldShowOverlay) {
1509
1540
  t10 = container && createPortal(/* @__PURE__ */ jsx(Fragment, { children: shouldShowOverlay && /* @__PURE__ */ jsx("div", {
1510
1541
  "data-camox-block-id": blockId,
1511
1542
  "data-camox-detached": true,
@@ -1518,20 +1549,20 @@ function createBlock(options) {
1518
1549
  zIndex: 10
1519
1550
  }
1520
1551
  }) }), container);
1521
- $[21] = blockId;
1522
- $[22] = container;
1523
- $[23] = isBlockSelected;
1524
- $[24] = mode;
1525
- $[25] = shouldShowOverlay;
1526
- $[26] = t10;
1527
- } else t10 = $[26];
1552
+ $[22] = blockId;
1553
+ $[23] = container;
1554
+ $[24] = isBlockSelected;
1555
+ $[25] = mode;
1556
+ $[26] = shouldShowOverlay;
1557
+ $[27] = t10;
1558
+ } else t10 = $[27];
1528
1559
  let t11;
1529
- if ($[27] !== t10 || $[28] !== t9) {
1560
+ if ($[28] !== t10 || $[29] !== t9) {
1530
1561
  t11 = /* @__PURE__ */ jsxs(Fragment, { children: [t9, t10] });
1531
- $[27] = t10;
1532
- $[28] = t9;
1533
- $[29] = t11;
1534
- } else t11 = $[29];
1562
+ $[28] = t10;
1563
+ $[29] = t9;
1564
+ $[30] = t11;
1565
+ } else t11 = $[30];
1535
1566
  return t11;
1536
1567
  };
1537
1568
  return {
@@ -1544,6 +1575,11 @@ function createBlock(options) {
1544
1575
  Repeater,
1545
1576
  useSetting,
1546
1577
  _internal: {
1578
+ /**
1579
+ * The react component to be used at the page level when mapping on blocks content.
1580
+ * It exposes context that will be consumed by the Field component, and provides visual editing
1581
+ * capabilities (e.g. delete and reorder blocks).
1582
+ */
1547
1583
  Component: BlockComponent,
1548
1584
  id: options.id,
1549
1585
  title: options.title,