@waveform-playlist/ui-components 5.0.0-alpha.3 → 5.0.0-alpha.4
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 +10 -1
- package/dist/index.d.ts +10 -1
- package/dist/index.js +13 -3
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +12 -3
- package/dist/index.mjs.map +1 -1
- package/package.json +5 -5
package/dist/index.d.mts
CHANGED
|
@@ -170,6 +170,7 @@ interface ClipProps {
|
|
|
170
170
|
fadeOut?: Fade;
|
|
171
171
|
sampleRate?: number;
|
|
172
172
|
showFades?: boolean;
|
|
173
|
+
touchOptimized?: boolean;
|
|
173
174
|
}
|
|
174
175
|
/**
|
|
175
176
|
* Clip component for rendering individual audio clips within a track
|
|
@@ -216,6 +217,7 @@ interface ClipHeaderProps {
|
|
|
216
217
|
declare const ClipHeader: FunctionComponent<ClipHeaderProps>;
|
|
217
218
|
|
|
218
219
|
declare const CLIP_BOUNDARY_WIDTH = 8;
|
|
220
|
+
declare const CLIP_BOUNDARY_WIDTH_TOUCH = 24;
|
|
219
221
|
type BoundaryEdge = 'left' | 'right';
|
|
220
222
|
interface DragHandleProps extends DragHandleProps$1 {
|
|
221
223
|
isDragging?: boolean;
|
|
@@ -226,6 +228,11 @@ interface ClipBoundaryProps {
|
|
|
226
228
|
clipIndex: number;
|
|
227
229
|
edge: BoundaryEdge;
|
|
228
230
|
dragHandleProps?: DragHandleProps;
|
|
231
|
+
/**
|
|
232
|
+
* Enable larger touch targets for mobile devices.
|
|
233
|
+
* When true, boundary width increases from 8px to 24px for easier touch targeting.
|
|
234
|
+
*/
|
|
235
|
+
touchOptimized?: boolean;
|
|
229
236
|
}
|
|
230
237
|
/**
|
|
231
238
|
* ClipBoundary component - Draggable edge for trimming clips
|
|
@@ -233,6 +240,8 @@ interface ClipBoundaryProps {
|
|
|
233
240
|
* Renders at the left or right edge of a clip.
|
|
234
241
|
* Drag to trim the clip (adjust offset and duration).
|
|
235
242
|
* Supports bidirectional trimming (trim in and out).
|
|
243
|
+
*
|
|
244
|
+
* On mobile (touchOptimized=true), boundaries are wider for easier targeting.
|
|
236
245
|
*/
|
|
237
246
|
declare const ClipBoundary: FunctionComponent<ClipBoundaryProps>;
|
|
238
247
|
|
|
@@ -639,4 +648,4 @@ declare const BaseSlider: styled_components_dist_types.IStyledComponentBase<"web
|
|
|
639
648
|
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
649
|
}>, never>, never>> & string;
|
|
641
650
|
|
|
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 };
|
|
651
|
+
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, 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 };
|
package/dist/index.d.ts
CHANGED
|
@@ -170,6 +170,7 @@ interface ClipProps {
|
|
|
170
170
|
fadeOut?: Fade;
|
|
171
171
|
sampleRate?: number;
|
|
172
172
|
showFades?: boolean;
|
|
173
|
+
touchOptimized?: boolean;
|
|
173
174
|
}
|
|
174
175
|
/**
|
|
175
176
|
* Clip component for rendering individual audio clips within a track
|
|
@@ -216,6 +217,7 @@ interface ClipHeaderProps {
|
|
|
216
217
|
declare const ClipHeader: FunctionComponent<ClipHeaderProps>;
|
|
217
218
|
|
|
218
219
|
declare const CLIP_BOUNDARY_WIDTH = 8;
|
|
220
|
+
declare const CLIP_BOUNDARY_WIDTH_TOUCH = 24;
|
|
219
221
|
type BoundaryEdge = 'left' | 'right';
|
|
220
222
|
interface DragHandleProps extends DragHandleProps$1 {
|
|
221
223
|
isDragging?: boolean;
|
|
@@ -226,6 +228,11 @@ interface ClipBoundaryProps {
|
|
|
226
228
|
clipIndex: number;
|
|
227
229
|
edge: BoundaryEdge;
|
|
228
230
|
dragHandleProps?: DragHandleProps;
|
|
231
|
+
/**
|
|
232
|
+
* Enable larger touch targets for mobile devices.
|
|
233
|
+
* When true, boundary width increases from 8px to 24px for easier touch targeting.
|
|
234
|
+
*/
|
|
235
|
+
touchOptimized?: boolean;
|
|
229
236
|
}
|
|
230
237
|
/**
|
|
231
238
|
* ClipBoundary component - Draggable edge for trimming clips
|
|
@@ -233,6 +240,8 @@ interface ClipBoundaryProps {
|
|
|
233
240
|
* Renders at the left or right edge of a clip.
|
|
234
241
|
* Drag to trim the clip (adjust offset and duration).
|
|
235
242
|
* Supports bidirectional trimming (trim in and out).
|
|
243
|
+
*
|
|
244
|
+
* On mobile (touchOptimized=true), boundaries are wider for easier targeting.
|
|
236
245
|
*/
|
|
237
246
|
declare const ClipBoundary: FunctionComponent<ClipBoundaryProps>;
|
|
238
247
|
|
|
@@ -639,4 +648,4 @@ declare const BaseSlider: styled_components_dist_types.IStyledComponentBase<"web
|
|
|
639
648
|
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
649
|
}>, never>, never>> & string;
|
|
641
650
|
|
|
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 };
|
|
651
|
+
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, 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 };
|
package/dist/index.js
CHANGED
|
@@ -44,6 +44,7 @@ __export(index_exports, {
|
|
|
44
44
|
Button: () => Button,
|
|
45
45
|
ButtonGroup: () => ButtonGroup,
|
|
46
46
|
CLIP_BOUNDARY_WIDTH: () => CLIP_BOUNDARY_WIDTH,
|
|
47
|
+
CLIP_BOUNDARY_WIDTH_TOUCH: () => CLIP_BOUNDARY_WIDTH_TOUCH,
|
|
47
48
|
CLIP_HEADER_HEIGHT: () => CLIP_HEADER_HEIGHT,
|
|
48
49
|
Channel: () => Channel,
|
|
49
50
|
Clip: () => Clip,
|
|
@@ -772,6 +773,7 @@ var HeaderContainer = import_styled_components10.default.div`
|
|
|
772
773
|
z-index: 110;
|
|
773
774
|
flex-shrink: 0;
|
|
774
775
|
pointer-events: auto; /* Re-enable pointer events (parent ClipContainer has pointer-events: none) */
|
|
776
|
+
touch-action: ${(props) => props.$interactive ? "none" : "auto"}; /* Prevent browser scroll during drag on touch devices */
|
|
775
777
|
|
|
776
778
|
${(props) => props.$interactive && `
|
|
777
779
|
&:hover {
|
|
@@ -844,16 +846,18 @@ var import_react2 = __toESM(require("react"));
|
|
|
844
846
|
var import_styled_components11 = __toESM(require("styled-components"));
|
|
845
847
|
var import_jsx_runtime5 = require("react/jsx-runtime");
|
|
846
848
|
var CLIP_BOUNDARY_WIDTH = 8;
|
|
849
|
+
var CLIP_BOUNDARY_WIDTH_TOUCH = 24;
|
|
847
850
|
var BoundaryContainer = import_styled_components11.default.div`
|
|
848
851
|
position: absolute;
|
|
849
852
|
${(props) => props.$edge === "left" ? "left: 0;" : "right: 0;"}
|
|
850
853
|
top: 0;
|
|
851
854
|
bottom: 0;
|
|
852
|
-
width: ${CLIP_BOUNDARY_WIDTH}px;
|
|
855
|
+
width: ${(props) => props.$touchOptimized ? CLIP_BOUNDARY_WIDTH_TOUCH : CLIP_BOUNDARY_WIDTH}px;
|
|
853
856
|
cursor: col-resize;
|
|
854
857
|
user-select: none;
|
|
855
858
|
z-index: 105; /* Above waveform, below header */
|
|
856
859
|
pointer-events: auto; /* Re-enable pointer events (parent ClipContainer has pointer-events: none) */
|
|
860
|
+
touch-action: none; /* Prevent browser scroll during drag on touch devices */
|
|
857
861
|
|
|
858
862
|
/* Invisible by default, visible on hover */
|
|
859
863
|
background: ${(props) => props.$isDragging ? "rgba(255, 255, 255, 0.4)" : props.$isHovered ? "rgba(255, 255, 255, 0.2)" : "transparent"};
|
|
@@ -877,7 +881,8 @@ var ClipBoundary = ({
|
|
|
877
881
|
trackIndex,
|
|
878
882
|
clipIndex,
|
|
879
883
|
edge,
|
|
880
|
-
dragHandleProps
|
|
884
|
+
dragHandleProps,
|
|
885
|
+
touchOptimized = false
|
|
881
886
|
}) => {
|
|
882
887
|
const [isHovered, setIsHovered] = import_react2.default.useState(false);
|
|
883
888
|
if (!dragHandleProps) {
|
|
@@ -893,6 +898,7 @@ var ClipBoundary = ({
|
|
|
893
898
|
$edge: edge,
|
|
894
899
|
$isDragging: isDragging,
|
|
895
900
|
$isHovered: isHovered,
|
|
901
|
+
$touchOptimized: touchOptimized,
|
|
896
902
|
onMouseEnter: () => setIsHovered(true),
|
|
897
903
|
onMouseLeave: () => setIsHovered(false),
|
|
898
904
|
...listeners,
|
|
@@ -1015,7 +1021,8 @@ var Clip = ({
|
|
|
1015
1021
|
fadeIn,
|
|
1016
1022
|
fadeOut,
|
|
1017
1023
|
sampleRate = 44100,
|
|
1018
|
-
showFades = false
|
|
1024
|
+
showFades = false,
|
|
1025
|
+
touchOptimized = false
|
|
1019
1026
|
}) => {
|
|
1020
1027
|
const left = Math.floor(startSample / samplesPerPixel);
|
|
1021
1028
|
const endPixel = Math.floor((startSample + durationSamples) / samplesPerPixel);
|
|
@@ -1108,6 +1115,7 @@ var Clip = ({
|
|
|
1108
1115
|
trackIndex,
|
|
1109
1116
|
clipIndex,
|
|
1110
1117
|
edge: "left",
|
|
1118
|
+
touchOptimized,
|
|
1111
1119
|
dragHandleProps: {
|
|
1112
1120
|
attributes: leftBoundaryAttributes,
|
|
1113
1121
|
listeners: leftBoundaryListeners,
|
|
@@ -1123,6 +1131,7 @@ var Clip = ({
|
|
|
1123
1131
|
trackIndex,
|
|
1124
1132
|
clipIndex,
|
|
1125
1133
|
edge: "right",
|
|
1134
|
+
touchOptimized,
|
|
1126
1135
|
dragHandleProps: {
|
|
1127
1136
|
attributes: rightBoundaryAttributes,
|
|
1128
1137
|
listeners: rightBoundaryListeners,
|
|
@@ -2362,6 +2371,7 @@ var TrackControlsWithDelete = ({
|
|
|
2362
2371
|
Button,
|
|
2363
2372
|
ButtonGroup,
|
|
2364
2373
|
CLIP_BOUNDARY_WIDTH,
|
|
2374
|
+
CLIP_BOUNDARY_WIDTH_TOUCH,
|
|
2365
2375
|
CLIP_HEADER_HEIGHT,
|
|
2366
2376
|
Channel,
|
|
2367
2377
|
Clip,
|