camox 0.40.0 → 0.41.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.
- package/dist/components/PlatformLabel.js +62 -0
- package/dist/core/components/lexical/GradientNode.js +126 -0
- package/dist/core/components/lexical/InlineLexicalEditor.js +37 -56
- package/dist/core/components/lexical/InlineStylesPlugin.js +183 -0
- package/dist/core/components/lexical/SelectionBroadcaster.js +49 -46
- package/dist/core/components/lexical/SidebarLexicalEditor.js +197 -151
- package/dist/core/components/lexical/editorConfig.js +25 -7
- package/dist/core/components/lexical/selectTextLink.js +21 -0
- package/dist/core/createApp.d.ts +30 -17
- package/dist/core/createApp.js +14 -3
- package/dist/core/createBlock.d.ts +2 -2
- package/dist/core/createBlock.js +17 -28
- package/dist/core/createLayout.d.ts +48 -4
- package/dist/core/createLayout.js +51 -23
- package/dist/core/derivedRoutes.js +36 -0
- package/dist/core/editing/BlockEditingRuntime.js +4 -4
- package/dist/core/editing/CompleteBlockEditingRuntime.js +5 -5
- package/dist/core/editing/createEditableBlock.d.ts +9 -8
- package/dist/core/editing/createEditableBlock.js +265 -403
- package/dist/core/hooks/useIsEditable.js +4 -7
- package/dist/core/hooks/useRequireDraftSource.js +7 -11
- package/dist/core/lib/lexicalReact.d.ts +1 -26
- package/dist/core/lib/lexicalReact.js +46 -60
- package/dist/core/lib/lexicalState.js +164 -81
- package/dist/core/lib/modifierFormats.js +4 -15
- package/dist/core/lib/textStyles.d.ts +27 -0
- package/dist/core/lib/textStyles.js +47 -0
- package/dist/features/navigation/navigation.d.ts +2 -0
- package/dist/features/navigation/navigation.js +51 -46
- package/dist/features/page/DerivedPageContent.js +61 -0
- package/dist/features/page/PublishedPageContent.js +52 -83
- package/dist/features/page/SharedLayoutContent.js +66 -0
- package/dist/features/preview/CamoxPreview.d.ts +16 -1
- package/dist/features/preview/CamoxPreview.js +246 -290
- package/dist/features/preview/DerivedPreview.js +134 -0
- package/dist/features/preview/EditablePageExperience.js +25 -8
- package/dist/features/preview/components/AddBlockSidebar.js +43 -33
- package/dist/features/preview/components/AssetLightbox.js +1 -1
- package/dist/features/preview/components/BlockActionsPopover.js +8 -8
- package/dist/features/preview/components/BlockThumbnail.js +192 -0
- package/dist/features/preview/components/CreatePageModal.js +123 -115
- package/dist/features/preview/components/DerivedLayoutDialog.js +100 -0
- package/dist/features/preview/components/DerivedLayoutSidebar.d.ts +5 -0
- package/dist/features/preview/components/DerivedLayoutSidebar.js +160 -0
- package/dist/features/preview/components/DerivedPageInfoSidebar.js +57 -0
- package/dist/features/preview/components/FieldToolbar.js +42 -20
- package/dist/features/preview/components/Frame.js +133 -140
- package/dist/features/preview/components/LeftSidebar.js +42 -38
- package/dist/features/preview/components/LinkFieldEditor.js +3 -4
- package/dist/features/preview/components/MobilePreviewDrawer.js +4 -4
- package/dist/features/preview/components/Overlays.js +59 -47
- package/dist/features/preview/components/PageEditorSidebar.js +194 -203
- package/dist/features/preview/components/PageInfoSidebar.js +63 -55
- package/dist/features/preview/components/PageNavigatorSidebar.js +34 -483
- package/dist/features/preview/components/PagePicker.js +205 -153
- package/dist/features/preview/components/PageTree.js +366 -340
- package/dist/features/preview/components/PreviewActivation.js +78 -0
- package/dist/features/preview/components/PreviewPanel.js +98 -68
- package/dist/features/preview/components/PreviewToolbar.js +224 -241
- package/dist/features/preview/components/PreviewToolbarSpacer.js +43 -0
- package/dist/features/preview/components/PublicationRow.js +425 -0
- package/dist/features/preview/components/PublishDialog.js +180 -97
- package/dist/features/preview/components/RightSidebar.js +19 -34
- package/dist/features/preview/components/previewStyles.js +8 -0
- package/dist/features/preview/components/useUpdateBlockPosition.js +7 -13
- package/dist/features/preview/previewConstants.js +8 -0
- package/dist/features/preview/previewStore.js +18 -39
- package/dist/features/preview/publication.js +71 -0
- package/dist/features/provider/AuthenticatedCamoxProvider.js +2 -1
- package/dist/features/provider/CoreCamoxProvider.js +11 -2
- package/dist/features/provider/LocalhostPreviewProvider.js +6 -7
- package/dist/features/provider/useAdminShortcuts.js +5 -4
- package/dist/features/routes/pageRuntime.d.ts +10 -0
- package/dist/features/routes/pageRuntime.js +7 -9
- package/dist/features/runtime/PreviewDocumentContext.js +7 -0
- package/dist/features/runtime/RuntimeChrome.js +149 -0
- package/dist/features/runtime/SharedChromeContext.js +7 -0
- package/dist/features/runtime/navigationRequest.js +21 -0
- package/dist/features/runtime/navigationTarget.js +23 -0
- package/dist/features/runtime/pageApp.js +196 -121
- package/dist/features/runtime/pageNavigation.js +79 -130
- package/dist/features/runtime/runtime.d.ts +11 -0
- package/dist/features/runtime/runtime.js +183 -47
- package/dist/features/runtime/studioApp.d.ts +2 -11
- package/dist/features/runtime/studioApp.js +14 -177
- package/dist/features/studio/CamoxStudio.js +27 -13
- package/dist/features/studio/components/Navbar.js +80 -74
- package/dist/features/studio/components/UserButton.js +4 -4
- package/dist/features/studio/studioTheme.js +25 -0
- package/dist/features/studio/useTheme.js +94 -109
- package/dist/features/vite/appGeneration.js +12 -3
- package/dist/features/vite/definitionsSync.js +4 -2
- package/dist/features/vite/layoutGeneration.js +38 -0
- package/dist/features/vite/runtimeDev.js +3 -1
- package/dist/lib/auth.js +15 -13
- package/dist/lib/normalized-data.js +4 -4
- package/dist/lib/platform.js +13 -0
- package/dist/lib/utils.js +90 -38
- package/dist/studio-overlays.css +5 -40
- package/dist/studio.css +1 -1
- package/package.json +8 -4
- package/skills/camox/SKILL.md +2 -0
- package/skills/camox/references/block-definitions.md +31 -12
- package/skills/camox/references/layout-definitions.md +2 -0
- package/dist/core/lib/modifiers.js +0 -24
- package/dist/features/preview/components/DraftSwitchDialog.js +0 -66
- package/dist/features/preview/previewQueryFns.js +0 -23
- package/dist/features/runtime/studioNavigation.js +0 -120
|
@@ -21,9 +21,6 @@ import { generateKeyBetween } from "fractional-indexing";
|
|
|
21
21
|
import * as React from "react";
|
|
22
22
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
23
23
|
import { useSelector } from "@xstate/store-react";
|
|
24
|
-
import { Popover, PopoverContent, PopoverTrigger } from "@camox/ui/popover";
|
|
25
|
-
import { Label } from "@camox/ui/label";
|
|
26
|
-
import { Input } from "@camox/ui/input";
|
|
27
24
|
import { createPortal } from "react-dom";
|
|
28
25
|
|
|
29
26
|
//#region src/core/editing/createEditableBlock.tsx
|
|
@@ -185,7 +182,7 @@ function createEditableBlock(options) {
|
|
|
185
182
|
if (repeaterContext?.itemId != null) return `${blockId}__${repeaterContext.itemId}__${fieldName}`;
|
|
186
183
|
return `${blockId}__${fieldName}`;
|
|
187
184
|
};
|
|
188
|
-
const Field = ({ name,
|
|
185
|
+
const Field = ({ name, textStyle, linkStyle, children }) => {
|
|
189
186
|
const blockContext = React.use(Context);
|
|
190
187
|
if (!blockContext) throw new Error("Field must be used within a Block Component");
|
|
191
188
|
const { blockId, content, mode } = blockContext;
|
|
@@ -268,17 +265,22 @@ function createEditableBlock(options) {
|
|
|
268
265
|
if (!isContentEditable) return /* @__PURE__ */ jsx(Fragment, { children: children({ children: markdownToReactNodes(fieldValue, {
|
|
269
266
|
pages,
|
|
270
267
|
fallbackHref: currentPathname,
|
|
271
|
-
|
|
268
|
+
textStyle,
|
|
269
|
+
linkStyle
|
|
272
270
|
}) }, fieldData) });
|
|
273
271
|
return /* @__PURE__ */ jsx(Fragment, { children: children({
|
|
274
272
|
ref: elementRef,
|
|
275
273
|
"data-camox-field-id": fieldId,
|
|
276
274
|
"data-camox-hovered": isHovered || void 0,
|
|
277
275
|
"data-camox-focused": isFocused || void 0,
|
|
278
|
-
"data-camox-overlay-mode":
|
|
276
|
+
"data-camox-overlay-mode": options.synced ? "synced" : void 0,
|
|
279
277
|
onMouseEnter: handleMouseEnter,
|
|
280
278
|
onMouseLeave: handleMouseLeave,
|
|
281
279
|
children: /* @__PURE__ */ jsx(InlineLexicalEditor, {
|
|
280
|
+
textStyle,
|
|
281
|
+
linkStyle,
|
|
282
|
+
pages,
|
|
283
|
+
fallbackHref: currentPathname,
|
|
282
284
|
initialState: fieldValue,
|
|
283
285
|
externalState: fieldValue,
|
|
284
286
|
onChange: handleChange,
|
|
@@ -288,10 +290,10 @@ function createEditableBlock(options) {
|
|
|
288
290
|
}, fieldData) });
|
|
289
291
|
};
|
|
290
292
|
const Embed = (t0) => {
|
|
291
|
-
const $ = c(
|
|
292
|
-
if ($[0] !== "
|
|
293
|
-
for (let $i = 0; $i <
|
|
294
|
-
$[0] = "
|
|
293
|
+
const $ = c(35);
|
|
294
|
+
if ($[0] !== "d6c181312c1800a4e5ae8a8c97d5ce89a20fae6d141b3bb8b9dd5c16e3c88316") {
|
|
295
|
+
for (let $i = 0; $i < 35; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
|
|
296
|
+
$[0] = "d6c181312c1800a4e5ae8a8c97d5ce89a20fae6d141b3bb8b9dd5c16e3c88316";
|
|
295
297
|
}
|
|
296
298
|
const { name, children } = t0;
|
|
297
299
|
const blockContext = React.use(Context);
|
|
@@ -311,234 +313,145 @@ function createEditableBlock(options) {
|
|
|
311
313
|
$[4] = t2;
|
|
312
314
|
} else t2 = $[4];
|
|
313
315
|
const fieldId = t2;
|
|
314
|
-
const [isOpen, setIsOpen] = React.useState(false);
|
|
315
|
-
const [urlValue, setUrlValue] = React.useState(fieldValue);
|
|
316
316
|
const [isHovered, setIsHovered] = React.useState(false);
|
|
317
|
-
const
|
|
317
|
+
const embedRef = React.useRef(null);
|
|
318
|
+
const itemId = repeaterContext?.itemId;
|
|
318
319
|
let t3;
|
|
319
|
-
if ($[5] !==
|
|
320
|
-
t3 =
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
320
|
+
if ($[5] !== blockId || $[6] !== isContentEditable || $[7] !== itemId || $[8] !== name) {
|
|
321
|
+
t3 = () => {
|
|
322
|
+
if (!isContentEditable) return;
|
|
323
|
+
if (itemId != null) {
|
|
324
|
+
previewStore.send({
|
|
325
|
+
type: "selectItemField",
|
|
326
|
+
blockId,
|
|
327
|
+
itemId,
|
|
328
|
+
fieldName: String(name),
|
|
329
|
+
fieldType: "Embed"
|
|
330
|
+
});
|
|
331
|
+
return;
|
|
332
|
+
}
|
|
333
|
+
previewStore.send({
|
|
334
|
+
type: "selectBlockField",
|
|
335
|
+
blockId,
|
|
336
|
+
fieldName: String(name),
|
|
337
|
+
fieldType: "Embed"
|
|
338
|
+
});
|
|
339
|
+
};
|
|
340
|
+
$[5] = blockId;
|
|
341
|
+
$[6] = isContentEditable;
|
|
342
|
+
$[7] = itemId;
|
|
343
|
+
$[8] = name;
|
|
344
|
+
$[9] = t3;
|
|
345
|
+
} else t3 = $[9];
|
|
346
|
+
const selectField = t3;
|
|
325
347
|
let t4;
|
|
326
348
|
let t5;
|
|
327
|
-
if ($[
|
|
349
|
+
if ($[10] !== iframeWindow || $[11] !== isContentEditable || $[12] !== selectField) {
|
|
328
350
|
t4 = () => {
|
|
329
|
-
|
|
351
|
+
if (!isContentEditable || !iframeWindow) return;
|
|
352
|
+
let timer;
|
|
353
|
+
const handleBlur = () => {
|
|
354
|
+
iframeWindow.clearTimeout(timer);
|
|
355
|
+
timer = iframeWindow.setTimeout(() => {
|
|
356
|
+
const activeElement = iframeWindow.document.activeElement;
|
|
357
|
+
if (activeElement?.tagName !== "IFRAME") return;
|
|
358
|
+
if (embedRef.current?.contains(activeElement)) selectField();
|
|
359
|
+
}, 0);
|
|
360
|
+
};
|
|
361
|
+
iframeWindow.addEventListener("blur", handleBlur);
|
|
362
|
+
return () => {
|
|
363
|
+
iframeWindow.clearTimeout(timer);
|
|
364
|
+
iframeWindow.removeEventListener("blur", handleBlur);
|
|
365
|
+
};
|
|
330
366
|
};
|
|
331
|
-
t5 = [
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
367
|
+
t5 = [
|
|
368
|
+
isContentEditable,
|
|
369
|
+
iframeWindow,
|
|
370
|
+
selectField
|
|
371
|
+
];
|
|
372
|
+
$[10] = iframeWindow;
|
|
373
|
+
$[11] = isContentEditable;
|
|
374
|
+
$[12] = selectField;
|
|
375
|
+
$[13] = t4;
|
|
376
|
+
$[14] = t5;
|
|
335
377
|
} else {
|
|
336
|
-
t4 = $[
|
|
337
|
-
t5 = $[
|
|
378
|
+
t4 = $[13];
|
|
379
|
+
t5 = $[14];
|
|
338
380
|
}
|
|
339
381
|
React.useEffect(t4, t5);
|
|
340
382
|
let t6;
|
|
341
|
-
if ($[
|
|
342
|
-
t6 =
|
|
343
|
-
$[
|
|
344
|
-
|
|
345
|
-
|
|
383
|
+
if ($[15] !== fieldId) {
|
|
384
|
+
t6 = { fieldId };
|
|
385
|
+
$[15] = fieldId;
|
|
386
|
+
$[16] = t6;
|
|
387
|
+
} else t6 = $[16];
|
|
388
|
+
const isHoveredFromSidebar = useOverlayMessage(iframeWindow, isContentEditable, "CAMOX_HOVER_FIELD", "CAMOX_HOVER_FIELD_END", t6);
|
|
346
389
|
let t7;
|
|
347
|
-
if ($[11] === Symbol.for("react.memo_cache_sentinel")) {
|
|
348
|
-
t7 = repeatableItemMutations.updateContent();
|
|
349
|
-
$[11] = t7;
|
|
350
|
-
} else t7 = $[11];
|
|
351
|
-
const updateRepeatableContent = useMutation(t7);
|
|
352
390
|
let t8;
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
if (!isOpen) setUrlValue(fieldValue);
|
|
357
|
-
};
|
|
358
|
-
t9 = [fieldValue, isOpen];
|
|
359
|
-
$[12] = fieldValue;
|
|
360
|
-
$[13] = isOpen;
|
|
361
|
-
$[14] = t8;
|
|
362
|
-
$[15] = t9;
|
|
363
|
-
} else {
|
|
364
|
-
t8 = $[14];
|
|
365
|
-
t9 = $[15];
|
|
366
|
-
}
|
|
367
|
-
React.useEffect(t8, t9);
|
|
368
|
-
let t10;
|
|
369
|
-
let t11;
|
|
370
|
-
if ($[16] === Symbol.for("react.memo_cache_sentinel")) {
|
|
371
|
-
t10 = () => () => {
|
|
372
|
-
if (timerRef.current) clearTimeout(timerRef.current);
|
|
391
|
+
if ($[17] !== isHoveredFromSidebar) {
|
|
392
|
+
t7 = () => {
|
|
393
|
+
setIsHovered(isHoveredFromSidebar);
|
|
373
394
|
};
|
|
374
|
-
|
|
375
|
-
$[
|
|
376
|
-
$[
|
|
395
|
+
t8 = [isHoveredFromSidebar];
|
|
396
|
+
$[17] = isHoveredFromSidebar;
|
|
397
|
+
$[18] = t7;
|
|
398
|
+
$[19] = t8;
|
|
377
399
|
} else {
|
|
378
|
-
|
|
379
|
-
|
|
400
|
+
t7 = $[18];
|
|
401
|
+
t8 = $[19];
|
|
380
402
|
}
|
|
381
|
-
React.useEffect(
|
|
403
|
+
React.useEffect(t7, t8);
|
|
404
|
+
const t9 = isContentEditable ? fieldId : void 0;
|
|
405
|
+
const t10 = isContentEditable ? "embed" : void 0;
|
|
406
|
+
const t11 = isContentEditable && isHovered || void 0;
|
|
382
407
|
let t12;
|
|
383
|
-
if ($[
|
|
384
|
-
t12 = (
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
timerRef.current = window.setTimeout(() => {
|
|
389
|
-
if (repeaterContext?.itemId != null) updateRepeatableContent.mutate({
|
|
390
|
-
id: repeaterContext.itemId,
|
|
391
|
-
content: { [name]: newValue }
|
|
392
|
-
});
|
|
393
|
-
else updateBlockContent.mutate({
|
|
394
|
-
id: blockId,
|
|
395
|
-
content: { [name]: newValue }
|
|
396
|
-
});
|
|
397
|
-
}, 500);
|
|
398
|
-
};
|
|
399
|
-
$[18] = blockId;
|
|
400
|
-
$[19] = name;
|
|
401
|
-
$[20] = repeaterContext;
|
|
402
|
-
$[21] = updateBlockContent;
|
|
403
|
-
$[22] = updateRepeatableContent;
|
|
404
|
-
$[23] = t12;
|
|
405
|
-
} else t12 = $[23];
|
|
406
|
-
const handleUrlChange = t12;
|
|
408
|
+
if ($[20] !== isContentEditable) {
|
|
409
|
+
t12 = isContentEditable ? () => setIsHovered(true) : void 0;
|
|
410
|
+
$[20] = isContentEditable;
|
|
411
|
+
$[21] = t12;
|
|
412
|
+
} else t12 = $[21];
|
|
407
413
|
let t13;
|
|
408
|
-
if ($[
|
|
409
|
-
t13 = (
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
const t15 = isContentEditable ? handleOpenChange : void 0;
|
|
433
|
-
const t16 = isContentEditable ? fieldId : void 0;
|
|
434
|
-
const t17 = isContentEditable ? "embed" : void 0;
|
|
435
|
-
const t18 = isContentEditable && isHovered || void 0;
|
|
436
|
-
const t19 = isContentEditable && isOpen || void 0;
|
|
437
|
-
const t20 = mode === "layout" ? "layout" : void 0;
|
|
438
|
-
let t21;
|
|
439
|
-
if ($[28] !== isContentEditable) {
|
|
440
|
-
t21 = isContentEditable ? () => setIsHovered(true) : void 0;
|
|
441
|
-
$[28] = isContentEditable;
|
|
442
|
-
$[29] = t21;
|
|
443
|
-
} else t21 = $[29];
|
|
444
|
-
let t22;
|
|
445
|
-
if ($[30] !== isContentEditable) {
|
|
446
|
-
t22 = isContentEditable ? () => setIsHovered(false) : void 0;
|
|
447
|
-
$[30] = isContentEditable;
|
|
448
|
-
$[31] = t22;
|
|
449
|
-
} else t22 = $[31];
|
|
450
|
-
let t23;
|
|
451
|
-
if ($[32] !== t16 || $[33] !== t17 || $[34] !== t18 || $[35] !== t19 || $[36] !== t20 || $[37] !== t21 || $[38] !== t22) {
|
|
452
|
-
t23 = /* @__PURE__ */ jsx("div", {
|
|
453
|
-
"data-camox-field-id": t16,
|
|
454
|
-
"data-camox-field-type": t17,
|
|
455
|
-
"data-camox-hovered": t18,
|
|
456
|
-
"data-camox-focused": t19,
|
|
457
|
-
"data-camox-overlay-mode": t20,
|
|
458
|
-
onMouseEnter: t21,
|
|
459
|
-
onMouseLeave: t22
|
|
460
|
-
});
|
|
461
|
-
$[32] = t16;
|
|
462
|
-
$[33] = t17;
|
|
463
|
-
$[34] = t18;
|
|
464
|
-
$[35] = t19;
|
|
465
|
-
$[36] = t20;
|
|
466
|
-
$[37] = t21;
|
|
467
|
-
$[38] = t22;
|
|
468
|
-
$[39] = t23;
|
|
469
|
-
} else t23 = $[39];
|
|
470
|
-
let t24;
|
|
471
|
-
if ($[40] !== children || $[41] !== fieldValue) {
|
|
472
|
-
t24 = children({ src: fieldValue }, { url: fieldValue });
|
|
473
|
-
$[40] = children;
|
|
474
|
-
$[41] = fieldValue;
|
|
475
|
-
$[42] = t24;
|
|
476
|
-
} else t24 = $[42];
|
|
477
|
-
let t25;
|
|
478
|
-
if ($[43] !== isContentEditable) {
|
|
479
|
-
t25 = isContentEditable && /* @__PURE__ */ jsx("div", { style: {
|
|
480
|
-
position: "absolute",
|
|
481
|
-
inset: 0,
|
|
482
|
-
zIndex: 10
|
|
483
|
-
} });
|
|
484
|
-
$[43] = isContentEditable;
|
|
485
|
-
$[44] = t25;
|
|
486
|
-
} else t25 = $[44];
|
|
487
|
-
let t26;
|
|
488
|
-
if ($[45] !== t23 || $[46] !== t24 || $[47] !== t25) {
|
|
489
|
-
t26 = /* @__PURE__ */ jsxs(PopoverTrigger, {
|
|
490
|
-
render: t23,
|
|
491
|
-
nativeButton: false,
|
|
492
|
-
children: [t24, t25]
|
|
493
|
-
});
|
|
494
|
-
$[45] = t23;
|
|
495
|
-
$[46] = t24;
|
|
496
|
-
$[47] = t25;
|
|
497
|
-
$[48] = t26;
|
|
498
|
-
} else t26 = $[48];
|
|
499
|
-
let t27;
|
|
500
|
-
if ($[49] !== handleUrlChange || $[50] !== isContentEditable || $[51] !== name || $[52] !== urlValue) {
|
|
501
|
-
t27 = isContentEditable && /* @__PURE__ */ jsx(PopoverContent, {
|
|
502
|
-
className: "w-96 gap-2",
|
|
503
|
-
children: /* @__PURE__ */ jsxs("form", {
|
|
504
|
-
className: "grid gap-2",
|
|
505
|
-
children: [/* @__PURE__ */ jsx(Label, {
|
|
506
|
-
htmlFor: "url",
|
|
507
|
-
children: options.content[name]?.title ?? String(name)
|
|
508
|
-
}), /* @__PURE__ */ jsx(Input, {
|
|
509
|
-
type: "url",
|
|
510
|
-
id: "url",
|
|
511
|
-
value: urlValue,
|
|
512
|
-
onChange: handleUrlChange
|
|
513
|
-
})]
|
|
514
|
-
})
|
|
515
|
-
});
|
|
516
|
-
$[49] = handleUrlChange;
|
|
517
|
-
$[50] = isContentEditable;
|
|
518
|
-
$[51] = name;
|
|
519
|
-
$[52] = urlValue;
|
|
520
|
-
$[53] = t27;
|
|
521
|
-
} else t27 = $[53];
|
|
522
|
-
let t28;
|
|
523
|
-
if ($[54] !== t14 || $[55] !== t15 || $[56] !== t26 || $[57] !== t27) {
|
|
524
|
-
t28 = /* @__PURE__ */ jsxs(Popover, {
|
|
525
|
-
open: t14,
|
|
526
|
-
onOpenChange: t15,
|
|
527
|
-
children: [t26, t27]
|
|
414
|
+
if ($[22] !== isContentEditable) {
|
|
415
|
+
t13 = isContentEditable ? () => setIsHovered(false) : void 0;
|
|
416
|
+
$[22] = isContentEditable;
|
|
417
|
+
$[23] = t13;
|
|
418
|
+
} else t13 = $[23];
|
|
419
|
+
let t14;
|
|
420
|
+
if ($[24] !== children || $[25] !== fieldValue) {
|
|
421
|
+
t14 = children({ src: fieldValue }, { url: fieldValue });
|
|
422
|
+
$[24] = children;
|
|
423
|
+
$[25] = fieldValue;
|
|
424
|
+
$[26] = t14;
|
|
425
|
+
} else t14 = $[26];
|
|
426
|
+
let t15;
|
|
427
|
+
if ($[27] !== selectField || $[28] !== t10 || $[29] !== t11 || $[30] !== t12 || $[31] !== t13 || $[32] !== t14 || $[33] !== t9) {
|
|
428
|
+
t15 = /* @__PURE__ */ jsx("div", {
|
|
429
|
+
ref: embedRef,
|
|
430
|
+
onClickCapture: selectField,
|
|
431
|
+
"data-camox-field-id": t9,
|
|
432
|
+
"data-camox-field-type": t10,
|
|
433
|
+
"data-camox-hovered": t11,
|
|
434
|
+
"data-camox-overlay-mode": options.synced ? "synced" : void 0,
|
|
435
|
+
onMouseEnter: t12,
|
|
436
|
+
onMouseLeave: t13,
|
|
437
|
+
children: t14
|
|
528
438
|
});
|
|
529
|
-
$[
|
|
530
|
-
$[
|
|
531
|
-
$[
|
|
532
|
-
$[
|
|
533
|
-
$[
|
|
534
|
-
|
|
535
|
-
|
|
439
|
+
$[27] = selectField;
|
|
440
|
+
$[28] = t10;
|
|
441
|
+
$[29] = t11;
|
|
442
|
+
$[30] = t12;
|
|
443
|
+
$[31] = t13;
|
|
444
|
+
$[32] = t14;
|
|
445
|
+
$[33] = t9;
|
|
446
|
+
$[34] = t15;
|
|
447
|
+
} else t15 = $[34];
|
|
448
|
+
return t15;
|
|
536
449
|
};
|
|
537
450
|
const Link = (t0) => {
|
|
538
|
-
const $ = c(
|
|
539
|
-
if ($[0] !== "
|
|
540
|
-
for (let $i = 0; $i <
|
|
541
|
-
$[0] = "
|
|
451
|
+
const $ = c(29);
|
|
452
|
+
if ($[0] !== "d6c181312c1800a4e5ae8a8c97d5ce89a20fae6d141b3bb8b9dd5c16e3c88316") {
|
|
453
|
+
for (let $i = 0; $i < 29; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
|
|
454
|
+
$[0] = "d6c181312c1800a4e5ae8a8c97d5ce89a20fae6d141b3bb8b9dd5c16e3c88316";
|
|
542
455
|
}
|
|
543
456
|
const { name, children } = t0;
|
|
544
457
|
const blockContext = React.use(Context);
|
|
@@ -680,17 +593,6 @@ function createEditableBlock(options) {
|
|
|
680
593
|
$[24] = t12;
|
|
681
594
|
} else t12 = $[24];
|
|
682
595
|
const handleBlur = t12;
|
|
683
|
-
let t13;
|
|
684
|
-
if ($[25] === Symbol.for("react.memo_cache_sentinel")) {
|
|
685
|
-
t13 = (e_0) => {
|
|
686
|
-
e_0.stopPropagation();
|
|
687
|
-
previewStore.send({ type: "toggleContentSheet" });
|
|
688
|
-
setIsEditorFocused(false);
|
|
689
|
-
setIsEditing(false);
|
|
690
|
-
};
|
|
691
|
-
$[25] = t13;
|
|
692
|
-
} else t13 = $[25];
|
|
693
|
-
const handleEditLink = t13;
|
|
694
596
|
const linkData = {
|
|
695
597
|
text: displayText,
|
|
696
598
|
href: resolvedHref,
|
|
@@ -702,18 +604,18 @@ function createEditableBlock(options) {
|
|
|
702
604
|
rel: fieldValue.newTab ? "noreferrer" : void 0,
|
|
703
605
|
children: fieldValue.text
|
|
704
606
|
}, linkData) });
|
|
607
|
+
let t13;
|
|
705
608
|
let t14;
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
t14 = () => setIsHovered(
|
|
709
|
-
|
|
609
|
+
if ($[25] === Symbol.for("react.memo_cache_sentinel")) {
|
|
610
|
+
t13 = () => setIsHovered(true);
|
|
611
|
+
t14 = () => setIsHovered(false);
|
|
612
|
+
$[25] = t13;
|
|
710
613
|
$[26] = t14;
|
|
711
|
-
$[27] = t15;
|
|
712
614
|
} else {
|
|
615
|
+
t13 = $[25];
|
|
713
616
|
t14 = $[26];
|
|
714
|
-
t15 = $[27];
|
|
715
617
|
}
|
|
716
|
-
const
|
|
618
|
+
const t15 = children({
|
|
717
619
|
ref: elementRef,
|
|
718
620
|
to: resolvedHref,
|
|
719
621
|
target: fieldValue.newTab ? "_blank" : void 0,
|
|
@@ -722,64 +624,31 @@ function createEditableBlock(options) {
|
|
|
722
624
|
"data-camox-field-id": fieldId,
|
|
723
625
|
"data-camox-hovered": isHovered || void 0,
|
|
724
626
|
"data-camox-focused": isFocused || void 0,
|
|
725
|
-
"data-camox-overlay-mode":
|
|
627
|
+
"data-camox-overlay-mode": options.synced ? "synced" : void 0,
|
|
726
628
|
contentEditable: true,
|
|
727
629
|
onClick: _temp2,
|
|
728
630
|
onInput: handleInput,
|
|
729
631
|
onFocus: handleFocus,
|
|
730
632
|
onBlur: handleBlur,
|
|
731
|
-
onMouseEnter:
|
|
732
|
-
onMouseLeave:
|
|
633
|
+
onMouseEnter: t13,
|
|
634
|
+
onMouseLeave: t14,
|
|
733
635
|
onKeyDown: _temp3,
|
|
734
636
|
spellCheck: false,
|
|
735
637
|
suppressContentEditableWarning: true
|
|
736
|
-
};
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
onMouseDown: _temp4,
|
|
745
|
-
onClick: handleEditLink,
|
|
746
|
-
children: "Edit link"
|
|
747
|
-
});
|
|
748
|
-
$[28] = handleEditLink;
|
|
749
|
-
$[29] = t17;
|
|
750
|
-
} else t17 = $[29];
|
|
751
|
-
let t18;
|
|
752
|
-
if ($[30] !== elementRef || $[31] !== t17) {
|
|
753
|
-
t18 = /* @__PURE__ */ jsx(PopoverContent, {
|
|
754
|
-
className: "w-auto p-2",
|
|
755
|
-
initialFocus: false,
|
|
756
|
-
anchor: elementRef,
|
|
757
|
-
align: "end",
|
|
758
|
-
children: t17
|
|
759
|
-
});
|
|
760
|
-
$[30] = elementRef;
|
|
761
|
-
$[31] = t17;
|
|
762
|
-
$[32] = t18;
|
|
763
|
-
} else t18 = $[32];
|
|
764
|
-
let t19;
|
|
765
|
-
if ($[33] !== T0 || $[34] !== isEditorFocused || $[35] !== t16 || $[36] !== t18) {
|
|
766
|
-
t19 = /* @__PURE__ */ jsxs(T0, {
|
|
767
|
-
open: isEditorFocused,
|
|
768
|
-
children: [t16, t18]
|
|
769
|
-
});
|
|
770
|
-
$[33] = T0;
|
|
771
|
-
$[34] = isEditorFocused;
|
|
772
|
-
$[35] = t16;
|
|
773
|
-
$[36] = t18;
|
|
774
|
-
$[37] = t19;
|
|
775
|
-
} else t19 = $[37];
|
|
776
|
-
return t19;
|
|
638
|
+
}, linkData);
|
|
639
|
+
let t16;
|
|
640
|
+
if ($[27] !== t15) {
|
|
641
|
+
t16 = /* @__PURE__ */ jsx(Fragment, { children: t15 });
|
|
642
|
+
$[27] = t15;
|
|
643
|
+
$[28] = t16;
|
|
644
|
+
} else t16 = $[28];
|
|
645
|
+
return t16;
|
|
777
646
|
};
|
|
778
647
|
const Image = (t0) => {
|
|
779
648
|
const $ = c(22);
|
|
780
|
-
if ($[0] !== "
|
|
649
|
+
if ($[0] !== "d6c181312c1800a4e5ae8a8c97d5ce89a20fae6d141b3bb8b9dd5c16e3c88316") {
|
|
781
650
|
for (let $i = 0; $i < 22; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
|
|
782
|
-
$[0] = "
|
|
651
|
+
$[0] = "d6c181312c1800a4e5ae8a8c97d5ce89a20fae6d141b3bb8b9dd5c16e3c88316";
|
|
783
652
|
}
|
|
784
653
|
const { name, children } = t0;
|
|
785
654
|
const blockContext = React.use(Context);
|
|
@@ -861,7 +730,7 @@ function createEditableBlock(options) {
|
|
|
861
730
|
const t5 = "image";
|
|
862
731
|
const t6 = isHovered || void 0;
|
|
863
732
|
const t7 = isFocused || void 0;
|
|
864
|
-
const t8 =
|
|
733
|
+
const t8 = options.synced ? "synced" : void 0;
|
|
865
734
|
let t10;
|
|
866
735
|
let t9;
|
|
867
736
|
if ($[11] === Symbol.for("react.memo_cache_sentinel")) {
|
|
@@ -901,9 +770,9 @@ function createEditableBlock(options) {
|
|
|
901
770
|
};
|
|
902
771
|
const File = (t0) => {
|
|
903
772
|
const $ = c(9);
|
|
904
|
-
if ($[0] !== "
|
|
773
|
+
if ($[0] !== "d6c181312c1800a4e5ae8a8c97d5ce89a20fae6d141b3bb8b9dd5c16e3c88316") {
|
|
905
774
|
for (let $i = 0; $i < 9; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
|
|
906
|
-
$[0] = "
|
|
775
|
+
$[0] = "d6c181312c1800a4e5ae8a8c97d5ce89a20fae6d141b3bb8b9dd5c16e3c88316";
|
|
907
776
|
}
|
|
908
777
|
const { name, children } = t0;
|
|
909
778
|
const blockContext = React.use(Context);
|
|
@@ -977,10 +846,10 @@ function createEditableBlock(options) {
|
|
|
977
846
|
const ImageList = _AssetList;
|
|
978
847
|
const FileList = _AssetList;
|
|
979
848
|
const RepeaterItemWrapper = (t0) => {
|
|
980
|
-
const $ = c(
|
|
981
|
-
if ($[0] !== "
|
|
982
|
-
for (let $i = 0; $i <
|
|
983
|
-
$[0] = "
|
|
849
|
+
const $ = c(8);
|
|
850
|
+
if ($[0] !== "d6c181312c1800a4e5ae8a8c97d5ce89a20fae6d141b3bb8b9dd5c16e3c88316") {
|
|
851
|
+
for (let $i = 0; $i < 8; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
|
|
852
|
+
$[0] = "d6c181312c1800a4e5ae8a8c97d5ce89a20fae6d141b3bb8b9dd5c16e3c88316";
|
|
984
853
|
}
|
|
985
854
|
const { itemId, blockId, mode, children } = t0;
|
|
986
855
|
const isContentEditable = useIsEditable(mode);
|
|
@@ -1002,28 +871,26 @@ function createEditableBlock(options) {
|
|
|
1002
871
|
const showOverlay = isContentEditable && (isHovered || isRepeaterHovered);
|
|
1003
872
|
const t4 = isContentEditable ? itemId : void 0;
|
|
1004
873
|
const t5 = showOverlay || void 0;
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
t7 = /* @__PURE__ */ jsx("div", {
|
|
874
|
+
let t6;
|
|
875
|
+
if ($[4] !== children || $[5] !== t4 || $[6] !== t5) {
|
|
876
|
+
t6 = /* @__PURE__ */ jsx("div", {
|
|
1009
877
|
"data-camox-repeater-item-id": t4,
|
|
1010
878
|
"data-camox-hovered": t5,
|
|
1011
|
-
"data-camox-overlay-mode":
|
|
879
|
+
"data-camox-overlay-mode": options.synced ? "synced" : void 0,
|
|
1012
880
|
children
|
|
1013
881
|
});
|
|
1014
882
|
$[4] = children;
|
|
1015
883
|
$[5] = t4;
|
|
1016
884
|
$[6] = t5;
|
|
1017
885
|
$[7] = t6;
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
return t7;
|
|
886
|
+
} else t6 = $[7];
|
|
887
|
+
return t6;
|
|
1021
888
|
};
|
|
1022
889
|
const RepeaterHoverProvider = (t0) => {
|
|
1023
890
|
const $ = c(7);
|
|
1024
|
-
if ($[0] !== "
|
|
891
|
+
if ($[0] !== "d6c181312c1800a4e5ae8a8c97d5ce89a20fae6d141b3bb8b9dd5c16e3c88316") {
|
|
1025
892
|
for (let $i = 0; $i < 7; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
|
|
1026
|
-
$[0] = "
|
|
893
|
+
$[0] = "d6c181312c1800a4e5ae8a8c97d5ce89a20fae6d141b3bb8b9dd5c16e3c88316";
|
|
1027
894
|
}
|
|
1028
895
|
const { blockId, fieldName, children } = t0;
|
|
1029
896
|
const isContentEditable = useIsEditable("site");
|
|
@@ -1054,9 +921,9 @@ function createEditableBlock(options) {
|
|
|
1054
921
|
};
|
|
1055
922
|
const Repeater = (t0) => {
|
|
1056
923
|
const $ = c(27);
|
|
1057
|
-
if ($[0] !== "
|
|
924
|
+
if ($[0] !== "d6c181312c1800a4e5ae8a8c97d5ce89a20fae6d141b3bb8b9dd5c16e3c88316") {
|
|
1058
925
|
for (let $i = 0; $i < 27; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
|
|
1059
|
-
$[0] = "
|
|
926
|
+
$[0] = "d6c181312c1800a4e5ae8a8c97d5ce89a20fae6d141b3bb8b9dd5c16e3c88316";
|
|
1060
927
|
}
|
|
1061
928
|
const { name, children } = t0;
|
|
1062
929
|
const blockContext = React.use(Context);
|
|
@@ -1180,18 +1047,18 @@ function createEditableBlock(options) {
|
|
|
1180
1047
|
return t4;
|
|
1181
1048
|
};
|
|
1182
1049
|
const BlockComponent = (t0) => {
|
|
1183
|
-
const $ = c(
|
|
1184
|
-
if ($[0] !== "
|
|
1185
|
-
for (let $i = 0; $i <
|
|
1186
|
-
$[0] = "
|
|
1050
|
+
const $ = c(70);
|
|
1051
|
+
if ($[0] !== "d6c181312c1800a4e5ae8a8c97d5ce89a20fae6d141b3bb8b9dd5c16e3c88316") {
|
|
1052
|
+
for (let $i = 0; $i < 70; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
|
|
1053
|
+
$[0] = "d6c181312c1800a4e5ae8a8c97d5ce89a20fae6d141b3bb8b9dd5c16e3c88316";
|
|
1187
1054
|
}
|
|
1188
1055
|
const { blockData, mode, isFirstBlock, showAddBlockTop, showAddBlockBottom, addBlockAfterPosition } = t0;
|
|
1189
1056
|
const isContentEditable = useIsEditable(mode);
|
|
1190
1057
|
const { window: iframeWindow } = useFrame();
|
|
1191
1058
|
const [isHovered, setIsHovered] = React.useState(false);
|
|
1192
|
-
const selection = useSelector(previewStore,
|
|
1193
|
-
const isPageEditorSidebarOpen = useSelector(previewStore,
|
|
1194
|
-
const isAddBlockSidebarOpen = useSelector(previewStore,
|
|
1059
|
+
const selection = useSelector(previewStore, _temp4);
|
|
1060
|
+
const isPageEditorSidebarOpen = useSelector(previewStore, _temp5);
|
|
1061
|
+
const isAddBlockSidebarOpen = useSelector(previewStore, _temp6);
|
|
1195
1062
|
const isBlockSelected = selection?.blockId === blockData._id;
|
|
1196
1063
|
const ref = React.useRef(null);
|
|
1197
1064
|
const [isFirstRender, setIsFirstRender] = React.useState(true);
|
|
@@ -1266,7 +1133,7 @@ function createEditableBlock(options) {
|
|
|
1266
1133
|
result = { ...blockData.content };
|
|
1267
1134
|
for (const key in result) {
|
|
1268
1135
|
const value = result[key];
|
|
1269
|
-
if (Array.isArray(value) && value.length > 0 && value[0]?.content !== void 0) result[key] = value.map(
|
|
1136
|
+
if (Array.isArray(value) && value.length > 0 && value[0]?.content !== void 0) result[key] = value.map(_temp7);
|
|
1270
1137
|
}
|
|
1271
1138
|
$[17] = blockData.content;
|
|
1272
1139
|
$[18] = result;
|
|
@@ -1334,18 +1201,17 @@ function createEditableBlock(options) {
|
|
|
1334
1201
|
const t14 = isContentEditable ? blockData._id : void 0;
|
|
1335
1202
|
const t15 = shouldShowOverlay && !isBlockSelected || void 0;
|
|
1336
1203
|
const t16 = shouldShowOverlay && isBlockSelected || void 0;
|
|
1337
|
-
const t17 =
|
|
1338
|
-
|
|
1339
|
-
let t19;
|
|
1204
|
+
const t17 = blockData._id;
|
|
1205
|
+
let t18;
|
|
1340
1206
|
if ($[30] !== blockData.content) {
|
|
1341
|
-
|
|
1207
|
+
t18 = {
|
|
1342
1208
|
...contentDefaults,
|
|
1343
1209
|
...blockData.content
|
|
1344
1210
|
};
|
|
1345
1211
|
$[30] = blockData.content;
|
|
1346
|
-
$[31] =
|
|
1347
|
-
} else
|
|
1348
|
-
const merged =
|
|
1212
|
+
$[31] = t18;
|
|
1213
|
+
} else t18 = $[31];
|
|
1214
|
+
const merged = t18;
|
|
1349
1215
|
let overrides;
|
|
1350
1216
|
if ($[32] !== merged) {
|
|
1351
1217
|
overrides = {};
|
|
@@ -1356,33 +1222,33 @@ function createEditableBlock(options) {
|
|
|
1356
1222
|
$[32] = merged;
|
|
1357
1223
|
$[33] = overrides;
|
|
1358
1224
|
} else overrides = $[33];
|
|
1359
|
-
let
|
|
1225
|
+
let t19;
|
|
1360
1226
|
if ($[34] !== merged || $[35] !== overrides) {
|
|
1361
|
-
|
|
1227
|
+
t19 = {
|
|
1362
1228
|
...merged,
|
|
1363
1229
|
...overrides
|
|
1364
1230
|
};
|
|
1365
1231
|
$[34] = merged;
|
|
1366
1232
|
$[35] = overrides;
|
|
1367
|
-
$[36] =
|
|
1368
|
-
} else
|
|
1369
|
-
const
|
|
1370
|
-
let
|
|
1233
|
+
$[36] = t19;
|
|
1234
|
+
} else t19 = $[36];
|
|
1235
|
+
const t20 = t19;
|
|
1236
|
+
let t21;
|
|
1371
1237
|
if ($[37] !== blockData.settings) {
|
|
1372
|
-
|
|
1238
|
+
t21 = {
|
|
1373
1239
|
...settingsDefaults,
|
|
1374
1240
|
...blockData.settings
|
|
1375
1241
|
};
|
|
1376
1242
|
$[37] = blockData.settings;
|
|
1377
|
-
$[38] =
|
|
1378
|
-
} else
|
|
1379
|
-
const
|
|
1380
|
-
let
|
|
1381
|
-
if ($[39] !== blockData._id || $[40] !== isHovered || $[41] !== mode || $[42] !==
|
|
1382
|
-
|
|
1383
|
-
blockId:
|
|
1384
|
-
content:
|
|
1385
|
-
settings:
|
|
1243
|
+
$[38] = t21;
|
|
1244
|
+
} else t21 = $[38];
|
|
1245
|
+
const t22 = t21;
|
|
1246
|
+
let t23;
|
|
1247
|
+
if ($[39] !== blockData._id || $[40] !== isHovered || $[41] !== mode || $[42] !== t20 || $[43] !== t22) {
|
|
1248
|
+
t23 = {
|
|
1249
|
+
blockId: t17,
|
|
1250
|
+
content: t20,
|
|
1251
|
+
settings: t22,
|
|
1386
1252
|
mode,
|
|
1387
1253
|
isHovered,
|
|
1388
1254
|
setIsHovered
|
|
@@ -1390,39 +1256,39 @@ function createEditableBlock(options) {
|
|
|
1390
1256
|
$[39] = blockData._id;
|
|
1391
1257
|
$[40] = isHovered;
|
|
1392
1258
|
$[41] = mode;
|
|
1393
|
-
$[42] =
|
|
1394
|
-
$[43] =
|
|
1395
|
-
$[44] =
|
|
1396
|
-
} else
|
|
1397
|
-
let
|
|
1259
|
+
$[42] = t20;
|
|
1260
|
+
$[43] = t22;
|
|
1261
|
+
$[44] = t23;
|
|
1262
|
+
} else t23 = $[44];
|
|
1263
|
+
let t24;
|
|
1398
1264
|
if ($[45] !== normalizedContent) {
|
|
1399
|
-
|
|
1265
|
+
t24 = /* @__PURE__ */ jsx(options.component, { content: normalizedContent });
|
|
1400
1266
|
$[45] = normalizedContent;
|
|
1401
|
-
$[46] =
|
|
1402
|
-
} else
|
|
1403
|
-
let
|
|
1404
|
-
if ($[47] !==
|
|
1405
|
-
|
|
1406
|
-
value:
|
|
1407
|
-
children:
|
|
1267
|
+
$[46] = t24;
|
|
1268
|
+
} else t24 = $[46];
|
|
1269
|
+
let t25;
|
|
1270
|
+
if ($[47] !== t23 || $[48] !== t24) {
|
|
1271
|
+
t25 = /* @__PURE__ */ jsx(Context.Provider, {
|
|
1272
|
+
value: t23,
|
|
1273
|
+
children: t24
|
|
1408
1274
|
});
|
|
1409
|
-
$[47] =
|
|
1410
|
-
$[48] =
|
|
1411
|
-
$[49] =
|
|
1412
|
-
} else
|
|
1413
|
-
const
|
|
1414
|
-
let
|
|
1415
|
-
if ($[50] !==
|
|
1416
|
-
|
|
1275
|
+
$[47] = t23;
|
|
1276
|
+
$[48] = t24;
|
|
1277
|
+
$[49] = t25;
|
|
1278
|
+
} else t25 = $[49];
|
|
1279
|
+
const t26 = shouldShowAddBlockOverlay || void 0;
|
|
1280
|
+
let t27;
|
|
1281
|
+
if ($[50] !== t26) {
|
|
1282
|
+
t27 = /* @__PURE__ */ jsx("div", {
|
|
1417
1283
|
className: "camox-sheet-overlay",
|
|
1418
|
-
"data-camox-visible":
|
|
1284
|
+
"data-camox-visible": t26
|
|
1419
1285
|
});
|
|
1420
|
-
$[50] =
|
|
1421
|
-
$[51] =
|
|
1422
|
-
} else
|
|
1423
|
-
let
|
|
1286
|
+
$[50] = t26;
|
|
1287
|
+
$[51] = t27;
|
|
1288
|
+
} else t27 = $[51];
|
|
1289
|
+
let t28;
|
|
1424
1290
|
if ($[52] !== handleAddBlockClick || $[53] !== isAddBlockSidebarOpen || $[54] !== isFirstBlock || $[55] !== mode || $[56] !== shouldShowOverlay || $[57] !== showAddBlockBottom || $[58] !== showAddBlockTop) {
|
|
1425
|
-
|
|
1291
|
+
t28 = shouldShowOverlay && /* @__PURE__ */ jsxs(Fragment, { children: [(showAddBlockTop ?? (mode !== "layout" && !isFirstBlock)) && /* @__PURE__ */ jsx(AddBlockControlBar, {
|
|
1426
1292
|
position: "top",
|
|
1427
1293
|
hidden: isAddBlockSidebarOpen,
|
|
1428
1294
|
onMouseLeave: () => setIsHovered(false),
|
|
@@ -1440,25 +1306,25 @@ function createEditableBlock(options) {
|
|
|
1440
1306
|
$[56] = shouldShowOverlay;
|
|
1441
1307
|
$[57] = showAddBlockBottom;
|
|
1442
1308
|
$[58] = showAddBlockTop;
|
|
1443
|
-
$[59] =
|
|
1444
|
-
} else
|
|
1445
|
-
let
|
|
1446
|
-
if ($[60] !== handleClick || $[61] !== handleMouseEnter || $[62] !== handleMouseLeave || $[63] !== t14 || $[64] !== t15 || $[65] !== t16 || $[66] !==
|
|
1447
|
-
|
|
1309
|
+
$[59] = t28;
|
|
1310
|
+
} else t28 = $[59];
|
|
1311
|
+
let t29;
|
|
1312
|
+
if ($[60] !== handleClick || $[61] !== handleMouseEnter || $[62] !== handleMouseLeave || $[63] !== t14 || $[64] !== t15 || $[65] !== t16 || $[66] !== t25 || $[67] !== t27 || $[68] !== t28) {
|
|
1313
|
+
t29 = /* @__PURE__ */ jsxs("div", {
|
|
1448
1314
|
className: "group visual-editing-block",
|
|
1449
1315
|
ref,
|
|
1450
1316
|
style: t13,
|
|
1451
1317
|
"data-camox-block-id": t14,
|
|
1452
1318
|
"data-camox-hovered": t15,
|
|
1453
1319
|
"data-camox-focused": t16,
|
|
1454
|
-
"data-camox-overlay-mode":
|
|
1320
|
+
"data-camox-overlay-mode": options.synced ? "synced" : void 0,
|
|
1455
1321
|
onClick: handleClick,
|
|
1456
1322
|
onMouseEnter: handleMouseEnter,
|
|
1457
1323
|
onMouseLeave: handleMouseLeave,
|
|
1458
1324
|
children: [
|
|
1459
|
-
|
|
1460
|
-
|
|
1461
|
-
|
|
1325
|
+
t25,
|
|
1326
|
+
t27,
|
|
1327
|
+
t28
|
|
1462
1328
|
]
|
|
1463
1329
|
});
|
|
1464
1330
|
$[60] = handleClick;
|
|
@@ -1467,13 +1333,12 @@ function createEditableBlock(options) {
|
|
|
1467
1333
|
$[63] = t14;
|
|
1468
1334
|
$[64] = t15;
|
|
1469
1335
|
$[65] = t16;
|
|
1470
|
-
$[66] =
|
|
1471
|
-
$[67] =
|
|
1336
|
+
$[66] = t25;
|
|
1337
|
+
$[67] = t27;
|
|
1472
1338
|
$[68] = t28;
|
|
1473
1339
|
$[69] = t29;
|
|
1474
|
-
|
|
1475
|
-
|
|
1476
|
-
return t30;
|
|
1340
|
+
} else t29 = $[69];
|
|
1341
|
+
return t29;
|
|
1477
1342
|
};
|
|
1478
1343
|
const useSetting = (name) => {
|
|
1479
1344
|
const ctx = React.use(Context);
|
|
@@ -1485,10 +1350,10 @@ function createEditableBlock(options) {
|
|
|
1485
1350
|
* Provides the same hover, selection, and sheet overlays as the main BlockComponent.
|
|
1486
1351
|
*/
|
|
1487
1352
|
const Detached = (t0) => {
|
|
1488
|
-
const $ = c(
|
|
1489
|
-
if ($[0] !== "
|
|
1490
|
-
for (let $i = 0; $i <
|
|
1491
|
-
$[0] = "
|
|
1353
|
+
const $ = c(30);
|
|
1354
|
+
if ($[0] !== "d6c181312c1800a4e5ae8a8c97d5ce89a20fae6d141b3bb8b9dd5c16e3c88316") {
|
|
1355
|
+
for (let $i = 0; $i < 30; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
|
|
1356
|
+
$[0] = "d6c181312c1800a4e5ae8a8c97d5ce89a20fae6d141b3bb8b9dd5c16e3c88316";
|
|
1492
1357
|
}
|
|
1493
1358
|
const { children } = t0;
|
|
1494
1359
|
const ctx = React.use(Context);
|
|
@@ -1496,8 +1361,8 @@ function createEditableBlock(options) {
|
|
|
1496
1361
|
const { blockId, mode, isHovered, setIsHovered } = ctx;
|
|
1497
1362
|
const isContentEditable = useIsEditable(mode);
|
|
1498
1363
|
const { window: iframeWindow } = useFrame();
|
|
1499
|
-
const selection = useSelector(previewStore,
|
|
1500
|
-
const isAddBlockSidebarOpen = useSelector(previewStore,
|
|
1364
|
+
const selection = useSelector(previewStore, _temp8);
|
|
1365
|
+
const isAddBlockSidebarOpen = useSelector(previewStore, _temp9);
|
|
1501
1366
|
const isBlockSelected = selection?.blockId === blockId;
|
|
1502
1367
|
const t1 = String(blockId);
|
|
1503
1368
|
let t2;
|
|
@@ -1579,13 +1444,13 @@ function createEditableBlock(options) {
|
|
|
1579
1444
|
$[21] = t9;
|
|
1580
1445
|
} else t9 = $[21];
|
|
1581
1446
|
let t10;
|
|
1582
|
-
if ($[22] !== blockId || $[23] !== container || $[24] !== isBlockSelected || $[25] !==
|
|
1447
|
+
if ($[22] !== blockId || $[23] !== container || $[24] !== isBlockSelected || $[25] !== shouldShowOverlay) {
|
|
1583
1448
|
t10 = container && createPortal(/* @__PURE__ */ jsx(Fragment, { children: shouldShowOverlay && /* @__PURE__ */ jsx("div", {
|
|
1584
1449
|
"data-camox-block-id": blockId,
|
|
1585
1450
|
"data-camox-detached": true,
|
|
1586
1451
|
"data-camox-hovered": !isBlockSelected || void 0,
|
|
1587
1452
|
"data-camox-focused": isBlockSelected || void 0,
|
|
1588
|
-
"data-camox-overlay-mode":
|
|
1453
|
+
"data-camox-overlay-mode": options.synced ? "synced" : void 0,
|
|
1589
1454
|
style: {
|
|
1590
1455
|
position: "absolute",
|
|
1591
1456
|
pointerEvents: "none",
|
|
@@ -1595,17 +1460,16 @@ function createEditableBlock(options) {
|
|
|
1595
1460
|
$[22] = blockId;
|
|
1596
1461
|
$[23] = container;
|
|
1597
1462
|
$[24] = isBlockSelected;
|
|
1598
|
-
$[25] =
|
|
1599
|
-
$[26] =
|
|
1600
|
-
|
|
1601
|
-
} else t10 = $[27];
|
|
1463
|
+
$[25] = shouldShowOverlay;
|
|
1464
|
+
$[26] = t10;
|
|
1465
|
+
} else t10 = $[26];
|
|
1602
1466
|
let t11;
|
|
1603
|
-
if ($[
|
|
1467
|
+
if ($[27] !== t10 || $[28] !== t9) {
|
|
1604
1468
|
t11 = /* @__PURE__ */ jsxs(Fragment, { children: [t9, t10] });
|
|
1605
|
-
$[
|
|
1606
|
-
$[
|
|
1607
|
-
$[
|
|
1608
|
-
} else t11 = $[
|
|
1469
|
+
$[27] = t10;
|
|
1470
|
+
$[28] = t9;
|
|
1471
|
+
$[29] = t11;
|
|
1472
|
+
} else t11 = $[29];
|
|
1609
1473
|
return t11;
|
|
1610
1474
|
};
|
|
1611
1475
|
return {
|
|
@@ -1632,6 +1496,7 @@ function createEditableBlock(options) {
|
|
|
1632
1496
|
contentSchema,
|
|
1633
1497
|
settingsSchema,
|
|
1634
1498
|
layoutOnly: options.layoutOnly ?? false,
|
|
1499
|
+
synced: options.synced ?? false,
|
|
1635
1500
|
getInitialBundle: () => {
|
|
1636
1501
|
const counter = { value: 0 };
|
|
1637
1502
|
const allSeeds = [];
|
|
@@ -1685,31 +1550,28 @@ function createEditableBlock(options) {
|
|
|
1685
1550
|
function _temp(l) {
|
|
1686
1551
|
return l.pathname;
|
|
1687
1552
|
}
|
|
1688
|
-
function _temp2(
|
|
1689
|
-
return
|
|
1690
|
-
}
|
|
1691
|
-
function _temp3(e_2) {
|
|
1692
|
-
if (e_2.key === "Escape") e_2.target.blur();
|
|
1553
|
+
function _temp2(e_0) {
|
|
1554
|
+
return e_0.preventDefault();
|
|
1693
1555
|
}
|
|
1694
|
-
function
|
|
1695
|
-
|
|
1556
|
+
function _temp3(e_1) {
|
|
1557
|
+
if (e_1.key === "Escape") e_1.target.blur();
|
|
1696
1558
|
}
|
|
1697
|
-
function
|
|
1559
|
+
function _temp4(state) {
|
|
1698
1560
|
return state.context.selection;
|
|
1699
1561
|
}
|
|
1700
|
-
function
|
|
1562
|
+
function _temp5(state_0) {
|
|
1701
1563
|
return state_0.context.isPageEditorSidebarOpen;
|
|
1702
1564
|
}
|
|
1703
|
-
function
|
|
1565
|
+
function _temp6(state_1) {
|
|
1704
1566
|
return state_1.context.isAddBlockSidebarOpen;
|
|
1705
1567
|
}
|
|
1706
|
-
function
|
|
1568
|
+
function _temp7(item) {
|
|
1707
1569
|
return item.content;
|
|
1708
1570
|
}
|
|
1709
|
-
function
|
|
1571
|
+
function _temp8(state) {
|
|
1710
1572
|
return state.context.selection;
|
|
1711
1573
|
}
|
|
1712
|
-
function
|
|
1574
|
+
function _temp9(state_0) {
|
|
1713
1575
|
return state_0.context.isAddBlockSidebarOpen;
|
|
1714
1576
|
}
|
|
1715
1577
|
|