camox 0.46.0 → 0.48.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 (82) hide show
  1. package/dist/core/createApp.d.ts +19 -6
  2. package/dist/core/createApp.js +7 -2
  3. package/dist/core/createBlock.js +54 -43
  4. package/dist/core/createCollection.d.ts +25 -7
  5. package/dist/core/createCollection.js +28 -9
  6. package/dist/core/createLayout.d.ts +98 -71
  7. package/dist/core/createLayout.js +10 -16
  8. package/dist/core/derivedRoutes.js +1 -1
  9. package/dist/core/editing/BlockEditingRuntime.d.ts +3 -2
  10. package/dist/core/editing/CompleteBlockEditingRuntime.js +2 -1
  11. package/dist/core/editing/createEditableBlock.d.ts +59 -19
  12. package/dist/core/editing/createEditableBlock.js +162 -151
  13. package/dist/core/editing/useLatestRecord.js +7 -7
  14. package/dist/core/layoutContext.d.ts +54 -0
  15. package/dist/core/layoutContext.js +66 -0
  16. package/dist/core/lib/contentType.d.ts +91 -4
  17. package/dist/core/lib/contentType.js +84 -7
  18. package/dist/core/lib/recordScope.js +19 -17
  19. package/dist/core/lib/reference.d.ts +6 -2
  20. package/dist/core/recordItem.js +55 -2
  21. package/dist/core/requestContext.d.ts +18 -0
  22. package/dist/core/structuredData.d.ts +126 -0
  23. package/dist/core/structuredData.js +40 -0
  24. package/dist/features/canvas/canvasCamera.js +21 -6
  25. package/dist/features/canvas/sidebar/CanvasSidebarFrame.js +1 -1
  26. package/dist/features/canvas/useCanvasCamera.js +16 -11
  27. package/dist/features/content/ContentCollection.js +13 -7
  28. package/dist/features/content/collection-form.js +6 -2
  29. package/dist/features/content/components/MissingFromLocale.js +1 -1
  30. package/dist/features/og/pageImage.js +89 -0
  31. package/dist/features/page/CuratedPageContent.js +45 -32
  32. package/dist/features/page/DerivedPageContent.js +49 -22
  33. package/dist/features/page/SharedLayoutContent.js +26 -22
  34. package/dist/features/preview/CamoxPreview.js +176 -145
  35. package/dist/features/preview/components/AddBlockSheet.js +1 -0
  36. package/dist/features/preview/components/BlockActionsPopover.js +8 -6
  37. package/dist/features/preview/components/PageInfo.js +244 -264
  38. package/dist/features/preview/components/PageTree.js +63 -53
  39. package/dist/features/preview/components/PreviewToolbar.js +74 -85
  40. package/dist/features/preview/components/RecordCard.js +50 -34
  41. package/dist/features/preview/components/RecordCombobox.js +12 -5
  42. package/dist/features/preview/components/ReferenceFieldEditor.js +4 -2
  43. package/dist/features/preview/components/ReferenceListFieldEditor.js +24 -19
  44. package/dist/features/preview/components/RepeatableItemsList.js +62 -46
  45. package/dist/features/preview/components/SelectionEditor.js +3 -2
  46. package/dist/features/preview/components/useFieldWriter.js +2 -4
  47. package/dist/features/preview/components/useRecordView.js +2 -2
  48. package/dist/features/preview/entityName.js +11 -0
  49. package/dist/features/preview/pageRecord.js +17 -18
  50. package/dist/features/provider/CamoxProvider.js +8 -16
  51. package/dist/features/provider/CoreCamoxProvider.js +1 -6
  52. package/dist/features/provider/signInShortcut.js +60 -0
  53. package/dist/features/routes/pageRuntime.d.ts +15 -1
  54. package/dist/features/routes/pageRuntime.js +35 -38
  55. package/dist/features/runtime/RuntimeChrome.js +2 -2
  56. package/dist/features/runtime/breadcrumbs.js +68 -0
  57. package/dist/features/runtime/livePages.js +3 -2
  58. package/dist/features/runtime/pageApp.js +11 -39
  59. package/dist/features/runtime/pageGraph.js +92 -0
  60. package/dist/features/runtime/projectLogo.js +110 -0
  61. package/dist/features/runtime/runtime.d.ts +11 -6
  62. package/dist/features/runtime/runtime.js +278 -55
  63. package/dist/features/runtime/runtimeRoutes.d.ts +1 -0
  64. package/dist/features/runtime/runtimeRoutes.js +1 -0
  65. package/dist/features/runtime/structuredData.js +213 -0
  66. package/dist/features/studio/components/ChatSidebar.js +5 -5
  67. package/dist/features/studio/components/ProjectMenu.js +127 -100
  68. package/dist/features/studio/components/SocialProfilesDialog.js +342 -0
  69. package/dist/features/studio/components/ThreadMessages.js +2 -2
  70. package/dist/features/vite/blockBoilerplate.js +3 -2
  71. package/dist/features/vite/layoutGeneration.js +3 -2
  72. package/dist/features/vite/vite.js +1 -0
  73. package/dist/lib/queries.d.ts +4 -0
  74. package/dist/lib/queries.js +1 -0
  75. package/dist/lib/studio-reads.js +3 -1
  76. package/dist/package.js +1 -1
  77. package/dist/studio.css +1 -1
  78. package/package.json +5 -4
  79. package/skills/camox/references/block-definitions.md +105 -25
  80. package/skills/camox/references/layout-definitions.md +53 -17
  81. package/skills/camox/references/routed-layouts.md +17 -14
  82. package/dist/features/provider/LocalhostPreviewProvider.js +0 -158
