@waveform-playlist/ui-components 5.0.0-alpha.0 → 5.0.0-alpha.10

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 CHANGED
@@ -84,6 +84,8 @@ interface WaveformPlaylistTheme {
84
84
  timescaleBackgroundColor: string;
85
85
  playheadColor: string;
86
86
  selectionColor: string;
87
+ loopRegionColor: string;
88
+ loopMarkerColor: string;
87
89
  clipHeaderBackgroundColor: string;
88
90
  clipHeaderBorderColor: string;
89
91
  clipHeaderTextColor: string;
@@ -170,6 +172,7 @@ interface ClipProps {
170
172
  fadeOut?: Fade;
171
173
  sampleRate?: number;
172
174
  showFades?: boolean;
175
+ touchOptimized?: boolean;
173
176
  }
174
177
  /**
175
178
  * Clip component for rendering individual audio clips within a track
@@ -216,6 +219,7 @@ interface ClipHeaderProps {
216
219
  declare const ClipHeader: FunctionComponent<ClipHeaderProps>;
217
220
 
218
221
  declare const CLIP_BOUNDARY_WIDTH = 8;
222
+ declare const CLIP_BOUNDARY_WIDTH_TOUCH = 24;
219
223
  type BoundaryEdge = 'left' | 'right';
220
224
  interface DragHandleProps extends DragHandleProps$1 {
221
225
  isDragging?: boolean;
@@ -226,6 +230,11 @@ interface ClipBoundaryProps {
226
230
  clipIndex: number;
227
231
  edge: BoundaryEdge;
228
232
  dragHandleProps?: DragHandleProps;
233
+ /**
234
+ * Enable larger touch targets for mobile devices.
235
+ * When true, boundary width increases from 8px to 24px for easier touch targeting.
236
+ */
237
+ touchOptimized?: boolean;
229
238
  }
230
239
  /**
231
240
  * ClipBoundary component - Draggable edge for trimming clips
@@ -233,6 +242,8 @@ interface ClipBoundaryProps {
233
242
  * Renders at the left or right edge of a clip.
234
243
  * Drag to trim the clip (adjust offset and duration).
235
244
  * Supports bidirectional trimming (trim in and out).
245
+ *
246
+ * On mobile (touchOptimized=true), boundaries are wider for easier targeting.
236
247
  */
237
248
  declare const ClipBoundary: FunctionComponent<ClipBoundaryProps>;
238
249
 
@@ -326,6 +337,8 @@ interface PlaylistProps {
326
337
  readonly onTracksMouseMove?: (e: react__default.MouseEvent<HTMLDivElement>) => void;
327
338
  readonly onTracksMouseUp?: (e: react__default.MouseEvent<HTMLDivElement>) => void;
328
339
  readonly scrollContainerRef?: (el: HTMLDivElement | null) => void;
340
+ /** When true, selection is in progress - raises z-index to prevent clip boundary interference */
341
+ readonly isSelecting?: boolean;
329
342
  }
330
343
  declare const Playlist: FunctionComponent<PlaylistProps>;
331
344
  declare const StyledPlaylist: react__default.ForwardRefExoticComponent<styled_components.ExecutionProps & react__default.RefAttributes<react__default.FunctionComponent<PlaylistProps>>> & styled_components_dist_utils_hoist.NonReactStatics<react__default.FunctionComponent<PlaylistProps>>;
@@ -337,6 +350,61 @@ interface SelectionProps {
337
350
  }
338
351
  declare const Selection: react__default.FC<SelectionProps>;
339
352
 
