@theoremjs/react 0.3.5-next.1042.gfa994b5 → 0.3.5-next.1043.ge9acd49
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 +1 -0
- package/components/InkWaveform.js +5 -5
- package/package.json +3 -3
- package/ui/ChatComposerRow.js +1 -1
package/README.md
CHANGED
|
@@ -211,6 +211,7 @@ Each part of the look is a CSS custom property. Set it on any element above the
|
|
|
211
211
|
| `--theorem-composer-pill-radius` | The corner radius of each pill and of the stop button. | `var(--radius-full)` |
|
|
212
212
|
| `--theorem-composer-pill-fill` | The fill of each pill. | the surface's fill |
|
|
213
213
|
| `--theorem-composer-pill-shadow` | The shadow of each pill. | the surface's shadow |
|
|
214
|
+
| `--theorem-composer-pill-end-padding` | The space between the working pill's stop button and the pill's end. | half the pill's height less the stop button's, so the same ring of space goes round the button |
|
|
214
215
|
| `--theorem-composer-pill-align` | Where one pill sits in the row, as `justify-content`. Two or more pills start at the row's start, and scroll once they do not fit. | `center` |
|
|
215
216
|
|
|
216
217
|
```tsx
|
|
@@ -34,8 +34,8 @@ const WAVE_CONFIG = {
|
|
|
34
34
|
};
|
|
35
35
|
function resolveWaveDimensions(variant) {
|
|
36
36
|
const cfg = WAVE_CONFIG[variant] ?? WAVE_CONFIG.default;
|
|
37
|
-
const
|
|
38
|
-
return { ...cfg,
|
|
37
|
+
const barGap = (cfg.viewWidth - cfg.strokeWidth * cfg.barCount) / (cfg.barCount + 1);
|
|
38
|
+
return { ...cfg, barGap };
|
|
39
39
|
}
|
|
40
40
|
/** One frame's bar targets. The live ref's levels win over the last render's; a frozen wave moves to none. */
|
|
41
41
|
function frameTargets(snap, phases, timeMs) {
|
|
@@ -90,15 +90,15 @@ function usePaintedWave(svgRef, snapRef, phases, barCount, viewHeight) {
|
|
|
90
90
|
}, [svgRef, snapRef, phases, barCount, viewHeight]);
|
|
91
91
|
}
|
|
92
92
|
export function InkWaveform({ status = 'disconnected', inputLevel = 0, outputLevel = 0, levelsRef, toolActive = false, frozen = false, variant = 'default', }) {
|
|
93
|
-
const { viewWidth, viewHeight, preserveAspect, strokeWidth, barCount,
|
|
93
|
+
const { viewWidth, viewHeight, preserveAspect, strokeWidth, barCount, barGap } = resolveWaveDimensions(variant);
|
|
94
94
|
const phases = useMemo(() => inkWavePhases(barCount), [barCount]);
|
|
95
95
|
const xs = useMemo(() => {
|
|
96
96
|
const next = new Array(barCount);
|
|
97
97
|
for (let index = 0; index < barCount; index++) {
|
|
98
|
-
next[index] =
|
|
98
|
+
next[index] = barGap + index * (strokeWidth + barGap) + strokeWidth / 2;
|
|
99
99
|
}
|
|
100
100
|
return next;
|
|
101
|
-
}, [barCount,
|
|
101
|
+
}, [barCount, barGap, strokeWidth]);
|
|
102
102
|
const svgRef = useRef(null);
|
|
103
103
|
const snapRef = useRef({
|
|
104
104
|
status,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@theoremjs/react",
|
|
3
|
-
"version": "0.3.5-next.
|
|
3
|
+
"version": "0.3.5-next.1043.ge9acd49",
|
|
4
4
|
"description": "React bindings for Theorem: headless hooks + transport, an Astryx chat UI, and a Web-standard server handler.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -60,8 +60,8 @@
|
|
|
60
60
|
"@stylexjs/stylex": "0.19.0",
|
|
61
61
|
"react": "^19.0.0",
|
|
62
62
|
"react-dom": "^19.0.0",
|
|
63
|
-
"@theoremjs/agents": "^0.3.5-next.
|
|
64
|
-
"@theoremjs/web": "^0.3.5-next.
|
|
63
|
+
"@theoremjs/agents": "^0.3.5-next.1043.ge9acd49",
|
|
64
|
+
"@theoremjs/web": "^0.3.5-next.1043.ge9acd49"
|
|
65
65
|
},
|
|
66
66
|
"peerDependenciesMeta": {
|
|
67
67
|
"@astryxdesign/core": {
|
package/ui/ChatComposerRow.js
CHANGED
|
@@ -54,7 +54,7 @@ const PILL = {
|
|
|
54
54
|
/** why: The stop button sits in the pill's end with the same ring of space all round it. */
|
|
55
55
|
const WORKING_PILL = {
|
|
56
56
|
...PILL,
|
|
57
|
-
paddingInlineEnd: `calc((${PILL_HEIGHT} - var(--size-element-sm)) / 2)
|
|
57
|
+
paddingInlineEnd: knob('pill-end-padding', `calc((${PILL_HEIGHT} - var(--size-element-sm)) / 2)`),
|
|
58
58
|
};
|
|
59
59
|
/** invariant: The pill row keeps one pill's height whatever it holds, so the composer never moves. */
|
|
60
60
|
const PILL_ROW = { paddingInline: INSET, minHeight: PILL_HEIGHT };
|