@waveform-playlist/ui-components 7.0.0 → 7.1.0
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.mts +37 -3
- package/dist/index.d.ts +37 -3
- package/dist/index.js +549 -308
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +523 -279
- package/dist/index.mjs.map +1 -1
- package/package.json +4 -5
package/dist/index.d.mts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
2
|
import react__default, { FunctionComponent, ReactNode, Dispatch, SetStateAction } from 'react';
|
|
3
|
-
import { Peaks, Bits } from '@waveform-playlist/
|
|
4
|
-
import { Fade, FadeType, SpectrogramData, RenderMode } from '@waveform-playlist/core';
|
|
3
|
+
import { Peaks, Bits, Fade, FadeType, SpectrogramData, RenderMode } from '@waveform-playlist/core';
|
|
5
4
|
import { DraggableAttributes } from '@dnd-kit/core';
|
|
6
5
|
import { SyntheticListenerMap } from '@dnd-kit/core/dist/hooks/utilities';
|
|
7
6
|
import * as styled_components_dist_utils_hoist from 'styled-components/dist/utils/hoist';
|
|
@@ -670,6 +669,13 @@ interface TrackMenuProps {
|
|
|
670
669
|
}
|
|
671
670
|
declare const TrackMenu: react__default.FC<TrackMenuProps>;
|
|
672
671
|
|
|
672
|
+
/**
|
|
673
|
+
* Maximum width in CSS pixels for a single canvas chunk.
|
|
674
|
+
* Canvas elements are split into chunks of this width to enable
|
|
675
|
+
* horizontal virtual scrolling — only visible chunks are mounted.
|
|
676
|
+
*/
|
|
677
|
+
declare const MAX_CANVAS_WIDTH = 1000;
|
|
678
|
+
|
|
673
679
|
type Props$1 = {
|
|
674
680
|
children: ReactNode;
|
|
675
681
|
};
|
|
@@ -720,6 +726,34 @@ declare const usePlayoutStatus: () => {
|
|
|
720
726
|
};
|
|
721
727
|
declare const usePlayoutStatusUpdate: () => PlayoutStatusUpdate;
|
|
722
728
|
|
|
729
|
+
interface ScrollViewport {
|
|
730
|
+
scrollLeft: number;
|
|
731
|
+
containerWidth: number;
|
|
732
|
+
/** Left edge of the rendering window in pixels. Includes a 1.5× container-width over-scan buffer to the left of the visible area. */
|
|
733
|
+
visibleStart: number;
|
|
734
|
+
/** Right edge of the rendering window in pixels. Includes a 1.5× container-width over-scan buffer to the right of the visible area. */
|
|
735
|
+
visibleEnd: number;
|
|
736
|
+
}
|
|
737
|
+
type ScrollViewportProviderProps = {
|
|
738
|
+
containerRef: react__default.RefObject<HTMLElement | null>;
|
|
739
|
+
children: ReactNode;
|
|
740
|
+
};
|
|
741
|
+
declare const ScrollViewportProvider: ({ containerRef, children, }: ScrollViewportProviderProps) => react_jsx_runtime.JSX.Element;
|
|
742
|
+
/**
|
|
743
|
+
* Full viewport hook — re-renders on every viewport update (after threshold).
|
|
744
|
+
* Use useScrollViewportSelector() instead when you only need derived state.
|
|
745
|
+
*/
|
|
746
|
+
declare const useScrollViewport: () => ScrollViewport | null;
|
|
747
|
+
/**
|
|
748
|
+
* Selector hook — only re-renders when the selector's return value changes
|
|
749
|
+
* (compared via Object.is). Return primitive values (strings, numbers) for
|
|
750
|
+
* best results, since objects/arrays create new references each call.
|
|
751
|
+
*
|
|
752
|
+
* Example: compute visible chunk key so the component only re-renders when
|
|
753
|
+
* the set of visible chunks actually changes, not on every scroll update.
|
|
754
|
+
*/
|
|
755
|
+
declare function useScrollViewportSelector<T>(selector: (viewport: ScrollViewport | null) => T): T;
|
|
756
|
+
|
|
723
757
|
declare function samplesToSeconds(samples: number, sampleRate: number): number;
|
|
724
758
|
declare function secondsToSamples(seconds: number, sampleRate: number): number;
|
|
725
759
|
declare function samplesToPixels(samples: number, samplesPerPixel: number): number;
|
|
@@ -793,4 +827,4 @@ declare const BaseSlider: styled_components_dist_types.IStyledComponentBase<"web
|
|
|
793
827
|
ref?: ((instance: HTMLInputElement | null) => void | react.DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof react.DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) | react.RefObject<HTMLInputElement> | null | undefined;
|
|
794
828
|
}>, never>, never>> & string;
|
|
795
829
|
|
|
796
|
-
export { AudioPosition, type AudioPositionProps, AutomaticScrollCheckbox, type AutomaticScrollCheckboxProps, BaseButton, BaseCheckbox, BaseCheckboxLabel, BaseCheckboxWrapper, BaseControlButton, BaseInput, BaseLabel, BaseSelect, BaseSlider, Button, ButtonGroup, CLIP_BOUNDARY_WIDTH, CLIP_BOUNDARY_WIDTH_TOUCH, CLIP_HEADER_HEIGHT, Channel, type ChannelProps, Clip, ClipBoundary, type ClipBoundaryProps, ClipHeader, ClipHeaderPresentational, type ClipHeaderPresentationalProps, type ClipHeaderProps, type ClipProps, CloseButton, Controls$1 as Controls, type ControlsWrapperProps, DevicePixelRatioProvider, DotsIcon, type DragHandleProps$1 as DragHandleProps, FadeOverlay, type FadeOverlayProps, type GradientStop, Header, InlineLabel, LoopRegion, LoopRegionMarkers, type LoopRegionMarkersProps, type LoopRegionProps, MasterVolumeControl, type MasterVolumeControlProps, Playhead, type PlayheadProps, PlayheadWithMarker, Playlist, PlaylistErrorBoundary, type PlaylistErrorBoundaryProps, PlaylistInfoContext, type PlaylistProps, PlayoutProvider, type RenderPlayheadFunction, ScreenReaderOnly, Selection, type SelectionProps, SelectionTimeInputs, type SelectionTimeInputsProps, Slider, SliderWrapper, SmartChannel, type SmartChannelProps, SmartScale, type SmartScaleProps, SpectrogramChannel, type SpectrogramChannelProps, SpectrogramLabels, type SpectrogramLabelsProps, type SpectrogramWorkerCanvasApi, StyledPlaylist, StyledTimeScale, type TimeFormat, TimeFormatSelect, type TimeFormatSelectProps, TimeInput, type TimeInputProps, TimeScale, type TimeScaleProps, TimescaleLoopRegion, type TimescaleLoopRegionProps, Track, TrackControlsContext, TrackMenu, type TrackMenuItem, type TrackMenuProps, type TrackProps, TrashIcon, VolumeDownIcon, VolumeUpIcon, type WaveformColor, type WaveformDrawMode, type WaveformGradient, type WaveformPlaylistTheme, darkTheme, defaultTheme, formatTime, isWaveformGradient, parseTime, pixelsToSamples, pixelsToSeconds, samplesToPixels, samplesToSeconds, secondsToPixels, secondsToSamples, useDevicePixelRatio, usePlaylistInfo, usePlayoutStatus, usePlayoutStatusUpdate, useTheme, useTrackControls, waveformColorToCss };
|
|
830
|
+
export { AudioPosition, type AudioPositionProps, AutomaticScrollCheckbox, type AutomaticScrollCheckboxProps, BaseButton, BaseCheckbox, BaseCheckboxLabel, BaseCheckboxWrapper, BaseControlButton, BaseInput, BaseLabel, BaseSelect, BaseSlider, Button, ButtonGroup, CLIP_BOUNDARY_WIDTH, CLIP_BOUNDARY_WIDTH_TOUCH, CLIP_HEADER_HEIGHT, Channel, type ChannelProps, Clip, ClipBoundary, type ClipBoundaryProps, ClipHeader, ClipHeaderPresentational, type ClipHeaderPresentationalProps, type ClipHeaderProps, type ClipProps, CloseButton, Controls$1 as Controls, type ControlsWrapperProps, DevicePixelRatioProvider, DotsIcon, type DragHandleProps$1 as DragHandleProps, FadeOverlay, type FadeOverlayProps, type GradientStop, Header, InlineLabel, LoopRegion, LoopRegionMarkers, type LoopRegionMarkersProps, type LoopRegionProps, MAX_CANVAS_WIDTH, MasterVolumeControl, type MasterVolumeControlProps, Playhead, type PlayheadProps, PlayheadWithMarker, Playlist, PlaylistErrorBoundary, type PlaylistErrorBoundaryProps, PlaylistInfoContext, type PlaylistProps, PlayoutProvider, type RenderPlayheadFunction, ScreenReaderOnly, type ScrollViewport, ScrollViewportProvider, Selection, type SelectionProps, SelectionTimeInputs, type SelectionTimeInputsProps, Slider, SliderWrapper, SmartChannel, type SmartChannelProps, SmartScale, type SmartScaleProps, SpectrogramChannel, type SpectrogramChannelProps, SpectrogramLabels, type SpectrogramLabelsProps, type SpectrogramWorkerCanvasApi, StyledPlaylist, StyledTimeScale, type TimeFormat, TimeFormatSelect, type TimeFormatSelectProps, TimeInput, type TimeInputProps, TimeScale, type TimeScaleProps, TimescaleLoopRegion, type TimescaleLoopRegionProps, Track, TrackControlsContext, TrackMenu, type TrackMenuItem, type TrackMenuProps, type TrackProps, TrashIcon, VolumeDownIcon, VolumeUpIcon, type WaveformColor, type WaveformDrawMode, type WaveformGradient, type WaveformPlaylistTheme, darkTheme, defaultTheme, formatTime, isWaveformGradient, parseTime, pixelsToSamples, pixelsToSeconds, samplesToPixels, samplesToSeconds, secondsToPixels, secondsToSamples, useDevicePixelRatio, usePlaylistInfo, usePlayoutStatus, usePlayoutStatusUpdate, useScrollViewport, useScrollViewportSelector, useTheme, useTrackControls, waveformColorToCss };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
2
|
import react__default, { FunctionComponent, ReactNode, Dispatch, SetStateAction } from 'react';
|
|
3
|
-
import { Peaks, Bits } from '@waveform-playlist/
|
|
4
|
-
import { Fade, FadeType, SpectrogramData, RenderMode } from '@waveform-playlist/core';
|
|
3
|
+
import { Peaks, Bits, Fade, FadeType, SpectrogramData, RenderMode } from '@waveform-playlist/core';
|
|
5
4
|
import { DraggableAttributes } from '@dnd-kit/core';
|
|
6
5
|
import { SyntheticListenerMap } from '@dnd-kit/core/dist/hooks/utilities';
|
|
7
6
|
import * as styled_components_dist_utils_hoist from 'styled-components/dist/utils/hoist';
|
|
@@ -670,6 +669,13 @@ interface TrackMenuProps {
|
|
|
670
669
|
}
|
|
671
670
|
declare const TrackMenu: react__default.FC<TrackMenuProps>;
|
|
672
671
|
|
|
672
|
+
/**
|
|
673
|
+
* Maximum width in CSS pixels for a single canvas chunk.
|
|
674
|
+
* Canvas elements are split into chunks of this width to enable
|
|
675
|
+
* horizontal virtual scrolling — only visible chunks are mounted.
|
|
676
|
+
*/
|
|
677
|
+
declare const MAX_CANVAS_WIDTH = 1000;
|
|
678
|
+
|
|
673
679
|
type Props$1 = {
|
|
674
680
|
children: ReactNode;
|
|
675
681
|
};
|
|
@@ -720,6 +726,34 @@ declare const usePlayoutStatus: () => {
|
|
|
720
726
|
};
|
|
721
727
|
declare const usePlayoutStatusUpdate: () => PlayoutStatusUpdate;
|
|
722
728
|
|
|
729
|
+
interface ScrollViewport {
|
|
730
|
+
scrollLeft: number;
|
|
731
|
+
containerWidth: number;
|
|
732
|
+
/** Left edge of the rendering window in pixels. Includes a 1.5× container-width over-scan buffer to the left of the visible area. */
|
|
733
|
+
visibleStart: number;
|
|
734
|
+
/** Right edge of the rendering window in pixels. Includes a 1.5× container-width over-scan buffer to the right of the visible area. */
|
|
735
|
+
visibleEnd: number;
|
|
736
|
+
}
|
|
737
|
+
type ScrollViewportProviderProps = {
|
|
738
|
+
containerRef: react__default.RefObject<HTMLElement | null>;
|
|
739
|
+
children: ReactNode;
|
|
740
|
+
};
|
|
741
|
+
declare const ScrollViewportProvider: ({ containerRef, children, }: ScrollViewportProviderProps) => react_jsx_runtime.JSX.Element;
|
|
742
|
+
/**
|
|
743
|
+
* Full viewport hook — re-renders on every viewport update (after threshold).
|
|
744
|
+
* Use useScrollViewportSelector() instead when you only need derived state.
|
|
745
|
+
*/
|
|
746
|
+
declare const useScrollViewport: () => ScrollViewport | null;
|
|
747
|
+
/**
|
|
748
|
+
* Selector hook — only re-renders when the selector's return value changes
|
|
749
|
+
* (compared via Object.is). Return primitive values (strings, numbers) for
|
|
750
|
+
* best results, since objects/arrays create new references each call.
|
|
751
|
+
*
|
|
752
|
+
* Example: compute visible chunk key so the component only re-renders when
|
|
753
|
+
* the set of visible chunks actually changes, not on every scroll update.
|
|
754
|
+
*/
|
|
755
|
+
declare function useScrollViewportSelector<T>(selector: (viewport: ScrollViewport | null) => T): T;
|
|
756
|
+
|
|
723
757
|
declare function samplesToSeconds(samples: number, sampleRate: number): number;
|
|
724
758
|
declare function secondsToSamples(seconds: number, sampleRate: number): number;
|
|
725
759
|
declare function samplesToPixels(samples: number, samplesPerPixel: number): number;
|
|
@@ -793,4 +827,4 @@ declare const BaseSlider: styled_components_dist_types.IStyledComponentBase<"web
|
|
|
793
827
|
ref?: ((instance: HTMLInputElement | null) => void | react.DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof react.DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) | react.RefObject<HTMLInputElement> | null | undefined;
|
|
794
828
|
}>, never>, never>> & string;
|
|
795
829
|
|
|
796
|
-
export { AudioPosition, type AudioPositionProps, AutomaticScrollCheckbox, type AutomaticScrollCheckboxProps, BaseButton, BaseCheckbox, BaseCheckboxLabel, BaseCheckboxWrapper, BaseControlButton, BaseInput, BaseLabel, BaseSelect, BaseSlider, Button, ButtonGroup, CLIP_BOUNDARY_WIDTH, CLIP_BOUNDARY_WIDTH_TOUCH, CLIP_HEADER_HEIGHT, Channel, type ChannelProps, Clip, ClipBoundary, type ClipBoundaryProps, ClipHeader, ClipHeaderPresentational, type ClipHeaderPresentationalProps, type ClipHeaderProps, type ClipProps, CloseButton, Controls$1 as Controls, type ControlsWrapperProps, DevicePixelRatioProvider, DotsIcon, type DragHandleProps$1 as DragHandleProps, FadeOverlay, type FadeOverlayProps, type GradientStop, Header, InlineLabel, LoopRegion, LoopRegionMarkers, type LoopRegionMarkersProps, type LoopRegionProps, MasterVolumeControl, type MasterVolumeControlProps, Playhead, type PlayheadProps, PlayheadWithMarker, Playlist, PlaylistErrorBoundary, type PlaylistErrorBoundaryProps, PlaylistInfoContext, type PlaylistProps, PlayoutProvider, type RenderPlayheadFunction, ScreenReaderOnly, Selection, type SelectionProps, SelectionTimeInputs, type SelectionTimeInputsProps, Slider, SliderWrapper, SmartChannel, type SmartChannelProps, SmartScale, type SmartScaleProps, SpectrogramChannel, type SpectrogramChannelProps, SpectrogramLabels, type SpectrogramLabelsProps, type SpectrogramWorkerCanvasApi, StyledPlaylist, StyledTimeScale, type TimeFormat, TimeFormatSelect, type TimeFormatSelectProps, TimeInput, type TimeInputProps, TimeScale, type TimeScaleProps, TimescaleLoopRegion, type TimescaleLoopRegionProps, Track, TrackControlsContext, TrackMenu, type TrackMenuItem, type TrackMenuProps, type TrackProps, TrashIcon, VolumeDownIcon, VolumeUpIcon, type WaveformColor, type WaveformDrawMode, type WaveformGradient, type WaveformPlaylistTheme, darkTheme, defaultTheme, formatTime, isWaveformGradient, parseTime, pixelsToSamples, pixelsToSeconds, samplesToPixels, samplesToSeconds, secondsToPixels, secondsToSamples, useDevicePixelRatio, usePlaylistInfo, usePlayoutStatus, usePlayoutStatusUpdate, useTheme, useTrackControls, waveformColorToCss };
|
|
830
|
+
export { AudioPosition, type AudioPositionProps, AutomaticScrollCheckbox, type AutomaticScrollCheckboxProps, BaseButton, BaseCheckbox, BaseCheckboxLabel, BaseCheckboxWrapper, BaseControlButton, BaseInput, BaseLabel, BaseSelect, BaseSlider, Button, ButtonGroup, CLIP_BOUNDARY_WIDTH, CLIP_BOUNDARY_WIDTH_TOUCH, CLIP_HEADER_HEIGHT, Channel, type ChannelProps, Clip, ClipBoundary, type ClipBoundaryProps, ClipHeader, ClipHeaderPresentational, type ClipHeaderPresentationalProps, type ClipHeaderProps, type ClipProps, CloseButton, Controls$1 as Controls, type ControlsWrapperProps, DevicePixelRatioProvider, DotsIcon, type DragHandleProps$1 as DragHandleProps, FadeOverlay, type FadeOverlayProps, type GradientStop, Header, InlineLabel, LoopRegion, LoopRegionMarkers, type LoopRegionMarkersProps, type LoopRegionProps, MAX_CANVAS_WIDTH, MasterVolumeControl, type MasterVolumeControlProps, Playhead, type PlayheadProps, PlayheadWithMarker, Playlist, PlaylistErrorBoundary, type PlaylistErrorBoundaryProps, PlaylistInfoContext, type PlaylistProps, PlayoutProvider, type RenderPlayheadFunction, ScreenReaderOnly, type ScrollViewport, ScrollViewportProvider, Selection, type SelectionProps, SelectionTimeInputs, type SelectionTimeInputsProps, Slider, SliderWrapper, SmartChannel, type SmartChannelProps, SmartScale, type SmartScaleProps, SpectrogramChannel, type SpectrogramChannelProps, SpectrogramLabels, type SpectrogramLabelsProps, type SpectrogramWorkerCanvasApi, StyledPlaylist, StyledTimeScale, type TimeFormat, TimeFormatSelect, type TimeFormatSelectProps, TimeInput, type TimeInputProps, TimeScale, type TimeScaleProps, TimescaleLoopRegion, type TimescaleLoopRegionProps, Track, TrackControlsContext, TrackMenu, type TrackMenuItem, type TrackMenuProps, type TrackProps, TrashIcon, VolumeDownIcon, VolumeUpIcon, type WaveformColor, type WaveformDrawMode, type WaveformGradient, type WaveformPlaylistTheme, darkTheme, defaultTheme, formatTime, isWaveformGradient, parseTime, pixelsToSamples, pixelsToSeconds, samplesToPixels, samplesToSeconds, secondsToPixels, secondsToSamples, useDevicePixelRatio, usePlaylistInfo, usePlayoutStatus, usePlayoutStatusUpdate, useScrollViewport, useScrollViewportSelector, useTheme, useTrackControls, waveformColorToCss };
|