camox 0.6.1 → 0.7.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/components/AddBlockControlBar.d.ts.map +1 -1
- package/dist/core/components/AddBlockControlBar.js +51 -117
- package/dist/core/components/lexical/InlineLexicalEditor.js +1 -1
- package/dist/core/components/lexical/SidebarLexicalEditor.js +1 -1
- package/dist/core/createApp.d.ts +314 -44
- package/dist/core/createApp.d.ts.map +1 -1
- package/dist/core/createBlock.d.ts +160 -22
- package/dist/core/createBlock.d.ts.map +1 -1
- package/dist/core/createBlock.js +467 -579
- package/dist/features/content/components/AssetCard.js +1 -1
- package/dist/features/preview/CamoxPreview.d.ts.map +1 -1
- package/dist/features/preview/CamoxPreview.js +12 -16
- package/dist/features/preview/components/AddBlockSheet.d.ts.map +1 -1
- package/dist/features/preview/components/AddBlockSheet.js +1 -2
- package/dist/features/preview/components/AssetLightbox.d.ts.map +1 -1
- package/dist/features/preview/components/AssetLightbox.js +13 -15
- package/dist/features/preview/components/BlockActionsPopover.d.ts.map +1 -1
- package/dist/features/preview/components/BlockActionsPopover.js +19 -22
- package/dist/features/preview/components/CreatePageSheet.d.ts.map +1 -1
- package/dist/features/preview/components/CreatePageSheet.js +10 -4
- package/dist/features/preview/components/EditPageSheet.d.ts +1 -1
- package/dist/features/preview/components/EditPageSheet.d.ts.map +1 -1
- package/dist/features/preview/components/EditPageSheet.js +20 -17
- package/dist/features/preview/components/FieldOverlayStyles.d.ts +2 -0
- package/dist/features/preview/components/FieldOverlayStyles.d.ts.map +1 -0
- package/dist/features/preview/components/FieldOverlayStyles.js +15 -0
- package/dist/features/preview/components/Frame.d.ts +20 -0
- package/dist/features/preview/components/Frame.d.ts.map +1 -0
- package/dist/features/preview/components/Frame.js +162 -0
- package/dist/features/preview/components/LinkFieldEditor.d.ts.map +1 -1
- package/dist/features/preview/components/LinkFieldEditor.js +11 -12
- package/dist/features/preview/components/OverlayTracker.js +1 -1
- package/dist/features/preview/components/PageContentSheet.d.ts.map +1 -1
- package/dist/features/preview/components/PageContentSheet.js +3 -3
- package/dist/features/preview/components/PageLocationFieldset.d.ts.map +1 -1
- package/dist/features/preview/components/PageLocationFieldset.js +9 -11
- package/dist/features/preview/components/PagePicker.d.ts.map +1 -1
- package/dist/features/preview/components/PagePicker.js +15 -15
- package/dist/features/preview/components/PageTree.d.ts.map +1 -1
- package/dist/features/preview/components/PageTree.js +215 -203
- package/dist/features/preview/components/PreviewPanel.d.ts.map +1 -1
- package/dist/features/preview/components/PreviewPanel.js +21 -15
- package/dist/features/preview/components/PreviewSideSheet.d.ts.map +1 -1
- package/dist/features/preview/components/PreviewSideSheet.js +42 -26
- package/dist/features/preview/components/PreviewToolbar.d.ts.map +1 -1
- package/dist/features/preview/components/PreviewToolbar.js +191 -171
- package/dist/features/preview/components/RepeatableItemsList.d.ts.map +1 -1
- package/dist/features/preview/components/RepeatableItemsList.js +4 -5
- package/dist/features/preview/components/TextFormatToolbar.d.ts.map +1 -1
- package/dist/features/preview/components/TextFormatToolbar.js +5 -6
- package/dist/features/preview/components/UnlinkAssetButton.d.ts.map +1 -1
- package/dist/features/preview/components/UnlinkAssetButton.js +70 -91
- package/dist/features/preview/studio-overlays.css?inline.js +4 -0
- package/dist/features/provider/components/CamoxAppContext.d.ts +314 -44
- package/dist/features/provider/components/CamoxAppContext.d.ts.map +1 -1
- package/dist/features/provider/components/CommandPalette.d.ts.map +1 -1
- package/dist/features/provider/components/CommandPalette.js +22 -14
- package/dist/features/studio/CamoxStudio.d.ts +2 -3
- package/dist/features/studio/CamoxStudio.d.ts.map +1 -1
- package/dist/features/studio/components/EnvironmentMenu.d.ts.map +1 -1
- package/dist/features/studio/components/EnvironmentMenu.js +39 -35
- package/dist/features/studio/components/Navbar.js +2 -2
- package/dist/features/studio/components/ProjectMenu.d.ts.map +1 -1
- package/dist/features/studio/components/ProjectMenu.js +143 -129
- package/dist/features/studio/components/UserButton.d.ts.map +1 -1
- package/dist/features/studio/components/UserButton.js +8 -9
- package/dist/features/vite/vite.d.ts +2 -0
- package/dist/features/vite/vite.d.ts.map +1 -1
- package/dist/features/vite/vite.js +26 -30
- package/dist/lib/api-client.d.ts +17 -17
- package/dist/lib/queries.d.ts +7 -7
- package/dist/studio.css +1 -1
- package/package.json +5 -6
- package/skills/camox-block/SKILL.md +55 -28
- package/dist/features/preview/overlayConstants.d.ts +0 -19
- package/dist/features/preview/overlayConstants.d.ts.map +0 -1
- package/dist/features/preview/overlayConstants.js +0 -21
package/dist/core/createBlock.js
CHANGED
|
@@ -2,7 +2,7 @@ import { previewStore } from "../features/preview/previewStore.js";
|
|
|
2
2
|
import { useIsPreviewSheetOpen } from "../features/preview/components/PreviewSideSheet.js";
|
|
3
3
|
import { useProjectSlug } from "../lib/auth.js";
|
|
4
4
|
import { blockMutations, pageQueries, projectQueries, repeatableItemMutations } from "../lib/queries.js";
|
|
5
|
-
import {
|
|
5
|
+
import { useFrame } from "../features/preview/components/Frame.js";
|
|
6
6
|
import { postOverlayMessage } from "../features/preview/overlayMessages.js";
|
|
7
7
|
import { isFileMarker, isItemMarker, resolveFileMarker, useNormalizedData } from "../lib/normalized-data.js";
|
|
8
8
|
import { AddBlockControlBar } from "./components/AddBlockControlBar.js";
|
|
@@ -13,13 +13,11 @@ import { useOverlayMessage } from "./hooks/useOverlayMessage.js";
|
|
|
13
13
|
import { Type } from "./lib/contentType.js";
|
|
14
14
|
import { markdownToReactNodes } from "./lib/lexicalReact.js";
|
|
15
15
|
import { c } from "react/compiler-runtime";
|
|
16
|
-
import { useFrame } from "@camox/ui/frame";
|
|
17
16
|
import { Input } from "@camox/ui/input";
|
|
18
17
|
import { Kbd } from "@camox/ui/kbd";
|
|
19
18
|
import { Label } from "@camox/ui/label";
|
|
20
|
-
import { Popover,
|
|
19
|
+
import { Popover, PopoverContent, PopoverTrigger } from "@camox/ui/popover";
|
|
21
20
|
import { toast } from "@camox/ui/toaster";
|
|
22
|
-
import { Slot } from "@radix-ui/react-slot";
|
|
23
21
|
import { Type as Type$1 } from "@sinclair/typebox";
|
|
24
22
|
import { useMutation, useQuery } from "@tanstack/react-query";
|
|
25
23
|
import { useSelector } from "@xstate/store/react";
|
|
@@ -179,7 +177,6 @@ function createBlock(options) {
|
|
|
179
177
|
if (!blockContext) throw new Error("Field must be used within a Block Component");
|
|
180
178
|
const { blockId, content, mode } = blockContext;
|
|
181
179
|
const isContentEditable = useIsEditable(mode);
|
|
182
|
-
const colors = mode === "layout" ? LAYOUT_OVERLAY_COLORS : OVERLAY_COLORS;
|
|
183
180
|
const elementRef = React.useRef(null);
|
|
184
181
|
const { window: iframeWindow } = useFrame();
|
|
185
182
|
const repeaterContext = React.use(RepeaterItemContext);
|
|
@@ -242,34 +239,32 @@ function createBlock(options) {
|
|
|
242
239
|
const handleMouseLeave = () => {
|
|
243
240
|
if (isContentEditable) setIsHovered(false);
|
|
244
241
|
};
|
|
245
|
-
const
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
} : void 0;
|
|
249
|
-
if (!isContentEditable) return /* @__PURE__ */ jsx(Fragment, { children: children(markdownToReactNodes(fieldValue)) });
|
|
250
|
-
return /* @__PURE__ */ jsx(Slot, {
|
|
242
|
+
const fieldData = { text: fieldValue };
|
|
243
|
+
if (!isContentEditable) return /* @__PURE__ */ jsx(Fragment, { children: children({ children: markdownToReactNodes(fieldValue) }, fieldData) });
|
|
244
|
+
return /* @__PURE__ */ jsx(Fragment, { children: children({
|
|
251
245
|
ref: elementRef,
|
|
252
246
|
"data-camox-field-id": fieldId,
|
|
247
|
+
"data-camox-hovered": isHovered || void 0,
|
|
248
|
+
"data-camox-focused": isFocused || void 0,
|
|
249
|
+
"data-camox-overlay-mode": mode === "layout" ? "layout" : void 0,
|
|
253
250
|
onMouseEnter: handleMouseEnter,
|
|
254
251
|
onMouseLeave: handleMouseLeave,
|
|
255
|
-
|
|
256
|
-
children: children(/* @__PURE__ */ jsx(InlineLexicalEditor, {
|
|
252
|
+
children: /* @__PURE__ */ jsx(InlineLexicalEditor, {
|
|
257
253
|
initialState: fieldValue,
|
|
258
254
|
externalState: fieldValue,
|
|
259
255
|
onChange: handleChange,
|
|
260
256
|
onFocus: handleFocus,
|
|
261
257
|
onBlur: handleBlur
|
|
262
|
-
})
|
|
263
|
-
});
|
|
258
|
+
})
|
|
259
|
+
}, fieldData) });
|
|
264
260
|
};
|
|
265
261
|
const Embed = (t0) => {
|
|
266
|
-
const $ = c(
|
|
262
|
+
const $ = c(58);
|
|
267
263
|
const { name, children } = t0;
|
|
268
264
|
const blockContext = React.use(Context);
|
|
269
265
|
if (!blockContext) throw new Error("Embed must be used within a Block Component");
|
|
270
266
|
const { blockId, content, mode } = blockContext;
|
|
271
267
|
const isContentEditable = useIsEditable(mode);
|
|
272
|
-
const colors = mode === "layout" ? LAYOUT_OVERLAY_COLORS : OVERLAY_COLORS;
|
|
273
268
|
const { window: iframeWindow } = useFrame();
|
|
274
269
|
const repeaterContext = React.use(RepeaterItemContext);
|
|
275
270
|
const fieldValue = repeaterContext ? repeaterContext.itemContent[name] : content[name];
|
|
@@ -378,7 +373,7 @@ function createBlock(options) {
|
|
|
378
373
|
const handleUrlChange = t12;
|
|
379
374
|
let t13;
|
|
380
375
|
if ($[23] !== blockId || $[24] !== name || $[25] !== repeaterContext) {
|
|
381
|
-
t13 = (open) => {
|
|
376
|
+
t13 = (open, _eventDetails) => {
|
|
382
377
|
setIsOpen(open);
|
|
383
378
|
if (open) if (repeaterContext?.itemId) previewStore.send({
|
|
384
379
|
type: "selectItemField",
|
|
@@ -402,72 +397,78 @@ function createBlock(options) {
|
|
|
402
397
|
const handleOpenChange = t13;
|
|
403
398
|
const t14 = isContentEditable ? isOpen : false;
|
|
404
399
|
const t15 = isContentEditable ? handleOpenChange : void 0;
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
let
|
|
411
|
-
if ($[
|
|
412
|
-
|
|
413
|
-
$[
|
|
414
|
-
$[
|
|
415
|
-
} else
|
|
416
|
-
let
|
|
417
|
-
if ($[
|
|
418
|
-
|
|
419
|
-
$[
|
|
420
|
-
$[
|
|
421
|
-
} else
|
|
422
|
-
let
|
|
423
|
-
if ($[32] !==
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
400
|
+
const t16 = isContentEditable ? fieldId : void 0;
|
|
401
|
+
const t17 = isContentEditable ? "embed" : void 0;
|
|
402
|
+
const t18 = isContentEditable && isHovered || void 0;
|
|
403
|
+
const t19 = isContentEditable && isOpen || void 0;
|
|
404
|
+
const t20 = mode === "layout" ? "layout" : void 0;
|
|
405
|
+
let t21;
|
|
406
|
+
if ($[27] !== isContentEditable) {
|
|
407
|
+
t21 = isContentEditable ? () => setIsHovered(true) : void 0;
|
|
408
|
+
$[27] = isContentEditable;
|
|
409
|
+
$[28] = t21;
|
|
410
|
+
} else t21 = $[28];
|
|
411
|
+
let t22;
|
|
412
|
+
if ($[29] !== isContentEditable) {
|
|
413
|
+
t22 = isContentEditable ? () => setIsHovered(false) : void 0;
|
|
414
|
+
$[29] = isContentEditable;
|
|
415
|
+
$[30] = t22;
|
|
416
|
+
} else t22 = $[30];
|
|
417
|
+
let t23;
|
|
418
|
+
if ($[31] !== t16 || $[32] !== t17 || $[33] !== t18 || $[34] !== t19 || $[35] !== t20 || $[36] !== t21 || $[37] !== t22) {
|
|
419
|
+
t23 = /* @__PURE__ */ jsx("div", {
|
|
420
|
+
"data-camox-field-id": t16,
|
|
421
|
+
"data-camox-field-type": t17,
|
|
422
|
+
"data-camox-hovered": t18,
|
|
423
|
+
"data-camox-focused": t19,
|
|
424
|
+
"data-camox-overlay-mode": t20,
|
|
425
|
+
onMouseEnter: t21,
|
|
426
|
+
onMouseLeave: t22
|
|
427
|
+
});
|
|
428
|
+
$[31] = t16;
|
|
429
|
+
$[32] = t17;
|
|
430
|
+
$[33] = t18;
|
|
427
431
|
$[34] = t19;
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
+
$[35] = t20;
|
|
433
|
+
$[36] = t21;
|
|
434
|
+
$[37] = t22;
|
|
435
|
+
$[38] = t23;
|
|
436
|
+
} else t23 = $[38];
|
|
437
|
+
let t24;
|
|
438
|
+
if ($[39] !== children || $[40] !== fieldValue) {
|
|
439
|
+
t24 = children({ src: fieldValue }, { url: fieldValue });
|
|
440
|
+
$[39] = children;
|
|
441
|
+
$[40] = fieldValue;
|
|
442
|
+
$[41] = t24;
|
|
443
|
+
} else t24 = $[41];
|
|
444
|
+
let t25;
|
|
445
|
+
if ($[42] !== isContentEditable) {
|
|
446
|
+
t25 = isContentEditable && /* @__PURE__ */ jsx("div", {
|
|
432
447
|
style: {
|
|
433
448
|
position: "absolute",
|
|
434
449
|
inset: 0,
|
|
435
450
|
zIndex: 10
|
|
436
451
|
},
|
|
437
452
|
onClick: _temp
|
|
438
|
-
}), (isHovered || isOpen) && /* @__PURE__ */ jsx("div", { style: {
|
|
439
|
-
position: "absolute",
|
|
440
|
-
inset: isOpen ? OVERLAY_OFFSETS.blockSelected : OVERLAY_OFFSETS.blockHover,
|
|
441
|
-
border: `${isOpen ? OVERLAY_WIDTHS.selected : OVERLAY_WIDTHS.hover} solid ${isOpen ? colors.selected : colors.hover}`,
|
|
442
|
-
pointerEvents: "none",
|
|
443
|
-
zIndex: 11
|
|
444
|
-
} })] });
|
|
445
|
-
$[35] = colors;
|
|
446
|
-
$[36] = isContentEditable;
|
|
447
|
-
$[37] = isHovered;
|
|
448
|
-
$[38] = isOpen;
|
|
449
|
-
$[39] = t20;
|
|
450
|
-
} else t20 = $[39];
|
|
451
|
-
let t21;
|
|
452
|
-
if ($[40] !== t17 || $[41] !== t18 || $[42] !== t19 || $[43] !== t20) {
|
|
453
|
-
t21 = /* @__PURE__ */ jsx(PopoverTrigger, {
|
|
454
|
-
asChild: true,
|
|
455
|
-
children: /* @__PURE__ */ jsxs("div", {
|
|
456
|
-
style: t16,
|
|
457
|
-
onMouseEnter: t17,
|
|
458
|
-
onMouseLeave: t18,
|
|
459
|
-
children: [t19, t20]
|
|
460
|
-
})
|
|
461
453
|
});
|
|
462
|
-
$[
|
|
463
|
-
$[
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
454
|
+
$[42] = isContentEditable;
|
|
455
|
+
$[43] = t25;
|
|
456
|
+
} else t25 = $[43];
|
|
457
|
+
let t26;
|
|
458
|
+
if ($[44] !== t23 || $[45] !== t24 || $[46] !== t25) {
|
|
459
|
+
t26 = /* @__PURE__ */ jsxs(PopoverTrigger, {
|
|
460
|
+
render: t23,
|
|
461
|
+
nativeButton: false,
|
|
462
|
+
children: [t24, t25]
|
|
463
|
+
});
|
|
464
|
+
$[44] = t23;
|
|
465
|
+
$[45] = t24;
|
|
466
|
+
$[46] = t25;
|
|
467
|
+
$[47] = t26;
|
|
468
|
+
} else t26 = $[47];
|
|
469
|
+
let t27;
|
|
470
|
+
if ($[48] !== handleUrlChange || $[49] !== isContentEditable || $[50] !== name || $[51] !== urlValue) {
|
|
471
|
+
t27 = isContentEditable && /* @__PURE__ */ jsx(PopoverContent, {
|
|
471
472
|
className: "w-96 gap-2",
|
|
472
473
|
children: /* @__PURE__ */ jsxs("form", {
|
|
473
474
|
className: "grid gap-2",
|
|
@@ -482,35 +483,34 @@ function createBlock(options) {
|
|
|
482
483
|
})]
|
|
483
484
|
})
|
|
484
485
|
});
|
|
485
|
-
$[
|
|
486
|
-
$[
|
|
487
|
-
$[
|
|
488
|
-
$[
|
|
489
|
-
$[
|
|
490
|
-
} else
|
|
491
|
-
let
|
|
492
|
-
if ($[
|
|
493
|
-
|
|
486
|
+
$[48] = handleUrlChange;
|
|
487
|
+
$[49] = isContentEditable;
|
|
488
|
+
$[50] = name;
|
|
489
|
+
$[51] = urlValue;
|
|
490
|
+
$[52] = t27;
|
|
491
|
+
} else t27 = $[52];
|
|
492
|
+
let t28;
|
|
493
|
+
if ($[53] !== t14 || $[54] !== t15 || $[55] !== t26 || $[56] !== t27) {
|
|
494
|
+
t28 = /* @__PURE__ */ jsxs(Popover, {
|
|
494
495
|
open: t14,
|
|
495
496
|
onOpenChange: t15,
|
|
496
|
-
children: [
|
|
497
|
+
children: [t26, t27]
|
|
497
498
|
});
|
|
498
|
-
$[
|
|
499
|
-
$[
|
|
500
|
-
$[
|
|
501
|
-
$[
|
|
502
|
-
$[
|
|
503
|
-
} else
|
|
504
|
-
return
|
|
499
|
+
$[53] = t14;
|
|
500
|
+
$[54] = t15;
|
|
501
|
+
$[55] = t26;
|
|
502
|
+
$[56] = t27;
|
|
503
|
+
$[57] = t28;
|
|
504
|
+
} else t28 = $[57];
|
|
505
|
+
return t28;
|
|
505
506
|
};
|
|
506
507
|
const Link = (t0) => {
|
|
507
|
-
const $ = c(
|
|
508
|
+
const $ = c(36);
|
|
508
509
|
const { name, children } = t0;
|
|
509
510
|
const blockContext = React.use(Context);
|
|
510
511
|
if (!blockContext) throw new Error("Link must be used within a Block Component");
|
|
511
512
|
const { blockId, content, mode } = blockContext;
|
|
512
513
|
const isContentEditable = useIsEditable(mode);
|
|
513
|
-
const colors = mode === "layout" ? LAYOUT_OVERLAY_COLORS : OVERLAY_COLORS;
|
|
514
514
|
const elementRef = React.useRef(null);
|
|
515
515
|
const { window: iframeWindow } = useFrame();
|
|
516
516
|
const repeaterContext = React.use(RepeaterItemContext);
|
|
@@ -554,16 +554,7 @@ function createBlock(options) {
|
|
|
554
554
|
} else t6 = $[8];
|
|
555
555
|
const { data: pages } = useQuery(t6);
|
|
556
556
|
const resolvedHref = resolveLinkHref(fieldValue, pages);
|
|
557
|
-
const
|
|
558
|
-
let t8;
|
|
559
|
-
if ($[9] !== blockId || $[10] !== repeaterContext || $[11] !== t7) {
|
|
560
|
-
t8 = getOverlayFieldId(blockId, repeaterContext, t7);
|
|
561
|
-
$[9] = blockId;
|
|
562
|
-
$[10] = repeaterContext;
|
|
563
|
-
$[11] = t7;
|
|
564
|
-
$[12] = t8;
|
|
565
|
-
} else t8 = $[12];
|
|
566
|
-
const fieldId = t8;
|
|
557
|
+
const fieldId = getOverlayFieldId(blockId, repeaterContext, String(name));
|
|
567
558
|
const [isEditing, setIsEditing] = React.useState(false);
|
|
568
559
|
const [displayText, setDisplayText] = React.useState(fieldValue.text);
|
|
569
560
|
const [isHovered, setIsHovered] = React.useState(false);
|
|
@@ -573,31 +564,25 @@ function createBlock(options) {
|
|
|
573
564
|
React.useEffect(() => {
|
|
574
565
|
if (!isEditing) setDisplayText(fieldValue.text);
|
|
575
566
|
}, [fieldValue.text, isEditing]);
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
} else t9 = $[14];
|
|
582
|
-
const isHoveredFromSidebar = useOverlayMessage(iframeWindow, isContentEditable, "CAMOX_HOVER_FIELD", "CAMOX_HOVER_FIELD_END", t9);
|
|
583
|
-
let t10;
|
|
584
|
-
let t11;
|
|
585
|
-
if ($[15] !== isHoveredFromSidebar) {
|
|
586
|
-
t10 = () => {
|
|
567
|
+
const isHoveredFromSidebar = useOverlayMessage(iframeWindow, isContentEditable, "CAMOX_HOVER_FIELD", "CAMOX_HOVER_FIELD_END", { fieldId });
|
|
568
|
+
let t7;
|
|
569
|
+
let t8;
|
|
570
|
+
if ($[9] !== isHoveredFromSidebar) {
|
|
571
|
+
t7 = () => {
|
|
587
572
|
setIsHovered(isHoveredFromSidebar);
|
|
588
573
|
};
|
|
589
|
-
|
|
590
|
-
$[
|
|
591
|
-
$[
|
|
592
|
-
$[
|
|
574
|
+
t8 = [isHoveredFromSidebar];
|
|
575
|
+
$[9] = isHoveredFromSidebar;
|
|
576
|
+
$[10] = t7;
|
|
577
|
+
$[11] = t8;
|
|
593
578
|
} else {
|
|
594
|
-
|
|
595
|
-
|
|
579
|
+
t7 = $[10];
|
|
580
|
+
t8 = $[11];
|
|
596
581
|
}
|
|
597
|
-
React.useEffect(
|
|
598
|
-
let
|
|
599
|
-
if ($[
|
|
600
|
-
|
|
582
|
+
React.useEffect(t7, t8);
|
|
583
|
+
let t9;
|
|
584
|
+
if ($[12] !== blockId || $[13] !== name || $[14] !== repeaterContext || $[15] !== updateBlockContent || $[16] !== updateRepeatableContent) {
|
|
585
|
+
t9 = (newLinkValue) => {
|
|
601
586
|
if (repeaterContext?.itemId) updateRepeatableContent.mutate({
|
|
602
587
|
id: Number(repeaterContext.itemId),
|
|
603
588
|
content: { [name]: newLinkValue }
|
|
@@ -607,14 +592,14 @@ function createBlock(options) {
|
|
|
607
592
|
content: { [name]: newLinkValue }
|
|
608
593
|
});
|
|
609
594
|
};
|
|
610
|
-
$[
|
|
611
|
-
$[
|
|
612
|
-
$[
|
|
613
|
-
$[
|
|
614
|
-
$[
|
|
615
|
-
$[
|
|
616
|
-
} else
|
|
617
|
-
const saveLinkValue =
|
|
595
|
+
$[12] = blockId;
|
|
596
|
+
$[13] = name;
|
|
597
|
+
$[14] = repeaterContext;
|
|
598
|
+
$[15] = updateBlockContent;
|
|
599
|
+
$[16] = updateRepeatableContent;
|
|
600
|
+
$[17] = t9;
|
|
601
|
+
} else t9 = $[17];
|
|
602
|
+
const saveLinkValue = t9;
|
|
618
603
|
const handleInput = (e) => {
|
|
619
604
|
const newText = e.target.textContent || "";
|
|
620
605
|
saveLinkValue({
|
|
@@ -622,9 +607,9 @@ function createBlock(options) {
|
|
|
622
607
|
text: newText
|
|
623
608
|
});
|
|
624
609
|
};
|
|
625
|
-
let
|
|
626
|
-
if ($[
|
|
627
|
-
|
|
610
|
+
let t10;
|
|
611
|
+
if ($[18] !== blockId || $[19] !== name || $[20] !== repeaterContext) {
|
|
612
|
+
t10 = () => {
|
|
628
613
|
setIsEditing(true);
|
|
629
614
|
setIsEditorFocused(true);
|
|
630
615
|
if (repeaterContext?.itemId) previewStore.send({
|
|
@@ -641,202 +626,165 @@ function createBlock(options) {
|
|
|
641
626
|
fieldType: "Link"
|
|
642
627
|
});
|
|
643
628
|
};
|
|
644
|
-
$[
|
|
645
|
-
$[
|
|
646
|
-
$[
|
|
647
|
-
$[
|
|
648
|
-
} else
|
|
649
|
-
const handleFocus =
|
|
650
|
-
let
|
|
651
|
-
if ($[
|
|
652
|
-
|
|
629
|
+
$[18] = blockId;
|
|
630
|
+
$[19] = name;
|
|
631
|
+
$[20] = repeaterContext;
|
|
632
|
+
$[21] = t10;
|
|
633
|
+
} else t10 = $[21];
|
|
634
|
+
const handleFocus = t10;
|
|
635
|
+
let t11;
|
|
636
|
+
if ($[22] === Symbol.for("react.memo_cache_sentinel")) {
|
|
637
|
+
t11 = () => {
|
|
653
638
|
setIsEditing(false);
|
|
654
639
|
setIsEditorFocused(false);
|
|
655
640
|
};
|
|
656
|
-
$[
|
|
657
|
-
} else
|
|
658
|
-
const handleBlur =
|
|
659
|
-
let
|
|
660
|
-
if ($[
|
|
661
|
-
|
|
641
|
+
$[22] = t11;
|
|
642
|
+
} else t11 = $[22];
|
|
643
|
+
const handleBlur = t11;
|
|
644
|
+
let t12;
|
|
645
|
+
if ($[23] === Symbol.for("react.memo_cache_sentinel")) {
|
|
646
|
+
t12 = (e_0) => {
|
|
662
647
|
e_0.stopPropagation();
|
|
663
648
|
previewStore.send({ type: "toggleContentSheet" });
|
|
664
649
|
setIsEditorFocused(false);
|
|
665
650
|
setIsEditing(false);
|
|
666
651
|
};
|
|
667
|
-
$[
|
|
668
|
-
} else
|
|
669
|
-
const handleEditLink =
|
|
670
|
-
const
|
|
671
|
-
const t16 = isContentEditable && isEditorFocused;
|
|
672
|
-
const T1 = PopoverAnchor;
|
|
673
|
-
const t17 = true;
|
|
674
|
-
const T2 = Slot;
|
|
675
|
-
const t18 = isContentEditable ? fieldId : void 0;
|
|
676
|
-
const t19 = isContentEditable ? _temp2 : void 0;
|
|
677
|
-
let t20;
|
|
678
|
-
if ($[30] !== isContentEditable) {
|
|
679
|
-
t20 = isContentEditable ? () => setIsHovered(true) : void 0;
|
|
680
|
-
$[30] = isContentEditable;
|
|
681
|
-
$[31] = t20;
|
|
682
|
-
} else t20 = $[31];
|
|
683
|
-
let t21;
|
|
684
|
-
if ($[32] !== isContentEditable) {
|
|
685
|
-
t21 = isContentEditable ? () => setIsHovered(false) : void 0;
|
|
686
|
-
$[32] = isContentEditable;
|
|
687
|
-
$[33] = t21;
|
|
688
|
-
} else t21 = $[33];
|
|
689
|
-
const t22 = _temp3;
|
|
690
|
-
const t23 = false;
|
|
691
|
-
const t24 = true;
|
|
692
|
-
let t25;
|
|
693
|
-
if ($[34] !== colors || $[35] !== isContentEditable || $[36] !== isFocused || $[37] !== isHovered) {
|
|
694
|
-
t25 = isContentEditable && (isHovered || isFocused) ? {
|
|
695
|
-
outline: `${isFocused ? OVERLAY_WIDTHS.selected : OVERLAY_WIDTHS.hover} solid ${isFocused ? colors.selected : colors.hover}`,
|
|
696
|
-
outlineOffset: isFocused ? OVERLAY_OFFSETS.fieldSelected : OVERLAY_OFFSETS.fieldHover
|
|
697
|
-
} : void 0;
|
|
698
|
-
$[34] = colors;
|
|
699
|
-
$[35] = isContentEditable;
|
|
700
|
-
$[36] = isFocused;
|
|
701
|
-
$[37] = isHovered;
|
|
702
|
-
$[38] = t25;
|
|
703
|
-
} else t25 = $[38];
|
|
704
|
-
const t26 = children({
|
|
652
|
+
$[23] = t12;
|
|
653
|
+
} else t12 = $[23];
|
|
654
|
+
const handleEditLink = t12;
|
|
655
|
+
const linkData = {
|
|
705
656
|
text: displayText,
|
|
706
657
|
href: resolvedHref,
|
|
707
658
|
newTab: fieldValue.newTab
|
|
708
|
-
}
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
659
|
+
};
|
|
660
|
+
if (!isContentEditable) return /* @__PURE__ */ jsx(Fragment, { children: children({
|
|
661
|
+
to: resolvedHref,
|
|
662
|
+
target: fieldValue.newTab ? "_blank" : void 0,
|
|
663
|
+
rel: fieldValue.newTab ? "noreferrer" : void 0,
|
|
664
|
+
children: fieldValue.text
|
|
665
|
+
}, linkData) });
|
|
666
|
+
let t13;
|
|
667
|
+
let t14;
|
|
668
|
+
if ($[24] === Symbol.for("react.memo_cache_sentinel")) {
|
|
669
|
+
t13 = () => setIsHovered(true);
|
|
670
|
+
t14 = () => setIsHovered(false);
|
|
671
|
+
$[24] = t13;
|
|
672
|
+
$[25] = t14;
|
|
673
|
+
} else {
|
|
674
|
+
t13 = $[24];
|
|
675
|
+
t14 = $[25];
|
|
676
|
+
}
|
|
677
|
+
const linkProps = {
|
|
678
|
+
ref: elementRef,
|
|
679
|
+
to: resolvedHref,
|
|
680
|
+
target: fieldValue.newTab ? "_blank" : void 0,
|
|
681
|
+
rel: fieldValue.newTab ? "noreferrer" : void 0,
|
|
682
|
+
children: displayText,
|
|
683
|
+
"data-camox-field-id": fieldId,
|
|
684
|
+
"data-camox-hovered": isHovered || void 0,
|
|
685
|
+
"data-camox-focused": isFocused || void 0,
|
|
686
|
+
"data-camox-overlay-mode": mode === "layout" ? "layout" : void 0,
|
|
687
|
+
contentEditable: true,
|
|
688
|
+
onClick: _temp2,
|
|
689
|
+
onInput: handleInput,
|
|
690
|
+
onFocus: handleFocus,
|
|
691
|
+
onBlur: handleBlur,
|
|
692
|
+
onMouseEnter: t13,
|
|
693
|
+
onMouseLeave: t14,
|
|
694
|
+
onKeyDown: _temp3,
|
|
695
|
+
spellCheck: false,
|
|
696
|
+
suppressContentEditableWarning: true
|
|
697
|
+
};
|
|
698
|
+
const T0 = Popover;
|
|
699
|
+
const t15 = children(linkProps, linkData);
|
|
700
|
+
let t16;
|
|
701
|
+
if ($[26] !== handleEditLink) {
|
|
702
|
+
t16 = /* @__PURE__ */ jsx("button", {
|
|
703
|
+
type: "button",
|
|
704
|
+
className: "hover:bg-accent flex items-center gap-1.5 rounded-md px-2 py-1 text-sm transition-colors",
|
|
705
|
+
onMouseDown: _temp4,
|
|
706
|
+
onClick: handleEditLink,
|
|
707
|
+
children: "Edit link"
|
|
746
708
|
});
|
|
747
|
-
$[
|
|
748
|
-
$[
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
t29 = isContentEditable && /* @__PURE__ */ jsx(PopoverContent, {
|
|
709
|
+
$[26] = handleEditLink;
|
|
710
|
+
$[27] = t16;
|
|
711
|
+
} else t16 = $[27];
|
|
712
|
+
let t17;
|
|
713
|
+
if ($[28] !== elementRef || $[29] !== t16) {
|
|
714
|
+
t17 = /* @__PURE__ */ jsx(PopoverContent, {
|
|
754
715
|
className: "w-auto p-2",
|
|
755
|
-
|
|
716
|
+
initialFocus: false,
|
|
717
|
+
anchor: elementRef,
|
|
756
718
|
align: "end",
|
|
757
|
-
children:
|
|
758
|
-
type: "button",
|
|
759
|
-
className: "hover:bg-accent flex items-center gap-1.5 rounded-md px-2 py-1 text-sm transition-colors",
|
|
760
|
-
onMouseDown: _temp5,
|
|
761
|
-
onClick: handleEditLink,
|
|
762
|
-
children: "Edit link"
|
|
763
|
-
})
|
|
719
|
+
children: t16
|
|
764
720
|
});
|
|
765
|
-
$[
|
|
766
|
-
$[
|
|
767
|
-
$[
|
|
768
|
-
} else
|
|
769
|
-
let
|
|
770
|
-
if ($[
|
|
771
|
-
|
|
772
|
-
open:
|
|
773
|
-
children: [
|
|
721
|
+
$[28] = elementRef;
|
|
722
|
+
$[29] = t16;
|
|
723
|
+
$[30] = t17;
|
|
724
|
+
} else t17 = $[30];
|
|
725
|
+
let t18;
|
|
726
|
+
if ($[31] !== T0 || $[32] !== isEditorFocused || $[33] !== t15 || $[34] !== t17) {
|
|
727
|
+
t18 = /* @__PURE__ */ jsxs(T0, {
|
|
728
|
+
open: isEditorFocused,
|
|
729
|
+
children: [t15, t17]
|
|
774
730
|
});
|
|
775
|
-
$[
|
|
776
|
-
$[
|
|
777
|
-
$[
|
|
778
|
-
$[
|
|
779
|
-
$[
|
|
780
|
-
} else
|
|
781
|
-
return
|
|
731
|
+
$[31] = T0;
|
|
732
|
+
$[32] = isEditorFocused;
|
|
733
|
+
$[33] = t15;
|
|
734
|
+
$[34] = t17;
|
|
735
|
+
$[35] = t18;
|
|
736
|
+
} else t18 = $[35];
|
|
737
|
+
return t18;
|
|
782
738
|
};
|
|
783
739
|
const Image = (t0) => {
|
|
784
|
-
const $ = c(
|
|
740
|
+
const $ = c(25);
|
|
785
741
|
const { name, children } = t0;
|
|
786
742
|
const blockContext = React.use(Context);
|
|
787
743
|
if (!blockContext) throw new Error("Image must be used within a Block Component");
|
|
788
744
|
const { blockId, content, mode } = blockContext;
|
|
789
745
|
const isContentEditable = useIsEditable(mode);
|
|
790
|
-
const colors = mode === "layout" ? LAYOUT_OVERLAY_COLORS : OVERLAY_COLORS;
|
|
791
746
|
const { window: iframeWindow } = useFrame();
|
|
792
747
|
const repeaterContext = React.use(RepeaterItemContext);
|
|
793
748
|
const { filesMap } = useNormalizedData();
|
|
794
749
|
const rawSource = repeaterContext ? repeaterContext.itemContent[name] : content[name];
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
750
|
+
const fieldValue = (isFileMarker(rawSource) ? resolveFileMarker(rawSource, filesMap) : rawSource) ?? contentDefaults[String(name)];
|
|
751
|
+
const t1 = String(name);
|
|
752
|
+
let t2;
|
|
753
|
+
if ($[0] !== blockId || $[1] !== repeaterContext || $[2] !== t1) {
|
|
754
|
+
t2 = getOverlayFieldId(blockId, repeaterContext, t1);
|
|
755
|
+
$[0] = blockId;
|
|
756
|
+
$[1] = repeaterContext;
|
|
800
757
|
$[2] = t1;
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
const
|
|
804
|
-
let t3;
|
|
805
|
-
if ($[3] !== blockId || $[4] !== repeaterContext || $[5] !== t2) {
|
|
806
|
-
t3 = getOverlayFieldId(blockId, repeaterContext, t2);
|
|
807
|
-
$[3] = blockId;
|
|
808
|
-
$[4] = repeaterContext;
|
|
809
|
-
$[5] = t2;
|
|
810
|
-
$[6] = t3;
|
|
811
|
-
} else t3 = $[6];
|
|
812
|
-
const fieldId = t3;
|
|
758
|
+
$[3] = t2;
|
|
759
|
+
} else t2 = $[3];
|
|
760
|
+
const fieldId = t2;
|
|
813
761
|
const [isHovered, setIsHovered] = React.useState(false);
|
|
814
762
|
const isFocused = useFieldSelection(blockId, String(name), "Image", repeaterContext?.itemId);
|
|
763
|
+
let t3;
|
|
764
|
+
if ($[4] !== fieldId) {
|
|
765
|
+
t3 = { fieldId };
|
|
766
|
+
$[4] = fieldId;
|
|
767
|
+
$[5] = t3;
|
|
768
|
+
} else t3 = $[5];
|
|
769
|
+
const isHoveredFromSidebar = useOverlayMessage(iframeWindow, isContentEditable, "CAMOX_HOVER_FIELD", "CAMOX_HOVER_FIELD_END", t3);
|
|
815
770
|
let t4;
|
|
816
|
-
if ($[7] !== fieldId) {
|
|
817
|
-
t4 = { fieldId };
|
|
818
|
-
$[7] = fieldId;
|
|
819
|
-
$[8] = t4;
|
|
820
|
-
} else t4 = $[8];
|
|
821
|
-
const isHoveredFromSidebar = useOverlayMessage(iframeWindow, isContentEditable, "CAMOX_HOVER_FIELD", "CAMOX_HOVER_FIELD_END", t4);
|
|
822
771
|
let t5;
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
t5 = () => {
|
|
772
|
+
if ($[6] !== isHoveredFromSidebar) {
|
|
773
|
+
t4 = () => {
|
|
826
774
|
setIsHovered(isHoveredFromSidebar);
|
|
827
775
|
};
|
|
828
|
-
|
|
829
|
-
$[
|
|
830
|
-
$[
|
|
831
|
-
$[
|
|
776
|
+
t5 = [isHoveredFromSidebar];
|
|
777
|
+
$[6] = isHoveredFromSidebar;
|
|
778
|
+
$[7] = t4;
|
|
779
|
+
$[8] = t5;
|
|
832
780
|
} else {
|
|
833
|
-
|
|
834
|
-
|
|
781
|
+
t4 = $[7];
|
|
782
|
+
t5 = $[8];
|
|
835
783
|
}
|
|
836
|
-
React.useEffect(
|
|
837
|
-
let
|
|
838
|
-
if ($[
|
|
839
|
-
|
|
784
|
+
React.useEffect(t4, t5);
|
|
785
|
+
let t6;
|
|
786
|
+
if ($[9] !== blockId || $[10] !== isContentEditable || $[11] !== name || $[12] !== repeaterContext) {
|
|
787
|
+
t6 = () => {
|
|
840
788
|
if (!isContentEditable) return;
|
|
841
789
|
const imageFieldName = repeaterContext && !repeaterContext.itemId ? repeaterContext.arrayFieldName : String(name);
|
|
842
790
|
if (repeaterContext?.itemId) previewStore.send({
|
|
@@ -854,87 +802,61 @@ function createBlock(options) {
|
|
|
854
802
|
});
|
|
855
803
|
previewStore.send({ type: "toggleContentSheet" });
|
|
856
804
|
};
|
|
857
|
-
$[
|
|
858
|
-
$[
|
|
859
|
-
$[
|
|
860
|
-
$[
|
|
861
|
-
$[
|
|
862
|
-
} else
|
|
863
|
-
const handleClick =
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
if ($[20] !== t8) {
|
|
874
|
-
t9 = /* @__PURE__ */ jsx(Fragment, { children: t8 });
|
|
875
|
-
$[20] = t8;
|
|
876
|
-
$[21] = t9;
|
|
877
|
-
} else t9 = $[21];
|
|
878
|
-
return t9;
|
|
879
|
-
}
|
|
880
|
-
const showOverlay = isHovered || isFocused;
|
|
881
|
-
let t8;
|
|
882
|
-
if ($[22] === Symbol.for("react.memo_cache_sentinel")) {
|
|
883
|
-
t8 = { position: "relative" };
|
|
884
|
-
$[22] = t8;
|
|
885
|
-
} else t8 = $[22];
|
|
886
|
-
let t10;
|
|
887
|
-
let t9;
|
|
888
|
-
if ($[23] === Symbol.for("react.memo_cache_sentinel")) {
|
|
889
|
-
t9 = () => setIsHovered(true);
|
|
890
|
-
t10 = () => setIsHovered(false);
|
|
891
|
-
$[23] = t10;
|
|
892
|
-
$[24] = t9;
|
|
893
|
-
} else {
|
|
894
|
-
t10 = $[23];
|
|
895
|
-
t9 = $[24];
|
|
896
|
-
}
|
|
805
|
+
$[9] = blockId;
|
|
806
|
+
$[10] = isContentEditable;
|
|
807
|
+
$[11] = name;
|
|
808
|
+
$[12] = repeaterContext;
|
|
809
|
+
$[13] = t6;
|
|
810
|
+
} else t6 = $[13];
|
|
811
|
+
const handleClick = t6;
|
|
812
|
+
const imageProps = {
|
|
813
|
+
src: fieldValue.url,
|
|
814
|
+
alt: fieldValue.alt
|
|
815
|
+
};
|
|
816
|
+
if (!isContentEditable) return /* @__PURE__ */ jsx(Fragment, { children: children(imageProps, fieldValue) });
|
|
817
|
+
const t7 = "image";
|
|
818
|
+
const t8 = isHovered || void 0;
|
|
819
|
+
const t9 = isFocused || void 0;
|
|
820
|
+
const t10 = mode === "layout" ? "layout" : void 0;
|
|
897
821
|
let t11;
|
|
898
|
-
if ($[25] !== children || $[26] !== fieldValue) {
|
|
899
|
-
t11 = children(fieldValue);
|
|
900
|
-
$[25] = children;
|
|
901
|
-
$[26] = fieldValue;
|
|
902
|
-
$[27] = t11;
|
|
903
|
-
} else t11 = $[27];
|
|
904
822
|
let t12;
|
|
905
|
-
if ($[
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
let t13;
|
|
919
|
-
if ($[32] !== fieldId || $[33] !== handleClick || $[34] !== t11 || $[35] !== t12) {
|
|
920
|
-
t13 = /* @__PURE__ */ jsxs("div", {
|
|
921
|
-
style: t8,
|
|
823
|
+
if ($[14] === Symbol.for("react.memo_cache_sentinel")) {
|
|
824
|
+
t11 = () => setIsHovered(true);
|
|
825
|
+
t12 = () => setIsHovered(false);
|
|
826
|
+
$[14] = t11;
|
|
827
|
+
$[15] = t12;
|
|
828
|
+
} else {
|
|
829
|
+
t11 = $[14];
|
|
830
|
+
t12 = $[15];
|
|
831
|
+
}
|
|
832
|
+
const t13 = children(imageProps, fieldValue);
|
|
833
|
+
let t14;
|
|
834
|
+
if ($[16] !== fieldId || $[17] !== handleClick || $[18] !== t10 || $[19] !== t11 || $[20] !== t12 || $[21] !== t13 || $[22] !== t8 || $[23] !== t9) {
|
|
835
|
+
t14 = /* @__PURE__ */ jsx("div", {
|
|
922
836
|
"data-camox-field-id": fieldId,
|
|
923
|
-
|
|
924
|
-
|
|
837
|
+
"data-camox-field-type": t7,
|
|
838
|
+
"data-camox-hovered": t8,
|
|
839
|
+
"data-camox-focused": t9,
|
|
840
|
+
"data-camox-overlay-mode": t10,
|
|
841
|
+
onMouseEnter: t11,
|
|
842
|
+
onMouseLeave: t12,
|
|
925
843
|
onClick: handleClick,
|
|
926
|
-
children:
|
|
844
|
+
children: t13
|
|
927
845
|
});
|
|
928
|
-
$[
|
|
929
|
-
$[
|
|
930
|
-
$[
|
|
931
|
-
$[
|
|
932
|
-
$[
|
|
933
|
-
|
|
934
|
-
|
|
846
|
+
$[16] = fieldId;
|
|
847
|
+
$[17] = handleClick;
|
|
848
|
+
$[18] = t10;
|
|
849
|
+
$[19] = t11;
|
|
850
|
+
$[20] = t12;
|
|
851
|
+
$[21] = t13;
|
|
852
|
+
$[22] = t8;
|
|
853
|
+
$[23] = t9;
|
|
854
|
+
$[24] = t14;
|
|
855
|
+
} else t14 = $[24];
|
|
856
|
+
return t14;
|
|
935
857
|
};
|
|
936
858
|
const File = (t0) => {
|
|
937
|
-
const $ = c(
|
|
859
|
+
const $ = c(7);
|
|
938
860
|
const { name, children } = t0;
|
|
939
861
|
const blockContext = React.use(Context);
|
|
940
862
|
if (!blockContext) throw new Error("File must be used within a Block Component");
|
|
@@ -943,33 +865,30 @@ function createBlock(options) {
|
|
|
943
865
|
const { filesMap } = useNormalizedData();
|
|
944
866
|
const rawSource = repeaterContext ? repeaterContext.itemContent[name] : content[name];
|
|
945
867
|
let t1;
|
|
946
|
-
if ($[0] !==
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
868
|
+
if ($[0] !== children || $[1] !== filesMap || $[2] !== name || $[3] !== rawSource) {
|
|
869
|
+
const fieldValue = (isFileMarker(rawSource) ? resolveFileMarker(rawSource, filesMap) : rawSource) ?? contentDefaults[String(name)];
|
|
870
|
+
t1 = children({
|
|
871
|
+
href: fieldValue.url,
|
|
872
|
+
download: fieldValue.filename
|
|
873
|
+
}, fieldValue);
|
|
874
|
+
$[0] = children;
|
|
875
|
+
$[1] = filesMap;
|
|
876
|
+
$[2] = name;
|
|
877
|
+
$[3] = rawSource;
|
|
878
|
+
$[4] = t1;
|
|
879
|
+
} else t1 = $[4];
|
|
953
880
|
let t2;
|
|
954
|
-
if ($[
|
|
955
|
-
t2 = children
|
|
956
|
-
$[
|
|
957
|
-
$[4] = fieldValue;
|
|
958
|
-
$[5] = t2;
|
|
959
|
-
} else t2 = $[5];
|
|
960
|
-
let t3;
|
|
961
|
-
if ($[6] !== t2) {
|
|
962
|
-
t3 = /* @__PURE__ */ jsx(Fragment, { children: t2 });
|
|
881
|
+
if ($[5] !== t1) {
|
|
882
|
+
t2 = /* @__PURE__ */ jsx(Fragment, { children: t1 });
|
|
883
|
+
$[5] = t1;
|
|
963
884
|
$[6] = t2;
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
return t3;
|
|
885
|
+
} else t2 = $[6];
|
|
886
|
+
return t2;
|
|
967
887
|
};
|
|
968
888
|
const RepeaterItemWrapper = (t0) => {
|
|
969
|
-
const $ = c(
|
|
889
|
+
const $ = c(8);
|
|
970
890
|
const { itemId, blockId, mode, children } = t0;
|
|
971
891
|
const isContentEditable = useIsEditable(mode);
|
|
972
|
-
const colors = mode === "layout" ? LAYOUT_OVERLAY_COLORS : OVERLAY_COLORS;
|
|
973
892
|
const { window: iframeWindow } = useFrame();
|
|
974
893
|
const isRepeaterHovered = React.useContext(RepeaterHoverContext);
|
|
975
894
|
let t1;
|
|
@@ -984,37 +903,23 @@ function createBlock(options) {
|
|
|
984
903
|
} else t1 = $[2];
|
|
985
904
|
const isHovered = useOverlayMessage(iframeWindow, isContentEditable, "CAMOX_HOVER_REPEATER_ITEM", "CAMOX_HOVER_REPEATER_ITEM_END", t1);
|
|
986
905
|
const showOverlay = isContentEditable && (isHovered || isRepeaterHovered);
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
$[3] = t2;
|
|
991
|
-
} else t2 = $[3];
|
|
992
|
-
const t3 = isContentEditable ? itemId : void 0;
|
|
993
|
-
let t4;
|
|
994
|
-
if ($[4] !== colors || $[5] !== showOverlay) {
|
|
995
|
-
t4 = showOverlay && /* @__PURE__ */ jsx("div", { style: {
|
|
996
|
-
position: "absolute",
|
|
997
|
-
inset: OVERLAY_OFFSETS.blockHover,
|
|
998
|
-
border: `${OVERLAY_WIDTHS.hover} solid ${colors.hover}`,
|
|
999
|
-
pointerEvents: "none",
|
|
1000
|
-
zIndex: 10
|
|
1001
|
-
} });
|
|
1002
|
-
$[4] = colors;
|
|
1003
|
-
$[5] = showOverlay;
|
|
1004
|
-
$[6] = t4;
|
|
1005
|
-
} else t4 = $[6];
|
|
906
|
+
const t2 = isContentEditable ? itemId : void 0;
|
|
907
|
+
const t3 = showOverlay || void 0;
|
|
908
|
+
const t4 = mode === "layout" ? "layout" : void 0;
|
|
1006
909
|
let t5;
|
|
1007
|
-
if ($[
|
|
1008
|
-
t5 = /* @__PURE__ */
|
|
1009
|
-
|
|
1010
|
-
"data-camox-
|
|
1011
|
-
|
|
910
|
+
if ($[3] !== children || $[4] !== t2 || $[5] !== t3 || $[6] !== t4) {
|
|
911
|
+
t5 = /* @__PURE__ */ jsx("div", {
|
|
912
|
+
"data-camox-repeater-item-id": t2,
|
|
913
|
+
"data-camox-hovered": t3,
|
|
914
|
+
"data-camox-overlay-mode": t4,
|
|
915
|
+
children
|
|
1012
916
|
});
|
|
1013
|
-
$[
|
|
1014
|
-
$[
|
|
1015
|
-
$[
|
|
1016
|
-
$[
|
|
1017
|
-
|
|
917
|
+
$[3] = children;
|
|
918
|
+
$[4] = t2;
|
|
919
|
+
$[5] = t3;
|
|
920
|
+
$[6] = t4;
|
|
921
|
+
$[7] = t5;
|
|
922
|
+
} else t5 = $[7];
|
|
1018
923
|
return t5;
|
|
1019
924
|
};
|
|
1020
925
|
const RepeaterHoverProvider = (t0) => {
|
|
@@ -1134,14 +1039,14 @@ function createBlock(options) {
|
|
|
1134
1039
|
return t3;
|
|
1135
1040
|
};
|
|
1136
1041
|
const BlockComponent = (t0) => {
|
|
1137
|
-
const $ = c(
|
|
1042
|
+
const $ = c(69);
|
|
1138
1043
|
const { blockData, mode, isFirstBlock, showAddBlockTop, showAddBlockBottom, addBlockAfterPosition } = t0;
|
|
1139
1044
|
const isContentEditable = useIsEditable(mode);
|
|
1140
1045
|
const { window: iframeWindow } = useFrame();
|
|
1141
1046
|
const [isHovered, setIsHovered] = React.useState(false);
|
|
1142
|
-
const selection = useSelector(previewStore,
|
|
1143
|
-
const isPageContentSheetOpen = useSelector(previewStore,
|
|
1144
|
-
const isAddBlockSheetOpen = useSelector(previewStore,
|
|
1047
|
+
const selection = useSelector(previewStore, _temp5);
|
|
1048
|
+
const isPageContentSheetOpen = useSelector(previewStore, _temp6);
|
|
1049
|
+
const isAddBlockSheetOpen = useSelector(previewStore, _temp7);
|
|
1145
1050
|
const isAnySideSheetOpen = useIsPreviewSheetOpen();
|
|
1146
1051
|
const isBlockSelected = selection?.blockId === blockData._id;
|
|
1147
1052
|
const ref = React.useRef(null);
|
|
@@ -1213,7 +1118,7 @@ function createBlock(options) {
|
|
|
1213
1118
|
result = { ...blockData.content };
|
|
1214
1119
|
for (const key in result) {
|
|
1215
1120
|
const value = result[key];
|
|
1216
|
-
if (Array.isArray(value) && value.length > 0 && value[0]?.content !== void 0) result[key] = value.map(
|
|
1121
|
+
if (Array.isArray(value) && value.length > 0 && value[0]?.content !== void 0) result[key] = value.map(_temp8);
|
|
1217
1122
|
}
|
|
1218
1123
|
$[15] = blockData.content;
|
|
1219
1124
|
$[16] = result;
|
|
@@ -1279,17 +1184,20 @@ function createBlock(options) {
|
|
|
1279
1184
|
$[27] = t12;
|
|
1280
1185
|
} else t12 = $[27];
|
|
1281
1186
|
const t13 = isContentEditable ? blockData._id : void 0;
|
|
1282
|
-
const t14 =
|
|
1283
|
-
|
|
1187
|
+
const t14 = shouldShowOverlay && !isBlockSelected || void 0;
|
|
1188
|
+
const t15 = shouldShowOverlay && isBlockSelected || void 0;
|
|
1189
|
+
const t16 = mode === "layout" ? "layout" : void 0;
|
|
1190
|
+
const t17 = blockData._id;
|
|
1191
|
+
let t18;
|
|
1284
1192
|
if ($[28] !== blockData.content) {
|
|
1285
|
-
|
|
1193
|
+
t18 = {
|
|
1286
1194
|
...contentDefaults,
|
|
1287
1195
|
...blockData.content
|
|
1288
1196
|
};
|
|
1289
1197
|
$[28] = blockData.content;
|
|
1290
|
-
$[29] =
|
|
1291
|
-
} else
|
|
1292
|
-
const merged =
|
|
1198
|
+
$[29] = t18;
|
|
1199
|
+
} else t18 = $[29];
|
|
1200
|
+
const merged = t18;
|
|
1293
1201
|
let overrides;
|
|
1294
1202
|
if ($[30] !== merged) {
|
|
1295
1203
|
overrides = {};
|
|
@@ -1300,33 +1208,33 @@ function createBlock(options) {
|
|
|
1300
1208
|
$[30] = merged;
|
|
1301
1209
|
$[31] = overrides;
|
|
1302
1210
|
} else overrides = $[31];
|
|
1303
|
-
let
|
|
1211
|
+
let t19;
|
|
1304
1212
|
if ($[32] !== merged || $[33] !== overrides) {
|
|
1305
|
-
|
|
1213
|
+
t19 = {
|
|
1306
1214
|
...merged,
|
|
1307
1215
|
...overrides
|
|
1308
1216
|
};
|
|
1309
1217
|
$[32] = merged;
|
|
1310
1218
|
$[33] = overrides;
|
|
1311
|
-
$[34] =
|
|
1312
|
-
} else
|
|
1313
|
-
const
|
|
1314
|
-
let
|
|
1219
|
+
$[34] = t19;
|
|
1220
|
+
} else t19 = $[34];
|
|
1221
|
+
const t20 = t19;
|
|
1222
|
+
let t21;
|
|
1315
1223
|
if ($[35] !== blockData.settings) {
|
|
1316
|
-
|
|
1224
|
+
t21 = {
|
|
1317
1225
|
...settingsDefaults,
|
|
1318
1226
|
...blockData.settings
|
|
1319
1227
|
};
|
|
1320
1228
|
$[35] = blockData.settings;
|
|
1321
|
-
$[36] =
|
|
1322
|
-
} else
|
|
1323
|
-
const
|
|
1324
|
-
let
|
|
1325
|
-
if ($[37] !== blockData._id || $[38] !== isHovered || $[39] !== mode || $[40] !==
|
|
1326
|
-
|
|
1327
|
-
blockId:
|
|
1328
|
-
content:
|
|
1329
|
-
settings:
|
|
1229
|
+
$[36] = t21;
|
|
1230
|
+
} else t21 = $[36];
|
|
1231
|
+
const t22 = t21;
|
|
1232
|
+
let t23;
|
|
1233
|
+
if ($[37] !== blockData._id || $[38] !== isHovered || $[39] !== mode || $[40] !== t20 || $[41] !== t22) {
|
|
1234
|
+
t23 = {
|
|
1235
|
+
blockId: t17,
|
|
1236
|
+
content: t20,
|
|
1237
|
+
settings: t22,
|
|
1330
1238
|
mode,
|
|
1331
1239
|
isHovered,
|
|
1332
1240
|
setIsHovered
|
|
@@ -1334,105 +1242,89 @@ function createBlock(options) {
|
|
|
1334
1242
|
$[37] = blockData._id;
|
|
1335
1243
|
$[38] = isHovered;
|
|
1336
1244
|
$[39] = mode;
|
|
1337
|
-
$[40] =
|
|
1338
|
-
$[41] =
|
|
1339
|
-
$[42] =
|
|
1340
|
-
} else
|
|
1341
|
-
let
|
|
1245
|
+
$[40] = t20;
|
|
1246
|
+
$[41] = t22;
|
|
1247
|
+
$[42] = t23;
|
|
1248
|
+
} else t23 = $[42];
|
|
1249
|
+
let t24;
|
|
1342
1250
|
if ($[43] !== normalizedContent) {
|
|
1343
|
-
|
|
1251
|
+
t24 = /* @__PURE__ */ jsx(options.component, { content: normalizedContent });
|
|
1344
1252
|
$[43] = normalizedContent;
|
|
1345
|
-
$[44] =
|
|
1346
|
-
} else
|
|
1347
|
-
let
|
|
1348
|
-
if ($[45] !==
|
|
1349
|
-
|
|
1350
|
-
value:
|
|
1351
|
-
children:
|
|
1253
|
+
$[44] = t24;
|
|
1254
|
+
} else t24 = $[44];
|
|
1255
|
+
let t25;
|
|
1256
|
+
if ($[45] !== t23 || $[46] !== t24) {
|
|
1257
|
+
t25 = /* @__PURE__ */ jsx(Context.Provider, {
|
|
1258
|
+
value: t23,
|
|
1259
|
+
children: t24
|
|
1352
1260
|
});
|
|
1353
|
-
$[45] =
|
|
1354
|
-
$[46] =
|
|
1355
|
-
$[47] =
|
|
1356
|
-
} else
|
|
1357
|
-
|
|
1358
|
-
|
|
1359
|
-
|
|
1360
|
-
|
|
1361
|
-
|
|
1362
|
-
position: "absolute",
|
|
1363
|
-
width: "100%",
|
|
1364
|
-
height: "100%",
|
|
1365
|
-
top: 0,
|
|
1366
|
-
left: 0,
|
|
1367
|
-
background: "#000",
|
|
1368
|
-
opacity: t23,
|
|
1369
|
-
transition: "opacity 0.3s ease-in-out",
|
|
1370
|
-
pointerEvents: "none",
|
|
1371
|
-
zIndex: 20
|
|
1372
|
-
},
|
|
1373
|
-
id: "hello"
|
|
1261
|
+
$[45] = t23;
|
|
1262
|
+
$[46] = t24;
|
|
1263
|
+
$[47] = t25;
|
|
1264
|
+
} else t25 = $[47];
|
|
1265
|
+
let t26;
|
|
1266
|
+
if ($[48] !== shouldShowSheetOverlay) {
|
|
1267
|
+
t26 = /* @__PURE__ */ jsx("div", {
|
|
1268
|
+
className: "camox-sheet-overlay",
|
|
1269
|
+
...shouldShowSheetOverlay ? { "data-camox-visible": "" } : {}
|
|
1374
1270
|
});
|
|
1375
|
-
$[48] =
|
|
1376
|
-
$[49] =
|
|
1377
|
-
} else
|
|
1378
|
-
let
|
|
1379
|
-
if ($[50] !== handleAddBlockClick || $[51] !== isAnySideSheetOpen || $[52] !==
|
|
1380
|
-
|
|
1381
|
-
|
|
1382
|
-
|
|
1383
|
-
|
|
1384
|
-
|
|
1385
|
-
|
|
1386
|
-
|
|
1387
|
-
|
|
1388
|
-
|
|
1389
|
-
|
|
1390
|
-
|
|
1391
|
-
onMouseLeave: () => setIsHovered(false),
|
|
1392
|
-
onClick: () => handleAddBlockClick("before")
|
|
1393
|
-
}), (showAddBlockBottom ?? mode !== "layout") && /* @__PURE__ */ jsx(AddBlockControlBar, {
|
|
1394
|
-
position: "bottom",
|
|
1395
|
-
hidden: isAnySideSheetOpen,
|
|
1396
|
-
onMouseLeave: () => setIsHovered(false),
|
|
1397
|
-
onClick: () => handleAddBlockClick("after")
|
|
1398
|
-
})] })] });
|
|
1399
|
-
})();
|
|
1271
|
+
$[48] = shouldShowSheetOverlay;
|
|
1272
|
+
$[49] = t26;
|
|
1273
|
+
} else t26 = $[49];
|
|
1274
|
+
let t27;
|
|
1275
|
+
if ($[50] !== handleAddBlockClick || $[51] !== isAnySideSheetOpen || $[52] !== isFirstBlock || $[53] !== mode || $[54] !== shouldShowOverlay || $[55] !== showAddBlockBottom || $[56] !== showAddBlockTop) {
|
|
1276
|
+
t27 = shouldShowOverlay && /* @__PURE__ */ jsxs(Fragment, { children: [(showAddBlockTop ?? (mode !== "layout" && !isFirstBlock)) && /* @__PURE__ */ jsx(AddBlockControlBar, {
|
|
1277
|
+
position: "top",
|
|
1278
|
+
hidden: isAnySideSheetOpen,
|
|
1279
|
+
onMouseLeave: () => setIsHovered(false),
|
|
1280
|
+
onClick: () => handleAddBlockClick("before")
|
|
1281
|
+
}), (showAddBlockBottom ?? mode !== "layout") && /* @__PURE__ */ jsx(AddBlockControlBar, {
|
|
1282
|
+
position: "bottom",
|
|
1283
|
+
hidden: isAnySideSheetOpen,
|
|
1284
|
+
onMouseLeave: () => setIsHovered(false),
|
|
1285
|
+
onClick: () => handleAddBlockClick("after")
|
|
1286
|
+
})] });
|
|
1400
1287
|
$[50] = handleAddBlockClick;
|
|
1401
1288
|
$[51] = isAnySideSheetOpen;
|
|
1402
|
-
$[52] =
|
|
1403
|
-
$[53] =
|
|
1404
|
-
$[54] =
|
|
1405
|
-
$[55] =
|
|
1406
|
-
$[56] =
|
|
1407
|
-
$[57] =
|
|
1408
|
-
|
|
1409
|
-
|
|
1410
|
-
|
|
1411
|
-
|
|
1412
|
-
t26 = /* @__PURE__ */ jsxs("div", {
|
|
1289
|
+
$[52] = isFirstBlock;
|
|
1290
|
+
$[53] = mode;
|
|
1291
|
+
$[54] = shouldShowOverlay;
|
|
1292
|
+
$[55] = showAddBlockBottom;
|
|
1293
|
+
$[56] = showAddBlockTop;
|
|
1294
|
+
$[57] = t27;
|
|
1295
|
+
} else t27 = $[57];
|
|
1296
|
+
let t28;
|
|
1297
|
+
if ($[58] !== handleClick || $[59] !== handleMouseEnter || $[60] !== handleMouseLeave || $[61] !== t13 || $[62] !== t14 || $[63] !== t15 || $[64] !== t16 || $[65] !== t25 || $[66] !== t26 || $[67] !== t27) {
|
|
1298
|
+
t28 = /* @__PURE__ */ jsxs("div", {
|
|
1413
1299
|
className: "group visual-editing-block",
|
|
1414
1300
|
ref,
|
|
1415
1301
|
style: t12,
|
|
1416
1302
|
"data-camox-block-id": t13,
|
|
1303
|
+
"data-camox-hovered": t14,
|
|
1304
|
+
"data-camox-focused": t15,
|
|
1305
|
+
"data-camox-overlay-mode": t16,
|
|
1417
1306
|
onClick: handleClick,
|
|
1418
1307
|
onMouseEnter: handleMouseEnter,
|
|
1419
1308
|
onMouseLeave: handleMouseLeave,
|
|
1420
1309
|
children: [
|
|
1421
|
-
|
|
1422
|
-
|
|
1423
|
-
|
|
1310
|
+
t25,
|
|
1311
|
+
t26,
|
|
1312
|
+
t27
|
|
1424
1313
|
]
|
|
1425
1314
|
});
|
|
1426
|
-
$[
|
|
1427
|
-
$[
|
|
1428
|
-
$[
|
|
1429
|
-
$[
|
|
1430
|
-
$[
|
|
1431
|
-
$[
|
|
1315
|
+
$[58] = handleClick;
|
|
1316
|
+
$[59] = handleMouseEnter;
|
|
1317
|
+
$[60] = handleMouseLeave;
|
|
1318
|
+
$[61] = t13;
|
|
1319
|
+
$[62] = t14;
|
|
1320
|
+
$[63] = t15;
|
|
1321
|
+
$[64] = t16;
|
|
1432
1322
|
$[65] = t25;
|
|
1433
1323
|
$[66] = t26;
|
|
1434
|
-
|
|
1435
|
-
|
|
1324
|
+
$[67] = t27;
|
|
1325
|
+
$[68] = t28;
|
|
1326
|
+
} else t28 = $[68];
|
|
1327
|
+
return t28;
|
|
1436
1328
|
};
|
|
1437
1329
|
const useSetting = (name) => {
|
|
1438
1330
|
const ctx = React.use(Context);
|
|
@@ -1444,16 +1336,16 @@ function createBlock(options) {
|
|
|
1444
1336
|
* Provides the same hover, selection, and sheet overlays as the main BlockComponent.
|
|
1445
1337
|
*/
|
|
1446
1338
|
const Detached = (t0) => {
|
|
1447
|
-
const $ = c(
|
|
1339
|
+
const $ = c(30);
|
|
1448
1340
|
const { children } = t0;
|
|
1449
1341
|
const ctx = React.use(Context);
|
|
1450
1342
|
if (!ctx) throw new Error("Detached must be used within a Block Component");
|
|
1451
1343
|
const { blockId, mode, isHovered, setIsHovered } = ctx;
|
|
1452
1344
|
const isContentEditable = useIsEditable(mode);
|
|
1453
1345
|
const { window: iframeWindow } = useFrame();
|
|
1454
|
-
const selection = useSelector(previewStore,
|
|
1455
|
-
const isAddBlockSheetOpen = useSelector(previewStore,
|
|
1456
|
-
const isPageContentSheetOpen = useSelector(previewStore,
|
|
1346
|
+
const selection = useSelector(previewStore, _temp9);
|
|
1347
|
+
const isAddBlockSheetOpen = useSelector(previewStore, _temp0);
|
|
1348
|
+
const isPageContentSheetOpen = useSelector(previewStore, _temp1);
|
|
1457
1349
|
const isBlockSelected = selection?.blockId === blockId;
|
|
1458
1350
|
let t1;
|
|
1459
1351
|
if ($[0] !== blockId) {
|
|
@@ -1516,56 +1408,55 @@ function createBlock(options) {
|
|
|
1516
1408
|
} else t6 = $[14];
|
|
1517
1409
|
const handleMouseLeave = t6;
|
|
1518
1410
|
const [container, setContainer] = React.useState(null);
|
|
1519
|
-
|
|
1520
|
-
|
|
1521
|
-
|
|
1411
|
+
const t7 = shouldShowSheetOverlay ? 0 : 1;
|
|
1412
|
+
let t8;
|
|
1413
|
+
if ($[15] !== children || $[16] !== handleClick || $[17] !== handleMouseEnter || $[18] !== handleMouseLeave || $[19] !== t7) {
|
|
1414
|
+
t8 = children({
|
|
1522
1415
|
ref: setContainer,
|
|
1416
|
+
style: {
|
|
1417
|
+
opacity: t7,
|
|
1418
|
+
transition: "opacity 0.3s ease-in-out"
|
|
1419
|
+
},
|
|
1523
1420
|
onClick: handleClick,
|
|
1524
1421
|
onMouseEnter: handleMouseEnter,
|
|
1525
|
-
onMouseLeave: handleMouseLeave
|
|
1526
|
-
children
|
|
1422
|
+
onMouseLeave: handleMouseLeave
|
|
1527
1423
|
});
|
|
1528
1424
|
$[15] = children;
|
|
1529
1425
|
$[16] = handleClick;
|
|
1530
1426
|
$[17] = handleMouseEnter;
|
|
1531
1427
|
$[18] = handleMouseLeave;
|
|
1532
1428
|
$[19] = t7;
|
|
1533
|
-
|
|
1534
|
-
|
|
1535
|
-
|
|
1536
|
-
|
|
1537
|
-
|
|
1538
|
-
|
|
1539
|
-
|
|
1540
|
-
|
|
1541
|
-
|
|
1542
|
-
|
|
1543
|
-
|
|
1544
|
-
} }), shouldShowOverlay && (() => {
|
|
1545
|
-
const colors = mode === "layout" ? LAYOUT_OVERLAY_COLORS : OVERLAY_COLORS;
|
|
1546
|
-
return /* @__PURE__ */ jsx("div", { style: {
|
|
1429
|
+
$[20] = t8;
|
|
1430
|
+
} else t8 = $[20];
|
|
1431
|
+
let t9;
|
|
1432
|
+
if ($[21] !== blockId || $[22] !== container || $[23] !== isBlockSelected || $[24] !== mode || $[25] !== shouldShowOverlay) {
|
|
1433
|
+
t9 = container && createPortal(/* @__PURE__ */ jsx(Fragment, { children: shouldShowOverlay && /* @__PURE__ */ jsx("div", {
|
|
1434
|
+
"data-camox-block-id": blockId,
|
|
1435
|
+
"data-camox-detached": true,
|
|
1436
|
+
"data-camox-hovered": !isBlockSelected || void 0,
|
|
1437
|
+
"data-camox-focused": isBlockSelected || void 0,
|
|
1438
|
+
"data-camox-overlay-mode": mode === "layout" ? "layout" : void 0,
|
|
1439
|
+
style: {
|
|
1547
1440
|
position: "absolute",
|
|
1548
|
-
inset: isBlockSelected ? OVERLAY_OFFSETS.blockSelected : OVERLAY_OFFSETS.blockHover,
|
|
1549
|
-
border: `${isBlockSelected ? OVERLAY_WIDTHS.selected : OVERLAY_WIDTHS.hover} solid ${isBlockSelected ? colors.selected : colors.hover}`,
|
|
1550
1441
|
pointerEvents: "none",
|
|
1551
1442
|
zIndex: 10
|
|
1552
|
-
}
|
|
1553
|
-
})
|
|
1554
|
-
$[
|
|
1555
|
-
$[
|
|
1556
|
-
$[
|
|
1557
|
-
$[
|
|
1558
|
-
$[
|
|
1559
|
-
$[
|
|
1560
|
-
} else
|
|
1561
|
-
let
|
|
1562
|
-
if ($[
|
|
1563
|
-
|
|
1564
|
-
$[26] = t7;
|
|
1443
|
+
}
|
|
1444
|
+
}) }), container);
|
|
1445
|
+
$[21] = blockId;
|
|
1446
|
+
$[22] = container;
|
|
1447
|
+
$[23] = isBlockSelected;
|
|
1448
|
+
$[24] = mode;
|
|
1449
|
+
$[25] = shouldShowOverlay;
|
|
1450
|
+
$[26] = t9;
|
|
1451
|
+
} else t9 = $[26];
|
|
1452
|
+
let t10;
|
|
1453
|
+
if ($[27] !== t8 || $[28] !== t9) {
|
|
1454
|
+
t10 = /* @__PURE__ */ jsxs(Fragment, { children: [t8, t9] });
|
|
1565
1455
|
$[27] = t8;
|
|
1566
1456
|
$[28] = t9;
|
|
1567
|
-
|
|
1568
|
-
|
|
1457
|
+
$[29] = t10;
|
|
1458
|
+
} else t10 = $[29];
|
|
1459
|
+
return t10;
|
|
1569
1460
|
};
|
|
1570
1461
|
return {
|
|
1571
1462
|
Component: BlockComponent,
|
|
@@ -1651,28 +1542,25 @@ function _temp3(e_2) {
|
|
|
1651
1542
|
function _temp4(e_3) {
|
|
1652
1543
|
return e_3.preventDefault();
|
|
1653
1544
|
}
|
|
1654
|
-
function _temp5(
|
|
1655
|
-
return e_4.preventDefault();
|
|
1656
|
-
}
|
|
1657
|
-
function _temp6(state) {
|
|
1545
|
+
function _temp5(state) {
|
|
1658
1546
|
return state.context.selection;
|
|
1659
1547
|
}
|
|
1660
|
-
function
|
|
1548
|
+
function _temp6(state_0) {
|
|
1661
1549
|
return state_0.context.isPageContentSheetOpen;
|
|
1662
1550
|
}
|
|
1663
|
-
function
|
|
1551
|
+
function _temp7(state_1) {
|
|
1664
1552
|
return state_1.context.isAddBlockSheetOpen;
|
|
1665
1553
|
}
|
|
1666
|
-
function
|
|
1554
|
+
function _temp8(item) {
|
|
1667
1555
|
return item.content;
|
|
1668
1556
|
}
|
|
1669
|
-
function
|
|
1557
|
+
function _temp9(state) {
|
|
1670
1558
|
return state.context.selection;
|
|
1671
1559
|
}
|
|
1672
|
-
function
|
|
1560
|
+
function _temp0(state_0) {
|
|
1673
1561
|
return state_0.context.isAddBlockSheetOpen;
|
|
1674
1562
|
}
|
|
1675
|
-
function
|
|
1563
|
+
function _temp1(state_1) {
|
|
1676
1564
|
return state_1.context.isPageContentSheetOpen;
|
|
1677
1565
|
}
|
|
1678
1566
|
//#endregion
|