@seams/voice-capture 0.68.0 → 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 +56 -2
- package/dist/browser/card.js +267 -18
- package/dist/esm/card/index.js +1 -1
- package/dist/esm/card/phraseCard.js +2 -2
- package/dist/esm/card/prompt.js +329 -19
- package/dist/esm/card/ribbon.js +106 -5
- package/dist/esm/card/rowMotion.js +3 -3
- package/dist/esm/card/surface.js +121 -6
- package/dist/esm/card/visual.js +2 -2
- package/dist/esm/chunks/{visual-Di3ojTED.js → visual-DU1OVwCA.js} +35 -3
- package/dist/types/card/index.d.ts +2 -2
- package/dist/types/card/prompt.d.ts +13 -1
- package/dist/types/card/ribbon.d.ts +19 -0
- package/dist/types/card/rowMotion.d.ts +3 -3
- package/dist/types/card/surface.d.ts +63 -0
- package/dist/types/card/visual.d.ts +6 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -109,8 +109,34 @@ try {
|
|
|
109
109
|
- `record()` resolves with `recorded` (the samples) or `cancelled`. A too quiet recording
|
|
110
110
|
stays on the card with "Try again".
|
|
111
111
|
- `autoStart: true` starts the first recording with no press on Record. Use it when the person
|
|
112
|
-
just asked for the card with a click or a key.
|
|
113
|
-
|
|
112
|
+
just asked for the card with a click or a key. The card then shows no Record button and has
|
|
113
|
+
no row for it, so it is shorter and its rows sit in the middle. If the browser starts audio
|
|
114
|
+
only after a press, the card shows its Record button; "Try again" and a result's button
|
|
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.
|
|
114
140
|
- `show()` resolves with `action` when the person selects the button of a result, `closed`
|
|
115
141
|
when the person closes the card, or `replaced` when a new view or recording takes its place.
|
|
116
142
|
- The card uses the CSS variables `--seams-colors-*`, `--seams-shape-*` and
|
|
@@ -118,6 +144,28 @@ try {
|
|
|
118
144
|
Record and the other main buttons use `--seams-colors-buttonBackground` and
|
|
119
145
|
`--seams-colors-textButton`. Without them, the main button has the text colour
|
|
120
146
|
(`textPrimary`) with the card's background colour as its text.
|
|
147
|
+
The voice line and the Beam glow under it take these values, and keep today's look
|
|
148
|
+
without them:
|
|
149
|
+
|
|
150
|
+
| CSS variable | Theme key (Seams Wallet) | What it sets | Default |
|
|
151
|
+
| --- | --- | --- | --- |
|
|
152
|
+
| `--seams-colors-voiceLine` | `colors.voiceLine` | The voice line, its ring and its seal | The text colour |
|
|
153
|
+
| `--seams-colors-voiceEcho` | `colors.voiceEcho` | Echo lines 1 and 3 behind the line | `voiceLine` |
|
|
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` |
|
|
156
|
+
| `--seams-colors-voiceBeam` | `colors.voiceBeam` | The Beam palette: `colorful`, `mono`, `ocean`, `sunset`, `forest`, `candy`, `ice` or `gold`. `mono` is grey, band included | `ocean` |
|
|
157
|
+
| `--seams-shape-voiceLineWidth` | `shape.voiceLineWidth` | The width of the voice line | `1px` |
|
|
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
|
+
|
|
121
169
|
`data-theme="light"` or `"dark"` on the page selects the glow colours.
|
|
122
170
|
- `frame` adds what a host needs: the parent element, more class names, the corner controls,
|
|
123
171
|
and a callback when the card is in the document.
|
|
@@ -125,6 +173,12 @@ try {
|
|
|
125
173
|
Close) or `'back_and_close'`. Back is in the leading corner, Close in the trailing corner.
|
|
126
174
|
Each one ends the card. `frame.pressed(control)` tells you which one the person
|
|
127
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.
|
|
128
182
|
- `VoicePrompt`, `PhraseCard`, `VoiceRibbon` and `VoiceVisual` are exported for a host that
|
|
129
183
|
makes its own surfaces.
|
|
130
184
|
|