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
|
@@ -8,19 +8,23 @@ import { InputGroup, InputGroupAddon, InputGroupInput, InputGroupText } from "@c
|
|
|
8
8
|
//#region src/features/preview/components/PageLocationFieldset.tsx
|
|
9
9
|
const NO_PARENT_VALUE = "__no_parent__";
|
|
10
10
|
const PageLocationFieldset = (t0) => {
|
|
11
|
-
const $ = c(
|
|
11
|
+
const $ = c(62);
|
|
12
|
+
if ($[0] !== "b2799a1c747cb3d8810eb257f36745e1b5fcbbfe8659b68c9d233a42301c1eca") {
|
|
13
|
+
for (let $i = 0; $i < 62; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
|
|
14
|
+
$[0] = "b2799a1c747cb3d8810eb257f36745e1b5fcbbfe8659b68c9d233a42301c1eca";
|
|
15
|
+
}
|
|
12
16
|
const { parentPageId, onParentPageIdChange, pathSegment, onPathSegmentChange, disabled, pages, excludePageId, autoFocusPathSegment } = t0;
|
|
13
17
|
let t1;
|
|
14
|
-
if ($[
|
|
18
|
+
if ($[1] !== pages || $[2] !== parentPageId) {
|
|
15
19
|
t1 = () => {
|
|
16
20
|
if (!pages || !parentPageId) return "/";
|
|
17
21
|
const page = pages.find((p) => p.id === parentPageId);
|
|
18
22
|
return page ? page.fullPath + "/" : "/";
|
|
19
23
|
};
|
|
20
|
-
$[
|
|
21
|
-
$[
|
|
22
|
-
$[
|
|
23
|
-
} else t1 = $[
|
|
24
|
+
$[1] = pages;
|
|
25
|
+
$[2] = parentPageId;
|
|
26
|
+
$[3] = t1;
|
|
27
|
+
} else t1 = $[3];
|
|
24
28
|
const getParentPath = t1;
|
|
25
29
|
let T0;
|
|
26
30
|
let T1;
|
|
@@ -33,111 +37,111 @@ const PageLocationFieldset = (t0) => {
|
|
|
33
37
|
let t7;
|
|
34
38
|
let t8;
|
|
35
39
|
let t9;
|
|
36
|
-
if ($[
|
|
40
|
+
if ($[4] !== disabled || $[5] !== excludePageId || $[6] !== onParentPageIdChange || $[7] !== pages || $[8] !== parentPageId) {
|
|
37
41
|
const nonRootPages = pages?.filter((page_0) => page_0.id !== excludePageId && page_0.fullPath !== "/");
|
|
38
42
|
const hasParentOptions = nonRootPages && nonRootPages.length > 0;
|
|
39
43
|
t9 = "space-y-2";
|
|
40
|
-
if ($[
|
|
44
|
+
if ($[20] === Symbol.for("react.memo_cache_sentinel")) {
|
|
41
45
|
t10 = /* @__PURE__ */ jsxs(Label, { children: ["Parent page ", /* @__PURE__ */ jsx("span", {
|
|
42
46
|
className: "text-muted-foreground",
|
|
43
47
|
children: "(optional)"
|
|
44
48
|
})] });
|
|
45
|
-
$[
|
|
46
|
-
} else t10 = $[
|
|
49
|
+
$[20] = t10;
|
|
50
|
+
} else t10 = $[20];
|
|
47
51
|
T1 = Select;
|
|
48
52
|
t5 = parentPageId != null ? String(parentPageId) : "";
|
|
49
53
|
t6 = disabled || !hasParentOptions;
|
|
50
|
-
if ($[
|
|
54
|
+
if ($[21] !== onParentPageIdChange) {
|
|
51
55
|
t7 = (value) => onParentPageIdChange(!value || ["", NO_PARENT_VALUE].includes(value) ? void 0 : Number(value));
|
|
52
|
-
$[
|
|
53
|
-
$[
|
|
54
|
-
} else t7 = $[
|
|
55
|
-
if ($[
|
|
56
|
+
$[21] = onParentPageIdChange;
|
|
57
|
+
$[22] = t7;
|
|
58
|
+
} else t7 = $[22];
|
|
59
|
+
if ($[23] === Symbol.for("react.memo_cache_sentinel")) {
|
|
56
60
|
t8 = /* @__PURE__ */ jsx(SelectTrigger, { children: /* @__PURE__ */ jsx(SelectValue, { placeholder: "No parent" }) });
|
|
57
|
-
$[
|
|
58
|
-
} else t8 = $[
|
|
61
|
+
$[23] = t8;
|
|
62
|
+
} else t8 = $[23];
|
|
59
63
|
T0 = SelectContent;
|
|
60
|
-
if ($[
|
|
64
|
+
if ($[24] === Symbol.for("react.memo_cache_sentinel")) {
|
|
61
65
|
t2 = /* @__PURE__ */ jsx(SelectItem, {
|
|
62
66
|
value: NO_PARENT_VALUE,
|
|
63
67
|
children: "No parent"
|
|
64
68
|
});
|
|
65
69
|
t3 = /* @__PURE__ */ jsx(SelectSeparator, {});
|
|
66
|
-
$[
|
|
67
|
-
$[
|
|
70
|
+
$[24] = t2;
|
|
71
|
+
$[25] = t3;
|
|
68
72
|
} else {
|
|
69
|
-
t2 = $[
|
|
70
|
-
t3 = $[
|
|
73
|
+
t2 = $[24];
|
|
74
|
+
t3 = $[25];
|
|
71
75
|
}
|
|
72
76
|
t4 = nonRootPages?.map(_temp);
|
|
73
|
-
$[
|
|
74
|
-
$[
|
|
75
|
-
$[
|
|
76
|
-
$[
|
|
77
|
-
$[
|
|
78
|
-
$[
|
|
79
|
-
$[
|
|
80
|
-
$[
|
|
81
|
-
$[
|
|
82
|
-
$[
|
|
83
|
-
$[
|
|
84
|
-
$[
|
|
85
|
-
$[
|
|
86
|
-
$[
|
|
87
|
-
$[
|
|
88
|
-
$[
|
|
77
|
+
$[4] = disabled;
|
|
78
|
+
$[5] = excludePageId;
|
|
79
|
+
$[6] = onParentPageIdChange;
|
|
80
|
+
$[7] = pages;
|
|
81
|
+
$[8] = parentPageId;
|
|
82
|
+
$[9] = T0;
|
|
83
|
+
$[10] = T1;
|
|
84
|
+
$[11] = t10;
|
|
85
|
+
$[12] = t2;
|
|
86
|
+
$[13] = t3;
|
|
87
|
+
$[14] = t4;
|
|
88
|
+
$[15] = t5;
|
|
89
|
+
$[16] = t6;
|
|
90
|
+
$[17] = t7;
|
|
91
|
+
$[18] = t8;
|
|
92
|
+
$[19] = t9;
|
|
89
93
|
} else {
|
|
90
|
-
T0 = $[
|
|
91
|
-
T1 = $[
|
|
92
|
-
t10 = $[
|
|
93
|
-
t2 = $[
|
|
94
|
-
t3 = $[
|
|
95
|
-
t4 = $[
|
|
96
|
-
t5 = $[
|
|
97
|
-
t6 = $[
|
|
98
|
-
t7 = $[
|
|
99
|
-
t8 = $[
|
|
100
|
-
t9 = $[
|
|
94
|
+
T0 = $[9];
|
|
95
|
+
T1 = $[10];
|
|
96
|
+
t10 = $[11];
|
|
97
|
+
t2 = $[12];
|
|
98
|
+
t3 = $[13];
|
|
99
|
+
t4 = $[14];
|
|
100
|
+
t5 = $[15];
|
|
101
|
+
t6 = $[16];
|
|
102
|
+
t7 = $[17];
|
|
103
|
+
t8 = $[18];
|
|
104
|
+
t9 = $[19];
|
|
101
105
|
}
|
|
102
106
|
let t11;
|
|
103
|
-
if ($[
|
|
107
|
+
if ($[26] !== T0 || $[27] !== t2 || $[28] !== t3 || $[29] !== t4) {
|
|
104
108
|
t11 = /* @__PURE__ */ jsxs(T0, { children: [
|
|
105
109
|
t2,
|
|
106
110
|
t3,
|
|
107
111
|
t4
|
|
108
112
|
] });
|
|
109
|
-
$[
|
|
110
|
-
$[
|
|
111
|
-
$[
|
|
112
|
-
$[
|
|
113
|
-
$[
|
|
114
|
-
} else t11 = $[
|
|
113
|
+
$[26] = T0;
|
|
114
|
+
$[27] = t2;
|
|
115
|
+
$[28] = t3;
|
|
116
|
+
$[29] = t4;
|
|
117
|
+
$[30] = t11;
|
|
118
|
+
} else t11 = $[30];
|
|
115
119
|
let t12;
|
|
116
|
-
if ($[
|
|
120
|
+
if ($[31] !== T1 || $[32] !== t11 || $[33] !== t5 || $[34] !== t6 || $[35] !== t7 || $[36] !== t8) {
|
|
117
121
|
t12 = /* @__PURE__ */ jsxs(T1, {
|
|
118
122
|
value: t5,
|
|
119
123
|
disabled: t6,
|
|
120
124
|
onValueChange: t7,
|
|
121
125
|
children: [t8, t11]
|
|
122
126
|
});
|
|
123
|
-
$[
|
|
124
|
-
$[
|
|
125
|
-
$[
|
|
126
|
-
$[
|
|
127
|
-
$[
|
|
128
|
-
$[
|
|
129
|
-
$[
|
|
130
|
-
} else t12 = $[
|
|
127
|
+
$[31] = T1;
|
|
128
|
+
$[32] = t11;
|
|
129
|
+
$[33] = t5;
|
|
130
|
+
$[34] = t6;
|
|
131
|
+
$[35] = t7;
|
|
132
|
+
$[36] = t8;
|
|
133
|
+
$[37] = t12;
|
|
134
|
+
} else t12 = $[37];
|
|
131
135
|
let t13;
|
|
132
|
-
if ($[
|
|
136
|
+
if ($[38] === Symbol.for("react.memo_cache_sentinel")) {
|
|
133
137
|
t13 = /* @__PURE__ */ jsx("p", {
|
|
134
138
|
className: "text-muted-foreground text-xs",
|
|
135
139
|
children: "Select a parent page to nest this page under it."
|
|
136
140
|
});
|
|
137
|
-
$[
|
|
138
|
-
} else t13 = $[
|
|
141
|
+
$[38] = t13;
|
|
142
|
+
} else t13 = $[38];
|
|
139
143
|
let t14;
|
|
140
|
-
if ($[
|
|
144
|
+
if ($[39] !== t10 || $[40] !== t12 || $[41] !== t9) {
|
|
141
145
|
t14 = /* @__PURE__ */ jsxs("div", {
|
|
142
146
|
className: t9,
|
|
143
147
|
children: [
|
|
@@ -146,37 +150,37 @@ const PageLocationFieldset = (t0) => {
|
|
|
146
150
|
t13
|
|
147
151
|
]
|
|
148
152
|
});
|
|
149
|
-
$[
|
|
150
|
-
$[
|
|
151
|
-
$[
|
|
152
|
-
$[
|
|
153
|
-
} else t14 = $[
|
|
153
|
+
$[39] = t10;
|
|
154
|
+
$[40] = t12;
|
|
155
|
+
$[41] = t9;
|
|
156
|
+
$[42] = t14;
|
|
157
|
+
} else t14 = $[42];
|
|
154
158
|
let t15;
|
|
155
|
-
if ($[
|
|
159
|
+
if ($[43] === Symbol.for("react.memo_cache_sentinel")) {
|
|
156
160
|
t15 = /* @__PURE__ */ jsx(Label, {
|
|
157
161
|
htmlFor: "pathSegment",
|
|
158
162
|
children: "Page path"
|
|
159
163
|
});
|
|
160
|
-
$[
|
|
161
|
-
} else t15 = $[
|
|
164
|
+
$[43] = t15;
|
|
165
|
+
} else t15 = $[43];
|
|
162
166
|
const t16 = getParentPath();
|
|
163
167
|
let t17;
|
|
164
|
-
if ($[
|
|
168
|
+
if ($[44] !== t16) {
|
|
165
169
|
t17 = /* @__PURE__ */ jsx(InputGroupAddon, { children: /* @__PURE__ */ jsx(InputGroupText, {
|
|
166
170
|
className: "px-2",
|
|
167
171
|
children: t16
|
|
168
172
|
}) });
|
|
169
|
-
$[
|
|
170
|
-
$[
|
|
171
|
-
} else t17 = $[
|
|
173
|
+
$[44] = t16;
|
|
174
|
+
$[45] = t17;
|
|
175
|
+
} else t17 = $[45];
|
|
172
176
|
let t18;
|
|
173
|
-
if ($[
|
|
177
|
+
if ($[46] !== onPathSegmentChange) {
|
|
174
178
|
t18 = (e) => onPathSegmentChange(e.target.value);
|
|
175
|
-
$[
|
|
176
|
-
$[
|
|
177
|
-
} else t18 = $[
|
|
179
|
+
$[46] = onPathSegmentChange;
|
|
180
|
+
$[47] = t18;
|
|
181
|
+
} else t18 = $[47];
|
|
178
182
|
let t19;
|
|
179
|
-
if ($[
|
|
183
|
+
if ($[48] !== autoFocusPathSegment || $[49] !== disabled || $[50] !== pathSegment || $[51] !== t18) {
|
|
180
184
|
t19 = /* @__PURE__ */ jsx(InputGroupInput, {
|
|
181
185
|
id: "pathSegment",
|
|
182
186
|
value: pathSegment,
|
|
@@ -185,29 +189,29 @@ const PageLocationFieldset = (t0) => {
|
|
|
185
189
|
placeholder: "e.g. pricing, about-us",
|
|
186
190
|
autoFocus: autoFocusPathSegment
|
|
187
191
|
});
|
|
188
|
-
$[
|
|
189
|
-
$[
|
|
190
|
-
$[
|
|
191
|
-
$[
|
|
192
|
-
$[
|
|
193
|
-
} else t19 = $[
|
|
192
|
+
$[48] = autoFocusPathSegment;
|
|
193
|
+
$[49] = disabled;
|
|
194
|
+
$[50] = pathSegment;
|
|
195
|
+
$[51] = t18;
|
|
196
|
+
$[52] = t19;
|
|
197
|
+
} else t19 = $[52];
|
|
194
198
|
let t20;
|
|
195
|
-
if ($[
|
|
199
|
+
if ($[53] !== t17 || $[54] !== t19) {
|
|
196
200
|
t20 = /* @__PURE__ */ jsxs(InputGroup, { children: [t17, t19] });
|
|
197
|
-
$[
|
|
198
|
-
$[
|
|
199
|
-
$[
|
|
200
|
-
} else t20 = $[
|
|
201
|
+
$[53] = t17;
|
|
202
|
+
$[54] = t19;
|
|
203
|
+
$[55] = t20;
|
|
204
|
+
} else t20 = $[55];
|
|
201
205
|
let t21;
|
|
202
|
-
if ($[
|
|
206
|
+
if ($[56] === Symbol.for("react.memo_cache_sentinel")) {
|
|
203
207
|
t21 = /* @__PURE__ */ jsx("p", {
|
|
204
208
|
className: "text-muted-foreground text-xs",
|
|
205
209
|
children: "Used to generate the page URL, along with the parent page."
|
|
206
210
|
});
|
|
207
|
-
$[
|
|
208
|
-
} else t21 = $[
|
|
211
|
+
$[56] = t21;
|
|
212
|
+
} else t21 = $[56];
|
|
209
213
|
let t22;
|
|
210
|
-
if ($[
|
|
214
|
+
if ($[57] !== t20) {
|
|
211
215
|
t22 = /* @__PURE__ */ jsxs("div", {
|
|
212
216
|
className: "space-y-2",
|
|
213
217
|
children: [
|
|
@@ -216,16 +220,16 @@ const PageLocationFieldset = (t0) => {
|
|
|
216
220
|
t21
|
|
217
221
|
]
|
|
218
222
|
});
|
|
219
|
-
$[
|
|
220
|
-
$[
|
|
221
|
-
} else t22 = $[
|
|
223
|
+
$[57] = t20;
|
|
224
|
+
$[58] = t22;
|
|
225
|
+
} else t22 = $[58];
|
|
222
226
|
let t23;
|
|
223
|
-
if ($[
|
|
227
|
+
if ($[59] !== t14 || $[60] !== t22) {
|
|
224
228
|
t23 = /* @__PURE__ */ jsxs(Fragment, { children: [t14, t22] });
|
|
225
|
-
$[
|
|
226
|
-
$[
|
|
227
|
-
$[
|
|
228
|
-
} else t23 = $[
|
|
229
|
+
$[59] = t14;
|
|
230
|
+
$[60] = t22;
|
|
231
|
+
$[61] = t23;
|
|
232
|
+
} else t23 = $[61];
|
|
229
233
|
return t23;
|
|
230
234
|
};
|
|
231
235
|
function _temp(page_1) {
|
|
@@ -39,7 +39,7 @@ const PagePicker = () => {
|
|
|
39
39
|
try {
|
|
40
40
|
await deletePage.mutateAsync({ id: page.id });
|
|
41
41
|
toast.success(`Deleted ${displayName} page`);
|
|
42
|
-
if (pathname === page.fullPath) navigate({ to: "/" });
|
|
42
|
+
if (pathname === page.fullPath) await navigate({ to: "/" });
|
|
43
43
|
} catch (error) {
|
|
44
44
|
console.error("Failed to delete page:", error);
|
|
45
45
|
toast.error(`Could not delete ${displayName} page`);
|