353
+ interface LoopRegionProps {
354
+ startPosition: number;
355
+ endPosition: number;
356
+ regionColor?: string;
357
+ markerColor?: string;
358
+ }
359
+ /**
360
+ * Loop region overlay with non-interactive markers.
361
+ * This renders over the tracks area - markers are visual only here.
362
+ */
363
+ declare const LoopRegion: react__default.FC<LoopRegionProps>;
364
+ interface LoopRegionMarkersProps {
365
+ startPosition: number;
366
+ endPosition: number;
367
+ markerColor?: string;
368
+ regionColor?: string;
369
+ onLoopStartChange?: (newPositionPixels: number) => void;
370
+ onLoopEndChange?: (newPositionPixels: number) => void;
371
+ /** Called when the entire region is moved */
372
+ onLoopRegionMove?: (newStartPixels: number, newEndPixels: number) => void;
373
+ /** Minimum position in pixels (usually controls width offset) */
374
+ minPosition?: number;
375
+ /** Maximum position in pixels */
376
+ maxPosition?: number;
377
+ }
378
+ /**
379
+ * Draggable loop region markers for the timescale area.
380
+ * These are interactive and can be dragged to adjust loop boundaries.
381
+ * The shaded region between markers can be dragged to move the entire loop.
382
+ */
383
+ declare const LoopRegionMarkers: react__default.FC<LoopRegionMarkersProps>;
384
+ interface TimescaleLoopRegionProps {
385
+ /** Current loop start position in pixels */
386
+ startPosition: number;
387
+ /** Current loop end position in pixels */
388
+ endPosition: number;
389
+ markerColor?: string;
390
+ regionColor?: string;
391
+ /** Called when loop region changes (start pixels, end pixels) */
392
+ onLoopRegionChange?: (startPixels: number, endPixels: number) => void;
393
+ /** Minimum position in pixels */
394
+ minPosition?: number;
395
+ /** Maximum position in pixels */
396
+ maxPosition?: number;
397
+ /** Offset for controls area (left margin) */
398
+ controlsOffset?: number;
399
+ }
400
+ /**
401
+ * Complete timescale loop region component with:
402
+ * - Click and drag to create a new loop region
403
+ * - Drag markers to resize existing loop region
404
+ * - Drag the shaded region to move the entire loop
405
+ */
406
+ declare const TimescaleLoopRegion: react__default.FC<TimescaleLoopRegionProps>;
407
+
340
408
  interface SelectionTimeInputsProps {
341
409
  selectionStart: number;
342
410
  selectionEnd: number;
@@ -639,4 +707,4 @@ declare const BaseSlider: styled_components_dist_types.IStyledComponentBase<"web
639
707
  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;
640
708
  }>, never>, never>> & string;
641
709
 
642
- export { AudioPosition, type AudioPositionProps, AutomaticScrollCheckbox, type AutomaticScrollCheckboxProps, BaseButton, BaseCheckbox, BaseCheckboxLabel, BaseCheckboxWrapper, BaseControlButton, BaseInput, BaseLabel, BaseSelect, BaseSlider, Button, ButtonGroup, CLIP_BOUNDARY_WIDTH, CLIP_HEADER_HEIGHT, Channel, type ChannelProps, Clip, ClipBoundary, type ClipBoundaryProps, ClipHeader, ClipHeaderPresentational, type ClipHeaderPresentationalProps, type ClipHeaderProps, type ClipProps, Controls$1 as Controls, type ControlsWrapperProps, DevicePixelRatioProvider, type DragHandleProps$1 as DragHandleProps, FadeOverlay, type FadeOverlayProps, type GradientStop, Header, InlineLabel, MasterVolumeControl, type MasterVolumeControlProps, Playhead, type PlayheadProps, PlayheadWithMarker, Playlist, PlaylistInfoContext, type PlaylistProps, PlayoutProvider, type RenderPlayheadFunction, ScreenReaderOnly, Selection, type SelectionProps, SelectionTimeInputs, type SelectionTimeInputsProps, Slider, SliderWrapper, SmartChannel, type SmartChannelProps, SmartScale, StyledPlaylist, StyledTimeScale, type TimeFormat, TimeFormatSelect, type TimeFormatSelectProps, TimeInput, type TimeInputProps, TimeScale, type TimeScaleProps, Track, TrackControlsContext, TrackControlsWithDelete, type TrackControlsWithDeleteProps, 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 };
710
+ 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, Controls$1 as Controls, type ControlsWrapperProps, DevicePixelRatioProvider, 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, PlaylistInfoContext, type PlaylistProps, PlayoutProvider, type RenderPlayheadFunction, ScreenReaderOnly, Selection, type SelectionProps, SelectionTimeInputs, type SelectionTimeInputsProps, Slider, SliderWrapper, SmartChannel, type SmartChannelProps, SmartScale, StyledPlaylist, StyledTimeScale, type TimeFormat, TimeFormatSelect, type TimeFormatSelectProps, TimeInput, type TimeInputProps, TimeScale, type TimeScaleProps, TimescaleLoopRegion, type TimescaleLoopRegionProps, Track, TrackControlsContext, TrackControlsWithDelete, type TrackControlsWithDeleteProps, 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 };
package/dist/index.d.ts CHANGED
@@ -84,6 +84,8 @@ interface WaveformPlaylistTheme {
84
84
  timescaleBackgroundColor: string;
85
85
  playheadColor: string;
86
86
  selectionColor: string;
87
+ loopRegionColor: string;
88
+ loopMarkerColor: string;
87
89
  clipHeaderBackgroundColor: string;
88
90
  clipHeaderBorderColor: string;
89
91
  clipHeaderTextColor: string;
@@ -170,6 +172,7 @@ interface ClipProps {
170
172
  fadeOut?: Fade;
171
173
  sampleRate?: number;
172
174
  showFades?: boolean;
175
+ touchOptimized?: boolean;
173
176
  }
174
177
  /**
175
178
  * Clip component for rendering individual audio clips within a track
@@ -216,6 +219,7 @@ interface ClipHeaderProps {
216
219
  declare const ClipHeader: FunctionComponent<ClipHeaderProps>;
217
220
 
218
221
  declare const CLIP_BOUNDARY_WIDTH = 8;
222
+ declare const CLIP_BOUNDARY_WIDTH_TOUCH = 24;
219
223
  type BoundaryEdge = 'left' | 'right';
220
224
  interface DragHandleProps extends DragHandleProps$1 {
221
225
  isDragging?: boolean;
@@ -226,6 +230,11 @@ interface ClipBoundaryProps {
226
230
  clipIndex: number;
227
231
  edge: BoundaryEdge;
228
232
  dragHandleProps?: DragHandleProps;
233
+ /**
234
+ * Enable larger touch targets for mobile devices.
235
+ * When true, boundary width increases from 8px to 24px for easier touch targeting.
236
+ */
237
+ touchOptimized?: boolean;
229
238
  }
