strata-react 1.0.26 → 1.0.29
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 -1
- package/dist/components/compare-audio.d.ts +30 -0
- package/dist/components/compare-parts.d.ts +2 -1
- package/dist/components/compare-text.d.ts +32 -0
- package/dist/components/compare-video.d.ts +33 -0
- package/dist/components/compare.d.ts +25 -1
- package/dist/components/pair-vote.d.ts +22 -10
- package/dist/components/viewport.d.ts +4 -0
- package/dist/index.d.ts +7 -2
- package/dist/index.js +972 -18
- package/dist/index.js.map +1 -1
- package/dist/lib/loudness.d.ts +18 -0
- package/dist/lib/text-diff.d.ts +16 -0
- package/package.json +1 -1
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/** A clip's level in dB relative to full scale: its RMS (what the ear follows) and its highest sample. */
|
|
2
|
+
export type Loudness = {
|
|
3
|
+
rms: number;
|
|
4
|
+
peak: number;
|
|
5
|
+
};
|
|
6
|
+
/** The most of a clip that is measured, in seconds. */
|
|
7
|
+
export declare const MAX_SECONDS = 120;
|
|
8
|
+
/** The RMS and peak of channel data (-1 to 1), over all channels together. */
|
|
9
|
+
export declare function loudnessOf(channels: readonly Float32Array[]): Loudness;
|
|
10
|
+
/** How much to turn each of two clips down (in dB, zero or less) so they play at the same RMS: the louder is lowered to the quieter. */
|
|
11
|
+
export declare function matchGains(a: Loudness, b: Loudness): {
|
|
12
|
+
a: number;
|
|
13
|
+
b: number;
|
|
14
|
+
};
|
|
15
|
+
/** dB to a media element's volume (0 to 1). */
|
|
16
|
+
export declare const gainToVolume: (decibels: number) => number;
|
|
17
|
+
/** Fetches and decodes a clip and measures it. Needs the Web Audio API; reads at most `MAX_SECONDS`. */
|
|
18
|
+
export declare function measureLoudness(src: string): Promise<Loudness>;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/** A run of one text: its words and spaces as written, and whether the words are not in the other text. */
|
|
2
|
+
export type TextSegment = {
|
|
3
|
+
text: string;
|
|
4
|
+
changed: boolean;
|
|
5
|
+
};
|
|
6
|
+
/** The two texts cut into segments, and how many words differ on each side. */
|
|
7
|
+
export type TextDifference = {
|
|
8
|
+
a: TextSegment[];
|
|
9
|
+
b: TextSegment[];
|
|
10
|
+
changedA: number;
|
|
11
|
+
changedB: number;
|
|
12
|
+
};
|
|
13
|
+
/** The most words in A times the most in B that are compared; a bigger pair is not. */
|
|
14
|
+
export declare const MAX_CELLS = 2500000;
|
|
15
|
+
/** Marks the words that differ between two texts, or returns null when the pair is too long to compare. */
|
|
16
|
+
export declare function diffWords(a: string, b: string): TextDifference | null;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "strata-react",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.29",
|
|
4
4
|
"description": "React + Tailwind v4 components that ship structure, behaviour, states and a token contract, and no look: each product brings a theme generated from its own subject.",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|