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.
Files changed (75) hide show
  1. package/dist/components/AuthGate.js +6 -0
  2. package/dist/core/components/AddBlockControlBar.js +30 -26
  3. package/dist/core/components/lexical/InlineContentEditable.js +19 -15
  4. package/dist/core/components/lexical/InlineLexicalEditor.js +62 -42
  5. package/dist/core/components/lexical/SelectionBroadcaster.js +25 -21
  6. package/dist/core/components/lexical/SidebarLexicalEditor.js +33 -21
  7. package/dist/core/createBlock.js +524 -488
  8. package/dist/core/createLayout.js +40 -28
  9. package/dist/core/hooks/useFieldSelection.js +12 -8
  10. package/dist/core/hooks/useIsEditable.js +6 -0
  11. package/dist/core/hooks/useOverlayMessage.js +19 -15
  12. package/dist/core/lib/contentType.d.ts +8 -8
  13. package/dist/core/lib/contentType.js +63 -0
  14. package/dist/features/content/CamoxContent.js +92 -88
  15. package/dist/features/content/components/AssetCard.js +46 -42
  16. package/dist/features/content/components/AssetCardSkeleton.js +8 -4
  17. package/dist/features/content/components/ContentSidebar.js +8 -4
  18. package/dist/features/content/components/UploadDropZone.js +31 -27
  19. package/dist/features/content/components/UploadProgressDrawer.js +98 -90
  20. package/dist/features/preview/CamoxPreview.js +162 -146
  21. package/dist/features/preview/components/AddBlockSheet.js +105 -101
  22. package/dist/features/preview/components/AgentChatSheet.js +74 -21
  23. package/dist/features/preview/components/AssetFieldEditor.js +98 -90
  24. package/dist/features/preview/components/AssetLightbox.js +21 -17
  25. package/dist/features/preview/components/AssetPickerGrid.js +84 -80
  26. package/dist/features/preview/components/BlockActionsPopover.js +35 -31
  27. package/dist/features/preview/components/BlockErrorBoundary.js +12 -8
  28. package/dist/features/preview/components/CreatePageModal.js +1 -1
  29. package/dist/features/preview/components/DebouncedFieldEditor.js +41 -37
  30. package/dist/features/preview/components/EditPageModal.js +114 -98
  31. package/dist/features/preview/components/FieldOverlayStyles.js +8 -4
  32. package/dist/features/preview/components/FieldToolbar.js +95 -54
  33. package/dist/features/preview/components/Frame.js +50 -46
  34. package/dist/features/preview/components/ItemFieldsEditor.js +81 -79
  35. package/dist/features/preview/components/LinkFieldEditor.js +138 -134
  36. package/dist/features/preview/components/MultipleAssetFieldEditor.js +105 -97
  37. package/dist/features/preview/components/OverlayTracker.js +19 -15
  38. package/dist/features/preview/components/Overlays.js +27 -23
  39. package/dist/features/preview/components/PageContentSheet.js +54 -4
  40. package/dist/features/preview/components/PageLocationFieldset.js +113 -109
  41. package/dist/features/preview/components/PagePicker.js +1 -1
  42. package/dist/features/preview/components/PageTree.js +443 -399
  43. package/dist/features/preview/components/PeekedBlock.js +69 -65
  44. package/dist/features/preview/components/PreviewPanel.js +64 -52
  45. package/dist/features/preview/components/PreviewSideSheet.js +25 -16
  46. package/dist/features/preview/components/PreviewToolbar.js +127 -123
  47. package/dist/features/preview/components/RepeatableItemsList.js +176 -171
  48. package/dist/features/preview/components/ShikiMarkdown.js +18 -14
  49. package/dist/features/preview/components/UnlinkAssetButton.js +74 -70
  50. package/dist/features/preview/components/useRepeatableItemActions.js +266 -0
  51. package/dist/features/preview/components/useUpdateBlockPosition.js +13 -9
  52. package/dist/features/provider/CamoxProvider.js +60 -52
  53. package/dist/features/provider/components/CamoxAppContext.js +10 -6
  54. package/dist/features/provider/components/CommandPalette.js +77 -69
  55. package/dist/features/provider/useAdminShortcuts.js +11 -7
  56. package/dist/features/routes/pageRoute.js +8 -4
  57. package/dist/features/studio/CamoxStudio.js +23 -19
  58. package/dist/features/studio/components/EnvironmentMenu.js +32 -28
  59. package/dist/features/studio/components/Navbar.js +62 -54
  60. package/dist/features/studio/components/ProjectMenu.js +131 -123
  61. package/dist/features/studio/components/UserButton.js +15 -11
  62. package/dist/features/studio/useTheme.js +82 -42
  63. package/dist/features/vite/definitionsSync.js +5 -5
  64. package/dist/features/vite/skillGeneration.js +43 -8
  65. package/dist/features/vite/vite.d.ts +1 -1
  66. package/dist/features/vite/vite.js +20 -2
  67. package/dist/hooks/use-marquee-selection.js +36 -32
  68. package/dist/lib/auth.js +49 -22
  69. package/dist/lib/normalized-data.js +55 -47
  70. package/dist/lib/use-project-room.js +22 -18
  71. package/dist/studio.css +1 -1
  72. package/package.json +10 -11
  73. package/skills/camox-block/SKILL.md +4 -0
  74. package/skills/camox-cli/SKILL.md +142 -0
  75. 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(61);
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 ($[0] !== pages || $[1] !== parentPageId) {
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
- $[0] = pages;
21
- $[1] = parentPageId;
22
- $[2] = t1;
23
- } else t1 = $[2];
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 ($[3] !== disabled || $[4] !== excludePageId || $[5] !== onParentPageIdChange || $[6] !== pages || $[7] !== parentPageId) {
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 ($[19] === Symbol.for("react.memo_cache_sentinel")) {
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
- $[19] = t10;
46
- } else t10 = $[19];
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 ($[20] !== onParentPageIdChange) {
54
+ if ($[21] !== onParentPageIdChange) {
51
55
  t7 = (value) => onParentPageIdChange(!value || ["", NO_PARENT_VALUE].includes(value) ? void 0 : Number(value));
52
- $[20] = onParentPageIdChange;
53
- $[21] = t7;
54
- } else t7 = $[21];
55
- if ($[22] === Symbol.for("react.memo_cache_sentinel")) {
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
- $[22] = t8;
58
- } else t8 = $[22];
61
+ $[23] = t8;
62
+ } else t8 = $[23];
59
63
  T0 = SelectContent;
60
- if ($[23] === Symbol.for("react.memo_cache_sentinel")) {
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
- $[23] = t2;
67
- $[24] = t3;
70
+ $[24] = t2;
71
+ $[25] = t3;
68
72
  } else {
69
- t2 = $[23];
70
- t3 = $[24];
73
+ t2 = $[24];
74
+ t3 = $[25];
71
75
  }
72
76
  t4 = nonRootPages?.map(_temp);
73
- $[3] = disabled;
74
- $[4] = excludePageId;
75
- $[5] = onParentPageIdChange;
76
- $[6] = pages;
77
- $[7] = parentPageId;
78
- $[8] = T0;
79
- $[9] = T1;
80
- $[10] = t10;
81
- $[11] = t2;
82
- $[12] = t3;
83
- $[13] = t4;
84
- $[14] = t5;
85
- $[15] = t6;
86
- $[16] = t7;
87
- $[17] = t8;
88
- $[18] = t9;
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 = $[8];
91
- T1 = $[9];
92
- t10 = $[10];
93
- t2 = $[11];
94
- t3 = $[12];
95
- t4 = $[13];
96
- t5 = $[14];
97
- t6 = $[15];
98
- t7 = $[16];
99
- t8 = $[17];
100
- t9 = $[18];
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 ($[25] !== T0 || $[26] !== t2 || $[27] !== t3 || $[28] !== t4) {
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
- $[25] = T0;
110
- $[26] = t2;
111
- $[27] = t3;
112
- $[28] = t4;
113
- $[29] = t11;
114
- } else t11 = $[29];
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 ($[30] !== T1 || $[31] !== t11 || $[32] !== t5 || $[33] !== t6 || $[34] !== t7 || $[35] !== t8) {
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
- $[30] = T1;
124
- $[31] = t11;
125
- $[32] = t5;
126
- $[33] = t6;
127
- $[34] = t7;
128
- $[35] = t8;
129
- $[36] = t12;
130
- } else t12 = $[36];
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 ($[37] === Symbol.for("react.memo_cache_sentinel")) {
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
- $[37] = t13;
138
- } else t13 = $[37];
141
+ $[38] = t13;
142
+ } else t13 = $[38];
139
143
  let t14;
