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
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
import { c } from "react/compiler-runtime";
|
|
2
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { Button } from "@camox/ui/button";
|
|
4
|
+
import { Check, CircleHelp, Loader2, Wrench, XCircle } from "lucide-react";
|
|
5
|
+
|
|
6
|
+
//#region src/features/agent-chat/components/AgentToolCallCard.tsx
|
|
7
|
+
function getStatus(part, requiresApprovalFallback, result) {
|
|
8
|
+
if (part.approval?.approved === false) return "denied";
|
|
9
|
+
if (result?.state === "error") return "error";
|
|
10
|
+
if (result?.state === "complete") return "complete";
|
|
11
|
+
if (part.output !== void 0) return "complete";
|
|
12
|
+
if (part.approval?.needsApproval && part.approval.approved === void 0) return "approval";
|
|
13
|
+
if (requiresApprovalFallback && part.state === "input-complete") return "approval";
|
|
14
|
+
if (part.state === "complete") return "complete";
|
|
15
|
+
if (part.state === "approval-responded") return "complete";
|
|
16
|
+
return "running";
|
|
17
|
+
}
|
|
18
|
+
const AgentToolCallCard = (t0) => {
|
|
19
|
+
const $ = c(30);
|
|
20
|
+
if ($[0] !== "0558c22212ea82c1e7d2ad4ce6a5749c7979e2e1f04725121be94540507bca0e") {
|
|
21
|
+
for (let $i = 0; $i < 30; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
|
|
22
|
+
$[0] = "0558c22212ea82c1e7d2ad4ce6a5749c7979e2e1f04725121be94540507bca0e";
|
|
23
|
+
}
|
|
24
|
+
const { part, label, result, requiresApprovalFallback, onApprovalResponse } = t0;
|
|
25
|
+
const t1 = requiresApprovalFallback ?? false;
|
|
26
|
+
let t2;
|
|
27
|
+
if ($[1] !== part || $[2] !== result || $[3] !== t1) {
|
|
28
|
+
t2 = getStatus(part, t1, result);
|
|
29
|
+
$[1] = part;
|
|
30
|
+
$[2] = result;
|
|
31
|
+
$[3] = t1;
|
|
32
|
+
$[4] = t2;
|
|
33
|
+
} else t2 = $[4];
|
|
34
|
+
const status = t2;
|
|
35
|
+
const needsApproval = status === "approval";
|
|
36
|
+
let t3;
|
|
37
|
+
if ($[5] !== status) {
|
|
38
|
+
t3 = status === "running" && /* @__PURE__ */ jsx(Loader2, { className: "size-3 animate-spin justify-self-center" });
|
|
39
|
+
$[5] = status;
|
|
40
|
+
$[6] = t3;
|
|
41
|
+
} else t3 = $[6];
|
|
42
|
+
let t4;
|
|
43
|
+
if ($[7] !== status) {
|
|
44
|
+
t4 = status === "complete" && /* @__PURE__ */ jsx(Wrench, { className: "size-3 justify-self-center" });
|
|
45
|
+
$[7] = status;
|
|
46
|
+
$[8] = t4;
|
|
47
|
+
} else t4 = $[8];
|
|
48
|
+
let t5;
|
|
49
|
+
if ($[9] !== status) {
|
|
50
|
+
t5 = status === "approval" && /* @__PURE__ */ jsx(CircleHelp, { className: "size-3 justify-self-center" });
|
|
51
|
+
$[9] = status;
|
|
52
|
+
$[10] = t5;
|
|
53
|
+
} else t5 = $[10];
|
|
54
|
+
let t6;
|
|
55
|
+
if ($[11] !== status) {
|
|
56
|
+
t6 = status === "denied" && /* @__PURE__ */ jsx(XCircle, { className: "size-3 justify-self-center" });
|
|
57
|
+
$[11] = status;
|
|
58
|
+
$[12] = t6;
|
|
59
|
+
} else t6 = $[12];
|
|
60
|
+
let t7;
|
|
61
|
+
if ($[13] !== status) {
|
|
62
|
+
t7 = status === "error" && /* @__PURE__ */ jsx(XCircle, { className: "size-3 justify-self-center" });
|
|
63
|
+
$[13] = status;
|
|
64
|
+
$[14] = t7;
|
|
65
|
+
} else t7 = $[14];
|
|
66
|
+
let t8;
|
|
67
|
+
if ($[15] !== label) {
|
|
68
|
+
t8 = /* @__PURE__ */ jsx("span", {
|
|
69
|
+
className: "text-sm",
|
|
70
|
+
children: label
|
|
71
|
+
});
|
|
72
|
+
$[15] = label;
|
|
73
|
+
$[16] = t8;
|
|
74
|
+
} else t8 = $[16];
|
|
75
|
+
let t9;
|
|
76
|
+
if ($[17] !== t3 || $[18] !== t4 || $[19] !== t5 || $[20] !== t6 || $[21] !== t7 || $[22] !== t8) {
|
|
77
|
+
t9 = /* @__PURE__ */ jsxs("span", {
|
|
78
|
+
className: "text-muted-foreground grid grid-cols-[1rem_minmax(0,1fr)] items-center gap-2",
|
|
79
|
+
children: [
|
|
80
|
+
t3,
|
|
81
|
+
t4,
|
|
82
|
+
t5,
|
|
83
|
+
t6,
|
|
84
|
+
t7,
|
|
85
|
+
t8
|
|
86
|
+
]
|
|
87
|
+
});
|
|
88
|
+
$[17] = t3;
|
|
89
|
+
$[18] = t4;
|
|
90
|
+
$[19] = t5;
|
|
91
|
+
$[20] = t6;
|
|
92
|
+
$[21] = t7;
|
|
93
|
+
$[22] = t8;
|
|
94
|
+
$[23] = t9;
|
|
95
|
+
} else t9 = $[23];
|
|
96
|
+
let t10;
|
|
97
|
+
if ($[24] !== needsApproval || $[25] !== onApprovalResponse) {
|
|
98
|
+
t10 = needsApproval && /* @__PURE__ */ jsxs("div", {
|
|
99
|
+
className: "space-y-2 pl-6",
|
|
100
|
+
children: [/* @__PURE__ */ jsx("p", {
|
|
101
|
+
className: "text-sm",
|
|
102
|
+
children: "This immediately impacts your live website"
|
|
103
|
+
}), /* @__PURE__ */ jsxs("span", {
|
|
104
|
+
className: "flex items-center gap-1",
|
|
105
|
+
children: [/* @__PURE__ */ jsxs(Button, {
|
|
106
|
+
type: "button",
|
|
107
|
+
size: "sm",
|
|
108
|
+
variant: "secondary",
|
|
109
|
+
onClick: () => onApprovalResponse?.(true),
|
|
110
|
+
children: [/* @__PURE__ */ jsx(Check, {
|
|
111
|
+
"data-icon": "inline-start",
|
|
112
|
+
className: "text-muted-foreground"
|
|
113
|
+
}), "Approve"]
|
|
114
|
+
}), /* @__PURE__ */ jsx(Button, {
|
|
115
|
+
type: "button",
|
|
116
|
+
size: "sm",
|
|
117
|
+
variant: "ghost",
|
|
118
|
+
onClick: () => onApprovalResponse?.(false),
|
|
119
|
+
children: "Deny"
|
|
120
|
+
})]
|
|
121
|
+
})]
|
|
122
|
+
});
|
|
123
|
+
$[24] = needsApproval;
|
|
124
|
+
$[25] = onApprovalResponse;
|
|
125
|
+
$[26] = t10;
|
|
126
|
+
} else t10 = $[26];
|
|
127
|
+
let t11;
|
|
128
|
+
if ($[27] !== t10 || $[28] !== t9) {
|
|
129
|
+
t11 = /* @__PURE__ */ jsxs("div", {
|
|
130
|
+
className: "flex flex-col gap-3",
|
|
131
|
+
children: [t9, t10]
|
|
132
|
+
});
|
|
133
|
+
$[27] = t10;
|
|
134
|
+
$[28] = t9;
|
|
135
|
+
$[29] = t11;
|
|
136
|
+
} else t11 = $[29];
|
|
137
|
+
return t11;
|
|
138
|
+
};
|
|
139
|
+
|
|
140
|
+
//#endregion
|
|
141
|
+
export { AgentToolCallCard };
|
|
@@ -7,10 +7,10 @@ import { blockQueries, pageMutations, pageQueries, projectQueries } from "../../
|
|
|
7
7
|
import { cn } from "../../lib/utils.js";
|
|
8
8
|
import { NormalizedDataProvider, seedBlockCaches, usePageBlocks } from "../../lib/normalized-data.js";
|
|
9
9
|
import { BlockErrorBoundary } from "./components/BlockErrorBoundary.js";
|
|
10
|
+
import { AgentChatSheet } from "../agent-chat/components/AgentChatSheet.js";
|
|
10
11
|
import { useCamoxApp } from "../provider/components/CamoxAppContext.js";
|
|
11
12
|
import { Navbar } from "../studio/components/Navbar.js";
|
|
12
13
|
import { AddBlockSheet } from "./components/AddBlockSheet.js";
|
|
13
|
-
import { AgentChatSheet } from "./components/AgentChatSheet.js";
|
|
14
14
|
import { CreatePageModal } from "./components/CreatePageModal.js";
|
|
15
15
|
import { DraftSwitchDialog } from "./components/DraftSwitchDialog.js";
|
|
16
16
|
import { PageContentSheet } from "./components/PageContentSheet.js";
|
|
@@ -86,9 +86,9 @@ function pageFullQueryFn(queryClient, path, projectSlug, source) {
|
|
|
86
86
|
}
|
|
87
87
|
function usePreviewedPage() {
|
|
88
88
|
const $ = c(26);
|
|
89
|
-
if ($[0] !== "
|
|
89
|
+
if ($[0] !== "1f8b3d930e363e9f026de778e54437825e294d4a0094b6a999e795efbcd37f98") {
|
|
90
90
|
for (let $i = 0; $i < 26; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
|
|
91
|
-
$[0] = "
|
|
91
|
+
$[0] = "1f8b3d930e363e9f026de778e54437825e294d4a0094b6a999e795efbcd37f98";
|
|
92
92
|
}
|
|
93
93
|
const { pathname } = useLocation();
|
|
94
94
|
const queryClient = useQueryClient();
|
|
@@ -185,9 +185,9 @@ function _temp(state) {
|
|
|
185
185
|
}
|
|
186
186
|
const BlockRenderer = (t0) => {
|
|
187
187
|
const $ = c(23);
|
|
188
|
-
if ($[0] !== "
|
|
188
|
+
if ($[0] !== "1f8b3d930e363e9f026de778e54437825e294d4a0094b6a999e795efbcd37f98") {
|
|
189
189
|
for (let $i = 0; $i < 23; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
|
|
190
|
-
$[0] = "
|
|
190
|
+
$[0] = "1f8b3d930e363e9f026de778e54437825e294d4a0094b6a999e795efbcd37f98";
|
|
191
191
|
}
|
|
192
192
|
const { blockId, mode, showAddBlockTop, showAddBlockBottom } = t0;
|
|
193
193
|
const previewSource = useSelector(previewStore, _temp3);
|
|
@@ -330,9 +330,9 @@ const PageContent = () => {
|
|
|
330
330
|
};
|
|
331
331
|
const SidebarPublishRow = (t0) => {
|
|
332
332
|
const $ = c(102);
|
|
333
|
-
if ($[0] !== "
|
|
333
|
+
if ($[0] !== "1f8b3d930e363e9f026de778e54437825e294d4a0094b6a999e795efbcd37f98") {
|
|
334
334
|
for (let $i = 0; $i < 102; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
|
|
335
|
-
$[0] = "
|
|
335
|
+
$[0] = "1f8b3d930e363e9f026de778e54437825e294d4a0094b6a999e795efbcd37f98";
|
|
336
336
|
}
|
|
337
337
|
const { page } = t0;
|
|
338
338
|
const previewSource = useSelector(previewStore, _temp4);
|
|
@@ -397,6 +397,11 @@ const SidebarPublishRow = (t0) => {
|
|
|
397
397
|
{
|
|
398
398
|
id: "publish-current-page",
|
|
399
399
|
label: publishLabel,
|
|
400
|
+
aliases: [
|
|
401
|
+
"Publish",
|
|
402
|
+
"Publish page",
|
|
403
|
+
"Make live"
|
|
404
|
+
],
|
|
400
405
|
groupLabel: "Preview",
|
|
401
406
|
checkIfAvailable: () => canPublish,
|
|
402
407
|
execute: () => setIsPublishDialogOpen(true)
|
|
@@ -404,6 +409,11 @@ const SidebarPublishRow = (t0) => {
|
|
|
404
409
|
{
|
|
405
410
|
id: "unpublish-current-page",
|
|
406
411
|
label: "Unpublish page",
|
|
412
|
+
aliases: [
|
|
413
|
+
"Take offline",
|
|
414
|
+
"Remove from live",
|
|
415
|
+
"Hide page"
|
|
416
|
+
],
|
|
407
417
|
groupLabel: "Preview",
|
|
408
418
|
checkIfAvailable: () => hasLiveCheckpoint && !isHomePage && !unpublishPage.isPending,
|
|
409
419
|
execute: () => setIsUnpublishDialogOpen(true)
|
|
@@ -411,6 +421,11 @@ const SidebarPublishRow = (t0) => {
|
|
|
411
421
|
{
|
|
412
422
|
id: "discard-current-page-changes",
|
|
413
423
|
label: "Discard page changes",
|
|
424
|
+
aliases: [
|
|
425
|
+
"Revert page",
|
|
426
|
+
"Reset page",
|
|
427
|
+
"Discard draft"
|
|
428
|
+
],
|
|
414
429
|
groupLabel: "Preview",
|
|
415
430
|
checkIfAvailable: () => canDiscardChanges && !discardChanges.isPending,
|
|
416
431
|
execute: () => setIsDiscardDialogOpen(true)
|
|
@@ -808,9 +823,9 @@ const SidebarPublishRow = (t0) => {
|
|
|
808
823
|
};
|
|
809
824
|
function useHydrateDraftCache() {
|
|
810
825
|
const $ = c(7);
|
|
811
|
-
if ($[0] !== "
|
|
826
|
+
if ($[0] !== "1f8b3d930e363e9f026de778e54437825e294d4a0094b6a999e795efbcd37f98") {
|
|
812
827
|
for (let $i = 0; $i < 7; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
|
|
813
|
-
$[0] = "
|
|
828
|
+
$[0] = "1f8b3d930e363e9f026de778e54437825e294d4a0094b6a999e795efbcd37f98";
|
|
814
829
|
}
|
|
815
830
|
const isAuthenticated = useIsAuthenticated();
|
|
816
831
|
const queryClient = useQueryClient();
|
|
@@ -861,9 +876,9 @@ function useHydrateDraftCache() {
|
|
|
861
876
|
function _temp8() {}
|
|
862
877
|
const CamoxPreview = (t0) => {
|
|
863
878
|
const $ = c(32);
|
|
864
|
-
if ($[0] !== "
|
|
879
|
+
if ($[0] !== "1f8b3d930e363e9f026de778e54437825e294d4a0094b6a999e795efbcd37f98") {
|
|
865
880
|
for (let $i = 0; $i < 32; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
|
|
866
|
-
$[0] = "
|
|
881
|
+
$[0] = "1f8b3d930e363e9f026de778e54437825e294d4a0094b6a999e795efbcd37f98";
|
|
867
882
|
}
|
|
868
883
|
const { children } = t0;
|
|
869
884
|
const isAuthenticated = useIsAuthenticated();
|
|
@@ -881,6 +896,11 @@ const CamoxPreview = (t0) => {
|
|
|
881
896
|
{
|
|
882
897
|
id: "enter-presentation-mode",
|
|
883
898
|
label: "Hide Camox Studio",
|
|
899
|
+
aliases: [
|
|
900
|
+
"Hide studio",
|
|
901
|
+
"Preview only",
|
|
902
|
+
"Presentation mode"
|
|
903
|
+
],
|
|
884
904
|
groupLabel: "Preview",
|
|
885
905
|
checkIfAvailable: () => isAuthenticated && !isPresentationMode,
|
|
886
906
|
execute: _temp10,
|
|
@@ -892,6 +912,11 @@ const CamoxPreview = (t0) => {
|
|
|
892
912
|
{
|
|
893
913
|
id: "exit-presentation-mode",
|
|
894
914
|
label: "Show Camox Studio",
|
|
915
|
+
aliases: [
|
|
916
|
+
"Show studio",
|
|
917
|
+
"Exit presentation",
|
|
918
|
+
"Edit mode"
|
|
919
|
+
],
|
|
895
920
|
groupLabel: "Preview",
|
|
896
921
|
checkIfAvailable: () => isAuthenticated && isPresentationMode,
|
|
897
922
|
execute: _temp11,
|
|
@@ -903,6 +928,11 @@ const CamoxPreview = (t0) => {
|
|
|
903
928
|
{
|
|
904
929
|
id: "preview-live-content",
|
|
905
930
|
label: "Preview live content",
|
|
931
|
+
aliases: [
|
|
932
|
+
"Live",
|
|
933
|
+
"View live",
|
|
934
|
+
"Published content"
|
|
935
|
+
],
|
|
906
936
|
groupLabel: "Preview",
|
|
907
937
|
checkIfAvailable: () => isAuthenticated && previewSource === "draft" && hasLiveCheckpoint,
|
|
908
938
|
execute: _temp12,
|
|
@@ -914,6 +944,11 @@ const CamoxPreview = (t0) => {
|
|
|
914
944
|
{
|
|
915
945
|
id: "preview-draft-content",
|
|
916
946
|
label: "Preview draft content",
|
|
947
|
+
aliases: [
|
|
948
|
+
"Draft",
|
|
949
|
+
"View draft",
|
|
950
|
+
"Unpublished content"
|
|
951
|
+
],
|
|
917
952
|
groupLabel: "Preview",
|
|
918
953
|
checkIfAvailable: () => isAuthenticated && previewSource === "live",
|
|
919
954
|
execute: _temp13,
|
|
@@ -925,6 +960,7 @@ const CamoxPreview = (t0) => {
|
|
|
925
960
|
{
|
|
926
961
|
id: "clear-selection",
|
|
927
962
|
label: "Clear selection",
|
|
963
|
+
aliases: ["Deselect", "Unselect"],
|
|
928
964
|
groupLabel: "Preview",
|
|
929
965
|
checkIfAvailable: _temp14,
|
|
930
966
|
execute: _temp15,
|
|
@@ -1091,9 +1127,9 @@ const CamoxPreview = (t0) => {
|
|
|
1091
1127
|
};
|
|
1092
1128
|
function usePreviewPagesActions() {
|
|
1093
1129
|
const $ = c(13);
|
|
1094
|
-
if ($[0] !== "
|
|
1130
|
+
if ($[0] !== "1f8b3d930e363e9f026de778e54437825e294d4a0094b6a999e795efbcd37f98") {
|
|
1095
1131
|
for (let $i = 0; $i < 13; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
|
|
1096
|
-
$[0] = "
|
|
1132
|
+
$[0] = "1f8b3d930e363e9f026de778e54437825e294d4a0094b6a999e795efbcd37f98";
|
|
1097
1133
|
}
|
|
1098
1134
|
const navigate = useNavigate();
|
|
1099
1135
|
const { pathname } = useLocation();
|
|
@@ -1132,6 +1168,7 @@ function usePreviewPagesActions() {
|
|
|
1132
1168
|
{
|
|
1133
1169
|
id: "create-page",
|
|
1134
1170
|
label: "Create page",
|
|
1171
|
+
aliases: ["New page", "Add page"],
|
|
1135
1172
|
groupLabel: "Preview",
|
|
1136
1173
|
checkIfAvailable: _temp17,
|
|
1137
1174
|
execute: _temp18
|
|
@@ -1139,6 +1176,11 @@ function usePreviewPagesActions() {
|
|
|
1139
1176
|
{
|
|
1140
1177
|
id: "edit-current-page",
|
|
1141
1178
|
label: "Edit current page",
|
|
1179
|
+
aliases: [
|
|
1180
|
+
"Page settings",
|
|
1181
|
+
"Edit page settings",
|
|
1182
|
+
"Page metadata"
|
|
1183
|
+
],
|
|
1142
1184
|
groupLabel: "Preview",
|
|
1143
1185
|
checkIfAvailable: () => !!currentPage,
|
|
1144
1186
|
execute: () => {
|
|
@@ -1152,6 +1194,11 @@ function usePreviewPagesActions() {
|
|
|
1152
1194
|
{
|
|
1153
1195
|
id: "go-to-page",
|
|
1154
1196
|
label: "Go to page",
|
|
1197
|
+
aliases: [
|
|
1198
|
+
"Open page",
|
|
1199
|
+
"Navigate page",
|
|
1200
|
+
"Switch page"
|
|
1201
|
+
],
|
|
1155
1202
|
groupLabel: "Preview",
|
|
1156
1203
|
checkIfAvailable: () => !!pages,
|
|
1157
1204
|
hasChildren: true,
|