camox 0.24.0 → 0.24.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "camox",
3
- "version": "0.24.0",
3
+ "version": "0.24.1",
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.24.0",
130
- "@camox/cli": "0.24.0",
131
- "@camox/ui": "0.24.0"
129
+ "@camox/api-contract": "0.24.1",
130
+ "@camox/ui": "0.24.1",
131
+ "@camox/cli": "0.24.1"
132
132
  },
133
133
  "devDependencies": {
134
134
  "@babel/core": "^7.29.0",
@@ -81,6 +81,29 @@ See **Block positioning** below for the full set of options.
81
81
  {{CAMOX_CMD}} blocks edit --id 314 --content '{"headline": "New headline"}'
82
82
  ```
83
83
 
84
+ ### Update one item inside a repeatable field (one FAQ answer, one feature title, …)
85
+
86
+ Repeatable fields are an array of items. `blocks edit` treats the items array as the new truth: any existing item whose `_itemId` is not in your patch is **deleted** (cascading to its file references, settings, and child items). To change one item without losing the rest, fetch the block first to learn every item's id, then patch with every `_itemId` present.
87
+
88
+ ```sh
89
+ # 1) Fetch the block's raw items (the `id` of each is its `_itemId`).
90
+ {{CAMOX_CMD}} blocks get --id 99
91
+ # in the response, `repeatableItems` lists each item with `id`, `fieldName`,
92
+ # `parentItemId`, and `content`. Pick the id you want to edit.
93
+
94
+ # 2) Send every item back. Empty `{"_itemId": N}` entries preserve items as-is;
95
+ # the entry you want to change carries the field overrides.
96
+ {{CAMOX_CMD}} blocks edit --id 99 --content '{
97
+ "items": [
98
+ {"_itemId": 401},
99
+ {"_itemId": 402, "answer": "Updated answer."},
100
+ {"_itemId": 403}
101
+ ]
102
+ }'
103
+ ```
104
+
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
+
84
107
  ### Create a new page using an existing layout
85
108
 
86
109
  ```sh