camox 0.71.0 → 0.74.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (104) hide show
  1. package/dist/core/createApp.d.ts +4 -103
  2. package/dist/core/createApp.js +3 -24
  3. package/dist/core/createBlock.d.ts +2 -2
  4. package/dist/core/createBlock.js +41 -185
  5. package/dist/core/createLayout.d.ts +6 -77
  6. package/dist/core/createLayout.js +12 -50
  7. package/dist/core/editing/createEditableBlock.d.ts +9 -75
  8. package/dist/core/editing/createEditableBlock.js +258 -640
  9. package/dist/core/hooks/useIsEditable.js +2 -2
  10. package/dist/core/lib/artifactData.js +8 -3
  11. package/dist/core/lib/contentType.d.ts +23 -38
  12. package/dist/core/lib/contentType.js +34 -62
  13. package/dist/core/lib/iconTypes.d.ts +0 -3
  14. package/dist/core/lib/icons.js +63 -51
  15. package/dist/core/lib/recordScope.js +1 -1
  16. package/dist/features/canvas/CanvasOverlays.js +94 -176
  17. package/dist/features/canvas/CanvasPageFrame.js +62 -68
  18. package/dist/features/canvas/CanvasPreviewPageSlot.js +1 -3
  19. package/dist/features/canvas/canvasOverlayGeometry.js +1 -7
  20. package/dist/features/canvas/sidebar/CuratedPageInspector.js +3 -21
  21. package/dist/features/canvas/sidebar/LayoutPageBlocks.js +1 -2
  22. package/dist/features/canvas/useCanvasCamera.js +1 -1
  23. package/dist/features/canvas/useCanvasFrame.js +1 -1
  24. package/dist/features/content/ContentCollection.js +2 -2
  25. package/dist/features/content/collection-form.js +6 -7
  26. package/dist/features/page/CuratedPageContent.js +15 -24
  27. package/dist/features/page/UnplacedBlockContent.js +1 -6
  28. package/dist/features/preview/CamoxPreview.js +30 -33
  29. package/dist/features/preview/EditablePageContent.js +131 -151
  30. package/dist/features/preview/components/BlockActionsPopover.js +43 -152
  31. package/dist/features/preview/components/CanvasPreview.js +2 -2
  32. package/dist/features/preview/components/Frame.js +3 -3
  33. package/dist/features/preview/components/IconFieldEditor.js +1 -1
  34. package/dist/features/preview/components/ItemFieldsEditor.js +1 -3
  35. package/dist/features/preview/components/Overlays.js +18 -84
  36. package/dist/features/preview/components/PageInfo.js +121 -98
  37. package/dist/features/preview/components/PageTree.js +57 -103
  38. package/dist/features/preview/components/PreviewPanel.js +8 -11
  39. package/dist/features/preview/components/RecordCombobox.js +65 -78
  40. package/dist/features/preview/components/ReferenceFieldEditor.js +1 -19
  41. package/dist/features/preview/components/ReferenceListFieldEditor.js +1 -19
  42. package/dist/features/preview/components/RemovedBlockPlaceholder.js +2 -2
  43. package/dist/features/preview/components/SelectionEditor.js +6 -5
  44. package/dist/features/preview/components/useRepeatableItemActions.js +18 -24
  45. package/dist/features/preview/components/useUpdateBlockPosition.js +1 -1
  46. package/dist/features/preview/overlayMessages.js +1 -4
  47. package/dist/features/preview/previewStore.js +3 -23
  48. package/dist/features/renderer/RendererApp.js +17 -141
  49. package/dist/features/renderer/definitionAnswers.js +1 -8
  50. package/dist/features/renderer/rendererHost.js +1 -31
  51. package/dist/features/renderer/studioConnection.js +1 -25
  52. package/dist/features/routes/pageRuntime.js +15 -4
  53. package/dist/features/runtime/ClaimCard.js +192 -0
  54. package/dist/features/runtime/pageApp.js +5 -4
  55. package/dist/features/runtime/runtime.js +29 -8
  56. package/dist/features/runtime/worker.js +2 -2
  57. package/dist/features/runtime/workerRequest.d.ts +6 -0
  58. package/dist/features/runtime/workerRequest.js +13 -1
  59. package/dist/features/runtime/workerRuntime.d.ts +2 -2
  60. package/dist/features/runtime/workerRuntime.js +2 -2
  61. package/dist/features/studio/components/AgentSidebar.js +7 -7
  62. package/dist/features/studio/components/ChatWidget.js +142 -106
  63. package/dist/features/studio/components/ContentFindings.js +127 -230
  64. package/dist/features/studio/components/DeleteDraftDialog.js +112 -0
  65. package/dist/features/studio/components/DraftBar.js +98 -53
  66. package/dist/features/studio/components/DraftsControl.js +203 -190
  67. package/dist/features/studio/components/ReviewDraftDialog.js +670 -0
  68. package/dist/features/studio/components/{Patrol.js → Specialists.js} +291 -330
  69. package/dist/features/studio/components/Squareling.js +5 -5
  70. package/dist/features/studio/components/ThreadComposer.js +106 -127
  71. package/dist/features/studio/components/ThreadMessages.js +137 -45
  72. package/dist/features/studio/findingSentence.js +14 -12
  73. package/dist/features/studio/fixMessage.js +23 -0
  74. package/dist/features/studio/reportSentence.js +1 -1
  75. package/dist/features/studio/{patrollerBio.js → specialistBio.js} +8 -5
  76. package/dist/features/studio/studioStore.js +29 -15
  77. package/dist/features/studio/workingSentence.js +1 -1
  78. package/dist/features/vite/blockBoilerplate.js +1 -1
  79. package/dist/features/vite/definitionsSync.js +1 -8
  80. package/dist/lib/api-client.js +5 -1
  81. package/dist/lib/queries.js +5 -6
  82. package/dist/lib/studio-definitions.js +0 -2
  83. package/dist/lib/studio-reads.d.ts +1 -1
  84. package/dist/lib/studio-reads.js +5 -10
  85. package/dist/lib/use-thread.js +196 -138
  86. package/dist/package.js +1 -1
  87. package/dist/studio-overlays.css +0 -29
  88. package/dist/studio.css +1 -1
  89. package/package.json +4 -4
  90. package/skills/camox/SKILL.md +1 -1
  91. package/skills/camox/references/artifacts.md +4 -4
  92. package/skills/camox/references/block-definitions.md +21 -25
  93. package/skills/camox/references/dom-integrations.md +1 -1
  94. package/skills/camox/references/layout-definitions.md +3 -12
  95. package/skills/camox/references/routed-layouts.md +2 -2
  96. package/skills/camox-expand/SKILL.md +5 -5
  97. package/skills/camoxify/SKILL.md +4 -4
  98. package/dist/features/canvas/canvasInsertionSeams.js +0 -44
  99. package/dist/features/preview/components/AddBlockSheet.js +0 -314
  100. package/dist/features/preview/components/BlockPeek.js +0 -66
  101. package/dist/features/preview/components/BlockThumbnail.js +0 -281
  102. package/dist/features/preview/components/blockGridNavigation.js +0 -15
  103. package/dist/features/preview/referencePickerFocus.js +0 -29
  104. package/dist/features/studio/components/ReviewDraftSheet.js +0 -1587
