camox 0.9.1 → 0.10.1
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 +386 -363
- 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 +13 -13
- 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} +17 -19
- package/dist/features/preview/components/{EditPageSheet.js → EditPageModal.js} +27 -24
- 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 +4 -4
- 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/components/useUpdateBlockPosition.js +1 -1
- package/dist/features/preview/previewStore.js +7 -7
- package/dist/features/provider/CamoxProvider.js +1 -1
- package/dist/features/routes/ogRoute.js +2 -2
- package/dist/features/routes/pageRoute.js +5 -4
- package/dist/features/studio/CamoxStudio.js +1 -1
- package/dist/features/studio/components/Navbar.js +1 -1
- package/dist/features/studio/components/ProjectMenu.js +1 -1
- package/dist/features/studio/components/UserButton.js +46 -30
- package/dist/features/vite/definitionsSync.js +20 -20
- package/dist/features/vite/routeGeneration.js +1 -0
- package/dist/features/vite/vite.js +51 -7
- 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) {
|
|
@@ -5,11 +5,11 @@ import { cn, formatPathSegment } from "../../../lib/utils.js";
|
|
|
5
5
|
import { Popover, PopoverContent, PopoverTrigger } from "@camox/ui/popover";
|
|
6
6
|
import { toast } from "@camox/ui/toaster";
|
|
7
7
|
import { useMutation, useQuery } from "@tanstack/react-query";
|
|
8
|
+
import { useLocation, useNavigate } from "@tanstack/react-router";
|
|
8
9
|
import { useSelector } from "@xstate/store/react";
|
|
9
10
|
import * as React from "react";
|
|
10
11
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
11
12
|
import { Button } from "@camox/ui/button";
|
|
12
|
-
import { useLocation, useNavigate } from "@tanstack/react-router";
|
|
13
13
|
import { Check, ChevronsUpDown, Pencil, Plus, Trash2 } from "lucide-react";
|
|
14
14
|
import { Skeleton } from "@camox/ui/skeleton";
|
|
15
15
|
import { Command, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator } from "@camox/ui/command";
|
|
@@ -126,7 +126,7 @@ const PagePicker = () => {
|
|
|
126
126
|
onClick: (e) => {
|
|
127
127
|
e.stopPropagation();
|
|
128
128
|
previewStore.send({
|
|
129
|
-
type: "
|
|
129
|
+
type: "openEditPageModal",
|
|
130
130
|
pageId: page_1.id
|
|
131
131
|
});
|
|
132
132
|
closePopover();
|
|
@@ -136,7 +136,7 @@ const PagePicker = () => {
|
|
|
136
136
|
e_0.preventDefault();
|
|
137
137
|
e_0.stopPropagation();
|
|
138
138
|
previewStore.send({
|
|
139
|
-
type: "
|
|
139
|
+
type: "openEditPageModal",
|
|
140
140
|
pageId: page_1.id
|
|
141
141
|
});
|
|
142
142
|
closePopover();
|
|
@@ -166,7 +166,7 @@ const PagePicker = () => {
|
|
|
166
166
|
/* @__PURE__ */ jsx(CommandGroup, { children: /* @__PURE__ */ jsxs(CommandItem, {
|
|
167
167
|
onSelect: () => {
|
|
168
168
|
closePopover();
|
|
169
|
-
previewStore.send({ type: "
|
|
169
|
+
previewStore.send({ type: "openCreatePageModal" });
|
|
170
170
|
},
|
|
171
171
|
value: CREATE_PAGE_VALUE,
|
|
172
172
|
children: [/* @__PURE__ */ jsx(Plus, { className: "size-4" }), "Create page"]
|