camox 0.71.0 → 0.74.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/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 +41 -185
- 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/useIsEditable.js +2 -2
- package/dist/core/lib/artifactData.js +8 -3
- 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/PageInfo.js +121 -98
- 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 +6 -5
- 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/routes/pageRuntime.js +15 -4
- package/dist/features/runtime/ClaimCard.js +192 -0
- package/dist/features/runtime/pageApp.js +5 -4
- package/dist/features/runtime/runtime.js +29 -8
- package/dist/features/runtime/worker.js +2 -2
- package/dist/features/runtime/workerRequest.d.ts +6 -0
- package/dist/features/runtime/workerRequest.js +13 -1
- package/dist/features/runtime/workerRuntime.d.ts +2 -2
- package/dist/features/runtime/workerRuntime.js +2 -2
- package/dist/features/studio/components/AgentSidebar.js +7 -7
- package/dist/features/studio/components/ChatWidget.js +142 -106
- package/dist/features/studio/components/ContentFindings.js +127 -230
- package/dist/features/studio/components/DeleteDraftDialog.js +112 -0
- package/dist/features/studio/components/DraftBar.js +98 -53
- package/dist/features/studio/components/DraftsControl.js +203 -190
- package/dist/features/studio/components/ReviewDraftDialog.js +670 -0
- package/dist/features/studio/components/{Patrol.js → Specialists.js} +291 -330
- package/dist/features/studio/components/Squareling.js +5 -5
- package/dist/features/studio/components/ThreadComposer.js +106 -127
- package/dist/features/studio/components/ThreadMessages.js +137 -45
- package/dist/features/studio/findingSentence.js +14 -12
- package/dist/features/studio/fixMessage.js +23 -0
- package/dist/features/studio/reportSentence.js +1 -1
- package/dist/features/studio/{patrollerBio.js → specialistBio.js} +8 -5
- package/dist/features/studio/studioStore.js +29 -15
- package/dist/features/studio/workingSentence.js +1 -1
- package/dist/features/vite/blockBoilerplate.js +1 -1
- package/dist/features/vite/definitionsSync.js +1 -8
- package/dist/lib/api-client.js +5 -1
- package/dist/lib/queries.js +5 -6
- package/dist/lib/studio-definitions.js +0 -2
- package/dist/lib/studio-reads.d.ts +1 -1
- package/dist/lib/studio-reads.js +5 -10
- 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 +4 -4
- package/skills/camox/SKILL.md +1 -1
- package/skills/camox/references/artifacts.md +4 -4
- 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
- package/dist/features/studio/components/ReviewDraftSheet.js +0 -1587
|
@@ -16,6 +16,7 @@ import { useRendererAnswer } from "../../renderer/RendererFrames.js";
|
|
|
16
16
|
import { PageLocationFieldset } from "./PageLocationFieldset.js";
|
|
17
17
|
import { PageNicknameField } from "./PageNicknameField.js";
|
|
18
18
|
import { pageImageUrl } from "../../og/pageImage.js";
|
|
19
|
+
import { ContentFindings, useContentFindings } from "../../studio/components/ContentFindings.js";
|
|
19
20
|
import { ShikiMarkdown } from "./ShikiMarkdown.js";
|
|
20
21
|
import { c } from "react/compiler-runtime";
|
|
21
22
|
import * as React from "react";
|
|
@@ -1094,7 +1095,7 @@ const PageSeoContent = (t0) => {
|
|
|
1094
1095
|
return t1;
|
|
1095
1096
|
};
|
|
1096
1097
|
const PageSeoEditor = (t0) => {
|
|
1097
|
-
const $ = c(
|
|
1098
|
+
const $ = c(46);
|
|
1098
1099
|
const { page, metaTitle } = t0;
|
|
1099
1100
|
let t1;
|
|
1100
1101
|
if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
|
|
@@ -1104,149 +1105,171 @@ const PageSeoEditor = (t0) => {
|
|
|
1104
1105
|
const setSeo = useMutation(t1);
|
|
1105
1106
|
const localized = useLocalizedPath();
|
|
1106
1107
|
let t2;
|
|
1107
|
-
if ($[1] !== page.id
|
|
1108
|
-
t2 =
|
|
1108
|
+
if ($[1] !== page.id) {
|
|
1109
|
+
t2 = {
|
|
1110
|
+
entity: "page",
|
|
1111
|
+
id: page.id
|
|
1112
|
+
};
|
|
1113
|
+
$[1] = page.id;
|
|
1114
|
+
$[2] = t2;
|
|
1115
|
+
} else t2 = $[2];
|
|
1116
|
+
const findings = useContentFindings(t2);
|
|
1117
|
+
let t3;
|
|
1118
|
+
if ($[3] !== page.id || $[4] !== setSeo) {
|
|
1119
|
+
t3 = (checked) => {
|
|
1109
1120
|
setSeo.mutate({
|
|
1110
1121
|
id: page.id,
|
|
1111
1122
|
aiSeo: checked
|
|
1112
1123
|
});
|
|
1113
1124
|
};
|
|
1114
|
-
$[
|
|
1115
|
-
$[
|
|
1116
|
-
$[
|
|
1117
|
-
} else
|
|
1118
|
-
let
|
|
1119
|
-
if ($[
|
|
1120
|
-
|
|
1125
|
+
$[3] = page.id;
|
|
1126
|
+
$[4] = setSeo;
|
|
1127
|
+
$[5] = t3;
|
|
1128
|
+
} else t3 = $[5];
|
|
1129
|
+
let t4;
|
|
1130
|
+
if ($[6] !== page.aiSeo || $[7] !== t3) {
|
|
1131
|
+
t4 = /* @__PURE__ */ jsx(Switch, {
|
|
1121
1132
|
id: "ai-seo",
|
|
1122
1133
|
checked: page.aiSeo,
|
|
1123
|
-
onCheckedChange:
|
|
1134
|
+
onCheckedChange: t3
|
|
1124
1135
|
});
|
|
1125
|
-
$[
|
|
1126
|
-
$[
|
|
1127
|
-
$[
|
|
1128
|
-
} else
|
|
1129
|
-
let
|
|
1130
|
-
if ($[
|
|
1131
|
-
|
|
1136
|
+
$[6] = page.aiSeo;
|
|
1137
|
+
$[7] = t3;
|
|
1138
|
+
$[8] = t4;
|
|
1139
|
+
} else t4 = $[8];
|
|
1140
|
+
let t5;
|
|
1141
|
+
if ($[9] === Symbol.for("react.memo_cache_sentinel")) {
|
|
1142
|
+
t5 = /* @__PURE__ */ jsx(Label, {
|
|
1132
1143
|
htmlFor: "ai-seo",
|
|
1133
1144
|
children: "AI metadata"
|
|
1134
1145
|
});
|
|
1135
|
-
$[7] = t4;
|
|
1136
|
-
} else t4 = $[7];
|
|
1137
|
-
let t5;
|
|
1138
|
-
if ($[8] !== t3) {
|
|
1139
|
-
t5 = /* @__PURE__ */ jsxs("div", {
|
|
1140
|
-
className: "flex items-center gap-2",
|
|
1141
|
-
children: [t3, t4]
|
|
1142
|
-
});
|
|
1143
|
-
$[8] = t3;
|
|
1144
1146
|
$[9] = t5;
|
|
1145
1147
|
} else t5 = $[9];
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
|
|
1148
|
+
let t6;
|
|
1149
|
+
if ($[10] !== t4) {
|
|
1150
|
+
t6 = /* @__PURE__ */ jsxs("div", {
|
|
1151
|
+
className: "flex items-center gap-2",
|
|
1152
|
+
children: [t4, t5]
|
|
1153
|
+
});
|
|
1154
|
+
$[10] = t4;
|
|
1155
|
+
$[11] = t6;
|
|
1156
|
+
} else t6 = $[11];
|
|
1157
|
+
const t7 = page.metaTitle ?? "";
|
|
1158
|
+
let t8;
|
|
1159
|
+
if ($[12] !== page.id || $[13] !== setSeo) {
|
|
1160
|
+
t8 = (value) => setSeo.mutate({
|
|
1150
1161
|
id: page.id,
|
|
1151
1162
|
metaTitle: value
|
|
1152
1163
|
});
|
|
1153
|
-
$[
|
|
1154
|
-
$[
|
|
1155
|
-
$[
|
|
1156
|
-
} else
|
|
1157
|
-
let
|
|
1158
|
-
if ($[
|
|
1159
|
-
|
|
1164
|
+
$[12] = page.id;
|
|
1165
|
+
$[13] = setSeo;
|
|
1166
|
+
$[14] = t8;
|
|
1167
|
+
} else t8 = $[14];
|
|
1168
|
+
let t9;
|
|
1169
|
+
if ($[15] !== page.aiSeo || $[16] !== t7 || $[17] !== t8) {
|
|
1170
|
+
t9 = /* @__PURE__ */ jsx(DebouncedFieldEditor, {
|
|
1160
1171
|
label: "Page title",
|
|
1161
1172
|
placeholder: "Page title...",
|
|
1162
|
-
initialValue:
|
|
1173
|
+
initialValue: t7,
|
|
1163
1174
|
disabled: page.aiSeo,
|
|
1164
|
-
onSave:
|
|
1175
|
+
onSave: t8
|
|
1165
1176
|
});
|
|
1166
|
-
$[
|
|
1167
|
-
$[
|
|
1168
|
-
$[
|
|
1169
|
-
$[
|
|
1170
|
-
} else
|
|
1171
|
-
const t9 = page.metaDescription ?? "";
|
|
1177
|
+
$[15] = page.aiSeo;
|
|
1178
|
+
$[16] = t7;
|
|
1179
|
+
$[17] = t8;
|
|
1180
|
+
$[18] = t9;
|
|
1181
|
+
} else t9 = $[18];
|
|
1172
1182
|
let t10;
|
|
1173
|
-
if ($[
|
|
1174
|
-
t10 =
|
|
1183
|
+
if ($[19] !== findings) {
|
|
1184
|
+
t10 = /* @__PURE__ */ jsx(ContentFindings, {
|
|
1185
|
+
view: findings,
|
|
1186
|
+
field: "metaTitle",
|
|
1187
|
+
className: "space-y-2"
|
|
1188
|
+
});
|
|
1189
|
+
$[19] = findings;
|
|
1190
|
+
$[20] = t10;
|
|
1191
|
+
} else t10 = $[20];
|
|
1192
|
+
const t11 = page.metaDescription ?? "";
|
|
1193
|
+
let t12;
|
|
1194
|
+
if ($[21] !== page.id || $[22] !== setSeo) {
|
|
1195
|
+
t12 = (value_0) => setSeo.mutate({
|
|
1175
1196
|
id: page.id,
|
|
1176
1197
|
metaDescription: value_0
|
|
1177
1198
|
});
|
|
1178
|
-
$[
|
|
1179
|
-
$[
|
|
1180
|
-
$[
|
|
1181
|
-
} else
|
|
1182
|
-
let
|
|
1183
|
-
if ($[
|
|
1184
|
-
|
|
1199
|
+
$[21] = page.id;
|
|
1200
|
+
$[22] = setSeo;
|
|
1201
|
+
$[23] = t12;
|
|
1202
|
+
} else t12 = $[23];
|
|
1203
|
+
let t13;
|
|
1204
|
+
if ($[24] !== page.aiSeo || $[25] !== t11 || $[26] !== t12) {
|
|
1205
|
+
t13 = /* @__PURE__ */ jsx(DebouncedFieldEditor, {
|
|
1185
1206
|
label: "Page description",
|
|
1186
1207
|
placeholder: "Page description...",
|
|
1187
|
-
initialValue:
|
|
1208
|
+
initialValue: t11,
|
|
1188
1209
|
disabled: page.aiSeo,
|
|
1189
1210
|
rows: 2,
|
|
1190
|
-
onSave:
|
|
1211
|
+
onSave: t12
|
|
1191
1212
|
});
|
|
1192
|
-
$[
|
|
1193
|
-
$[
|
|
1194
|
-
$[22] = t9;
|
|
1195
|
-
$[23] = t11;
|
|
1196
|
-
} else t11 = $[23];
|
|
1197
|
-
let t12;
|
|
1198
|
-
if ($[24] !== localized || $[25] !== page.fullPath) {
|
|
1199
|
-
t12 = localized(page.fullPath);
|
|
1200
|
-
$[24] = localized;
|
|
1201
|
-
$[25] = page.fullPath;
|
|
1213
|
+
$[24] = page.aiSeo;
|
|
1214
|
+
$[25] = t11;
|
|
1202
1215
|
$[26] = t12;
|
|
1203
|
-
|
|
1204
|
-
|
|
1216
|
+
$[27] = t13;
|
|
1217
|
+
} else t13 = $[27];
|
|
1205
1218
|
let t14;
|
|
1206
|
-
if ($[
|
|
1207
|
-
t14 =
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
metaDescription: t13
|
|
1211
|
-
});
|
|
1212
|
-
$[27] = metaTitle;
|
|
1213
|
-
$[28] = t12;
|
|
1214
|
-
$[29] = t13;
|
|
1219
|
+
if ($[28] !== localized || $[29] !== page.fullPath) {
|
|
1220
|
+
t14 = localized(page.fullPath);
|
|
1221
|
+
$[28] = localized;
|
|
1222
|
+
$[29] = page.fullPath;
|
|
1215
1223
|
$[30] = t14;
|
|
1216
1224
|
} else t14 = $[30];
|
|
1217
1225
|
const t15 = page.metaDescription ?? "";
|
|
1218
1226
|
let t16;
|
|
1219
|
-
if ($[31] !== metaTitle || $[32] !==
|
|
1220
|
-
t16 = /* @__PURE__ */ jsx(
|
|
1221
|
-
|
|
1227
|
+
if ($[31] !== metaTitle || $[32] !== t14 || $[33] !== t15) {
|
|
1228
|
+
t16 = /* @__PURE__ */ jsx(SearchEnginePreview, {
|
|
1229
|
+
path: t14,
|
|
1222
1230
|
metaTitle,
|
|
1223
1231
|
metaDescription: t15
|
|
1224
1232
|
});
|
|
1225
1233
|
$[31] = metaTitle;
|
|
1226
|
-
$[32] =
|
|
1234
|
+
$[32] = t14;
|
|
1227
1235
|
$[33] = t15;
|
|
1228
1236
|
$[34] = t16;
|
|
1229
1237
|
} else t16 = $[34];
|
|
1230
|
-
|
|
1231
|
-
|
|
1232
|
-
|
|
1238
|
+
const t17 = page.metaDescription ?? "";
|
|
1239
|
+
let t18;
|
|
1240
|
+
if ($[35] !== metaTitle || $[36] !== page || $[37] !== t17) {
|
|
1241
|
+
t18 = /* @__PURE__ */ jsx(SocialPreviewSection, {
|
|
1242
|
+
page,
|
|
1243
|
+
metaTitle,
|
|
1244
|
+
metaDescription: t17
|
|
1245
|
+
});
|
|
1246
|
+
$[35] = metaTitle;
|
|
1247
|
+
$[36] = page;
|
|
1248
|
+
$[37] = t17;
|
|
1249
|
+
$[38] = t18;
|
|
1250
|
+
} else t18 = $[38];
|
|
1251
|
+
let t19;
|
|
1252
|
+
if ($[39] !== t10 || $[40] !== t13 || $[41] !== t16 || $[42] !== t18 || $[43] !== t6 || $[44] !== t9) {
|
|
1253
|
+
t19 = /* @__PURE__ */ jsxs("div", {
|
|
1233
1254
|
className: "space-y-4",
|
|
1234
1255
|
children: [
|
|
1235
|
-
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
|
|
1239
|
-
t16
|
|
1256
|
+
t6,
|
|
1257
|
+
t9,
|
|
1258
|
+
t10,
|
|
1259
|
+
t13,
|
|
1260
|
+
t16,
|
|
1261
|
+
t18
|
|
1240
1262
|
]
|
|
1241
1263
|
});
|
|
1242
|
-
$[
|
|
1243
|
-
$[
|
|
1244
|
-
$[
|
|
1245
|
-
$[
|
|
1246
|
-
$[
|
|
1247
|
-
$[
|
|
1248
|
-
|
|
1249
|
-
|
|
1264
|
+
$[39] = t10;
|
|
1265
|
+
$[40] = t13;
|
|
1266
|
+
$[41] = t16;
|
|
1267
|
+
$[42] = t18;
|
|
1268
|
+
$[43] = t6;
|
|
1269
|
+
$[44] = t9;
|
|
1270
|
+
$[45] = t19;
|
|
1271
|
+
} else t19 = $[45];
|
|
1272
|
+
return t19;
|
|
1250
1273
|
};
|
|
1251
1274
|
const PageMarkdownSheet = (t0) => {
|
|
1252
1275
|
const $ = c(8);
|
|
@@ -10,11 +10,11 @@ import { BlockActionsPopover } from "./BlockActionsPopover.js";
|
|
|
10
10
|
import { usePreviewedPage } from "../CamoxPreview.js";
|
|
11
11
|
import { c } from "react/compiler-runtime";
|
|
12
12
|
import * as React from "react";
|
|
13
|
-
import {
|
|
13
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
14
14
|
import { useSelector } from "@xstate/store-react";
|
|
15
15
|
import { Button } from "@camox/ui/button";
|
|
16
16
|
import { Label } from "@camox/ui/label";
|
|
17
|
-
import { ChevronsUpDown, Ellipsis, GripVertical, LayoutTemplate
|
|
17
|
+
import { ChevronsUpDown, Ellipsis, GripVertical, LayoutTemplate } from "lucide-react";
|
|
18
18
|
import { Tooltip, TooltipContent, TooltipTrigger } from "@camox/ui/tooltip";
|
|
19
19
|
import { DndContext, DragOverlay, KeyboardSensor, PointerSensor, closestCenter, useSensor, useSensors } from "@dnd-kit/core";
|
|
20
20
|
import { restrictToVerticalAxis } from "@dnd-kit/modifiers";
|
|
@@ -375,98 +375,76 @@ const SortableBlock = (t0) => {
|
|
|
375
375
|
return t17;
|
|
376
376
|
};
|
|
377
377
|
const LayoutBlockItem = (t0) => {
|
|
378
|
-
const $ = c(
|
|
379
|
-
const { block, layoutName
|
|
380
|
-
const withActions = t1 === void 0 ? true : t1;
|
|
378
|
+
const $ = c(17);
|
|
379
|
+
const { block, layoutName } = t0;
|
|
381
380
|
const blockDef = useBlockDefinition(block.type);
|
|
382
381
|
const ctx = useBlockTreeItem(block);
|
|
383
382
|
const displayText = blockDef?.title ?? block.type;
|
|
384
|
-
let
|
|
383
|
+
let t1;
|
|
385
384
|
if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
|
|
386
|
-
|
|
387
|
-
$[0] =
|
|
388
|
-
} else
|
|
389
|
-
let
|
|
385
|
+
t1 = /* @__PURE__ */ jsx(TooltipTrigger, { children: /* @__PURE__ */ jsx(LayoutTemplate, { className: "h-4 w-4" }) });
|
|
386
|
+
$[0] = t1;
|
|
387
|
+
} else t1 = $[0];
|
|
388
|
+
let t2;
|
|
390
389
|
if ($[1] !== layoutName) {
|
|
391
|
-
|
|
390
|
+
t2 = /* @__PURE__ */ jsx("span", {
|
|
392
391
|
className: "font-semibold",
|
|
393
392
|
children: layoutName
|
|
394
393
|
});
|
|
395
394
|
$[1] = layoutName;
|
|
396
|
-
$[2] =
|
|
397
|
-
} else
|
|
398
|
-
let
|
|
395
|
+
$[2] = t2;
|
|
396
|
+
} else t2 = $[2];
|
|
397
|
+
let t3;
|
|
399
398
|
if ($[3] === Symbol.for("react.memo_cache_sentinel")) {
|
|
400
|
-
|
|
401
|
-
$[3] =
|
|
402
|
-
} else
|
|
403
|
-
const
|
|
404
|
-
let
|
|
405
|
-
if ($[4] !==
|
|
406
|
-
|
|
399
|
+
t3 = /* @__PURE__ */ jsx("br", {});
|
|
400
|
+
$[3] = t3;
|
|
401
|
+
} else t3 = $[3];
|
|
402
|
+
const t4 = blockDef?.synced ? "Synced: editing this block updates it across all layouts and pages" : "Changing the content may affect other pages";
|
|
403
|
+
let t5;
|
|
404
|
+
if ($[4] !== t2 || $[5] !== t4) {
|
|
405
|
+
t5 = /* @__PURE__ */ jsx("div", {
|
|
407
406
|
className: "text-muted-foreground flex size-8 shrink-0 items-center justify-center",
|
|
408
|
-
children: /* @__PURE__ */ jsxs(Tooltip, { children: [
|
|
407
|
+
children: /* @__PURE__ */ jsxs(Tooltip, { children: [t1, /* @__PURE__ */ jsxs(TooltipContent, { children: [
|
|
409
408
|
"From ",
|
|
410
|
-
|
|
409
|
+
t2,
|
|
411
410
|
" layout.",
|
|
412
|
-
|
|
413
|
-
|
|
411
|
+
t3,
|
|
412
|
+
t4
|
|
414
413
|
] })] })
|
|
415
414
|
});
|
|
416
|
-
$[4] =
|
|
417
|
-
$[5] =
|
|
418
|
-
$[6] =
|
|
419
|
-
} else
|
|
420
|
-
let
|
|
415
|
+
$[4] = t2;
|
|
416
|
+
$[5] = t4;
|
|
417
|
+
$[6] = t5;
|
|
418
|
+
} else t5 = $[6];
|
|
419
|
+
let t6;
|
|
421
420
|
if ($[7] !== ctx.toggleSelection || $[8] !== displayText) {
|
|
422
|
-
|
|
421
|
+
t6 = /* @__PURE__ */ jsx(BlockTreeItemTrigger, {
|
|
423
422
|
displayText,
|
|
424
423
|
onClick: ctx.toggleSelection
|
|
425
424
|
});
|
|
426
425
|
$[7] = ctx.toggleSelection;
|
|
427
426
|
$[8] = displayText;
|
|
428
|
-
$[9] =
|
|
429
|
-
} else
|
|
430
|
-
let
|
|
431
|
-
if ($[10] !==
|
|
432
|
-
|
|
433
|
-
block,
|
|
434
|
-
open: ctx.ellipsisPopoverOpen,
|
|
435
|
-
onOpenChange: ctx.setEllipsisPopoverOpen,
|
|
436
|
-
isLayoutBlock: true,
|
|
437
|
-
layoutSlot: block.slot,
|
|
438
|
-
children: /* @__PURE__ */ jsx(BlockTreeItemEllipsis, { open: ctx.ellipsisPopoverOpen })
|
|
439
|
-
});
|
|
440
|
-
$[10] = block;
|
|
441
|
-
$[11] = ctx.ellipsisPopoverOpen;
|
|
442
|
-
$[12] = ctx.setEllipsisPopoverOpen;
|
|
443
|
-
$[13] = withActions;
|
|
444
|
-
$[14] = t8;
|
|
445
|
-
} else t8 = $[14];
|
|
446
|
-
let t9;
|
|
447
|
-
if ($[15] !== ctx.handleBlockMouseEnter || $[16] !== ctx.handleBlockMouseLeave || $[17] !== ctx.shouldShowActive || $[18] !== ctx.shouldShowHover || $[19] !== t6 || $[20] !== t7 || $[21] !== t8) {
|
|
448
|
-
t9 = /* @__PURE__ */ jsxs(BlockTreeItemHeader, {
|
|
427
|
+
$[9] = t6;
|
|
428
|
+
} else t6 = $[9];
|
|
429
|
+
let t7;
|
|
430
|
+
if ($[10] !== ctx.handleBlockMouseEnter || $[11] !== ctx.handleBlockMouseLeave || $[12] !== ctx.shouldShowActive || $[13] !== ctx.shouldShowHover || $[14] !== t5 || $[15] !== t6) {
|
|
431
|
+
t7 = /* @__PURE__ */ jsxs(BlockTreeItemHeader, {
|
|
449
432
|
className: "group",
|
|
450
433
|
shouldShowHover: ctx.shouldShowHover,
|
|
451
434
|
shouldShowActive: ctx.shouldShowActive,
|
|
452
435
|
onMouseEnter: ctx.handleBlockMouseEnter,
|
|
453
436
|
onMouseLeave: ctx.handleBlockMouseLeave,
|
|
454
|
-
children: [
|
|
455
|
-
t6,
|
|
456
|
-
t7,
|
|
457
|
-
t8
|
|
458
|
-
]
|
|
437
|
+
children: [t5, t6]
|
|
459
438
|
});
|
|
460
|
-
$[
|
|
461
|
-
$[
|
|
462
|
-
$[
|
|
463
|
-
$[
|
|
464
|
-
$[
|
|
465
|
-
$[
|
|
466
|
-
$[
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
return t9;
|
|
439
|
+
$[10] = ctx.handleBlockMouseEnter;
|
|
440
|
+
$[11] = ctx.handleBlockMouseLeave;
|
|
441
|
+
$[12] = ctx.shouldShowActive;
|
|
442
|
+
$[13] = ctx.shouldShowHover;
|
|
443
|
+
$[14] = t5;
|
|
444
|
+
$[15] = t6;
|
|
445
|
+
$[16] = t7;
|
|
446
|
+
} else t7 = $[16];
|
|
447
|
+
return t7;
|
|
470
448
|
};
|
|
471
449
|
/** A sidebar field labelled "Blocks", holding a page's blocks and what acts on them. */
|
|
472
450
|
const BlocksGroup = (t0) => {
|
|
@@ -577,7 +555,7 @@ const CollapsedPageTree = (t0) => {
|
|
|
577
555
|
};
|
|
578
556
|
/** A page's blocks. When `collapsible`, they start collapsed behind a toggle showing their count. */
|
|
579
557
|
const PageTree = (t0) => {
|
|
580
|
-
const $ = c(
|
|
558
|
+
const $ = c(45);
|
|
581
559
|
const { collapsible: t1 } = t0;
|
|
582
560
|
const collapsible = t1 === void 0 ? false : t1;
|
|
583
561
|
const page = usePreviewedPage();
|
|
@@ -784,40 +762,19 @@ const PageTree = (t0) => {
|
|
|
784
762
|
$[41] = t17;
|
|
785
763
|
} else t17 = $[41];
|
|
786
764
|
const list = t17;
|
|
787
|
-
|
|
788
|
-
if ($[42] === Symbol.for("react.memo_cache_sentinel")) {
|
|
789
|
-
t18 = /* @__PURE__ */ jsxs(Button, {
|
|
790
|
-
variant: "secondary",
|
|
791
|
-
onClick: _temp4,
|
|
792
|
-
children: [/* @__PURE__ */ jsx(Plus, {}), "Add block"]
|
|
793
|
-
});
|
|
794
|
-
$[42] = t18;
|
|
795
|
-
} else t18 = $[42];
|
|
796
|
-
const addBlockButton = t18;
|
|
797
|
-
if (!collapsible) {
|
|
798
|
-
let t19;
|
|
799
|
-
if ($[43] !== list) {
|
|
800
|
-
t19 = /* @__PURE__ */ jsxs(Fragment, { children: [list, addBlockButton] });
|
|
801
|
-
$[43] = list;
|
|
802
|
-
$[44] = t19;
|
|
803
|
-
} else t19 = $[44];
|
|
804
|
-
return t19;
|
|
805
|
-
}
|
|
765
|
+
if (!collapsible) return list;
|
|
806
766
|
const blockCount = layoutBeforeBlocks.length + pageBlocks.length + layoutAfterBlocks.length;
|
|
807
|
-
let
|
|
808
|
-
if ($[
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
children:
|
|
812
|
-
blockCount,
|
|
813
|
-
children: list
|
|
814
|
-
}), addBlockButton]
|
|
767
|
+
let t18;
|
|
768
|
+
if ($[42] !== blockCount || $[43] !== list) {
|
|
769
|
+
t18 = /* @__PURE__ */ jsx(BlocksGroup, { children: /* @__PURE__ */ jsx(CollapsedPageTree, {
|
|
770
|
+
blockCount,
|
|
771
|
+
children: list
|
|
815
772
|
}) });
|
|
816
|
-
$[
|
|
817
|
-
$[
|
|
818
|
-
$[
|
|
819
|
-
} else
|
|
820
|
-
return
|
|
773
|
+
$[42] = blockCount;
|
|
774
|
+
$[43] = list;
|
|
775
|
+
$[44] = t18;
|
|
776
|
+
} else t18 = $[44];
|
|
777
|
+
return t18;
|
|
821
778
|
};
|
|
822
779
|
function _temp(value) {
|
|
823
780
|
return !value;
|
|
@@ -828,9 +785,6 @@ function _temp2(block_2) {
|
|
|
828
785
|
function _temp3(block_3) {
|
|
829
786
|
return /* @__PURE__ */ jsx(SortableBlock, { block: block_3 }, block_3.id);
|
|
830
787
|
}
|
|
831
|
-
function _temp4() {
|
|
832
|
-
previewStore.send({ type: "openAddBlockSheet" });
|
|
833
|
-
}
|
|
834
788
|
|
|
835
789
|
//#endregion
|
|
836
790
|
export { BlocksGroup, CollapsedPageTree, LayoutBlockItem, PageTree };
|
|
@@ -6,13 +6,13 @@ import { useEditingFrameClaim, useEditingOwner } from "../editingFrame.js";
|
|
|
6
6
|
import { EditableSurfaceContext } from "../../../core/hooks/useIsEditable.js";
|
|
7
7
|
import { CanvasWorkspaceContext } from "../../canvas/canvasZoom.js";
|
|
8
8
|
import { PreviewEditingOwnerContext } from "../previewSelection.js";
|
|
9
|
-
import { Frame, useFrame } from "./Frame.js";
|
|
10
9
|
import { previewPageIframeProps, usePreviewPageFrame } from "../previewPageFrame.js";
|
|
11
10
|
import { adoptCanvasDocument, pauseCanvasDocument } from "../../canvas/canvasFrameDocument.js";
|
|
12
11
|
import { forwardCanvasWheel, useCanvasFrameInput } from "../../canvas/useCanvasFrameInput.js";
|
|
13
12
|
import { useActionShortcuts } from "../../provider/useAdminShortcuts.js";
|
|
14
13
|
import { guardStrayCaret } from "../strayCaretGuard.js";
|
|
15
14
|
import { useBlockActionsShortcuts } from "./BlockActionsPopover.js";
|
|
15
|
+
import { Frame, useFrame } from "./Frame.js";
|
|
16
16
|
import { FieldOverlayStyles } from "./FieldOverlayStyles.js";
|
|
17
17
|
import { MobilePreviewDrawer } from "./MobilePreviewDrawer.js";
|
|
18
18
|
import { Overlays } from "./Overlays.js";
|
|
@@ -114,7 +114,7 @@ function CuratedBlockShortcuts() {
|
|
|
114
114
|
* when used, pauses with the camera, and draws its editing overlays.
|
|
115
115
|
*/
|
|
116
116
|
function PreviewPageCanvasEffects(t0) {
|
|
117
|
-
const $ = c(
|
|
117
|
+
const $ = c(30);
|
|
118
118
|
const { owner } = t0;
|
|
119
119
|
const { window: frameWindow, iframeElement } = useFrame();
|
|
120
120
|
const { frame, slot, inCanvas } = usePreviewPageFrame();
|
|
@@ -261,25 +261,22 @@ function PreviewPageCanvasEffects(t0) {
|
|
|
261
261
|
t12 = $[25];
|
|
262
262
|
t13 = $[26];
|
|
263
263
|
}
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
t15 = /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
264
|
+
let t14;
|
|
265
|
+
if ($[27] !== iframeElement || $[28] !== owner) {
|
|
266
|
+
t14 = /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
268
267
|
t11,
|
|
269
268
|
t12,
|
|
270
269
|
t13,
|
|
271
270
|
/* @__PURE__ */ jsx(Overlays, {
|
|
272
271
|
frame: iframeElement,
|
|
273
|
-
owner
|
|
274
|
-
canAddBlocks: t14
|
|
272
|
+
owner
|
|
275
273
|
})
|
|
276
274
|
] });
|
|
277
275
|
$[27] = iframeElement;
|
|
278
276
|
$[28] = owner;
|
|
279
277
|
$[29] = t14;
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
return t15;
|
|
278
|
+
} else t14 = $[29];
|
|
279
|
+
return t14;
|
|
283
280
|
}
|
|
284
281
|
function _temp(event) {
|
|
285
282
|
if (event.target?.closest?.("a")) event.preventDefault();
|