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] !== "
|
|
21
|
+
if ($[0] !== "d799d12f8899aeada62843d5bb83029c25038cd1566b1870e63b1f293c26d992") {
|
|
22
22
|
for (let $i = 0; $i < 9; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
|
|
23
|
-
$[0] = "
|
|
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] !== "
|
|
64
|
+
if ($[0] !== "d799d12f8899aeada62843d5bb83029c25038cd1566b1870e63b1f293c26d992") {
|
|
65
65
|
for (let $i = 0; $i < 5; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
|
|
66
|
-
$[0] = "
|
|
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(
|
|
123
|
-
if ($[0] !== "
|
|
124
|
-
for (let $i = 0; $i <
|
|
125
|
-
$[0] = "
|
|
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
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
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:
|
|
175
|
+
transform: t5
|
|
242
176
|
};
|
|
243
|
-
$[
|
|
244
|
-
$[
|
|
245
|
-
$[
|
|
246
|
-
} else
|
|
247
|
-
let
|
|
248
|
-
if ($[
|
|
249
|
-
|
|
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
|
-
$[
|
|
274
|
-
$[
|
|
275
|
-
$[
|
|
276
|
-
$[
|
|
277
|
-
} else
|
|
278
|
-
let
|
|
279
|
-
if ($[
|
|
280
|
-
|
|
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:
|
|
286
|
-
children:
|
|
219
|
+
style: t6,
|
|
220
|
+
children: t7
|
|
287
221
|
})
|
|
288
222
|
}) });
|
|
289
|
-
$[
|
|
290
|
-
$[
|
|
291
|
-
$[
|
|
292
|
-
} else
|
|
293
|
-
return
|
|
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(
|
|
311
|
-
return
|
|
244
|
+
function _temp5() {
|
|
245
|
+
return true;
|
|
312
246
|
}
|
|
313
247
|
function _temp6() {
|
|
314
|
-
return
|
|
248
|
+
return previewStore.send({ type: "toggleSidebar" });
|
|
315
249
|
}
|
|
316
250
|
function _temp7() {
|
|
317
|
-
return
|
|
251
|
+
return true;
|
|
318
252
|
}
|
|
319
253
|
function _temp8() {
|
|
320
|
-
return
|
|
254
|
+
return previewStore.send({ type: "toggleLockContent" });
|
|
321
255
|
}
|
|
322
256
|
function _temp9() {
|
|
323
|
-
return
|
|
257
|
+
return true;
|
|
324
258
|
}
|
|
325
259
|
function _temp0() {
|
|
326
|
-
return
|
|
260
|
+
return previewStore.send({ type: "toggleMobileMode" });
|
|
327
261
|
}
|
|
328
262
|
function _temp1() {
|
|
329
|
-
return
|
|
263
|
+
return true;
|
|
330
264
|
}
|
|
331
265
|
function _temp10() {
|
|
332
|
-
|
|
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] !== "
|
|
18
|
+
if ($[0] !== "9eb26d2e74b59f556130f84b8d22fd9907b3e87a936f560c3c15b54462b76f83") {
|
|
19
19
|
for (let $i = 0; $i < 70; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
|
|
20
|
-
$[0] = "
|
|
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, "
|
|
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.
|
|
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.
|
|
130
|
-
"@camox/cli": "0.
|
|
131
|
-
"@camox/ui": "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
|
|
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
|