@@ -8,6 +8,7 @@ import { useCamoxApp } from "../provider/components/CamoxAppContext.js";
8
8
  import { NormalizedDataProvider, usePageBlocks } from "../../lib/normalized-data.js";
9
9
  import { reads, useRead, useStudioCache } from "../../lib/studio-reads.js";
10
10
  import { BlockErrorBoundary } from "./components/BlockErrorBoundary.js";
11
+ import { curatedLayoutContext } from "../../core/layoutContext.js";
11
12
  import { CollectionItemSheetProvider } from "../content/CollectionItemSheetContext.js";
12
13
  import { cn } from "../../lib/utils.js";
13
14
  import { ContentCollectionItemSheet } from "../content/ContentCollection.js";
@@ -17,6 +18,7 @@ import { canvasStore } from "../canvas/canvasStore.js";
17
18
  import { SHOW_WHOLE_CANVAS_SHORTCUT, TOGGLE_CANVAS_SHORTCUT } from "./previewConstants.js";
18
19
  import { CanvasSidebarSkeleton } from "../canvas/sidebar/CanvasSidebarSkeleton.js";
19
20
  import { DerivedPageContent } from "../page/DerivedPageContent.js";
21
+ import { takeShowCanvasRequest } from "../provider/signInShortcut.js";
20
22
  import { STUDIO_CANVAS_PATH } from "../studio/routes.js";
21
23
  import { studioStore } from "../studio/studioStore.js";
22
24
  import { previewStore, selectIsCanvasShown } from "./previewStore.js";
@@ -163,10 +165,11 @@ const BlockRenderer = (t0) => {
163
165
  return t13;
164
166
  };
