@waveform-playlist/annotations 14.0.0-next.16 → 14.0.0-next.18
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 +5 -5
- package/package.json +5 -5
package/README.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Time-synchronized text annotations for waveform-playlist — mark up an audio timeline with editable regions for transcripts, podcast chapters, cue points, or music markers.
|
|
4
4
|
|
|
5
|
-
Used with [`@waveform-playlist/browser`](https://www.npmjs.com/package/@waveform-playlist/browser): make an annotation store with `useCreateAnnotationStore`, pass it as `annotationStore` to `
|
|
5
|
+
Used with [`@waveform-playlist/browser`](https://www.npmjs.com/package/@waveform-playlist/browser): make an annotation store with `useCreateAnnotationStore`, pass it as `annotationStore` to `WebAudioProvider` or `MediaElementProvider`, and render `AnnotationProvider` above the view. `<Waveform />` and `<MediaElementWaveform />` then render the annotation boxes and the annotation text list. To give either one an option, compose the view with `<WaveformAnnotationBoxes>` and `<AnnotationList>` from `@waveform-playlist/browser`.
|
|
6
6
|
|
|
7
7
|
## Features
|
|
8
8
|
|
|
@@ -26,7 +26,7 @@ Peer dependencies: `react` and `react-dom` (^19.0.0), `styled-components` (^6.0.
|
|
|
26
26
|
|
|
27
27
|
```tsx
|
|
28
28
|
import {
|
|
29
|
-
|
|
29
|
+
WebAudioProvider,
|
|
30
30
|
Waveform,
|
|
31
31
|
useCreateArrangement,
|
|
32
32
|
useCreateAnnotationStore,
|
|
@@ -45,7 +45,7 @@ function AnnotatedPlaylist() {
|
|
|
45
45
|
]);
|
|
46
46
|
|
|
47
47
|
return (
|
|
48
|
-
<
|
|
48
|
+
<WebAudioProvider
|
|
49
49
|
arrangement={arrangement}
|
|
50
50
|
annotationStore={annotationStore}
|
|
51
51
|
annotationList={{ editable: true }}
|
|
@@ -53,12 +53,12 @@ function AnnotatedPlaylist() {
|
|
|
53
53
|
<AnnotationProvider>
|
|
54
54
|
<Waveform />
|
|
55
55
|
</AnnotationProvider>
|
|
56
|
-
</
|
|
56
|
+
</WebAudioProvider>
|
|
57
57
|
);
|
|
58
58
|
}
|
|
59
59
|
```
|
|
60
60
|
|
|
61
|
-
Change the annotations with `annotationStore.set(list)` and `annotationStore.update((current) => next)`; read them with `useStoredAnnotations(annotationStore)` (also above the provider) or `useAnnotations()` below it. To save them, subscribe to the store. The store refuses an annotation without finite numeric `start` and `end`, and two annotations with one id (a `TypeError`). See the [Annotations guide](https://naomiaro.github.io/waveform-playlist/docs/react/guides/annotations#the-annotation-store).
|
|
61
|
+
Change the annotations with `annotationStore.set(list)` and `annotationStore.update((current) => next)`; read them with `useStoredAnnotations(annotationStore)` (also above the provider) or `useAnnotations()` below it. To save them, subscribe to the store. The store refuses an annotation without finite numeric `start` and `end`, and two annotations with one id (a `TypeError`). Keep the list in time order, without overlaps, and with no annotation ending before it starts: the store does not check that ([What a List Must Be](https://naomiaro.github.io/waveform-playlist/docs/react/guides/annotations#what-a-list-must-be)). See the [Annotations guide](https://naomiaro.github.io/waveform-playlist/docs/react/guides/annotations#the-annotation-store).
|
|
62
62
|
|
|
63
63
|
Each annotation is a plain object:
|
|
64
64
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@waveform-playlist/annotations",
|
|
3
|
-
"version": "14.0.0-next.
|
|
3
|
+
"version": "14.0.0-next.18",
|
|
4
4
|
"description": "Annotation support for waveform-playlist",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"module": "./dist/index.mjs",
|
|
@@ -45,11 +45,11 @@
|
|
|
45
45
|
"tsup": "^8.5.1",
|
|
46
46
|
"typescript": "^5.9.3",
|
|
47
47
|
"vitest": "^5.0.3",
|
|
48
|
-
"@waveform-playlist/browser": "17.0.0-next.
|
|
48
|
+
"@waveform-playlist/browser": "17.0.0-next.29"
|
|
49
49
|
},
|
|
50
50
|
"dependencies": {
|
|
51
|
-
"@waveform-playlist/core": "13.0.0-next.
|
|
52
|
-
"@waveform-playlist/ui-components": "15.0.0-next.
|
|
51
|
+
"@waveform-playlist/core": "13.0.0-next.12",
|
|
52
|
+
"@waveform-playlist/ui-components": "15.0.0-next.18"
|
|
53
53
|
},
|
|
54
54
|
"peerDependencies": {
|
|
55
55
|
"@dnd-kit/dom": "^0.5.0",
|
|
@@ -57,7 +57,7 @@
|
|
|
57
57
|
"react": "^19.0.0",
|
|
58
58
|
"react-dom": "^19.0.0",
|
|
59
59
|
"styled-components": "^6.0.0",
|
|
60
|
-
"@waveform-playlist/browser": "^17.0.0-next.
|
|
60
|
+
"@waveform-playlist/browser": "^17.0.0-next.29"
|
|
61
61
|
},
|
|
62
62
|
"scripts": {
|
|
63
63
|
"build": "tsup",
|