@@ -16,6 +16,7 @@ import { useRendererAnswer } from "../../renderer/RendererFrames.js";
16
16
  import { PageLocationFieldset } from "./PageLocationFieldset.js";
17
17
  import { PageNicknameField } from "./PageNicknameField.js";
18
18
  import { pageImageUrl } from "../../og/pageImage.js";
19
+ import { ContentFindings, useContentFindings } from "../../studio/components/ContentFindings.js";
19
20
  import { ShikiMarkdown } from "./ShikiMarkdown.js";
20
21
  import { c } from "react/compiler-runtime";
21
22
  import * as React from "react";
@@ -1094,7 +1095,7 @@ const PageSeoContent = (t0) => {
1094
1095
  return t1;
1095
1096
  };
1096
1097
  const PageSeoEditor = (t0) => {
1097
- const $ = c(41);
1098
+ const $ = c(46);
1098
1099
  const { page, metaTitle } = t0;
1099
1100
  let t1;
1100
1101
  if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
@@ -1104,149 +1105,171 @@ const PageSeoEditor = (t0) => {
1104
1105
  const setSeo = useMutation(t1);
1105
1106
  const localized = useLocalizedPath();
1106
1107
  let t2;
1107
- if ($[1] !== page.id || $[2] !== setSeo) {
1108
- t2 = (checked) => {
1108
+ if ($[1] !== page.id) {
1109
+ t2 = {
1110
+ entity: "page",
1111
+ id: page.id
1112
+ };
1113
+ $[1] = page.id;
1114
+ $[2] = t2;
1115
+ } else t2 = $[2];
1116
+ const findings = useContentFindings(t2);
1117
+ let t3;
1118
+ if ($[3] !== page.id || $[4] !== setSeo) {
1119
+ t3 = (checked) => {
1109
1120
  setSeo.mutate({
1110
1121
  id: page.id,
1111
1122
  aiSeo: checked
1112
1123
  });
1113
1124
  };
1114
- $[1] = page.id;
1115
- $[2] = setSeo;
1116
- $[3] = t2;
1117
- } else t2 = $[3];
1118
- let t3;
1119
- if ($[4] !== page.aiSeo || $[5] !== t2) {
1120
- t3 = /* @__PURE__ */ jsx(Switch, {
1125
+ $[3] = page.id;
1126
+ $[4] = setSeo;
1127
+ $[5] = t3;
1128
+ } else t3 = $[5];
1129
+ let t4;
1130
+ if ($[6] !== page.aiSeo || $[7] !== t3) {
1131
+ t4 = /* @__PURE__ */ jsx(Switch, {
1121
1132
  id: "ai-seo",
1122
1133
  checked: page.aiSeo,
1123
- onCheckedChange: t2
1134
+ onCheckedChange: t3
1124
1135
  });
1125
- $[4] = page.aiSeo;
1126
- $[5] = t2;
1127
- $[6] = t3;
1128
- } else t3 = $[6];
1129
- let t4;
1130
- if ($[7] === Symbol.for("react.memo_cache_sentinel")) {
1131
- t4 = /* @__PURE__ */ jsx(Label, {
1136
+ $[6] = page.aiSeo;
1137
+ $[7] = t3;
1138
+ $[8] = t4;
1139
+ } else t4 = $[8];
1140
+ let t5;
1141
+ if ($[9] === Symbol.for("react.memo_cache_sentinel")) {
1142
+ t5 = /* @__PURE__ */ jsx(Label, {
1132
1143
  htmlFor: "ai-seo",
1133
1144
  children: "AI metadata"
1134
1145
  });
1135
- $[7] = t4;
1136
- } else t4 = $[7];
1137
- let t5;
1138
- if ($[8] !== t3) {
1139
- t5 = /* @__PURE__ */ jsxs("div", {
1140
- className: "flex items-center gap-2",
1141
- children: [t3, t4]
1142
- });
1143
- $[8] = t3;
1144
1146
  $[9] = t5;
1145
1147
  } else t5 = $[9];
1146
- const t6 = page.metaTitle ?? "";
1147
- let t7;
1148
- if ($[10] !== page.id || $[11] !== setSeo) {
1149
- t7 = (value) => setSeo.mutate({
1148
+ let t6;
1149
+ if ($[10] !== t4) {
1150
+ t6 = /* @__PURE__ */ jsxs("div", {
1151
+ className: "flex items-center gap-2",
1152
+ children: [t4, t5]
1153
+ });
1154
+ $[10] = t4;
1155
+ $[11] = t6;
1156
+ } else t6 = $[11];
1157
+ const t7 = page.metaTitle ?? "";
1158
+ let t8;
1159
+ if ($[12] !== page.id || $[13] !== setSeo) {
1160
+ t8 = (value) => setSeo.mutate({
1150
1161
  id: page.id,
1151
1162
  metaTitle: value
1152
1163
  });
1153
- $[10] = page.id;
1154
- $[11] = setSeo;
1155
- $[12] = t7;
1156
- } else t7 = $[12];
1157
- let t8;
1158
- if ($[13] !== page.aiSeo || $[14] !== t6 || $[15] !== t7) {
1159
- t8 = /* @__PURE__ */ jsx(DebouncedFieldEditor, {
1164
+ $[12] = page.id;
1165
+ $[13] = setSeo;
1166
+ $[14] = t8;
1167
+ } else t8 = $[14];
1168
+ let t9;
1169
+ if ($[15] !== page.aiSeo || $[16] !== t7 || $[17] !== t8) {
1170
+ t9 = /* @__PURE__ */ jsx(DebouncedFieldEditor, {
1160
1171
  label: "Page title",
1161
1172
  placeholder: "Page title...",
1162
- initialValue: t6,
1173
+ initialValue: t7,
1163
1174
  disabled: page.aiSeo,
1164
- onSave: t7
1175
+ onSave: t8
1165
1176
  });
1166
- $[13] = page.aiSeo;
1167
- $[14] = t6;
1168
- $[15] = t7;
1169
- $[16] = t8;
1170
- } else t8 = $[16];
1171
- const t9 = page.metaDescription ?? "";
1177
+ $[15] = page.aiSeo;
1178
+ $[16] = t7;
1179
+ $[17] = t8;
1180
+ $[18] = t9;
1181
+ } else t9 = $[18];
1172
1182
  let t10;
1173
- if ($[17] !== page.id || $[18] !== setSeo) {
1174
- t10 = (value_0) => setSeo.mutate({
1183
+ if ($[19] !== findings) {
1184
+ t10 = /* @__PURE__ */ jsx(ContentFindings, {
1185
+ view: findings,
1186
+ field: "metaTitle",
1187
+ className: "space-y-2"
1188
+ });
1189
+ $[19] = findings;
1190
+ $[20] = t10;
1191
+ } else t10 = $[20];
1192
+ const t11 = page.metaDescription ?? "";
1193
+ let t12;
1194
+ if ($[21] !== page.id || $[22] !== setSeo) {
1195
+ t12 = (value_0) => setSeo.mutate({
1175
1196
  id: page.id,
1176
1197
  metaDescription: value_0
1177
1198
  });
1178
- $[17] = page.id;
1179
- $[18] = setSeo;
1180
- $[19] = t10;
1181
- } else t10 = $[19];
1182
- let t11;
1183
- if ($[20] !== page.aiSeo || $[21] !== t10 || $[22] !== t9) {
1184
- t11 = /* @__PURE__ */ jsx(DebouncedFieldEditor, {
1199
+ $[21] = page.id;
1200
+ $[22] = setSeo;
1201
+ $[23] = t12;
1202
+ } else t12 = $[23];
1203
+ let t13;
1204
+ if ($[24] !== page.aiSeo || $[25] !== t11 || $[26] !== t12) {
1205
+ t13 = /* @__PURE__ */ jsx(DebouncedFieldEditor, {
1185
1206
  label: "Page description",
1186
1207
  placeholder: "Page description...",
1187
- initialValue: t9,
1208
+ initialValue: t11,
1188
1209
  disabled: page.aiSeo,
1189
1210
  rows: 2,
1190
- onSave: t10
1211
+ onSave: t12
1191
1212
  });
1192
- $[20] = page.aiSeo;
1193
- $[21] = t10;
1194
- $[22] = t9;
1195
- $[23] = t11;
1196
- } else t11 = $[23];
1197
- let t12;
1198
- if ($[24] !== localized || $[25] !== page.fullPath) {
1199
- t12 = localized(page.fullPath);
1200
- $[24] = localized;
1201
- $[25] = page.fullPath;
1213
+ $[24] = page.aiSeo;
1214
+ $[25] = t11;
1202
1215
  $[26] = t12;
1203
- } else t12 = $[26];
1204
- const t13 = page.metaDescription ?? "";
1216
+ $[27] = t13;
1217
+ } else t13 = $[27];
1205
1218
  let t14;
1206
- if ($[27] !== metaTitle || $[28] !== t12 || $[29] !== t13) {
1207
- t14 = /* @__PURE__ */ jsx(SearchEnginePreview, {
1208
- path: t12,
1209
- metaTitle,
1210
- metaDescription: t13
1211
- });
1212
- $[27] = metaTitle;
1213
- $[28] = t12;
1214
- $[29] = t13;
1219
+ if ($[28] !== localized || $[29] !== page.fullPath) {
1220
+ t14 = localized(page.fullPath);
1221
+ $[28] = localized;
1222
+ $[29] = page.fullPath;
1215
1223
  $[30] = t14;
1216
1224
  } else t14 = $[30];
1217
1225
  const t15 = page.metaDescription ?? "";
1218
1226
  let t16;
1219
- if ($[31] !== metaTitle || $[32] !== page || $[33] !== t15) {
1220
- t16 = /* @__PURE__ */ jsx(SocialPreviewSection, {
1221
- page,
1227
+ if ($[31] !== metaTitle || $[32] !== t14 || $[33] !== t15) {
1228
+ t16 = /* @__PURE__ */ jsx(SearchEnginePreview, {
1229
+ path: t14,
1222
1230
  metaTitle,
1223
1231
  metaDescription: t15
1224
1232
  });
1225
1233
  $[31] = metaTitle;
1226
- $[32] = page;
1234
+ $[32] = t14;
1227
1235
  $[33] = t15;
1228
1236
  $[34] = t16;
1229
1237
  } else t16 = $[34];
1230
- let t17;
1231
- if ($[35] !== t11 || $[36] !== t14 || $[37] !== t16 || $[38] !== t5 || $[39] !== t8) {
1232
- t17 = /* @__PURE__ */ jsxs("div", {
1238
+ const t17 = page.metaDescription ?? "";
1239
+ let t18;
1240
+ if ($[35] !== metaTitle || $[36] !== page || $[37] !== t17) {
1241
+ t18 = /* @__PURE__ */ jsx(SocialPreviewSection, {
1242
+ page,
1243
+ metaTitle,
1244
+ metaDescription: t17
1245
+ });
1246
+ $[35] = metaTitle;
1247
+ $[36] = page;
1248
+ $[37] = t17;
1249
+ $[38] = t18;
1250
+ } else t18 = $[38];
1251
+ let t19;
1252
+ if ($[39] !== t10 || $[40] !== t13 || $[41] !== t16 || $[42] !== t18 || $[43] !== t6 || $[44] !== t9) {
1253
+ t19 = /* @__PURE__ */ jsxs("div", {
1233
1254
  className: "space-y-4",
1234
1255
  children: [
1235
- t5,
1236
- t8,
1237
- t11,
1238
- t14,
1239
- t16
1256
+ t6,
1257
+ t9,
1258
+ t10,
1259
+ t13,
1260
+ t16,
1261
+ t18
1240
1262
  ]
1241
1263
  });
1242
- $[35] = t11;
1243
- $[36] = t14;
1244
- $[37] = t16;
1245
- $[38] = t5;
1246
- $[39] = t8;
1247
- $[40] = t17;
1248
- } else t17 = $[40];
1249
- return t17;
1264
+ $[39] = t10;
1265
+ $[40] = t13;
1266
+ $[41] = t16;
1267
+ $[42] = t18;
1268
+ $[43] = t6;
1269
+ $[44] = t9;
1270
+ $[45] = t19;
1271
+ } else t19 = $[45];
1272
+ return t19;
1250
1273
  };
1251
1274
  const PageMarkdownSheet = (t0) => {
1252
1275
  const $ = c(8);
@@ -10,11 +10,11 @@ import { BlockActionsPopover } from "./BlockActionsPopover.js";
10
10
  import { usePreviewedPage } from "../CamoxPreview.js";
11
11
  import { c } from "react/compiler-runtime";
12
12
  import * as React from "react";
13
- import { Fragment, jsx, jsxs } from "react/jsx-runtime";
13
+ import { jsx, jsxs } from "react/jsx-runtime";
14
14
  import { useSelector } from "@xstate/store-react";
15
15
  import { Button } from "@camox/ui/button";
16
16
  import { Label } from "@camox/ui/label";
17
- import { ChevronsUpDown, Ellipsis, GripVertical, LayoutTemplate, Plus } from "lucide-react";
17
+ import { ChevronsUpDown, Ellipsis, GripVertical, LayoutTemplate } from "lucide-react";
18
18
  import { Tooltip, TooltipContent, TooltipTrigger } from "@camox/ui/tooltip";
19
19
  import { DndContext, DragOverlay, KeyboardSensor, PointerSensor, closestCenter, useSensor, useSensors } from "@dnd-kit/core";
20
20
  import { restrictToVerticalAxis } from "@dnd-kit/modifiers";
@@ -375,98 +375,76 @@ const SortableBlock = (t0) => {
375
375
  return t17;
376
376
  };
377
377
  const LayoutBlockItem = (t0) => {
378
- const $ = c(23);
379
- const { block, layoutName, withActions: t1 } = t0;
380
- const withActions = t1 === void 0 ? true : t1;
378
+ const $ = c(17);
379
+ const { block, layoutName } = t0;
381
380
  const blockDef = useBlockDefinition(block.type);
382
381
  const ctx = useBlockTreeItem(block);
383
382
  const displayText = blockDef?.title ?? block.type;
384
- let t2;
383
+ let t1;
385
384
  if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
386
- t2 = /* @__PURE__ */ jsx(TooltipTrigger, { children: /* @__PURE__ */ jsx(LayoutTemplate, { className: "h-4 w-4" }) });
387
- $[0] = t2;
388
- } else t2 = $[0];
389
- let t3;
385
+ t1 = /* @__PURE__ */ jsx(TooltipTrigger, { children: /* @__PURE__ */ jsx(LayoutTemplate, { className: "h-4 w-4" }) });
386
+ $[0] = t1;
387
+ } else t1 = $[0];
388
+ let t2;
390
389
  if ($[1] !== layoutName) {
391
- t3 = /* @__PURE__ */ jsx("span", {
390
+ t2 = /* @__PURE__ */ jsx("span", {
392
391
  className: "font-semibold",
393
392
  children: layoutName
394
393
  });
395
394
  $[1] = layoutName;
396
- $[2] = t3;
397
- } else t3 = $[2];
398
- let t4;
395
+ $[2] = t2;
396
+ } else t2 = $[2];
397
+ let t3;
399
398
  if ($[3] === Symbol.for("react.memo_cache_sentinel")) {
400
- t4 = /* @__PURE__ */ jsx("br", {});
401
- $[3] = t4;
402
- } else t4 = $[3];
403
- const t5 = blockDef?.synced ? "Synced: editing this block updates it across all layouts and pages" : "Changing the content may affect other pages";
404
- let t6;
405
- if ($[4] !== t3 || $[5] !== t5) {
406
- t6 = /* @__PURE__ */ jsx("div", {
399
+ t3 = /* @__PURE__ */ jsx("br", {});
400
+ $[3] = t3;
401
+ } else t3 = $[3];
402
+ const t4 = blockDef?.synced ? "Synced: editing this block updates it across all layouts and pages" : "Changing the content may affect other pages";
403
+ let t5;
404
+ if ($[4] !== t2 || $[5] !== t4) {
405
+ t5 = /* @__PURE__ */ jsx("div", {
407
406
  className: "text-muted-foreground flex size-8 shrink-0 items-center justify-center",
408
- children: /* @__PURE__ */ jsxs(Tooltip, { children: [t2, /* @__PURE__ */ jsxs(TooltipContent, { children: [
407
+ children: /* @__PURE__ */ jsxs(Tooltip, { children: [t1, /* @__PURE__ */ jsxs(TooltipContent, { children: [
409
408
  "From ",
410
- t3,
409
+ t2,
411
410
  " layout.",
412
- t4,
413
- t5
411
+ t3,
412
+ t4
414
413
  ] })] })
415
414
  });
416
- $[4] = t3;
417
- $[5] = t5;
418
- $[6] = t6;
419
- } else t6 = $[6];
420
- let t7;
415
+ $[4] = t2;
416
+ $[5] = t4;
417
+ $[6] = t5;
418
+ } else t5 = $[6];
419
+ let t6;
421
420
  if ($[7] !== ctx.toggleSelection || $[8] !== displayText) {
422
- t7 = /* @__PURE__ */ jsx(BlockTreeItemTrigger, {
421
+ t6 = /* @__PURE__ */ jsx(BlockTreeItemTrigger, {
423
422
  displayText,
424
423
  onClick: ctx.toggleSelection
425
424
  });
426
425
  $[7] = ctx.toggleSelection;
427
426
  $[8] = displayText;
428
- $[9] = t7;
429
- } else t7 = $[9];
430
- let t8;
431
- if ($[10] !== block || $[11] !== ctx.ellipsisPopoverOpen || $[12] !== ctx.setEllipsisPopoverOpen || $[13] !== withActions) {
432
- t8 = withActions && /* @__PURE__ */ jsx(BlockActionsPopover, {
433
- block,
434
- open: ctx.ellipsisPopoverOpen,
435
- onOpenChange: ctx.setEllipsisPopoverOpen,
436
- isLayoutBlock: true,
437
- layoutSlot: block.slot,
438
- children: /* @__PURE__ */ jsx(BlockTreeItemEllipsis, { open: ctx.ellipsisPopoverOpen })
439
- });
440
- $[10] = block;
441
- $[11] = ctx.ellipsisPopoverOpen;
442
- $[12] = ctx.setEllipsisPopoverOpen;
443
- $[13] = withActions;
444
- $[14] = t8;
445
- } else t8 = $[14];
446
- let t9;
447
- if ($[15] !== ctx.handleBlockMouseEnter || $[16] !== ctx.handleBlockMouseLeave || $[17] !== ctx.shouldShowActive || $[18] !== ctx.shouldShowHover || $[19] !== t6 || $[20] !== t7 || $[21] !== t8) {
448
- t9 = /* @__PURE__ */ jsxs(BlockTreeItemHeader, {
427
+ $[9] = t6;
428
+ } else t6 = $[9];
429
+ let t7;
430
+ if ($[10] !== ctx.handleBlockMouseEnter || $[11] !== ctx.handleBlockMouseLeave || $[12] !== ctx.shouldShowActive || $[13] !== ctx.shouldShowHover || $[14] !== t5 || $[15] !== t6) {
431
+ t7 = /* @__PURE__ */ jsxs(BlockTreeItemHeader, {
449
432
  className: "group",
450
433
  shouldShowHover: ctx.shouldShowHover,
451
434
  shouldShowActive: ctx.shouldShowActive,
452
435
  onMouseEnter: ctx.handleBlockMouseEnter,
453
436
  onMouseLeave: ctx.handleBlockMouseLeave,
454
- children: [
455
- t6,
456
- t7,
457
- t8
458
- ]
437
+ children: [t5, t6]
459
438
  });
460
- $[15] = ctx.handleBlockMouseEnter;
461
- $[16] = ctx.handleBlockMouseLeave;
462
- $[17] = ctx.shouldShowActive;
463
- $[18] = ctx.shouldShowHover;
464
- $[19] = t6;
465
- $[20] = t7;
466
- $[21] = t8;
467
- $[22] = t9;
468
- } else t9 = $[22];
469
- return t9;
439
+ $[10] = ctx.handleBlockMouseEnter;
440
+ $[11] = ctx.handleBlockMouseLeave;
441
+ $[12] = ctx.shouldShowActive;
442
+ $[13] = ctx.shouldShowHover;
443
+ $[14] = t5;
444
+ $[15] = t6;
445
+ $[16] = t7;
446
+ } else t7 = $[16];
447
+ return t7;
470
448
  };
471
449
  /** A sidebar field labelled "Blocks", holding a page's blocks and what acts on them. */
472
450
  const BlocksGroup = (t0) => {
@@ -577,7 +555,7 @@ const CollapsedPageTree = (t0) => {
577
555
  };
578
556
  /** A page's blocks. When `collapsible`, they start collapsed behind a toggle showing their count. */
579
557
  const PageTree = (t0) => {
580
- const $ = c(48);
558
+ const $ = c(45);
581
559
  const { collapsible: t1 } = t0;
582
560
  const collapsible = t1 === void 0 ? false : t1;
583
561
  const page = usePreviewedPage();
@@ -784,40 +762,19 @@ const PageTree = (t0) => {
784
762
  $[41] = t17;
785
763
  } else t17 = $[41];
786
764
  const list = t17;
787
- let t18;
788
- if ($[42] === Symbol.for("react.memo_cache_sentinel")) {
789
- t18 = /* @__PURE__ */ jsxs(Button, {
790
- variant: "secondary",
791
- onClick: _temp4,
792
- children: [/* @__PURE__ */ jsx(Plus, {}), "Add block"]
793
- });
794
- $[42] = t18;
795
- } else t18 = $[42];
796
- const addBlockButton = t18;
797
- if (!collapsible) {
798
- let t19;
799
- if ($[43] !== list) {
800
- t19 = /* @__PURE__ */ jsxs(Fragment, { children: [list, addBlockButton] });
801
- $[43] = list;
802
- $[44] = t19;
803
- } else t19 = $[44];
804
- return t19;
805
- }
765
+ if (!collapsible) return list;
806
766
  const blockCount = layoutBeforeBlocks.length + pageBlocks.length + layoutAfterBlocks.length;
807
- let t19;
808
- if ($[45] !== blockCount || $[46] !== list) {
809
- t19 = /* @__PURE__ */ jsx(BlocksGroup, { children: /* @__PURE__ */ jsxs("div", {
810
- className: "flex flex-col gap-1",
811
- children: [/* @__PURE__ */ jsx(CollapsedPageTree, {
812
- blockCount,
813
- children: list
814
- }), addBlockButton]
767
+ let t18;
768
+ if ($[42] !== blockCount || $[43] !== list) {
769
+ t18 = /* @__PURE__ */ jsx(BlocksGroup, { children: /* @__PURE__ */ jsx(CollapsedPageTree, {
770
+ blockCount,
771
+ children: list
815
772
  }) });
816
- $[45] = blockCount;
817
- $[46] = list;
818
- $[47] = t19;
819
- } else t19 = $[47];
820
- return t19;
773
+ $[42] = blockCount;
774
+ $[43] = list;
775
+ $[44] = t18;
776
+ } else t18 = $[44];
777
+ return t18;
821
778
  };
822
779
  function _temp(value) {
823
780
  return !value;
@@ -828,9 +785,6 @@ function _temp2(block_2) {
828
785
  function _temp3(block_3) {
829
786
  return /* @__PURE__ */ jsx(SortableBlock, { block: block_3 }, block_3.id);
830
787
  }
831
- function _temp4() {
832
- previewStore.send({ type: "openAddBlockSheet" });
833
- }
834
788
 
835
789
  //#endregion
836
790
  export { BlocksGroup, CollapsedPageTree, LayoutBlockItem, PageTree };
@@ -6,13 +6,13 @@ import { useEditingFrameClaim, useEditingOwner } from "../editingFrame.js";
6
6
  import { EditableSurfaceContext } from "../../../core/hooks/useIsEditable.js";
7
7
  import { CanvasWorkspaceContext } from "../../canvas/canvasZoom.js";
8
8
  import { PreviewEditingOwnerContext } from "../previewSelection.js";
9
- import { Frame, useFrame } from "./Frame.js";
10
9
  import { previewPageIframeProps, usePreviewPageFrame } from "../previewPageFrame.js";
11
10
  import { adoptCanvasDocument, pauseCanvasDocument } from "../../canvas/canvasFrameDocument.js";
12
11
  import { forwardCanvasWheel, useCanvasFrameInput } from "../../canvas/useCanvasFrameInput.js";
13
12
  import { useActionShortcuts } from "../../provider/useAdminShortcuts.js";
14
13
  import { guardStrayCaret } from "../strayCaretGuard.js";
15
14
  import { useBlockActionsShortcuts } from "./BlockActionsPopover.js";
15
+ import { Frame, useFrame } from "./Frame.js";
16
16
  import { FieldOverlayStyles } from "./FieldOverlayStyles.js";
17
17
  import { MobilePreviewDrawer } from "./MobilePreviewDrawer.js";
18
18
  import { Overlays } from "./Overlays.js";
@@ -114,7 +114,7 @@ function CuratedBlockShortcuts() {
114
114
  * when used, pauses with the camera, and draws its editing overlays.
115
115
  */
116
116
  function PreviewPageCanvasEffects(t0) {
117
- const $ = c(31);
117
+ const $ = c(30);
118
118
  const { owner } = t0;
119
119
  const { window: frameWindow, iframeElement } = useFrame();
120
120
  const { frame, slot, inCanvas } = usePreviewPageFrame();
@@ -261,25 +261,22 @@ function PreviewPageCanvasEffects(t0) {
261
261
  t12 = $[25];
262
262
  t13 = $[26];
263
263
  }
264
- const t14 = owner?.kind === "page";
265
- let t15;
266
- if ($[27] !== iframeElement || $[28] !== owner || $[29] !== t14) {
267
- t15 = /* @__PURE__ */ jsxs(Fragment, { children: [
264
+ let t14;
265
+ if ($[27] !== iframeElement || $[28] !== owner) {
266
+ t14 = /* @__PURE__ */ jsxs(Fragment, { children: [
268
267
  t11,
269
268
  t12,
270
269
  t13,
271
270
  /* @__PURE__ */ jsx(Overlays, {
272
271
  frame: iframeElement,
273
- owner,
274
- canAddBlocks: t14
272
+ owner
275
273
  })
276
274
  ] });
277
275
  $[27] = iframeElement;
278
276
  $[28] = owner;
279
277
  $[29] = t14;
280
- $[30] = t15;
281
- } else t15 = $[30];
282
- return t15;
278
+ } else t14 = $[29];
279
+ return t14;
283
280
  }
284
281
  function _temp(event) {
285
282
  if (event.target?.closest?.("a")) event.preventDefault();