@waveform-playlist/browser 12.1.0 → 13.0.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 +21 -9
- package/dist/index.d.ts +21 -9
- package/dist/index.js +2 -20
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +2 -20
- package/dist/index.mjs.map +1 -1
- package/package.json +6 -6
package/dist/index.d.mts
CHANGED
|
@@ -1659,15 +1659,32 @@ declare const AnnotationIntegrationProvider: React$1.Provider<AnnotationIntegrat
|
|
|
1659
1659
|
*/
|
|
1660
1660
|
declare function useAnnotationIntegration(): AnnotationIntegration;
|
|
1661
1661
|
|
|
1662
|
+
/**
|
|
1663
|
+
* Single-call canvas registration shape. Consolidates the OffscreenCanvas
|
|
1664
|
+
* transfer and per-canvas metadata that earlier required two separate
|
|
1665
|
+
* registration paths.
|
|
1666
|
+
*
|
|
1667
|
+
* Provider/orchestrator look up trackId from clipId and derive
|
|
1668
|
+
* globalPixelOffset = chunkIndex * MAX_CANVAS_WIDTH.
|
|
1669
|
+
*/
|
|
1670
|
+
interface SpectrogramCanvasRegistration {
|
|
1671
|
+
canvasId: string;
|
|
1672
|
+
canvas: OffscreenCanvas;
|
|
1673
|
+
clipId: string;
|
|
1674
|
+
channelIndex: number;
|
|
1675
|
+
chunkIndex: number;
|
|
1676
|
+
widthPx: number;
|
|
1677
|
+
heightPx: number;
|
|
1678
|
+
}
|
|
1662
1679
|
interface SpectrogramIntegration {
|
|
1663
1680
|
trackSpectrogramOverrides: Map<string, TrackSpectrogramOverrides>;
|
|
1664
|
-
spectrogramWorkerApi: SpectrogramWorkerApi | null;
|
|
1665
1681
|
spectrogramConfig?: SpectrogramConfig;
|
|
1666
1682
|
spectrogramColorMap?: ColorMapValue;
|
|
1667
1683
|
setTrackRenderMode: (trackId: string, mode: RenderMode) => void;
|
|
1668
1684
|
setTrackSpectrogramConfig: (trackId: string, config: SpectrogramConfig, colorMap?: ColorMapValue) => void;
|
|
1669
|
-
|
|
1670
|
-
|
|
1685
|
+
/** Single-canvas registration. OffscreenCanvas is non-transferable — call once per canvas. */
|
|
1686
|
+
registerSpectrogramCanvas: (reg: SpectrogramCanvasRegistration) => void;
|
|
1687
|
+
unregisterSpectrogramCanvas: (canvasId: string) => void;
|
|
1671
1688
|
/** Render spectrogram menu items for a track's context menu */
|
|
1672
1689
|
renderMenuItems?: (props: {
|
|
1673
1690
|
renderMode: string;
|
|
@@ -1688,11 +1705,6 @@ interface SpectrogramIntegration {
|
|
|
1688
1705
|
/** Get frequency scale function for a scale name */
|
|
1689
1706
|
getFrequencyScale: (name: string) => (f: number, minF: number, maxF: number) => number;
|
|
1690
1707
|
}
|
|
1691
|
-
/** Minimal type for the worker API surface used by browser components */
|
|
1692
|
-
interface SpectrogramWorkerApi {
|
|
1693
|
-
registerCanvas: (canvasId: string, canvas: OffscreenCanvas) => void;
|
|
1694
|
-
unregisterCanvas: (canvasId: string) => void;
|
|
1695
|
-
}
|
|
1696
1708
|
declare const SpectrogramIntegrationProvider: React$1.Provider<SpectrogramIntegration | null>;
|
|
1697
1709
|
/**
|
|
1698
1710
|
* Hook to access spectrogram integration provided by @waveform-playlist/spectrogram.
|
|
@@ -1837,4 +1849,4 @@ declare function getWaveformDataMetadata(src: string): Promise<{
|
|
|
1837
1849
|
bits: 8 | 16;
|
|
1838
1850
|
}>;
|
|
1839
1851
|
|
|
1840
|
-
export { type ActiveEffect, type AnnotationIntegration, AnnotationIntegrationProvider, AudioPosition, type AudioTrackConfig, AutomaticScrollCheckbox, ClearAllButton, type ClearAllButtonProps, ClipCollisionModifier, ClipInteractionProvider, type ClipInteractionProviderProps, ContinuousPlayCheckbox, DownloadAnnotationsButton, EditableCheckbox, type EffectDefinition, type EffectInstance, type EffectParameter, type ExportOptions, type ExportResult, ExportWavButton, type ExportWavButtonProps, FastForwardButton, type FrameData, type GetAnnotationBoxLabelFn, KeyboardShortcuts, type KeyboardShortcutsProps, LinkEndpointsCheckbox, LoopButton, MasterVolumeControl, type MasterVolumeControls, type MediaElementAnimationContextValue, MediaElementAnnotationList, type MediaElementAnnotationListProps, type MediaElementControlsContextValue, type MediaElementDataContextValue, MediaElementPlaylist, type MediaElementPlaylistProps, MediaElementPlaylistProvider, type MediaElementStateContextValue, type MediaElementTrackConfig, MediaElementWaveform, type MediaElementWaveformProps, type OnAnnotationUpdateFn, type ParameterType, PauseButton, PlayButton, PlaylistAnnotationList, type PlaylistAnnotationListProps, PlaylistVisualization, type PlaylistVisualizationProps, RewindButton, SelectionTimeInputs, SetLoopRegionButton, SkipBackwardButton, SkipForwardButton, SnapToGridModifier, type SpectrogramIntegration, SpectrogramIntegrationProvider, StopButton, type TimeFormatControls, TimeFormatSelect, type TrackActiveEffect, type TrackEffectsState, type TrackLoadError, type TrackSource, type TrackState$1 as TrackState, type UseDynamicEffectsReturn, type UseDynamicTracksReturn, type UseExportWavReturn, type UseOutputMeterOptions, type UseOutputMeterReturn, type UsePlaybackShortcutsOptions, type UsePlaybackShortcutsReturn, type UseTrackDynamicEffectsReturn, Waveform, WaveformPlaylistProvider, type WaveformProps, type WaveformTrack, type ZoomControls, ZoomInButton, ZoomOutButton, createEffectChain, createEffectInstance, effectCategories, effectDefinitions, getEffectDefinition, getEffectsByCategory, getWaveformDataMetadata, loadPeaksFromWaveformData, loadWaveformData, noDropAnimationPlugins, useAnnotationDragHandlers, useAnnotationIntegration, useAnnotationKeyboardControls, useAudioTracks, useClipDragHandlers, useClipInteractionEnabled, useClipSplitting, useDragSensors, useDynamicEffects, useDynamicTracks, useExportWav, useKeyboardShortcuts, useMasterAnalyser, useMasterVolume, useMediaElementAnimation, useMediaElementControls, useMediaElementData, useMediaElementState, useOutputMeter, usePlaybackAnimation, usePlaybackShortcuts, usePlaylistControls, usePlaylistData, usePlaylistState, useSpectrogramIntegration, useTimeFormat, useTrackDynamicEffects, useZoomControls, waveformDataToPeaks };
|
|
1852
|
+
export { type ActiveEffect, type AnnotationIntegration, AnnotationIntegrationProvider, AudioPosition, type AudioTrackConfig, AutomaticScrollCheckbox, ClearAllButton, type ClearAllButtonProps, ClipCollisionModifier, ClipInteractionProvider, type ClipInteractionProviderProps, ContinuousPlayCheckbox, DownloadAnnotationsButton, EditableCheckbox, type EffectDefinition, type EffectInstance, type EffectParameter, type ExportOptions, type ExportResult, ExportWavButton, type ExportWavButtonProps, FastForwardButton, type FrameData, type GetAnnotationBoxLabelFn, KeyboardShortcuts, type KeyboardShortcutsProps, LinkEndpointsCheckbox, LoopButton, MasterVolumeControl, type MasterVolumeControls, type MediaElementAnimationContextValue, MediaElementAnnotationList, type MediaElementAnnotationListProps, type MediaElementControlsContextValue, type MediaElementDataContextValue, MediaElementPlaylist, type MediaElementPlaylistProps, MediaElementPlaylistProvider, type MediaElementStateContextValue, type MediaElementTrackConfig, MediaElementWaveform, type MediaElementWaveformProps, type OnAnnotationUpdateFn, type ParameterType, PauseButton, PlayButton, PlaylistAnnotationList, type PlaylistAnnotationListProps, PlaylistVisualization, type PlaylistVisualizationProps, RewindButton, SelectionTimeInputs, SetLoopRegionButton, SkipBackwardButton, SkipForwardButton, SnapToGridModifier, type SpectrogramCanvasRegistration, type SpectrogramIntegration, SpectrogramIntegrationProvider, StopButton, type TimeFormatControls, TimeFormatSelect, type TrackActiveEffect, type TrackEffectsState, type TrackLoadError, type TrackSource, type TrackState$1 as TrackState, type UseDynamicEffectsReturn, type UseDynamicTracksReturn, type UseExportWavReturn, type UseOutputMeterOptions, type UseOutputMeterReturn, type UsePlaybackShortcutsOptions, type UsePlaybackShortcutsReturn, type UseTrackDynamicEffectsReturn, Waveform, WaveformPlaylistProvider, type WaveformProps, type WaveformTrack, type ZoomControls, ZoomInButton, ZoomOutButton, createEffectChain, createEffectInstance, effectCategories, effectDefinitions, getEffectDefinition, getEffectsByCategory, getWaveformDataMetadata, loadPeaksFromWaveformData, loadWaveformData, noDropAnimationPlugins, useAnnotationDragHandlers, useAnnotationIntegration, useAnnotationKeyboardControls, useAudioTracks, useClipDragHandlers, useClipInteractionEnabled, useClipSplitting, useDragSensors, useDynamicEffects, useDynamicTracks, useExportWav, useKeyboardShortcuts, useMasterAnalyser, useMasterVolume, useMediaElementAnimation, useMediaElementControls, useMediaElementData, useMediaElementState, useOutputMeter, usePlaybackAnimation, usePlaybackShortcuts, usePlaylistControls, usePlaylistData, usePlaylistState, useSpectrogramIntegration, useTimeFormat, useTrackDynamicEffects, useZoomControls, waveformDataToPeaks };
|
package/dist/index.d.ts
CHANGED
|
@@ -1659,15 +1659,32 @@ declare const AnnotationIntegrationProvider: React$1.Provider<AnnotationIntegrat
|
|
|
1659
1659
|
*/
|
|
1660
1660
|
declare function useAnnotationIntegration(): AnnotationIntegration;
|
|
1661
1661
|
|
|
1662
|
+
/**
|
|
1663
|
+
* Single-call canvas registration shape. Consolidates the OffscreenCanvas
|
|
1664
|
+
* transfer and per-canvas metadata that earlier required two separate
|
|
1665
|
+
* registration paths.
|
|
1666
|
+
*
|
|
1667
|
+
* Provider/orchestrator look up trackId from clipId and derive
|
|
1668
|
+
* globalPixelOffset = chunkIndex * MAX_CANVAS_WIDTH.
|
|
1669
|
+
*/
|
|
1670
|
+
interface SpectrogramCanvasRegistration {
|
|
1671
|
+
canvasId: string;
|
|
1672
|
+
canvas: OffscreenCanvas;
|
|
1673
|
+
clipId: string;
|
|
1674
|
+
channelIndex: number;
|
|
1675
|
+
chunkIndex: number;
|
|
1676
|
+
widthPx: number;
|
|
1677
|
+
heightPx: number;
|
|
1678
|
+
}
|
|
1662
1679
|
interface SpectrogramIntegration {
|
|
1663
1680
|
trackSpectrogramOverrides: Map<string, TrackSpectrogramOverrides>;
|
|
1664
|
-
spectrogramWorkerApi: SpectrogramWorkerApi | null;
|
|
1665
1681
|
spectrogramConfig?: SpectrogramConfig;
|
|
1666
1682
|
spectrogramColorMap?: ColorMapValue;
|
|
1667
1683
|
setTrackRenderMode: (trackId: string, mode: RenderMode) => void;
|
|
1668
1684
|
setTrackSpectrogramConfig: (trackId: string, config: SpectrogramConfig, colorMap?: ColorMapValue) => void;
|
|
1669
|
-
|
|
1670
|
-
|
|
1685
|
+
/** Single-canvas registration. OffscreenCanvas is non-transferable — call once per canvas. */
|
|
1686
|
+
registerSpectrogramCanvas: (reg: SpectrogramCanvasRegistration) => void;
|
|
1687
|
+
unregisterSpectrogramCanvas: (canvasId: string) => void;
|
|
1671
1688
|
/** Render spectrogram menu items for a track's context menu */
|
|
1672
1689
|
renderMenuItems?: (props: {
|
|
1673
1690
|
renderMode: string;
|
|
@@ -1688,11 +1705,6 @@ interface SpectrogramIntegration {
|
|
|
1688
1705
|
/** Get frequency scale function for a scale name */
|
|
1689
1706
|
getFrequencyScale: (name: string) => (f: number, minF: number, maxF: number) => number;
|
|
1690
1707
|
}
|
|
1691
|
-
/** Minimal type for the worker API surface used by browser components */
|
|
1692
|
-
interface SpectrogramWorkerApi {
|
|
1693
|
-
registerCanvas: (canvasId: string, canvas: OffscreenCanvas) => void;
|
|
1694
|
-
unregisterCanvas: (canvasId: string) => void;
|
|
1695
|
-
}
|
|
1696
1708
|
declare const SpectrogramIntegrationProvider: React$1.Provider<SpectrogramIntegration | null>;
|
|
1697
1709
|
/**
|
|
1698
1710
|
* Hook to access spectrogram integration provided by @waveform-playlist/spectrogram.
|
|
@@ -1837,4 +1849,4 @@ declare function getWaveformDataMetadata(src: string): Promise<{
|
|
|
1837
1849
|
bits: 8 | 16;
|
|
1838
1850
|
}>;
|
|
1839
1851
|
|
|
1840
|
-
export { type ActiveEffect, type AnnotationIntegration, AnnotationIntegrationProvider, AudioPosition, type AudioTrackConfig, AutomaticScrollCheckbox, ClearAllButton, type ClearAllButtonProps, ClipCollisionModifier, ClipInteractionProvider, type ClipInteractionProviderProps, ContinuousPlayCheckbox, DownloadAnnotationsButton, EditableCheckbox, type EffectDefinition, type EffectInstance, type EffectParameter, type ExportOptions, type ExportResult, ExportWavButton, type ExportWavButtonProps, FastForwardButton, type FrameData, type GetAnnotationBoxLabelFn, KeyboardShortcuts, type KeyboardShortcutsProps, LinkEndpointsCheckbox, LoopButton, MasterVolumeControl, type MasterVolumeControls, type MediaElementAnimationContextValue, MediaElementAnnotationList, type MediaElementAnnotationListProps, type MediaElementControlsContextValue, type MediaElementDataContextValue, MediaElementPlaylist, type MediaElementPlaylistProps, MediaElementPlaylistProvider, type MediaElementStateContextValue, type MediaElementTrackConfig, MediaElementWaveform, type MediaElementWaveformProps, type OnAnnotationUpdateFn, type ParameterType, PauseButton, PlayButton, PlaylistAnnotationList, type PlaylistAnnotationListProps, PlaylistVisualization, type PlaylistVisualizationProps, RewindButton, SelectionTimeInputs, SetLoopRegionButton, SkipBackwardButton, SkipForwardButton, SnapToGridModifier, type SpectrogramIntegration, SpectrogramIntegrationProvider, StopButton, type TimeFormatControls, TimeFormatSelect, type TrackActiveEffect, type TrackEffectsState, type TrackLoadError, type TrackSource, type TrackState$1 as TrackState, type UseDynamicEffectsReturn, type UseDynamicTracksReturn, type UseExportWavReturn, type UseOutputMeterOptions, type UseOutputMeterReturn, type UsePlaybackShortcutsOptions, type UsePlaybackShortcutsReturn, type UseTrackDynamicEffectsReturn, Waveform, WaveformPlaylistProvider, type WaveformProps, type WaveformTrack, type ZoomControls, ZoomInButton, ZoomOutButton, createEffectChain, createEffectInstance, effectCategories, effectDefinitions, getEffectDefinition, getEffectsByCategory, getWaveformDataMetadata, loadPeaksFromWaveformData, loadWaveformData, noDropAnimationPlugins, useAnnotationDragHandlers, useAnnotationIntegration, useAnnotationKeyboardControls, useAudioTracks, useClipDragHandlers, useClipInteractionEnabled, useClipSplitting, useDragSensors, useDynamicEffects, useDynamicTracks, useExportWav, useKeyboardShortcuts, useMasterAnalyser, useMasterVolume, useMediaElementAnimation, useMediaElementControls, useMediaElementData, useMediaElementState, useOutputMeter, usePlaybackAnimation, usePlaybackShortcuts, usePlaylistControls, usePlaylistData, usePlaylistState, useSpectrogramIntegration, useTimeFormat, useTrackDynamicEffects, useZoomControls, waveformDataToPeaks };
|
|
1852
|
+
export { type ActiveEffect, type AnnotationIntegration, AnnotationIntegrationProvider, AudioPosition, type AudioTrackConfig, AutomaticScrollCheckbox, ClearAllButton, type ClearAllButtonProps, ClipCollisionModifier, ClipInteractionProvider, type ClipInteractionProviderProps, ContinuousPlayCheckbox, DownloadAnnotationsButton, EditableCheckbox, type EffectDefinition, type EffectInstance, type EffectParameter, type ExportOptions, type ExportResult, ExportWavButton, type ExportWavButtonProps, FastForwardButton, type FrameData, type GetAnnotationBoxLabelFn, KeyboardShortcuts, type KeyboardShortcutsProps, LinkEndpointsCheckbox, LoopButton, MasterVolumeControl, type MasterVolumeControls, type MediaElementAnimationContextValue, MediaElementAnnotationList, type MediaElementAnnotationListProps, type MediaElementControlsContextValue, type MediaElementDataContextValue, MediaElementPlaylist, type MediaElementPlaylistProps, MediaElementPlaylistProvider, type MediaElementStateContextValue, type MediaElementTrackConfig, MediaElementWaveform, type MediaElementWaveformProps, type OnAnnotationUpdateFn, type ParameterType, PauseButton, PlayButton, PlaylistAnnotationList, type PlaylistAnnotationListProps, PlaylistVisualization, type PlaylistVisualizationProps, RewindButton, SelectionTimeInputs, SetLoopRegionButton, SkipBackwardButton, SkipForwardButton, SnapToGridModifier, type SpectrogramCanvasRegistration, type SpectrogramIntegration, SpectrogramIntegrationProvider, StopButton, type TimeFormatControls, TimeFormatSelect, type TrackActiveEffect, type TrackEffectsState, type TrackLoadError, type TrackSource, type TrackState$1 as TrackState, type UseDynamicEffectsReturn, type UseDynamicTracksReturn, type UseExportWavReturn, type UseOutputMeterOptions, type UseOutputMeterReturn, type UsePlaybackShortcutsOptions, type UsePlaybackShortcutsReturn, type UseTrackDynamicEffectsReturn, Waveform, WaveformPlaylistProvider, type WaveformProps, type WaveformTrack, type ZoomControls, ZoomInButton, ZoomOutButton, createEffectChain, createEffectInstance, effectCategories, effectDefinitions, getEffectDefinition, getEffectsByCategory, getWaveformDataMetadata, loadPeaksFromWaveformData, loadWaveformData, noDropAnimationPlugins, useAnnotationDragHandlers, useAnnotationIntegration, useAnnotationKeyboardControls, useAudioTracks, useClipDragHandlers, useClipInteractionEnabled, useClipSplitting, useDragSensors, useDynamicEffects, useDynamicTracks, useExportWav, useKeyboardShortcuts, useMasterAnalyser, useMasterVolume, useMediaElementAnimation, useMediaElementControls, useMediaElementData, useMediaElementState, useOutputMeter, usePlaybackAnimation, usePlaybackShortcuts, usePlaylistControls, usePlaylistData, usePlaylistState, useSpectrogramIntegration, useTimeFormat, useTrackDynamicEffects, useZoomControls, waveformDataToPeaks };
|
package/dist/index.js
CHANGED
|
@@ -5816,17 +5816,6 @@ var PlaylistVisualization = ({
|
|
|
5816
5816
|
});
|
|
5817
5817
|
return helpers;
|
|
5818
5818
|
}, [tracks, spectrogram]);
|
|
5819
|
-
const workerCanvasApi = (0, import_react33.useMemo)(() => {
|
|
5820
|
-
if (!(spectrogram == null ? void 0 : spectrogram.spectrogramWorkerApi)) return void 0;
|
|
5821
|
-
return {
|
|
5822
|
-
registerCanvas: spectrogram.spectrogramWorkerApi.registerCanvas.bind(
|
|
5823
|
-
spectrogram.spectrogramWorkerApi
|
|
5824
|
-
),
|
|
5825
|
-
unregisterCanvas: spectrogram.spectrogramWorkerApi.unregisterCanvas.bind(
|
|
5826
|
-
spectrogram.spectrogramWorkerApi
|
|
5827
|
-
)
|
|
5828
|
-
};
|
|
5829
|
-
}, [spectrogram == null ? void 0 : spectrogram.spectrogramWorkerApi]);
|
|
5830
5819
|
const [settingsModalTrackId, setSettingsModalTrackId] = (0, import_react33.useState)(null);
|
|
5831
5820
|
const [isSelecting, setIsSelecting] = (0, import_react33.useState)(false);
|
|
5832
5821
|
const mouseDownTimeRef = (0, import_react33.useRef)(0);
|
|
@@ -6192,16 +6181,9 @@ var PlaylistVisualization = ({
|
|
|
6192
6181
|
clipSampleRate: clip.sampleRate,
|
|
6193
6182
|
clipOffsetSeconds: clip.offsetSamples != null ? clip.offsetSamples / (clip.sampleRate || sampleRate) : 0,
|
|
6194
6183
|
samplesPerPixel,
|
|
6195
|
-
spectrogramWorkerApi: workerCanvasApi,
|
|
6196
6184
|
spectrogramClipId: clip.clipId,
|
|
6197
|
-
|
|
6198
|
-
|
|
6199
|
-
clip.clipId,
|
|
6200
|
-
channelIndex,
|
|
6201
|
-
canvasIds,
|
|
6202
|
-
canvasWidths
|
|
6203
|
-
);
|
|
6204
|
-
} : void 0
|
|
6185
|
+
spectrogramOnCanvasRegister: spectrogram ? spectrogram.registerSpectrogramCanvas : void 0,
|
|
6186
|
+
spectrogramOnCanvasUnregister: spectrogram ? spectrogram.unregisterSpectrogramCanvas : void 0
|
|
6205
6187
|
},
|
|
6206
6188
|
`${clip.clipId}-${channelIndex}`
|
|
6207
6189
|
);
|