165
167
  const PageContent = () => {
166
- const $ = c(30);
168
+ const $ = c(34);
167
169
  const pageData = usePreviewedPage();
168
170
  const { pageBlocks, beforeBlocks, afterBlocks, layoutFiles, layoutItems } = usePageBlocks(pageData);
169
171
  const camoxApp = useCamoxApp();
172
+ const { locale } = useViewLocale();
170
173
  let layout;
171
174
  let layoutBlocksMap;
172
175
  let t0;
@@ -227,7 +230,7 @@ const PageContent = () => {
227
230
  } else t1 = $[12];
228
231
  const pageBlocksContent = t1;
229
232
  if (layout && layoutBlocksMap) {
230
- const LayoutComponent = layout._internal.component;
233
+ const ToReact = layout._internal.toReact;
231
234
  let t2;
232
235
  if ($[13] !== afterBlocks || $[14] !== beforeBlocks) {
233
236
  t2 = [...beforeBlocks, ...afterBlocks];
@@ -235,49 +238,61 @@ const PageContent = () => {
235
238
  $[14] = beforeBlocks;
236
239
  $[15] = t2;
237
240
  } else t2 = $[15];
241
+ const T0 = layout._internal.Provider;
238
242
  let t3;
239
- if ($[16] !== LayoutComponent || $[17] !== pageBlocksContent) {
240
- t3 = /* @__PURE__ */ jsx(LayoutComponent, { children: pageBlocksContent });
241
- $[16] = LayoutComponent;
242
- $[17] = pageBlocksContent;
243
+ if ($[16] !== locale || $[17] !== pageData) {
244
+ t3 = curatedLayoutContext(pageData, locale);
245
+ $[16] = locale;
246
+ $[17] = pageData;
243
247
  $[18] = t3;
244
248
  } else t3 = $[18];
245
249
  let t4;
246
- if ($[19] !== layout._internal.Provider || $[20] !== layoutBlocksMap || $[21] !== t3) {
247
- t4 = /* @__PURE__ */ jsx(layout._internal.Provider, {
248
- layoutBlocks: layoutBlocksMap,
249
- children: t3
250
+ if ($[19] !== ToReact || $[20] !== pageBlocksContent || $[21] !== t3) {
251
+ t4 = /* @__PURE__ */ jsx(ToReact, {
252
+ ...t3,
253
+ children: pageBlocksContent
250
254
  });
251
- $[19] = layout._internal.Provider;
252
- $[20] = layoutBlocksMap;
255
+ $[19] = ToReact;
256
+ $[20] = pageBlocksContent;
253
257
  $[21] = t3;
254
258
  $[22] = t4;
255
259
  } else t4 = $[22];
256
260
  let t5;
257
- if ($[23] !== layoutFiles || $[24] !== layoutItems || $[25] !== t2 || $[26] !== t4) {
258
- t5 = /* @__PURE__ */ jsx(NormalizedDataProvider, {
261
+ if ($[23] !== layout._internal.Provider || $[24] !== layoutBlocksMap || $[25] !== t4) {
262
+ t5 = /* @__PURE__ */ jsx(T0, {
263
+ layoutBlocks: layoutBlocksMap,
264
+ children: t4
265
+ });
266
+ $[23] = layout._internal.Provider;
267
+ $[24] = layoutBlocksMap;
268
+ $[25] = t4;
269
+ $[26] = t5;
270
+ } else t5 = $[26];
271
+ let t6;
272
+ if ($[27] !== layoutFiles || $[28] !== layoutItems || $[29] !== t2 || $[30] !== t5) {
273
+ t6 = /* @__PURE__ */ jsx(NormalizedDataProvider, {
259
274
  files: layoutFiles,
260
275
  repeatableItems: layoutItems,
261
276
  blocks: t2,
262
- children: t4
277
+ children: t5
263
278
  });
264
- $[23] = layoutFiles;
265
- $[24] = layoutItems;
266
- $[25] = t2;
267
- $[26] = t4;
268
- $[27] = t5;
269
- } else t5 = $[27];
270
- return t5;
279
+ $[27] = layoutFiles;
280
+ $[28] = layoutItems;
281
+ $[29] = t2;
282
+ $[30] = t5;
283
+ $[31] = t6;
284
+ } else t6 = $[31];
285
+ return t6;
271
286
  }
272
287
  let t2;
273
- if ($[28] !== pageBlocksContent) {
288
+ if ($[32] !== pageBlocksContent) {
274
289
  t2 = /* @__PURE__ */ jsx("main", {
275
290
  className: "flex min-h-screen flex-col",
276
291
  children: pageBlocksContent
277
292
  });
278
- $[28] = pageBlocksContent;
279
- $[29] = t2;
280
- } else t2 = $[29];
293
+ $[32] = pageBlocksContent;
294
+ $[33] = t2;
295
+ } else t2 = $[33];
281
296
  return t2;
282
297
  };
283
298
  /**
@@ -617,7 +632,7 @@ function usePrefetchCanvas(enabled, projectUuid) {
617
632
  }
618
633
  /** Studio chrome is shared; only curated previews require a Camox page record. */
619
634
  const PreviewShell = (t0) => {
620
- const $ = c(49);
635
+ const $ = c(53);
621
636
  const { children, pageData, derivedLayout, pageLocation, canvasOnly, runtimeBasePath: t1 } = t0;
622
637
  const runtimeBasePath = t1 === void 0 ? "" : t1;
623
638
  const isAuthenticated = useIsAuthenticated();
@@ -663,26 +678,42 @@ const PreviewShell = (t0) => {
663
678
  const editingOwner = t2;
664
679
  let t3;
665
680
  let t4;
666
- if ($[4] !== isMobileStudio) {
681
+ if ($[4] !== isAuthenticated || $[5] !== isMobileStudio) {
667
682
  t3 = () => {
668
- if (!isMobileStudio) return;
669
- previewStore.send({ type: "hideCanvas" });
670
- previewStore.send({ type: "closeAddBlockSheet" });
683
+ if (isAuthenticated && takeShowCanvasRequest() && !isMobileStudio) previewStore.send({ type: "showCanvas" });
671
684
  };
672
- t4 = [isMobileStudio];
673
- $[4] = isMobileStudio;
674
- $[5] = t3;
675
- $[6] = t4;
685
+ t4 = [isAuthenticated, isMobileStudio];
686
+ $[4] = isAuthenticated;
687
+ $[5] = isMobileStudio;
688
+ $[6] = t3;
689
+ $[7] = t4;
676
690
  } else {
677
- t3 = $[5];
678
- t4 = $[6];
691
+ t3 = $[6];
692
+ t4 = $[7];
679
693
  }
680
694
  React.useEffect(t3, t4);
681
- useCanvasOnlyLocation(!!canvasOnly && isAuthenticated, isCanvasShown, isMobileStudio, pageLocation);
682
695
  let t5;
683
696
  let t6;
684
- if ($[7] !== isAuthenticated || $[8] !== isCanvasShown || $[9] !== isMobileStudio) {
697
+ if ($[8] !== isMobileStudio) {
685
698
  t5 = () => {
699
+ if (!isMobileStudio) return;
700
+ previewStore.send({ type: "hideCanvas" });
701
+ previewStore.send({ type: "closeAddBlockSheet" });
702
+ };
703
+ t6 = [isMobileStudio];
704
+ $[8] = isMobileStudio;
705
+ $[9] = t5;
706
+ $[10] = t6;
707
+ } else {
708
+ t5 = $[9];
709
+ t6 = $[10];
710
+ }
711
+ React.useEffect(t5, t6);
712
+ useCanvasOnlyLocation(!!canvasOnly && isAuthenticated, isCanvasShown, isMobileStudio, pageLocation);
713
+ let t7;
714
+ let t8;
715
+ if ($[11] !== isAuthenticated || $[12] !== isCanvasShown || $[13] !== isMobileStudio) {
716
+ t7 = () => {
686
717
  const actions = [
687
718
  {
688
719
  id: "hide-canvas",
@@ -732,140 +763,140 @@ const PreviewShell = (t0) => {
732
763
  });
733
764
  };
734
765
  };
735
- t6 = [
766
+ t8 = [
736
767
  isCanvasShown,
737
768
  isAuthenticated,
738
769
  isMobileStudio
739
770
  ];
740
- $[7] = isAuthenticated;
741
- $[8] = isCanvasShown;
742
- $[9] = isMobileStudio;
743
- $[10] = t5;
744
- $[11] = t6;
771
+ $[11] = isAuthenticated;
772
+ $[12] = isCanvasShown;
773
+ $[13] = isMobileStudio;
774
+ $[14] = t7;
775
+ $[15] = t8;
745
776
  } else {
746
- t5 = $[10];
747
- t6 = $[11];
777
+ t7 = $[14];
778
+ t8 = $[15];
748
779
  }
749
- React.useEffect(t5, t6);
780
+ React.useEffect(t7, t8);
750
781
  if (!isAuthenticated) {
751
- let t7;
752
- if ($[12] !== children) {
753
- t7 = /* @__PURE__ */ jsx(Fragment, { children });
754
- $[12] = children;
755
- $[13] = t7;
756
- } else t7 = $[13];
757
- return t7;
782
+ let t9;
783
+ if ($[16] !== children) {
784
+ t9 = /* @__PURE__ */ jsx(Fragment, { children });
785
+ $[16] = children;
786
+ $[17] = t9;
787
+ } else t9 = $[17];
788
+ return t9;
758
789
  }
759
- const t7 = !isCanvasShown && "bg-black";
760
- let t8;
761
- if ($[14] !== t7) {
762
- t8 = cn("bg-background relative flex h-full min-h-0 flex-1 flex-col overflow-hidden", t7);
763
- $[14] = t7;
764
- $[15] = t8;
765
- } else t8 = $[15];
766
- const t9 = pageLocation?.pathname;
767
- const t10 = !canvasOnly;
768
- const t11 = !!derivedLayout;
769
- let t12;
770
- if ($[16] !== t10 || $[17] !== t11) {
771
- t12 = /* @__PURE__ */ jsx(CanvasSidebarSkeleton, {
772
- page: t10,
773
- layoutPage: t11
790
+ const t9 = !isCanvasShown && "bg-black";
791
+ let t10;
792
+ if ($[18] !== t9) {
793
+ t10 = cn("bg-background relative flex h-full min-h-0 flex-1 flex-col overflow-hidden", t9);
794
+ $[18] = t9;
795
+ $[19] = t10;
796
+ } else t10 = $[19];
797
+ const t11 = pageLocation?.pathname;
798
+ const t12 = !canvasOnly;
799
+ const t13 = !!derivedLayout;
800
+ let t14;
801
+ if ($[20] !== t12 || $[21] !== t13) {
802
+ t14 = /* @__PURE__ */ jsx(CanvasSidebarSkeleton, {
803
+ page: t12,
804
+ layoutPage: t13
774
805
  });
775
- $[16] = t10;
776
- $[17] = t11;
777
- $[18] = t12;
778
- } else t12 = $[18];
779
- const t13 = !isCanvasEnabled;
780
- const t14 = pageData?.page;
781
- const t15 = derivedLayout?.layoutId;
782
- const t16 = pageData?.projectName;
783
- let t17;
784
- if ($[19] !== children || $[20] !== isMobileStudio || $[21] !== pageLocation || $[22] !== t13 || $[23] !== t14 || $[24] !== t15 || $[25] !== t16) {
785
- t17 = /* @__PURE__ */ jsx("div", {
806
+ $[20] = t12;
807
+ $[21] = t13;
808
+ $[22] = t14;
809
+ } else t14 = $[22];
810
+ const t15 = !isCanvasEnabled;
811
+ const t16 = pageData?.page;
812
+ const t17 = derivedLayout?.layoutId;
813
+ const t18 = pageData?.projectName;
814
+ let t19;
815
+ if ($[23] !== children || $[24] !== isMobileStudio || $[25] !== pageLocation || $[26] !== t15 || $[27] !== t16 || $[28] !== t17 || $[29] !== t18) {
816
+ t19 = /* @__PURE__ */ jsx("div", {
786
817
  className: "flex min-h-0 flex-1 flex-row items-stretch",
787
818
  children: /* @__PURE__ */ jsx(PreviewPanel, {
788
- active: t13,
819
+ active: t15,
789
820
  isMobileExperience: isMobileStudio,
790
- page: t14,
791
- layoutId: t15,
821
+ page: t16,
822
+ layoutId: t17,
792
823
  pageLocation,
793
- projectName: t16,
824
+ projectName: t18,
794
825
  children
795
826
  })
796
827
  });
797
- $[19] = children;
798
- $[20] = isMobileStudio;
799
- $[21] = pageLocation;
800
- $[22] = t13;
801
- $[23] = t14;
802
- $[24] = t15;
803
- $[25] = t16;
804
- $[26] = t17;
805
- } else t17 = $[26];
806
- let t18;
807
- if ($[27] !== isCanvasEnabled || $[28] !== pathname || $[29] !== runtimeBasePath || $[30] !== t12 || $[31] !== t17 || $[32] !== t9) {
808
- t18 = /* @__PURE__ */ jsx(CanvasPreview, {
828
+ $[23] = children;
829
+ $[24] = isMobileStudio;
830
+ $[25] = pageLocation;
831
+ $[26] = t15;
832
+ $[27] = t16;
833
+ $[28] = t17;
834
+ $[29] = t18;
835
+ $[30] = t19;
836
+ } else t19 = $[30];
837
+ let t20;
838
+ if ($[31] !== isCanvasEnabled || $[32] !== pathname || $[33] !== runtimeBasePath || $[34] !== t11 || $[35] !== t14 || $[36] !== t19) {
839
+ t20 = /* @__PURE__ */ jsx(CanvasPreview, {
809
840
  enabled: isCanvasEnabled,
810
841
  pathname,
811
- pagePathname: t9,
842
+ pagePathname: t11,
812
843
  runtimeBasePath,
813
- placeholder: t12,
814
- children: t17
844
+ placeholder: t14,
845
+ children: t19
815
846
  });
816
- $[27] = isCanvasEnabled;
817
- $[28] = pathname;
818
- $[29] = runtimeBasePath;
819
- $[30] = t12;
820
- $[31] = t17;
821
- $[32] = t9;
822
- $[33] = t18;
823
- } else t18 = $[33];
824
- let t19;
825
- if ($[34] !== isCanvasEnabled || $[35] !== pageId) {
826
- t19 = !isCanvasEnabled && /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(CreatePageModal, {}), pageId != null && /* @__PURE__ */ jsx(AddBlockSheet, {})] });
827
- $[34] = isCanvasEnabled;
828
- $[35] = pageId;
847
+ $[31] = isCanvasEnabled;
848
+ $[32] = pathname;
849
+ $[33] = runtimeBasePath;
850
+ $[34] = t11;
851
+ $[35] = t14;
829
852
  $[36] = t19;
830
- } else t19 = $[36];
831
- let t20;
832
- if ($[37] !== t18 || $[38] !== t19 || $[39] !== t8) {
833
- t20 = /* @__PURE__ */ jsxs("div", {
834
- className: t8,
835
- children: [t18, t19]
836
- });
837
- $[37] = t18;
838
- $[38] = t19;
839
- $[39] = t8;
840
- $[40] = t20;
841
- } else t20 = $[40];
853
+ $[37] = t20;
854
+ } else t20 = $[37];
842
855
  let t21;
843
- if ($[41] !== editingOwner || $[42] !== t20) {
844
- t21 = /* @__PURE__ */ jsx(PreviewEditingOwnerContext, {
845
- value: editingOwner,
846
- children: t20
856
+ if ($[38] !== isCanvasEnabled || $[39] !== pageId) {
857
+ t21 = !isCanvasEnabled && /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(CreatePageModal, {}), pageId != null && /* @__PURE__ */ jsx(AddBlockSheet, {})] });
858
+ $[38] = isCanvasEnabled;
859
+ $[39] = pageId;
860
+ $[40] = t21;
861
+ } else t21 = $[40];
862
+ let t22;
863
+ if ($[41] !== t10 || $[42] !== t20 || $[43] !== t21) {
864
+ t22 = /* @__PURE__ */ jsxs("div", {
865
+ className: t10,
866
+ children: [t20, t21]
847
867
  });
848
- $[41] = editingOwner;
868
+ $[41] = t10;
849
869
  $[42] = t20;
850
870
  $[43] = t21;
851
- } else t21 = $[43];
852
- let t22;
853
- if ($[44] !== projectUuid) {
854
- t22 = /* @__PURE__ */ jsx(ContentCollectionItemSheet, { projectUuid });
855
- $[44] = projectUuid;
856
- $[45] = t22;
857
- } else t22 = $[45];
871
+ $[44] = t22;
872
+ } else t22 = $[44];
858
873
  let t23;
859
- if ($[46] !== t21 || $[47] !== t22) {
860
- t23 = /* @__PURE__ */ jsxs(CollectionItemSheetProvider, {
874
+ if ($[45] !== editingOwner || $[46] !== t22) {
875
+ t23 = /* @__PURE__ */ jsx(PreviewEditingOwnerContext, {
876
+ value: editingOwner,
877
+ children: t22
878
+ });
879
+ $[45] = editingOwner;
880
+ $[46] = t22;
881
+ $[47] = t23;
882
+ } else t23 = $[47];
883
+ let t24;
884
+ if ($[48] !== projectUuid) {
885
+ t24 = /* @__PURE__ */ jsx(ContentCollectionItemSheet, { projectUuid });
886
+ $[48] = projectUuid;
887
+ $[49] = t24;
888
+ } else t24 = $[49];
889
+ let t25;
890
+ if ($[50] !== t23 || $[51] !== t24) {
891
+ t25 = /* @__PURE__ */ jsxs(CollectionItemSheetProvider, {
861
892
  onRouteTargetClose: _temp9,
862
- children: [t21, t22]
893
+ children: [t23, t24]
863
894
  });
864
- $[46] = t21;
865
- $[47] = t22;
866
- $[48] = t23;
867
- } else t23 = $[48];
868
- return t23;
895
+ $[50] = t23;
896
+ $[51] = t24;
897
+ $[52] = t25;
898
+ } else t25 = $[52];
899
+ return t25;
869
900
  };
870
901
  /** Zooms out to the whole Canvas, from anywhere in the site or the Studio. */
871
902
  function useShowCanvasAction() {
@@ -76,6 +76,7 @@ const AddBlockSheet = ({ focusCreatedBlock = true }) => {
76
76
  settings: variables.settings ?? null,
77
77
  slot: null,
78
78
  summary: "",
79
+ title: "",
79
80
  position,
80
81
  createdAt: now,
81
82
  updatedAt: now
@@ -4,6 +4,7 @@ import { usePageBlocks } from "../../../lib/normalized-data.js";
4
4
  import { formatShortcut } from "../../../lib/utils.js";
5
5
  import { blockMutations, repeatableItemMutations } from "../../../lib/queries.js";
6
6
  import { isBlockSelection, previewStore, selectionForPage, selectionItemId } from "../previewStore.js";
7
+ import { entityName } from "../entityName.js";
7
8
  import { useUpdateBlockPosition } from "./useUpdateBlockPosition.js";
8
9
  import { usePreviewedPage } from "../CamoxPreview.js";
9
10
  import { c } from "react/compiler-runtime";
@@ -28,7 +29,7 @@ const BlockActionsPopover = ({ block, children, open, onOpenChange, align = "sta
28
29
  const handleDeleteBlock = async (block) => {
29
30
  try {
30
31
  await deleteBlock.mutateAsync({ id: block.id });
31
- toast.success(`Deleted "${block.summary || block.type}" block`);
32
+ toast.success(`Deleted "${entityName(block, block.type)}" block`);
32
33
  } catch (error) {
33
34
  console.error("Failed to delete block:", error);
34
35
  toast.error("Could not delete block");
@@ -39,7 +40,7 @@ const BlockActionsPopover = ({ block, children, open, onOpenChange, align = "sta
39
40
  const handleDuplicateBlock = async (block) => {
40
41
  try {
41
42
  await duplicateBlock.mutateAsync({ id: block.id });
42
- toast.success(`Duplicated "${block.summary}" block`);
43
+ toast.success(`Duplicated "${entityName(block, block.type)}" block`);
43
44
  } catch (error) {
44
45
  console.error("Failed to duplicate block:", error);
45
46
  toast.error("Could not duplicate block");
@@ -209,8 +210,9 @@ const BlockActionsPopover = ({ block, children, open, onOpenChange, align = "sta
209
210
  open: !!blockToDelete,
210
211
  onOpenChange: (open) => !open && setBlockToDelete(null),
211
212
  children: /* @__PURE__ */ jsxs(AlertDialogContent, { children: [/* @__PURE__ */ jsxs(AlertDialogHeader, { children: [/* @__PURE__ */ jsx(AlertDialogTitle, { children: "Delete block" }), /* @__PURE__ */ jsxs(AlertDialogDescription, { children: [
212
- "Are you sure you want to delete ",
213
- /* @__PURE__ */ jsx("strong", { children: blockToDelete?.summary }),
213
+ "Are you sure you want to delete",
214
+ " ",
215
+ /* @__PURE__ */ jsx("strong", { children: blockToDelete && entityName(blockToDelete, blockToDelete.type) }),
214
216
  "? This action cannot be undone."
215
217
  ] })] }), /* @__PURE__ */ jsxs(AlertDialogFooter, { children: [/* @__PURE__ */ jsx(AlertDialogCancel, {
216
218
  variant: "outline",
@@ -310,7 +312,7 @@ function useBlockActionsShortcuts() {
310
312
  return;
311
313
  }
312
314
  const block_0 = pageBlocks.find((b_0) => b_0.id === sel_0.blockId);
313
- deleteBlock({ id: sel_0.blockId }).then(() => toast.success(`Deleted "${block_0?.summary || block_0?.type}" block`), _temp6);
315
+ deleteBlock({ id: sel_0.blockId }).then(() => toast.success(`Deleted "${block_0 ? entityName(block_0, block_0.type) : ""}" block`), _temp6);
314
316
  previewStore.send({ type: "clearSelection" });
315
317
  }
316
318
  },
@@ -339,7 +341,7 @@ function useBlockActionsShortcuts() {
339
341
  return;
340
342
  }
341
343
  const block_1 = pageBlocks.find((b_1) => b_1.id === sel_2.blockId);
342
- duplicateBlock({ id: sel_2.blockId }).then(() => toast.success(`Duplicated "${block_1?.summary}" block`), _temp9);
344
+ duplicateBlock({ id: sel_2.blockId }).then(() => toast.success(`Duplicated "${block_1 ? entityName(block_1, block_1.type) : ""}" block`), _temp9);
343
345
  }
344
346
  },
345
347
  {