@seams/voice-capture 0.68.1 → 0.69.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/README.md CHANGED
@@ -113,6 +113,30 @@ try {
113
113
  no row for it, so it is shorter and its rows sit in the middle. If the browser starts audio
114
114
  only after a press, the card shows its Record button; "Try again" and a result's button
115
115
  bring the row back too.
116
+ - `context: { label, text, sentenceLabel? }` makes the card a form for a sentence that speaks
117
+ for a text, such as the summary of a note:
118
+ `{ label: 'Your note on @alice', text: note, sentenceLabel: 'Read this aloud to post' }`.
119
+ - The text sits in a soft box under its label, and scrolls when it is long.
120
+ - The sentence sits centred in a box with a light blue fill under `sentenceLabel` (default
121
+ "Say this sentence"). The fill is a tint of the main button's colour, or the theme's
122
+ `voiceFill`.
123
+ - One button at the foot changes with the card: Record (or Try again) when the card waits
124
+ for a press, the voice line while it records, the check, then the result's action. A
125
+ microphone in a circle sits at its left, except on the result's action.
126
+ - The text stays for the check and the result. Without `context`, the card is as before.
127
+ - `colors` sets the card's colours in code, over the page's CSS variables:
128
+ `{ buttonBackground: '#1d9bf0', textButton: '#ffffff', voiceFill: '#d6edfc' }`. The keys are
129
+ the colour names of the table below and of the card's base colours (`colorBackground`,
130
+ `textPrimary`, `textSecondary`, `textMuted`, `borderPrimary`, `surface`, `buttonBackground`,
131
+ `textButton`, `error`, `info`). A Seams Wallet app sets the same keys in
132
+ `appearance.theme.colors` of its configuration.
133
+ - `voiceLine` sets how the card draws the voice while it listens: `'wave'`, sine wave lines
134
+ (the default), or `'pixels'`, columns of dots that grow from the middle row with the voice and
135
+ move left. Without the prop, the theme value `--seams-shape-voiceLine` (`wave` or `pixels`)
136
+ decides, so a Wallet host can choose it with its theme (`shape.voiceLine`).
137
+ - The rows of the card's grid have names: `context`, `title`, `phrase`, `line`, `status` and
138
+ `action`. A host that sets its own `grid-template-rows` on `.seams-voiceid-prompt` must give
139
+ its rows these names, or the rows move to new tracks.
116
140
  - `show()` resolves with `action` when the person selects the button of a result, `closed`
117
141
  when the person closes the card, or `replaced` when a new view or recording takes its place.
118
142
  - The card uses the CSS variables `--seams-colors-*`, `--seams-shape-*` and
@@ -128,9 +152,20 @@ try {
128
152
  | `--seams-colors-voiceLine` | `colors.voiceLine` | The voice line, its ring and its seal | The text colour |
129
153
  | `--seams-colors-voiceEcho` | `colors.voiceEcho` | Echo lines 1 and 3 behind the line | `voiceLine` |
130
154
  | `--seams-colors-voiceEchoDeep` | `colors.voiceEchoDeep` | Echo line 2 | `voiceEcho` |
155
+ | `--seams-colors-voiceSeal` | `colors.voiceSeal` | The check's line and the seal behind the tick of a result | `voiceLine` |
131
156
  | `--seams-colors-voiceBeam` | `colors.voiceBeam` | The Beam palette: `colorful`, `mono`, `ocean`, `sunset`, `forest`, `candy`, `ice` or `gold`. `mono` is grey, band included | `ocean` |
132
157
  | `--seams-shape-voiceLineWidth` | `shape.voiceLineWidth` | The width of the voice line | `1px` |
133
158
  | `--seams-shape-voiceEchoWidth` | `shape.voiceEchoWidth` | The width of the echo lines | `0.65px` |
159
+ | `--seams-shape-voiceLine` | `shape.voiceLine` | The line style without the `voiceLine` prop: `wave` or `pixels` | `wave` |
160
+ | `--seams-colors-voiceFill` | `colors.voiceFill` | The fill of the sentence's box in a form card | The main button's colour at 14% (light), 24% (dark) or 16% |
161
+ | `--seams-colors-voicePixelBackground` | `colors.voicePixelBackground` | The button behind the pixels in a form card | The main button's colour |
162
+
163
+ The pixel style takes three of these colours, by the distance of a dot from the middle row:
164
+ `voiceEcho` for the middle row (default `#8ecdf8`), `voiceLine` for rows 1 and 2
165
+ (`#1d9bf0`) and `voiceEchoDeep` for rows 3 and 4 (`#1a6fb0`). In a form card the dots sit on
166
+ the button, so they take the button's text colour instead: full in the middle row, and mixed
167
+ with the button's colour further out (white, light and light blue on X blue).
168
+
134
169
  `data-theme="light"` or `"dark"` on the page selects the glow colours.
135
170
  - `frame` adds what a host needs: the parent element, more class names, the corner controls,
136
171
  and a callback when the card is in the document.
@@ -138,6 +173,12 @@ try {
138
173
  Close) or `'back_and_close'`. Back is in the leading corner, Close in the trailing corner.
139
174
  Each one ends the card. `frame.pressed(control)` tells you which one the person
140
175
  pressed, before the card ends. Escape also ends the card, with no `pressed` call.
176
+ - `frame.minimized(minimized)` adds Minimize beside Close. It stays in the check, where Back
177
+ and Close are hidden. A press calls `minimized(true)` and does not end the card: you hide
178
+ the card, and the recording and the check go on. The card calls `minimized(false)` when it
179
+ needs the person again: on a result, and when a recording needs another try.
180
+ `frame.progressed({ stage, done, total })` tells you each new stage (`recording`,
181
+ `checking`, `result`), so you can show the progress of a hidden card.
141
182
  - `VoicePrompt`, `PhraseCard`, `VoiceRibbon` and `VoiceVisual` are exported for a host that
142
183
  makes its own surfaces.
143
184