@waveform-playlist/ui-components 15.0.0-next.11 → 15.0.0-next.13
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/README.md +0 -1
- package/dist/index.d.mts +2 -27
- package/dist/index.d.ts +2 -27
- package/dist/index.js +13 -135
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +16 -136
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
package/dist/index.mjs
CHANGED
|
@@ -35,21 +35,6 @@ var BaseButton = styled.button`
|
|
|
35
35
|
cursor: not-allowed;
|
|
36
36
|
}
|
|
37
37
|
`;
|
|
38
|
-
var BaseButtonSmall = styled(BaseButton)`
|
|
39
|
-
padding: 0.25rem 0.5rem;
|
|
40
|
-
font-size: ${(props) => props.theme.fontSizeSmall};
|
|
41
|
-
`;
|
|
42
|
-
var IconButton = styled(BaseButton)`
|
|
43
|
-
padding: 0.5rem;
|
|
44
|
-
min-width: 2.25rem;
|
|
45
|
-
min-height: 2.25rem;
|
|
46
|
-
`;
|
|
47
|
-
var IconButtonSmall = styled(BaseButton)`
|
|
48
|
-
padding: 0.25rem;
|
|
49
|
-
min-width: 1.75rem;
|
|
50
|
-
min-height: 1.75rem;
|
|
51
|
-
font-size: ${(props) => props.theme.fontSizeSmall};
|
|
52
|
-
`;
|
|
53
38
|
|
|
54
39
|
// src/styled/BaseCheckbox.tsx
|
|
55
40
|
import styled2 from "styled-components";
|
|
@@ -1014,8 +999,6 @@ var ClipHeaderPresentational = ({
|
|
|
1014
999
|
};
|
|
1015
1000
|
var ClipHeader = ({
|
|
1016
1001
|
clipId,
|
|
1017
|
-
trackIndex: _trackIndex,
|
|
1018
|
-
clipIndex: _clipIndex,
|
|
1019
1002
|
trackName,
|
|
1020
1003
|
isSelected = false,
|
|
1021
1004
|
disableDrag = false,
|
|
@@ -1073,8 +1056,6 @@ var BoundaryContainer = styled10.div`
|
|
|
1073
1056
|
`;
|
|
1074
1057
|
var ClipBoundary = ({
|
|
1075
1058
|
clipId,
|
|
1076
|
-
trackIndex: _trackIndex,
|
|
1077
|
-
clipIndex: _clipIndex,
|
|
1078
1059
|
edge,
|
|
1079
1060
|
dragHandleProps,
|
|
1080
1061
|
touchOptimized = false
|
|
@@ -1194,15 +1175,14 @@ function clipDraggableIds(trackId, clipId, trackIndex, clipIndex) {
|
|
|
1194
1175
|
};
|
|
1195
1176
|
}
|
|
1196
1177
|
var ClipContainer = styled12.div.attrs((props) => ({
|
|
1197
|
-
style:
|
|
1178
|
+
style: {
|
|
1198
1179
|
left: `${props.$left}px`,
|
|
1199
1180
|
width: `${props.$width}px`
|
|
1200
1181
|
}
|
|
1201
1182
|
}))`
|
|
1202
|
-
position:
|
|
1183
|
+
position: absolute;
|
|
1203
1184
|
top: 0;
|
|
1204
|
-
height:
|
|
1205
|
-
width: ${(props) => props.$isOverlay ? `${props.$width}px` : "auto"};
|
|
1185
|
+
height: 100%;
|
|
1206
1186
|
display: flex;
|
|
1207
1187
|
flex-direction: column;
|
|
1208
1188
|
z-index: 10; /* Above progress overlay (z-index: 2) but below controls/playhead */
|
|
@@ -1214,7 +1194,7 @@ var ClipContainer = styled12.div.attrs((props) => ({
|
|
|
1214
1194
|
var ChannelsWrapper = styled12.div`
|
|
1215
1195
|
flex: 1;
|
|
1216
1196
|
position: relative;
|
|
1217
|
-
overflow:
|
|
1197
|
+
overflow: hidden;
|
|
1218
1198
|
`;
|
|
1219
1199
|
var Clip = ({
|
|
1220
1200
|
children,
|
|
@@ -1228,7 +1208,6 @@ var Clip = ({
|
|
|
1228
1208
|
samplesPerPixel,
|
|
1229
1209
|
showHeader = false,
|
|
1230
1210
|
disableHeaderDrag = false,
|
|
1231
|
-
isOverlay = false,
|
|
1232
1211
|
isSelected = false,
|
|
1233
1212
|
onMouseDown,
|
|
1234
1213
|
trackId,
|
|
@@ -1242,7 +1221,7 @@ var Clip = ({
|
|
|
1242
1221
|
const left = Math.floor(startSample / samplesPerPixel);
|
|
1243
1222
|
const width = clipPixelWidth(startSample, durationSamples, samplesPerPixel);
|
|
1244
1223
|
const headerDragDisabled = disableHeaderDrag || isPlaceholder;
|
|
1245
|
-
const enableDrag = showHeader && !headerDragDisabled
|
|
1224
|
+
const enableDrag = showHeader && !headerDragDisabled;
|
|
1246
1225
|
const ids = clipDraggableIds(trackId, clipId, trackIndex, clipIndex);
|
|
1247
1226
|
const {
|
|
1248
1227
|
ref: clipRef,
|
|
@@ -1275,7 +1254,6 @@ var Clip = ({
|
|
|
1275
1254
|
className,
|
|
1276
1255
|
$left: left,
|
|
1277
1256
|
$width: width,
|
|
1278
|
-
$isOverlay: isOverlay,
|
|
1279
1257
|
$isPlaceholder: isPlaceholder,
|
|
1280
1258
|
"data-clip-container": "true",
|
|
1281
1259
|
"data-clip-placeholder": isPlaceholder ? "true" : void 0,
|
|
@@ -1287,15 +1265,13 @@ var Clip = ({
|
|
|
1287
1265
|
ClipHeader,
|
|
1288
1266
|
{
|
|
1289
1267
|
clipId,
|
|
1290
|
-
trackIndex,
|
|
1291
|
-
clipIndex,
|
|
1292
1268
|
trackName,
|
|
1293
1269
|
isSelected,
|
|
1294
1270
|
disableDrag: headerDragDisabled,
|
|
1295
1271
|
dragHandleProps: enableDrag ? { handleRef } : void 0
|
|
1296
1272
|
}
|
|
1297
1273
|
),
|
|
1298
|
-
/* @__PURE__ */ jsx9(ClipViewportOriginProvider, { originX: left, children: /* @__PURE__ */ jsxs2(ChannelsWrapper, {
|
|
1274
|
+
/* @__PURE__ */ jsx9(ClipViewportOriginProvider, { originX: left, children: /* @__PURE__ */ jsxs2(ChannelsWrapper, { children: [
|
|
1299
1275
|
children,
|
|
1300
1276
|
showFades && fadeIn && fadeIn.duration > 0 && /* @__PURE__ */ jsx9(
|
|
1301
1277
|
FadeOverlay,
|
|
@@ -1316,13 +1292,11 @@ var Clip = ({
|
|
|
1316
1292
|
}
|
|
1317
1293
|
)
|
|
1318
1294
|
] }) }),
|
|
1319
|
-
showHeader && !headerDragDisabled &&
|
|
1295
|
+
showHeader && !headerDragDisabled && /* @__PURE__ */ jsxs2(Fragment, { children: [
|
|
1320
1296
|
/* @__PURE__ */ jsx9(
|
|
1321
1297
|
ClipBoundary,
|
|
1322
1298
|
{
|
|
1323
1299
|
clipId,
|
|
1324
|
-
trackIndex,
|
|
1325
|
-
clipIndex,
|
|
1326
1300
|
edge: "left",
|
|
1327
1301
|
touchOptimized,
|
|
1328
1302
|
dragHandleProps: {
|
|
@@ -1335,8 +1309,6 @@ var Clip = ({
|
|
|
1335
1309
|
ClipBoundary,
|
|
1336
1310
|
{
|
|
1337
1311
|
clipId,
|
|
1338
|
-
trackIndex,
|
|
1339
|
-
clipIndex,
|
|
1340
1312
|
edge: "right",
|
|
1341
1313
|
touchOptimized,
|
|
1342
1314
|
dragHandleProps: {
|
|
@@ -1742,7 +1714,7 @@ var PlayheadWithMarker = ({
|
|
|
1742
1714
|
};
|
|
1743
1715
|
|
|
1744
1716
|
// src/components/Playlist.tsx
|
|
1745
|
-
import styled17
|
|
1717
|
+
import styled17 from "styled-components";
|
|
1746
1718
|
import { useRef as useRef5, useCallback as useCallback3 } from "react";
|
|
1747
1719
|
import { jsx as jsx16, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
1748
1720
|
var Wrapper3 = styled17.div`
|
|
@@ -1848,7 +1820,6 @@ var Playlist = ({
|
|
|
1848
1820
|
] }) }) })
|
|
1849
1821
|
] });
|
|
1850
1822
|
};
|
|
1851
|
-
var StyledPlaylist = withTheme(Playlist);
|
|
1852
1823
|
|
|
1853
1824
|
// src/components/Selection.tsx
|
|
1854
1825
|
import styled18 from "styled-components";
|
|
@@ -1883,84 +1854,6 @@ var Selection = ({
|
|
|
1883
1854
|
import { useCallback as useCallback4, useRef as useRef6, useState as useState2 } from "react";
|
|
1884
1855
|
import styled19 from "styled-components";
|
|
1885
1856
|
import { Fragment as Fragment2, jsx as jsx18, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
1886
|
-
var LoopRegionOverlayDiv = styled19.div.attrs((props) => ({
|
|
1887
|
-
style: {
|
|
1888
|
-
left: `${props.$left}px`,
|
|
1889
|
-
width: `${props.$width}px`
|
|
1890
|
-
}
|
|
1891
|
-
}))`
|
|
1892
|
-
position: absolute;
|
|
1893
|
-
top: 0;
|
|
1894
|
-
background: ${(props) => props.$color};
|
|
1895
|
-
height: 100%;
|
|
1896
|
-
z-index: 55; /* Between clips (z-index: 50) and selection (z-index: 60) */
|
|
1897
|
-
pointer-events: none;
|
|
1898
|
-
`;
|
|
1899
|
-
var LoopMarker = styled19.div.attrs((props) => ({
|
|
1900
|
-
style: {
|
|
1901
|
-
left: `${props.$left}px`
|
|
1902
|
-
}
|
|
1903
|
-
}))`
|
|
1904
|
-
position: absolute;
|
|
1905
|
-
top: 0;
|
|
1906
|
-
width: 2px;
|
|
1907
|
-
height: 100%;
|
|
1908
|
-
background: ${(props) => props.$color};
|
|
1909
|
-
z-index: 90; /* Below playhead (z-index: 100) */
|
|
1910
|
-
pointer-events: none;
|
|
1911
|
-
|
|
1912
|
-
/* Triangle marker at top */
|
|
1913
|
-
&::before {
|
|
1914
|
-
content: '';
|
|
1915
|
-
position: absolute;
|
|
1916
|
-
top: 0;
|
|
1917
|
-
${(props) => props.$isStart ? "left: 0" : "right: 0"};
|
|
1918
|
-
width: 0;
|
|
1919
|
-
height: 0;
|
|
1920
|
-
border-top: 8px solid ${(props) => props.$color};
|
|
1921
|
-
${(props) => props.$isStart ? "border-right: 8px solid transparent;" : "border-left: 8px solid transparent;"}
|
|
1922
|
-
}
|
|
1923
|
-
`;
|
|
1924
|
-
var LoopRegion = ({
|
|
1925
|
-
startPosition,
|
|
1926
|
-
endPosition,
|
|
1927
|
-
regionColor = "rgba(59, 130, 246, 0.3)",
|
|
1928
|
-
markerColor = "#3b82f6"
|
|
1929
|
-
}) => {
|
|
1930
|
-
const width = Math.max(0, endPosition - startPosition);
|
|
1931
|
-
if (width <= 0) {
|
|
1932
|
-
return null;
|
|
1933
|
-
}
|
|
1934
|
-
return /* @__PURE__ */ jsxs6(Fragment2, { children: [
|
|
1935
|
-
/* @__PURE__ */ jsx18(
|
|
1936
|
-
LoopRegionOverlayDiv,
|
|
1937
|
-
{
|
|
1938
|
-
$left: startPosition,
|
|
1939
|
-
$width: width,
|
|
1940
|
-
$color: regionColor,
|
|
1941
|
-
"data-loop-region": true
|
|
1942
|
-
}
|
|
1943
|
-
),
|
|
1944
|
-
/* @__PURE__ */ jsx18(
|
|
1945
|
-
LoopMarker,
|
|
1946
|
-
{
|
|
1947
|
-
$left: startPosition,
|
|
1948
|
-
$color: markerColor,
|
|
1949
|
-
$isStart: true,
|
|
1950
|
-
"data-loop-marker": "start"
|
|
1951
|
-
}
|
|
1952
|
-
),
|
|
1953
|
-
/* @__PURE__ */ jsx18(
|
|
1954
|
-
LoopMarker,
|
|
1955
|
-
{
|
|
1956
|
-
$left: endPosition - 2,
|
|
1957
|
-
$color: markerColor,
|
|
1958
|
-
$isStart: false,
|
|
1959
|
-
"data-loop-marker": "end"
|
|
1960
|
-
}
|
|
1961
|
-
)
|
|
1962
|
-
] });
|
|
1963
|
-
};
|
|
1964
1857
|
var DraggableMarkerHandle = styled19.div.attrs((props) => ({
|
|
1965
1858
|
style: {
|
|
1966
1859
|
left: `${props.$left}px`
|
|
@@ -2415,7 +2308,6 @@ var SpectrogramChannel = ({
|
|
|
2415
2308
|
length,
|
|
2416
2309
|
waveHeight,
|
|
2417
2310
|
devicePixelRatio = 1,
|
|
2418
|
-
samplesPerPixel: _samplesPerPixel,
|
|
2419
2311
|
clipId,
|
|
2420
2312
|
onCanvasRegister,
|
|
2421
2313
|
onCanvasUnregister,
|
|
@@ -2529,7 +2421,6 @@ var SmartChannel = ({
|
|
|
2529
2421
|
isSelected,
|
|
2530
2422
|
transparentBackground,
|
|
2531
2423
|
renderMode = "waveform",
|
|
2532
|
-
samplesPerPixel: sppProp,
|
|
2533
2424
|
spectrogramClipId,
|
|
2534
2425
|
spectrogramOnCanvasRegister,
|
|
2535
2426
|
spectrogramOnCanvasUnregister,
|
|
@@ -2546,11 +2437,10 @@ var SmartChannel = ({
|
|
|
2546
2437
|
barWidth,
|
|
2547
2438
|
barGap,
|
|
2548
2439
|
roundedBars,
|
|
2549
|
-
samplesPerPixel
|
|
2440
|
+
samplesPerPixel,
|
|
2550
2441
|
sampleRate: contextSampleRate
|
|
2551
2442
|
} = usePlaylistInfo();
|
|
2552
2443
|
const devicePixelRatio = useDevicePixelRatio();
|
|
2553
|
-
const samplesPerPixel = sppProp ?? contextSpp;
|
|
2554
2444
|
const waveOutlineColor = isSelected && theme ? theme.selectedWaveOutlineColor : theme?.waveOutlineColor;
|
|
2555
2445
|
const waveFillColor = isSelected && theme ? theme.selectedWaveFillColor : theme?.waveFillColor;
|
|
2556
2446
|
const drawMode = theme?.waveformDrawMode || "inverted";
|
|
@@ -2583,7 +2473,6 @@ var SmartChannel = ({
|
|
|
2583
2473
|
length: props.length,
|
|
2584
2474
|
waveHeight,
|
|
2585
2475
|
devicePixelRatio,
|
|
2586
|
-
samplesPerPixel,
|
|
2587
2476
|
clipId: spectrogramClipId,
|
|
2588
2477
|
onCanvasRegister: spectrogramOnCanvasRegister,
|
|
2589
2478
|
onCanvasUnregister: spectrogramOnCanvasUnregister,
|
|
@@ -2603,7 +2492,6 @@ var SmartChannel = ({
|
|
|
2603
2492
|
length: props.length,
|
|
2604
2493
|
waveHeight: halfHeight,
|
|
2605
2494
|
devicePixelRatio,
|
|
2606
|
-
samplesPerPixel,
|
|
2607
2495
|
clipId: spectrogramClipId,
|
|
2608
2496
|
onCanvasRegister: spectrogramOnCanvasRegister,
|
|
2609
2497
|
onCanvasUnregister: spectrogramOnCanvasUnregister,
|
|
@@ -2774,7 +2662,7 @@ import styled23 from "styled-components";
|
|
|
2774
2662
|
|
|
2775
2663
|
// src/components/TimeScale.tsx
|
|
2776
2664
|
import { useLayoutEffect as useLayoutEffect5, use as use7, useMemo as useMemo5 } from "react";
|
|
2777
|
-
import styled22, { withTheme
|
|
2665
|
+
import styled22, { withTheme } from "styled-components";
|
|
2778
2666
|
import { MAX_CANVAS_WIDTH as MAX_CANVAS_WIDTH4 } from "@waveform-playlist/core";
|
|
2779
2667
|
import { jsx as jsx24, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
2780
2668
|
var PlaylistTimeScaleScroll = styled22.div.attrs((props) => ({
|
|
@@ -2877,7 +2765,7 @@ var TimeScale = (props) => {
|
|
|
2877
2765
|
visibleChunks
|
|
2878
2766
|
] });
|
|
2879
2767
|
};
|
|
2880
|
-
var StyledTimeScale =
|
|
2768
|
+
var StyledTimeScale = withTheme(TimeScale);
|
|
2881
2769
|
|
|
2882
2770
|
// src/components/SmartScale.tsx
|
|
2883
2771
|
import {
|
|
@@ -3124,11 +3012,7 @@ var Container = styled26.div.attrs((props) => ({
|
|
|
3124
3012
|
}))`
|
|
3125
3013
|
position: relative;
|
|
3126
3014
|
`;
|
|
3127
|
-
var ChannelContainer = styled26.div
|
|
3128
|
-
style: {
|
|
3129
|
-
paddingLeft: `${props.$offset || 0}px`
|
|
3130
|
-
}
|
|
3131
|
-
}))`
|
|
3015
|
+
var ChannelContainer = styled26.div`
|
|
3132
3016
|
position: relative;
|
|
3133
3017
|
background: ${(props) => {
|
|
3134
3018
|
if (props.$isSelected) {
|
|
@@ -3143,7 +3027,6 @@ var Track = ({
|
|
|
3143
3027
|
children,
|
|
3144
3028
|
className,
|
|
3145
3029
|
backgroundColor,
|
|
3146
|
-
offset = 0,
|
|
3147
3030
|
width,
|
|
3148
3031
|
hasClipHeaders = false,
|
|
3149
3032
|
onClick,
|
|
@@ -3163,7 +3046,6 @@ var Track = ({
|
|
|
3163
3046
|
ChannelContainer,
|
|
3164
3047
|
{
|
|
3165
3048
|
$backgroundColor: backgroundColor,
|
|
3166
|
-
$offset: offset,
|
|
3167
3049
|
$isSelected: isSelected,
|
|
3168
3050
|
onClick,
|
|
3169
3051
|
"data-track-id": trackId,
|
|
@@ -3817,7 +3699,7 @@ var SegmentedVUMeterInner = ({
|
|
|
3817
3699
|
orientation = "vertical",
|
|
3818
3700
|
segmentCount = 24,
|
|
3819
3701
|
dBRange = [-50, 5],
|
|
3820
|
-
|
|
3702
|
+
hideScale = false,
|
|
3821
3703
|
colorStops = DEFAULT_COLOR_STOPS,
|
|
3822
3704
|
segmentWidth = 20,
|
|
3823
3705
|
segmentHeight = 8,
|
|
@@ -3982,7 +3864,7 @@ var SegmentedVUMeterInner = ({
|
|
|
3982
3864
|
"data-meter-orientation": orientation,
|
|
3983
3865
|
children: [
|
|
3984
3866
|
Array.from({ length: channelCount }, (_, i) => renderChannel(i)),
|
|
3985
|
-
|
|
3867
|
+
!hideScale && renderScale()
|
|
3986
3868
|
]
|
|
3987
3869
|
},
|
|
3988
3870
|
sourceKey
|
|
@@ -4000,7 +3882,7 @@ var SegmentedVUMeterInner = ({
|
|
|
4000
3882
|
"data-meter-orientation": orientation,
|
|
4001
3883
|
children: [
|
|
4002
3884
|
leftChannels.map(renderChannel),
|
|
4003
|
-
|
|
3885
|
+
!hideScale && renderScale(),
|
|
4004
3886
|
rightChannels.map(renderChannel)
|
|
4005
3887
|
]
|
|
4006
3888
|
},
|
|
@@ -4016,7 +3898,7 @@ var SegmentedVUMeterInner = ({
|
|
|
4016
3898
|
"data-meter-orientation": orientation,
|
|
4017
3899
|
children: [
|
|
4018
3900
|
renderChannel(0),
|
|
4019
|
-
|
|
3901
|
+
!hideScale && renderScale()
|
|
4020
3902
|
]
|
|
4021
3903
|
},
|
|
4022
3904
|
sourceKey
|
|
@@ -4104,7 +3986,6 @@ export {
|
|
|
4104
3986
|
GripIcon,
|
|
4105
3987
|
Header,
|
|
4106
3988
|
InlineLabel,
|
|
4107
|
-
LoopRegion,
|
|
4108
3989
|
LoopRegionMarkers,
|
|
4109
3990
|
MasterVolumeControl,
|
|
4110
3991
|
MoveDownIcon,
|
|
@@ -4128,7 +4009,6 @@ export {
|
|
|
4128
4009
|
SmartScale,
|
|
4129
4010
|
SpectrogramChannel,
|
|
4130
4011
|
SpectrogramLabels,
|
|
4131
|
-
StyledPlaylist,
|
|
4132
4012
|
StyledTimeScale,
|
|
4133
4013
|
TimeFormatSelect,
|
|
4134
4014
|
TimeInput,
|