camox 0.14.2 → 0.16.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/components/AuthGate.js +6 -0
- package/dist/core/components/AddBlockControlBar.js +30 -26
- package/dist/core/components/lexical/InlineContentEditable.js +19 -15
- package/dist/core/components/lexical/InlineLexicalEditor.js +62 -42
- package/dist/core/components/lexical/SelectionBroadcaster.js +25 -21
- package/dist/core/components/lexical/SidebarLexicalEditor.js +33 -21
- package/dist/core/createBlock.js +524 -488
- package/dist/core/createLayout.js +40 -28
- package/dist/core/hooks/useFieldSelection.js +12 -8
- package/dist/core/hooks/useIsEditable.js +6 -0
- package/dist/core/hooks/useOverlayMessage.js +19 -15
- package/dist/core/lib/contentType.d.ts +8 -8
- package/dist/core/lib/contentType.js +63 -0
- package/dist/features/content/CamoxContent.js +92 -88
- package/dist/features/content/components/AssetCard.js +46 -42
- package/dist/features/content/components/AssetCardSkeleton.js +8 -4
- package/dist/features/content/components/ContentSidebar.js +8 -4
- package/dist/features/content/components/UploadDropZone.js +31 -27
- package/dist/features/content/components/UploadProgressDrawer.js +98 -90
- package/dist/features/preview/CamoxPreview.js +162 -146
- package/dist/features/preview/components/AddBlockSheet.js +105 -101
- package/dist/features/preview/components/AgentChatSheet.js +74 -21
- package/dist/features/preview/components/AssetFieldEditor.js +98 -90
- package/dist/features/preview/components/AssetLightbox.js +21 -17
- package/dist/features/preview/components/AssetPickerGrid.js +84 -80
- package/dist/features/preview/components/BlockActionsPopover.js +35 -31
- package/dist/features/preview/components/BlockErrorBoundary.js +12 -8
- package/dist/features/preview/components/CreatePageModal.js +1 -1
- package/dist/features/preview/components/DebouncedFieldEditor.js +41 -37
- package/dist/features/preview/components/EditPageModal.js +114 -98
- package/dist/features/preview/components/FieldOverlayStyles.js +8 -4
- package/dist/features/preview/components/FieldToolbar.js +95 -54
- package/dist/features/preview/components/Frame.js +50 -46
- package/dist/features/preview/components/ItemFieldsEditor.js +81 -79
- package/dist/features/preview/components/LinkFieldEditor.js +138 -134
- package/dist/features/preview/components/MultipleAssetFieldEditor.js +105 -97
- package/dist/features/preview/components/OverlayTracker.js +19 -15
- package/dist/features/preview/components/Overlays.js +27 -23
- package/dist/features/preview/components/PageContentSheet.js +54 -4
- package/dist/features/preview/components/PageLocationFieldset.js +113 -109
- package/dist/features/preview/components/PagePicker.js +1 -1
- package/dist/features/preview/components/PageTree.js +443 -399
- package/dist/features/preview/components/PeekedBlock.js +69 -65
- package/dist/features/preview/components/PreviewPanel.js +64 -52
- package/dist/features/preview/components/PreviewSideSheet.js +25 -16
- package/dist/features/preview/components/PreviewToolbar.js +127 -123
- package/dist/features/preview/components/RepeatableItemsList.js +176 -171
- package/dist/features/preview/components/ShikiMarkdown.js +18 -14
- package/dist/features/preview/components/UnlinkAssetButton.js +74 -70
- package/dist/features/preview/components/useRepeatableItemActions.js +266 -0
- package/dist/features/preview/components/useUpdateBlockPosition.js +13 -9
- package/dist/features/provider/CamoxProvider.js +60 -52
- package/dist/features/provider/components/CamoxAppContext.js +10 -6
- package/dist/features/provider/components/CommandPalette.js +77 -69
- package/dist/features/provider/useAdminShortcuts.js +11 -7
- package/dist/features/routes/pageRoute.js +8 -4
- package/dist/features/studio/CamoxStudio.js +23 -19
- package/dist/features/studio/components/EnvironmentMenu.js +32 -28
- package/dist/features/studio/components/Navbar.js +62 -54
- package/dist/features/studio/components/ProjectMenu.js +131 -123
- package/dist/features/studio/components/UserButton.js +15 -11
- package/dist/features/studio/useTheme.js +82 -42
- package/dist/features/vite/definitionsSync.js +5 -5
- package/dist/features/vite/skillGeneration.js +43 -8
- package/dist/features/vite/vite.d.ts +1 -1
- package/dist/features/vite/vite.js +20 -2
- package/dist/hooks/use-marquee-selection.js +36 -32
- package/dist/lib/auth.js +49 -22
- package/dist/lib/normalized-data.js +55 -47
- package/dist/lib/use-project-room.js +22 -18
- package/dist/studio.css +1 -1
- package/package.json +10 -11
- package/skills/camox-block/SKILL.md +4 -0
- package/skills/camox-cli/SKILL.md +142 -0
- package/skills/camox-layout/SKILL.md +4 -0
|
@@ -9,7 +9,11 @@ import { Badge } from "@camox/ui/badge";
|
|
|
9
9
|
|
|
10
10
|
//#region src/features/studio/components/EnvironmentMenu.tsx
|
|
11
11
|
const EnvironmentMenu = () => {
|
|
12
|
-
const $ = c(
|
|
12
|
+
const $ = c(14);
|
|
13
|
+
if ($[0] !== "b4c87e8e94e837c7c310a7417eb826babd26658f7e32a825af55ee5b28e4b94c") {
|
|
14
|
+
for (let $i = 0; $i < 14; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
|
|
15
|
+
$[0] = "b4c87e8e94e837c7c310a7417eb826babd26658f7e32a825af55ee5b28e4b94c";
|
|
16
|
+
}
|
|
13
17
|
const [open, setOpen] = React.useState(false);
|
|
14
18
|
const authCtx = React.useContext(AuthContext);
|
|
15
19
|
if (!authCtx?.environmentName) return null;
|
|
@@ -17,40 +21,40 @@ const EnvironmentMenu = () => {
|
|
|
17
21
|
const label = isProduction ? "PROD" : "DEV";
|
|
18
22
|
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";
|
|
19
23
|
let t0;
|
|
20
|
-
if ($[
|
|
24
|
+
if ($[1] === Symbol.for("react.memo_cache_sentinel")) {
|
|
21
25
|
t0 = /* @__PURE__ */ jsx(Button, {
|
|
22
26
|
variant: "ghost",
|
|
23
27
|
className: "gap-2"
|
|
24
28
|
});
|
|
25
|
-
$[
|
|
26
|
-
} else t0 = $[
|
|
29
|
+
$[1] = t0;
|
|
30
|
+
} else t0 = $[1];
|
|
27
31
|
let t1;
|
|
28
|
-
if ($[
|
|
32
|
+
if ($[2] !== badgeClassName || $[3] !== label) {
|
|
29
33
|
t1 = /* @__PURE__ */ jsx(Badge, {
|
|
30
34
|
variant: "secondary",
|
|
31
35
|
className: badgeClassName,
|
|
32
36
|
children: label
|
|
33
37
|
});
|
|
34
|
-
$[
|
|
35
|
-
$[
|
|
36
|
-
$[
|
|
37
|
-
} else t1 = $[
|
|
38
|
+
$[2] = badgeClassName;
|
|
39
|
+
$[3] = label;
|
|
40
|
+
$[4] = t1;
|
|
41
|
+
} else t1 = $[4];
|
|
38
42
|
let t2;
|
|
39
|
-
if ($[
|
|
43
|
+
if ($[5] === Symbol.for("react.memo_cache_sentinel")) {
|
|
40
44
|
t2 = /* @__PURE__ */ jsx(ChevronDown, { className: "shrink-0 opacity-50" });
|
|
41
|
-
$[
|
|
42
|
-
} else t2 = $[
|
|
45
|
+
$[5] = t2;
|
|
46
|
+
} else t2 = $[5];
|
|
43
47
|
let t3;
|
|
44
|
-
if ($[
|
|
48
|
+
if ($[6] !== t1) {
|
|
45
49
|
t3 = /* @__PURE__ */ jsxs(PopoverTrigger, {
|
|
46
50
|
render: t0,
|
|
47
51
|
children: [t1, t2]
|
|
48
52
|
});
|
|
49
|
-
$[
|
|
50
|
-
$[
|
|
51
|
-
} else t3 = $[
|
|
53
|
+
$[6] = t1;
|
|
54
|
+
$[7] = t3;
|
|
55
|
+
} else t3 = $[7];
|
|
52
56
|
let t4;
|
|
53
|
-
if ($[
|
|
57
|
+
if ($[8] !== isProduction) {
|
|
54
58
|
t4 = /* @__PURE__ */ jsx(PopoverContent, {
|
|
55
59
|
className: "w-96 p-4",
|
|
56
60
|
align: "start",
|
|
@@ -62,28 +66,28 @@ const EnvironmentMenu = () => {
|
|
|
62
66
|
children: "You are viewing the production environment."
|
|
63
67
|
}) : /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx("p", {
|
|
64
68
|
className: "text-sm",
|
|
65
|
-
children: "This environment is your personal space to iterate on content and data structures. It
|
|
69
|
+
children: "This environment is your personal space to iterate on content and data structures. It doesn't affect production data."
|
|
66
70
|
}), /* @__PURE__ */ jsx("p", {
|
|
67
71
|
className: "text-muted-foreground text-xs",
|
|
68
|
-
children: "You will be able to pull and push data
|
|
72
|
+
children: "You will be able to pull and push data to the production env from here."
|
|
69
73
|
})] })
|
|
70
74
|
})
|
|
71
75
|
});
|
|
72
|
-
$[
|
|
73
|
-
$[
|
|
74
|
-
} else t4 = $[
|
|
76
|
+
$[8] = isProduction;
|
|
77
|
+
$[9] = t4;
|
|
78
|
+
} else t4 = $[9];
|
|
75
79
|
let t5;
|
|
76
|
-
if ($[
|
|
80
|
+
if ($[10] !== open || $[11] !== t3 || $[12] !== t4) {
|
|
77
81
|
t5 = /* @__PURE__ */ jsxs(Popover, {
|
|
78
82
|
open,
|
|
79
83
|
onOpenChange: setOpen,
|
|
80
84
|
children: [t3, t4]
|
|
81
85
|
});
|
|
82
|
-
$[
|
|
83
|
-
$[
|
|
84
|
-
$[
|
|
85
|
-
$[
|
|
86
|
-
} else t5 = $[
|
|
86
|
+
$[10] = open;
|
|
87
|
+
$[11] = t3;
|
|
88
|
+
$[12] = t4;
|
|
89
|
+
$[13] = t5;
|
|
90
|
+
} else t5 = $[13];
|
|
87
91
|
return t5;
|
|
88
92
|
};
|
|
89
93
|
|
|
@@ -29,70 +29,74 @@ const links = [{
|
|
|
29
29
|
icon: "FileText"
|
|
30
30
|
}];
|
|
31
31
|
const Navbar = () => {
|
|
32
|
-
const $ = c(
|
|
32
|
+
const $ = c(24);
|
|
33
|
+
if ($[0] !== "8dc1a9bd4bf6bec7a5222000410c137024570dada4eee777e4c30a50b639d928") {
|
|
34
|
+
for (let $i = 0; $i < 24; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
|
|
35
|
+
$[0] = "8dc1a9bd4bf6bec7a5222000410c137024570dada4eee777e4c30a50b639d928";
|
|
36
|
+
}
|
|
33
37
|
const projectSlug = useProjectSlug();
|
|
34
38
|
let t0;
|
|
35
|
-
if ($[
|
|
39
|
+
if ($[1] !== projectSlug) {
|
|
36
40
|
t0 = projectQueries.getBySlug(projectSlug);
|
|
37
|
-
$[
|
|
38
|
-
$[
|
|
39
|
-
} else t0 = $[
|
|
41
|
+
$[1] = projectSlug;
|
|
42
|
+
$[2] = t0;
|
|
43
|
+
} else t0 = $[2];
|
|
40
44
|
const { data: project } = useQuery(t0);
|
|
41
45
|
let t1;
|
|
42
|
-
if ($[
|
|
46
|
+
if ($[3] !== project?.id) {
|
|
43
47
|
t1 = pageQueries.list(project?.id ?? 0);
|
|
44
|
-
$[
|
|
45
|
-
$[
|
|
46
|
-
} else t1 = $[
|
|
48
|
+
$[3] = project?.id;
|
|
49
|
+
$[4] = t1;
|
|
50
|
+
} else t1 = $[4];
|
|
47
51
|
const t2 = !!project;
|
|
48
52
|
let t3;
|
|
49
|
-
if ($[
|
|
53
|
+
if ($[5] !== t1 || $[6] !== t2) {
|
|
50
54
|
t3 = {
|
|
51
55
|
...t1,
|
|
52
56
|
enabled: t2
|
|
53
57
|
};
|
|
54
|
-
$[
|
|
55
|
-
$[
|
|
56
|
-
$[
|
|
57
|
-
} else t3 = $[
|
|
58
|
+
$[5] = t1;
|
|
59
|
+
$[6] = t2;
|
|
60
|
+
$[7] = t3;
|
|
61
|
+
} else t3 = $[7];
|
|
58
62
|
const { data: pages } = useQuery(t3);
|
|
59
63
|
const isMac = navigator.userAgent.toUpperCase().indexOf("MAC") >= 0;
|
|
60
64
|
const { pathname } = useLocation();
|
|
61
65
|
const t4 = useIsPreviewSheetOpen() ? "opacity-100" : "opacity-0";
|
|
62
66
|
let t5;
|
|
63
|
-
if ($[
|
|
67
|
+
if ($[8] !== t4) {
|
|
64
68
|
t5 = cn("absolute top-0 left-0 w-full h-[calc(100%+2px)] bg-black/66 transition-opacity z-10 will-change-auto pointer-events-none", t4);
|
|
65
|
-
$[
|
|
66
|
-
$[
|
|
67
|
-
} else t5 = $[
|
|
69
|
+
$[8] = t4;
|
|
70
|
+
$[9] = t5;
|
|
71
|
+
} else t5 = $[9];
|
|
68
72
|
let t6;
|
|
69
|
-
if ($[
|
|
73
|
+
if ($[10] !== t5) {
|
|
70
74
|
t6 = /* @__PURE__ */ jsx("div", { className: t5 });
|
|
71
|
-
$[
|
|
72
|
-
$[
|
|
73
|
-
} else t6 = $[
|
|
75
|
+
$[10] = t5;
|
|
76
|
+
$[11] = t6;
|
|
77
|
+
} else t6 = $[11];
|
|
74
78
|
let t7;
|
|
75
|
-
if ($[
|
|
79
|
+
if ($[12] === Symbol.for("react.memo_cache_sentinel")) {
|
|
76
80
|
t7 = /* @__PURE__ */ jsxs("div", {
|
|
77
81
|
className: "flew-row flex gap-1",
|
|
78
82
|
children: [/* @__PURE__ */ jsx(ProjectMenu, {}), /* @__PURE__ */ jsx(EnvironmentMenu, {})]
|
|
79
83
|
});
|
|
80
|
-
$[
|
|
81
|
-
} else t7 = $[
|
|
84
|
+
$[12] = t7;
|
|
85
|
+
} else t7 = $[12];
|
|
82
86
|
let t8;
|
|
83
|
-
if ($[
|
|
87
|
+
if ($[13] !== pages || $[14] !== pathname) {
|
|
84
88
|
t8 = links.map((link, index) => /* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsx(Link, {
|
|
85
89
|
to: link.to,
|
|
86
90
|
className: cn("flex gap-2 items-center rounded-md px-4 py-2 text-sm font-medium", "hover:bg-accent hover:text-accent-foreground outline-none transition-[color,box-shadow] focus-visible:ring-ring/50 focus-visible:ring-[3px] focus-visible:outline-1", pages?.some((page) => page.fullPath === pathname) && index === 0 ? "bg-accent hover:bg-accent text-accent-foreground" : "text-muted-foreground"),
|
|
87
91
|
activeProps: { className: "bg-accent hover:bg-accent text-accent-foreground!" },
|
|
88
92
|
children: link.children
|
|
89
93
|
}) }, link.to));
|
|
90
|
-
$[
|
|
91
|
-
$[
|
|
92
|
-
$[
|
|
93
|
-
} else t8 = $[
|
|
94
|
+
$[13] = pages;
|
|
95
|
+
$[14] = pathname;
|
|
96
|
+
$[15] = t8;
|
|
97
|
+
} else t8 = $[15];
|
|
94
98
|
let t9;
|
|
95
|
-
if ($[
|
|
99
|
+
if ($[16] !== t8) {
|
|
96
100
|
t9 = /* @__PURE__ */ jsxs("div", {
|
|
97
101
|
className: "flex flex-row gap-2",
|
|
98
102
|
children: [t7, /* @__PURE__ */ jsx("ul", {
|
|
@@ -100,25 +104,25 @@ const Navbar = () => {
|
|
|
100
104
|
children: t8
|
|
101
105
|
})]
|
|
102
106
|
});
|
|
103
|
-
$[
|
|
104
|
-
$[
|
|
105
|
-
} else t9 = $[
|
|
107
|
+
$[16] = t8;
|
|
108
|
+
$[17] = t9;
|
|
109
|
+
} else t9 = $[17];
|
|
106
110
|
let t10;
|
|
107
111
|
let t11;
|
|
108
|
-
if ($[
|
|
112
|
+
if ($[18] === Symbol.for("react.memo_cache_sentinel")) {
|
|
109
113
|
t10 = /* @__PURE__ */ jsx(SearchIcon, { className: "text-muted-foreground size-4" });
|
|
110
114
|
t11 = /* @__PURE__ */ jsx("span", {
|
|
111
115
|
className: "text-muted-foreground",
|
|
112
116
|
children: "Quick find"
|
|
113
117
|
});
|
|
114
|
-
$[
|
|
115
|
-
$[
|
|
118
|
+
$[18] = t10;
|
|
119
|
+
$[19] = t11;
|
|
116
120
|
} else {
|
|
117
|
-
t10 = $[
|
|
118
|
-
t11 = $[
|
|
121
|
+
t10 = $[18];
|
|
122
|
+
t11 = $[19];
|
|
119
123
|
}
|
|
120
124
|
let t12;
|
|
121
|
-
if ($[
|
|
125
|
+
if ($[20] === Symbol.for("react.memo_cache_sentinel")) {
|
|
122
126
|
t12 = /* @__PURE__ */ jsxs("div", {
|
|
123
127
|
className: "flex items-center gap-2",
|
|
124
128
|
children: [/* @__PURE__ */ jsxs(Button, {
|
|
@@ -134,10 +138,10 @@ const Navbar = () => {
|
|
|
134
138
|
]
|
|
135
139
|
}), /* @__PURE__ */ jsx(UserButton, {})]
|
|
136
140
|
});
|
|
137
|
-
$[
|
|
138
|
-
} else t12 = $[
|
|
141
|
+
$[20] = t12;
|
|
142
|
+
} else t12 = $[20];
|
|
139
143
|
let t13;
|
|
140
|
-
if ($[
|
|
144
|
+
if ($[21] !== t6 || $[22] !== t9) {
|
|
141
145
|
t13 = /* @__PURE__ */ jsxs("nav", {
|
|
142
146
|
className: "relative flex items-center justify-between gap-4 border-b-2 bg-transparent px-2 py-2",
|
|
143
147
|
children: [
|
|
@@ -146,18 +150,22 @@ const Navbar = () => {
|
|
|
146
150
|
t12
|
|
147
151
|
]
|
|
148
152
|
});
|
|
149
|
-
$[
|
|
150
|
-
$[
|
|
151
|
-
$[
|
|
152
|
-
} else t13 = $[
|
|
153
|
+
$[21] = t6;
|
|
154
|
+
$[22] = t9;
|
|
155
|
+
$[23] = t13;
|
|
156
|
+
} else t13 = $[23];
|
|
153
157
|
return t13;
|
|
154
158
|
};
|
|
155
159
|
function useNavbarActions() {
|
|
156
|
-
const $ = c(
|
|
160
|
+
const $ = c(4);
|
|
161
|
+
if ($[0] !== "8dc1a9bd4bf6bec7a5222000410c137024570dada4eee777e4c30a50b639d928") {
|
|
162
|
+
for (let $i = 0; $i < 4; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
|
|
163
|
+
$[0] = "8dc1a9bd4bf6bec7a5222000410c137024570dada4eee777e4c30a50b639d928";
|
|
164
|
+
}
|
|
157
165
|
const navigate = useNavigate();
|
|
158
166
|
let t0;
|
|
159
167
|
let t1;
|
|
160
|
-
if ($[
|
|
168
|
+
if ($[1] !== navigate) {
|
|
161
169
|
t0 = () => {
|
|
162
170
|
const actions = links.map((link, index) => ({
|
|
163
171
|
id: `navigate-to-${link.to}`,
|
|
@@ -182,12 +190,12 @@ function useNavbarActions() {
|
|
|
182
190
|
};
|
|
183
191
|
};
|
|
184
192
|
t1 = [navigate];
|
|
185
|
-
$[
|
|
186
|
-
$[
|
|
187
|
-
$[
|
|
193
|
+
$[1] = navigate;
|
|
194
|
+
$[2] = t0;
|
|
195
|
+
$[3] = t1;
|
|
188
196
|
} else {
|
|
189
|
-
t0 = $[
|
|
190
|
-
t1 = $[
|
|
197
|
+
t0 = $[2];
|
|
198
|
+
t1 = $[3];
|
|
191
199
|
}
|
|
192
200
|
React.useEffect(t0, t1);
|
|
193
201
|
}
|