camox 0.9.0 → 0.10.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/lexical/SidebarLexicalEditor.js +2 -1
- package/dist/core/createApp.d.ts +231 -209
- package/dist/core/createApp.js +17 -17
- package/dist/core/createBlock.d.ts +74 -72
- package/dist/core/createBlock.js +274 -267
- package/dist/core/createLayout.d.ts +100 -80
- package/dist/core/createLayout.js +93 -65
- package/dist/features/preview/CamoxPreview.js +76 -54
- package/dist/features/preview/components/AddBlockSheet.js +12 -12
- package/dist/features/preview/components/AssetFieldEditor.js +1 -1
- package/dist/features/preview/components/AssetLightbox.js +1 -1
- package/dist/features/preview/components/AssetPickerGrid.js +1 -1
- package/dist/features/preview/components/BlockActionsPopover.js +26 -26
- package/dist/features/preview/components/BlockErrorBoundary.js +59 -0
- package/dist/features/preview/components/{CreatePageSheet.js → CreatePageModal.js} +16 -18
- package/dist/features/preview/components/{EditPageSheet.js → EditPageModal.js} +32 -25
- package/dist/features/preview/components/Frame.js +1 -1
- package/dist/features/preview/components/ItemFieldsEditor.js +134 -98
- package/dist/features/preview/components/LinkFieldEditor.js +166 -146
- package/dist/features/preview/components/PageContentSheet.js +42 -37
- package/dist/features/preview/components/PageLocationFieldset.js +28 -26
- package/dist/features/preview/components/PagePicker.js +15 -8
- package/dist/features/preview/components/PageTree.js +337 -351
- package/dist/features/preview/components/PeekedBlock.js +38 -26
- package/dist/features/preview/components/PreviewPanel.js +16 -2
- package/dist/features/preview/components/PreviewSideSheet.js +26 -42
- package/dist/features/preview/components/RepeatableItemsList.js +7 -7
- package/dist/features/preview/previewStore.js +7 -7
- package/dist/features/provider/CamoxProvider.js +41 -9
- package/dist/features/routes/ogRoute.js +2 -2
- package/dist/features/routes/pageRoute.js +1 -1
- package/dist/features/studio/components/EnvironmentMenu.js +2 -2
- package/dist/features/studio/components/UserButton.js +49 -34
- package/dist/features/vite/blockBoilerplate.js +2 -1
- package/dist/features/vite/definitionsSync.js +53 -22
- package/dist/features/vite/routeGeneration.js +1 -0
- package/dist/features/vite/vite.js +51 -7
- package/dist/lib/auth.js +6 -4
- package/dist/lib/use-project-room.js +25 -13
- package/dist/studio-overlays.css +34 -0
- package/dist/studio.css +1 -1
- package/package.json +4 -4
- package/skills/camox-layout/SKILL.md +34 -30
|
@@ -8,8 +8,8 @@ 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(
|
|
12
|
-
const { parentPageId, onParentPageIdChange, pathSegment, onPathSegmentChange, disabled, pages, excludePageId } = t0;
|
|
11
|
+
const $ = c(61);
|
|
12
|
+
const { parentPageId, onParentPageIdChange, pathSegment, onPathSegmentChange, disabled, pages, excludePageId, autoFocusPathSegment } = t0;
|
|
13
13
|
let t1;
|
|
14
14
|
if ($[0] !== pages || $[1] !== parentPageId) {
|
|
15
15
|
t1 = () => {
|
|
@@ -176,36 +176,38 @@ const PageLocationFieldset = (t0) => {
|
|
|
176
176
|
$[46] = t18;
|
|
177
177
|
} else t18 = $[46];
|
|
178
178
|
let t19;
|
|
179
|
-
if ($[47] !==
|
|
179
|
+
if ($[47] !== autoFocusPathSegment || $[48] !== disabled || $[49] !== pathSegment || $[50] !== t18) {
|
|
180
180
|
t19 = /* @__PURE__ */ jsx(InputGroupInput, {
|
|
181
181
|
id: "pathSegment",
|
|
182
182
|
value: pathSegment,
|
|
183
183
|
disabled,
|
|
184
184
|
onChange: t18,
|
|
185
|
-
placeholder: "e.g. pricing, about-us"
|
|
185
|
+
placeholder: "e.g. pricing, about-us",
|
|
186
|
+
autoFocus: autoFocusPathSegment
|
|
186
187
|
});
|
|
187
|
-
$[47] =
|
|
188
|
-
$[48] =
|
|
189
|
-
$[49] =
|
|
190
|
-
$[50] =
|
|
191
|
-
|
|
188
|
+
$[47] = autoFocusPathSegment;
|
|
189
|
+
$[48] = disabled;
|
|
190
|
+
$[49] = pathSegment;
|
|
191
|
+
$[50] = t18;
|
|
192
|
+
$[51] = t19;
|
|
193
|
+
} else t19 = $[51];
|
|
192
194
|
let t20;
|
|
193
|
-
if ($[
|
|
195
|
+
if ($[52] !== t17 || $[53] !== t19) {
|
|
194
196
|
t20 = /* @__PURE__ */ jsxs(InputGroup, { children: [t17, t19] });
|
|
195
|
-
$[
|
|
196
|
-
$[
|
|
197
|
-
$[
|
|
198
|
-
} else t20 = $[
|
|
197
|
+
$[52] = t17;
|
|
198
|
+
$[53] = t19;
|
|
199
|
+
$[54] = t20;
|
|
200
|
+
} else t20 = $[54];
|
|
199
201
|
let t21;
|
|
200
|
-
if ($[
|
|
202
|
+
if ($[55] === Symbol.for("react.memo_cache_sentinel")) {
|
|
201
203
|
t21 = /* @__PURE__ */ jsx("p", {
|
|
202
204
|
className: "text-muted-foreground text-xs",
|
|
203
205
|
children: "Used to generate the page URL, along with the parent page."
|
|
204
206
|
});
|
|
205
|
-
$[
|
|
206
|
-
} else t21 = $[
|
|
207
|
+
$[55] = t21;
|
|
208
|
+
} else t21 = $[55];
|
|
207
209
|
let t22;
|
|
208
|
-
if ($[
|
|
210
|
+
if ($[56] !== t20) {
|
|
209
211
|
t22 = /* @__PURE__ */ jsxs("div", {
|
|
210
212
|
className: "space-y-2",
|
|
211
213
|
children: [
|
|
@@ -214,16 +216,16 @@ const PageLocationFieldset = (t0) => {
|
|
|
214
216
|
t21
|
|
215
217
|
]
|
|
216
218
|
});
|
|
217
|
-
$[
|
|
218
|
-
$[
|
|
219
|
-
} else t22 = $[
|
|
219
|
+
$[56] = t20;
|
|
220
|
+
$[57] = t22;
|
|
221
|
+
} else t22 = $[57];
|
|
220
222
|
let t23;
|
|
221
|
-
if ($[
|
|
223
|
+
if ($[58] !== t14 || $[59] !== t22) {
|
|
222
224
|
t23 = /* @__PURE__ */ jsxs(Fragment, { children: [t14, t22] });
|
|
223
|
-
$[
|
|
224
|
-
$[
|
|
225
|
-
$[
|
|
226
|
-
} else t23 = $[
|
|
225
|
+
$[58] = t14;
|
|
226
|
+
$[59] = t22;
|
|
227
|
+
$[60] = t23;
|
|
228
|
+
} else t23 = $[60];
|
|
227
229
|
return t23;
|
|
228
230
|
};
|
|
229
231
|
function _temp(page_1) {
|
|
@@ -30,6 +30,10 @@ const PagePicker = () => {
|
|
|
30
30
|
});
|
|
31
31
|
const { pathname } = useLocation();
|
|
32
32
|
const navigate = useNavigate();
|
|
33
|
+
const closePopover = () => {
|
|
34
|
+
previewStore.send({ type: "clearPeekedPage" });
|
|
35
|
+
setOpen(false);
|
|
36
|
+
};
|
|
33
37
|
const handleDeletePage = async (page) => {
|
|
34
38
|
const displayName = page.metaTitle ?? formatPathSegment(page.pathSegment);
|
|
35
39
|
try {
|
|
@@ -54,7 +58,10 @@ const PagePicker = () => {
|
|
|
54
58
|
return /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsxs(Popover, {
|
|
55
59
|
open,
|
|
56
60
|
onOpenChange: (value) => {
|
|
57
|
-
|
|
61
|
+
if (!value) {
|
|
62
|
+
closePopover();
|
|
63
|
+
return;
|
|
64
|
+
}
|
|
58
65
|
setOpen(value);
|
|
59
66
|
},
|
|
60
67
|
children: [/* @__PURE__ */ jsxs(PopoverTrigger, {
|
|
@@ -97,7 +104,7 @@ const PagePicker = () => {
|
|
|
97
104
|
hideCheck: true,
|
|
98
105
|
onSelect: () => {
|
|
99
106
|
navigate({ to: page_1.fullPath });
|
|
100
|
-
|
|
107
|
+
closePopover();
|
|
101
108
|
},
|
|
102
109
|
children: [/* @__PURE__ */ jsxs("div", {
|
|
103
110
|
className: "flex min-w-0 flex-1 items-start gap-2",
|
|
@@ -119,20 +126,20 @@ const PagePicker = () => {
|
|
|
119
126
|
onClick: (e) => {
|
|
120
127
|
e.stopPropagation();
|
|
121
128
|
previewStore.send({
|
|
122
|
-
type: "
|
|
129
|
+
type: "openEditPageModal",
|
|
123
130
|
pageId: page_1.id
|
|
124
131
|
});
|
|
125
|
-
|
|
132
|
+
closePopover();
|
|
126
133
|
},
|
|
127
134
|
onKeyDown: (e_0) => {
|
|
128
135
|
if (e_0.key === "Enter" || e_0.key === " ") {
|
|
129
136
|
e_0.preventDefault();
|
|
130
137
|
e_0.stopPropagation();
|
|
131
138
|
previewStore.send({
|
|
132
|
-
type: "
|
|
139
|
+
type: "openEditPageModal",
|
|
133
140
|
pageId: page_1.id
|
|
134
141
|
});
|
|
135
|
-
|
|
142
|
+
closePopover();
|
|
136
143
|
}
|
|
137
144
|
},
|
|
138
145
|
children: /* @__PURE__ */ jsx(Pencil, { className: "size-4" })
|
|
@@ -158,8 +165,8 @@ const PagePicker = () => {
|
|
|
158
165
|
/* @__PURE__ */ jsx(CommandSeparator, {}),
|
|
159
166
|
/* @__PURE__ */ jsx(CommandGroup, { children: /* @__PURE__ */ jsxs(CommandItem, {
|
|
160
167
|
onSelect: () => {
|
|
161
|
-
|
|
162
|
-
previewStore.send({ type: "
|
|
168
|
+
closePopover();
|
|
169
|
+
previewStore.send({ type: "openCreatePageModal" });
|
|
163
170
|
},
|
|
164
171
|
value: CREATE_PAGE_VALUE,
|
|
165
172
|
children: [/* @__PURE__ */ jsx(Plus, { className: "size-4" }), "Create page"]
|