230
239
  /**
231
240
  * ClipBoundary component - Draggable edge for trimming clips
@@ -233,6 +242,8 @@ interface ClipBoundaryProps {
233
242
  * Renders at the left or right edge of a clip.
234
243
  * Drag to trim the clip (adjust offset and duration).
235
244
  * Supports bidirectional trimming (trim in and out).
245
+ *
246
+ * On mobile (touchOptimized=true), boundaries are wider for easier targeting.
236
247
  */
237
248
  declare const ClipBoundary: FunctionComponent<ClipBoundaryProps>;
238
249
 
@@ -326,6 +337,8 @@ interface PlaylistProps {
326
337
  readonly onTracksMouseMove?: (e: react__default.MouseEvent<HTMLDivElement>) => void;
327
338
  readonly onTracksMouseUp?: (e: react__default.MouseEvent<HTMLDivElement>) => void;
328
339
  readonly scrollContainerRef?: (el: HTMLDivElement | null) => void;
340
+ /** When true, selection is in progress - raises z-index to prevent clip boundary interference */
341
+ readonly isSelecting?: boolean;
329
342
  }
330
343
  declare const Playlist: FunctionComponent<PlaylistProps>;
331
344
  declare const StyledPlaylist: react__default.ForwardRefExoticComponent<styled_components.ExecutionProps & react__default.RefAttributes<react__default.FunctionComponent<PlaylistProps>>> & styled_components_dist_utils_hoist.NonReactStatics<react__default.FunctionComponent<PlaylistProps>>;
@@ -337,6 +350,61 @@ interface SelectionProps {
337
350
  }
338
351
  declare const Selection: react__default.FC<SelectionProps>;
339
352
 
