camox 0.27.0 → 0.28.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.
@@ -18,9 +18,9 @@ import { PanelContent } from "@camox/ui/panel";
18
18
  //#region src/features/preview/components/PreviewPanel.tsx
19
19
  const PreviewFrame = (t0) => {
20
20
  const $ = c(9);
21
- if ($[0] !== "0ff00f7e0a48a9512a0a40e1f9f3e978f0fd159929e643b5036b8a98b2f79fe4") {
21
+ if ($[0] !== "d799d12f8899aeada62843d5bb83029c25038cd1566b1870e63b1f293c26d992") {
22
22
  for (let $i = 0; $i < 9; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
23
- $[0] = "0ff00f7e0a48a9512a0a40e1f9f3e978f0fd159929e643b5036b8a98b2f79fe4";
23
+ $[0] = "d799d12f8899aeada62843d5bb83029c25038cd1566b1870e63b1f293c26d992";
24
24
  }
25
25
  const { children, style, className, onIframeReady } = t0;
26
26
  let t1;
@@ -61,9 +61,9 @@ const PreviewFrame = (t0) => {
61
61
  };
62
62
  const KeyDownForwarder = () => {
63
63
  const $ = c(5);
64
- if ($[0] !== "0ff00f7e0a48a9512a0a40e1f9f3e978f0fd159929e643b5036b8a98b2f79fe4") {
64
+ if ($[0] !== "d799d12f8899aeada62843d5bb83029c25038cd1566b1870e63b1f293c26d992") {
65
65
  for (let $i = 0; $i < 5; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
66
- $[0] = "0ff00f7e0a48a9512a0a40e1f9f3e978f0fd159929e643b5036b8a98b2f79fe4";
66
+ $[0] = "d799d12f8899aeada62843d5bb83029c25038cd1566b1870e63b1f293c26d992";
67
67
  }
68
68
  const { window: iframeWindow } = useFrame();
69
69
  const actions = useSelector(actionsStore, _temp);
@@ -119,17 +119,16 @@ const KeyDownForwarder = () => {
119
119
  return null;
120
120
  };
121
121
  const PreviewPanel = (t0) => {
122
- const $ = c(16);
123
- if ($[0] !== "0ff00f7e0a48a9512a0a40e1f9f3e978f0fd159929e643b5036b8a98b2f79fe4") {
124
- for (let $i = 0; $i < 16; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
125
- $[0] = "0ff00f7e0a48a9512a0a40e1f9f3e978f0fd159929e643b5036b8a98b2f79fe4";
122
+ const $ = c(14);
123
+ if ($[0] !== "d799d12f8899aeada62843d5bb83029c25038cd1566b1870e63b1f293c26d992") {
124
+ for (let $i = 0; $i < 14; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
125
+ $[0] = "d799d12f8899aeada62843d5bb83029c25038cd1566b1870e63b1f293c26d992";
126
126
  }
127
127
  const { children } = t0;
128
128
  useBlockActionsShortcuts();
129
129
  const iframeElement = useSelector(previewStore, _temp2);
130
130
  const handleIframeReady = _temp3;
131
131
  const isMobileMode = useSelector(previewStore, _temp4);
132
- const isAgentChatSheetOpen = useSelector(previewStore, _temp5);
133
132
  const isAnySideSheetOpen = useIsPreviewSheetOpen();
134
133
  const wrapperRef = React.useRef(null);
135
134
  const [panelWidth, setPanelWidth] = React.useState(0);
@@ -161,92 +160,27 @@ const PreviewPanel = (t0) => {
161
160
  const sheetOverlap = Math.max(0, 400 - panelLeft);
162
161
  const sheetOpenScale = panelWidth > 0 ? (panelWidth - sheetOverlap) / panelWidth : 1;
163
162
  let t3;
164
- let t4;
165
- if ($[3] !== isAgentChatSheetOpen) {
166
- t3 = () => {
167
- const actions = [
168
- {
169
- id: "toggle-editing-panel",
170
- label: "Toggle editing panel",
171
- groupLabel: "Preview",
172
- checkIfAvailable: _temp6,
173
- execute: _temp7,
174
- shortcut: {
175
- key: "b",
176
- withAlt: true
177
- }
178
- },
179
- {
180
- id: "toggle-lock-content",
181
- label: "Toggle lock content",
182
- groupLabel: "Preview",
183
- checkIfAvailable: _temp8,
184
- execute: _temp9
185
- },
186
- {
187
- id: "toggle-mobile-mode",
188
- label: "Toggle mobile mode",
189
- groupLabel: "Preview",
190
- checkIfAvailable: _temp0,
191
- execute: _temp1,
192
- shortcut: { key: "m" }
193
- },
194
- {
195
- id: "open-agent-chat",
196
- label: "Ask for changes",
197
- groupLabel: "Preview",
198
- checkIfAvailable: () => !isAgentChatSheetOpen,
199
- execute: _temp10,
200
- shortcut: {
201
- key: "i",
202
- withAlt: true
203
- }
204
- },
205
- {
206
- id: "clear-selection",
207
- label: "Clear selection",
208
- groupLabel: "Preview",
209
- checkIfAvailable: _temp11,
210
- execute: _temp12,
211
- shortcut: { key: "Escape" }
212
- }
213
- ];
214
- actionsStore.send({
215
- type: "registerManyActions",
216
- actions
217
- });
218
- return () => {
219
- actionsStore.send({
220
- type: "unregisterManyActions",
221
- ids: actions.map(_temp13)
222
- });
223
- };
224
- };
225
- t4 = [isAgentChatSheetOpen];
226
- $[3] = isAgentChatSheetOpen;
227
- $[4] = t3;
228
- $[5] = t4;
229
- } else {
230
- t3 = $[4];
231
- t4 = $[5];
232
- }
233
- React.useEffect(t3, t4);
234
- const t5 = isAnySideSheetOpen ? `${100 / sheetOpenScale}%` : "100%";
235
- const t6 = isAnySideSheetOpen ? `scale(${sheetOpenScale})` : "scale(1)";
236
- let t7;
237
- if ($[6] !== t5 || $[7] !== t6) {
238
- t7 = {
239
- height: t5,
163
+ if ($[3] === Symbol.for("react.memo_cache_sentinel")) {
164
+ t3 = [];
165
+ $[3] = t3;
166
+ } else t3 = $[3];
167
+ React.useEffect(_temp14, t3);
168
+ const t4 = isAnySideSheetOpen ? `${100 / sheetOpenScale}%` : "100%";
169
+ const t5 = isAnySideSheetOpen ? `scale(${sheetOpenScale})` : "scale(1)";
170
+ let t6;
171
+ if ($[4] !== t4 || $[5] !== t5) {
172
+ t6 = {
173
+ height: t4,
240
174
  transformOrigin: "top right",
241
- transform: t6
175
+ transform: t5
242
176
  };
243
- $[6] = t5;
244
- $[7] = t6;
245
- $[8] = t7;
246
- } else t7 = $[8];
247
- let t8;
248
- if ($[9] !== children || $[10] !== iframeElement || $[11] !== isMobileMode) {
249
- t8 = isMobileMode ? /* @__PURE__ */ jsxs("div", {
177
+ $[4] = t4;
178
+ $[5] = t5;
179
+ $[6] = t6;
180
+ } else t6 = $[6];
181
+ let t7;
182
+ if ($[7] !== children || $[8] !== iframeElement || $[9] !== isMobileMode) {
183
+ t7 = isMobileMode ? /* @__PURE__ */ jsxs("div", {
250
184
  className: "checkered flex h-full justify-center",
251
185
  children: [
252
186
  /* @__PURE__ */ jsxs("div", {
@@ -270,27 +204,27 @@ const PreviewPanel = (t0) => {
270
204
  /* @__PURE__ */ jsx(FieldToolbar, {}),
271
205
  /* @__PURE__ */ jsx(PreviewToolbar, {})
272
206
  ] });
273
- $[9] = children;
274
- $[10] = iframeElement;
275
- $[11] = isMobileMode;
276
- $[12] = t8;
277
- } else t8 = $[12];
278
- let t9;
279
- if ($[13] !== t7 || $[14] !== t8) {
280
- t9 = /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(PanelContent, {
207
+ $[7] = children;
208
+ $[8] = iframeElement;
209
+ $[9] = isMobileMode;
210
+ $[10] = t7;
211
+ } else t7 = $[10];
212
+ let t8;
213
+ if ($[11] !== t6 || $[12] !== t7) {
214
+ t8 = /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(PanelContent, {
281
215
  className: "relative overflow-hidden bg-black",
282
216
  children: /* @__PURE__ */ jsx("div", {
283
217
  ref: wrapperRef,
284
218
  className: "absolute inset-0 transition-[transform,height] duration-500 ease-in-out will-change-transform",
285
- style: t7,
286
- children: t8
219
+ style: t6,
220
+ children: t7
287
221
  })
288
222
  }) });
289
- $[13] = t7;
290
- $[14] = t8;
291
- $[15] = t9;
292
- } else t9 = $[15];
293
- return t9;
223
+ $[11] = t6;
224
+ $[12] = t7;
225
+ $[13] = t8;
226
+ } else t8 = $[13];
227
+ return t8;
294
228
  };
295
229
  function _temp(state) {
296
230
  return state.context.actions;
@@ -307,29 +241,30 @@ function _temp3(element) {
307
241
  function _temp4(state_0) {
308
242
  return state_0.context.isMobileMode;
309
243
  }
310
- function _temp5(state_1) {
311
- return state_1.context.isAgentChatSheetOpen;
244
+ function _temp5() {
245
+ return true;
312
246
  }
313
247
  function _temp6() {
314
- return true;
248
+ return previewStore.send({ type: "toggleSidebar" });
315
249
  }
316
250
  function _temp7() {
317
- return previewStore.send({ type: "toggleSidebar" });
251
+ return true;
318
252
  }
319
253
  function _temp8() {
320
- return true;
254
+ return previewStore.send({ type: "toggleLockContent" });
321
255
  }
322
256
  function _temp9() {
323
- return previewStore.send({ type: "toggleLockContent" });
257
+ return true;
324
258
  }
325
259
  function _temp0() {
326
- return true;
260
+ return previewStore.send({ type: "toggleMobileMode" });
327
261
  }
328
262
  function _temp1() {
329
- return previewStore.send({ type: "toggleMobileMode" });
263
+ return true;
330
264
  }
331
265
  function _temp10() {
332
- return previewStore.send({ type: "openAgentChatSheet" });
266
+ const { isAgentChatSheetOpen } = previewStore.getSnapshot().context;
267
+ previewStore.send({ type: isAgentChatSheetOpen ? "closeAgentChatSheet" : "openAgentChatSheet" });
333
268
  }
334
269
  function _temp11() {
335
270
  return true;
@@ -340,6 +275,65 @@ function _temp12() {
340
275
  function _temp13(a) {
341
276
  return a.id;
342
277
  }
278
+ function _temp14() {
279
+ const actions = [
280
+ {
281
+ id: "toggle-editing-panel",
282
+ label: "Toggle editing panel",
283
+ groupLabel: "Preview",
284
+ checkIfAvailable: _temp5,
285
+ execute: _temp6,
286
+ shortcut: {
287
+ key: "b",
288
+ withAlt: true
289
+ }
290
+ },
291
+ {
292
+ id: "toggle-lock-content",
293
+ label: "Toggle lock content",
294
+ groupLabel: "Preview",
295
+ checkIfAvailable: _temp7,
296
+ execute: _temp8
297
+ },
298
+ {
299
+ id: "toggle-mobile-mode",
300
+ label: "Toggle mobile mode",
301
+ groupLabel: "Preview",
302
+ checkIfAvailable: _temp9,
303
+ execute: _temp0,
304
+ shortcut: { key: "m" }
305
+ },
306
+ {
307
+ id: "toggle-agent-chat",
308
+ label: "Toggle agent chat",
309
+ groupLabel: "Preview",
310
+ checkIfAvailable: _temp1,
311
+ execute: _temp10,
312
+ shortcut: {
313
+ key: "i",
314
+ withAlt: true
315
+ }
316
+ },
317
+ {
318
+ id: "clear-selection",
319
+ label: "Clear selection",
320
+ groupLabel: "Preview",
321
+ checkIfAvailable: _temp11,
322
+ execute: _temp12,
323
+ shortcut: { key: "Escape" }
324
+ }
325
+ ];
326
+ actionsStore.send({
327
+ type: "registerManyActions",
328
+ actions
329
+ });
330
+ return () => {
331
+ actionsStore.send({
332
+ type: "unregisterManyActions",
333
+ ids: actions.map(_temp13)
334
+ });
335
+ };
336
+ }
343
337
 
344
338
  //#endregion
345
339
  export { PreviewFrame, PreviewPanel };
@@ -15,9 +15,9 @@ import { Toggle } from "@camox/ui/toggle";
15
15
  //#region src/features/preview/components/PreviewToolbar.tsx
16
16
  const PreviewToolbar = () => {
17
17
  const $ = c(70);
18
- if ($[0] !== "3f4ab1b23a0c71433f448a6d697143e0a49bc26edf45de5fcefe147aab349d48") {
18
+ if ($[0] !== "9eb26d2e74b59f556130f84b8d22fd9907b3e87a936f560c3c15b54462b76f83") {
19
19
  for (let $i = 0; $i < 70; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
20
- $[0] = "3f4ab1b23a0c71433f448a6d697143e0a49bc26edf45de5fcefe147aab349d48";
20
+ $[0] = "9eb26d2e74b59f556130f84b8d22fd9907b3e87a936f560c3c15b54462b76f83";
21
21
  }
22
22
  const isEditingLocked = useSelector(previewStore, _temp);
23
23
  const isEditingPanelOpen = useSelector(previewStore, _temp2);
@@ -247,7 +247,7 @@ const PreviewToolbar = () => {
247
247
  } else t32 = $[61];
248
248
  let t33;
249
249
  if ($[62] !== actions) {
250
- t33 = getActionShortcut(actions, "open-agent-chat");
250
+ t33 = getActionShortcut(actions, "toggle-agent-chat");
251
251
  $[62] = actions;
252
252
  $[63] = t33;
253
253
  } else t33 = $[63];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "camox",
3
- "version": "0.27.0",
3
+ "version": "0.28.0",
4
4
  "bin": {
5
5
  "camox": "./bin/camox.mjs"
6
6
  },
@@ -126,9 +126,9 @@
126
126
  "react-og-preview": "^0.2.0",
127
127
  "shiki": "^4.0.2",
128
128
  "zod": "^4.3.6",
129
- "@camox/api-contract": "0.27.0",
130
- "@camox/cli": "0.27.0",
131
- "@camox/ui": "0.27.0"
129
+ "@camox/api-contract": "0.28.0",
130
+ "@camox/cli": "0.28.0",
131
+ "@camox/ui": "0.28.0"
132
132
  },
133
133
  "devDependencies": {
134
134
  "@babel/core": "^7.29.0",
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: camox-cli
3
- description: "How to read or modify the website's content (pages and the sections inside them) via the Camox CLI. This is a Camox-powered site, so any request about its content even when phrased generically — is a Camox operation. Use this skill whenever the user wants to add, remove, rename, reorder, review, publish, or change anything visible on the site: a new page or route, a section / hero / footer / etc., the title or wording shown to visitors, what appears at a URL, the SEO title or social-share preview, the structure shared across pages, etc. Also covers reading draft vs live content, publishing draft changes, and syncing content between the dev and production environments (push to prod, pull from prod, check whether the two envs are in sync). Trigger broadly — on phrases like 'add a page', 'put a hero at the top', 'change the headline', 'move this section', 'what's on /about', 'show me the live page', 'review the draft', 'publish this page', 'fix the meta title', 'rename this route', 'why does this show up on every page', 'push to production', 'promote my changes to prod', 'pull from production', 'sync dev with prod' and on similar requests even when the user doesn't say 'page', 'block', 'layout', 'environment', 'CMS', 'Camox', or 'CLI'. When in doubt and the request touches site content, draft/live state, publishing, or the dev/prod split, load this skill."
3
+ description: "How to read or modify Camox website content via the CLI: pages, routes, block instances, copy, images/files, meta fields, layout assignments, draft/live state, publishing, and dev/prod sync. Use when the user wants to add, remove, rename, reorder, review, publish, or change anything visible on the site, including sections, heroes, footers, headlines, SEO titles, social previews, or what appears at a URL. Trigger on requests like 'add a page', 'change the headline', 'move this section', 'what's on /about', 'show me the live page', 'publish this page', 'fix the meta title', 'push to production', 'pull from production', or 'sync dev with prod', even if they do not mention Camox, CMS, page, block, layout, environment, or CLI."
4
4
  ---
5
5
 
6
6
  # Using the Camox CLI
@@ -104,6 +104,14 @@ Repeatable fields are an array of items. `blocks edit` treats the items array as
104
104
 
105
105
  Same pattern for nested repeatables: each child item also has an `id` you pass back as `_itemId` inside the parent item's array field.
106
106
 
107
+ When you need to edit repeatable fields in several blocks, prefer fetching them together first:
108
+
109
+ ```sh
110
+ {{CAMOX_CMD}} blocks get-many --id 99 --id 100 --id 101
111
+ ```
112
+
113
+ `blocks get-many` returns the same bundle shape as `blocks get` for each block, in the same order as the requested ids.
114
+
107
115
  ### Create a new page using an existing layout
108
116
 
109
117
  ```sh