camox 0.32.0 → 0.33.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/core/createBlock.d.ts +1 -1
- package/dist/core/createBlock.js +88 -108
- package/dist/core/hooks/useIsEditable.js +6 -10
- package/dist/core/lib/fieldTypes.js +10 -219
- package/dist/features/agent-chat/components/AgentChatSidebar.js +172 -0
- package/dist/features/agent-chat/components/AgentChatThread.js +9 -9
- package/dist/features/preview/CamoxPreview.js +137 -729
- package/dist/features/preview/components/{AddBlockSheet.js → AddBlockSidebar.js} +121 -131
- package/dist/features/preview/components/AssetFieldEditor.js +107 -82
- package/dist/features/preview/components/AssetLightbox.js +4 -4
- package/dist/features/preview/components/AssetPickerModal.js +277 -0
- package/dist/features/preview/components/BlockActionsPopover.js +18 -24
- package/dist/features/preview/components/CreatePageModal.js +6 -6
- package/dist/features/preview/components/FieldToolbar.js +64 -127
- package/dist/features/preview/components/ItemFieldsEditor.js +98 -125
- package/dist/features/preview/components/LeftSidebar.js +64 -0
- package/dist/features/preview/components/LinkFieldEditor.js +1 -1
- package/dist/features/preview/components/MultipleAssetFieldEditor.js +94 -56
- package/dist/features/preview/components/OverlayTracker.js +15 -15
- package/dist/features/preview/components/Overlays.js +12 -12
- package/dist/features/preview/components/PageEditorSidebar.js +563 -0
- package/dist/features/preview/components/PageInfoSidebar.js +1453 -0
- package/dist/features/preview/components/PageNavigatorSidebar.js +590 -0
- package/dist/features/preview/components/PagePicker.js +3 -3
- package/dist/features/preview/components/PageStatusBadge.js +1 -1
- package/dist/features/preview/components/PageTree.js +204 -564
- package/dist/features/preview/components/PreviewPanel.js +123 -158
- package/dist/features/preview/components/PreviewToolbar.js +260 -256
- package/dist/features/preview/components/PublishDialog.js +2 -2
- package/dist/features/preview/components/RepeatableItemsList.js +2 -2
- package/dist/features/preview/components/RightSidebar.js +109 -0
- package/dist/features/preview/components/UnlinkAssetButton.js +2 -2
- package/dist/features/preview/components/useRepeatableItemActions.js +3 -138
- package/dist/features/preview/components/useUpdateBlockPosition.js +1 -1
- package/dist/features/preview/previewQueryFns.js +23 -0
- package/dist/features/preview/previewStore.js +46 -63
- package/dist/features/provider/CamoxProvider.js +255 -70
- package/dist/features/provider/useAdminShortcuts.js +5 -48
- package/dist/features/routes/pageRoute.js +1 -1
- package/dist/features/studio/CamoxStudio.js +6 -5
- package/dist/features/studio/components/EnvironmentMenu.js +2 -2
- package/dist/features/studio/components/Navbar.js +53 -71
- package/dist/features/studio/components/ProjectMenu.js +1 -1
- package/dist/features/studio/components/UserButton.js +1 -1
- package/dist/features/studio/routes.js +7 -0
- package/dist/features/studio/useTheme.js +67 -33
- package/dist/features/vite/routeGeneration.js +68 -66
- package/dist/hooks/use-file-upload.js +1 -1
- package/dist/lib/auth.js +23 -22
- package/dist/lib/utils.js +1 -1
- package/dist/studio-overlays.css +1 -1
- package/dist/studio.css +1 -1
- package/package.json +4 -4
- package/dist/features/agent-chat/components/AgentChatSheet.js +0 -207
- package/dist/features/preview/components/AssetPickerGrid.js +0 -236
- package/dist/features/preview/components/PageContentSheet.js +0 -608
- package/dist/features/preview/components/PageMetadataModal.js +0 -908
- package/dist/features/preview/components/PreviewSideSheet.js +0 -76
|
@@ -0,0 +1,277 @@
|
|
|
1
|
+
import { useProjectSlug } from "../../../lib/auth.js";
|
|
2
|
+
import { fileQueries, projectQueries } from "../../../lib/queries.js";
|
|
3
|
+
import { AssetLightbox } from "./AssetLightbox.js";
|
|
4
|
+
import { AssetCard } from "../../content/components/AssetCard.js";
|
|
5
|
+
import { c } from "react/compiler-runtime";
|
|
6
|
+
import { useQuery } from "@tanstack/react-query";
|
|
7
|
+
import * as React from "react";
|
|
8
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
9
|
+
import { Button } from "@camox/ui/button";
|
|
10
|
+
import { Skeleton } from "@camox/ui/skeleton";
|
|
11
|
+
import { Dialog, DialogClose, DialogContent, DialogFooter, DialogHeader, DialogTitle } from "@camox/ui/dialog";
|
|
12
|
+
|
|
13
|
+
//#region src/features/preview/components/AssetPickerModal.tsx
|
|
14
|
+
const AssetPickerModal = (t0) => {
|
|
15
|
+
const $ = c(56);
|
|
16
|
+
if ($[0] !== "c984030a1422cdd88b1f831d5358c0286f37bccfe41f31a3e0d717767fe6ebfd") {
|
|
17
|
+
for (let $i = 0; $i < 56; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
|
|
18
|
+
$[0] = "c984030a1422cdd88b1f831d5358c0286f37bccfe41f31a3e0d717767fe6ebfd";
|
|
19
|
+
}
|
|
20
|
+
const { open, onOpenChange, assetType, mode, onSelectSingle, onSelectMultiple } = t0;
|
|
21
|
+
const projectSlug = useProjectSlug();
|
|
22
|
+
let t1;
|
|
23
|
+
if ($[1] !== projectSlug) {
|
|
24
|
+
t1 = projectQueries.getBySlug(projectSlug);
|
|
25
|
+
$[1] = projectSlug;
|
|
26
|
+
$[2] = t1;
|
|
27
|
+
} else t1 = $[2];
|
|
28
|
+
const { data: project } = useQuery(t1);
|
|
29
|
+
let t2;
|
|
30
|
+
if ($[3] !== project?.id) {
|
|
31
|
+
t2 = fileQueries.list(project?.id ?? 0);
|
|
32
|
+
$[3] = project?.id;
|
|
33
|
+
$[4] = t2;
|
|
34
|
+
} else t2 = $[4];
|
|
35
|
+
const t3 = !!project;
|
|
36
|
+
let t4;
|
|
37
|
+
if ($[5] !== t2 || $[6] !== t3) {
|
|
38
|
+
t4 = {
|
|
39
|
+
...t2,
|
|
40
|
+
enabled: t3
|
|
41
|
+
};
|
|
42
|
+
$[5] = t2;
|
|
43
|
+
$[6] = t3;
|
|
44
|
+
$[7] = t4;
|
|
45
|
+
} else t4 = $[7];
|
|
46
|
+
const { data: allFiles } = useQuery(t4);
|
|
47
|
+
let t5;
|
|
48
|
+
if ($[8] === Symbol.for("react.memo_cache_sentinel")) {
|
|
49
|
+
t5 = /* @__PURE__ */ new Set();
|
|
50
|
+
$[8] = t5;
|
|
51
|
+
} else t5 = $[8];
|
|
52
|
+
const [selectedIds, setSelectedIds] = React.useState(t5);
|
|
53
|
+
const [lightboxFile, setLightboxFile] = React.useState(null);
|
|
54
|
+
let t6;
|
|
55
|
+
let t7;
|
|
56
|
+
if ($[9] !== open) {
|
|
57
|
+
t6 = () => {
|
|
58
|
+
if (open) return;
|
|
59
|
+
setSelectedIds(/* @__PURE__ */ new Set());
|
|
60
|
+
setLightboxFile(null);
|
|
61
|
+
};
|
|
62
|
+
t7 = [open];
|
|
63
|
+
$[9] = open;
|
|
64
|
+
$[10] = t6;
|
|
65
|
+
$[11] = t7;
|
|
66
|
+
} else {
|
|
67
|
+
t6 = $[10];
|
|
68
|
+
t7 = $[11];
|
|
69
|
+
}
|
|
70
|
+
React.useEffect(t6, t7);
|
|
71
|
+
const isImage = assetType === "Image";
|
|
72
|
+
let t8;
|
|
73
|
+
bb0: {
|
|
74
|
+
if (!allFiles) {
|
|
75
|
+
t8 = void 0;
|
|
76
|
+
break bb0;
|
|
77
|
+
}
|
|
78
|
+
if (!isImage) {
|
|
79
|
+
t8 = allFiles;
|
|
80
|
+
break bb0;
|
|
81
|
+
}
|
|
82
|
+
let t9;
|
|
83
|
+
if ($[12] !== allFiles) {
|
|
84
|
+
t9 = allFiles.filter(_temp);
|
|
85
|
+
$[12] = allFiles;
|
|
86
|
+
$[13] = t9;
|
|
87
|
+
} else t9 = $[13];
|
|
88
|
+
t8 = t9;
|
|
89
|
+
}
|
|
90
|
+
const files = t8;
|
|
91
|
+
let t9;
|
|
92
|
+
if ($[14] === Symbol.for("react.memo_cache_sentinel")) {
|
|
93
|
+
t9 = (fileId) => {
|
|
94
|
+
setSelectedIds((prev) => {
|
|
95
|
+
const next = new Set(prev);
|
|
96
|
+
if (next.has(fileId)) next.delete(fileId);
|
|
97
|
+
else next.add(fileId);
|
|
98
|
+
return next;
|
|
99
|
+
});
|
|
100
|
+
};
|
|
101
|
+
$[14] = t9;
|
|
102
|
+
} else t9 = $[14];
|
|
103
|
+
const toggleSelection = t9;
|
|
104
|
+
let t10;
|
|
105
|
+
if ($[15] !== files || $[16] !== onOpenChange || $[17] !== onSelectMultiple || $[18] !== selectedIds) {
|
|
106
|
+
t10 = () => {
|
|
107
|
+
if (!files) return;
|
|
108
|
+
onSelectMultiple(files.filter((f_0) => selectedIds.has(f_0.id)));
|
|
109
|
+
onOpenChange(false);
|
|
110
|
+
};
|
|
111
|
+
$[15] = files;
|
|
112
|
+
$[16] = onOpenChange;
|
|
113
|
+
$[17] = onSelectMultiple;
|
|
114
|
+
$[18] = selectedIds;
|
|
115
|
+
$[19] = t10;
|
|
116
|
+
} else t10 = $[19];
|
|
117
|
+
const handleConfirmMultiple = t10;
|
|
118
|
+
let t11;
|
|
119
|
+
if ($[20] !== onOpenChange || $[21] !== onSelectSingle) {
|
|
120
|
+
t11 = (file) => {
|
|
121
|
+
onSelectSingle(file);
|
|
122
|
+
onOpenChange(false);
|
|
123
|
+
};
|
|
124
|
+
$[20] = onOpenChange;
|
|
125
|
+
$[21] = onSelectSingle;
|
|
126
|
+
$[22] = t11;
|
|
127
|
+
} else t11 = $[22];
|
|
128
|
+
const handleSelectSingle = t11;
|
|
129
|
+
const title = mode === "multiple" ? `Add existing ${isImage ? "images" : "files"}` : `Add an existing ${isImage ? "image" : "file"}`;
|
|
130
|
+
let t12;
|
|
131
|
+
if ($[23] !== title) {
|
|
132
|
+
t12 = /* @__PURE__ */ jsx(DialogHeader, { children: /* @__PURE__ */ jsx(DialogTitle, { children: title }) });
|
|
133
|
+
$[23] = title;
|
|
134
|
+
$[24] = t12;
|
|
135
|
+
} else t12 = $[24];
|
|
136
|
+
let t13;
|
|
137
|
+
if ($[25] !== files) {
|
|
138
|
+
t13 = files === void 0 && /* @__PURE__ */ jsx("div", {
|
|
139
|
+
className: "grid grid-cols-[repeat(auto-fill,minmax(140px,1fr))] gap-3",
|
|
140
|
+
children: Array.from({ length: 6 }).map(_temp2)
|
|
141
|
+
});
|
|
142
|
+
$[25] = files;
|
|
143
|
+
$[26] = t13;
|
|
144
|
+
} else t13 = $[26];
|
|
145
|
+
let t14;
|
|
146
|
+
if ($[27] !== files?.length) {
|
|
147
|
+
t14 = files?.length === 0 && /* @__PURE__ */ jsx("p", {
|
|
148
|
+
className: "text-muted-foreground py-8 text-center text-sm",
|
|
149
|
+
children: "No assets yet"
|
|
150
|
+
});
|
|
151
|
+
$[27] = files?.length;
|
|
152
|
+
$[28] = t14;
|
|
153
|
+
} else t14 = $[28];
|
|
154
|
+
let t15;
|
|
155
|
+
if ($[29] !== files || $[30] !== handleSelectSingle || $[31] !== mode || $[32] !== selectedIds) {
|
|
156
|
+
t15 = files && files.length > 0 && /* @__PURE__ */ jsx("div", {
|
|
157
|
+
className: "grid grid-cols-[repeat(auto-fill,minmax(140px,1fr))] gap-3",
|
|
158
|
+
children: files.map((file_0) => /* @__PURE__ */ jsx(AssetCard, {
|
|
159
|
+
file: file_0,
|
|
160
|
+
selected: selectedIds.has(file_0.id),
|
|
161
|
+
onSelect: () => {
|
|
162
|
+
if (mode === "single") {
|
|
163
|
+
handleSelectSingle(file_0);
|
|
164
|
+
return;
|
|
165
|
+
}
|
|
166
|
+
toggleSelection(file_0.id);
|
|
167
|
+
},
|
|
168
|
+
onOpen: () => setLightboxFile(file_0)
|
|
169
|
+
}, file_0.id))
|
|
170
|
+
});
|
|
171
|
+
$[29] = files;
|
|
172
|
+
$[30] = handleSelectSingle;
|
|
173
|
+
$[31] = mode;
|
|
174
|
+
$[32] = selectedIds;
|
|
175
|
+
$[33] = t15;
|
|
176
|
+
} else t15 = $[33];
|
|
177
|
+
let t16;
|
|
178
|
+
if ($[34] !== t13 || $[35] !== t14 || $[36] !== t15) {
|
|
179
|
+
t16 = /* @__PURE__ */ jsxs("div", {
|
|
180
|
+
className: "-mx-2 overflow-y-auto px-2",
|
|
181
|
+
children: [
|
|
182
|
+
t13,
|
|
183
|
+
t14,
|
|
184
|
+
t15
|
|
185
|
+
]
|
|
186
|
+
});
|
|
187
|
+
$[34] = t13;
|
|
188
|
+
$[35] = t14;
|
|
189
|
+
$[36] = t15;
|
|
190
|
+
$[37] = t16;
|
|
191
|
+
} else t16 = $[37];
|
|
192
|
+
let t17;
|
|
193
|
+
if ($[38] === Symbol.for("react.memo_cache_sentinel")) {
|
|
194
|
+
t17 = /* @__PURE__ */ jsx(DialogClose, {
|
|
195
|
+
render: /* @__PURE__ */ jsx(Button, { variant: "outline" }),
|
|
196
|
+
children: "Cancel"
|
|
197
|
+
});
|
|
198
|
+
$[38] = t17;
|
|
199
|
+
} else t17 = $[38];
|
|
200
|
+
let t18;
|
|
201
|
+
if ($[39] !== handleConfirmMultiple || $[40] !== mode || $[41] !== selectedIds) {
|
|
202
|
+
t18 = mode === "multiple" && /* @__PURE__ */ jsxs(Button, {
|
|
203
|
+
variant: "default",
|
|
204
|
+
disabled: selectedIds.size === 0,
|
|
205
|
+
onClick: handleConfirmMultiple,
|
|
206
|
+
children: [
|
|
207
|
+
"Add selected (",
|
|
208
|
+
selectedIds.size,
|
|
209
|
+
")"
|
|
210
|
+
]
|
|
211
|
+
});
|
|
212
|
+
$[39] = handleConfirmMultiple;
|
|
213
|
+
$[40] = mode;
|
|
214
|
+
$[41] = selectedIds;
|
|
215
|
+
$[42] = t18;
|
|
216
|
+
} else t18 = $[42];
|
|
217
|
+
let t19;
|
|
218
|
+
if ($[43] !== t18) {
|
|
219
|
+
t19 = /* @__PURE__ */ jsxs(DialogFooter, { children: [t17, t18] });
|
|
220
|
+
$[43] = t18;
|
|
221
|
+
$[44] = t19;
|
|
222
|
+
} else t19 = $[44];
|
|
223
|
+
let t20;
|
|
224
|
+
if ($[45] !== lightboxFile) {
|
|
225
|
+
t20 = lightboxFile && /* @__PURE__ */ jsx(AssetLightbox, {
|
|
226
|
+
open: !!lightboxFile,
|
|
227
|
+
onOpenChange: (open_0) => {
|
|
228
|
+
if (!open_0) setLightboxFile(null);
|
|
229
|
+
},
|
|
230
|
+
fileId: lightboxFile.id
|
|
231
|
+
});
|
|
232
|
+
$[45] = lightboxFile;
|
|
233
|
+
$[46] = t20;
|
|
234
|
+
} else t20 = $[46];
|
|
235
|
+
let t21;
|
|
236
|
+
if ($[47] !== t12 || $[48] !== t16 || $[49] !== t19 || $[50] !== t20) {
|
|
237
|
+
t21 = /* @__PURE__ */ jsxs(DialogContent, {
|
|
238
|
+
className: "flex max-h-[90vh] flex-col sm:max-w-4xl",
|
|
239
|
+
children: [
|
|
240
|
+
t12,
|
|
241
|
+
t16,
|
|
242
|
+
t19,
|
|
243
|
+
t20
|
|
244
|
+
]
|
|
245
|
+
});
|
|
246
|
+
$[47] = t12;
|
|
247
|
+
$[48] = t16;
|
|
248
|
+
$[49] = t19;
|
|
249
|
+
$[50] = t20;
|
|
250
|
+
$[51] = t21;
|
|
251
|
+
} else t21 = $[51];
|
|
252
|
+
let t22;
|
|
253
|
+
if ($[52] !== onOpenChange || $[53] !== open || $[54] !== t21) {
|
|
254
|
+
t22 = /* @__PURE__ */ jsx(Dialog, {
|
|
255
|
+
open,
|
|
256
|
+
onOpenChange,
|
|
257
|
+
children: t21
|
|
258
|
+
});
|
|
259
|
+
$[52] = onOpenChange;
|
|
260
|
+
$[53] = open;
|
|
261
|
+
$[54] = t21;
|
|
262
|
+
$[55] = t22;
|
|
263
|
+
} else t22 = $[55];
|
|
264
|
+
return t22;
|
|
265
|
+
};
|
|
266
|
+
function _temp(f) {
|
|
267
|
+
return f.mimeType?.startsWith("image/");
|
|
268
|
+
}
|
|
269
|
+
function _temp2(_, i) {
|
|
270
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
271
|
+
className: "flex flex-col gap-1.5 rounded-lg p-2",
|
|
272
|
+
children: [/* @__PURE__ */ jsx(Skeleton, { className: "aspect-4/3 w-full rounded-md" }), /* @__PURE__ */ jsx(Skeleton, { className: "h-3.5 w-3/4 rounded" })]
|
|
273
|
+
}, i);
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
//#endregion
|
|
277
|
+
export { AssetPickerModal };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { trackClientEvent } from "../../../lib/telemetry-client.js";
|
|
2
|
-
import { previewStore, selectionItemId } from "../previewStore.js";
|
|
3
1
|
import { actionsStore } from "../../provider/actionsStore.js";
|
|
4
2
|
import { blockMutations, repeatableItemMutations } from "../../../lib/queries.js";
|
|
3
|
+
import { trackClientEvent } from "../../../lib/telemetry-client.js";
|
|
5
4
|
import { formatShortcut } from "../../../lib/utils.js";
|
|
5
|
+
import { previewStore, selectionItemId } from "../previewStore.js";
|
|
6
6
|
import { usePageBlocks } from "../../../lib/normalized-data.js";
|
|
7
7
|
import { useCamoxApp } from "../../provider/components/CamoxAppContext.js";
|
|
8
8
|
import { useRequireDraftSource } from "../../../core/hooks/useRequireDraftSource.js";
|
|
@@ -10,13 +10,13 @@ import { useUpdateBlockPosition } from "./useUpdateBlockPosition.js";
|
|
|
10
10
|
import { usePreviewedPage } from "../CamoxPreview.js";
|
|
11
11
|
import { c } from "react/compiler-runtime";
|
|
12
12
|
import { Popover, PopoverContent, PopoverTrigger } from "@camox/ui/popover";
|
|
13
|
-
import { toast } from "@camox/ui/toaster";
|
|
14
13
|
import { useMutation } from "@tanstack/react-query";
|
|
15
14
|
import { useSelector } from "@xstate/store-react";
|
|
16
15
|
import * as React from "react";
|
|
17
16
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
18
|
-
import {
|
|
17
|
+
import { toast } from "@camox/ui/toaster";
|
|
19
18
|
import { Copy, Pen, Settings, Trash2 } from "lucide-react";
|
|
19
|
+
import { AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogTitle } from "@camox/ui/alert-dialog";
|
|
20
20
|
import { Command, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator, CommandShortcut } from "@camox/ui/command";
|
|
21
21
|
|
|
22
22
|
//#region src/features/preview/components/BlockActionsPopover.tsx
|
|
@@ -61,14 +61,14 @@ const BlockActionsPopover = ({ block, children, open, onOpenChange, align = "sta
|
|
|
61
61
|
const blockIndex = pageBlocks.findIndex((b) => b.id === block_2.id);
|
|
62
62
|
const afterPosition = blockIndex > 0 ? pageBlocks[blockIndex - 1].position : "";
|
|
63
63
|
previewStore.send({
|
|
64
|
-
type: "
|
|
64
|
+
type: "openAddBlockSidebar",
|
|
65
65
|
afterPosition,
|
|
66
66
|
via: "popover-above"
|
|
67
67
|
});
|
|
68
68
|
};
|
|
69
69
|
const handleAddBlockBelow = (block_3) => {
|
|
70
70
|
previewStore.send({
|
|
71
|
-
type: "
|
|
71
|
+
type: "openAddBlockSidebar",
|
|
72
72
|
afterPosition: block_3.position,
|
|
73
73
|
via: "popover-below"
|
|
74
74
|
});
|
|
@@ -151,7 +151,7 @@ const BlockActionsPopover = ({ block, children, open, onOpenChange, align = "sta
|
|
|
151
151
|
isLayoutBlock && layoutPlacement === "before" && /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(CommandSeparator, {}), /* @__PURE__ */ jsx(CommandGroup, { children: /* @__PURE__ */ jsx(CommandItem, {
|
|
152
152
|
onSelect: () => {
|
|
153
153
|
previewStore.send({
|
|
154
|
-
type: "
|
|
154
|
+
type: "openAddBlockSidebar",
|
|
155
155
|
afterPosition: "",
|
|
156
156
|
via: "layout-popover-below"
|
|
157
157
|
});
|
|
@@ -166,7 +166,7 @@ const BlockActionsPopover = ({ block, children, open, onOpenChange, align = "sta
|
|
|
166
166
|
onSelect: () => {
|
|
167
167
|
const lastPageBlock = pageBlocks[pageBlocks.length - 1];
|
|
168
168
|
previewStore.send({
|
|
169
|
-
type: "
|
|
169
|
+
type: "openAddBlockSidebar",
|
|
170
170
|
afterPosition: lastPageBlock?.position,
|
|
171
171
|
via: "layout-popover-above"
|
|
172
172
|
});
|
|
@@ -279,9 +279,9 @@ function isLayoutBlockId(page, blockId) {
|
|
|
279
279
|
}
|
|
280
280
|
function useBlockActionsShortcuts() {
|
|
281
281
|
const $ = c(20);
|
|
282
|
-
if ($[0] !== "
|
|
282
|
+
if ($[0] !== "6f08ff9bc0fed3282acf0d89ae92abc621f32d53def6f8643005da200178547a") {
|
|
283
283
|
for (let $i = 0; $i < 20; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
|
|
284
|
-
$[0] = "
|
|
284
|
+
$[0] = "6f08ff9bc0fed3282acf0d89ae92abc621f32d53def6f8643005da200178547a";
|
|
285
285
|
}
|
|
286
286
|
const camoxApp = useCamoxApp();
|
|
287
287
|
const page = usePreviewedPage();
|
|
@@ -327,8 +327,7 @@ function useBlockActionsShortcuts() {
|
|
|
327
327
|
},
|
|
328
328
|
checkIfAvailable: () => {
|
|
329
329
|
const ctx = previewStore.getSnapshot().context;
|
|
330
|
-
if (ctx.
|
|
331
|
-
if (ctx.isPresentationMode) return false;
|
|
330
|
+
if (!ctx.isEditMode) return false;
|
|
332
331
|
const sel = ctx.selection;
|
|
333
332
|
if (!sel) return false;
|
|
334
333
|
if (isLayoutBlockId(page, sel.blockId)) return false;
|
|
@@ -370,8 +369,7 @@ function useBlockActionsShortcuts() {
|
|
|
370
369
|
},
|
|
371
370
|
checkIfAvailable: () => {
|
|
372
371
|
const ctx_0 = previewStore.getSnapshot().context;
|
|
373
|
-
if (ctx_0.
|
|
374
|
-
if (ctx_0.isPresentationMode) return false;
|
|
372
|
+
if (!ctx_0.isEditMode) return false;
|
|
375
373
|
const sel_1 = ctx_0.selection;
|
|
376
374
|
if (!sel_1) return false;
|
|
377
375
|
if (isLayoutBlockId(page, sel_1.blockId)) return false;
|
|
@@ -400,8 +398,7 @@ function useBlockActionsShortcuts() {
|
|
|
400
398
|
},
|
|
401
399
|
checkIfAvailable: () => {
|
|
402
400
|
const ctx_1 = previewStore.getSnapshot().context;
|
|
403
|
-
if (ctx_1.
|
|
404
|
-
if (ctx_1.isPresentationMode) return false;
|
|
401
|
+
if (!ctx_1.isEditMode) return false;
|
|
405
402
|
const sel_3 = ctx_1.selection;
|
|
406
403
|
if (!sel_3 || !page) return false;
|
|
407
404
|
if (isLayoutBlockId(page, sel_3.blockId)) return false;
|
|
@@ -432,8 +429,7 @@ function useBlockActionsShortcuts() {
|
|
|
432
429
|
},
|
|
433
430
|
checkIfAvailable: () => {
|
|
434
431
|
const ctx_2 = previewStore.getSnapshot().context;
|
|
435
|
-
if (ctx_2.
|
|
436
|
-
if (ctx_2.isPresentationMode) return false;
|
|
432
|
+
if (!ctx_2.isEditMode) return false;
|
|
437
433
|
const sel_5 = ctx_2.selection;
|
|
438
434
|
if (!sel_5 || !page) return false;
|
|
439
435
|
if (isLayoutBlockId(page, sel_5.blockId)) return false;
|
|
@@ -468,7 +464,7 @@ function useBlockActionsShortcuts() {
|
|
|
468
464
|
const block_2 = pageBlocks.find((b_6) => b_6.id === sel_7.blockId);
|
|
469
465
|
if (!block_2) return;
|
|
470
466
|
previewStore.send({
|
|
471
|
-
type: "
|
|
467
|
+
type: "openAddBlockSidebar",
|
|
472
468
|
afterPosition: block_2.position,
|
|
473
469
|
via: "shortcut-below"
|
|
474
470
|
});
|
|
@@ -491,7 +487,7 @@ function useBlockActionsShortcuts() {
|
|
|
491
487
|
if (blockIndex === -1) return;
|
|
492
488
|
const afterPosition_1 = blockIndex > 0 ? pageBlocks[blockIndex - 1].position : "";
|
|
493
489
|
previewStore.send({
|
|
494
|
-
type: "
|
|
490
|
+
type: "openAddBlockSidebar",
|
|
495
491
|
afterPosition: afterPosition_1,
|
|
496
492
|
via: "shortcut-above"
|
|
497
493
|
});
|
|
@@ -542,14 +538,12 @@ function _temp12(a) {
|
|
|
542
538
|
}
|
|
543
539
|
function _temp11() {
|
|
544
540
|
const ctx_4 = previewStore.getSnapshot().context;
|
|
545
|
-
if (ctx_4.
|
|
546
|
-
if (ctx_4.isPresentationMode) return false;
|
|
541
|
+
if (!ctx_4.isEditMode) return false;
|
|
547
542
|
return ctx_4.selection !== null;
|
|
548
543
|
}
|
|
549
544
|
function _temp10() {
|
|
550
545
|
const ctx_3 = previewStore.getSnapshot().context;
|
|
551
|
-
if (ctx_3.
|
|
552
|
-
if (ctx_3.isPresentationMode) return false;
|
|
546
|
+
if (!ctx_3.isEditMode) return false;
|
|
553
547
|
return ctx_3.selection !== null;
|
|
554
548
|
}
|
|
555
549
|
function _temp1() {
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import { trackClientEvent } from "../../../lib/telemetry-client.js";
|
|
2
|
-
import { previewStore } from "../previewStore.js";
|
|
3
1
|
import { useProjectSlug } from "../../../lib/auth.js";
|
|
4
2
|
import { layoutQueries, pageMutations, pageQueries, projectQueries } from "../../../lib/queries.js";
|
|
3
|
+
import { trackClientEvent } from "../../../lib/telemetry-client.js";
|
|
4
|
+
import { previewStore } from "../previewStore.js";
|
|
5
5
|
import { useCamoxApp } from "../../provider/components/CamoxAppContext.js";
|
|
6
6
|
import { PageLocationFieldset } from "./PageLocationFieldset.js";
|
|
7
7
|
import { PageNicknameField } from "./PageNicknameField.js";
|
|
8
8
|
import { c } from "react/compiler-runtime";
|
|
9
9
|
import { Label } from "@camox/ui/label";
|
|
10
|
-
import { toast } from "@camox/ui/toaster";
|
|
11
10
|
import { useMutation, useQuery } from "@tanstack/react-query";
|
|
12
11
|
import { useNavigate } from "@tanstack/react-router";
|
|
13
12
|
import { useSelector } from "@xstate/store-react";
|
|
14
13
|
import { useEffect } from "react";
|
|
15
14
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
15
|
+
import { toast } from "@camox/ui/toaster";
|
|
16
16
|
import { Button } from "@camox/ui/button";
|
|
17
17
|
import { Spinner } from "@camox/ui/spinner";
|
|
18
18
|
import { Dialog, DialogContent, DialogDescription, DialogHeader, DialogTitle } from "@camox/ui/dialog";
|
|
@@ -27,9 +27,9 @@ const slugifyPathSegment = (nickname) => {
|
|
|
27
27
|
};
|
|
28
28
|
const CreatePageModal = () => {
|
|
29
29
|
const $ = c(56);
|
|
30
|
-
if ($[0] !== "
|
|
30
|
+
if ($[0] !== "0bdc1cbbe76a506d23a387e0cb27a62f7a2ffc3ace0fcab2f383b3d3afedba17") {
|
|
31
31
|
for (let $i = 0; $i < 56; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
|
|
32
|
-
$[0] = "
|
|
32
|
+
$[0] = "0bdc1cbbe76a506d23a387e0cb27a62f7a2ffc3ace0fcab2f383b3d3afedba17";
|
|
33
33
|
}
|
|
34
34
|
const projectSlug = useProjectSlug();
|
|
35
35
|
const open = useSelector(previewStore, _temp);
|
|
@@ -130,7 +130,7 @@ const CreatePageModal = () => {
|
|
|
130
130
|
await new Promise(_temp2);
|
|
131
131
|
await navigate({ to: fullPath });
|
|
132
132
|
previewStore.send({
|
|
133
|
-
type: "
|
|
133
|
+
type: "openAgentChatSidebar",
|
|
134
134
|
pageScaffoldContext: {
|
|
135
135
|
nickname,
|
|
136
136
|
fullPath
|