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.
Files changed (43) hide show
  1. package/dist/core/components/lexical/SidebarLexicalEditor.js +2 -1
  2. package/dist/core/createApp.d.ts +231 -209
  3. package/dist/core/createApp.js +17 -17
  4. package/dist/core/createBlock.d.ts +74 -72
  5. package/dist/core/createBlock.js +386 -363
  6. package/dist/core/createLayout.d.ts +100 -80
  7. package/dist/core/createLayout.js +93 -65
  8. package/dist/features/preview/CamoxPreview.js +76 -54
  9. package/dist/features/preview/components/AddBlockSheet.js +13 -13
  10. package/dist/features/preview/components/AssetFieldEditor.js +1 -1
  11. package/dist/features/preview/components/AssetLightbox.js +1 -1
  12. package/dist/features/preview/components/AssetPickerGrid.js +1 -1
  13. package/dist/features/preview/components/BlockActionsPopover.js +26 -26
  14. package/dist/features/preview/components/BlockErrorBoundary.js +59 -0
  15. package/dist/features/preview/components/{CreatePageSheet.js → CreatePageModal.js} +17 -19
  16. package/dist/features/preview/components/{EditPageSheet.js → EditPageModal.js} +27 -24
  17. package/dist/features/preview/components/Frame.js +1 -1
  18. package/dist/features/preview/components/ItemFieldsEditor.js +134 -98
  19. package/dist/features/preview/components/LinkFieldEditor.js +166 -146
  20. package/dist/features/preview/components/PageContentSheet.js +42 -37
  21. package/dist/features/preview/components/PageLocationFieldset.js +28 -26
  22. package/dist/features/preview/components/PagePicker.js +4 -4
  23. package/dist/features/preview/components/PageTree.js +337 -351
  24. package/dist/features/preview/components/PeekedBlock.js +38 -26
  25. package/dist/features/preview/components/PreviewPanel.js +16 -2
  26. package/dist/features/preview/components/PreviewSideSheet.js +26 -42
  27. package/dist/features/preview/components/RepeatableItemsList.js +7 -7
  28. package/dist/features/preview/components/useUpdateBlockPosition.js +1 -1
  29. package/dist/features/preview/previewStore.js +7 -7
  30. package/dist/features/provider/CamoxProvider.js +1 -1
  31. package/dist/features/routes/ogRoute.js +2 -2
  32. package/dist/features/routes/pageRoute.js +5 -4
  33. package/dist/features/studio/CamoxStudio.js +1 -1
  34. package/dist/features/studio/components/Navbar.js +1 -1
  35. package/dist/features/studio/components/ProjectMenu.js +1 -1
  36. package/dist/features/studio/components/UserButton.js +46 -30
  37. package/dist/features/vite/definitionsSync.js +20 -20
  38. package/dist/features/vite/routeGeneration.js +1 -0
  39. package/dist/features/vite/vite.js +51 -7
  40. package/dist/studio-overlays.css +34 -0
  41. package/dist/studio.css +1 -1
  42. package/package.json +4 -4
  43. 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(60);
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] !== disabled || $[48] !== pathSegment || $[49] !== t18) {
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] = disabled;
188
- $[48] = pathSegment;
189
- $[49] = t18;
190
- $[50] = t19;
191
- } else t19 = $[50];
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 ($[51] !== t17 || $[52] !== t19) {
195
+ if ($[52] !== t17 || $[53] !== t19) {
194
196
  t20 = /* @__PURE__ */ jsxs(InputGroup, { children: [t17, t19] });
195
- $[51] = t17;
196
- $[52] = t19;
197
- $[53] = t20;
198
- } else t20 = $[53];
197
+ $[52] = t17;
198
+ $[53] = t19;
199
+ $[54] = t20;
200
+ } else t20 = $[54];
199
201
  let t21;
200
- if ($[54] === Symbol.for("react.memo_cache_sentinel")) {
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
- $[54] = t21;
206
- } else t21 = $[54];
207
+ $[55] = t21;
208
+ } else t21 = $[55];
207
209
  let t22;
208
- if ($[55] !== t20) {
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
- $[55] = t20;
218
- $[56] = t22;
219
- } else t22 = $[56];
219
+ $[56] = t20;
220
+ $[57] = t22;
221
+ } else t22 = $[57];
220
222
  let t23;
221
- if ($[57] !== t14 || $[58] !== t22) {
223
+ if ($[58] !== t14 || $[59] !== t22) {
222
224
  t23 = /* @__PURE__ */ jsxs(Fragment, { children: [t14, t22] });
223
- $[57] = t14;
224
- $[58] = t22;
225
- $[59] = t23;
226
- } else t23 = $[59];
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: "openEditPageSheet",
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: "openEditPageSheet",
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: "openCreatePageSheet" });
169
+ previewStore.send({ type: "openCreatePageModal" });
170
170
  },
171
171
  value: CREATE_PAGE_VALUE,
172
172
  children: [/* @__PURE__ */ jsx(Plus, { className: "size-4" }), "Create page"]