@waveform-playlist/browser 5.1.0 → 5.2.0-next.2
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/dist/index.d.ts +151 -4
- package/dist/index.js +99 -99
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +2593 -2491
- package/dist/index.mjs.map +1 -1
- package/package.json +16 -16
- package/LICENSE.md +0 -21
package/dist/index.d.ts
CHANGED
|
@@ -565,6 +565,39 @@ export declare interface MediaElementAnimationContextValue {
|
|
|
565
565
|
currentTimeRef: default_2.RefObject<number>;
|
|
566
566
|
}
|
|
567
567
|
|
|
568
|
+
/**
|
|
569
|
+
* Standalone annotation text list component for MediaElementPlaylistProvider.
|
|
570
|
+
*
|
|
571
|
+
* Reads annotations and playback state from context and renders AnnotationText
|
|
572
|
+
* unconditionally (even when annotations are empty).
|
|
573
|
+
*/
|
|
574
|
+
export declare const MediaElementAnnotationList: default_2.FC<MediaElementAnnotationListProps>;
|
|
575
|
+
|
|
576
|
+
export declare interface MediaElementAnnotationListProps {
|
|
577
|
+
/** Height in pixels for the annotation text list */
|
|
578
|
+
height?: number;
|
|
579
|
+
/**
|
|
580
|
+
* Custom render function for annotation items in the text list.
|
|
581
|
+
* When provided, completely replaces the default annotation item rendering.
|
|
582
|
+
*/
|
|
583
|
+
renderAnnotationItem?: (props: RenderAnnotationItemProps) => default_2.ReactNode;
|
|
584
|
+
/**
|
|
585
|
+
* Callback when annotations are updated (e.g., text edited).
|
|
586
|
+
* Called with the full updated annotations array.
|
|
587
|
+
*/
|
|
588
|
+
onAnnotationUpdate?: OnAnnotationUpdateFn;
|
|
589
|
+
/** Whether annotation text can be edited. Defaults to false. */
|
|
590
|
+
editable?: boolean;
|
|
591
|
+
/** Whether dragging one annotation boundary also moves the adjacent annotation's boundary. Defaults to false. */
|
|
592
|
+
linkEndpoints?: boolean;
|
|
593
|
+
/** Override continuousPlay from context. Falls back to context value if not provided. */
|
|
594
|
+
continuousPlay?: boolean;
|
|
595
|
+
/** Where to position the active annotation when auto-scrolling. Defaults to 'center'. */
|
|
596
|
+
scrollActivePosition?: ScrollLogicalPosition;
|
|
597
|
+
/** Which scrollable containers to scroll: 'nearest' or 'all'. Defaults to 'nearest'. */
|
|
598
|
+
scrollActiveContainer?: 'nearest' | 'all';
|
|
599
|
+
}
|
|
600
|
+
|
|
568
601
|
export declare interface MediaElementControlsContextValue {
|
|
569
602
|
play: (startTime?: number) => void;
|
|
570
603
|
pause: () => void;
|
|
@@ -572,7 +605,7 @@ export declare interface MediaElementControlsContextValue {
|
|
|
572
605
|
seekTo: (time: number) => void;
|
|
573
606
|
setPlaybackRate: (rate: number) => void;
|
|
574
607
|
setContinuousPlay: (enabled: boolean) => void;
|
|
575
|
-
setAnnotations:
|
|
608
|
+
setAnnotations: default_2.Dispatch<default_2.SetStateAction<AnnotationData[]>>;
|
|
576
609
|
setActiveAnnotationId: (id: string | null) => void;
|
|
577
610
|
setAutomaticScroll: (enabled: boolean) => void;
|
|
578
611
|
setScrollContainer: (element: HTMLDivElement | null) => void;
|
|
@@ -596,6 +629,35 @@ export declare interface MediaElementDataContextValue {
|
|
|
596
629
|
progressBarWidth: number;
|
|
597
630
|
}
|
|
598
631
|
|
|
632
|
+
/**
|
|
633
|
+
* Standalone waveform + annotation boxes component for MediaElementPlaylistProvider.
|
|
634
|
+
*
|
|
635
|
+
* Renders the waveform visualization, annotation boxes, selection, and playhead.
|
|
636
|
+
* Does NOT render the annotation text list — use `MediaElementAnnotationList` for that.
|
|
637
|
+
*
|
|
638
|
+
* Must be used inside a `MediaElementPlaylistProvider`.
|
|
639
|
+
*
|
|
640
|
+
* This component can be placed independently in consumer layouts, allowing the
|
|
641
|
+
* waveform and annotation list to be positioned separately (e.g., in different
|
|
642
|
+
* panels or with custom elements between them).
|
|
643
|
+
*/
|
|
644
|
+
export declare const MediaElementPlaylist: default_2.FC<MediaElementPlaylistProps>;
|
|
645
|
+
|
|
646
|
+
export declare interface MediaElementPlaylistProps {
|
|
647
|
+
/** Custom function to generate the label shown on annotation boxes */
|
|
648
|
+
getAnnotationBoxLabel?: GetAnnotationBoxLabelFn;
|
|
649
|
+
/** Whether annotation boundaries can be edited by dragging. Defaults to false. */
|
|
650
|
+
editable?: boolean;
|
|
651
|
+
/** Whether dragging one annotation boundary also moves the adjacent annotation's boundary. Defaults to false. */
|
|
652
|
+
linkEndpoints?: boolean;
|
|
653
|
+
/**
|
|
654
|
+
* Callback when annotations are updated (e.g., boundaries dragged).
|
|
655
|
+
* Called with the full updated annotations array.
|
|
656
|
+
*/
|
|
657
|
+
onAnnotationUpdate?: OnAnnotationUpdateFn;
|
|
658
|
+
className?: string;
|
|
659
|
+
}
|
|
660
|
+
|
|
599
661
|
/**
|
|
600
662
|
* MediaElementPlaylistProvider
|
|
601
663
|
*
|
|
@@ -694,6 +756,8 @@ export declare interface MediaElementWaveformProps {
|
|
|
694
756
|
renderAnnotationItem?: (props: RenderAnnotationItemProps) => default_2.ReactNode;
|
|
695
757
|
/** Whether annotation boundaries can be edited by dragging. Defaults to false. */
|
|
696
758
|
editable?: boolean;
|
|
759
|
+
/** Whether dragging one annotation boundary also moves the adjacent annotation's boundary. Defaults to false. */
|
|
760
|
+
linkEndpoints?: boolean;
|
|
697
761
|
/**
|
|
698
762
|
* Callback when annotations are updated (e.g., boundaries dragged).
|
|
699
763
|
* Called with the full updated annotations array.
|
|
@@ -783,6 +847,43 @@ declare interface PlayheadProps {
|
|
|
783
847
|
getAudioContextTime?: () => number;
|
|
784
848
|
}
|
|
785
849
|
|
|
850
|
+
/**
|
|
851
|
+
* Standalone annotation text list component for WaveformPlaylistProvider (WebAudio).
|
|
852
|
+
*
|
|
853
|
+
* Reads annotations and playback state from context and renders AnnotationText
|
|
854
|
+
* unconditionally (even when annotations are empty).
|
|
855
|
+
*/
|
|
856
|
+
export declare const PlaylistAnnotationList: default_2.FC<PlaylistAnnotationListProps>;
|
|
857
|
+
|
|
858
|
+
export declare interface PlaylistAnnotationListProps {
|
|
859
|
+
/** Height in pixels for the annotation text list */
|
|
860
|
+
height?: number;
|
|
861
|
+
/**
|
|
862
|
+
* Custom render function for annotation items in the text list.
|
|
863
|
+
* When provided, completely replaces the default annotation item rendering.
|
|
864
|
+
*/
|
|
865
|
+
renderAnnotationItem?: (props: RenderAnnotationItemProps) => default_2.ReactNode;
|
|
866
|
+
/**
|
|
867
|
+
* Callback when annotations are updated (e.g., text edited).
|
|
868
|
+
* Called with the full updated annotations array.
|
|
869
|
+
*/
|
|
870
|
+
onAnnotationUpdate?: OnAnnotationUpdateFn;
|
|
871
|
+
/**
|
|
872
|
+
* Action controls to show on each annotation item (e.g., delete, split).
|
|
873
|
+
* Only rendered when `annotationsEditable` is true in context.
|
|
874
|
+
*/
|
|
875
|
+
controls?: AnnotationAction[];
|
|
876
|
+
/**
|
|
877
|
+
* Override annotation list config. Falls back to context values
|
|
878
|
+
* `{ linkEndpoints, continuousPlay }` if not provided.
|
|
879
|
+
*/
|
|
880
|
+
annotationListConfig?: AnnotationActionOptions;
|
|
881
|
+
/** Where to position the active annotation when auto-scrolling. Defaults to 'center'. */
|
|
882
|
+
scrollActivePosition?: ScrollLogicalPosition;
|
|
883
|
+
/** Which scrollable containers to scroll: 'nearest' or 'all'. Defaults to 'nearest'. */
|
|
884
|
+
scrollActiveContainer?: 'nearest' | 'all';
|
|
885
|
+
}
|
|
886
|
+
|
|
786
887
|
declare interface PlaylistControlsContextValue {
|
|
787
888
|
play: (startTime?: number, playDuration?: number) => Promise<void>;
|
|
788
889
|
pause: () => void;
|
|
@@ -806,7 +907,7 @@ declare interface PlaylistControlsContextValue {
|
|
|
806
907
|
setContinuousPlay: (enabled: boolean) => void;
|
|
807
908
|
setLinkEndpoints: (enabled: boolean) => void;
|
|
808
909
|
setAnnotationsEditable: (enabled: boolean) => void;
|
|
809
|
-
setAnnotations:
|
|
910
|
+
setAnnotations: default_2.Dispatch<default_2.SetStateAction<AnnotationData[]>>;
|
|
810
911
|
setActiveAnnotationId: (id: string | null) => void;
|
|
811
912
|
setLoopEnabled: (enabled: boolean) => void;
|
|
812
913
|
setLoopRegion: (start: number, end: number) => void;
|
|
@@ -857,6 +958,49 @@ declare interface PlaylistStateContextValue {
|
|
|
857
958
|
loopEnd: number;
|
|
858
959
|
}
|
|
859
960
|
|
|
961
|
+
/**
|
|
962
|
+
* Standalone playlist visualization component (WebAudio version).
|
|
963
|
+
*
|
|
964
|
+
* Renders the waveform tracks, timescale, annotations boxes, selection,
|
|
965
|
+
* playhead, loop regions, and track controls — everything that lives
|
|
966
|
+
* inside <Playlist> plus wrapping providers.
|
|
967
|
+
*
|
|
968
|
+
* Does NOT render AnnotationText (the annotation list below the waveform).
|
|
969
|
+
* Pair with PlaylistAnnotationList for a full annotation editing UI.
|
|
970
|
+
*/
|
|
971
|
+
export declare const PlaylistVisualization: default_2.FC<PlaylistVisualizationProps>;
|
|
972
|
+
|
|
973
|
+
export declare interface PlaylistVisualizationProps {
|
|
974
|
+
renderTrackControls?: (trackIndex: number) => ReactNode;
|
|
975
|
+
renderTimestamp?: (timeMs: number, pixelPosition: number) => ReactNode;
|
|
976
|
+
/** Custom playhead render function. Receives position (pixels) and color from theme. */
|
|
977
|
+
renderPlayhead?: RenderPlayheadFunction;
|
|
978
|
+
annotationControls?: AnnotationAction[];
|
|
979
|
+
/**
|
|
980
|
+
* Custom function to generate the label shown on annotation boxes in the waveform.
|
|
981
|
+
* Receives the annotation data and its index, returns a string label.
|
|
982
|
+
* Default: annotation.id
|
|
983
|
+
*/
|
|
984
|
+
getAnnotationBoxLabel?: GetAnnotationBoxLabelFn;
|
|
985
|
+
className?: string;
|
|
986
|
+
showClipHeaders?: boolean;
|
|
987
|
+
interactiveClips?: boolean;
|
|
988
|
+
showFades?: boolean;
|
|
989
|
+
/**
|
|
990
|
+
* Enable mobile-optimized touch interactions.
|
|
991
|
+
* When true, increases touch target sizes for clip boundaries.
|
|
992
|
+
* Use with useDragSensors({ touchOptimized: true }) for best results.
|
|
993
|
+
*/
|
|
994
|
+
touchOptimized?: boolean;
|
|
995
|
+
recordingState?: {
|
|
996
|
+
isRecording: boolean;
|
|
997
|
+
trackId: string;
|
|
998
|
+
startSample: number;
|
|
999
|
+
durationSamples: number;
|
|
1000
|
+
peaks: Int8Array | Int16Array;
|
|
1001
|
+
};
|
|
1002
|
+
}
|
|
1003
|
+
|
|
860
1004
|
/**
|
|
861
1005
|
* Props passed to the renderAnnotationItem function for custom rendering
|
|
862
1006
|
*/
|
|
@@ -1618,7 +1762,10 @@ declare interface UseZoomControlsProps {
|
|
|
1618
1762
|
}
|
|
1619
1763
|
|
|
1620
1764
|
/**
|
|
1621
|
-
* Waveform visualization component that uses the playlist context
|
|
1765
|
+
* Waveform visualization component that uses the playlist context.
|
|
1766
|
+
*
|
|
1767
|
+
* Composes PlaylistVisualization (waveform + tracks) and
|
|
1768
|
+
* PlaylistAnnotationList (annotation text list below the waveform).
|
|
1622
1769
|
*/
|
|
1623
1770
|
export declare const Waveform: default_2.FC<WaveformProps>;
|
|
1624
1771
|
|
|
@@ -1749,7 +1896,7 @@ export declare interface WaveformPlaylistContextValue {
|
|
|
1749
1896
|
setContinuousPlay: (enabled: boolean) => void;
|
|
1750
1897
|
setLinkEndpoints: (enabled: boolean) => void;
|
|
1751
1898
|
setAnnotationsEditable: (enabled: boolean) => void;
|
|
1752
|
-
setAnnotations:
|
|
1899
|
+
setAnnotations: default_2.Dispatch<default_2.SetStateAction<AnnotationData[]>>;
|
|
1753
1900
|
setActiveAnnotationId: (id: string | null) => void;
|
|
1754
1901
|
playoutRef: default_2.RefObject<TonePlayout | null>;
|
|
1755
1902
|
currentTimeRef: default_2.RefObject<number>;
|