camox 0.6.1 → 0.7.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/components/AddBlockControlBar.d.ts.map +1 -1
- package/dist/core/components/AddBlockControlBar.js +51 -117
- package/dist/core/components/lexical/InlineLexicalEditor.js +1 -1
- package/dist/core/components/lexical/SidebarLexicalEditor.js +1 -1
- package/dist/core/createApp.d.ts +314 -44
- package/dist/core/createApp.d.ts.map +1 -1
- package/dist/core/createBlock.d.ts +160 -22
- package/dist/core/createBlock.d.ts.map +1 -1
- package/dist/core/createBlock.js +467 -579
- package/dist/features/content/components/AssetCard.js +1 -1
- package/dist/features/preview/CamoxPreview.d.ts.map +1 -1
- package/dist/features/preview/CamoxPreview.js +12 -16
- package/dist/features/preview/components/AddBlockSheet.d.ts.map +1 -1
- package/dist/features/preview/components/AddBlockSheet.js +1 -2
- package/dist/features/preview/components/AssetLightbox.d.ts.map +1 -1
- package/dist/features/preview/components/AssetLightbox.js +13 -15
- package/dist/features/preview/components/BlockActionsPopover.d.ts.map +1 -1
- package/dist/features/preview/components/BlockActionsPopover.js +19 -22
- package/dist/features/preview/components/CreatePageSheet.d.ts.map +1 -1
- package/dist/features/preview/components/CreatePageSheet.js +10 -4
- package/dist/features/preview/components/EditPageSheet.d.ts +1 -1
- package/dist/features/preview/components/EditPageSheet.d.ts.map +1 -1
- package/dist/features/preview/components/EditPageSheet.js +20 -17
- package/dist/features/preview/components/FieldOverlayStyles.d.ts +2 -0
- package/dist/features/preview/components/FieldOverlayStyles.d.ts.map +1 -0
- package/dist/features/preview/components/FieldOverlayStyles.js +15 -0
- package/dist/features/preview/components/Frame.d.ts +20 -0
- package/dist/features/preview/components/Frame.d.ts.map +1 -0
- package/dist/features/preview/components/Frame.js +162 -0
- package/dist/features/preview/components/LinkFieldEditor.d.ts.map +1 -1
- package/dist/features/preview/components/LinkFieldEditor.js +11 -12
- package/dist/features/preview/components/OverlayTracker.js +1 -1
- package/dist/features/preview/components/PageContentSheet.d.ts.map +1 -1
- package/dist/features/preview/components/PageContentSheet.js +3 -3
- package/dist/features/preview/components/PageLocationFieldset.d.ts.map +1 -1
- package/dist/features/preview/components/PageLocationFieldset.js +9 -11
- package/dist/features/preview/components/PagePicker.d.ts.map +1 -1
- package/dist/features/preview/components/PagePicker.js +15 -15
- package/dist/features/preview/components/PageTree.d.ts.map +1 -1
- package/dist/features/preview/components/PageTree.js +215 -203
- package/dist/features/preview/components/PreviewPanel.d.ts.map +1 -1
- package/dist/features/preview/components/PreviewPanel.js +21 -15
- package/dist/features/preview/components/PreviewSideSheet.d.ts.map +1 -1
- package/dist/features/preview/components/PreviewSideSheet.js +42 -26
- package/dist/features/preview/components/PreviewToolbar.d.ts.map +1 -1
- package/dist/features/preview/components/PreviewToolbar.js +191 -171
- package/dist/features/preview/components/RepeatableItemsList.d.ts.map +1 -1
- package/dist/features/preview/components/RepeatableItemsList.js +4 -5
- package/dist/features/preview/components/TextFormatToolbar.d.ts.map +1 -1
- package/dist/features/preview/components/TextFormatToolbar.js +5 -6
- package/dist/features/preview/components/UnlinkAssetButton.d.ts.map +1 -1
- package/dist/features/preview/components/UnlinkAssetButton.js +70 -91
- package/dist/features/preview/studio-overlays.css?inline.js +4 -0
- package/dist/features/provider/components/CamoxAppContext.d.ts +314 -44
- package/dist/features/provider/components/CamoxAppContext.d.ts.map +1 -1
- package/dist/features/provider/components/CommandPalette.d.ts.map +1 -1
- package/dist/features/provider/components/CommandPalette.js +22 -14
- package/dist/features/studio/CamoxStudio.d.ts +2 -3
- package/dist/features/studio/CamoxStudio.d.ts.map +1 -1
- package/dist/features/studio/components/EnvironmentMenu.d.ts.map +1 -1
- package/dist/features/studio/components/EnvironmentMenu.js +39 -35
- package/dist/features/studio/components/Navbar.js +2 -2
- package/dist/features/studio/components/ProjectMenu.d.ts.map +1 -1
- package/dist/features/studio/components/ProjectMenu.js +143 -129
- package/dist/features/studio/components/UserButton.d.ts.map +1 -1
- package/dist/features/studio/components/UserButton.js +8 -9
- package/dist/features/vite/vite.d.ts +2 -0
- package/dist/features/vite/vite.d.ts.map +1 -1
- package/dist/features/vite/vite.js +26 -30
- package/dist/lib/api-client.d.ts +17 -17
- package/dist/lib/queries.d.ts +7 -7
- package/dist/studio.css +1 -1
- package/package.json +5 -6
- package/skills/camox-block/SKILL.md +55 -28
- package/dist/features/preview/overlayConstants.d.ts +0 -19
- package/dist/features/preview/overlayConstants.d.ts.map +0 -1
- package/dist/features/preview/overlayConstants.js +0 -21
|
@@ -8,44 +8,48 @@ import { ChevronsUpDown } from "lucide-react";
|
|
|
8
8
|
import { Badge } from "@camox/ui/badge";
|
|
9
9
|
//#region src/features/studio/components/EnvironmentMenu.tsx
|
|
10
10
|
var EnvironmentMenu = () => {
|
|
11
|
-
const $ = c(
|
|
11
|
+
const $ = c(13);
|
|
12
12
|
const [open, setOpen] = React.useState(false);
|
|
13
13
|
const authCtx = React.useContext(AuthContext);
|
|
14
14
|
if (!authCtx?.environmentName) return null;
|
|
15
15
|
const isProduction = authCtx.environmentName === "production";
|
|
16
16
|
const badgeClassName = isProduction ? "bg-green-100 text-green-800 border border-green-300 hover:bg-green-100 dark:bg-green-900 dark:text-green-300 dark:border-green-700 dark:hover:bg-green-900 font-mono text-xs" : "bg-yellow-100 text-yellow-800 border border-yellow-300 hover:bg-yellow-100 dark:bg-yellow-900 dark:text-yellow-300 dark:border-yellow-700 dark:hover:bg-yellow-900 font-mono text-xs";
|
|
17
17
|
let t0;
|
|
18
|
-
if ($[0]
|
|
19
|
-
t0 = /* @__PURE__ */ jsx(
|
|
18
|
+
if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
|
|
19
|
+
t0 = /* @__PURE__ */ jsx(Button, {
|
|
20
|
+
variant: "ghost",
|
|
21
|
+
className: "gap-2"
|
|
22
|
+
});
|
|
23
|
+
$[0] = t0;
|
|
24
|
+
} else t0 = $[0];
|
|
25
|
+
let t1;
|
|
26
|
+
if ($[1] !== authCtx.environmentName || $[2] !== badgeClassName) {
|
|
27
|
+
t1 = /* @__PURE__ */ jsx(Badge, {
|
|
20
28
|
variant: "secondary",
|
|
21
29
|
className: badgeClassName,
|
|
22
30
|
children: authCtx.environmentName
|
|
23
31
|
});
|
|
24
|
-
$[
|
|
25
|
-
$[
|
|
26
|
-
$[2] = t0;
|
|
27
|
-
} else t0 = $[2];
|
|
28
|
-
let t1;
|
|
29
|
-
if ($[3] === Symbol.for("react.memo_cache_sentinel")) {
|
|
30
|
-
t1 = /* @__PURE__ */ jsx(ChevronsUpDown, { className: "shrink-0 opacity-50" });
|
|
32
|
+
$[1] = authCtx.environmentName;
|
|
33
|
+
$[2] = badgeClassName;
|
|
31
34
|
$[3] = t1;
|
|
32
35
|
} else t1 = $[3];
|
|
33
36
|
let t2;
|
|
34
|
-
if ($[4]
|
|
35
|
-
t2 = /* @__PURE__ */ jsx(
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
variant: "ghost",
|
|
39
|
-
className: "gap-2",
|
|
40
|
-
children: [t0, t1]
|
|
41
|
-
})
|
|
42
|
-
});
|
|
43
|
-
$[4] = t0;
|
|
44
|
-
$[5] = t2;
|
|
45
|
-
} else t2 = $[5];
|
|
37
|
+
if ($[4] === Symbol.for("react.memo_cache_sentinel")) {
|
|
38
|
+
t2 = /* @__PURE__ */ jsx(ChevronsUpDown, { className: "shrink-0 opacity-50" });
|
|
39
|
+
$[4] = t2;
|
|
40
|
+
} else t2 = $[4];
|
|
46
41
|
let t3;
|
|
47
|
-
if ($[
|
|
48
|
-
t3 = /* @__PURE__ */
|
|
42
|
+
if ($[5] !== t1) {
|
|
43
|
+
t3 = /* @__PURE__ */ jsxs(PopoverTrigger, {
|
|
44
|
+
render: t0,
|
|
45
|
+
children: [t1, t2]
|
|
46
|
+
});
|
|
47
|
+
$[5] = t1;
|
|
48
|
+
$[6] = t3;
|
|
49
|
+
} else t3 = $[6];
|
|
50
|
+
let t4;
|
|
51
|
+
if ($[7] !== isProduction) {
|
|
52
|
+
t4 = /* @__PURE__ */ jsx(PopoverContent, {
|
|
49
53
|
className: "w-96 p-4",
|
|
50
54
|
align: "start",
|
|
51
55
|
side: "bottom",
|
|
@@ -63,22 +67,22 @@ var EnvironmentMenu = () => {
|
|
|
63
67
|
})] })
|
|
64
68
|
})
|
|
65
69
|
});
|
|
66
|
-
$[
|
|
67
|
-
$[
|
|
68
|
-
} else
|
|
69
|
-
let
|
|
70
|
-
if ($[
|
|
71
|
-
|
|
70
|
+
$[7] = isProduction;
|
|
71
|
+
$[8] = t4;
|
|
72
|
+
} else t4 = $[8];
|
|
73
|
+
let t5;
|
|
74
|
+
if ($[9] !== open || $[10] !== t3 || $[11] !== t4) {
|
|
75
|
+
t5 = /* @__PURE__ */ jsxs(Popover, {
|
|
72
76
|
open,
|
|
73
77
|
onOpenChange: setOpen,
|
|
74
|
-
children: [
|
|
78
|
+
children: [t3, t4]
|
|
75
79
|
});
|
|
76
|
-
$[
|
|
77
|
-
$[9] = t2;
|
|
80
|
+
$[9] = open;
|
|
78
81
|
$[10] = t3;
|
|
79
82
|
$[11] = t4;
|
|
80
|
-
|
|
81
|
-
|
|
83
|
+
$[12] = t5;
|
|
84
|
+
} else t5 = $[12];
|
|
85
|
+
return t5;
|
|
82
86
|
};
|
|
83
87
|
//#endregion
|
|
84
88
|
export { EnvironmentMenu };
|
|
@@ -57,10 +57,10 @@ var Navbar = () => {
|
|
|
57
57
|
const { data: pages } = useQuery(t3);
|
|
58
58
|
const isMac = navigator.userAgent.toUpperCase().indexOf("MAC") >= 0;
|
|
59
59
|
const { pathname } = useLocation();
|
|
60
|
-
const t4 = useIsPreviewSheetOpen() ? "opacity-
|
|
60
|
+
const t4 = useIsPreviewSheetOpen() ? "opacity-100" : "opacity-0";
|
|
61
61
|
let t5;
|
|
62
62
|
if ($[7] !== t4) {
|
|
63
|
-
t5 = cn("absolute top-0 left-0 w-full h-[calc(100%+2px)] bg-black transition-opacity z-10 will-change-auto pointer-events-none", t4);
|
|
63
|
+
t5 = cn("absolute top-0 left-0 w-full h-[calc(100%+2px)] bg-black/10 transition-opacity z-10 will-change-auto pointer-events-none supports-backdrop-filter:backdrop-blur-xs", t4);
|
|
64
64
|
$[7] = t4;
|
|
65
65
|
$[8] = t5;
|
|
66
66
|
} else t5 = $[8];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ProjectMenu.d.ts","sourceRoot":"","sources":["../../../../src/features/studio/components/ProjectMenu.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ProjectMenu.d.ts","sourceRoot":"","sources":["../../../../src/features/studio/components/ProjectMenu.tsx"],"names":[],"mappings":"AAyEA,eAAO,MAAM,WAAW,+CAqFvB,CAAC"}
|
|
@@ -7,7 +7,7 @@ import { jsx, jsxs } from "react/jsx-runtime";
|
|
|
7
7
|
import { Button } from "@camox/ui/button";
|
|
8
8
|
import { Link } from "@tanstack/react-router";
|
|
9
9
|
import { ChevronDown, Globe, Info, Settings, Users } from "lucide-react";
|
|
10
|
-
import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuLabel, DropdownMenuSeparator, DropdownMenuTrigger } from "@camox/ui/dropdown-menu";
|
|
10
|
+
import { DropdownMenu, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuSeparator, DropdownMenuTrigger } from "@camox/ui/dropdown-menu";
|
|
11
11
|
import { Skeleton } from "@camox/ui/skeleton";
|
|
12
12
|
//#region src/features/studio/components/ProjectMenu.tsx
|
|
13
13
|
var Favicon = (t0) => {
|
|
@@ -107,7 +107,7 @@ var Favicon = (t0) => {
|
|
|
107
107
|
return t7;
|
|
108
108
|
};
|
|
109
109
|
var ProjectMenu = () => {
|
|
110
|
-
const $ = c(
|
|
110
|
+
const $ = c(40);
|
|
111
111
|
const authCtx = React.useContext(AuthContext);
|
|
112
112
|
let t0;
|
|
113
113
|
if ($[0] !== authCtx.projectSlug) {
|
|
@@ -129,169 +129,183 @@ var ProjectMenu = () => {
|
|
|
129
129
|
}
|
|
130
130
|
let t1;
|
|
131
131
|
if ($[3] === Symbol.for("react.memo_cache_sentinel")) {
|
|
132
|
-
t1 = /* @__PURE__ */ jsx(
|
|
132
|
+
t1 = /* @__PURE__ */ jsx(Button, { variant: "ghost" });
|
|
133
133
|
$[3] = t1;
|
|
134
134
|
} else t1 = $[3];
|
|
135
135
|
let t2;
|
|
136
|
-
if ($[4]
|
|
137
|
-
t2 = /* @__PURE__ */
|
|
136
|
+
if ($[4] === Symbol.for("react.memo_cache_sentinel")) {
|
|
137
|
+
t2 = /* @__PURE__ */ jsx(Favicon, { size: 16 });
|
|
138
|
+
$[4] = t2;
|
|
139
|
+
} else t2 = $[4];
|
|
140
|
+
let t3;
|
|
141
|
+
if ($[5] !== project.name) {
|
|
142
|
+
t3 = /* @__PURE__ */ jsxs("div", {
|
|
138
143
|
className: "flex items-center gap-2",
|
|
139
|
-
children: [
|
|
144
|
+
children: [t2, /* @__PURE__ */ jsx("span", {
|
|
140
145
|
className: "select-none",
|
|
141
146
|
children: project.name
|
|
142
147
|
})]
|
|
143
148
|
});
|
|
144
|
-
$[
|
|
145
|
-
$[5] = t2;
|
|
146
|
-
} else t2 = $[5];
|
|
147
|
-
let t3;
|
|
148
|
-
if ($[6] === Symbol.for("react.memo_cache_sentinel")) {
|
|
149
|
-
t3 = /* @__PURE__ */ jsx(ChevronDown, { className: "shrink-0 opacity-50" });
|
|
149
|
+
$[5] = project.name;
|
|
150
150
|
$[6] = t3;
|
|
151
151
|
} else t3 = $[6];
|
|
152
152
|
let t4;
|
|
153
|
-
if ($[7]
|
|
154
|
-
t4 = /* @__PURE__ */ jsx(
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
variant: "ghost",
|
|
158
|
-
children: [t2, t3]
|
|
159
|
-
})
|
|
160
|
-
});
|
|
161
|
-
$[7] = t2;
|
|
162
|
-
$[8] = t4;
|
|
163
|
-
} else t4 = $[8];
|
|
153
|
+
if ($[7] === Symbol.for("react.memo_cache_sentinel")) {
|
|
154
|
+
t4 = /* @__PURE__ */ jsx(ChevronDown, { className: "shrink-0 opacity-50" });
|
|
155
|
+
$[7] = t4;
|
|
156
|
+
} else t4 = $[7];
|
|
164
157
|
let t5;
|
|
165
|
-
if ($[
|
|
166
|
-
t5 = (
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
$[
|
|
171
|
-
$[
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
let t6;
|
|
175
|
-
if ($[13] === Symbol.for("react.memo_cache_sentinel")) {
|
|
176
|
-
t6 = /* @__PURE__ */ jsx(Settings, {});
|
|
177
|
-
$[13] = t6;
|
|
178
|
-
} else t6 = $[13];
|
|
158
|
+
if ($[8] !== t3) {
|
|
159
|
+
t5 = /* @__PURE__ */ jsxs(DropdownMenuTrigger, {
|
|
160
|
+
render: t1,
|
|
161
|
+
children: [t3, t4]
|
|
162
|
+
});
|
|
163
|
+
$[8] = t3;
|
|
164
|
+
$[9] = t5;
|
|
165
|
+
} else t5 = $[9];
|
|
166
|
+
const t6 = authCtx ? `${authCtx.authenticationUrl}/dashboard/${project.organizationSlug}/${project.slug}/overview` : "#";
|
|
179
167
|
let t7;
|
|
180
|
-
if ($[
|
|
181
|
-
t7 = /* @__PURE__ */
|
|
182
|
-
|
|
183
|
-
|
|
168
|
+
if ($[10] !== t6) {
|
|
169
|
+
t7 = /* @__PURE__ */ jsx("a", {
|
|
170
|
+
href: t6,
|
|
171
|
+
target: "_blank",
|
|
172
|
+
rel: "noopener noreferrer"
|
|
184
173
|
});
|
|
185
|
-
$[
|
|
186
|
-
$[
|
|
187
|
-
} else t7 = $[
|
|
174
|
+
$[10] = t6;
|
|
175
|
+
$[11] = t7;
|
|
176
|
+
} else t7 = $[11];
|
|
188
177
|
let t8;
|
|
189
|
-
if ($[
|
|
190
|
-
t8 = /* @__PURE__ */ jsx(
|
|
191
|
-
$[
|
|
192
|
-
} else t8 = $[
|
|
178
|
+
if ($[12] === Symbol.for("react.memo_cache_sentinel")) {
|
|
179
|
+
t8 = /* @__PURE__ */ jsx(Settings, {});
|
|
180
|
+
$[12] = t8;
|
|
181
|
+
} else t8 = $[12];
|
|
193
182
|
let t9;
|
|
194
|
-
if ($[
|
|
195
|
-
t9 = /* @__PURE__ */
|
|
196
|
-
|
|
197
|
-
children:
|
|
183
|
+
if ($[13] !== t7) {
|
|
184
|
+
t9 = /* @__PURE__ */ jsxs(DropdownMenuItem, {
|
|
185
|
+
render: t7,
|
|
186
|
+
children: [t8, "Project settings"]
|
|
198
187
|
});
|
|
199
|
-
$[
|
|
200
|
-
$[
|
|
201
|
-
} else t9 = $[
|
|
188
|
+
$[13] = t7;
|
|
189
|
+
$[14] = t9;
|
|
190
|
+
} else t9 = $[14];
|
|
202
191
|
let t10;
|
|
203
|
-
if ($[
|
|
204
|
-
t10 = (
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
$[19] = authCtx;
|
|
208
|
-
$[20] = project.organizationSlug;
|
|
209
|
-
$[21] = t10;
|
|
210
|
-
} else t10 = $[21];
|
|
192
|
+
if ($[15] === Symbol.for("react.memo_cache_sentinel")) {
|
|
193
|
+
t10 = /* @__PURE__ */ jsx(DropdownMenuSeparator, {});
|
|
194
|
+
$[15] = t10;
|
|
195
|
+
} else t10 = $[15];
|
|
211
196
|
let t11;
|
|
212
|
-
if ($[
|
|
213
|
-
t11 = /* @__PURE__ */ jsx(
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
let t12;
|
|
217
|
-
if ($[23] !== t10) {
|
|
218
|
-
t12 = /* @__PURE__ */ jsxs(DropdownMenuItem, {
|
|
219
|
-
onSelect: t10,
|
|
220
|
-
children: [t11, "Team members"]
|
|
197
|
+
if ($[16] !== project.organizationSlug) {
|
|
198
|
+
t11 = /* @__PURE__ */ jsx(DropdownMenuLabel, {
|
|
199
|
+
className: "text-muted-foreground text-xs font-normal",
|
|
200
|
+
children: project.organizationSlug
|
|
221
201
|
});
|
|
222
|
-
$[
|
|
223
|
-
$[
|
|
224
|
-
} else
|
|
202
|
+
$[16] = project.organizationSlug;
|
|
203
|
+
$[17] = t11;
|
|
204
|
+
} else t11 = $[17];
|
|
205
|
+
const t12 = authCtx ? `${authCtx.authenticationUrl}/dashboard/${project.organizationSlug}/team?tab=members` : "#";
|
|
225
206
|
let t13;
|
|
226
|
-
if ($[
|
|
227
|
-
t13 = (
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
$[
|
|
233
|
-
|
|
207
|
+
if ($[18] !== t12) {
|
|
208
|
+
t13 = /* @__PURE__ */ jsx("a", {
|
|
209
|
+
href: t12,
|
|
210
|
+
target: "_blank",
|
|
211
|
+
rel: "noopener noreferrer"
|
|
212
|
+
});
|
|
213
|
+
$[18] = t12;
|
|
214
|
+
$[19] = t13;
|
|
215
|
+
} else t13 = $[19];
|
|
234
216
|
let t14;
|
|
235
|
-
if ($[
|
|
236
|
-
t14 = /* @__PURE__ */ jsx(
|
|
237
|
-
$[
|
|
238
|
-
} else t14 = $[
|
|
217
|
+
if ($[20] === Symbol.for("react.memo_cache_sentinel")) {
|
|
218
|
+
t14 = /* @__PURE__ */ jsx(Users, {});
|
|
219
|
+
$[20] = t14;
|
|
220
|
+
} else t14 = $[20];
|
|
239
221
|
let t15;
|
|
240
|
-
if ($[
|
|
222
|
+
if ($[21] !== t13) {
|
|
241
223
|
t15 = /* @__PURE__ */ jsxs(DropdownMenuItem, {
|
|
242
|
-
|
|
243
|
-
children: [t14, "Team
|
|
224
|
+
render: t13,
|
|
225
|
+
children: [t14, "Team members"]
|
|
244
226
|
});
|
|
245
|
-
$[
|
|
246
|
-
$[
|
|
247
|
-
} else t15 = $[
|
|
248
|
-
|
|
249
|
-
if ($[31] === Symbol.for("react.memo_cache_sentinel")) {
|
|
250
|
-
t16 = /* @__PURE__ */ jsx(DropdownMenuSeparator, {});
|
|
251
|
-
$[31] = t16;
|
|
252
|
-
} else t16 = $[31];
|
|
227
|
+
$[21] = t13;
|
|
228
|
+
$[22] = t15;
|
|
229
|
+
} else t15 = $[22];
|
|
230
|
+
const t16 = authCtx ? `${authCtx.authenticationUrl}/dashboard/${project.organizationSlug}/team?tab=settings` : "#";
|
|
253
231
|
let t17;
|
|
232
|
+
if ($[23] !== t16) {
|
|
233
|
+
t17 = /* @__PURE__ */ jsx("a", {
|
|
234
|
+
href: t16,
|
|
235
|
+
target: "_blank",
|
|
236
|
+
rel: "noopener noreferrer"
|
|
237
|
+
});
|
|
238
|
+
$[23] = t16;
|
|
239
|
+
$[24] = t17;
|
|
240
|
+
} else t17 = $[24];
|
|
241
|
+
let t18;
|
|
242
|
+
if ($[25] === Symbol.for("react.memo_cache_sentinel")) {
|
|
243
|
+
t18 = /* @__PURE__ */ jsx(Settings, { className: "h-4 w-4" });
|
|
244
|
+
$[25] = t18;
|
|
245
|
+
} else t18 = $[25];
|
|
246
|
+
let t19;
|
|
247
|
+
if ($[26] !== t17) {
|
|
248
|
+
t19 = /* @__PURE__ */ jsxs(DropdownMenuItem, {
|
|
249
|
+
render: t17,
|
|
250
|
+
children: [t18, "Team settings"]
|
|
251
|
+
});
|
|
252
|
+
$[26] = t17;
|
|
253
|
+
$[27] = t19;
|
|
254
|
+
} else t19 = $[27];
|
|
255
|
+
let t20;
|
|
256
|
+
if ($[28] !== t11 || $[29] !== t15 || $[30] !== t19) {
|
|
257
|
+
t20 = /* @__PURE__ */ jsxs(DropdownMenuGroup, { children: [
|
|
258
|
+
t11,
|
|
259
|
+
t15,
|
|
260
|
+
t19
|
|
261
|
+
] });
|
|
262
|
+
$[28] = t11;
|
|
263
|
+
$[29] = t15;
|
|
264
|
+
$[30] = t19;
|
|
265
|
+
$[31] = t20;
|
|
266
|
+
} else t20 = $[31];
|
|
267
|
+
let t21;
|
|
254
268
|
if ($[32] === Symbol.for("react.memo_cache_sentinel")) {
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
269
|
+
t21 = /* @__PURE__ */ jsx(DropdownMenuSeparator, {});
|
|
270
|
+
$[32] = t21;
|
|
271
|
+
} else t21 = $[32];
|
|
272
|
+
let t22;
|
|
273
|
+
if ($[33] === Symbol.for("react.memo_cache_sentinel")) {
|
|
274
|
+
t22 = /* @__PURE__ */ jsxs(DropdownMenuItem, {
|
|
275
|
+
render: /* @__PURE__ */ jsx(Link, {
|
|
258
276
|
to: "https://camox.ai",
|
|
259
|
-
target: "_blank"
|
|
260
|
-
|
|
261
|
-
})
|
|
277
|
+
target: "_blank"
|
|
278
|
+
}),
|
|
279
|
+
children: [/* @__PURE__ */ jsx(Info, { className: "h-4 w-4" }), "Powered by Camox"]
|
|
262
280
|
});
|
|
263
|
-
$[
|
|
264
|
-
} else
|
|
265
|
-
let
|
|
266
|
-
if ($[
|
|
267
|
-
|
|
281
|
+
$[33] = t22;
|
|
282
|
+
} else t22 = $[33];
|
|
283
|
+
let t23;
|
|
284
|
+
if ($[34] !== t20 || $[35] !== t9) {
|
|
285
|
+
t23 = /* @__PURE__ */ jsxs(DropdownMenuContent, {
|
|
268
286
|
className: "w-72",
|
|
269
287
|
align: "start",
|
|
270
288
|
side: "bottom",
|
|
271
289
|
children: [
|
|
272
|
-
t7,
|
|
273
|
-
t8,
|
|
274
290
|
t9,
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
291
|
+
t10,
|
|
292
|
+
t20,
|
|
293
|
+
t21,
|
|
294
|
+
t22
|
|
279
295
|
]
|
|
280
296
|
});
|
|
281
|
-
$[
|
|
282
|
-
$[
|
|
283
|
-
$[
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
$[
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
} else t19 = $[40];
|
|
294
|
-
return t19;
|
|
297
|
+
$[34] = t20;
|
|
298
|
+
$[35] = t9;
|
|
299
|
+
$[36] = t23;
|
|
300
|
+
} else t23 = $[36];
|
|
301
|
+
let t24;
|
|
302
|
+
if ($[37] !== t23 || $[38] !== t5) {
|
|
303
|
+
t24 = /* @__PURE__ */ jsxs(DropdownMenu, { children: [t5, t23] });
|
|
304
|
+
$[37] = t23;
|
|
305
|
+
$[38] = t5;
|
|
306
|
+
$[39] = t24;
|
|
307
|
+
} else t24 = $[39];
|
|
308
|
+
return t24;
|
|
295
309
|
};
|
|
296
310
|
function _temp() {
|
|
297
311
|
for (const selector of [
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UserButton.d.ts","sourceRoot":"","sources":["../../../../src/features/studio/components/UserButton.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"UserButton.d.ts","sourceRoot":"","sources":["../../../../src/features/studio/components/UserButton.tsx"],"names":[],"mappings":"AAqBA,eAAO,MAAM,UAAU,+CAatB,CAAC"}
|
|
@@ -5,7 +5,7 @@ import { useContext } from "react";
|
|
|
5
5
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
6
|
import { Button } from "@camox/ui/button";
|
|
7
7
|
import { LogOut, Monitor, Moon, Settings, Sun, User } from "lucide-react";
|
|
8
|
-
import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuLabel, DropdownMenuSeparator, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger } from "@camox/ui/dropdown-menu";
|
|
8
|
+
import { DropdownMenu, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuSeparator, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger } from "@camox/ui/dropdown-menu";
|
|
9
9
|
import { Avatar, AvatarFallback, AvatarImage } from "@camox/ui/avatar";
|
|
10
10
|
//#region src/features/studio/components/UserButton.tsx
|
|
11
11
|
var UserButton = () => {
|
|
@@ -41,17 +41,16 @@ function AuthenticatedUserButton({ setTheme }) {
|
|
|
41
41
|
const userImage = session?.user?.image;
|
|
42
42
|
const userInitials = userName.split(" ").map((n) => n[0]).join("").toUpperCase().slice(0, 2);
|
|
43
43
|
return /* @__PURE__ */ jsxs(DropdownMenu, { children: [/* @__PURE__ */ jsx(DropdownMenuTrigger, {
|
|
44
|
-
|
|
45
|
-
children: /* @__PURE__ */ jsx(Button, {
|
|
44
|
+
render: /* @__PURE__ */ jsx(Button, {
|
|
46
45
|
variant: "outline",
|
|
47
|
-
size: "icon"
|
|
48
|
-
|
|
49
|
-
})
|
|
46
|
+
size: "icon"
|
|
47
|
+
}),
|
|
48
|
+
children: /* @__PURE__ */ jsx(User, { className: "text-muted-foreground h-4 w-4" })
|
|
50
49
|
}), /* @__PURE__ */ jsxs(DropdownMenuContent, {
|
|
51
50
|
className: "w-72",
|
|
52
51
|
align: "end",
|
|
53
52
|
children: [
|
|
54
|
-
/* @__PURE__ */ jsx(DropdownMenuLabel, {
|
|
53
|
+
/* @__PURE__ */ jsx(DropdownMenuGroup, { children: /* @__PURE__ */ jsx(DropdownMenuLabel, {
|
|
55
54
|
className: "font-normal",
|
|
56
55
|
children: /* @__PURE__ */ jsxs("div", {
|
|
57
56
|
className: "flex items-center gap-3",
|
|
@@ -64,7 +63,7 @@ function AuthenticatedUserButton({ setTheme }) {
|
|
|
64
63
|
}), /* @__PURE__ */ jsxs("div", {
|
|
65
64
|
className: "flex-1 space-y-0.5",
|
|
66
65
|
children: [/* @__PURE__ */ jsx("p", {
|
|
67
|
-
className: "text-sm leading-none font-medium",
|
|
66
|
+
className: "text-foreground text-sm leading-none font-medium",
|
|
68
67
|
children: userName
|
|
69
68
|
}), /* @__PURE__ */ jsx("p", {
|
|
70
69
|
className: "text-muted-foreground text-sm",
|
|
@@ -72,7 +71,7 @@ function AuthenticatedUserButton({ setTheme }) {
|
|
|
72
71
|
})]
|
|
73
72
|
})]
|
|
74
73
|
})
|
|
75
|
-
}),
|
|
74
|
+
}) }),
|
|
76
75
|
/* @__PURE__ */ jsx(DropdownMenuSeparator, {}),
|
|
77
76
|
/* @__PURE__ */ jsxs(DropdownMenuItem, {
|
|
78
77
|
onClick: () => window.open(`${authenticationUrl}/dashboard/profile`, "_blank"),
|
|
@@ -14,6 +14,8 @@ export interface CamoxPluginOptions {
|
|
|
14
14
|
authenticationUrl?: string;
|
|
15
15
|
/** Show Tanstack query devtools (default: false) */
|
|
16
16
|
enableTanstackDevtools?: boolean;
|
|
17
|
+
/** Disable automatic code generation (route files, app file, skill files) (default: false) */
|
|
18
|
+
disableCodeGen?: boolean;
|
|
17
19
|
};
|
|
18
20
|
}
|
|
19
21
|
export declare function camox(options: CamoxPluginOptions): Plugin;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vite.d.ts","sourceRoot":"","sources":["../../../src/features/vite/vite.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,KAAK,MAAM,EAAyD,MAAM,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"vite.d.ts","sourceRoot":"","sources":["../../../src/features/vite/vite.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,KAAK,MAAM,EAAyD,MAAM,MAAM,CAAC;AA2C1F,MAAM,WAAW,kBAAkB;IACjC,0FAA0F;IAC1F,WAAW,EAAE,MAAM,CAAC;IACpB,wEAAwE;IACxE,UAAU,EAAE,MAAM,CAAC;IACnB,4DAA4D;IAC5D,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,4FAA4F;IAC5F,SAAS,CAAC,EAAE;QACV,2DAA2D;QAC3D,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,0EAA0E;QAC1E,iBAAiB,CAAC,EAAE,MAAM,CAAC;QAC3B,oDAAoD;QACpD,sBAAsB,CAAC,EAAE,OAAO,CAAC;QACjC,8FAA8F;QAC9F,cAAc,CAAC,EAAE,OAAO,CAAC;KAC1B,CAAC;CACH;AAED,wBAAgB,KAAK,CAAC,OAAO,EAAE,kBAAkB,GAAG,MAAM,CAmIzD"}
|
|
@@ -12,14 +12,6 @@ import { createServer } from "vite";
|
|
|
12
12
|
var sdkRoot = resolve(dirname(fileURLToPath(import.meta.url)), "../../..");
|
|
13
13
|
var VIRTUAL_STUDIO_CSS = "virtual:camox-studio-css";
|
|
14
14
|
var RESOLVED_VIRTUAL_STUDIO_CSS = "\0" + VIRTUAL_STUDIO_CSS;
|
|
15
|
-
/**
|
|
16
|
-
* use-sync-external-store is CJS-only and causes issues in ESM environments.
|
|
17
|
-
* Since all Camox apps use React 19+, we can redirect imports to React's built-in
|
|
18
|
-
* useSyncExternalStore instead. This handles all subpaths (e.g. /shim, /shim/index.js).
|
|
19
|
-
*/
|
|
20
|
-
var USE_SYNC_EXTERNAL_STORE_RE = /^use-sync-external-store(\/|$)/;
|
|
21
|
-
var RESOLVED_USE_SYNC_SHIM = "\0use-sync-external-store-shim";
|
|
22
|
-
var USE_SYNC_SHIM_CODE = `export { useSyncExternalStore } from "react";\n`;
|
|
23
15
|
var PRODUCTION_API_URL = "https://api.camox.ai";
|
|
24
16
|
/** Authentication URL to use for Camox authentication (production Camox web app) */
|
|
25
17
|
var DEFAULT_AUTHENTICATION_URL = "https://camox.ai";
|
|
@@ -40,6 +32,7 @@ function camox(options) {
|
|
|
40
32
|
const apiUrl = options._internal?.apiUrl ?? PRODUCTION_API_URL;
|
|
41
33
|
const authenticationUrl = options._internal?.authenticationUrl ?? DEFAULT_AUTHENTICATION_URL;
|
|
42
34
|
const enableTanstackDevtools = options._internal?.enableTanstackDevtools ?? false;
|
|
35
|
+
const disableCodeGen = options._internal?.disableCodeGen ?? false;
|
|
43
36
|
let isBuild = false;
|
|
44
37
|
let resolvedConfig;
|
|
45
38
|
let environmentName;
|
|
@@ -47,10 +40,8 @@ function camox(options) {
|
|
|
47
40
|
name: "camox",
|
|
48
41
|
resolveId(id) {
|
|
49
42
|
if (id === VIRTUAL_STUDIO_CSS) return RESOLVED_VIRTUAL_STUDIO_CSS;
|
|
50
|
-
if (USE_SYNC_EXTERNAL_STORE_RE.test(id)) return RESOLVED_USE_SYNC_SHIM;
|
|
51
43
|
},
|
|
52
44
|
load(id) {
|
|
53
|
-
if (id === RESOLVED_USE_SYNC_SHIM) return USE_SYNC_SHIM_CODE;
|
|
54
45
|
if (id !== RESOLVED_VIRTUAL_STUDIO_CSS) return;
|
|
55
46
|
const cssPath = resolve(sdkRoot, "dist/studio.css");
|
|
56
47
|
if (isBuild) {
|
|
@@ -77,31 +68,36 @@ function camox(options) {
|
|
|
77
68
|
configResolved(config) {
|
|
78
69
|
resolvedConfig = config;
|
|
79
70
|
const routesDir = resolve(config.root, "src/routes");
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
71
|
+
if (!disableCodeGen) {
|
|
72
|
+
generateAppFile(config.root);
|
|
73
|
+
generateRouteFiles({
|
|
74
|
+
routesDir,
|
|
75
|
+
authenticationUrl,
|
|
76
|
+
apiUrl,
|
|
77
|
+
projectSlug: options.projectSlug,
|
|
78
|
+
environmentName
|
|
79
|
+
});
|
|
80
|
+
generateSkillFiles(config.root);
|
|
81
|
+
}
|
|
82
|
+
if (disableCodeGen) config.logger.warn("⚠️ Code generation is disabled (_internal.disableCodeGen). This option is only meant for momentary debugging — do not deploy or commit your app with it enabled.", { timestamp: true });
|
|
89
83
|
const mode = config.command === "serve" ? "Running" : "Building";
|
|
90
84
|
config.logger.info(`${mode} Camox app (environment: ${environmentName})`, { timestamp: true });
|
|
91
85
|
},
|
|
92
86
|
configureServer(server) {
|
|
93
87
|
const routesDir = resolve(server.config.root, "src/routes");
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
88
|
+
if (!disableCodeGen) {
|
|
89
|
+
watchAppFile(server, server.config.root);
|
|
90
|
+
watchRouteFiles({
|
|
91
|
+
server,
|
|
92
|
+
routesDir,
|
|
93
|
+
authenticationUrl,
|
|
94
|
+
apiUrl,
|
|
95
|
+
projectSlug: options.projectSlug,
|
|
96
|
+
environmentName
|
|
97
|
+
});
|
|
98
|
+
watchSkillFiles(server, server.config.root);
|
|
99
|
+
watchNewBlockFiles(server);
|
|
100
|
+
}
|
|
105
101
|
server.httpServer?.once("listening", () => {
|
|
106
102
|
syncDefinitions(server, {
|
|
107
103
|
projectSlug: options.projectSlug,
|