camox 0.69.0 → 0.72.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/createApp.d.ts +4 -103
- package/dist/core/createApp.js +3 -24
- package/dist/core/createBlock.d.ts +2 -2
- package/dist/core/createBlock.js +55 -192
- package/dist/core/createLayout.d.ts +6 -77
- package/dist/core/createLayout.js +12 -50
- package/dist/core/editing/createEditableBlock.d.ts +9 -75
- package/dist/core/editing/createEditableBlock.js +258 -640
- package/dist/core/hooks/useArtifactHost.js +56 -46
- package/dist/core/hooks/useIsEditable.js +2 -2
- package/dist/core/lib/artifact.d.ts +4 -0
- package/dist/core/lib/artifactData.js +8 -3
- package/dist/core/lib/artifactHost.js +40 -0
- package/dist/core/lib/artifactRuntime.js +20 -1
- package/dist/core/lib/contentType.d.ts +23 -38
- package/dist/core/lib/contentType.js +34 -62
- package/dist/core/lib/iconTypes.d.ts +0 -3
- package/dist/core/lib/icons.js +63 -51
- package/dist/core/lib/recordScope.js +1 -1
- package/dist/features/canvas/CanvasOverlays.js +94 -176
- package/dist/features/canvas/CanvasPageFrame.js +62 -68
- package/dist/features/canvas/CanvasPreviewPageSlot.js +1 -3
- package/dist/features/canvas/canvasOverlayGeometry.js +1 -7
- package/dist/features/canvas/sidebar/CuratedPageInspector.js +3 -21
- package/dist/features/canvas/sidebar/LayoutPageBlocks.js +1 -2
- package/dist/features/canvas/useCanvasCamera.js +1 -1
- package/dist/features/canvas/useCanvasFrame.js +1 -1
- package/dist/features/content/ContentCollection.js +2 -2
- package/dist/features/content/collection-form.js +6 -7
- package/dist/features/page/CuratedPageContent.js +15 -24
- package/dist/features/page/UnplacedBlockContent.js +1 -6
- package/dist/features/preview/CamoxPreview.js +30 -33
- package/dist/features/preview/EditablePageContent.js +131 -151
- package/dist/features/preview/components/BlockActionsPopover.js +43 -152
- package/dist/features/preview/components/CanvasPreview.js +2 -2
- package/dist/features/preview/components/Frame.js +3 -3
- package/dist/features/preview/components/IconFieldEditor.js +1 -1
- package/dist/features/preview/components/ItemFieldsEditor.js +1 -3
- package/dist/features/preview/components/Overlays.js +18 -84
- package/dist/features/preview/components/PageTree.js +57 -103
- package/dist/features/preview/components/PreviewPanel.js +8 -11
- package/dist/features/preview/components/RecordCombobox.js +65 -78
- package/dist/features/preview/components/ReferenceFieldEditor.js +1 -19
- package/dist/features/preview/components/ReferenceListFieldEditor.js +1 -19
- package/dist/features/preview/components/RemovedBlockPlaceholder.js +2 -2
- package/dist/features/preview/components/SelectionEditor.js +5 -4
- package/dist/features/preview/components/useRepeatableItemActions.js +18 -24
- package/dist/features/preview/components/useUpdateBlockPosition.js +1 -1
- package/dist/features/preview/overlayMessages.js +1 -4
- package/dist/features/preview/previewStore.js +3 -23
- package/dist/features/renderer/RendererApp.js +17 -141
- package/dist/features/renderer/definitionAnswers.js +1 -8
- package/dist/features/renderer/rendererHost.js +1 -31
- package/dist/features/renderer/studioConnection.js +1 -25
- package/dist/features/runtime/pageApp.js +8 -4
- package/dist/features/runtime/runtime.js +3 -3
- package/dist/features/studio/agentRunToast.js +71 -0
- package/dist/features/studio/components/ChatWidget.js +2 -0
- package/dist/features/studio/components/DraftBar.js +2 -3
- package/dist/features/studio/components/DraftsControl.js +150 -176
- package/dist/features/studio/components/ReviewDraftSheet.js +344 -548
- package/dist/features/studio/components/ThreadMessages.js +89 -22
- package/dist/features/studio/draftLabel.js +1 -1
- package/dist/features/studio/studioStore.js +5 -17
- package/dist/features/studio/viewSwitch.js +2 -4
- package/dist/features/vite/blockBoilerplate.js +1 -1
- package/dist/features/vite/definitionsSync.js +1 -8
- package/dist/lib/queries.js +0 -1
- package/dist/lib/studio-definitions.js +0 -2
- package/dist/lib/studio-reads.js +0 -5
- package/dist/lib/use-thread.js +196 -138
- package/dist/package.js +1 -1
- package/dist/studio-overlays.css +0 -29
- package/dist/studio.css +1 -1
- package/package.json +6 -4
- package/skills/camox/SKILL.md +1 -1
- package/skills/camox/references/artifacts.md +89 -5
- package/skills/camox/references/block-definitions.md +21 -25
- package/skills/camox/references/dom-integrations.md +1 -1
- package/skills/camox/references/layout-definitions.md +3 -12
- package/skills/camox/references/routed-layouts.md +2 -2
- package/skills/camox-expand/SKILL.md +5 -5
- package/skills/camoxify/SKILL.md +4 -4
- package/dist/features/canvas/canvasInsertionSeams.js +0 -44
- package/dist/features/preview/components/AddBlockSheet.js +0 -314
- package/dist/features/preview/components/BlockPeek.js +0 -66
- package/dist/features/preview/components/BlockThumbnail.js +0 -281
- package/dist/features/preview/components/blockGridNavigation.js +0 -15
- package/dist/features/preview/referencePickerFocus.js +0 -29
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { isLexicalState, lexicalStateToPlainText } from "../../core/lib/lexicalState.js";
|
|
2
2
|
import { titleField } from "../../core/recordItem.js";
|
|
3
|
+
import { emptyFieldValue } from "@camox/api-contract";
|
|
3
4
|
|
|
4
5
|
//#region src/features/content/collection-form.ts
|
|
5
6
|
/** The form's fields, the one the record's title starts with first. */
|
|
@@ -8,7 +9,8 @@ function collectionFormFields(contentSchema, toTitle) {
|
|
|
8
9
|
const first = titleField(toTitle);
|
|
9
10
|
return Object.entries(schema.properties).sort(([a], [b]) => Number(b === first) - Number(a === first));
|
|
10
11
|
}
|
|
11
|
-
|
|
12
|
+
/** The form's values: the record's content, and the empty value of each field it lacks. */
|
|
13
|
+
function collectionFormValues(fields, content = {}) {
|
|
12
14
|
return Object.fromEntries(fields.map(([name, schema]) => {
|
|
13
15
|
if (schema.fieldType === "Reference") return [name, content[name] ?? null];
|
|
14
16
|
if (schema.fieldType === "ReferenceList") {
|
|
@@ -20,12 +22,9 @@ function collectionFormDefaults(fields, content = {}) {
|
|
|
20
22
|
const assets = content[name];
|
|
21
23
|
return [name, Array.isArray(assets) ? assets.map(editorAsset) : []];
|
|
22
24
|
}
|
|
23
|
-
const value = content[name] ?? schema
|
|
25
|
+
const value = content[name] ?? emptyFieldValue(schema);
|
|
24
26
|
if (schema.fieldType === "String" && isLexicalState(value)) return [name, lexicalStateToPlainText(value)];
|
|
25
|
-
|
|
26
|
-
if (schema.fieldType === "Boolean") return [name, false];
|
|
27
|
-
if (schema.fieldType === "Enum") return [name, schema.enum?.[0] ?? ""];
|
|
28
|
-
return [name, ""];
|
|
27
|
+
return [name, value];
|
|
29
28
|
}));
|
|
30
29
|
}
|
|
31
30
|
const isAssetFieldType = (fieldType) => fieldType === "Image" || fieldType === "File" || fieldType === "ImageList" || fieldType === "FileList";
|
|
@@ -59,4 +58,4 @@ function collectionFormContent(fields, values, original = {}) {
|
|
|
59
58
|
}
|
|
60
59
|
|
|
61
60
|
//#endregion
|
|
62
|
-
export { collectionFormContent,
|
|
61
|
+
export { collectionFormContent, collectionFormFields, collectionFormValues, editorAssetField, serializeAssetField };
|
|
@@ -14,8 +14,8 @@ import { jsx } from "react/jsx-runtime";
|
|
|
14
14
|
//#region src/features/page/CuratedPageContent.tsx
|
|
15
15
|
/** A block read with its bundle, rendered by its definition's code as a page shows it. */
|
|
16
16
|
function PageBlock(t0) {
|
|
17
|
-
const $ = c(
|
|
18
|
-
const { blockId
|
|
17
|
+
const $ = c(18);
|
|
18
|
+
const { blockId } = t0;
|
|
19
19
|
let t1;
|
|
20
20
|
if ($[0] !== blockId) {
|
|
21
21
|
t1 = reads.blockBundle(blockId);
|
|
@@ -57,32 +57,26 @@ function PageBlock(t0) {
|
|
|
57
57
|
$[9] = t10;
|
|
58
58
|
} else t10 = $[9];
|
|
59
59
|
let t11;
|
|
60
|
-
if ($[10] !== blockDef._internal.Component || $[11] !==
|
|
61
|
-
t11 = /* @__PURE__ */ jsx(T0, {
|
|
62
|
-
blockData: t10,
|
|
63
|
-
mode,
|
|
64
|
-
showAddBlockTop: false,
|
|
65
|
-
showAddBlockBottom: false
|
|
66
|
-
});
|
|
60
|
+
if ($[10] !== blockDef._internal.Component || $[11] !== t10) {
|
|
61
|
+
t11 = /* @__PURE__ */ jsx(T0, { blockData: t10 });
|
|
67
62
|
$[10] = blockDef._internal.Component;
|
|
68
|
-
$[11] =
|
|
69
|
-
$[12] =
|
|
70
|
-
|
|
71
|
-
} else t11 = $[13];
|
|
63
|
+
$[11] = t10;
|
|
64
|
+
$[12] = t11;
|
|
65
|
+
} else t11 = $[12];
|
|
72
66
|
let t12;
|
|
73
|
-
if ($[
|
|
67
|
+
if ($[13] !== data.files || $[14] !== data.repeatableItems || $[15] !== t11 || $[16] !== t4) {
|
|
74
68
|
t12 = /* @__PURE__ */ jsx(NormalizedDataProvider, {
|
|
75
69
|
files: t2,
|
|
76
70
|
repeatableItems: t3,
|
|
77
71
|
blocks: t4,
|
|
78
72
|
children: t11
|
|
79
73
|
});
|
|
80
|
-
$[
|
|
81
|
-
$[
|
|
82
|
-
$[
|
|
83
|
-
$[
|
|
84
|
-
$[
|
|
85
|
-
} else t12 = $[
|
|
74
|
+
$[13] = data.files;
|
|
75
|
+
$[14] = data.repeatableItems;
|
|
76
|
+
$[15] = t11;
|
|
77
|
+
$[16] = t4;
|
|
78
|
+
$[17] = t12;
|
|
79
|
+
} else t12 = $[17];
|
|
86
80
|
return t12;
|
|
87
81
|
}
|
|
88
82
|
/** A curated page as visitors see it, without editing. */
|
|
@@ -170,10 +164,7 @@ function _temp(block) {
|
|
|
170
164
|
return /* @__PURE__ */ jsx(BlockErrorBoundary, {
|
|
171
165
|
blockId: block.id,
|
|
172
166
|
blockType: block.type,
|
|
173
|
-
children: /* @__PURE__ */ jsx(PageBlock, {
|
|
174
|
-
blockId: block.id,
|
|
175
|
-
mode: "site"
|
|
176
|
-
})
|
|
167
|
+
children: /* @__PURE__ */ jsx(PageBlock, { blockId: block.id })
|
|
177
168
|
}, block.id);
|
|
178
169
|
}
|
|
179
170
|
|
|
@@ -8,8 +8,6 @@ import { jsx } from "react/jsx-runtime";
|
|
|
8
8
|
/**
|
|
9
9
|
* A block placed nowhere, alone, as a page would show it: the look document's Block Definition
|
|
10
10
|
* mode (ADR 0032). Its bundle is read like a page's block, so it renders and hydrates as one.
|
|
11
|
-
* Thumbnails render a Block Definition their own way (`BlockPeek`); only the block render is
|
|
12
|
-
* shared.
|
|
13
11
|
*/
|
|
14
12
|
function UnplacedBlockContent(t0) {
|
|
15
13
|
const $ = c(8);
|
|
@@ -23,10 +21,7 @@ function UnplacedBlockContent(t0) {
|
|
|
23
21
|
const { block } = useRead(t1);
|
|
24
22
|
let t2;
|
|
25
23
|
if ($[2] !== blockId) {
|
|
26
|
-
t2 = /* @__PURE__ */ jsx(PageBlock, {
|
|
27
|
-
blockId,
|
|
28
|
-
mode: "site"
|
|
29
|
-
});
|
|
24
|
+
t2 = /* @__PURE__ */ jsx(PageBlock, { blockId });
|
|
30
25
|
$[2] = blockId;
|
|
31
26
|
$[3] = t2;
|
|
32
27
|
} else t2 = $[3];
|
|
@@ -20,7 +20,6 @@ import { PreviewEditingOwnerContext } from "./previewSelection.js";
|
|
|
20
20
|
import { RendererFramesProvider, RendererSlot, useRendererHost, useRendererStatus } from "../renderer/RendererFrames.js";
|
|
21
21
|
import { STUDIO_CANVAS_PATH } from "../studio/routes.js";
|
|
22
22
|
import { studioStore } from "../studio/studioStore.js";
|
|
23
|
-
import { AddBlockSheet } from "./components/AddBlockSheet.js";
|
|
24
23
|
import { CanvasPreview, prefetchCanvas } from "./components/CanvasPreview.js";
|
|
25
24
|
import { CreatePageModal } from "./components/CreatePageModal.js";
|
|
26
25
|
import { PageRecordContext, getPageRecord, useDerivedPageResult, useFollowPageRecord } from "./pageRecord.js";
|
|
@@ -409,7 +408,7 @@ function usePrefetchCanvas(enabled, projectUuid) {
|
|
|
409
408
|
}
|
|
410
409
|
/** Studio chrome is shared; only curated previews require a Camox page record. */
|
|
411
410
|
const PreviewShell = (t0) => {
|
|
412
|
-
const $ = c(
|
|
411
|
+
const $ = c(61);
|
|
413
412
|
const { children, pageData, derivedLayout, pageLocation, canvasOnly, runtimeBasePath: t1, pageShown: t2 } = t0;
|
|
414
413
|
const runtimeBasePath = t1 === void 0 ? "" : t1;
|
|
415
414
|
const pageShown = t2 === void 0 ? true : t2;
|
|
@@ -476,7 +475,6 @@ const PreviewShell = (t0) => {
|
|
|
476
475
|
t6 = () => {
|
|
477
476
|
if (!isMobileStudio) return;
|
|
478
477
|
previewStore.send({ type: "hideCanvas" });
|
|
479
|
-
previewStore.send({ type: "closeAddBlockSheet" });
|
|
480
478
|
};
|
|
481
479
|
t7 = [isMobileStudio];
|
|
482
480
|
$[8] = isMobileStudio;
|
|
@@ -645,60 +643,59 @@ const PreviewShell = (t0) => {
|
|
|
645
643
|
$[43] = t23;
|
|
646
644
|
} else t23 = $[43];
|
|
647
645
|
let t24;
|
|
648
|
-
if ($[44] !== isCanvasEnabled
|
|
649
|
-
t24 = !isCanvasEnabled && /* @__PURE__ */
|
|
646
|
+
if ($[44] !== isCanvasEnabled) {
|
|
647
|
+
t24 = !isCanvasEnabled && /* @__PURE__ */ jsx(CreatePageModal, {});
|
|
650
648
|
$[44] = isCanvasEnabled;
|
|
651
|
-
$[45] =
|
|
652
|
-
|
|
653
|
-
} else t24 = $[46];
|
|
649
|
+
$[45] = t24;
|
|
650
|
+
} else t24 = $[45];
|
|
654
651
|
let t25;
|
|
655
|
-
if ($[
|
|
652
|
+
if ($[46] !== t11 || $[47] !== t23 || $[48] !== t24) {
|
|
656
653
|
t25 = /* @__PURE__ */ jsxs("div", {
|
|
657
654
|
className: t11,
|
|
658
655
|
children: [t23, t24]
|
|
659
656
|
});
|
|
660
|
-
$[
|
|
661
|
-
$[
|
|
662
|
-
$[
|
|
663
|
-
$[
|
|
664
|
-
} else t25 = $[
|
|
657
|
+
$[46] = t11;
|
|
658
|
+
$[47] = t23;
|
|
659
|
+
$[48] = t24;
|
|
660
|
+
$[49] = t25;
|
|
661
|
+
} else t25 = $[49];
|
|
665
662
|
let t26;
|
|
666
|
-
if ($[
|
|
663
|
+
if ($[50] !== editingOwner || $[51] !== t25) {
|
|
667
664
|
t26 = /* @__PURE__ */ jsx(PreviewEditingOwnerContext, {
|
|
668
665
|
value: editingOwner,
|
|
669
666
|
children: t25
|
|
670
667
|
});
|
|
671
|
-
$[
|
|
672
|
-
$[
|
|
673
|
-
$[
|
|
674
|
-
} else t26 = $[
|
|
668
|
+
$[50] = editingOwner;
|
|
669
|
+
$[51] = t25;
|
|
670
|
+
$[52] = t26;
|
|
671
|
+
} else t26 = $[52];
|
|
675
672
|
let t27;
|
|
676
|
-
if ($[
|
|
673
|
+
if ($[53] !== projectUuid) {
|
|
677
674
|
t27 = /* @__PURE__ */ jsx(ContentCollectionItemSheet, { projectUuid });
|
|
678
|
-
$[
|
|
679
|
-
$[
|
|
680
|
-
} else t27 = $[
|
|
675
|
+
$[53] = projectUuid;
|
|
676
|
+
$[54] = t27;
|
|
677
|
+
} else t27 = $[54];
|
|
681
678
|
let t28;
|
|
682
|
-
if ($[
|
|
679
|
+
if ($[55] !== t26 || $[56] !== t27) {
|
|
683
680
|
t28 = /* @__PURE__ */ jsxs(CollectionItemSheetProvider, {
|
|
684
681
|
onRouteTargetClose: _temp8,
|
|
685
682
|
children: [t26, t27]
|
|
686
683
|
});
|
|
687
|
-
$[
|
|
688
|
-
$[
|
|
689
|
-
$[
|
|
690
|
-
} else t28 = $[
|
|
684
|
+
$[55] = t26;
|
|
685
|
+
$[56] = t27;
|
|
686
|
+
$[57] = t28;
|
|
687
|
+
} else t28 = $[57];
|
|
691
688
|
const website = t28;
|
|
692
689
|
let t29;
|
|
693
|
-
if ($[
|
|
690
|
+
if ($[58] !== runtimeBasePath || $[59] !== website) {
|
|
694
691
|
t29 = /* @__PURE__ */ jsx(RendererFramesProvider, {
|
|
695
692
|
runtimeBasePath,
|
|
696
693
|
children: website
|
|
697
694
|
});
|
|
698
|
-
$[
|
|
699
|
-
$[
|
|
700
|
-
$[
|
|
701
|
-
} else t29 = $[
|
|
695
|
+
$[58] = runtimeBasePath;
|
|
696
|
+
$[59] = website;
|
|
697
|
+
$[60] = t29;
|
|
698
|
+
} else t29 = $[60];
|
|
702
699
|
return t29;
|
|
703
700
|
};
|
|
704
701
|
/**
|
|
@@ -12,8 +12,8 @@ import { Fragment, jsx } from "react/jsx-runtime";
|
|
|
12
12
|
|
|
13
13
|
//#region src/features/preview/EditablePageContent.tsx
|
|
14
14
|
const BlockRenderer = (t0) => {
|
|
15
|
-
const $ = c(
|
|
16
|
-
const { blockId
|
|
15
|
+
const $ = c(24);
|
|
16
|
+
const { blockId } = t0;
|
|
17
17
|
let t1;
|
|
18
18
|
if ($[0] !== blockId) {
|
|
19
19
|
t1 = reads.blockBundle(blockId);
|
|
@@ -32,27 +32,25 @@ const BlockRenderer = (t0) => {
|
|
|
32
32
|
const blockDef = t2;
|
|
33
33
|
if (!blockDef) {
|
|
34
34
|
let t3;
|
|
35
|
-
if ($[5] !== blockId || $[6] !== data.block.type
|
|
35
|
+
if ($[5] !== blockId || $[6] !== data.block.type) {
|
|
36
36
|
t3 = /* @__PURE__ */ jsx(RemovedBlockPlaceholder, {
|
|
37
37
|
blockId,
|
|
38
|
-
type: data.block.type
|
|
39
|
-
mode
|
|
38
|
+
type: data.block.type
|
|
40
39
|
});
|
|
41
40
|
$[5] = blockId;
|
|
42
41
|
$[6] = data.block.type;
|
|
43
|
-
$[7] =
|
|
44
|
-
|
|
45
|
-
} else t3 = $[8];
|
|
42
|
+
$[7] = t3;
|
|
43
|
+
} else t3 = $[7];
|
|
46
44
|
return t3;
|
|
47
45
|
}
|
|
48
46
|
const t3 = data.files;
|
|
49
47
|
const t4 = data.repeatableItems;
|
|
50
48
|
let t5;
|
|
51
|
-
if ($[
|
|
49
|
+
if ($[8] !== data.block) {
|
|
52
50
|
t5 = [data.block];
|
|
53
|
-
$[
|
|
54
|
-
$[
|
|
55
|
-
} else t5 = $[
|
|
51
|
+
$[8] = data.block;
|
|
52
|
+
$[9] = t5;
|
|
53
|
+
} else t5 = $[9];
|
|
56
54
|
const T0 = blockDef._internal.Component;
|
|
57
55
|
const t6 = data.block.id;
|
|
58
56
|
const t7 = data.block.type;
|
|
@@ -60,7 +58,7 @@ const BlockRenderer = (t0) => {
|
|
|
60
58
|
const t9 = data.block.settings;
|
|
61
59
|
const t10 = String(data.block.position);
|
|
62
60
|
let t11;
|
|
63
|
-
if ($[
|
|
61
|
+
if ($[10] !== data.block.id || $[11] !== data.block.type || $[12] !== t10 || $[13] !== t8 || $[14] !== t9) {
|
|
64
62
|
t11 = {
|
|
65
63
|
_id: t6,
|
|
66
64
|
type: t7,
|
|
@@ -68,177 +66,159 @@ const BlockRenderer = (t0) => {
|
|
|
68
66
|
settings: t9,
|
|
69
67
|
position: t10
|
|
70
68
|
};
|
|
71
|
-
$[
|
|
72
|
-
$[
|
|
73
|
-
$[
|
|
74
|
-
$[
|
|
75
|
-
$[
|
|
76
|
-
$[
|
|
77
|
-
} else t11 = $[
|
|
69
|
+
$[10] = data.block.id;
|
|
70
|
+
$[11] = data.block.type;
|
|
71
|
+
$[12] = t10;
|
|
72
|
+
$[13] = t8;
|
|
73
|
+
$[14] = t9;
|
|
74
|
+
$[15] = t11;
|
|
75
|
+
} else t11 = $[15];
|
|
78
76
|
let t12;
|
|
79
|
-
if ($[
|
|
80
|
-
t12 = /* @__PURE__ */ jsx(T0, {
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
});
|
|
86
|
-
$[17] = blockDef._internal.Component;
|
|
87
|
-
$[18] = mode;
|
|
88
|
-
$[19] = showAddBlockBottom;
|
|
89
|
-
$[20] = showAddBlockTop;
|
|
90
|
-
$[21] = t11;
|
|
91
|
-
$[22] = t12;
|
|
92
|
-
} else t12 = $[22];
|
|
77
|
+
if ($[16] !== blockDef._internal.Component || $[17] !== t11) {
|
|
78
|
+
t12 = /* @__PURE__ */ jsx(T0, { blockData: t11 });
|
|
79
|
+
$[16] = blockDef._internal.Component;
|
|
80
|
+
$[17] = t11;
|
|
81
|
+
$[18] = t12;
|
|
82
|
+
} else t12 = $[18];
|
|
93
83
|
let t13;
|
|
94
|
-
if ($[
|
|
84
|
+
if ($[19] !== data.files || $[20] !== data.repeatableItems || $[21] !== t12 || $[22] !== t5) {
|
|
95
85
|
t13 = /* @__PURE__ */ jsx(NormalizedDataProvider, {
|
|
96
86
|
files: t3,
|
|
97
87
|
repeatableItems: t4,
|
|
98
88
|
blocks: t5,
|
|
99
89
|
children: t12
|
|
100
90
|
});
|
|
101
|
-
$[
|
|
102
|
-
$[
|
|
103
|
-
$[
|
|
104
|
-
$[
|
|
105
|
-
$[
|
|
106
|
-
} else t13 = $[
|
|
91
|
+
$[19] = data.files;
|
|
92
|
+
$[20] = data.repeatableItems;
|
|
93
|
+
$[21] = t12;
|
|
94
|
+
$[22] = t5;
|
|
95
|
+
$[23] = t13;
|
|
96
|
+
} else t13 = $[23];
|
|
107
97
|
return t13;
|
|
108
98
|
};
|
|
109
99
|
const EditablePageContent = () => {
|
|
110
|
-
const $ = c(
|
|
100
|
+
const $ = c(31);
|
|
111
101
|
const pageData = usePreviewedPage();
|
|
112
102
|
const { pageBlocks, beforeBlocks, afterBlocks, layoutFiles, layoutItems } = usePageBlocks(pageData);
|
|
113
103
|
const camoxApp = useCamoxApp();
|
|
114
104
|
const { locale } = useViewLocale();
|
|
115
|
-
let layout;
|
|
116
|
-
let layoutBlocksMap;
|
|
117
105
|
let t0;
|
|
118
|
-
if ($[0] !==
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
for (const block of allLayoutBlocks) blocks[block.type] = {
|
|
131
|
-
_id: block.id,
|
|
132
|
-
type: block.type,
|
|
133
|
-
content: block.content,
|
|
134
|
-
settings: block.settings,
|
|
135
|
-
position: String(block.position)
|
|
136
|
-
};
|
|
137
|
-
$[8] = afterBlocks;
|
|
138
|
-
$[9] = beforeBlocks;
|
|
139
|
-
$[10] = blocks;
|
|
140
|
-
} else blocks = $[10];
|
|
141
|
-
t1 = blocks;
|
|
106
|
+
if ($[0] !== camoxApp || $[1] !== pageData.layout) {
|
|
107
|
+
t0 = pageData.layout ? camoxApp.getLayoutById(pageData.layout.layoutId) : void 0;
|
|
108
|
+
$[0] = camoxApp;
|
|
109
|
+
$[1] = pageData.layout;
|
|
110
|
+
$[2] = t0;
|
|
111
|
+
} else t0 = $[2];
|
|
112
|
+
const layout = t0;
|
|
113
|
+
let t1;
|
|
114
|
+
bb0: {
|
|
115
|
+
if (!pageData.layout) {
|
|
116
|
+
t1 = null;
|
|
117
|
+
break bb0;
|
|
142
118
|
}
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
$[
|
|
158
|
-
|
|
159
|
-
$[5] = layout;
|
|
160
|
-
$[6] = layoutBlocksMap;
|
|
161
|
-
$[7] = t0;
|
|
162
|
-
} else {
|
|
163
|
-
layout = $[5];
|
|
164
|
-
layoutBlocksMap = $[6];
|
|
165
|
-
t0 = $[7];
|
|
119
|
+
let blocks;
|
|
120
|
+
if ($[3] !== afterBlocks || $[4] !== beforeBlocks) {
|
|
121
|
+
const allLayoutBlocks = [...beforeBlocks, ...afterBlocks];
|
|
122
|
+
blocks = {};
|
|
123
|
+
for (const block of allLayoutBlocks) blocks[block.type] = {
|
|
124
|
+
_id: block.id,
|
|
125
|
+
type: block.type,
|
|
126
|
+
content: block.content,
|
|
127
|
+
settings: block.settings,
|
|
128
|
+
position: String(block.position)
|
|
129
|
+
};
|
|
130
|
+
$[3] = afterBlocks;
|
|
131
|
+
$[4] = beforeBlocks;
|
|
132
|
+
$[5] = blocks;
|
|
133
|
+
} else blocks = $[5];
|
|
134
|
+
t1 = blocks;
|
|
166
135
|
}
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
$[
|
|
172
|
-
|
|
173
|
-
|
|
136
|
+
const layoutBlocksMap = t1;
|
|
137
|
+
let t2;
|
|
138
|
+
if ($[6] !== pageBlocks) {
|
|
139
|
+
t2 = pageBlocks.map(_temp);
|
|
140
|
+
$[6] = pageBlocks;
|
|
141
|
+
$[7] = t2;
|
|
142
|
+
} else t2 = $[7];
|
|
143
|
+
let t3;
|
|
144
|
+
if ($[8] !== t2) {
|
|
145
|
+
t3 = /* @__PURE__ */ jsx(Fragment, { children: t2 });
|
|
146
|
+
$[8] = t2;
|
|
147
|
+
$[9] = t3;
|
|
148
|
+
} else t3 = $[9];
|
|
149
|
+
const pageBlocksContent = t3;
|
|
174
150
|
if (layout && layoutBlocksMap) {
|
|
175
151
|
const ToReact = layout._internal.toReact;
|
|
176
|
-
let t2;
|
|
177
|
-
if ($[13] !== afterBlocks || $[14] !== beforeBlocks) {
|
|
178
|
-
t2 = [...beforeBlocks, ...afterBlocks];
|
|
179
|
-
$[13] = afterBlocks;
|
|
180
|
-
$[14] = beforeBlocks;
|
|
181
|
-
$[15] = t2;
|
|
182
|
-
} else t2 = $[15];
|
|
183
|
-
const T0 = layout._internal.Provider;
|
|
184
|
-
let t3;
|
|
185
|
-
if ($[16] !== locale || $[17] !== pageData) {
|
|
186
|
-
t3 = curatedLayoutContext(pageData, locale);
|
|
187
|
-
$[16] = locale;
|
|
188
|
-
$[17] = pageData;
|
|
189
|
-
$[18] = t3;
|
|
190
|
-
} else t3 = $[18];
|
|
191
152
|
let t4;
|
|
192
|
-
if ($[
|
|
193
|
-
t4 =
|
|
194
|
-
|
|
153
|
+
if ($[10] !== afterBlocks || $[11] !== beforeBlocks) {
|
|
154
|
+
t4 = [...beforeBlocks, ...afterBlocks];
|
|
155
|
+
$[10] = afterBlocks;
|
|
156
|
+
$[11] = beforeBlocks;
|
|
157
|
+
$[12] = t4;
|
|
158
|
+
} else t4 = $[12];
|
|
159
|
+
const T0 = layout._internal.Provider;
|
|
160
|
+
let t5;
|
|
161
|
+
if ($[13] !== locale || $[14] !== pageData) {
|
|
162
|
+
t5 = curatedLayoutContext(pageData, locale);
|
|
163
|
+
$[13] = locale;
|
|
164
|
+
$[14] = pageData;
|
|
165
|
+
$[15] = t5;
|
|
166
|
+
} else t5 = $[15];
|
|
167
|
+
let t6;
|
|
168
|
+
if ($[16] !== ToReact || $[17] !== pageBlocksContent || $[18] !== t5) {
|
|
169
|
+
t6 = /* @__PURE__ */ jsx(ToReact, {
|
|
170
|
+
...t5,
|
|
195
171
|
children: pageBlocksContent
|
|
196
172
|
});
|
|
197
|
-
$[
|
|
198
|
-
$[
|
|
199
|
-
$[
|
|
200
|
-
$[
|
|
201
|
-
} else
|
|
202
|
-
let
|
|
203
|
-
if ($[
|
|
204
|
-
|
|
173
|
+
$[16] = ToReact;
|
|
174
|
+
$[17] = pageBlocksContent;
|
|
175
|
+
$[18] = t5;
|
|
176
|
+
$[19] = t6;
|
|
177
|
+
} else t6 = $[19];
|
|
178
|
+
let t7;
|
|
179
|
+
if ($[20] !== layout._internal.Provider || $[21] !== layoutBlocksMap || $[22] !== t6) {
|
|
180
|
+
t7 = /* @__PURE__ */ jsx(T0, {
|
|
205
181
|
layoutBlocks: layoutBlocksMap,
|
|
206
|
-
children:
|
|
182
|
+
children: t6
|
|
207
183
|
});
|
|
208
|
-
$[
|
|
209
|
-
$[
|
|
210
|
-
$[
|
|
211
|
-
$[
|
|
212
|
-
} else
|
|
213
|
-
let
|
|
214
|
-
if ($[
|
|
215
|
-
|
|
184
|
+
$[20] = layout._internal.Provider;
|
|
185
|
+
$[21] = layoutBlocksMap;
|
|
186
|
+
$[22] = t6;
|
|
187
|
+
$[23] = t7;
|
|
188
|
+
} else t7 = $[23];
|
|
189
|
+
let t8;
|
|
190
|
+
if ($[24] !== layoutFiles || $[25] !== layoutItems || $[26] !== t4 || $[27] !== t7) {
|
|
191
|
+
t8 = /* @__PURE__ */ jsx(NormalizedDataProvider, {
|
|
216
192
|
files: layoutFiles,
|
|
217
193
|
repeatableItems: layoutItems,
|
|
218
|
-
blocks:
|
|
219
|
-
children:
|
|
194
|
+
blocks: t4,
|
|
195
|
+
children: t7
|
|
220
196
|
});
|
|
221
|
-
$[
|
|
222
|
-
$[
|
|
223
|
-
$[
|
|
224
|
-
$[
|
|
225
|
-
$[
|
|
226
|
-
} else
|
|
227
|
-
return
|
|
197
|
+
$[24] = layoutFiles;
|
|
198
|
+
$[25] = layoutItems;
|
|
199
|
+
$[26] = t4;
|
|
200
|
+
$[27] = t7;
|
|
201
|
+
$[28] = t8;
|
|
202
|
+
} else t8 = $[28];
|
|
203
|
+
return t8;
|
|
228
204
|
}
|
|
229
|
-
let
|
|
230
|
-
if ($[
|
|
231
|
-
|
|
205
|
+
let t4;
|
|
206
|
+
if ($[29] !== pageBlocksContent) {
|
|
207
|
+
t4 = /* @__PURE__ */ jsx("main", {
|
|
232
208
|
className: "flex min-h-screen flex-col",
|
|
233
209
|
children: pageBlocksContent
|
|
234
210
|
});
|
|
235
|
-
$[
|
|
236
|
-
$[
|
|
237
|
-
} else
|
|
238
|
-
return
|
|
211
|
+
$[29] = pageBlocksContent;
|
|
212
|
+
$[30] = t4;
|
|
213
|
+
} else t4 = $[30];
|
|
214
|
+
return t4;
|
|
239
215
|
};
|
|
240
|
-
function _temp(
|
|
241
|
-
return
|
|
216
|
+
function _temp(blockData) {
|
|
217
|
+
return /* @__PURE__ */ jsx(BlockErrorBoundary, {
|
|
218
|
+
blockId: blockData.id,
|
|
219
|
+
blockType: blockData.type,
|
|
220
|
+
children: /* @__PURE__ */ jsx(BlockRenderer, { blockId: blockData.id })
|
|
221
|
+
}, blockData.id);
|
|
242
222
|
}
|
|
243
223
|
|
|
244
224
|
//#endregion
|