@wix/himalaya-cli 0.819.0 → 0.820.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.
- package/dist/cli.mjs +418 -36
- package/guides/tier-5-add-a-screen.md +28 -7
- package/package.json +2 -2
|
@@ -101,20 +101,41 @@ The first arg after `state` is the action's payload object: the descriptor's `Ac
|
|
|
101
101
|
|
|
102
102
|
| Component | Its `Action` prop | What the reducer's payload contains |
|
|
103
103
|
|---|---|---|
|
|
104
|
-
| `TextField` / `RichTextField` | `onChange` | `{ value }` — the current text (fires per keystroke) |
|
|
105
|
-
| `
|
|
106
|
-
| `
|
|
104
|
+
| `TextField` / `RichTextField` | `onChange`, `onSubmit` | `{ value }` — the current text (onChange fires per keystroke) |
|
|
105
|
+
| `SearchField` | `onChange`, `onSubmit` | `{ value }` — the query, debounced by `debounceMs` |
|
|
106
|
+
| `Picker` / `SegmentedControl` / `Tabs` / `WheelPicker` | `onChange` | `{ selectedId }` — the id of the newly selected option |
|
|
107
|
+
| `FilterChips` | `onChange` | `{ selectedIds }` — the **array** of ids selected *after* the tap (honors `multiSelect`) |
|
|
108
|
+
| `Toggle` | `onChange` | `{ value }` — the next state, as a boolean |
|
|
109
|
+
| `SelectionControl` | `onChange` | `{ value }` — the next checked state, as a boolean |
|
|
110
|
+
| `Stepper` | `onChange` | `{ value }` — the clamped next value, as an int |
|
|
111
|
+
| `Slider` | `onChange` | `{ value }` — a double (range mode adds `upperValue`) |
|
|
112
|
+
| `Rating` | `onChange` | `{ value }` — the 1-based star index |
|
|
107
113
|
| `ColorPicker` | `onChange` | `{ value }` — the hex string |
|
|
108
|
-
| `
|
|
109
|
-
| `
|
|
110
|
-
| `
|
|
114
|
+
| `DatePicker` | `onChange` | `{ value }` — unix **seconds**, string-encoded |
|
|
115
|
+
| `OtpInput` | `onChange`, `onComplete` | `{ value }` — the assembled code (dispatched on React Native today; the other renderers show the boxes read-only) |
|
|
116
|
+
| `ChipsInput` | `onRemove` | `{ value }` — the removed chip |
|
|
111
117
|
| `Button` / `ListItem` | `action` / `onTap` | exactly the descriptor's `params` (no injected value) |
|
|
112
118
|
|
|
119
|
+
The payload rides in **`args`**. Some arms also mirror it into `params`; that is permitted only
|
|
120
|
+
for string-encoded values, because `Action.params` is `map<string,string>` in the proto. Every
|
|
121
|
+
host merges `{...params, ...args}` (args winning) before invoking the reducer, so a worker sees
|
|
122
|
+
one object either way.
|
|
123
|
+
|
|
124
|
+
> **Not every arm honors this yet.** The table above is the *contract*, not a report of current
|
|
125
|
+
> behaviour — several controls diverge per renderer today (web's `Toggle`, `Slider` and
|
|
126
|
+
> `SelectionControl` inject nothing; `DatePicker` differs on three arms; `Rating` ships three
|
|
127
|
+
> encodings). The platform keeps a machine-checked record of what each arm actually does, and
|
|
128
|
+
> what is still outstanding, in its action-payload contract — a cross-renderer parity gate holds
|
|
129
|
+
> the two in step. Until that divergence list is empty, defensive reducers
|
|
130
|
+
> (`String(p?.value ?? p?.text ?? "")`) remain the safe way to read a payload.
|
|
131
|
+
|
|
113
132
|
So a text-input reducer is `setDraft: (s, { value }) => ({ ...s, draft: value })`, bound with `onChange: { actionId: "tier5.notes.setDraft" }`.
|
|
114
133
|
|
|
115
134
|
**Per-row actions carry `$item` fields.** In a bound list/grid, `$item.<field>` substitutes into an action's `params` per row — so a per-row delete is `action: { actionId: "tier5.notes.remove", params: { id: "$item.id" } }`, and the reducer reads `remove: (s, { id }) => …`. (`$item` also substitutes into any prop string, e.g. `text: "$item.title"`.)
|
|
116
135
|
|
|
117
|
-
> These payload shapes are the SDUI protocol contract
|
|
136
|
+
> These payload shapes are the SDUI protocol contract. Parity across the four renderers is
|
|
137
|
+
> enforced by a gate that reads the action-payload contract, which also records every arm that
|
|
138
|
+
> does not conform yet — this line previously asserted a parity that did not hold.
|
|
118
139
|
|
|
119
140
|
### 2. Build the bundle
|
|
120
141
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wix/himalaya-cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.820.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "himi — the Himalaya authoring CLI. Build a Tier-5 content package on your own machine, push it to the production serve as a draft, preview it on web + Himi Player, and read worker logs back — the remote dev loop. Wraps @himalaya/serve-cli for transport.",
|
|
6
6
|
"keywords": [
|
|
@@ -63,5 +63,5 @@
|
|
|
63
63
|
"artifactId": "himalaya-cli"
|
|
64
64
|
}
|
|
65
65
|
},
|
|
66
|
-
"falconPackageHash": "
|
|
66
|
+
"falconPackageHash": "043a4884aa2e1dd120db9847ffc6bd72eee22779ef9556c5a0386f14"
|
|
67
67
|
}
|