140
- if ($[38] !== t10 || $[39] !== t12 || $[40] !== t9) {
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
- $[38] = t10;
150
- $[39] = t12;
151
- $[40] = t9;
152
- $[41] = t14;
153
- } else t14 = $[41];
153
+ $[39] = t10;
154
+ $[40] = t12;
155
+ $[41] = t9;
156
+ $[42] = t14;
157
+ } else t14 = $[42];
154
158
  let t15;
155
- if ($[42] === Symbol.for("react.memo_cache_sentinel")) {
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
- $[42] = t15;
161
- } else t15 = $[42];
164
+ $[43] = t15;
165
+ } else t15 = $[43];
162
166
  const t16 = getParentPath();
163
167
  let t17;
164
- if ($[43] !== t16) {
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
- $[43] = t16;
170
- $[44] = t17;
171
- } else t17 = $[44];
173
+ $[44] = t16;
174
+ $[45] = t17;
175
+ } else t17 = $[45];
172
176
  let t18;
173
- if ($[45] !== onPathSegmentChange) {
177
+ if ($[46] !== onPathSegmentChange) {
174
178
  t18 = (e) => onPathSegmentChange(e.target.value);
175
- $[45] = onPathSegmentChange;
176
- $[46] = t18;
177
- } else t18 = $[46];
179
+ $[46] = onPathSegmentChange;
180
+ $[47] = t18;
181
+ } else t18 = $[47];
178
182
  let t19;
