camox 0.29.1 → 0.31.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.
@@ -282,9 +282,9 @@ function createBlock(options) {
282
282
  };
283
283
  const Embed = (t0) => {
284
284
  const $ = c(59);
285
- if ($[0] !== "7449f3ea9be4e14dfde818341dfd9ef5acd44b63f0cff7104a5c200feae79d4a") {
285
+ if ($[0] !== "16fbadb9c99d2d93df5249e83b6340f85840c1bffae0734d6a331a4171f15790") {
286
286
  for (let $i = 0; $i < 59; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
287
- $[0] = "7449f3ea9be4e14dfde818341dfd9ef5acd44b63f0cff7104a5c200feae79d4a";
287
+ $[0] = "16fbadb9c99d2d93df5249e83b6340f85840c1bffae0734d6a331a4171f15790";
288
288
  }
289
289
  const { name, children } = t0;
290
290
  const blockContext = React.use(Context);
@@ -532,9 +532,9 @@ function createBlock(options) {
532
532
  };
533
533
  const Link = (t0) => {
534
534
  const $ = c(38);
535
- if ($[0] !== "7449f3ea9be4e14dfde818341dfd9ef5acd44b63f0cff7104a5c200feae79d4a") {
535
+ if ($[0] !== "16fbadb9c99d2d93df5249e83b6340f85840c1bffae0734d6a331a4171f15790") {
536
536
  for (let $i = 0; $i < 38; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
537
- $[0] = "7449f3ea9be4e14dfde818341dfd9ef5acd44b63f0cff7104a5c200feae79d4a";
537
+ $[0] = "16fbadb9c99d2d93df5249e83b6340f85840c1bffae0734d6a331a4171f15790";
538
538
  }
539
539
  const { name, children } = t0;
540
540
  const blockContext = React.use(Context);
@@ -773,9 +773,9 @@ function createBlock(options) {
773
773
  };
774
774
  const Image = (t0) => {
775
775
  const $ = c(22);
776
- if ($[0] !== "7449f3ea9be4e14dfde818341dfd9ef5acd44b63f0cff7104a5c200feae79d4a") {
776
+ if ($[0] !== "16fbadb9c99d2d93df5249e83b6340f85840c1bffae0734d6a331a4171f15790") {
777
777
  for (let $i = 0; $i < 22; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
778
- $[0] = "7449f3ea9be4e14dfde818341dfd9ef5acd44b63f0cff7104a5c200feae79d4a";
778
+ $[0] = "16fbadb9c99d2d93df5249e83b6340f85840c1bffae0734d6a331a4171f15790";
779
779
  }
780
780
  const { name, children } = t0;
781
781
  const blockContext = React.use(Context);
@@ -897,9 +897,9 @@ function createBlock(options) {
897
897
  };
898
898
  const File = (t0) => {
899
899
  const $ = c(9);
900
- if ($[0] !== "7449f3ea9be4e14dfde818341dfd9ef5acd44b63f0cff7104a5c200feae79d4a") {
900
+ if ($[0] !== "16fbadb9c99d2d93df5249e83b6340f85840c1bffae0734d6a331a4171f15790") {
901
901
  for (let $i = 0; $i < 9; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
902
- $[0] = "7449f3ea9be4e14dfde818341dfd9ef5acd44b63f0cff7104a5c200feae79d4a";
902
+ $[0] = "16fbadb9c99d2d93df5249e83b6340f85840c1bffae0734d6a331a4171f15790";
903
903
  }
904
904
  const { name, children } = t0;
905
905
  const blockContext = React.use(Context);
@@ -974,9 +974,9 @@ function createBlock(options) {
974
974
  const FileList = _AssetList;
975
975
  const RepeaterItemWrapper = (t0) => {
976
976
  const $ = c(9);
977
- if ($[0] !== "7449f3ea9be4e14dfde818341dfd9ef5acd44b63f0cff7104a5c200feae79d4a") {
977
+ if ($[0] !== "16fbadb9c99d2d93df5249e83b6340f85840c1bffae0734d6a331a4171f15790") {
978
978
  for (let $i = 0; $i < 9; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
979
- $[0] = "7449f3ea9be4e14dfde818341dfd9ef5acd44b63f0cff7104a5c200feae79d4a";
979
+ $[0] = "16fbadb9c99d2d93df5249e83b6340f85840c1bffae0734d6a331a4171f15790";
980
980
  }
981
981
  const { itemId, blockId, mode, children } = t0;
982
982
  const isContentEditable = useIsEditable(mode);
@@ -1017,9 +1017,9 @@ function createBlock(options) {
1017
1017
  };
1018
1018
  const RepeaterHoverProvider = (t0) => {
1019
1019
  const $ = c(7);
1020
- if ($[0] !== "7449f3ea9be4e14dfde818341dfd9ef5acd44b63f0cff7104a5c200feae79d4a") {
1020
+ if ($[0] !== "16fbadb9c99d2d93df5249e83b6340f85840c1bffae0734d6a331a4171f15790") {
1021
1021
  for (let $i = 0; $i < 7; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
1022
- $[0] = "7449f3ea9be4e14dfde818341dfd9ef5acd44b63f0cff7104a5c200feae79d4a";
1022
+ $[0] = "16fbadb9c99d2d93df5249e83b6340f85840c1bffae0734d6a331a4171f15790";
1023
1023
  }
1024
1024
  const { blockId, fieldName, children } = t0;
1025
1025
  const isContentEditable = useIsEditable("site");
@@ -1050,9 +1050,9 @@ function createBlock(options) {
1050
1050
  };
1051
1051
  const Repeater = (t0) => {
1052
1052
  const $ = c(27);
1053
- if ($[0] !== "7449f3ea9be4e14dfde818341dfd9ef5acd44b63f0cff7104a5c200feae79d4a") {
1053
+ if ($[0] !== "16fbadb9c99d2d93df5249e83b6340f85840c1bffae0734d6a331a4171f15790") {
1054
1054
  for (let $i = 0; $i < 27; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
1055
- $[0] = "7449f3ea9be4e14dfde818341dfd9ef5acd44b63f0cff7104a5c200feae79d4a";
1055
+ $[0] = "16fbadb9c99d2d93df5249e83b6340f85840c1bffae0734d6a331a4171f15790";
1056
1056
  }
1057
1057
  const { name, children } = t0;
1058
1058
  const blockContext = React.use(Context);
@@ -1176,10 +1176,10 @@ function createBlock(options) {
1176
1176
  return t4;
1177
1177
  };
1178
1178
  const BlockComponent = (t0) => {
1179
- const $ = c(70);
1180
- if ($[0] !== "7449f3ea9be4e14dfde818341dfd9ef5acd44b63f0cff7104a5c200feae79d4a") {
1181
- for (let $i = 0; $i < 70; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
1182
- $[0] = "7449f3ea9be4e14dfde818341dfd9ef5acd44b63f0cff7104a5c200feae79d4a";
1179
+ const $ = c(78);
1180
+ if ($[0] !== "16fbadb9c99d2d93df5249e83b6340f85840c1bffae0734d6a331a4171f15790") {
1181
+ for (let $i = 0; $i < 78; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
1182
+ $[0] = "16fbadb9c99d2d93df5249e83b6340f85840c1bffae0734d6a331a4171f15790";
1183
1183
  }
1184
1184
  const { blockData, mode, isFirstBlock, showAddBlockTop, showAddBlockBottom, addBlockAfterPosition } = t0;
1185
1185
  const isContentEditable = useIsEditable(mode);
@@ -1189,6 +1189,7 @@ function createBlock(options) {
1189
1189
  const isPageContentSheetOpen = useSelector(previewStore, _temp7);
1190
1190
  const isAddBlockSheetOpen = useSelector(previewStore, _temp8);
1191
1191
  const isAnySideSheetOpen = useIsPreviewSheetOpen();
1192
+ const pendingAgentBlockFocus = useSelector(previewStore, _temp9);
1192
1193
  const isBlockSelected = selection?.blockId === blockData._id;
1193
1194
  const ref = React.useRef(null);
1194
1195
  const [isFirstRender, setIsFirstRender] = React.useState(true);
@@ -1208,67 +1209,100 @@ function createBlock(options) {
1208
1209
  }
1209
1210
  React.useEffect(t1, t2);
1210
1211
  let t3;
1211
- if ($[4] !== isBlockSelected || $[5] !== isFirstRender) {
1212
+ if ($[4] !== blockData._id || $[5] !== isBlockSelected || $[6] !== isFirstRender || $[7] !== pendingAgentBlockFocus?.blockId) {
1212
1213
  t3 = () => {
1213
- if (isBlockSelected && ref.current) ref.current.scrollIntoView({
1214
+ if (!isBlockSelected || !ref.current) return;
1215
+ if (pendingAgentBlockFocus?.blockId === blockData._id) return;
1216
+ ref.current.scrollIntoView({
1214
1217
  behavior: isFirstRender ? "instant" : "smooth",
1215
1218
  block: isFirstRender ? "start" : "nearest"
1216
1219
  });
1217
1220
  };
1218
- $[4] = isBlockSelected;
1219
- $[5] = isFirstRender;
1220
- $[6] = t3;
1221
- } else t3 = $[6];
1221
+ $[4] = blockData._id;
1222
+ $[5] = isBlockSelected;
1223
+ $[6] = isFirstRender;
1224
+ $[7] = pendingAgentBlockFocus?.blockId;
1225
+ $[8] = t3;
1226
+ } else t3 = $[8];
1222
1227
  let t4;
1223
- if ($[7] !== isBlockSelected || $[8] !== isFirstRender || $[9] !== isPageContentSheetOpen) {
1228
+ if ($[9] !== blockData._id || $[10] !== isBlockSelected || $[11] !== isFirstRender || $[12] !== isPageContentSheetOpen || $[13] !== pendingAgentBlockFocus) {
1224
1229
  t4 = [
1230
+ blockData._id,
1225
1231
  isBlockSelected,
1226
1232
  isFirstRender,
1227
- isPageContentSheetOpen
1233
+ isPageContentSheetOpen,
1234
+ pendingAgentBlockFocus
1228
1235
  ];
1229
- $[7] = isBlockSelected;
1230
- $[8] = isFirstRender;
1231
- $[9] = isPageContentSheetOpen;
1232
- $[10] = t4;
1233
- } else t4 = $[10];
1236
+ $[9] = blockData._id;
1237
+ $[10] = isBlockSelected;
1238
+ $[11] = isFirstRender;
1239
+ $[12] = isPageContentSheetOpen;
1240
+ $[13] = pendingAgentBlockFocus;
1241
+ $[14] = t4;
1242
+ } else t4 = $[14];
1234
1243
  React.useEffect(t3, t4);
1235
- const t5 = String(blockData._id);
1244
+ let t5;
1236
1245
  let t6;
1237
- if ($[11] !== t5) {
1238
- t6 = { blockId: t5 };
1239
- $[11] = t5;
1240
- $[12] = t6;
1241
- } else t6 = $[12];
1242
- const isHoveredFromSidebar = useOverlayMessage(iframeWindow, isContentEditable, "CAMOX_HOVER_BLOCK", "CAMOX_HOVER_BLOCK_END", t6);
1243
- let t7;
1246
+ if ($[15] !== blockData._id || $[16] !== pendingAgentBlockFocus) {
1247
+ t5 = () => {
1248
+ if (!pendingAgentBlockFocus || pendingAgentBlockFocus.blockId !== blockData._id) return;
1249
+ if (!ref.current) return;
1250
+ ref.current.scrollIntoView({
1251
+ behavior: "smooth",
1252
+ block: "nearest"
1253
+ });
1254
+ previewStore.send({
1255
+ type: "clearPendingAgentBlockFocus",
1256
+ requestId: pendingAgentBlockFocus.requestId
1257
+ });
1258
+ };
1259
+ t6 = [blockData._id, pendingAgentBlockFocus];
1260
+ $[15] = blockData._id;
1261
+ $[16] = pendingAgentBlockFocus;
1262
+ $[17] = t5;
1263
+ $[18] = t6;
1264
+ } else {
1265
+ t5 = $[17];
1266
+ t6 = $[18];
1267
+ }
1268
+ React.useEffect(t5, t6);
1269
+ const t7 = String(blockData._id);
1244
1270
  let t8;
1245
- if ($[13] !== isHoveredFromSidebar) {
1246
- t7 = () => {
1271
+ if ($[19] !== t7) {
1272
+ t8 = { blockId: t7 };
1273
+ $[19] = t7;
1274
+ $[20] = t8;
1275
+ } else t8 = $[20];
1276
+ const isHoveredFromSidebar = useOverlayMessage(iframeWindow, isContentEditable, "CAMOX_HOVER_BLOCK", "CAMOX_HOVER_BLOCK_END", t8);
1277
+ let t10;
1278
+ let t9;
1279
+ if ($[21] !== isHoveredFromSidebar) {
1280
+ t9 = () => {
1247
1281
  setIsHovered(isHoveredFromSidebar);
1248
1282
  };
1249
- t8 = [isHoveredFromSidebar];
1250
- $[13] = isHoveredFromSidebar;
1251
- $[14] = t7;
1252
- $[15] = t8;
1283
+ t10 = [isHoveredFromSidebar];
1284
+ $[21] = isHoveredFromSidebar;
1285
+ $[22] = t10;
1286
+ $[23] = t9;
1253
1287
  } else {
1254
- t7 = $[14];
1255
- t8 = $[15];
1288
+ t10 = $[22];
1289
+ t9 = $[23];
1256
1290
  }
1257
- React.useEffect(t7, t8);
1291
+ React.useEffect(t9, t10);
1258
1292
  let result;
1259
- if ($[16] !== blockData.content) {
1293
+ if ($[24] !== blockData.content) {
1260
1294
  result = { ...blockData.content };
1261
1295
  for (const key in result) {
1262
1296
  const value = result[key];
1263
- if (Array.isArray(value) && value.length > 0 && value[0]?.content !== void 0) result[key] = value.map(_temp9);
1297
+ if (Array.isArray(value) && value.length > 0 && value[0]?.content !== void 0) result[key] = value.map(_temp0);
1264
1298
  }
1265
- $[16] = blockData.content;
1266
- $[17] = result;
1267
- } else result = $[17];
1299
+ $[24] = blockData.content;
1300
+ $[25] = result;
1301
+ } else result = $[25];
1268
1302
  const normalizedContent = result;
1269
- let t9;
1270
- if ($[18] !== blockData._id || $[19] !== isContentEditable) {
1271
- t9 = (e) => {
1303
+ let t11;
1304
+ if ($[26] !== blockData._id || $[27] !== isContentEditable) {
1305
+ t11 = (e) => {
1272
1306
  if (!isContentEditable) return;
1273
1307
  if (e.target.closest("[data-camox-field-id]")) return;
1274
1308
  previewStore.send({
@@ -1276,32 +1310,32 @@ function createBlock(options) {
1276
1310
  blockId: blockData._id
1277
1311
  });
1278
1312
  };
1279
- $[18] = blockData._id;
1280
- $[19] = isContentEditable;
1281
- $[20] = t9;
1282
- } else t9 = $[20];
1283
- const handleClick = t9;
1284
- let t10;
1285
- if ($[21] !== isContentEditable) {
1286
- t10 = () => {
1313
+ $[26] = blockData._id;
1314
+ $[27] = isContentEditable;
1315
+ $[28] = t11;
1316
+ } else t11 = $[28];
1317
+ const handleClick = t11;
1318
+ let t12;
1319
+ if ($[29] !== isContentEditable) {
1320
+ t12 = () => {
1287
1321
  if (isContentEditable) setIsHovered(true);
1288
1322
  };
1289
- $[21] = isContentEditable;
1290
- $[22] = t10;
1291
- } else t10 = $[22];
1292
- const handleMouseEnter = t10;
1293
- let t11;
1294
- if ($[23] !== isContentEditable) {
1295
- t11 = () => {
1323
+ $[29] = isContentEditable;
1324
+ $[30] = t12;
1325
+ } else t12 = $[30];
1326
+ const handleMouseEnter = t12;
1327
+ let t13;
1328
+ if ($[31] !== isContentEditable) {
1329
+ t13 = () => {
1296
1330
  if (isContentEditable) setIsHovered(false);
1297
1331
  };
1298
- $[23] = isContentEditable;
1299
- $[24] = t11;
1300
- } else t11 = $[24];
1301
- const handleMouseLeave = t11;
1302
- let t12;
1303
- if ($[25] !== addBlockAfterPosition || $[26] !== blockData.position) {
1304
- t12 = (insertPosition) => {
1332
+ $[31] = isContentEditable;
1333
+ $[32] = t13;
1334
+ } else t13 = $[32];
1335
+ const handleMouseLeave = t13;
1336
+ let t14;
1337
+ if ($[33] !== addBlockAfterPosition || $[34] !== blockData.position) {
1338
+ t14 = (insertPosition) => {
1305
1339
  postOverlayMessage({
1306
1340
  type: "CAMOX_ADD_BLOCK_REQUEST",
1307
1341
  blockPosition: blockData.position,
@@ -1309,113 +1343,113 @@ function createBlock(options) {
1309
1343
  ...addBlockAfterPosition !== void 0 && { afterPosition: addBlockAfterPosition }
1310
1344
  });
1311
1345
  };
1312
- $[25] = addBlockAfterPosition;
1313
- $[26] = blockData.position;
1314
- $[27] = t12;
1315
- } else t12 = $[27];
1316
- const handleAddBlockClick = t12;
1346
+ $[33] = addBlockAfterPosition;
1347
+ $[34] = blockData.position;
1348
+ $[35] = t14;
1349
+ } else t14 = $[35];
1350
+ const handleAddBlockClick = t14;
1317
1351
  const shouldShowOverlay = isContentEditable && (isHovered || isBlockSelected) && !isAddBlockSheetOpen;
1318
1352
  const shouldShowSheetOverlay = isAddBlockSheetOpen && mode !== "peek" || isPageContentSheetOpen && !isBlockSelected;
1319
- let t13;
1320
- if ($[28] === Symbol.for("react.memo_cache_sentinel")) {
1321
- t13 = {
1353
+ let t15;
1354
+ if ($[36] === Symbol.for("react.memo_cache_sentinel")) {
1355
+ t15 = {
1322
1356
  position: "relative",
1323
1357
  scrollMargin: "5rem",
1324
1358
  background: "var(--background)"
1325
1359
  };
1326
- $[28] = t13;
1327
- } else t13 = $[28];
1328
- const t14 = isContentEditable ? blockData._id : void 0;
1329
- const t15 = shouldShowOverlay && !isBlockSelected || void 0;
1330
- const t16 = shouldShowOverlay && isBlockSelected || void 0;
1331
- const t17 = mode === "layout" ? "layout" : void 0;
1332
- const t18 = blockData._id;
1333
- let t19;
1334
- if ($[29] !== blockData.content) {
1335
- t19 = {
1360
+ $[36] = t15;
1361
+ } else t15 = $[36];
1362
+ const t16 = isContentEditable ? blockData._id : void 0;
1363
+ const t17 = shouldShowOverlay && !isBlockSelected || void 0;
1364
+ const t18 = shouldShowOverlay && isBlockSelected || void 0;
1365
+ const t19 = mode === "layout" ? "layout" : void 0;
1366
+ const t20 = blockData._id;
1367
+ let t21;
1368
+ if ($[37] !== blockData.content) {
1369
+ t21 = {
1336
1370
  ...contentDefaults,
1337
1371
  ...blockData.content
1338
1372
  };
1339
- $[29] = blockData.content;
1340
- $[30] = t19;
1341
- } else t19 = $[30];
1342
- const merged = t19;
1373
+ $[37] = blockData.content;
1374
+ $[38] = t21;
1375
+ } else t21 = $[38];
1376
+ const merged = t21;
1343
1377
  let overrides;
1344
- if ($[31] !== merged) {
1378
+ if ($[39] !== merged) {
1345
1379
  overrides = {};
1346
1380
  for (const key_0 in merged) {
1347
1381
  const val = merged[key_0];
1348
1382
  if (val && typeof val === "object" && "url" in val && !val.url && contentDefaults[key_0]) overrides[key_0] = contentDefaults[key_0];
1349
1383
  }
1350
- $[31] = merged;
1351
- $[32] = overrides;
1352
- } else overrides = $[32];
1353
- let t20;
1354
- if ($[33] !== merged || $[34] !== overrides) {
1355
- t20 = {
1356
- ...merged,
1357
- ...overrides
1358
- };
1359
- $[33] = merged;
1360
- $[34] = overrides;
1361
- $[35] = t20;
1362
- } else t20 = $[35];
1363
- const t21 = t20;
1384
+ $[39] = merged;
1385
+ $[40] = overrides;
1386
+ } else overrides = $[40];
1364
1387
  let t22;
1365
- if ($[36] !== blockData.settings) {
1388
+ if ($[41] !== merged || $[42] !== overrides) {
1366
1389
  t22 = {
1367
- ...settingsDefaults,
1368
- ...blockData.settings
1390
+ ...merged,
1391
+ ...overrides
1369
1392
  };
1370
- $[36] = blockData.settings;
1371
- $[37] = t22;
1372
- } else t22 = $[37];
1393
+ $[41] = merged;
1394
+ $[42] = overrides;
1395
+ $[43] = t22;
1396
+ } else t22 = $[43];
1373
1397
  const t23 = t22;
1374
1398
  let t24;
1375
- if ($[38] !== blockData._id || $[39] !== isHovered || $[40] !== mode || $[41] !== t21 || $[42] !== t23) {
1399
+ if ($[44] !== blockData.settings) {
1376
1400
  t24 = {
1377
- blockId: t18,
1378
- content: t21,
1379
- settings: t23,
1401
+ ...settingsDefaults,
1402
+ ...blockData.settings
1403
+ };
1404
+ $[44] = blockData.settings;
1405
+ $[45] = t24;
1406
+ } else t24 = $[45];
1407
+ const t25 = t24;
1408
+ let t26;
1409
+ if ($[46] !== blockData._id || $[47] !== isHovered || $[48] !== mode || $[49] !== t23 || $[50] !== t25) {
1410
+ t26 = {
1411
+ blockId: t20,
1412
+ content: t23,
1413
+ settings: t25,
1380
1414
  mode,
1381
1415
  isHovered,
1382
1416
  setIsHovered
1383
1417
  };
1384
- $[38] = blockData._id;
1385
- $[39] = isHovered;
1386
- $[40] = mode;
1387
- $[41] = t21;
1388
- $[42] = t23;
1389
- $[43] = t24;
1390
- } else t24 = $[43];
1391
- let t25;
1392
- if ($[44] !== normalizedContent) {
1393
- t25 = /* @__PURE__ */ jsx(options.component, { content: normalizedContent });
1394
- $[44] = normalizedContent;
1395
- $[45] = t25;
1396
- } else t25 = $[45];
1397
- let t26;
1398
- if ($[46] !== t24 || $[47] !== t25) {
1399
- t26 = /* @__PURE__ */ jsx(Context.Provider, {
1400
- value: t24,
1401
- children: t25
1402
- });
1403
- $[46] = t24;
1404
- $[47] = t25;
1405
- $[48] = t26;
1406
- } else t26 = $[48];
1418
+ $[46] = blockData._id;
1419
+ $[47] = isHovered;
1420
+ $[48] = mode;
1421
+ $[49] = t23;
1422
+ $[50] = t25;
1423
+ $[51] = t26;
1424
+ } else t26 = $[51];
1407
1425
  let t27;
1408
- if ($[49] !== shouldShowSheetOverlay) {
1409
- t27 = /* @__PURE__ */ jsx("div", {
1426
+ if ($[52] !== normalizedContent) {
1427
+ t27 = /* @__PURE__ */ jsx(options.component, { content: normalizedContent });
1428
+ $[52] = normalizedContent;
1429
+ $[53] = t27;
1430
+ } else t27 = $[53];
1431
+ let t28;
1432
+ if ($[54] !== t26 || $[55] !== t27) {
1433
+ t28 = /* @__PURE__ */ jsx(Context.Provider, {
1434
+ value: t26,
1435
+ children: t27
1436
+ });
1437
+ $[54] = t26;
1438
+ $[55] = t27;
1439
+ $[56] = t28;
1440
+ } else t28 = $[56];
1441
+ let t29;
1442
+ if ($[57] !== shouldShowSheetOverlay) {
1443
+ t29 = /* @__PURE__ */ jsx("div", {
1410
1444
  className: "camox-sheet-overlay",
1411
1445
  ...shouldShowSheetOverlay ? { "data-camox-visible": "" } : {}
1412
1446
  });
1413
- $[49] = shouldShowSheetOverlay;
1414
- $[50] = t27;
1415
- } else t27 = $[50];
1416
- let t28;
1417
- if ($[51] !== handleAddBlockClick || $[52] !== isAnySideSheetOpen || $[53] !== isFirstBlock || $[54] !== mode || $[55] !== shouldShowOverlay || $[56] !== showAddBlockBottom || $[57] !== showAddBlockTop) {
1418
- t28 = shouldShowOverlay && /* @__PURE__ */ jsxs(Fragment, { children: [(showAddBlockTop ?? (mode !== "layout" && !isFirstBlock)) && /* @__PURE__ */ jsx(AddBlockControlBar, {
1447
+ $[57] = shouldShowSheetOverlay;
1448
+ $[58] = t29;
1449
+ } else t29 = $[58];
1450
+ let t30;
1451
+ if ($[59] !== handleAddBlockClick || $[60] !== isAnySideSheetOpen || $[61] !== isFirstBlock || $[62] !== mode || $[63] !== shouldShowOverlay || $[64] !== showAddBlockBottom || $[65] !== showAddBlockTop) {
1452
+ t30 = shouldShowOverlay && /* @__PURE__ */ jsxs(Fragment, { children: [(showAddBlockTop ?? (mode !== "layout" && !isFirstBlock)) && /* @__PURE__ */ jsx(AddBlockControlBar, {
1419
1453
  position: "top",
1420
1454
  hidden: isAnySideSheetOpen,
1421
1455
  onMouseLeave: () => setIsHovered(false),
@@ -1426,47 +1460,47 @@ function createBlock(options) {
1426
1460
  onMouseLeave: () => setIsHovered(false),
1427
1461
  onClick: () => handleAddBlockClick("after")
1428
1462
  })] });
1429
- $[51] = handleAddBlockClick;
1430
- $[52] = isAnySideSheetOpen;
1431
- $[53] = isFirstBlock;
1432
- $[54] = mode;
1433
- $[55] = shouldShowOverlay;
1434
- $[56] = showAddBlockBottom;
1435
- $[57] = showAddBlockTop;
1436
- $[58] = t28;
1437
- } else t28 = $[58];
1438
- let t29;
1439
- if ($[59] !== handleClick || $[60] !== handleMouseEnter || $[61] !== handleMouseLeave || $[62] !== t14 || $[63] !== t15 || $[64] !== t16 || $[65] !== t17 || $[66] !== t26 || $[67] !== t27 || $[68] !== t28) {
1440
- t29 = /* @__PURE__ */ jsxs("div", {
1463
+ $[59] = handleAddBlockClick;
1464
+ $[60] = isAnySideSheetOpen;
1465
+ $[61] = isFirstBlock;
1466
+ $[62] = mode;
1467
+ $[63] = shouldShowOverlay;
1468
+ $[64] = showAddBlockBottom;
1469
+ $[65] = showAddBlockTop;
1470
+ $[66] = t30;
1471
+ } else t30 = $[66];
1472
+ let t31;
1473
+ if ($[67] !== handleClick || $[68] !== handleMouseEnter || $[69] !== handleMouseLeave || $[70] !== t16 || $[71] !== t17 || $[72] !== t18 || $[73] !== t19 || $[74] !== t28 || $[75] !== t29 || $[76] !== t30) {
1474
+ t31 = /* @__PURE__ */ jsxs("div", {
1441
1475
  className: "group visual-editing-block",
1442
1476
  ref,
1443
- style: t13,
1444
- "data-camox-block-id": t14,
1445
- "data-camox-hovered": t15,
1446
- "data-camox-focused": t16,
1447
- "data-camox-overlay-mode": t17,
1477
+ style: t15,
1478
+ "data-camox-block-id": t16,
1479
+ "data-camox-hovered": t17,
1480
+ "data-camox-focused": t18,
1481
+ "data-camox-overlay-mode": t19,
1448
1482
  onClick: handleClick,
1449
1483
  onMouseEnter: handleMouseEnter,
1450
1484
  onMouseLeave: handleMouseLeave,
1451
1485
  children: [
1452
- t26,
1453
- t27,
1454
- t28
1486
+ t28,
1487
+ t29,
1488
+ t30
1455
1489
  ]
1456
1490
  });
1457
- $[59] = handleClick;
1458
- $[60] = handleMouseEnter;
1459
- $[61] = handleMouseLeave;
1460
- $[62] = t14;
1461
- $[63] = t15;
1462
- $[64] = t16;
1463
- $[65] = t17;
1464
- $[66] = t26;
1465
- $[67] = t27;
1466
- $[68] = t28;
1467
- $[69] = t29;
1468
- } else t29 = $[69];
1469
- return t29;
1491
+ $[67] = handleClick;
1492
+ $[68] = handleMouseEnter;
1493
+ $[69] = handleMouseLeave;
1494
+ $[70] = t16;
1495
+ $[71] = t17;
1496
+ $[72] = t18;
1497
+ $[73] = t19;
1498
+ $[74] = t28;
1499
+ $[75] = t29;
1500
+ $[76] = t30;
1501
+ $[77] = t31;
1502
+ } else t31 = $[77];
1503
+ return t31;
1470
1504
  };
1471
1505
  const useSetting = (name) => {
1472
1506
  const ctx = React.use(Context);
@@ -1479,9 +1513,9 @@ function createBlock(options) {
1479
1513
  */
1480
1514
  const Detached = (t0) => {
1481
1515
  const $ = c(31);
1482
- if ($[0] !== "7449f3ea9be4e14dfde818341dfd9ef5acd44b63f0cff7104a5c200feae79d4a") {
1516
+ if ($[0] !== "16fbadb9c99d2d93df5249e83b6340f85840c1bffae0734d6a331a4171f15790") {
1483
1517
  for (let $i = 0; $i < 31; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
1484
- $[0] = "7449f3ea9be4e14dfde818341dfd9ef5acd44b63f0cff7104a5c200feae79d4a";
1518
+ $[0] = "16fbadb9c99d2d93df5249e83b6340f85840c1bffae0734d6a331a4171f15790";
1485
1519
  }
1486
1520
  const { children } = t0;
1487
1521
  const ctx = React.use(Context);
@@ -1489,9 +1523,9 @@ function createBlock(options) {
1489
1523
  const { blockId, mode, isHovered, setIsHovered } = ctx;
1490
1524
  const isContentEditable = useIsEditable(mode);
1491
1525
  const { window: iframeWindow } = useFrame();
1492
- const selection = useSelector(previewStore, _temp0);
1493
- const isAddBlockSheetOpen = useSelector(previewStore, _temp1);
1494
- const isPageContentSheetOpen = useSelector(previewStore, _temp10);
1526
+ const selection = useSelector(previewStore, _temp1);
1527
+ const isAddBlockSheetOpen = useSelector(previewStore, _temp10);
1528
+ const isPageContentSheetOpen = useSelector(previewStore, _temp11);
1495
1529
  const isBlockSelected = selection?.blockId === blockId;
1496
1530
  const t1 = String(blockId);
1497
1531
  let t2;
@@ -1706,16 +1740,19 @@ function _temp7(state_0) {
1706
1740
  function _temp8(state_1) {
1707
1741
  return state_1.context.isAddBlockSheetOpen;
1708
1742
  }
1709
- function _temp9(item) {
1743
+ function _temp9(state_2) {
1744
+ return state_2.context.pendingAgentBlockFocus;
1745
+ }
1746
+ function _temp0(item) {
1710
1747
  return item.content;
1711
1748
  }
1712
- function _temp0(state) {
1749
+ function _temp1(state) {
1713
1750
  return state.context.selection;
1714
1751
  }
1715
- function _temp1(state_0) {
1752
+ function _temp10(state_0) {
1716
1753
  return state_0.context.isAddBlockSheetOpen;
1717
1754
  }
1718
- function _temp10(state_1) {
1755
+ function _temp11(state_1) {
1719
1756
  return state_1.context.isPageContentSheetOpen;
1720
1757
  }
1721
1758