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.
- package/dist/core/createBlock.js +235 -198
- package/dist/features/agent-chat/agent-chat-labels.js +200 -0
- package/dist/features/agent-chat/components/AgentChatSheet.js +207 -0
- package/dist/features/agent-chat/components/AgentChatThread.js +594 -0
- package/dist/features/agent-chat/components/AgentToolCallCard.js +141 -0
- package/dist/features/preview/CamoxPreview.js +60 -13
- package/dist/features/preview/components/CreatePageModal.js +257 -121
- package/dist/features/preview/components/PageNicknameField.js +3 -3
- package/dist/features/preview/components/PreviewPanel.js +29 -6
- package/dist/features/preview/components/PreviewSideSheet.js +20 -16
- package/dist/features/preview/previewStore.js +49 -8
- package/dist/features/provider/components/CommandPalette.js +6 -4
- package/dist/features/studio/components/Navbar.js +14 -7
- package/dist/features/studio/useTheme.js +14 -6
- package/dist/features/vite/vite.js +1 -0
- package/dist/lib/auth.js +18 -12
- package/dist/studio.css +1 -1
- package/package.json +6 -4
- package/dist/features/preview/components/AgentChatSheet.js +0 -101
package/dist/core/createBlock.js
CHANGED
|
@@ -282,9 +282,9 @@ function createBlock(options) {
|
|
|
282
282
|
};
|
|
283
283
|
const Embed = (t0) => {
|
|
284
284
|
const $ = c(59);
|
|
285
|
-
if ($[0] !== "
|
|
285
|
+
if ($[0] !== "16fbadb9c99d2d93df5249e83b6340f85840c1bffae0734d6a331a4171f15790") {
|
|
286
286
|
for (let $i = 0; $i < 59; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
|
|
287
|
-
$[0] = "
|
|
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] !== "
|
|
535
|
+
if ($[0] !== "16fbadb9c99d2d93df5249e83b6340f85840c1bffae0734d6a331a4171f15790") {
|
|
536
536
|
for (let $i = 0; $i < 38; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
|
|
537
|
-
$[0] = "
|
|
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] !== "
|
|
776
|
+
if ($[0] !== "16fbadb9c99d2d93df5249e83b6340f85840c1bffae0734d6a331a4171f15790") {
|
|
777
777
|
for (let $i = 0; $i < 22; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
|
|
778
|
-
$[0] = "
|
|
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] !== "
|
|
900
|
+
if ($[0] !== "16fbadb9c99d2d93df5249e83b6340f85840c1bffae0734d6a331a4171f15790") {
|
|
901
901
|
for (let $i = 0; $i < 9; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
|
|
902
|
-
$[0] = "
|
|
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] !== "
|
|
977
|
+
if ($[0] !== "16fbadb9c99d2d93df5249e83b6340f85840c1bffae0734d6a331a4171f15790") {
|
|
978
978
|
for (let $i = 0; $i < 9; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
|
|
979
|
-
$[0] = "
|
|
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] !== "
|
|
1020
|
+
if ($[0] !== "16fbadb9c99d2d93df5249e83b6340f85840c1bffae0734d6a331a4171f15790") {
|
|
1021
1021
|
for (let $i = 0; $i < 7; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
|
|
1022
|
-
$[0] = "
|
|
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] !== "
|
|
1053
|
+
if ($[0] !== "16fbadb9c99d2d93df5249e83b6340f85840c1bffae0734d6a331a4171f15790") {
|
|
1054
1054
|
for (let $i = 0; $i < 27; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
|
|
1055
|
-
$[0] = "
|
|
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(
|
|
1180
|
-
if ($[0] !== "
|
|
1181
|
-
for (let $i = 0; $i <
|
|
1182
|
-
$[0] = "
|
|
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] !==
|
|
1212
|
+
if ($[4] !== blockData._id || $[5] !== isBlockSelected || $[6] !== isFirstRender || $[7] !== pendingAgentBlockFocus?.blockId) {
|
|
1212
1213
|
t3 = () => {
|
|
1213
|
-
if (isBlockSelected
|
|
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] =
|
|
1219
|
-
$[5] =
|
|
1220
|
-
$[6] =
|
|
1221
|
-
|
|
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 ($[
|
|
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
|
-
$[
|
|
1230
|
-
$[
|
|
1231
|
-
$[
|
|
1232
|
-
$[
|
|
1233
|
-
|
|
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
|
-
|
|
1244
|
+
let t5;
|
|
1236
1245
|
let t6;
|
|
1237
|
-
if ($[
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
|
|
1242
|
-
|
|
1243
|
-
|
|
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 ($[
|
|
1246
|
-
|
|
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
|
-
|
|
1250
|
-
$[
|
|
1251
|
-
$[
|
|
1252
|
-
$[
|
|
1283
|
+
t10 = [isHoveredFromSidebar];
|
|
1284
|
+
$[21] = isHoveredFromSidebar;
|
|
1285
|
+
$[22] = t10;
|
|
1286
|
+
$[23] = t9;
|
|
1253
1287
|
} else {
|
|
1254
|
-
|
|
1255
|
-
|
|
1288
|
+
t10 = $[22];
|
|
1289
|
+
t9 = $[23];
|
|
1256
1290
|
}
|
|
1257
|
-
React.useEffect(
|
|
1291
|
+
React.useEffect(t9, t10);
|
|
1258
1292
|
let result;
|
|
1259
|
-
if ($[
|
|
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(
|
|
1297
|
+
if (Array.isArray(value) && value.length > 0 && value[0]?.content !== void 0) result[key] = value.map(_temp0);
|
|
1264
1298
|
}
|
|
1265
|
-
$[
|
|
1266
|
-
$[
|
|
1267
|
-
} else result = $[
|
|
1299
|
+
$[24] = blockData.content;
|
|
1300
|
+
$[25] = result;
|
|
1301
|
+
} else result = $[25];
|
|
1268
1302
|
const normalizedContent = result;
|
|
1269
|
-
let
|
|
1270
|
-
if ($[
|
|
1271
|
-
|
|
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
|
-
$[
|
|
1280
|
-
$[
|
|
1281
|
-
$[
|
|
1282
|
-
} else
|
|
1283
|
-
const handleClick =
|
|
1284
|
-
let
|
|
1285
|
-
if ($[
|
|
1286
|
-
|
|
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
|
-
$[
|
|
1290
|
-
$[
|
|
1291
|
-
} else
|
|
1292
|
-
const handleMouseEnter =
|
|
1293
|
-
let
|
|
1294
|
-
if ($[
|
|
1295
|
-
|
|
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
|
-
$[
|
|
1299
|
-
$[
|
|
1300
|
-
} else
|
|
1301
|
-
const handleMouseLeave =
|
|
1302
|
-
let
|
|
1303
|
-
if ($[
|
|
1304
|
-
|
|
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
|
-
$[
|
|
1313
|
-
$[
|
|
1314
|
-
$[
|
|
1315
|
-
} else
|
|
1316
|
-
const handleAddBlockClick =
|
|
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
|
|
1320
|
-
if ($[
|
|
1321
|
-
|
|
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
|
-
$[
|
|
1327
|
-
} else
|
|
1328
|
-
const
|
|
1329
|
-
const
|
|
1330
|
-
const
|
|
1331
|
-
const
|
|
1332
|
-
const
|
|
1333
|
-
let
|
|
1334
|
-
if ($[
|
|
1335
|
-
|
|
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
|
-
$[
|
|
1340
|
-
$[
|
|
1341
|
-
} else
|
|
1342
|
-
const merged =
|
|
1373
|
+
$[37] = blockData.content;
|
|
1374
|
+
$[38] = t21;
|
|
1375
|
+
} else t21 = $[38];
|
|
1376
|
+
const merged = t21;
|
|
1343
1377
|
let overrides;
|
|
1344
|
-
if ($[
|
|
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
|
-
$[
|
|
1351
|
-
$[
|
|
1352
|
-
} else overrides = $[
|
|
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 ($[
|
|
1388
|
+
if ($[41] !== merged || $[42] !== overrides) {
|
|
1366
1389
|
t22 = {
|
|
1367
|
-
...
|
|
1368
|
-
...
|
|
1390
|
+
...merged,
|
|
1391
|
+
...overrides
|
|
1369
1392
|
};
|
|
1370
|
-
$[
|
|
1371
|
-
$[
|
|
1372
|
-
|
|
1393
|
+
$[41] = merged;
|
|
1394
|
+
$[42] = overrides;
|
|
1395
|
+
$[43] = t22;
|
|
1396
|
+
} else t22 = $[43];
|
|
1373
1397
|
const t23 = t22;
|
|
1374
1398
|
let t24;
|
|
1375
|
-
if ($[
|
|
1399
|
+
if ($[44] !== blockData.settings) {
|
|
1376
1400
|
t24 = {
|
|
1377
|
-
|
|
1378
|
-
|
|
1379
|
-
|
|
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
|
-
$[
|
|
1385
|
-
$[
|
|
1386
|
-
$[
|
|
1387
|
-
$[
|
|
1388
|
-
$[
|
|
1389
|
-
$[
|
|
1390
|
-
} else
|
|
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 ($[
|
|
1409
|
-
t27 = /* @__PURE__ */ jsx(
|
|
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
|
-
$[
|
|
1414
|
-
$[
|
|
1415
|
-
} else
|
|
1416
|
-
let
|
|
1417
|
-
if ($[
|
|
1418
|
-
|
|
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
|
-
$[
|
|
1430
|
-
$[
|
|
1431
|
-
$[
|
|
1432
|
-
$[
|
|
1433
|
-
$[
|
|
1434
|
-
$[
|
|
1435
|
-
$[
|
|
1436
|
-
$[
|
|
1437
|
-
} else
|
|
1438
|
-
let
|
|
1439
|
-
if ($[
|
|
1440
|
-
|
|
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:
|
|
1444
|
-
"data-camox-block-id":
|
|
1445
|
-
"data-camox-hovered":
|
|
1446
|
-
"data-camox-focused":
|
|
1447
|
-
"data-camox-overlay-mode":
|
|
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
|
-
|
|
1453
|
-
|
|
1454
|
-
|
|
1486
|
+
t28,
|
|
1487
|
+
t29,
|
|
1488
|
+
t30
|
|
1455
1489
|
]
|
|
1456
1490
|
});
|
|
1457
|
-
$[
|
|
1458
|
-
$[
|
|
1459
|
-
$[
|
|
1460
|
-
$[
|
|
1461
|
-
$[
|
|
1462
|
-
$[
|
|
1463
|
-
$[
|
|
1464
|
-
$[
|
|
1465
|
-
$[
|
|
1466
|
-
$[
|
|
1467
|
-
$[
|
|
1468
|
-
} else
|
|
1469
|
-
return
|
|
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] !== "
|
|
1516
|
+
if ($[0] !== "16fbadb9c99d2d93df5249e83b6340f85840c1bffae0734d6a331a4171f15790") {
|
|
1483
1517
|
for (let $i = 0; $i < 31; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
|
|
1484
|
-
$[0] = "
|
|
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,
|
|
1493
|
-
const isAddBlockSheetOpen = useSelector(previewStore,
|
|
1494
|
-
const isPageContentSheetOpen = useSelector(previewStore,
|
|
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(
|
|
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
|
|
1749
|
+
function _temp1(state) {
|
|
1713
1750
|
return state.context.selection;
|
|
1714
1751
|
}
|
|
1715
|
-
function
|
|
1752
|
+
function _temp10(state_0) {
|
|
1716
1753
|
return state_0.context.isAddBlockSheetOpen;
|
|
1717
1754
|
}
|
|
1718
|
-
function
|
|
1755
|
+
function _temp11(state_1) {
|
|
1719
1756
|
return state_1.context.isPageContentSheetOpen;
|
|
1720
1757
|
}
|
|
1721
1758
|
|