179
- if ($[47] !== autoFocusPathSegment || $[48] !== disabled || $[49] !== pathSegment || $[50] !== t18) {
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
- $[47] = autoFocusPathSegment;
189
- $[48] = disabled;
190
- $[49] = pathSegment;
191
- $[50] = t18;
192
- $[51] = t19;
193
- } else t19 = $[51];
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 ($[52] !== t17 || $[53] !== t19) {
199
+ if ($[53] !== t17 || $[54] !== t19) {
196
200
  t20 = /* @__PURE__ */ jsxs(InputGroup, { children: [t17, t19] });
197
- $[52] = t17;
198
- $[53] = t19;
199
- $[54] = t20;
200
- } else t20 = $[54];
201
+ $[53] = t17;
202
+ $[54] = t19;
203
+ $[55] = t20;
204
+ } else t20 = $[55];
201
205
  let t21;
202
- if ($[55] === Symbol.for("react.memo_cache_sentinel")) {
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
- $[55] = t21;
208
- } else t21 = $[55];
211
+ $[56] = t21;
212
+ } else t21 = $[56];
209
213
  let t22;
210
- if ($[56] !== t20) {
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
- $[56] = t20;
220
- $[57] = t22;
221
- } else t22 = $[57];
223
+ $[57] = t20;
224
+ $[58] = t22;
225
+ } else t22 = $[58];
222
226
  let t23;
223
- if ($[58] !== t14 || $[59] !== t22) {
227
+ if ($[59] !== t14 || $[60] !== t22) {
224
228
  t23 = /* @__PURE__ */ jsxs(Fragment, { children: [t14, t22] });
225
- $[58] = t14;
226
- $[59] = t22;
227
- $[60] = t23;
228
- } else t23 = $[60];
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`);