camox 0.29.0 → 0.31.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.js +235 -198
- package/dist/features/agent-chat/agent-chat-labels.js +200 -0
- package/dist/features/agent-chat/components/AgentChatSheet.js +207 -0
- package/dist/features/agent-chat/components/AgentChatThread.js +594 -0
- package/dist/features/agent-chat/components/AgentToolCallCard.js +141 -0
- package/dist/features/preview/CamoxPreview.js +60 -13
- package/dist/features/preview/components/CreatePageModal.js +257 -121
- package/dist/features/preview/components/PageNicknameField.js +3 -3
- package/dist/features/preview/components/PreviewPanel.js +29 -6
- package/dist/features/preview/components/PreviewSideSheet.js +20 -16
- package/dist/features/preview/previewStore.js +49 -8
- package/dist/features/provider/components/CommandPalette.js +6 -4
- package/dist/features/studio/components/Navbar.js +14 -7
- package/dist/features/studio/useTheme.js +14 -6
- package/dist/features/vite/vite.js +1 -0
- package/dist/lib/auth.js +18 -12
- package/dist/studio.css +1 -1
- package/package.json +6 -4
- package/dist/features/preview/components/AgentChatSheet.js +0 -101
|
@@ -5,6 +5,7 @@ import { layoutQueries, pageMutations, pageQueries, projectQueries } from "../..
|
|
|
5
5
|
import { useCamoxApp } from "../../provider/components/CamoxAppContext.js";
|
|
6
6
|
import { PageLocationFieldset } from "./PageLocationFieldset.js";
|
|
7
7
|
import { PageNicknameField } from "./PageNicknameField.js";
|
|
8
|
+
import { c } from "react/compiler-runtime";
|
|
8
9
|
import { Label } from "@camox/ui/label";
|
|
9
10
|
import { toast } from "@camox/ui/toaster";
|
|
10
11
|
import { useMutation, useQuery } from "@tanstack/react-query";
|
|
@@ -16,7 +17,6 @@ import { Button } from "@camox/ui/button";
|
|
|
16
17
|
import { Spinner } from "@camox/ui/spinner";
|
|
17
18
|
import { Dialog, DialogContent, DialogDescription, DialogHeader, DialogTitle } from "@camox/ui/dialog";
|
|
18
19
|
import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "@camox/ui/select";
|
|
19
|
-
import { Textarea } from "@camox/ui/textarea";
|
|
20
20
|
import { useForm } from "@tanstack/react-form";
|
|
21
21
|
|
|
22
22
|
//#region src/features/preview/components/CreatePageModal.tsx
|
|
@@ -26,28 +26,76 @@ const slugifyPathSegment = (nickname) => {
|
|
|
26
26
|
return trimmedNickname.normalize("NFD").replace(/[\u0300-\u036f]/g, "").toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "");
|
|
27
27
|
};
|
|
28
28
|
const CreatePageModal = () => {
|
|
29
|
+
const $ = c(56);
|
|
30
|
+
if ($[0] !== "b8df2a1092de301a9d615ec804796532e8227e0b41cafb81fc4194f1edb03074") {
|
|
31
|
+
for (let $i = 0; $i < 56; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
|
|
32
|
+
$[0] = "b8df2a1092de301a9d615ec804796532e8227e0b41cafb81fc4194f1edb03074";
|
|
33
|
+
}
|
|
29
34
|
const projectSlug = useProjectSlug();
|
|
30
|
-
const open = useSelector(previewStore,
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
35
|
+
const open = useSelector(previewStore, _temp);
|
|
36
|
+
let t0;
|
|
37
|
+
if ($[1] === Symbol.for("react.memo_cache_sentinel")) {
|
|
38
|
+
t0 = pageMutations.create();
|
|
39
|
+
$[1] = t0;
|
|
40
|
+
} else t0 = $[1];
|
|
41
|
+
const createPage = useMutation(t0);
|
|
42
|
+
let t1;
|
|
43
|
+
if ($[2] !== projectSlug) {
|
|
44
|
+
t1 = projectQueries.getBySlug(projectSlug);
|
|
45
|
+
$[2] = projectSlug;
|
|
46
|
+
$[3] = t1;
|
|
47
|
+
} else t1 = $[3];
|
|
48
|
+
const { data: project } = useQuery(t1);
|
|
49
|
+
let t2;
|
|
50
|
+
if ($[4] !== project?.id) {
|
|
51
|
+
t2 = pageQueries.list(project?.id ?? 0);
|
|
52
|
+
$[4] = project?.id;
|
|
53
|
+
$[5] = t2;
|
|
54
|
+
} else t2 = $[5];
|
|
55
|
+
const t3 = !!project;
|
|
56
|
+
let t4;
|
|
57
|
+
if ($[6] !== t2 || $[7] !== t3) {
|
|
58
|
+
t4 = {
|
|
59
|
+
...t2,
|
|
60
|
+
enabled: t3
|
|
61
|
+
};
|
|
62
|
+
$[6] = t2;
|
|
63
|
+
$[7] = t3;
|
|
64
|
+
$[8] = t4;
|
|
65
|
+
} else t4 = $[8];
|
|
66
|
+
const { data: pages } = useQuery(t4);
|
|
67
|
+
let t5;
|
|
68
|
+
if ($[9] !== project?.id) {
|
|
69
|
+
t5 = layoutQueries.list(project?.id ?? 0);
|
|
70
|
+
$[9] = project?.id;
|
|
71
|
+
$[10] = t5;
|
|
72
|
+
} else t5 = $[10];
|
|
73
|
+
const t6 = !!project;
|
|
74
|
+
let t7;
|
|
75
|
+
if ($[11] !== t5 || $[12] !== t6) {
|
|
76
|
+
t7 = {
|
|
77
|
+
...t5,
|
|
78
|
+
enabled: t6
|
|
79
|
+
};
|
|
80
|
+
$[11] = t5;
|
|
81
|
+
$[12] = t6;
|
|
82
|
+
$[13] = t7;
|
|
83
|
+
} else t7 = $[13];
|
|
84
|
+
const { data: layouts } = useQuery(t7);
|
|
41
85
|
const camoxApp = useCamoxApp();
|
|
42
86
|
const navigate = useNavigate();
|
|
43
|
-
|
|
44
|
-
|
|
87
|
+
let t8;
|
|
88
|
+
if ($[14] === Symbol.for("react.memo_cache_sentinel")) {
|
|
89
|
+
t8 = {
|
|
45
90
|
nickname: "",
|
|
46
91
|
parentPageId: void 0,
|
|
47
92
|
pathSegment: "",
|
|
48
|
-
layoutId: ""
|
|
49
|
-
|
|
50
|
-
|
|
93
|
+
layoutId: ""
|
|
94
|
+
};
|
|
95
|
+
$[14] = t8;
|
|
96
|
+
} else t8 = $[14];
|
|
97
|
+
const form = useForm({
|
|
98
|
+
defaultValues: t8,
|
|
51
99
|
onSubmit: async (values) => {
|
|
52
100
|
try {
|
|
53
101
|
if (!project) {
|
|
@@ -64,8 +112,7 @@ const CreatePageModal = () => {
|
|
|
64
112
|
nickname,
|
|
65
113
|
pathSegment: values.value.pathSegment,
|
|
66
114
|
parentPageId: values.value.parentPageId,
|
|
67
|
-
layoutId: Number(values.value.layoutId)
|
|
68
|
-
contentDescription: values.value.contentDescription || void 0
|
|
115
|
+
layoutId: Number(values.value.layoutId)
|
|
69
116
|
});
|
|
70
117
|
toast.promise(createPagePromise, {
|
|
71
118
|
loading: "Creating page...",
|
|
@@ -76,122 +123,211 @@ const CreatePageModal = () => {
|
|
|
76
123
|
trackClientEvent("page_created", {
|
|
77
124
|
projectId: project.id,
|
|
78
125
|
pathSegment: values.value.pathSegment,
|
|
79
|
-
layoutId: values.value.layoutId
|
|
80
|
-
hasContentDescription: !!values.value.contentDescription
|
|
126
|
+
layoutId: values.value.layoutId
|
|
81
127
|
});
|
|
82
128
|
previewStore.send({ type: "closeCreatePageModal" });
|
|
83
129
|
form.reset();
|
|
84
|
-
await new Promise(
|
|
130
|
+
await new Promise(_temp2);
|
|
85
131
|
await navigate({ to: fullPath });
|
|
86
|
-
|
|
87
|
-
|
|
132
|
+
previewStore.send({
|
|
133
|
+
type: "openAgentChatSheet",
|
|
134
|
+
pageScaffoldContext: {
|
|
135
|
+
nickname,
|
|
136
|
+
fullPath
|
|
137
|
+
}
|
|
138
|
+
});
|
|
139
|
+
} catch (t9) {
|
|
140
|
+
console.error("Failed to create page:", t9);
|
|
88
141
|
toast.error("Could not create page");
|
|
89
142
|
}
|
|
90
143
|
}
|
|
91
144
|
});
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
145
|
+
let t10;
|
|
146
|
+
if ($[15] !== form || $[16] !== layouts) {
|
|
147
|
+
t10 = () => {
|
|
148
|
+
if (layouts && layouts.length > 0 && !form.getFieldValue("layoutId")) form.setFieldValue("layoutId", String(layouts[0].id));
|
|
149
|
+
};
|
|
150
|
+
$[15] = form;
|
|
151
|
+
$[16] = layouts;
|
|
152
|
+
$[17] = t10;
|
|
153
|
+
} else t10 = $[17];
|
|
154
|
+
let t11;
|
|
155
|
+
if ($[18] !== form || $[19] !== layouts) {
|
|
156
|
+
t11 = [layouts, form];
|
|
157
|
+
$[18] = form;
|
|
158
|
+
$[19] = layouts;
|
|
159
|
+
$[20] = t11;
|
|
160
|
+
} else t11 = $[20];
|
|
161
|
+
useEffect(t10, t11);
|
|
162
|
+
let t12;
|
|
163
|
+
if ($[21] === Symbol.for("react.memo_cache_sentinel")) {
|
|
164
|
+
t12 = /* @__PURE__ */ jsxs(DialogHeader, { children: [/* @__PURE__ */ jsx(DialogTitle, { children: "Create page" }), /* @__PURE__ */ jsx(DialogDescription, { children: "Fill in the details to create a new page. It will be created as a draft." })] });
|
|
165
|
+
$[21] = t12;
|
|
166
|
+
} else t12 = $[21];
|
|
167
|
+
let t13;
|
|
168
|
+
if ($[22] !== form) {
|
|
169
|
+
t13 = (e) => {
|
|
170
|
+
e.preventDefault();
|
|
171
|
+
e.stopPropagation();
|
|
172
|
+
form.handleSubmit();
|
|
173
|
+
};
|
|
174
|
+
$[22] = form;
|
|
175
|
+
$[23] = t13;
|
|
176
|
+
} else t13 = $[23];
|
|
177
|
+
let t14;
|
|
178
|
+
if ($[24] !== form) {
|
|
179
|
+
t14 = (field) => /* @__PURE__ */ jsx(PageNicknameField, {
|
|
180
|
+
value: field.state.value,
|
|
181
|
+
onChange: (value_0) => {
|
|
182
|
+
field.handleChange(value_0);
|
|
183
|
+
if (form.getFieldMeta("pathSegment")?.isDirty) return;
|
|
184
|
+
form.setFieldValue("pathSegment", slugifyPathSegment(value_0), { dontUpdateMeta: true });
|
|
185
|
+
},
|
|
186
|
+
autoFocus: true
|
|
187
|
+
});
|
|
188
|
+
$[24] = form;
|
|
189
|
+
$[25] = t14;
|
|
190
|
+
} else t14 = $[25];
|
|
191
|
+
let t15;
|
|
192
|
+
if ($[26] !== form.Field || $[27] !== t14) {
|
|
193
|
+
t15 = /* @__PURE__ */ jsx(form.Field, {
|
|
194
|
+
name: "nickname",
|
|
195
|
+
children: t14
|
|
196
|
+
});
|
|
197
|
+
$[26] = form.Field;
|
|
198
|
+
$[27] = t14;
|
|
199
|
+
$[28] = t15;
|
|
200
|
+
} else t15 = $[28];
|
|
201
|
+
let t16;
|
|
202
|
+
if ($[29] !== form.Field || $[30] !== pages) {
|
|
203
|
+
t16 = (parentField) => /* @__PURE__ */ jsx(form.Field, {
|
|
204
|
+
name: "pathSegment",
|
|
205
|
+
children: (pathField) => /* @__PURE__ */ jsx(PageLocationFieldset, {
|
|
206
|
+
parentPageId: parentField.state.value,
|
|
207
|
+
onParentPageIdChange: parentField.handleChange,
|
|
208
|
+
pathSegment: pathField.state.value,
|
|
209
|
+
onPathSegmentChange: pathField.handleChange,
|
|
210
|
+
pages
|
|
211
|
+
})
|
|
212
|
+
});
|
|
213
|
+
$[29] = form.Field;
|
|
214
|
+
$[30] = pages;
|
|
215
|
+
$[31] = t16;
|
|
216
|
+
} else t16 = $[31];
|
|
217
|
+
let t17;
|
|
218
|
+
if ($[32] !== form.Field || $[33] !== t16) {
|
|
219
|
+
t17 = /* @__PURE__ */ jsx(form.Field, {
|
|
220
|
+
name: "parentPageId",
|
|
221
|
+
children: t16
|
|
222
|
+
});
|
|
223
|
+
$[32] = form.Field;
|
|
224
|
+
$[33] = t16;
|
|
225
|
+
$[34] = t17;
|
|
226
|
+
} else t17 = $[34];
|
|
227
|
+
let t18;
|
|
228
|
+
if ($[35] !== camoxApp || $[36] !== layouts) {
|
|
229
|
+
t18 = (field_0) => /* @__PURE__ */ jsxs("div", {
|
|
230
|
+
className: "space-y-2",
|
|
231
|
+
children: [/* @__PURE__ */ jsx(Label, {
|
|
232
|
+
htmlFor: "layoutId",
|
|
233
|
+
children: "Layout"
|
|
234
|
+
}), /* @__PURE__ */ jsxs(Select, {
|
|
235
|
+
value: field_0.state.value,
|
|
236
|
+
onValueChange: (value_1) => {
|
|
237
|
+
if (value_1 != null) field_0.handleChange(value_1);
|
|
107
238
|
},
|
|
239
|
+
disabled: layouts != null && layouts.length <= 1,
|
|
240
|
+
items: layouts?.map((t) => ({
|
|
241
|
+
value: String(t.id),
|
|
242
|
+
label: camoxApp.getLayoutById(t.layoutId)?._internal.title ?? t.layoutId
|
|
243
|
+
})),
|
|
244
|
+
children: [/* @__PURE__ */ jsx(SelectTrigger, { children: /* @__PURE__ */ jsx(SelectValue, { placeholder: "Select a layout" }) }), /* @__PURE__ */ jsx(SelectContent, { children: layouts?.map((t_0) => /* @__PURE__ */ jsx(SelectItem, {
|
|
245
|
+
value: String(t_0.id),
|
|
246
|
+
children: camoxApp.getLayoutById(t_0.layoutId)?._internal.title ?? t_0.layoutId
|
|
247
|
+
}, t_0.id)) })]
|
|
248
|
+
})]
|
|
249
|
+
});
|
|
250
|
+
$[35] = camoxApp;
|
|
251
|
+
$[36] = layouts;
|
|
252
|
+
$[37] = t18;
|
|
253
|
+
} else t18 = $[37];
|
|
254
|
+
let t19;
|
|
255
|
+
if ($[38] !== form.Field || $[39] !== t18) {
|
|
256
|
+
t19 = /* @__PURE__ */ jsx(form.Field, {
|
|
257
|
+
name: "layoutId",
|
|
258
|
+
children: t18
|
|
259
|
+
});
|
|
260
|
+
$[38] = form.Field;
|
|
261
|
+
$[39] = t18;
|
|
262
|
+
$[40] = t19;
|
|
263
|
+
} else t19 = $[40];
|
|
264
|
+
let t20;
|
|
265
|
+
if ($[41] !== form.state.isSubmitting) {
|
|
266
|
+
t20 = form.state.isSubmitting && /* @__PURE__ */ jsx(Spinner, {});
|
|
267
|
+
$[41] = form.state.isSubmitting;
|
|
268
|
+
$[42] = t20;
|
|
269
|
+
} else t20 = $[42];
|
|
270
|
+
const t21 = form.state.isSubmitting && "...";
|
|
271
|
+
let t22;
|
|
272
|
+
if ($[43] !== form.state.isSubmitting || $[44] !== t20 || $[45] !== t21) {
|
|
273
|
+
t22 = /* @__PURE__ */ jsxs(Button, {
|
|
274
|
+
type: "submit",
|
|
275
|
+
disabled: form.state.isSubmitting,
|
|
276
|
+
children: [
|
|
277
|
+
t20,
|
|
278
|
+
"Create page",
|
|
279
|
+
t21
|
|
280
|
+
]
|
|
281
|
+
});
|
|
282
|
+
$[43] = form.state.isSubmitting;
|
|
283
|
+
$[44] = t20;
|
|
284
|
+
$[45] = t21;
|
|
285
|
+
$[46] = t22;
|
|
286
|
+
} else t22 = $[46];
|
|
287
|
+
let t23;
|
|
288
|
+
if ($[47] !== t13 || $[48] !== t15 || $[49] !== t17 || $[50] !== t19 || $[51] !== t22) {
|
|
289
|
+
t23 = /* @__PURE__ */ jsxs(DialogContent, {
|
|
290
|
+
className: "flex max-h-[90vh] flex-col sm:max-w-lg",
|
|
291
|
+
children: [t12, /* @__PURE__ */ jsxs("form", {
|
|
292
|
+
onSubmit: t13,
|
|
108
293
|
className: "-mx-1 space-y-4 overflow-y-auto px-1 py-2",
|
|
109
294
|
children: [
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
onChange: (value_0) => {
|
|
115
|
-
field.handleChange(value_0);
|
|
116
|
-
if (form.getFieldMeta("pathSegment")?.isDirty) return;
|
|
117
|
-
form.setFieldValue("pathSegment", slugifyPathSegment(value_0), { dontUpdateMeta: true });
|
|
118
|
-
},
|
|
119
|
-
autoFocus: true
|
|
120
|
-
})
|
|
121
|
-
}),
|
|
122
|
-
/* @__PURE__ */ jsx(form.Field, {
|
|
123
|
-
name: "parentPageId",
|
|
124
|
-
children: (parentField) => /* @__PURE__ */ jsx(form.Field, {
|
|
125
|
-
name: "pathSegment",
|
|
126
|
-
children: (pathField) => /* @__PURE__ */ jsx(PageLocationFieldset, {
|
|
127
|
-
parentPageId: parentField.state.value,
|
|
128
|
-
onParentPageIdChange: parentField.handleChange,
|
|
129
|
-
pathSegment: pathField.state.value,
|
|
130
|
-
onPathSegmentChange: pathField.handleChange,
|
|
131
|
-
pages
|
|
132
|
-
})
|
|
133
|
-
})
|
|
134
|
-
}),
|
|
135
|
-
/* @__PURE__ */ jsx(form.Field, {
|
|
136
|
-
name: "layoutId",
|
|
137
|
-
children: (field_0) => /* @__PURE__ */ jsxs("div", {
|
|
138
|
-
className: "space-y-2",
|
|
139
|
-
children: [/* @__PURE__ */ jsx(Label, {
|
|
140
|
-
htmlFor: "layoutId",
|
|
141
|
-
children: "Layout"
|
|
142
|
-
}), /* @__PURE__ */ jsxs(Select, {
|
|
143
|
-
value: field_0.state.value,
|
|
144
|
-
onValueChange: (value_1) => {
|
|
145
|
-
if (value_1 != null) field_0.handleChange(value_1);
|
|
146
|
-
},
|
|
147
|
-
disabled: layouts != null && layouts.length <= 1,
|
|
148
|
-
items: layouts?.map((t) => ({
|
|
149
|
-
value: String(t.id),
|
|
150
|
-
label: camoxApp.getLayoutById(t.layoutId)?._internal.title ?? t.layoutId
|
|
151
|
-
})),
|
|
152
|
-
children: [/* @__PURE__ */ jsx(SelectTrigger, { children: /* @__PURE__ */ jsx(SelectValue, { placeholder: "Select a layout" }) }), /* @__PURE__ */ jsx(SelectContent, { children: layouts?.map((t_0) => /* @__PURE__ */ jsx(SelectItem, {
|
|
153
|
-
value: String(t_0.id),
|
|
154
|
-
children: camoxApp.getLayoutById(t_0.layoutId)?._internal.title ?? t_0.layoutId
|
|
155
|
-
}, t_0.id)) })]
|
|
156
|
-
})]
|
|
157
|
-
})
|
|
158
|
-
}),
|
|
159
|
-
/* @__PURE__ */ jsx(form.Field, {
|
|
160
|
-
name: "contentDescription",
|
|
161
|
-
children: (field_1) => /* @__PURE__ */ jsxs("div", {
|
|
162
|
-
className: "space-y-2",
|
|
163
|
-
children: [
|
|
164
|
-
/* @__PURE__ */ jsx(Label, {
|
|
165
|
-
htmlFor: "contentDescription",
|
|
166
|
-
children: "Content description"
|
|
167
|
-
}),
|
|
168
|
-
/* @__PURE__ */ jsx(Textarea, {
|
|
169
|
-
id: "contentDescription",
|
|
170
|
-
value: field_1.state.value,
|
|
171
|
-
onChange: (e_0) => field_1.handleChange(e_0.target.value),
|
|
172
|
-
placeholder: "What your page will be about"
|
|
173
|
-
}),
|
|
174
|
-
/* @__PURE__ */ jsx("p", {
|
|
175
|
-
className: "text-muted-foreground text-xs",
|
|
176
|
-
children: "Used to generate a first draft of the page with AI."
|
|
177
|
-
})
|
|
178
|
-
]
|
|
179
|
-
})
|
|
180
|
-
}),
|
|
181
|
-
/* @__PURE__ */ jsxs(Button, {
|
|
182
|
-
type: "submit",
|
|
183
|
-
disabled: form.state.isSubmitting,
|
|
184
|
-
children: [
|
|
185
|
-
form.state.isSubmitting && /* @__PURE__ */ jsx(Spinner, {}),
|
|
186
|
-
"Create page",
|
|
187
|
-
form.state.isSubmitting && "..."
|
|
188
|
-
]
|
|
189
|
-
})
|
|
295
|
+
t15,
|
|
296
|
+
t17,
|
|
297
|
+
t19,
|
|
298
|
+
t22
|
|
190
299
|
]
|
|
191
300
|
})]
|
|
192
|
-
})
|
|
193
|
-
|
|
301
|
+
});
|
|
302
|
+
$[47] = t13;
|
|
303
|
+
$[48] = t15;
|
|
304
|
+
$[49] = t17;
|
|
305
|
+
$[50] = t19;
|
|
306
|
+
$[51] = t22;
|
|
307
|
+
$[52] = t23;
|
|
308
|
+
} else t23 = $[52];
|
|
309
|
+
let t24;
|
|
310
|
+
if ($[53] !== open || $[54] !== t23) {
|
|
311
|
+
t24 = /* @__PURE__ */ jsx(Dialog, {
|
|
312
|
+
open,
|
|
313
|
+
onOpenChange: _temp3,
|
|
314
|
+
children: t23
|
|
315
|
+
});
|
|
316
|
+
$[53] = open;
|
|
317
|
+
$[54] = t23;
|
|
318
|
+
$[55] = t24;
|
|
319
|
+
} else t24 = $[55];
|
|
320
|
+
return t24;
|
|
194
321
|
};
|
|
322
|
+
function _temp(state) {
|
|
323
|
+
return state.context.isCreatePageModalOpen;
|
|
324
|
+
}
|
|
325
|
+
function _temp2(resolve) {
|
|
326
|
+
return setTimeout(resolve, 50);
|
|
327
|
+
}
|
|
328
|
+
function _temp3(value) {
|
|
329
|
+
if (!value) previewStore.send({ type: "closeCreatePageModal" });
|
|
330
|
+
}
|
|
195
331
|
|
|
196
332
|
//#endregion
|
|
197
333
|
export { CreatePageModal };
|
|
@@ -7,9 +7,9 @@ import { jsx, jsxs } from "react/jsx-runtime";
|
|
|
7
7
|
const PAGE_NICKNAME_MAX_LENGTH = 80;
|
|
8
8
|
const PageNicknameField = (t0) => {
|
|
9
9
|
const $ = c(11);
|
|
10
|
-
if ($[0] !== "
|
|
10
|
+
if ($[0] !== "199b379d5753e5ca5f4aa7a7b627d5ac352937333c4a50c0960318d6a6420295") {
|
|
11
11
|
for (let $i = 0; $i < 11; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
|
|
12
|
-
$[0] = "
|
|
12
|
+
$[0] = "199b379d5753e5ca5f4aa7a7b627d5ac352937333c4a50c0960318d6a6420295";
|
|
13
13
|
}
|
|
14
14
|
const { value, onChange, autoFocus } = t0;
|
|
15
15
|
let t1;
|
|
@@ -45,7 +45,7 @@ const PageNicknameField = (t0) => {
|
|
|
45
45
|
if ($[8] === Symbol.for("react.memo_cache_sentinel")) {
|
|
46
46
|
t4 = /* @__PURE__ */ jsx("p", {
|
|
47
47
|
className: "text-muted-foreground text-xs",
|
|
48
|
-
children: "A short internal name used in Camox Studio.
|
|
48
|
+
children: "A short internal name used in Camox Studio. Does not affect SEO."
|
|
49
49
|
});
|
|
50
50
|
$[8] = t4;
|
|
51
51
|
} else t4 = $[8];
|
|
@@ -18,9 +18,9 @@ import { PanelContent } from "@camox/ui/panel";
|
|
|
18
18
|
//#region src/features/preview/components/PreviewPanel.tsx
|
|
19
19
|
const PreviewFrame = (t0) => {
|
|
20
20
|
const $ = c(9);
|
|
21
|
-
if ($[0] !== "
|
|
21
|
+
if ($[0] !== "a461a48603db73fa17ba8571e013d5de18c35d1f481b8ee66c35e485f2bdef70") {
|
|
22
22
|
for (let $i = 0; $i < 9; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
|
|
23
|
-
$[0] = "
|
|
23
|
+
$[0] = "a461a48603db73fa17ba8571e013d5de18c35d1f481b8ee66c35e485f2bdef70";
|
|
24
24
|
}
|
|
25
25
|
const { children, style, className, onIframeReady } = t0;
|
|
26
26
|
let t1;
|
|
@@ -61,9 +61,9 @@ const PreviewFrame = (t0) => {
|
|
|
61
61
|
};
|
|
62
62
|
const KeyDownForwarder = () => {
|
|
63
63
|
const $ = c(5);
|
|
64
|
-
if ($[0] !== "
|
|
64
|
+
if ($[0] !== "a461a48603db73fa17ba8571e013d5de18c35d1f481b8ee66c35e485f2bdef70") {
|
|
65
65
|
for (let $i = 0; $i < 5; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
|
|
66
|
-
$[0] = "
|
|
66
|
+
$[0] = "a461a48603db73fa17ba8571e013d5de18c35d1f481b8ee66c35e485f2bdef70";
|
|
67
67
|
}
|
|
68
68
|
const { window: iframeWindow } = useFrame();
|
|
69
69
|
const actions = useSelector(actionsStore, _temp);
|
|
@@ -120,9 +120,9 @@ const KeyDownForwarder = () => {
|
|
|
120
120
|
};
|
|
121
121
|
const PreviewPanel = (t0) => {
|
|
122
122
|
const $ = c(14);
|
|
123
|
-
if ($[0] !== "
|
|
123
|
+
if ($[0] !== "a461a48603db73fa17ba8571e013d5de18c35d1f481b8ee66c35e485f2bdef70") {
|
|
124
124
|
for (let $i = 0; $i < 14; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
|
|
125
|
-
$[0] = "
|
|
125
|
+
$[0] = "a461a48603db73fa17ba8571e013d5de18c35d1f481b8ee66c35e485f2bdef70";
|
|
126
126
|
}
|
|
127
127
|
const { children } = t0;
|
|
128
128
|
useBlockActionsShortcuts();
|
|
@@ -280,6 +280,12 @@ function _temp14() {
|
|
|
280
280
|
{
|
|
281
281
|
id: "toggle-editing-panel",
|
|
282
282
|
label: "Toggle editing panel",
|
|
283
|
+
aliases: [
|
|
284
|
+
"Sidebar",
|
|
285
|
+
"Toggle sidebar",
|
|
286
|
+
"Show sidebar",
|
|
287
|
+
"Hide sidebar"
|
|
288
|
+
],
|
|
283
289
|
groupLabel: "Preview",
|
|
284
290
|
checkIfAvailable: _temp5,
|
|
285
291
|
execute: _temp6,
|
|
@@ -291,6 +297,11 @@ function _temp14() {
|
|
|
291
297
|
{
|
|
292
298
|
id: "toggle-lock-content",
|
|
293
299
|
label: "Toggle lock content",
|
|
300
|
+
aliases: [
|
|
301
|
+
"Lock editing",
|
|
302
|
+
"Unlock content",
|
|
303
|
+
"Lock page"
|
|
304
|
+
],
|
|
294
305
|
groupLabel: "Preview",
|
|
295
306
|
checkIfAvailable: _temp7,
|
|
296
307
|
execute: _temp8
|
|
@@ -298,6 +309,11 @@ function _temp14() {
|
|
|
298
309
|
{
|
|
299
310
|
id: "toggle-mobile-mode",
|
|
300
311
|
label: "Toggle mobile mode",
|
|
312
|
+
aliases: [
|
|
313
|
+
"Mobile preview",
|
|
314
|
+
"Responsive preview",
|
|
315
|
+
"Phone preview"
|
|
316
|
+
],
|
|
301
317
|
groupLabel: "Preview",
|
|
302
318
|
checkIfAvailable: _temp9,
|
|
303
319
|
execute: _temp0,
|
|
@@ -306,6 +322,12 @@ function _temp14() {
|
|
|
306
322
|
{
|
|
307
323
|
id: "toggle-agent-chat",
|
|
308
324
|
label: "Toggle agent chat",
|
|
325
|
+
aliases: [
|
|
326
|
+
"AI chat",
|
|
327
|
+
"Assistant",
|
|
328
|
+
"Ask AI",
|
|
329
|
+
"Open chat"
|
|
330
|
+
],
|
|
309
331
|
groupLabel: "Preview",
|
|
310
332
|
checkIfAvailable: _temp1,
|
|
311
333
|
execute: _temp10,
|
|
@@ -317,6 +339,7 @@ function _temp14() {
|
|
|
317
339
|
{
|
|
318
340
|
id: "clear-selection",
|
|
319
341
|
label: "Clear selection",
|
|
342
|
+
aliases: ["Deselect", "Unselect"],
|
|
320
343
|
groupLabel: "Preview",
|
|
321
344
|
checkIfAvailable: _temp11,
|
|
322
345
|
execute: _temp12,
|
|
@@ -7,51 +7,55 @@ import { jsx } from "react/jsx-runtime";
|
|
|
7
7
|
|
|
8
8
|
//#region src/features/preview/components/PreviewSideSheet.tsx
|
|
9
9
|
const PreviewSideSheet = (t0) => {
|
|
10
|
-
const $ = c(
|
|
11
|
-
if ($[0] !== "
|
|
12
|
-
for (let $i = 0; $i <
|
|
13
|
-
$[0] = "
|
|
10
|
+
const $ = c(12);
|
|
11
|
+
if ($[0] !== "35b29fa3a8db99001095e915d7f303b2951fe53b35120b98796276d54347b926") {
|
|
12
|
+
for (let $i = 0; $i < 12; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
|
|
13
|
+
$[0] = "35b29fa3a8db99001095e915d7f303b2951fe53b35120b98796276d54347b926";
|
|
14
14
|
}
|
|
15
|
-
const { open, onOpenChange, initialFocus, children, className } = t0;
|
|
15
|
+
const { open, onOpenChange, initialFocus, children, className, keepMounted, showCloseButton } = t0;
|
|
16
16
|
let t1;
|
|
17
17
|
if ($[1] === Symbol.for("react.memo_cache_sentinel")) {
|
|
18
18
|
t1 = { minWidth: 400 };
|
|
19
19
|
$[1] = t1;
|
|
20
20
|
} else t1 = $[1];
|
|
21
21
|
let t2;
|
|
22
|
-
if ($[2] !== children || $[3] !== className || $[4] !== initialFocus) {
|
|
22
|
+
if ($[2] !== children || $[3] !== className || $[4] !== initialFocus || $[5] !== keepMounted || $[6] !== showCloseButton) {
|
|
23
23
|
t2 = /* @__PURE__ */ jsx(Sheet.SheetContent, {
|
|
24
24
|
className,
|
|
25
25
|
side: "left",
|
|
26
26
|
showOverlay: false,
|
|
27
27
|
style: t1,
|
|
28
28
|
initialFocus,
|
|
29
|
+
keepMounted,
|
|
30
|
+
showCloseButton,
|
|
29
31
|
children
|
|
30
32
|
});
|
|
31
33
|
$[2] = children;
|
|
32
34
|
$[3] = className;
|
|
33
35
|
$[4] = initialFocus;
|
|
34
|
-
$[5] =
|
|
35
|
-
|
|
36
|
+
$[5] = keepMounted;
|
|
37
|
+
$[6] = showCloseButton;
|
|
38
|
+
$[7] = t2;
|
|
39
|
+
} else t2 = $[7];
|
|
36
40
|
let t3;
|
|
37
|
-
if ($[
|
|
41
|
+
if ($[8] !== onOpenChange || $[9] !== open || $[10] !== t2) {
|
|
38
42
|
t3 = /* @__PURE__ */ jsx(Sheet.Sheet, {
|
|
39
43
|
open,
|
|
40
44
|
onOpenChange,
|
|
41
45
|
children: t2
|
|
42
46
|
});
|
|
43
|
-
$[
|
|
44
|
-
$[
|
|
45
|
-
$[
|
|
46
|
-
$[
|
|
47
|
-
} else t3 = $[
|
|
47
|
+
$[8] = onOpenChange;
|
|
48
|
+
$[9] = open;
|
|
49
|
+
$[10] = t2;
|
|
50
|
+
$[11] = t3;
|
|
51
|
+
} else t3 = $[11];
|
|
48
52
|
return t3;
|
|
49
53
|
};
|
|
50
54
|
function useIsPreviewSheetOpen() {
|
|
51
55
|
const $ = c(1);
|
|
52
|
-
if ($[0] !== "
|
|
56
|
+
if ($[0] !== "35b29fa3a8db99001095e915d7f303b2951fe53b35120b98796276d54347b926") {
|
|
53
57
|
for (let $i = 0; $i < 1; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
|
|
54
|
-
$[0] = "
|
|
58
|
+
$[0] = "35b29fa3a8db99001095e915d7f303b2951fe53b35120b98796276d54347b926";
|
|
55
59
|
}
|
|
56
60
|
const isPageContentSheetOpen = useSelector(previewStore, _temp);
|
|
57
61
|
const isPeekingBlock = useSelector(previewStore, _temp2);
|