@waveform-playlist/browser 5.2.0-next.1 → 5.2.0-next.3

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 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;
@@ -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
  *
@@ -785,6 +847,43 @@ declare interface PlayheadProps {
785
847
  getAudioContextTime?: () => number;
786
848
  }
787
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
+
788
887
  declare interface PlaylistControlsContextValue {
789
888
  play: (startTime?: number, playDuration?: number) => Promise<void>;
790
889
  pause: () => void;
@@ -859,6 +958,49 @@ declare interface PlaylistStateContextValue {
859
958
  loopEnd: number;
860
959
  }
861
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
+
862
1004
  /**
863
1005
  * Props passed to the renderAnnotationItem function for custom rendering
864
1006
  */
@@ -1620,7 +1762,10 @@ declare interface UseZoomControlsProps {
1620
1762
  }
1621
1763
 
1622
1764
  /**
1623
- * 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).
1624
1769
  */
1625
1770
  export declare const Waveform: default_2.FC<WaveformProps>;
1626
1771