@waveform-playlist/ui-components 15.0.0-next.16 → 15.0.0-next.18
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 +9 -9
- package/dist/index.d.mts +24 -24
- package/dist/index.d.ts +24 -24
- package/dist/index.js +22 -22
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +18 -18
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
package/dist/index.mjs
CHANGED
|
@@ -926,7 +926,7 @@ var errorContainerStyle = {
|
|
|
926
926
|
alignItems: "center",
|
|
927
927
|
justifyContent: "center"
|
|
928
928
|
};
|
|
929
|
-
var
|
|
929
|
+
var WaveformErrorBoundary = class extends React5.Component {
|
|
930
930
|
constructor(props) {
|
|
931
931
|
super(props);
|
|
932
932
|
this.state = { hasError: false, error: null };
|
|
@@ -1383,12 +1383,12 @@ var DevicePixelRatioProvider = ({ children }) => {
|
|
|
1383
1383
|
};
|
|
1384
1384
|
var useDevicePixelRatio = () => use4(DevicePixelRatioContext) ?? getScale();
|
|
1385
1385
|
|
|
1386
|
-
// src/contexts/
|
|
1386
|
+
// src/contexts/WaveformViewInfo.tsx
|
|
1387
1387
|
import { createContext as createContext5, use as use5 } from "react";
|
|
1388
1388
|
var DEFAULT_WAVE_HEIGHT = 80;
|
|
1389
1389
|
var DEFAULT_BAR_WIDTH = 1;
|
|
1390
1390
|
var DEFAULT_BAR_GAP = 0;
|
|
1391
|
-
var
|
|
1391
|
+
var WaveformViewInfoContext = createContext5({
|
|
1392
1392
|
sampleRate: 48e3,
|
|
1393
1393
|
samplesPerPixel: 1e3,
|
|
1394
1394
|
waveHeight: DEFAULT_WAVE_HEIGHT,
|
|
@@ -1398,7 +1398,7 @@ var PlaylistInfoContext = createContext5({
|
|
|
1398
1398
|
roundedBars: false,
|
|
1399
1399
|
progressBarWidth: DEFAULT_BAR_WIDTH + DEFAULT_BAR_GAP
|
|
1400
1400
|
});
|
|
1401
|
-
var
|
|
1401
|
+
var useWaveformViewInfo = () => use5(WaveformViewInfoContext);
|
|
1402
1402
|
|
|
1403
1403
|
// src/contexts/Theme.tsx
|
|
1404
1404
|
import { use as use6 } from "react";
|
|
@@ -1713,7 +1713,7 @@ var PlayheadWithMarker = ({
|
|
|
1713
1713
|
] });
|
|
1714
1714
|
};
|
|
1715
1715
|
|
|
1716
|
-
// src/components/
|
|
1716
|
+
// src/components/WaveformFrame.tsx
|
|
1717
1717
|
import styled17 from "styled-components";
|
|
1718
1718
|
import { useRef as useRef5, useCallback as useCallback3 } from "react";
|
|
1719
1719
|
import { jsx as jsx16, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
@@ -1769,7 +1769,7 @@ var ClickOverlay = styled17.div`
|
|
|
1769
1769
|
/* When selecting, raise z-index above clip boundaries (z-index: 105) to prevent interference */
|
|
1770
1770
|
z-index: ${(props) => props.$isSelecting ? 110 : 1};
|
|
1771
1771
|
`;
|
|
1772
|
-
var
|
|
1772
|
+
var WaveformFrame = ({
|
|
1773
1773
|
children,
|
|
1774
1774
|
backgroundColor,
|
|
1775
1775
|
timescaleBackgroundColor,
|
|
@@ -1783,7 +1783,7 @@ var Playlist = ({
|
|
|
1783
1783
|
onTracksMouseUp,
|
|
1784
1784
|
scrollContainerRef,
|
|
1785
1785
|
isSelecting,
|
|
1786
|
-
"data-
|
|
1786
|
+
"data-waveform-state": waveformState,
|
|
1787
1787
|
trackControlsSlots,
|
|
1788
1788
|
timescaleGapHeight = 0,
|
|
1789
1789
|
className
|
|
@@ -1797,7 +1797,7 @@ var Playlist = ({
|
|
|
1797
1797
|
[scrollContainerRef]
|
|
1798
1798
|
);
|
|
1799
1799
|
const showControls = controlsWidth !== void 0 && controlsWidth > 0;
|
|
1800
|
-
return /* @__PURE__ */ jsxs5(Wrapper3, { className, "data-
|
|
1800
|
+
return /* @__PURE__ */ jsxs5(Wrapper3, { className, "data-waveform-state": waveformState, children: [
|
|
1801
1801
|
showControls && /* @__PURE__ */ jsxs5(ControlsColumn, { $width: controlsWidth, children: [
|
|
1802
1802
|
timescaleGapHeight > 0 && /* @__PURE__ */ jsx16(TimescaleGap, { $height: timescaleGapHeight }),
|
|
1803
1803
|
trackControlsSlots
|
|
@@ -2476,7 +2476,7 @@ var SmartChannel = ({
|
|
|
2476
2476
|
roundedBars,
|
|
2477
2477
|
samplesPerPixel,
|
|
2478
2478
|
sampleRate: contextSampleRate
|
|
2479
|
-
} =
|
|
2479
|
+
} = useWaveformViewInfo();
|
|
2480
2480
|
const devicePixelRatio = useDevicePixelRatio();
|
|
2481
2481
|
const waveOutlineColor = isSelected && theme ? theme.selectedWaveOutlineColor : theme?.waveOutlineColor;
|
|
2482
2482
|
const waveFillColor = isSelected && theme ? theme.selectedWaveFillColor : theme?.waveFillColor;
|
|
@@ -2702,7 +2702,7 @@ import { useLayoutEffect as useLayoutEffect5, use as use7, useMemo as useMemo5 }
|
|
|
2702
2702
|
import styled22, { withTheme } from "styled-components";
|
|
2703
2703
|
import { MAX_CANVAS_WIDTH as MAX_CANVAS_WIDTH4 } from "@waveform-playlist/core";
|
|
2704
2704
|
import { jsx as jsx24, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
2705
|
-
var
|
|
2705
|
+
var TimeScaleScroll = styled22.div.attrs((props) => ({
|
|
2706
2706
|
style: {
|
|
2707
2707
|
width: `${props.$cssWidth}px`,
|
|
2708
2708
|
height: `${props.$timeScaleHeight}px`
|
|
@@ -2739,7 +2739,7 @@ var TimeScale = (props) => {
|
|
|
2739
2739
|
tickData
|
|
2740
2740
|
} = props;
|
|
2741
2741
|
const { canvasRef, canvasMapRef } = useChunkedCanvasRefs();
|
|
2742
|
-
const { timeScaleHeight } = use7(
|
|
2742
|
+
const { timeScaleHeight } = use7(WaveformViewInfoContext);
|
|
2743
2743
|
const devicePixelRatio = useDevicePixelRatio();
|
|
2744
2744
|
const { widthX, canvasInfo, timeMarkersWithPositions } = tickData;
|
|
2745
2745
|
const visibleChunkIndices = useVisibleChunkIndices(widthX, MAX_CANVAS_WIDTH4);
|
|
@@ -2797,7 +2797,7 @@ var TimeScale = (props) => {
|
|
|
2797
2797
|
drawVersion,
|
|
2798
2798
|
visibleChunkIndices
|
|
2799
2799
|
]);
|
|
2800
|
-
return /* @__PURE__ */ jsxs10(
|
|
2800
|
+
return /* @__PURE__ */ jsxs10(TimeScaleScroll, { $cssWidth: widthX, $timeScaleHeight: timeScaleHeight, children: [
|
|
2801
2801
|
visibleMarkers,
|
|
2802
2802
|
visibleChunks
|
|
2803
2803
|
] });
|
|
@@ -2866,7 +2866,7 @@ var SmartScale = ({
|
|
|
2866
2866
|
durationMs: duration,
|
|
2867
2867
|
renderTick
|
|
2868
2868
|
}) => {
|
|
2869
|
-
const { samplesPerPixel, sampleRate, timeScaleHeight } = use8(
|
|
2869
|
+
const { samplesPerPixel, sampleRate, timeScaleHeight } = use8(WaveformViewInfoContext);
|
|
2870
2870
|
const beatsAndBars = useBeatsAndBars();
|
|
2871
2871
|
const tickLayout = useMemo6(() => {
|
|
2872
2872
|
const widthX = secondsToPixels(duration / 1e3, samplesPerPixel, sampleRate);
|
|
@@ -3070,7 +3070,7 @@ var Track = ({
|
|
|
3070
3070
|
trackId,
|
|
3071
3071
|
isSelected = false
|
|
3072
3072
|
}) => {
|
|
3073
|
-
const { waveHeight } =
|
|
3073
|
+
const { waveHeight } = useWaveformViewInfo();
|
|
3074
3074
|
return /* @__PURE__ */ jsx28(
|
|
3075
3075
|
Container,
|
|
3076
3076
|
{
|
|
@@ -4031,9 +4031,6 @@ export {
|
|
|
4031
4031
|
PlaybackRateSelect,
|
|
4032
4032
|
Playhead,
|
|
4033
4033
|
PlayheadWithMarker,
|
|
4034
|
-
Playlist,
|
|
4035
|
-
PlaylistErrorBoundary,
|
|
4036
|
-
PlaylistInfoContext,
|
|
4037
4034
|
ReorderRail,
|
|
4038
4035
|
ScreenReaderOnly,
|
|
4039
4036
|
ScrollViewportProvider,
|
|
@@ -4056,6 +4053,9 @@ export {
|
|
|
4056
4053
|
TrashIcon,
|
|
4057
4054
|
VolumeDownIcon,
|
|
4058
4055
|
VolumeUpIcon,
|
|
4056
|
+
WaveformErrorBoundary,
|
|
4057
|
+
WaveformFrame,
|
|
4058
|
+
WaveformViewInfoContext,
|
|
4059
4059
|
darkTheme,
|
|
4060
4060
|
defaultTheme,
|
|
4061
4061
|
formatTime,
|
|
@@ -4066,12 +4066,12 @@ export {
|
|
|
4066
4066
|
useClipViewportOrigin,
|
|
4067
4067
|
useDevicePixelRatio,
|
|
4068
4068
|
useMeterLevels,
|
|
4069
|
-
usePlaylistInfo,
|
|
4070
4069
|
useScrollViewport,
|
|
4071
4070
|
useScrollViewportSelector,
|
|
4072
4071
|
useTheme2 as useTheme,
|
|
4073
4072
|
useThrottledValue,
|
|
4074
4073
|
useVisibleChunkIndices,
|
|
4074
|
+
useWaveformViewInfo,
|
|
4075
4075
|
waveformColorToCss
|
|
4076
4076
|
};
|
|
4077
4077
|
//# sourceMappingURL=index.mjs.map
|