353
+ interface LoopRegionProps {
354
+ startPosition: number;
355
+ endPosition: number;
356
+ regionColor?: string;
357
+ markerColor?: string;
358
+ }
359
+ /**
360
+ * Loop region overlay with non-interactive markers.
361
+ * This renders over the tracks area - markers are visual only here.
362
+ */
363
+ declare const LoopRegion: react__default.FC<LoopRegionProps>;
364
+ interface LoopRegionMarkersProps {
365
+ startPosition: number;
366
+ endPosition: number;
367
+ markerColor?: string;
368
+ regionColor?: string;
369
+ onLoopStartChange?: (newPositionPixels: number) => void;
370
+ onLoopEndChange?: (newPositionPixels: number) => void;
371
+ /** Called when the entire region is moved */
372
+ onLoopRegionMove?: (newStartPixels: number, newEndPixels: number) => void;
373
+ /** Minimum position in pixels (usually controls width offset) */
374
+ minPosition?: number;
375
+ /** Maximum position in pixels */
376
+ maxPosition?: number;
377
+ }
378
+ /**
379
+ * Draggable loop region markers for the timescale area.
380
+ * These are interactive and can be dragged to adjust loop boundaries.
381
+ * The shaded region between markers can be dragged to move the entire loop.
382
+ */
383
+ declare const LoopRegionMarkers: react__default.FC<LoopRegionMarkersProps>;
384
+ interface TimescaleLoopRegionProps {
385
+ /** Current loop start position in pixels */
386
+ startPosition: number;
387
+ /** Current loop end position in pixels */
388
+ endPosition: number;
389
+ markerColor?: string;
390
+ regionColor?: string;
391
+ /** Called when loop region changes (start pixels, end pixels) */
392
+ onLoopRegionChange?: (startPixels: number, endPixels: number) => void;
393
+ /** Minimum position in pixels */
394
+ minPosition?: number;
395
+ /** Maximum position in pixels */
396
+ maxPosition?: number;
397
+ /** Offset for controls area (left margin) */
398
+ controlsOffset?: number;
399
+ }
400
+ /**
401
+ * Complete timescale loop region component with:
402
+ * - Click and drag to create a new loop region
403
+ * - Drag markers to resize existing loop region
404
+ * - Drag the shaded region to move the entire loop
405
+ */
406
+ declare const TimescaleLoopRegion: react__default.FC<TimescaleLoopRegionProps>;
407
+
340
408
  interface SelectionTimeInputsProps {
341
409
  selectionStart: number;
342
410
  selectionEnd: number;
@@ -639,4 +707,4 @@ declare const BaseSlider: styled_components_dist_types.IStyledComponentBase<"web
639
707
  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;
640
708
  }>, never>, never>> & string;
641
709
 
642
- export { AudioPosition, type AudioPositionProps, AutomaticScrollCheckbox, type AutomaticScrollCheckboxProps, BaseButton, BaseCheckbox, BaseCheckboxLabel, BaseCheckboxWrapper, BaseControlButton, BaseInput, BaseLabel, BaseSelect, BaseSlider, Button, ButtonGroup, CLIP_BOUNDARY_WIDTH, CLIP_HEADER_HEIGHT, Channel, type ChannelProps, Clip, ClipBoundary, type ClipBoundaryProps, ClipHeader, ClipHeaderPresentational, type ClipHeaderPresentationalProps, type ClipHeaderProps, type ClipProps, Controls$1 as Controls, type ControlsWrapperProps, DevicePixelRatioProvider, type DragHandleProps$1 as DragHandleProps, FadeOverlay, type FadeOverlayProps, type GradientStop, Header, InlineLabel, MasterVolumeControl, type MasterVolumeControlProps, Playhead, type PlayheadProps, PlayheadWithMarker, Playlist, PlaylistInfoContext, type PlaylistProps, PlayoutProvider, type RenderPlayheadFunction, ScreenReaderOnly, Selection, type SelectionProps, SelectionTimeInputs, type SelectionTimeInputsProps, Slider, SliderWrapper, SmartChannel, type SmartChannelProps, SmartScale, StyledPlaylist, StyledTimeScale, type TimeFormat, TimeFormatSelect, type TimeFormatSelectProps, TimeInput, type TimeInputProps, TimeScale, type TimeScaleProps, Track, TrackControlsContext, TrackControlsWithDelete, type TrackControlsWithDeleteProps, 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 };
710
+ 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, Controls$1 as Controls, type ControlsWrapperProps, DevicePixelRatioProvider, 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, PlaylistInfoContext, type PlaylistProps, PlayoutProvider, type RenderPlayheadFunction, ScreenReaderOnly, Selection, type SelectionProps, SelectionTimeInputs, type SelectionTimeInputsProps, Slider, SliderWrapper, SmartChannel, type SmartChannelProps, SmartScale, StyledPlaylist, StyledTimeScale, type TimeFormat, TimeFormatSelect, type TimeFormatSelectProps, TimeInput, type TimeInputProps, TimeScale, type TimeScaleProps, TimescaleLoopRegion, type TimescaleLoopRegionProps, Track, TrackControlsContext, TrackControlsWithDelete, type TrackControlsWithDeleteProps, 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 };