easecut-react 1.1.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/LICENSE +21 -0
- package/README.md +224 -0
- package/dist/.dist-D4zXwUWp.js +81 -0
- package/dist/assets/audio-waveform.worker-DiTI_wJb.js +353 -0
- package/dist/assets/fonts/alibaba-puhuiti-2-regular.woff2 +0 -0
- package/dist/assets/fonts/licenses/source-han-sans-OFL-1.1.txt +96 -0
- package/dist/assets/fonts/licenses/zcool-gaoduanhei-usage-statement.txt +52 -0
- package/dist/assets/fonts/source-han-sans-cn-regular.otf +0 -0
- package/dist/assets/fonts/zcool-canger-yuyang-w03.ttf +0 -0
- package/dist/assets/fonts/zcool-gaoduanhei.ttf +0 -0
- package/dist/assets/fonts/zcool-kuaile.ttf +0 -0
- package/dist/assets/fonts/zcool-kuhei.ttf +0 -0
- package/dist/assets/fonts/zcool-wenyi.ttf +0 -0
- package/dist/assets/fonts/zcool-xiaowei-logo.otf +0 -0
- package/dist/assets/frame-preview.worker-ruBHl77w.js +345 -0
- package/dist/assets/soundtouch-processor-BKTidsbT.js +2062 -0
- package/dist/index.js +10802 -0
- package/dist/styles.css +1 -0
- package/dist/types/editor/EaseCut.d.ts +4 -0
- package/dist/types/editor/EaseCut.d.ts.map +1 -0
- package/dist/types/editor/api/create-easecut-api.d.ts +12 -0
- package/dist/types/editor/api/create-easecut-api.d.ts.map +1 -0
- package/dist/types/editor/api/easecut-api-context.d.ts +12 -0
- package/dist/types/editor/api/easecut-api-context.d.ts.map +1 -0
- package/dist/types/editor/api/errors.d.ts +6 -0
- package/dist/types/editor/api/errors.d.ts.map +1 -0
- package/dist/types/editor/api/index.d.ts +3 -0
- package/dist/types/editor/api/index.d.ts.map +1 -0
- package/dist/types/editor/api/source-input.d.ts +7 -0
- package/dist/types/editor/api/source-input.d.ts.map +1 -0
- package/dist/types/editor/api/source-store.d.ts +16 -0
- package/dist/types/editor/api/source-store.d.ts.map +1 -0
- package/dist/types/editor/api/types.d.ts +78 -0
- package/dist/types/editor/api/types.d.ts.map +1 -0
- package/dist/types/editor/components/AudioFloatingInspector.d.ts +10 -0
- package/dist/types/editor/components/AudioFloatingInspector.d.ts.map +1 -0
- package/dist/types/editor/components/CanvasRatioPanel.d.ts +2 -0
- package/dist/types/editor/components/CanvasRatioPanel.d.ts.map +1 -0
- package/dist/types/editor/components/ExportMenu.d.ts +8 -0
- package/dist/types/editor/components/ExportMenu.d.ts.map +1 -0
- package/dist/types/editor/components/FloatingInspector.d.ts +11 -0
- package/dist/types/editor/components/FloatingInspector.d.ts.map +1 -0
- package/dist/types/editor/components/FloatingInspectorBasicPanel.d.ts +10 -0
- package/dist/types/editor/components/FloatingInspectorBasicPanel.d.ts.map +1 -0
- package/dist/types/editor/components/FloatingInspectorShell.d.ts +15 -0
- package/dist/types/editor/components/FloatingInspectorShell.d.ts.map +1 -0
- package/dist/types/editor/components/FloatingInspectorSpeedPanel.d.ts +7 -0
- package/dist/types/editor/components/FloatingInspectorSpeedPanel.d.ts.map +1 -0
- package/dist/types/editor/components/FormDialog.d.ts +16 -0
- package/dist/types/editor/components/FormDialog.d.ts.map +1 -0
- package/dist/types/editor/components/PreviewPanel.d.ts +9 -0
- package/dist/types/editor/components/PreviewPanel.d.ts.map +1 -0
- package/dist/types/editor/components/TextFloatingInspector.d.ts +12 -0
- package/dist/types/editor/components/TextFloatingInspector.d.ts.map +1 -0
- package/dist/types/editor/components/TimelineToolbar.d.ts +8 -0
- package/dist/types/editor/components/TimelineToolbar.d.ts.map +1 -0
- package/dist/types/editor/components/TitleContentTextarea.d.ts +8 -0
- package/dist/types/editor/components/TitleContentTextarea.d.ts.map +1 -0
- package/dist/types/editor/components/VideoFloatingInspector.d.ts +12 -0
- package/dist/types/editor/components/VideoFloatingInspector.d.ts.map +1 -0
- package/dist/types/editor/components/ui/ColorInput.d.ts +15 -0
- package/dist/types/editor/components/ui/ColorInput.d.ts.map +1 -0
- package/dist/types/editor/components/ui/IconButton.d.ts +15 -0
- package/dist/types/editor/components/ui/IconButton.d.ts.map +1 -0
- package/dist/types/editor/components/ui/InputNumber.d.ts +13 -0
- package/dist/types/editor/components/ui/InputNumber.d.ts.map +1 -0
- package/dist/types/editor/components/ui/Select.d.ts +14 -0
- package/dist/types/editor/components/ui/Select.d.ts.map +1 -0
- package/dist/types/editor/components/ui/TextInput.d.ts +10 -0
- package/dist/types/editor/components/ui/TextInput.d.ts.map +1 -0
- package/dist/types/editor/core/audio-waveform-bars.d.ts +50 -0
- package/dist/types/editor/core/audio-waveform-bars.d.ts.map +1 -0
- package/dist/types/editor/core/canvas-size.d.ts +44 -0
- package/dist/types/editor/core/canvas-size.d.ts.map +1 -0
- package/dist/types/editor/core/clip-speed.d.ts +11 -0
- package/dist/types/editor/core/clip-speed.d.ts.map +1 -0
- package/dist/types/editor/core/collision.d.ts +96 -0
- package/dist/types/editor/core/collision.d.ts.map +1 -0
- package/dist/types/editor/core/composition.d.ts +47 -0
- package/dist/types/editor/core/composition.d.ts.map +1 -0
- package/dist/types/editor/core/export-schema.d.ts +5 -0
- package/dist/types/editor/core/export-schema.d.ts.map +1 -0
- package/dist/types/editor/core/index.d.ts +11 -0
- package/dist/types/editor/core/index.d.ts.map +1 -0
- package/dist/types/editor/core/model.d.ts +187 -0
- package/dist/types/editor/core/model.d.ts.map +1 -0
- package/dist/types/editor/core/preview-snapping.d.ts +27 -0
- package/dist/types/editor/core/preview-snapping.d.ts.map +1 -0
- package/dist/types/editor/core/text-fonts.d.ts +76 -0
- package/dist/types/editor/core/text-fonts.d.ts.map +1 -0
- package/dist/types/editor/core/time.d.ts +15 -0
- package/dist/types/editor/core/time.d.ts.map +1 -0
- package/dist/types/editor/core/timeline-commands.d.ts +143 -0
- package/dist/types/editor/core/timeline-commands.d.ts.map +1 -0
- package/dist/types/editor/core/timeline-layout.d.ts +25 -0
- package/dist/types/editor/core/timeline-layout.d.ts.map +1 -0
- package/dist/types/editor/core/timeline-math.d.ts +22 -0
- package/dist/types/editor/core/timeline-math.d.ts.map +1 -0
- package/dist/types/editor/core/timeline-tracks.d.ts +47 -0
- package/dist/types/editor/core/timeline-tracks.d.ts.map +1 -0
- package/dist/types/editor/media/audio-waveform-peaks.d.ts +17 -0
- package/dist/types/editor/media/audio-waveform-peaks.d.ts.map +1 -0
- package/dist/types/editor/media/audio-waveform.d.ts +8 -0
- package/dist/types/editor/media/audio-waveform.d.ts.map +1 -0
- package/dist/types/editor/media/frame-preview.d.ts +25 -0
- package/dist/types/editor/media/frame-preview.d.ts.map +1 -0
- package/dist/types/editor/media/index.d.ts +6 -0
- package/dist/types/editor/media/index.d.ts.map +1 -0
- package/dist/types/editor/media/media-runtime.d.ts +47 -0
- package/dist/types/editor/media/media-runtime.d.ts.map +1 -0
- package/dist/types/editor/media/mediabunny-audio-waveform.d.ts +8 -0
- package/dist/types/editor/media/mediabunny-audio-waveform.d.ts.map +1 -0
- package/dist/types/editor/media/mediabunny-frame-preview.d.ts +21 -0
- package/dist/types/editor/media/mediabunny-frame-preview.d.ts.map +1 -0
- package/dist/types/editor/media/preview-audio-engine.d.ts +23 -0
- package/dist/types/editor/media/preview-audio-engine.d.ts.map +1 -0
- package/dist/types/editor/media/preview-playback-controller.d.ts +26 -0
- package/dist/types/editor/media/preview-playback-controller.d.ts.map +1 -0
- package/dist/types/editor/media/single-frame-preview.d.ts +30 -0
- package/dist/types/editor/media/single-frame-preview.d.ts.map +1 -0
- package/dist/types/editor/media/text-layout-runtime.d.ts +27 -0
- package/dist/types/editor/media/text-layout-runtime.d.ts.map +1 -0
- package/dist/types/editor/store/index.d.ts +3 -0
- package/dist/types/editor/store/index.d.ts.map +1 -0
- package/dist/types/editor/store/timeline-store-context.d.ts +14 -0
- package/dist/types/editor/store/timeline-store-context.d.ts.map +1 -0
- package/dist/types/editor/store/timeline-store.d.ts +115 -0
- package/dist/types/editor/store/timeline-store.d.ts.map +1 -0
- package/dist/types/editor/timeline/AudioWaveformCanvas.d.ts +13 -0
- package/dist/types/editor/timeline/AudioWaveformCanvas.d.ts.map +1 -0
- package/dist/types/editor/timeline/TimelineClip.d.ts +41 -0
- package/dist/types/editor/timeline/TimelineClip.d.ts.map +1 -0
- package/dist/types/editor/timeline/TimelineDragGhost.d.ts +9 -0
- package/dist/types/editor/timeline/TimelineDragGhost.d.ts.map +1 -0
- package/dist/types/editor/timeline/TimelinePanel.d.ts +11 -0
- package/dist/types/editor/timeline/TimelinePanel.d.ts.map +1 -0
- package/dist/types/editor/timeline/TimelineRuler.d.ts +14 -0
- package/dist/types/editor/timeline/TimelineRuler.d.ts.map +1 -0
- package/dist/types/editor/timeline/TimelineTrimHandle.d.ts +12 -0
- package/dist/types/editor/timeline/TimelineTrimHandle.d.ts.map +1 -0
- package/dist/types/editor/timeline/TimelineViewport.d.ts +8 -0
- package/dist/types/editor/timeline/TimelineViewport.d.ts.map +1 -0
- package/dist/types/editor/timeline/clip-reveal.d.ts +29 -0
- package/dist/types/editor/timeline/clip-reveal.d.ts.map +1 -0
- package/dist/types/editor/timeline/timeline-interaction.d.ts +79 -0
- package/dist/types/editor/timeline/timeline-interaction.d.ts.map +1 -0
- package/dist/types/editor/timeline/useTimelineController.d.ts +22 -0
- package/dist/types/editor/timeline/useTimelineController.d.ts.map +1 -0
- package/dist/types/editor/types.d.ts +52 -0
- package/dist/types/editor/types.d.ts.map +1 -0
- package/dist/types/editor/util/abort-error.d.ts +3 -0
- package/dist/types/editor/util/abort-error.d.ts.map +1 -0
- package/dist/types/editor/util/browser.d.ts +5 -0
- package/dist/types/editor/util/browser.d.ts.map +1 -0
- package/dist/types/editor/util/format-canvas-font.d.ts +7 -0
- package/dist/types/editor/util/format-canvas-font.d.ts.map +1 -0
- package/dist/types/editor/util/format-media-label.d.ts +4 -0
- package/dist/types/editor/util/format-media-label.d.ts.map +1 -0
- package/dist/types/editor/util/format-text-color.d.ts +4 -0
- package/dist/types/editor/util/format-text-color.d.ts.map +1 -0
- package/dist/types/editor/util/format-timeline-time.d.ts +6 -0
- package/dist/types/editor/util/format-timeline-time.d.ts.map +1 -0
- package/dist/types/editor/util/id.d.ts +2 -0
- package/dist/types/editor/util/id.d.ts.map +1 -0
- package/dist/types/editor/util/media-file-format.d.ts +6 -0
- package/dist/types/editor/util/media-file-format.d.ts.map +1 -0
- package/dist/types/editor/util/number.d.ts +6 -0
- package/dist/types/editor/util/number.d.ts.map +1 -0
- package/dist/types/editor/util/text.d.ts +2 -0
- package/dist/types/editor/util/text.d.ts.map +1 -0
- package/dist/types/editor/util/url.d.ts +5 -0
- package/dist/types/editor/util/url.d.ts.map +1 -0
- package/dist/types/editor/util/value.d.ts +3 -0
- package/dist/types/editor/util/value.d.ts.map +1 -0
- package/dist/types/editor/workers/audio-waveform-protocol.d.ts +24 -0
- package/dist/types/editor/workers/audio-waveform-protocol.d.ts.map +1 -0
- package/dist/types/editor/workers/audio-waveform.worker.d.ts +2 -0
- package/dist/types/editor/workers/audio-waveform.worker.d.ts.map +1 -0
- package/dist/types/editor/workers/frame-preview-protocol.d.ts +35 -0
- package/dist/types/editor/workers/frame-preview-protocol.d.ts.map +1 -0
- package/dist/types/editor/workers/frame-preview.worker.d.ts +2 -0
- package/dist/types/editor/workers/frame-preview.worker.d.ts.map +1 -0
- package/dist/types/index.d.ts +7 -0
- package/dist/types/index.d.ts.map +1 -0
- package/package.json +74 -0
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
import type { TimelineClip, TimelineClipPosition, TimelineClipSpeed, TimelineClipTransform, TimelineClipVolume, TimelineTextLayoutSize, TimelineTrack, TimelineSource } from './model';
|
|
2
|
+
import { type TrackDropTarget } from './timeline-tracks';
|
|
3
|
+
export declare const MIN_CLIP_DURATION_US: number;
|
|
4
|
+
export declare const MIN_CLIP_TRANSFORM_SIZE = 40;
|
|
5
|
+
export declare const DEFAULT_TEXT_CLIP_DURATION_US: number;
|
|
6
|
+
export declare const DEFAULT_MEDIA_CLIP_DURATION_US: number;
|
|
7
|
+
export declare const normalizeClipVolume: (volume: number) => TimelineClipVolume;
|
|
8
|
+
export declare const normalizeClipTransform: (transform: TimelineClipTransform) => TimelineClipTransform;
|
|
9
|
+
export declare const createDefaultClipTransform: (canvasSize: {
|
|
10
|
+
height: number;
|
|
11
|
+
width: number;
|
|
12
|
+
}) => TimelineClipTransform;
|
|
13
|
+
export declare const createCenteredTextClipPosition: (canvasSize: {
|
|
14
|
+
height: number;
|
|
15
|
+
width: number;
|
|
16
|
+
}, layoutSize: TimelineTextLayoutSize) => TimelineClipPosition;
|
|
17
|
+
export type TimelineEdit = {
|
|
18
|
+
clips: TimelineClip[];
|
|
19
|
+
selectedClipId: string | null;
|
|
20
|
+
tracks: TimelineTrack[];
|
|
21
|
+
};
|
|
22
|
+
export type TimelineEditResult = {
|
|
23
|
+
changed: false;
|
|
24
|
+
} | ({
|
|
25
|
+
changed: true;
|
|
26
|
+
} & TimelineEdit);
|
|
27
|
+
export type MoveClipParams = {
|
|
28
|
+
clipId: string;
|
|
29
|
+
freeStartUs?: number;
|
|
30
|
+
insertionIndex: number;
|
|
31
|
+
target: TrackDropTarget;
|
|
32
|
+
};
|
|
33
|
+
export type TrimClipParams = {
|
|
34
|
+
clipId: string;
|
|
35
|
+
edge: 'start' | 'end';
|
|
36
|
+
timeUs?: number;
|
|
37
|
+
trimEndUs?: number;
|
|
38
|
+
trimStartUs?: number;
|
|
39
|
+
};
|
|
40
|
+
export type ChangeClipSpeedParams = {
|
|
41
|
+
clipId: string;
|
|
42
|
+
speed: TimelineClipSpeed;
|
|
43
|
+
};
|
|
44
|
+
export type ChangeClipVolumeParams = {
|
|
45
|
+
clipId: string;
|
|
46
|
+
volume: TimelineClipVolume;
|
|
47
|
+
};
|
|
48
|
+
export type ChangeClipHiddenParams = {
|
|
49
|
+
clipId: string;
|
|
50
|
+
hidden: boolean;
|
|
51
|
+
};
|
|
52
|
+
export type AddTextClipParams = {
|
|
53
|
+
canvasSize: {
|
|
54
|
+
height: number;
|
|
55
|
+
width: number;
|
|
56
|
+
};
|
|
57
|
+
layoutSize: TimelineTextLayoutSize;
|
|
58
|
+
startUs: number;
|
|
59
|
+
text: string;
|
|
60
|
+
};
|
|
61
|
+
export type AddMediaClipParams = {
|
|
62
|
+
canvasSize: {
|
|
63
|
+
height: number;
|
|
64
|
+
width: number;
|
|
65
|
+
};
|
|
66
|
+
source: TimelineSource;
|
|
67
|
+
startUs: number;
|
|
68
|
+
trackId?: string;
|
|
69
|
+
};
|
|
70
|
+
export type ChangeTextClipPropertiesParams = {
|
|
71
|
+
bold?: boolean;
|
|
72
|
+
clipId: string;
|
|
73
|
+
fontColor?: string;
|
|
74
|
+
fontSize?: number;
|
|
75
|
+
fontType?: string;
|
|
76
|
+
italic?: boolean;
|
|
77
|
+
layoutSize?: TimelineTextLayoutSize;
|
|
78
|
+
text?: string;
|
|
79
|
+
underline?: boolean;
|
|
80
|
+
};
|
|
81
|
+
export type MoveClipPositionParams = {
|
|
82
|
+
clipId: string;
|
|
83
|
+
position: TimelineClipPosition;
|
|
84
|
+
};
|
|
85
|
+
export type ChangeTextClipTimingParams = {
|
|
86
|
+
clipId: string;
|
|
87
|
+
endUs: number;
|
|
88
|
+
startUs: number;
|
|
89
|
+
};
|
|
90
|
+
export declare const normalizeTimelineClips: (clips: TimelineClip[]) => TimelineClip[];
|
|
91
|
+
export declare const removeEmptyTimelineTracks: (tracks: TimelineTrack[], clips: TimelineClip[]) => {
|
|
92
|
+
zIndex: number;
|
|
93
|
+
id: string;
|
|
94
|
+
muted: boolean;
|
|
95
|
+
name: string;
|
|
96
|
+
type: import("./model").TimelineTrackType;
|
|
97
|
+
}[];
|
|
98
|
+
export declare const addMediaClip: (edit: TimelineEdit, params: AddMediaClipParams) => TimelineEditResult;
|
|
99
|
+
export declare const addTextClip: (edit: TimelineEdit, params: AddTextClipParams) => TimelineEditResult;
|
|
100
|
+
export declare const changeTextClipProperties: (edit: TimelineEdit, params: ChangeTextClipPropertiesParams) => TimelineEditResult;
|
|
101
|
+
export declare const changeTextClipTiming: (edit: TimelineEdit, params: ChangeTextClipTimingParams) => TimelineEditResult;
|
|
102
|
+
export declare const moveClip: (edit: TimelineEdit, params: MoveClipParams) => TimelineEditResult;
|
|
103
|
+
export declare const getTrimmedClip: (clip: TimelineClip, edge: "start" | "end", timeUs: number) => TimelineClip;
|
|
104
|
+
export declare const getTrimmedTimelineClips: (clips: TimelineClip[], clipId: string, edge: "start" | "end", timeUs: number, mediaTrim?: {
|
|
105
|
+
trimEndUs: number;
|
|
106
|
+
trimStartUs: number;
|
|
107
|
+
}) => TimelineClip[];
|
|
108
|
+
export declare const trimClip: (edit: TimelineEdit, params: TrimClipParams) => TimelineEditResult;
|
|
109
|
+
export declare const changeClipSpeed: (edit: TimelineEdit, params: ChangeClipSpeedParams) => TimelineEditResult;
|
|
110
|
+
export declare const changeClipVolume: (edit: TimelineEdit, params: ChangeClipVolumeParams) => TimelineEditResult;
|
|
111
|
+
export declare const changeClipHidden: (edit: TimelineEdit, params: ChangeClipHiddenParams) => TimelineEditResult;
|
|
112
|
+
export declare const restoreClipTrim: (edit: TimelineEdit, clipId: string) => TimelineEditResult;
|
|
113
|
+
export declare const moveClipPosition: (edit: TimelineEdit, params: MoveClipPositionParams) => TimelineEditResult;
|
|
114
|
+
export declare const transformMediaClip: (edit: TimelineEdit, clipId: string, transform: TimelineClipTransform) => TimelineEditResult;
|
|
115
|
+
export declare const deleteClip: (edit: TimelineEdit, clipId: string) => TimelineEditResult;
|
|
116
|
+
export declare const pasteClip: (edit: TimelineEdit, copiedClip: TimelineClip, anchorId: string) => TimelineEditResult;
|
|
117
|
+
export declare const findClipAtTime: (clips: TimelineClip[], timeUs: number, preferredClipId?: string | null) => TimelineClip;
|
|
118
|
+
export declare const canSplitClipAtTime: (clips: TimelineClip[], timeUs: number, preferredClipId?: string | null) => boolean;
|
|
119
|
+
export declare const splitClip: (edit: TimelineEdit, clipId: string, timeUs: number) => TimelineEditResult;
|
|
120
|
+
export type UpdateTimelineClipParams = {
|
|
121
|
+
bold?: boolean;
|
|
122
|
+
clipId: string;
|
|
123
|
+
endUs?: number;
|
|
124
|
+
fontColor?: string;
|
|
125
|
+
fontSize?: number;
|
|
126
|
+
fontType?: string;
|
|
127
|
+
hidden?: boolean;
|
|
128
|
+
italic?: boolean;
|
|
129
|
+
layoutSize?: TimelineTextLayoutSize;
|
|
130
|
+
position?: TimelineClipPosition;
|
|
131
|
+
speed?: TimelineClipSpeed;
|
|
132
|
+
startUs?: number;
|
|
133
|
+
text?: string;
|
|
134
|
+
trackId?: string;
|
|
135
|
+
transform?: TimelineClipTransform;
|
|
136
|
+
trimEndUs?: number;
|
|
137
|
+
trimStartUs?: number;
|
|
138
|
+
underline?: boolean;
|
|
139
|
+
volume?: TimelineClipVolume;
|
|
140
|
+
};
|
|
141
|
+
export declare const updateTimelineClip: (edit: TimelineEdit, params: UpdateTimelineClipParams) => TimelineEditResult;
|
|
142
|
+
export declare const getEditDurationUs: (edit: TimelineEdit) => number;
|
|
143
|
+
//# sourceMappingURL=timeline-commands.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"timeline-commands.d.ts","sourceRoot":"","sources":["../../../../src/editor/core/timeline-commands.ts"],"names":[],"mappings":"AAYA,OAAO,KAAK,EACV,YAAY,EACZ,oBAAoB,EAGpB,iBAAiB,EACjB,qBAAqB,EACrB,kBAAkB,EAElB,sBAAsB,EACtB,aAAa,EACb,cAAc,EACf,MAAM,SAAS,CAAC;AAajB,OAAO,EAIL,KAAK,eAAe,EACrB,MAAM,mBAAmB,CAAC;AAG3B,eAAO,MAAM,oBAAoB,QAA6B,CAAC;AAC/D,eAAO,MAAM,uBAAuB,KAAK,CAAC;AAC1C,eAAO,MAAM,6BAA6B,QAA2B,CAAC;AACtE,eAAO,MAAM,8BAA8B,QAA2B,CAAC;AAEvE,eAAO,MAAM,mBAAmB,GAAI,QAAQ,MAAM,KAAG,kBACK,CAAC;AAE3D,eAAO,MAAM,sBAAsB,GACjC,WAAW,qBAAqB,KAC/B,qBAKD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AC;IACjB,SAAS,CAAC,EAAE,qBAAqB,CAAC;IAClC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,MAAM,CAAC,EAAE,kBAAkB,CAAC;CAC7B,CAAC;AAEF,eAAO,MAAM,kBAAkB,GAC7B,MAAM,YAAY,EAClB,QAAQ,wBAAwB,KAC/B,kBAsJF,CAAC;AAEF,eAAO,MAAM,iBAAiB,GAAI,MAAM,YAAY,WACnB,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { TrackInsertTarget } from './timeline-tracks';
|
|
2
|
+
import { type TimelineClipType, type TimelineTrack } from './model';
|
|
3
|
+
export declare const TIMELINE_RULER_HEIGHT = 32;
|
|
4
|
+
export declare const TIMELINE_TRACK_HEIGHT = 56;
|
|
5
|
+
export declare const TIMELINE_CLIP_HEIGHT = 56;
|
|
6
|
+
export declare const TIMELINE_AUDIO_TRACK_HEIGHT = 40;
|
|
7
|
+
export declare const TIMELINE_AUDIO_CLIP_HEIGHT = 40;
|
|
8
|
+
export declare const TIMELINE_TRACK_HEADER_WIDTH = 96;
|
|
9
|
+
export declare const TIMELINE_CONTENT_PADDING_X = 12;
|
|
10
|
+
export declare const TIMELINE_TRACK_GAP = 4;
|
|
11
|
+
export declare const getTimelineTrackHeight: (track: Pick<TimelineTrack, "type">) => 40 | 56;
|
|
12
|
+
export declare const getTimelineClipHeight: (type: TimelineClipType) => 40 | 56;
|
|
13
|
+
export type TimelineTrackLayout<T extends Pick<TimelineTrack, 'type'> = Pick<TimelineTrack, 'type'>> = {
|
|
14
|
+
bottom: number;
|
|
15
|
+
height: number;
|
|
16
|
+
index: number;
|
|
17
|
+
top: number;
|
|
18
|
+
track: T;
|
|
19
|
+
};
|
|
20
|
+
export declare const getTimelineTrackLayouts: <T extends Pick<TimelineTrack, "type">>(tracks: readonly T[]) => TimelineTrackLayout<T>[];
|
|
21
|
+
export declare const getTimelineTracksHeight: (tracks: Pick<TimelineTrack, "type">[]) => number;
|
|
22
|
+
export declare const getTimelineTrackY: (tracks: Pick<TimelineTrack, "type">[], trackIndex: number) => number;
|
|
23
|
+
export declare const getTimelineTrackInsertY: (tracks: Pick<TimelineTrack, "type">[], target: TrackInsertTarget) => number;
|
|
24
|
+
export declare const getTimelineClipY: (tracks: Pick<TimelineTrack, "type">[], trackIndex: number) => number;
|
|
25
|
+
//# sourceMappingURL=timeline-layout.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"timeline-layout.d.ts","sourceRoot":"","sources":["../../../../src/editor/core/timeline-layout.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAC3D,OAAO,EAEL,KAAK,gBAAgB,EACrB,KAAK,aAAa,EACnB,MAAM,SAAS,CAAC;AAEjB,eAAO,MAAM,qBAAqB,KAAK,CAAC;AACxC,eAAO,MAAM,qBAAqB,KAAK,CAAC;AACxC,eAAO,MAAM,oBAAoB,KAAwB,CAAC;AAC1D,eAAO,MAAM,2BAA2B,KAAK,CAAC;AAC9C,eAAO,MAAM,0BAA0B,KAA8B,CAAC;AACtE,eAAO,MAAM,2BAA2B,KAAK,CAAC;AAC9C,eAAO,MAAM,0BAA0B,KAAK,CAAC;AAC7C,eAAO,MAAM,kBAAkB,IAAI,CAAC;AAEpC,eAAO,MAAM,sBAAsB,GAAI,OAAO,IAAI,CAAC,aAAa,EAAE,MAAM,CAAC,YACK,CAAC;AAE/E,eAAO,MAAM,qBAAqB,GAAI,MAAM,gBAAgB,YAG5B,CAAC;AAEjC,MAAM,MAAM,mBAAmB,CAC7B,CAAC,SAAS,IAAI,CAAC,aAAa,EAAE,MAAM,CAAC,GAAG,IAAI,CAAC,aAAa,EAAE,MAAM,CAAC,IACjE;IACF,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,CAAC,CAAC;CACV,CAAC;AAEF,eAAO,MAAM,uBAAuB,GAClC,CAAC,SAAS,IAAI,CAAC,aAAa,EAAE,MAAM,CAAC,EAErC,QAAQ,SAAS,CAAC,EAAE,KACnB,mBAAmB,CAAC,CAAC,CAAC,EAoBxB,CAAC;AAEF,eAAO,MAAM,uBAAuB,GAClC,QAAQ,IAAI,CAAC,aAAa,EAAE,MAAM,CAAC,EAAE,WAItC,CAAC;AAEF,eAAO,MAAM,iBAAiB,GAC5B,QAAQ,IAAI,CAAC,aAAa,EAAE,MAAM,CAAC,EAAE,EACrC,YAAY,MAAM,WAUnB,CAAC;AAEF,eAAO,MAAM,uBAAuB,GAClC,QAAQ,IAAI,CAAC,aAAa,EAAE,MAAM,CAAC,EAAE,EACrC,QAAQ,iBAAiB,WAqB1B,CAAC;AAEF,eAAO,MAAM,gBAAgB,GAC3B,QAAQ,IAAI,CAAC,aAAa,EAAE,MAAM,CAAC,EAAE,EACrC,YAAY,MAAM,WASnB,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export declare const DEFAULT_PIXELS_PER_SECOND = 80;
|
|
2
|
+
export declare const MIN_PIXELS_PER_SECOND = 10;
|
|
3
|
+
export declare const MAX_PIXELS_PER_SECOND = 240;
|
|
4
|
+
export declare const TIMELINE_ZOOM_STEP = 10;
|
|
5
|
+
export declare const SNAP_THRESHOLD_PX = 6;
|
|
6
|
+
export declare const timeUsToX: (timeUs: number, pixelsPerSecond: number) => number;
|
|
7
|
+
export declare const xToTimeUs: (x: number, pixelsPerSecond: number) => number;
|
|
8
|
+
export declare const durationUsToWidth: (durationUs: number, pixelsPerSecond: number) => number;
|
|
9
|
+
export declare const normalizeTimelineTimeUs: (timeUs: number) => number;
|
|
10
|
+
type TickScale = {
|
|
11
|
+
/** Microseconds between two major ticks. */
|
|
12
|
+
majorIntervalUs: number;
|
|
13
|
+
/** How many minor ticks to draw between two major ticks. */
|
|
14
|
+
minorDivisions: number;
|
|
15
|
+
};
|
|
16
|
+
/**
|
|
17
|
+
* Choose the best major interval and minor division based on the current
|
|
18
|
+
* pixelsPerSecond (zoom level).
|
|
19
|
+
*/
|
|
20
|
+
export declare const calcTickScale: (pixelsPerSecond: number) => TickScale;
|
|
21
|
+
export {};
|
|
22
|
+
//# sourceMappingURL=timeline-math.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"timeline-math.d.ts","sourceRoot":"","sources":["../../../../src/editor/core/timeline-math.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,yBAAyB,KAAK,CAAC;AAC5C,eAAO,MAAM,qBAAqB,KAAK,CAAC;AACxC,eAAO,MAAM,qBAAqB,MAAM,CAAC;AACzC,eAAO,MAAM,kBAAkB,KAAK,CAAC;AACrC,eAAO,MAAM,iBAAiB,IAAI,CAAC;AAEnC,eAAO,MAAM,SAAS,GAAI,QAAQ,MAAM,EAAE,iBAAiB,MAAM,WAEhD,CAAC;AAElB,eAAO,MAAM,SAAS,GAAI,GAAG,MAAM,EAAE,iBAAiB,MAAM,WAIzD,CAAC;AAEJ,eAAO,MAAM,iBAAiB,GAC5B,YAAY,MAAM,EAClB,iBAAiB,MAAM,WAIR,CAAC;AAElB,eAAO,MAAM,uBAAuB,GAAI,QAAQ,MAAM,WASrD,CAAC;AAcF,KAAK,SAAS,GAAG;IACf,4CAA4C;IAC5C,eAAe,EAAE,MAAM,CAAC;IACxB,4DAA4D;IAC5D,cAAc,EAAE,MAAM,CAAC;CACxB,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,aAAa,GAAI,iBAAiB,MAAM,KAAG,SAmBvD,CAAC"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import type { TimelineTrack } from './model';
|
|
2
|
+
export declare const MAIN_VIDEO_TRACK_ID = "video-main";
|
|
3
|
+
export declare const DYNAMIC_VIDEO_TRACK_ID_PREFIX = "video-overlay-";
|
|
4
|
+
export declare const AUDIO_TRACK_ID_PREFIX = "audio-track-";
|
|
5
|
+
export declare const AUDIO_SOURCE_TRACK_ID_PREFIX = "audio-source-track-";
|
|
6
|
+
export declare const TEXT_TRACK_ID_PREFIX = "text-track-";
|
|
7
|
+
export type TrackInsertTarget = {
|
|
8
|
+
index: number;
|
|
9
|
+
type: TimelineTrack['type'];
|
|
10
|
+
};
|
|
11
|
+
export type TrackDropTarget = {
|
|
12
|
+
kind: 'existing';
|
|
13
|
+
trackId: string;
|
|
14
|
+
} | {
|
|
15
|
+
insert: TrackInsertTarget;
|
|
16
|
+
kind: 'insert';
|
|
17
|
+
};
|
|
18
|
+
export declare const normalizeTimelineTracks: (tracks: readonly TimelineTrack[]) => {
|
|
19
|
+
zIndex: number;
|
|
20
|
+
id: string;
|
|
21
|
+
muted: boolean;
|
|
22
|
+
name: string;
|
|
23
|
+
type: import("./model").TimelineTrackType;
|
|
24
|
+
}[];
|
|
25
|
+
export declare const isDynamicVideoTrack: (track: TimelineTrack) => boolean;
|
|
26
|
+
export declare const getTimelineTrackTypeRange: (tracks: readonly TimelineTrack[], type: TimelineTrack["type"]) => {
|
|
27
|
+
endIndex: number;
|
|
28
|
+
startIndex: number;
|
|
29
|
+
};
|
|
30
|
+
export declare const getSafeTrackInsertIndex: (tracks: TimelineTrack[], target: TrackInsertTarget) => number;
|
|
31
|
+
export declare const insertTimelineTrack: (tracks: TimelineTrack[], target: TrackInsertTarget) => {
|
|
32
|
+
track: {
|
|
33
|
+
zIndex: number;
|
|
34
|
+
id: string;
|
|
35
|
+
muted: boolean;
|
|
36
|
+
name: string;
|
|
37
|
+
type: import("./model").TimelineTrackType;
|
|
38
|
+
};
|
|
39
|
+
tracks: {
|
|
40
|
+
zIndex: number;
|
|
41
|
+
id: string;
|
|
42
|
+
muted: boolean;
|
|
43
|
+
name: string;
|
|
44
|
+
type: import("./model").TimelineTrackType;
|
|
45
|
+
}[];
|
|
46
|
+
};
|
|
47
|
+
//# sourceMappingURL=timeline-tracks.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"timeline-tracks.d.ts","sourceRoot":"","sources":["../../../../src/editor/core/timeline-tracks.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAE7C,eAAO,MAAM,mBAAmB,eAAe,CAAC;AAChD,eAAO,MAAM,6BAA6B,mBAAmB,CAAC;AAC9D,eAAO,MAAM,qBAAqB,iBAAiB,CAAC;AACpD,eAAO,MAAM,4BAA4B,wBAAwB,CAAC;AAClE,eAAO,MAAM,oBAAoB,gBAAgB,CAAC;AAElD,MAAM,MAAM,iBAAiB,GAAG;IAC9B,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,aAAa,CAAC,MAAM,CAAC,CAAC;CAC7B,CAAC;AAEF,MAAM,MAAM,eAAe,GACvB;IAAE,IAAI,EAAE,UAAU,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,GACrC;IAAE,MAAM,EAAE,iBAAiB,CAAC;IAAC,IAAI,EAAE,QAAQ,CAAA;CAAE,CAAC;AAElD,eAAO,MAAM,uBAAuB,GAAI,QAAQ,SAAS,aAAa,EAAE;;;;;;GAenE,CAAC;AAYN,eAAO,MAAM,mBAAmB,GAAI,OAAO,aAAa,YACa,CAAC;AA+BtE,eAAO,MAAM,yBAAyB,GACpC,QAAQ,SAAS,aAAa,EAAE,EAChC,MAAM,aAAa,CAAC,MAAM,CAAC;;;CAuB5B,CAAC;AAiCF,eAAO,MAAM,uBAAuB,GAClC,QAAQ,aAAa,EAAE,EACvB,QAAQ,iBAAiB,WAM1B,CAAC;AAEF,eAAO,MAAM,mBAAmB,GAC9B,QAAQ,aAAa,EAAE,EACvB,QAAQ,iBAAiB;;;;;;;;;;;;;;;CAiB1B,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export type DecodedAudioSample = {
|
|
2
|
+
allocationSize(options: {
|
|
3
|
+
format: 'f32-planar';
|
|
4
|
+
planeIndex: number;
|
|
5
|
+
}): number;
|
|
6
|
+
copyTo(destination: AllowSharedBufferSource, options: {
|
|
7
|
+
format: 'f32-planar';
|
|
8
|
+
planeIndex: number;
|
|
9
|
+
}): void;
|
|
10
|
+
numberOfChannels: number;
|
|
11
|
+
numberOfFrames: number;
|
|
12
|
+
sampleRate: number;
|
|
13
|
+
timestamp: number;
|
|
14
|
+
};
|
|
15
|
+
export declare const accumulateAudioSamplePeaks: (peaks: Float32Array, durationUs: number, sample: DecodedAudioSample) => void;
|
|
16
|
+
export declare const normalizeAudioPeaks: (peaks: Float32Array) => Float32Array<ArrayBufferLike>;
|
|
17
|
+
//# sourceMappingURL=audio-waveform-peaks.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"audio-waveform-peaks.d.ts","sourceRoot":"","sources":["../../../../src/editor/media/audio-waveform-peaks.ts"],"names":[],"mappings":"AAKA,MAAM,MAAM,kBAAkB,GAAG;IAC/B,cAAc,CAAC,OAAO,EAAE;QACtB,MAAM,EAAE,YAAY,CAAC;QACrB,UAAU,EAAE,MAAM,CAAC;KACpB,GAAG,MAAM,CAAC;IACX,MAAM,CACJ,WAAW,EAAE,uBAAuB,EACpC,OAAO,EAAE;QACP,MAAM,EAAE,YAAY,CAAC;QACrB,UAAU,EAAE,MAAM,CAAC;KACpB,GACA,IAAI,CAAC;IACR,gBAAgB,EAAE,MAAM,CAAC;IACzB,cAAc,EAAE,MAAM,CAAC;IACvB,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF,eAAO,MAAM,0BAA0B,GACrC,OAAO,YAAY,EACnB,YAAY,MAAM,EAClB,QAAQ,kBAAkB,SAqC3B,CAAC;AAEF,eAAO,MAAM,mBAAmB,GAAI,OAAO,YAAY,kCAQtD,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { AudioWaveformExtractor } from './mediabunny-audio-waveform';
|
|
2
|
+
export declare const HIGH_RESOLUTION_AUDIO_WAVEFORM_SAMPLE_COUNT = 16384;
|
|
3
|
+
export declare const sampleAudioBuffer: (audioBuffer: Pick<AudioBuffer, "getChannelData" | "length" | "numberOfChannels">, sampleCount?: number) => number[];
|
|
4
|
+
export declare const createAudioWaveformCache: (getBlob: (src: string) => Promise<Blob>, isDisposed: () => boolean, extractor?: AudioWaveformExtractor | null) => {
|
|
5
|
+
clear: () => void;
|
|
6
|
+
getSamples: (src: string, sampleCount?: number) => Promise<number[]>;
|
|
7
|
+
};
|
|
8
|
+
//# sourceMappingURL=audio-waveform.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"audio-waveform.d.ts","sourceRoot":"","sources":["../../../../src/editor/media/audio-waveform.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AAW1E,eAAO,MAAM,2CAA2C,QACvB,CAAC;AAwBlC,eAAO,MAAM,iBAAiB,GAC5B,aAAa,IAAI,CACf,WAAW,EACX,gBAAgB,GAAG,QAAQ,GAAG,kBAAkB,CACjD,EACD,oBAAiD,aAgClD,CAAC;AAEF,eAAO,MAAM,wBAAwB,GACnC,SAAS,CAAC,GAAG,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,EACvC,YAAY,MAAM,OAAO,EACzB,YAAW,sBAAsB,GAAG,IAAW;;sBAwDxC,MAAM;CAqDd,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { type MediabunnyFramePreviewSourceFactory } from './mediabunny-frame-preview';
|
|
2
|
+
export declare const FRAME_PREVIEW_CHUNK_DURATION_US: number;
|
|
3
|
+
export type FramePreviewFrame = {
|
|
4
|
+
index: number;
|
|
5
|
+
url: string;
|
|
6
|
+
};
|
|
7
|
+
export type FramePreviewStrip = {
|
|
8
|
+
frameWidth: number;
|
|
9
|
+
frames: FramePreviewFrame[];
|
|
10
|
+
pixelsPerSecond: number;
|
|
11
|
+
};
|
|
12
|
+
export type FramePreviewRequest = {
|
|
13
|
+
pixelsPerSecond: number;
|
|
14
|
+
rangeEndUs: number;
|
|
15
|
+
rangeStartUs: number;
|
|
16
|
+
sourceDurationUs: number;
|
|
17
|
+
src: string;
|
|
18
|
+
};
|
|
19
|
+
export type FramePreviewSubscriber = (strip: FramePreviewStrip) => void;
|
|
20
|
+
export declare const canGenerateFramePreviews: () => boolean;
|
|
21
|
+
export declare const createFramePreviewCache: (getBlob: (src: string) => Promise<Blob>, isDisposed: () => boolean, customCreateSource?: MediabunnyFramePreviewSourceFactory) => {
|
|
22
|
+
clear: () => void;
|
|
23
|
+
subscribe: (rawRequest: FramePreviewRequest, subscriber: FramePreviewSubscriber) => () => void;
|
|
24
|
+
};
|
|
25
|
+
//# sourceMappingURL=frame-preview.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"frame-preview.d.ts","sourceRoot":"","sources":["../../../../src/editor/media/frame-preview.ts"],"names":[],"mappings":"AAIA,OAAO,EAGL,KAAK,mCAAmC,EACzC,MAAM,4BAA4B,CAAC;AAOpC,eAAO,MAAM,+BAA+B,QAA8B,CAAC;AAE3E,MAAM,MAAM,iBAAiB,GAAG;IAC9B,KAAK,EAAE,MAAM,CAAC;IACd,GAAG,EAAE,MAAM,CAAC;CACb,CAAC;AAEF,MAAM,MAAM,iBAAiB,GAAG;IAC9B,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,iBAAiB,EAAE,CAAC;IAC5B,eAAe,EAAE,MAAM,CAAC;CACzB,CAAC;AAEF,MAAM,MAAM,mBAAmB,GAAG;IAChC,eAAe,EAAE,MAAM,CAAC;IACxB,UAAU,EAAE,MAAM,CAAC;IACnB,YAAY,EAAE,MAAM,CAAC;IACrB,gBAAgB,EAAE,MAAM,CAAC;IACzB,GAAG,EAAE,MAAM,CAAC;CACb,CAAC;AAEF,MAAM,MAAM,sBAAsB,GAAG,CAAC,KAAK,EAAE,iBAAiB,KAAK,IAAI,CAAC;AA8BxE,eAAO,MAAM,wBAAwB,eAGd,CAAC;AA8DxB,eAAO,MAAM,uBAAuB,GAClC,SAAS,CAAC,GAAG,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,EACvC,YAAY,MAAM,OAAO,EACzB,qBAAqB,mCAAmC;;4BA+OxC,mBAAmB,cACnB,sBAAsB;CA6BvC,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { MediaRuntimeProvider, createMediaRuntime, useAudioWaveformSamples, useFramePreviewStrip, useMediaMetadata, useMediaObjectUrl, useMediaRuntime, useSingleFramePreview, type MediaObjectUrlLease, type MediaRuntime, type MediaRuntimeProviderProps, } from './media-runtime';
|
|
2
|
+
export { canGenerateFramePreviews, FRAME_PREVIEW_CHUNK_DURATION_US, type FramePreviewFrame, type FramePreviewRequest, type FramePreviewStrip, } from './frame-preview';
|
|
3
|
+
export { TRIM_FRAME_PREVIEW_HEIGHT, type SingleFramePreviewResult, } from './single-frame-preview';
|
|
4
|
+
export { HIGH_RESOLUTION_AUDIO_WAVEFORM_SAMPLE_COUNT, sampleAudioBuffer, } from './audio-waveform';
|
|
5
|
+
export { TextLayoutError, createTextLayoutRuntime, type TextLayoutErrorCode, type TextLayoutRequest, type TextLayoutRuntime, } from './text-layout-runtime';
|
|
6
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/editor/media/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,oBAAoB,EACpB,kBAAkB,EAClB,uBAAuB,EACvB,oBAAoB,EACpB,gBAAgB,EAChB,iBAAiB,EACjB,eAAe,EACf,qBAAqB,EACrB,KAAK,mBAAmB,EACxB,KAAK,YAAY,EACjB,KAAK,yBAAyB,GAC/B,MAAM,iBAAiB,CAAC;AACzB,OAAO,EACL,wBAAwB,EACxB,+BAA+B,EAC/B,KAAK,iBAAiB,EACtB,KAAK,mBAAmB,EACxB,KAAK,iBAAiB,GACvB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EACL,yBAAyB,EACzB,KAAK,wBAAwB,GAC9B,MAAM,wBAAwB,CAAC;AAChC,OAAO,EACL,2CAA2C,EAC3C,iBAAiB,GAClB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EACL,eAAe,EACf,uBAAuB,EACvB,KAAK,mBAAmB,EACxB,KAAK,iBAAiB,EACtB,KAAK,iBAAiB,GACvB,MAAM,uBAAuB,CAAC"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { type ReactNode } from 'react';
|
|
2
|
+
import type { EaseCutMediaLoader, EaseCutMediaMetadata, VideoTimelineSource } from '../types';
|
|
3
|
+
import type { TimelineMediaType } from '../core/model';
|
|
4
|
+
import { type FramePreviewRequest, type FramePreviewStrip, type FramePreviewSubscriber } from './frame-preview';
|
|
5
|
+
import { type SingleFramePreviewRequest, type SingleFramePreviewResult, type SingleFramePreviewSession, type SingleFramePreviewSubscriber } from './single-frame-preview';
|
|
6
|
+
import { type TextLayoutRequest } from './text-layout-runtime';
|
|
7
|
+
type MediaReference = {
|
|
8
|
+
src: string;
|
|
9
|
+
type: TimelineMediaType;
|
|
10
|
+
};
|
|
11
|
+
type MediaInput = string | VideoTimelineSource | MediaReference;
|
|
12
|
+
export type MediaObjectUrlLease = {
|
|
13
|
+
release(): void;
|
|
14
|
+
url: Promise<string>;
|
|
15
|
+
};
|
|
16
|
+
export type MediaRuntime = {
|
|
17
|
+
acquireObjectUrl(input: MediaInput): MediaObjectUrlLease;
|
|
18
|
+
createSingleFramePreviewSession(request: SingleFramePreviewRequest, subscriber: SingleFramePreviewSubscriber): SingleFramePreviewSession;
|
|
19
|
+
dispose(): void;
|
|
20
|
+
getAudioWaveformSamples(input: MediaInput, sampleCount?: number): Promise<number[]>;
|
|
21
|
+
getBlob(input: MediaInput): Promise<Blob>;
|
|
22
|
+
getMetadata(input: MediaInput): Promise<EaseCutMediaMetadata | null>;
|
|
23
|
+
isDisposed(): boolean;
|
|
24
|
+
measureTextLayout(request: TextLayoutRequest, signal?: AbortSignal): Promise<{
|
|
25
|
+
height: number;
|
|
26
|
+
width: number;
|
|
27
|
+
}>;
|
|
28
|
+
setSources(sources: VideoTimelineSource[]): void;
|
|
29
|
+
subscribeFramePreviews(request: FramePreviewRequest, subscriber: FramePreviewSubscriber): () => void;
|
|
30
|
+
};
|
|
31
|
+
export declare const createMediaRuntime: (mediaLoader?: EaseCutMediaLoader, sources?: VideoTimelineSource[]) => MediaRuntime;
|
|
32
|
+
export type MediaRuntimeProviderProps = {
|
|
33
|
+
children: ReactNode;
|
|
34
|
+
mediaLoader?: EaseCutMediaLoader;
|
|
35
|
+
sources: VideoTimelineSource[];
|
|
36
|
+
};
|
|
37
|
+
export declare function MediaRuntimeProvider({ children, mediaLoader, sources, }: MediaRuntimeProviderProps): import("react").JSX.Element;
|
|
38
|
+
export declare const useMediaRuntime: () => MediaRuntime;
|
|
39
|
+
export declare const useMediaObjectUrl: (input: MediaInput, enabled?: boolean) => string | null;
|
|
40
|
+
export declare const useMediaMetadata: (input: MediaInput, enabled?: boolean) => EaseCutMediaMetadata | null;
|
|
41
|
+
export declare const useAudioWaveformSamples: (input: MediaInput, enabled?: boolean, sampleCount?: number) => number[];
|
|
42
|
+
export declare const useFramePreviewStrip: (request: FramePreviewRequest | null) => FramePreviewStrip | null;
|
|
43
|
+
export declare const useSingleFramePreview: (request: (SingleFramePreviewRequest & {
|
|
44
|
+
timeUs: number;
|
|
45
|
+
}) | null) => SingleFramePreviewResult | null;
|
|
46
|
+
export {};
|
|
47
|
+
//# sourceMappingURL=media-runtime.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"media-runtime.d.ts","sourceRoot":"","sources":["../../../../src/editor/media/media-runtime.tsx"],"names":[],"mappings":"AACA,OAAO,EAOL,KAAK,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
|
2
|
+
dispose(): void;
|
|
3
|
+
extract(blob: Blob, sampleCount: number, signal: AbortSignal): Promise<number[]>;
|
|
4
|
+
};
|
|
5
|
+
export type AudioWaveformWorkerFactory = () => Worker;
|
|
6
|
+
export declare const canUseMediabunnyAudioWaveform: () => boolean;
|
|
7
|
+
export declare const createMediabunnyAudioWaveformExtractor: (workerFactory?: AudioWaveformWorkerFactory) => AudioWaveformExtractor | null;
|
|
8
|
+
//# sourceMappingURL=mediabunny-audio-waveform.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mediabunny-audio-waveform.d.ts","sourceRoot":"","sources":["../../../../src/editor/media/mediabunny-audio-waveform.ts"],"names":[],"mappings":"AAeA,MAAM,MAAM,sBAAsB,GAAG;IACnC,OAAO,IAAI,IAAI,CAAC;IAChB,OAAO,CACL,IAAI,EAAE,IAAI,EACV,WAAW,EAAE,MAAM,EACnB,MAAM,EAAE,WAAW,GAClB,OAAO,CAAC,MAAM,EAAE,CAAC,CAAC;CACtB,CAAC;AAEF,MAAM,MAAM,0BAA0B,GAAG,MAAM,MAAM,CAAC;AAKtD,eAAO,MAAM,6BAA6B,eACX,CAAC;AAQhC,eAAO,MAAM,sCAAsC,GACjD,gBAAe,0BAAiD,KAC/D,sBAAsB,GAAG,IAmH3B,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { type FramePreviewWorkerFrame } from '../workers/frame-preview-protocol';
|
|
2
|
+
export type FramePreviewExtractionFrame = FramePreviewWorkerFrame;
|
|
3
|
+
export type ExtractedFramePreview = FramePreviewExtractionFrame & {
|
|
4
|
+
blob: Blob;
|
|
5
|
+
};
|
|
6
|
+
export type FramePreviewDecodeErrorCode = 'decode' | 'invalid-media' | 'unsupported';
|
|
7
|
+
export declare class FramePreviewDecodeError extends Error {
|
|
8
|
+
readonly code: FramePreviewDecodeErrorCode;
|
|
9
|
+
constructor(code: FramePreviewDecodeErrorCode, message: string);
|
|
10
|
+
}
|
|
11
|
+
export type MediabunnyFramePreviewSource = {
|
|
12
|
+
dispose(): void;
|
|
13
|
+
extract(frames: readonly FramePreviewExtractionFrame[], onFrame: (frame: ExtractedFramePreview) => void): Promise<void>;
|
|
14
|
+
frameWidth: number;
|
|
15
|
+
mediaDurationUs: number;
|
|
16
|
+
};
|
|
17
|
+
export type MediabunnyFramePreviewSourceFactory = (blob: Blob, signal: AbortSignal, outputHeight?: number) => Promise<MediabunnyFramePreviewSource>;
|
|
18
|
+
export type FramePreviewWorkerFactory = () => Worker;
|
|
19
|
+
export declare const canUseMediabunnyFramePreviewWorker: () => boolean;
|
|
20
|
+
export declare const createMediabunnyFramePreviewSource: (blob: Blob, signal: AbortSignal, outputHeight?: number, workerFactory?: FramePreviewWorkerFactory) => Promise<MediabunnyFramePreviewSource>;
|
|
21
|
+
//# sourceMappingURL=mediabunny-frame-preview.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mediabunny-frame-preview.d.ts","sourceRoot":"","sources":["../../../../src/editor/media/mediabunny-frame-preview.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,uBAAuB,EAE7B,MAAM,mCAAmC,CAAC;AAG3C,MAAM,MAAM,2BAA2B,GAAG,uBAAuB,CAAC;AAElE,MAAM,MAAM,qBAAqB,GAAG,2BAA2B,GAAG;IAChE,IAAI,EAAE,IAAI,CAAC;CACZ,CAAC;AAEF,MAAM,MAAM,2BAA2B,GACnC,QAAQ,GACR,eAAe,GACf,aAAa,CAAC;AAElB,qBAAa,uBAAwB,SAAQ,KAAK;IAChD,QAAQ,CAAC,IAAI,EAAE,2BAA2B,CAAC;gBAE/B,IAAI,EAAE,2BAA2B,EAAE,OAAO,EAAE,MAAM;CAK/D;AAED,MAAM,MAAM,4BAA4B,GAAG;IACzC,OAAO,IAAI,IAAI,CAAC;IAChB,OAAO,CACL,MAAM,EAAE,SAAS,2BAA2B,EAAE,EAC9C,OAAO,EAAE,CAAC,KAAK,EAAE,qBAAqB,KAAK,IAAI,GAC9C,OAAO,CAAC,IAAI,CAAC,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,eAAe,EAAE,MAAM,CAAC;CACzB,CAAC;AAEF,MAAM,MAAM,mCAAmC,GAAG,CAChD,IAAI,EAAE,IAAI,EACV,MAAM,EAAE,WAAW,EACnB,YAAY,CAAC,EAAE,MAAM,KAClB,OAAO,CAAC,4BAA4B,CAAC,CAAC;AAE3C,MAAM,MAAM,yBAAyB,GAAG,MAAM,MAAM,CAAC;AAiBrD,eAAO,MAAM,kCAAkC,eAGV,CAAC;AAEtC,eAAO,MAAM,kCAAkC,GAC7C,MAAM,IAAI,EACV,QAAQ,WAAW,EACnB,qBAAiB,EACjB,gBAAe,yBAAgD,KAC9D,OAAO,CAAC,4BAA4B,CA8ItC,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { TimelineClipSpeed } from '../core/model';
|
|
2
|
+
export type PreviewAudioConfiguration = {
|
|
3
|
+
muted: boolean;
|
|
4
|
+
speed: TimelineClipSpeed;
|
|
5
|
+
volume: number;
|
|
6
|
+
};
|
|
7
|
+
export declare class PreviewAudioEngine {
|
|
8
|
+
private appliedConfigurations;
|
|
9
|
+
private audioContext;
|
|
10
|
+
private connections;
|
|
11
|
+
private disposed;
|
|
12
|
+
private registrationPromise;
|
|
13
|
+
private soundTouchModulePromise;
|
|
14
|
+
configure(element: HTMLMediaElement, configuration: PreviewAudioConfiguration): void;
|
|
15
|
+
prepare(element: HTMLMediaElement, configuration: PreviewAudioConfiguration): Promise<boolean>;
|
|
16
|
+
release(element: HTMLMediaElement): void;
|
|
17
|
+
resume(): Promise<boolean>;
|
|
18
|
+
dispose(): void;
|
|
19
|
+
private createConnection;
|
|
20
|
+
private getAudioContext;
|
|
21
|
+
private getSoundTouchModule;
|
|
22
|
+
}
|
|
23
|
+
//# sourceMappingURL=preview-audio-engine.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"preview-audio-engine.d.ts","sourceRoot":"","sources":["../../../../src/editor/media/preview-audio-engine.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAEvD,MAAM,MAAM,yBAAyB,GAAG;IACtC,KAAK,EAAE,OAAO,CAAC;IACf,KAAK,EAAE,iBAAiB,CAAC;IACzB,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AAoGF,qBAAa,kBAAkB;IAC7B,OAAO,CAAC,qBAAqB,CAGzB;IACJ,OAAO,CAAC,YAAY,CAA6B;IACjD,OAAO,CAAC,WAAW,CAGf;IACJ,OAAO,CAAC,QAAQ,CAAS;IACzB,OAAO,CAAC,mBAAmB,CAA8B;IACzD,OAAO,CAAC,uBAAuB,CAEf;IAEhB,SAAS,CACP,OAAO,EAAE,gBAAgB,EACzB,aAAa,EAAE,yBAAyB;IAyCpC,OAAO,CACX,OAAO,EAAE,gBAAgB,EACzB,aAAa,EAAE,yBAAyB,GACvC,OAAO,CAAC,OAAO,CAAC;IAqCnB,OAAO,CAAC,OAAO,EAAE,gBAAgB;IAS3B,MAAM,IAAI,OAAO,CAAC,OAAO,CAAC;IAOhC,OAAO;YAkBO,gBAAgB;YAoChB,eAAe;IAe7B,OAAO,CAAC,mBAAmB;CAM5B"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { TimelineTimedMediaClip, TimelineTrack } from '../types';
|
|
2
|
+
import type { PreviewAudioConfiguration, PreviewAudioEngine } from './preview-audio-engine';
|
|
3
|
+
type PreviewPlaybackAudioEngine = Pick<PreviewAudioEngine, 'configure' | 'resume'>;
|
|
4
|
+
export type PreviewPlaybackUpdate = {
|
|
5
|
+
activeClips: readonly TimelineTimedMediaClip[];
|
|
6
|
+
audioEngine: PreviewPlaybackAudioEngine | null;
|
|
7
|
+
currentTimeUs: number;
|
|
8
|
+
isPlaying: boolean;
|
|
9
|
+
mediaElements: ReadonlyMap<string, HTMLMediaElement>;
|
|
10
|
+
objectUrls: Readonly<Record<string, string>>;
|
|
11
|
+
tracksById: ReadonlyMap<string, TimelineTrack>;
|
|
12
|
+
};
|
|
13
|
+
export type PreviewPlaybackUpdateResult = {
|
|
14
|
+
didSynchronize: boolean;
|
|
15
|
+
startPromise: Promise<void> | null;
|
|
16
|
+
};
|
|
17
|
+
export declare const getPreviewAudioConfiguration: (clip: TimelineTimedMediaClip, tracksById: ReadonlyMap<string, TimelineTrack>, forceMuted?: boolean) => PreviewAudioConfiguration;
|
|
18
|
+
export declare const getPreviewMediaTimingKey: (clip: TimelineTimedMediaClip) => string;
|
|
19
|
+
export declare const seekPreviewMediaToTimelineTime: (media: HTMLMediaElement, clip: TimelineTimedMediaClip, timelineTimeUs: number, timelineToleranceSeconds?: number) => boolean;
|
|
20
|
+
export declare class PreviewPlaybackController {
|
|
21
|
+
private session;
|
|
22
|
+
release(clipId: string, element: HTMLMediaElement): void;
|
|
23
|
+
update({ activeClips, audioEngine, currentTimeUs, isPlaying, mediaElements, objectUrls, tracksById, }: PreviewPlaybackUpdate): PreviewPlaybackUpdateResult;
|
|
24
|
+
}
|
|
25
|
+
export {};
|
|
26
|
+
//# sourceMappingURL=preview-playback-controller.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"preview-playback-controller.d.ts","sourceRoot":"","sources":["../../../../src/editor/media/preview-playback-controller.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,sBAAsB,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACtE,OAAO,KAAK,EACV,yBAAyB,EACzB,kBAAkB,EACnB,MAAM,wBAAwB,CAAC;AAKhC,KAAK,0BAA0B,GAAG,IAAI,CACpC,kBAAkB,EAClB,WAAW,GAAG,QAAQ,CACvB,CAAC;AASF,MAAM,MAAM,qBAAqB,GAAG;IAClC,WAAW,EAAE,SAAS,sBAAsB,EAAE,CAAC;IAC/C,WAAW,EAAE,0BAA0B,GAAG,IAAI,CAAC;IAC/C,aAAa,EAAE,MAAM,CAAC;IACtB,SAAS,EAAE,OAAO,CAAC;IACnB,aAAa,EAAE,WAAW,CAAC,MAAM,EAAE,gBAAgB,CAAC,CAAC;IACrD,UAAU,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;IAC7C,UAAU,EAAE,WAAW,CAAC,MAAM,EAAE,aAAa,CAAC,CAAC;CAChD,CAAC;AAEF,MAAM,MAAM,2BAA2B,GAAG;IACxC,cAAc,EAAE,OAAO,CAAC;IACxB,YAAY,EAAE,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC;CACpC,CAAC;AAEF,eAAO,MAAM,4BAA4B,GACvC,MAAM,sBAAsB,EAC5B,YAAY,WAAW,CAAC,MAAM,EAAE,aAAa,CAAC,EAC9C,oBAAkB,KACjB,yBAOD,CAAC;AAEH,eAAO,MAAM,wBAAwB,GAAI,MAAM,sBAAsB,WAOxD,CAAC;AAEd,eAAO,MAAM,8BAA8B,GACzC,OAAO,gBAAgB,EACvB,MAAM,sBAAsB,EAC5B,gBAAgB,MAAM,EACtB,iCAAuD,YAYxD,CAAC;AAkBF,qBAAa,yBAAyB;IACpC,OAAO,CAAC,OAAO,CAAwB;IAEvC,OAAO,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,gBAAgB;IAQjD,MAAM,CAAC,EACL,WAAW,EACX,WAAW,EACX,aAAa,EACb,SAAS,EACT,aAAa,EACb,UAAU,EACV,UAAU,GACX,EAAE,qBAAqB,GAAG,2BAA2B;CA8GvD"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { type MediabunnyFramePreviewSourceFactory } from './mediabunny-frame-preview';
|
|
2
|
+
export declare const TRIM_FRAME_PREVIEW_HEIGHT = 104;
|
|
3
|
+
export declare const SINGLE_FRAME_PREVIEW_CACHE_LIMIT = 32;
|
|
4
|
+
export type SingleFramePreviewRequest = {
|
|
5
|
+
height: number;
|
|
6
|
+
sourceDurationUs: number;
|
|
7
|
+
src: string;
|
|
8
|
+
};
|
|
9
|
+
export type SingleFramePreviewResult = {
|
|
10
|
+
status: 'loading';
|
|
11
|
+
} | {
|
|
12
|
+
height: number;
|
|
13
|
+
status: 'ready';
|
|
14
|
+
timeUs: number;
|
|
15
|
+
url: string;
|
|
16
|
+
width: number;
|
|
17
|
+
} | {
|
|
18
|
+
message: string;
|
|
19
|
+
status: 'error' | 'unsupported';
|
|
20
|
+
};
|
|
21
|
+
export type SingleFramePreviewSession = {
|
|
22
|
+
dispose(): void;
|
|
23
|
+
request(timeUs: number): void;
|
|
24
|
+
};
|
|
25
|
+
export type SingleFramePreviewSubscriber = (result: SingleFramePreviewResult) => void;
|
|
26
|
+
export declare const createSingleFramePreviewRuntime: (getBlob: (src: string) => Promise<Blob>, isDisposed: () => boolean, customCreateSource?: MediabunnyFramePreviewSourceFactory) => {
|
|
27
|
+
clear(): void;
|
|
28
|
+
createSession: (rawRequest: SingleFramePreviewRequest, subscriber: SingleFramePreviewSubscriber) => SingleFramePreviewSession;
|
|
29
|
+
};
|
|
30
|
+
//# sourceMappingURL=single-frame-preview.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"single-frame-preview.d.ts","sourceRoot":"","sources":["../../../../src/editor/media/single-frame-preview.ts"],"names":[],"mappings":"AAGA,OAAO,EAIL,KAAK,mCAAmC,EACzC,MAAM,4BAA4B,CAAC;AAEpC,eAAO,MAAM,yBAAyB,MAAM,CAAC;AAC7C,eAAO,MAAM,gCAAgC,KAAK,CAAC;AAEnD,MAAM,MAAM,yBAAyB,GAAG;IACtC,MAAM,EAAE,MAAM,CAAC;IACf,gBAAgB,EAAE,MAAM,CAAC;IACzB,GAAG,EAAE,MAAM,CAAC;CACb,CAAC;AAEF,MAAM,MAAM,wBAAwB,GAChC;IAAE,MAAM,EAAE,SAAS,CAAA;CAAE,GACrB;IACE,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,OAAO,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;IACf,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;CACf,GACD;IACE,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,OAAO,GAAG,aAAa,CAAC;CACjC,CAAC;AAEN,MAAM,MAAM,yBAAyB,GAAG;IACtC,OAAO,IAAI,IAAI,CAAC;IAChB,OAAO,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;CAC/B,CAAC;AAEF,MAAM,MAAM,4BAA4B,GAAG,CACzC,MAAM,EAAE,wBAAwB,KAC7B,IAAI,CAAC;AA0DV,eAAO,MAAM,+BAA+B,GAC1C,SAAS,CAAC,GAAG,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,EACvC,YAAY,MAAM,OAAO,EACzB,qBAAqB,mCAAmC;;gCAuC1C,yBAAyB,cACzB,4BAA4B,KACvC,yBAAyB;CAoJ7B,CAAC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { TimelineTextLayoutSize } from '../core/model';
|
|
2
|
+
import { type TimelineTextFontType } from '../core/text-fonts';
|
|
3
|
+
export type TextLayoutErrorCode = 'cancelled' | 'font-load-failed' | 'measurement-failed' | 'unsupported';
|
|
4
|
+
export declare class TextLayoutError extends Error {
|
|
5
|
+
readonly code: TextLayoutErrorCode;
|
|
6
|
+
constructor(code: TextLayoutErrorCode, message: string, options?: ErrorOptions);
|
|
7
|
+
}
|
|
8
|
+
export type TextLayoutRequest = Readonly<{
|
|
9
|
+
bold: boolean;
|
|
10
|
+
fontSize: number;
|
|
11
|
+
fontType: TimelineTextFontType;
|
|
12
|
+
italic: boolean;
|
|
13
|
+
text: string;
|
|
14
|
+
}>;
|
|
15
|
+
export type TextLayoutRuntime = {
|
|
16
|
+
dispose(): void;
|
|
17
|
+
measure(request: TextLayoutRequest, signal?: AbortSignal): Promise<TimelineTextLayoutSize>;
|
|
18
|
+
};
|
|
19
|
+
type TextMeasurementContext = Pick<CanvasRenderingContext2D, 'font' | 'measureText' | 'textAlign' | 'textBaseline'>;
|
|
20
|
+
type CreateTextLayoutRuntimeOptions = {
|
|
21
|
+
createContext?: () => TextMeasurementContext | null;
|
|
22
|
+
fontFaceSet?: Pick<FontFaceSet, 'load'> | null;
|
|
23
|
+
maxEntries?: number;
|
|
24
|
+
};
|
|
25
|
+
export declare const createTextLayoutRuntime: (options?: CreateTextLayoutRuntimeOptions) => TextLayoutRuntime;
|
|
26
|
+
export {};
|
|
27
|
+
//# sourceMappingURL=text-layout-runtime.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"text-layout-runtime.d.ts","sourceRoot":"","sources":["../../../../src/editor/media/text-layout-runtime.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,eAAe,CAAC;AAC5D,OAAO,EAEL,KAAK,oBAAoB,EAC1B,MAAM,oBAAoB,CAAC;AAO5B,MAAM,MAAM,mBAAmB,GAC3B,WAAW,GACX,kBAAkB,GAClB,oBAAoB,GACpB,aAAa,CAAC;AAElB,qBAAa,eAAgB,SAAQ,KAAK;IACxC,QAAQ,CAAC,IAAI,EAAE,mBAAmB,CAAC;gBAEvB,IAAI,EAAE,mBAAmB,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,YAAY;CAK/E;AAED,MAAM,MAAM,iBAAiB,GAAG,QAAQ,CAAC;IACvC,IAAI,EAAE,OAAO,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,oBAAoB,CAAC;IAC/B,MAAM,EAAE,OAAO,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;CACd,CAAC,CAAC;AAEH,MAAM,MAAM,iBAAiB,GAAG;IAC9B,OAAO,IAAI,IAAI,CAAC;IAChB,OAAO,CACL,OAAO,EAAE,iBAAiB,EAC1B,MAAM,CAAC,EAAE,WAAW,GACnB,OAAO,CAAC,sBAAsB,CAAC,CAAC;CACpC,CAAC;AAEF,KAAK,sBAAsB,GAAG,IAAI,CAChC,wBAAwB,EACxB,MAAM,GAAG,aAAa,GAAG,WAAW,GAAG,cAAc,CACtD,CAAC;AAEF,KAAK,8BAA8B,GAAG;IACpC,aAAa,CAAC,EAAE,MAAM,sBAAsB,GAAG,IAAI,CAAC;IACpD,WAAW,CAAC,EAAE,IAAI,CAAC,WAAW,EAAE,MAAM,CAAC,GAAG,IAAI,CAAC;IAC/C,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB,CAAC;AA0DF,eAAO,MAAM,uBAAuB,GAClC,UAAS,8BAAmC,KAC3C,iBAsIF,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/editor/store/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC;AACjC,cAAc,0BAA0B,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { type ReactNode } from 'react';
|
|
2
|
+
import type { VideoTimelineDraft, VideoTimelineSource } from '../types';
|
|
3
|
+
import { type TimelineStore, type TimelineStoreApi } from './timeline-store';
|
|
4
|
+
export type TimelineStoreProviderProps = {
|
|
5
|
+
children: ReactNode;
|
|
6
|
+
initialDraft?: VideoTimelineDraft;
|
|
7
|
+
sources?: VideoTimelineSource[];
|
|
8
|
+
store?: TimelineStoreApi;
|
|
9
|
+
};
|
|
10
|
+
export declare const TimelineStoreProvider: ({ children, initialDraft, sources, store: providedStore, }: TimelineStoreProviderProps) => import("react").FunctionComponentElement<import("react").ProviderProps<TimelineStoreApi | null>>;
|
|
11
|
+
export declare const useTimelineStoreApi: () => TimelineStoreApi;
|
|
12
|
+
export declare function useTimelineStore(): TimelineStore;
|
|
13
|
+
export declare function useTimelineStore<T>(selector: (state: TimelineStore) => T): T;
|
|
14
|
+
//# sourceMappingURL=timeline-store-context.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"timeline-store-context.d.ts","sourceRoot":"","sources":["../../../../src/editor/store/timeline-store-context.ts"],"names":[],"mappings":"AAAA,OAAO,EAKL,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AAGf,OAAO,KAAK,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AACxE,OAAO,EAEL,KAAK,aAAa,EAClB,KAAK,gBAAgB,EACtB,MAAM,kBAAkB,CAAC;AAI1B,MAAM,MAAM,0BAA0B,GAAG;IACvC,QAAQ,EAAE,SAAS,CAAC;IACpB,YAAY,CAAC,EAAE,kBAAkB,CAAC;IAClC,OAAO,CAAC,EAAE,mBAAmB,EAAE,CAAC;IAChC,KAAK,CAAC,EAAE,gBAAgB,CAAC;CAC1B,CAAC;AAEF,eAAO,MAAM,qBAAqB,GAAI,4DAKnC,0BAA0B,qGAW5B,CAAC;AAEF,eAAO,MAAM,mBAAmB,QAAO,gBAOtC,CAAC;AAEF,wBAAgB,gBAAgB,IAAI,aAAa,CAAC;AAClD,wBAAgB,gBAAgB,CAAC,CAAC,EAAE,QAAQ,EAAE,CAAC,KAAK,EAAE,aAAa,KAAK,CAAC,GAAG,CAAC,CAAC"}
|