@flycut/timeline-kit 0.0.0-stage → 0.2.1
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 +661 -0
- package/README.md +227 -2
- package/dist/chunks/TimelineEditor-ZMbJ8-ee.js +2051 -0
- package/dist/chunks/TimelineEditor-ZMbJ8-ee.js.map +1 -0
- package/dist/chunks/index-KK9cAE8q.js +661 -0
- package/dist/chunks/index-KK9cAE8q.js.map +1 -0
- package/dist/chunks/interactionManager-JoPxZ8st.js +775 -0
- package/dist/chunks/interactionManager-JoPxZ8st.js.map +1 -0
- package/dist/chunks/otio-6KO_Tfi1.js +510 -0
- package/dist/chunks/otio-6KO_Tfi1.js.map +1 -0
- package/dist/core.js +1673 -0
- package/dist/core.js.map +1 -0
- package/dist/index.js +100 -0
- package/dist/index.js.map +1 -0
- package/dist/otio.js +313 -0
- package/dist/otio.js.map +1 -0
- package/dist/plugins.js +243 -0
- package/dist/plugins.js.map +1 -0
- package/dist/react.js +259 -0
- package/dist/react.js.map +1 -0
- package/dist/types/adapters/react/index.d.ts +45 -0
- package/dist/types/adapters/vue/index.d.ts +202 -0
- package/dist/types/src/adapters/otio.d.ts +7 -0
- package/dist/types/src/core-entry.d.ts +8 -0
- package/dist/types/src/editor/TimelineEditor.d.ts +96 -0
- package/dist/types/src/editor/index.d.ts +2 -0
- package/dist/types/src/editor/types.d.ts +30 -0
- package/dist/types/src/engine/hitTest.d.ts +23 -0
- package/dist/types/src/engine/index.d.ts +7 -0
- package/dist/types/src/engine/layout.d.ts +47 -0
- package/dist/types/src/engine/magnet.d.ts +46 -0
- package/dist/types/src/engine/placement.d.ts +13 -0
- package/dist/types/src/engine/snap.d.ts +28 -0
- package/dist/types/src/engine/timeScale.d.ts +12 -0
- package/dist/types/src/engine/virtualization.d.ts +11 -0
- package/dist/types/src/frameworks/slotBridge.d.ts +13 -0
- package/dist/types/src/index.d.ts +10 -0
- package/dist/types/src/model/demoDocument.d.ts +3 -0
- package/dist/types/src/model/index.d.ts +4 -0
- package/dist/types/src/model/operations.d.ts +77 -0
- package/dist/types/src/model/structuralSharing.d.ts +11 -0
- package/dist/types/src/model/types.d.ts +55 -0
- package/dist/types/src/otio-core/commands/create.d.ts +6 -0
- package/dist/types/src/otio-core/commands/helpers.d.ts +5 -0
- package/dist/types/src/otio-core/commands/insert.d.ts +2 -0
- package/dist/types/src/otio-core/commands/move.d.ts +2 -0
- package/dist/types/src/otio-core/commands/split.d.ts +2 -0
- package/dist/types/src/otio-core/commands/trim.d.ts +3 -0
- package/dist/types/src/otio-core/flycut-otio-draft.d.ts +239 -0
- package/dist/types/src/otio-core/guards.d.ts +5 -0
- package/dist/types/src/otio-core/index.d.ts +14 -0
- package/dist/types/src/otio-core/media/clipMetadata.d.ts +18 -0
- package/dist/types/src/otio-core/media/reference.d.ts +9 -0
- package/dist/types/src/otio-core/selectors/clip.d.ts +4 -0
- package/dist/types/src/otio-core/selectors/timeline.d.ts +5 -0
- package/dist/types/src/otio-core/selectors/track.d.ts +8 -0
- package/dist/types/src/otio-core/types.d.ts +61 -0
- package/dist/types/src/otio-entry.d.ts +2 -0
- package/dist/types/src/plugins/clipDragPlugin.d.ts +2 -0
- package/dist/types/src/plugins/clipTrimPlugin.d.ts +2 -0
- package/dist/types/src/plugins/externalDropPlugin.d.ts +13 -0
- package/dist/types/src/plugins/index.d.ts +17 -0
- package/dist/types/src/plugins/interactionManager.d.ts +33 -0
- package/dist/types/src/plugins/marqueeSelectPlugin.d.ts +2 -0
- package/dist/types/src/plugins/playheadPlugin.d.ts +2 -0
- package/dist/types/src/plugins/selectionPlugin.d.ts +2 -0
- package/dist/types/src/plugins/shortcutsPlugin.d.ts +7 -0
- package/dist/types/src/plugins/snapProviders.d.ts +9 -0
- package/dist/types/src/plugins/types.d.ts +110 -0
- package/dist/types/src/plugins/wheelPlugin.d.ts +2 -0
- package/dist/types/src/plugins-entry.d.ts +1 -0
- package/dist/types/src/renderer/domRenderer.d.ts +73 -0
- package/dist/types/src/renderer/index.d.ts +6 -0
- package/dist/types/src/renderer/ruler.d.ts +18 -0
- package/dist/types/src/renderer/styles.d.ts +1 -0
- package/dist/types/src/renderer/types.d.ts +65 -0
- package/dist/types/src/renderer/ui/icons.d.ts +7 -0
- package/dist/types/src/renderer/ui/sidebar.d.ts +14 -0
- package/dist/types/src/renderer/ui/toolbar.d.ts +16 -0
- package/dist/types/src/store/builtinCommands.d.ts +56 -0
- package/dist/types/src/store/commandBus.d.ts +18 -0
- package/dist/types/src/store/index.d.ts +4 -0
- package/dist/types/src/store/store.d.ts +53 -0
- package/dist/types/src/store/types.d.ts +59 -0
- package/dist/types/src/utils/trimOffset.d.ts +9 -0
- package/dist/vue.js +278 -0
- package/dist/vue.js.map +1 -0
- package/package.json +111 -4
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { TimelineDocument } from './types.js';
|
|
2
|
+
/**
|
|
3
|
+
* Returns `next`, but with every track and clip that is structurally equal to its
|
|
4
|
+
* counterpart in `prev` replaced by the `prev` object itself. Store documents are
|
|
5
|
+
* treated as immutable, so successive history entries can share unchanged parts
|
|
6
|
+
* instead of each holding a full deep copy.
|
|
7
|
+
*
|
|
8
|
+
* Clips are matched by id and tracks by id, so reordering is handled. If nothing
|
|
9
|
+
* changed at all, `prev` is returned as-is.
|
|
10
|
+
*/
|
|
11
|
+
export declare function shareStructure<TTrackMeta, TClipMeta>(prev: TimelineDocument<TTrackMeta, TClipMeta> | null | undefined, next: TimelineDocument<TTrackMeta, TClipMeta>): TimelineDocument<TTrackMeta, TClipMeta>;
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
export interface TimelineTrimRange {
|
|
2
|
+
startMs: number;
|
|
3
|
+
endMs: number;
|
|
4
|
+
}
|
|
5
|
+
export interface TimelineClip<TMeta = Record<string, unknown>> {
|
|
6
|
+
id: string;
|
|
7
|
+
type: string;
|
|
8
|
+
name: string;
|
|
9
|
+
startMs: number;
|
|
10
|
+
endMs: number;
|
|
11
|
+
resource?: string;
|
|
12
|
+
durationMs?: number;
|
|
13
|
+
trim?: TimelineTrimRange;
|
|
14
|
+
meta?: TMeta;
|
|
15
|
+
}
|
|
16
|
+
export interface TimelineTrack<TTrackMeta = Record<string, unknown>, TClipMeta = Record<string, unknown>> {
|
|
17
|
+
id: string;
|
|
18
|
+
type: string;
|
|
19
|
+
name: string;
|
|
20
|
+
clips: TimelineClip<TClipMeta>[];
|
|
21
|
+
locked?: boolean;
|
|
22
|
+
visible?: boolean;
|
|
23
|
+
muted?: boolean;
|
|
24
|
+
main?: boolean;
|
|
25
|
+
meta?: TTrackMeta;
|
|
26
|
+
}
|
|
27
|
+
export interface TimelineDocument<TTrackMeta = Record<string, unknown>, TClipMeta = Record<string, unknown>> {
|
|
28
|
+
id: string;
|
|
29
|
+
name: string;
|
|
30
|
+
fps: number;
|
|
31
|
+
tracks: TimelineTrack<TTrackMeta, TClipMeta>[];
|
|
32
|
+
meta?: Record<string, unknown>;
|
|
33
|
+
}
|
|
34
|
+
export interface TimelineSelection {
|
|
35
|
+
trackIndex: number;
|
|
36
|
+
clipIndex: number;
|
|
37
|
+
clipId: string | null;
|
|
38
|
+
clipIds: string[];
|
|
39
|
+
}
|
|
40
|
+
export interface EditDropContext {
|
|
41
|
+
clip: TimelineClip;
|
|
42
|
+
sourceTrack?: TimelineTrack;
|
|
43
|
+
targetTrack: TimelineTrack;
|
|
44
|
+
startMs: number;
|
|
45
|
+
endMs: number;
|
|
46
|
+
}
|
|
47
|
+
export interface EditPolicies {
|
|
48
|
+
allowOverlap: boolean;
|
|
49
|
+
allowCrossTrackType: boolean;
|
|
50
|
+
removeEmptyTracks: boolean;
|
|
51
|
+
orderAudioToBottom: boolean;
|
|
52
|
+
minClipDurationMs?: number;
|
|
53
|
+
canDrop?: (ctx: EditDropContext) => boolean;
|
|
54
|
+
}
|
|
55
|
+
export declare const DEFAULT_EDIT_POLICIES: EditPolicies;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { Clip, Gap, MediaReference, RationalTime, Timeline, Track } from '../types.js';
|
|
2
|
+
export declare function createRationalTime(value: number, rate: number): RationalTime;
|
|
3
|
+
export declare function createTimeline(name: string, fps?: number): Timeline;
|
|
4
|
+
export declare function createTrack(name: string, kind: Track['kind']): Track;
|
|
5
|
+
export declare function createClip(name: string, reference: MediaReference, durationFrames: number, fps: number): Clip;
|
|
6
|
+
export declare function createGap(name: string, durationFrames: number, fps: number): Gap;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { Gap, TimelineItem, Track } from '../types.js';
|
|
2
|
+
export declare function createId(prefix?: string): string;
|
|
3
|
+
export declare function cloneTrack(track: Track): Track;
|
|
4
|
+
export declare function mergeAdjacentGaps(items: TimelineItem[]): TimelineItem[];
|
|
5
|
+
export declare function createGapLike(source: Gap, durationFrames: number): Gap;
|
|
@@ -0,0 +1,239 @@
|
|
|
1
|
+
import type { RationalTime, TimeRange } from "./types.js";
|
|
2
|
+
/**
|
|
3
|
+
* OTIO-centered schema draft types derived from docs/design-docs/editor-domain-model.md.
|
|
4
|
+
*
|
|
5
|
+
* These types are intentionally additive:
|
|
6
|
+
* - they do not replace the current runtime schema
|
|
7
|
+
* - they provide a concrete TypeScript landing zone for the OTIO-centered model
|
|
8
|
+
* - they can be imported gradually while the rest of the codebase still uses legacy metadata shapes
|
|
9
|
+
*/
|
|
10
|
+
export type ProjectId = string;
|
|
11
|
+
export type AssetId = string;
|
|
12
|
+
export type TimelineId = string;
|
|
13
|
+
export type TrackId = string;
|
|
14
|
+
export type ClipId = string;
|
|
15
|
+
export type TransitionId = string;
|
|
16
|
+
export type EffectId = string;
|
|
17
|
+
export type KeyframeTrackId = string;
|
|
18
|
+
export type FlycutTimebaseDraft = "frames" | "seconds";
|
|
19
|
+
export type FlycutPreviewScaleModeDraft = "fit" | "fill" | "stretch";
|
|
20
|
+
export type FlycutTrackRoleDraft = "main" | "overlay" | "title" | "caption" | "bgm" | "sfx" | "voiceover";
|
|
21
|
+
export type FlycutAssetTypeDraft = "video" | "audio" | "image" | "gif" | "svg" | "text";
|
|
22
|
+
export type FlycutAnchorDraft = "center" | "top-left" | "top-right" | "bottom-left" | "bottom-right";
|
|
23
|
+
export type FlycutFitModeDraft = "fill" | "fit" | "stretch" | "none";
|
|
24
|
+
export type FlycutBlendModeDraft = "normal" | "multiply" | "screen" | "overlay" | "darken" | "lighten";
|
|
25
|
+
export type FlycutKeyframeEasingDraft = "linear" | "ease-in" | "ease-out" | "ease-in-out" | "bezier";
|
|
26
|
+
export interface FlycutProjectSettingsDraft {
|
|
27
|
+
fps: number;
|
|
28
|
+
sampleRate: number;
|
|
29
|
+
timebase: FlycutTimebaseDraft;
|
|
30
|
+
dropFrame?: boolean;
|
|
31
|
+
canvasWidth: number;
|
|
32
|
+
canvasHeight: number;
|
|
33
|
+
aspectRatio: string;
|
|
34
|
+
background?: string;
|
|
35
|
+
previewScaleMode?: FlycutPreviewScaleModeDraft;
|
|
36
|
+
defaultTransitionDurationFrames?: number;
|
|
37
|
+
}
|
|
38
|
+
export interface FlycutTimelineMetadataDraft {
|
|
39
|
+
project: FlycutProjectSettingsDraft;
|
|
40
|
+
}
|
|
41
|
+
export interface FlycutTrackMetadataDraft {
|
|
42
|
+
role?: FlycutTrackRoleDraft;
|
|
43
|
+
main?: boolean;
|
|
44
|
+
locked?: boolean;
|
|
45
|
+
hidden?: boolean;
|
|
46
|
+
muted?: boolean;
|
|
47
|
+
}
|
|
48
|
+
export interface FlycutCropDraft {
|
|
49
|
+
x: number;
|
|
50
|
+
y: number;
|
|
51
|
+
width: number;
|
|
52
|
+
height: number;
|
|
53
|
+
}
|
|
54
|
+
export interface FlycutClipVisualDraft {
|
|
55
|
+
anchor?: FlycutAnchorDraft;
|
|
56
|
+
x: number;
|
|
57
|
+
y: number;
|
|
58
|
+
width?: number;
|
|
59
|
+
height?: number;
|
|
60
|
+
scaleX: number;
|
|
61
|
+
scaleY: number;
|
|
62
|
+
rotation: number;
|
|
63
|
+
opacity: number;
|
|
64
|
+
blendMode?: FlycutBlendModeDraft;
|
|
65
|
+
fit?: FlycutFitModeDraft;
|
|
66
|
+
crop?: FlycutCropDraft;
|
|
67
|
+
}
|
|
68
|
+
export interface FlycutKeyframeDraft<T = unknown> {
|
|
69
|
+
time: RationalTime;
|
|
70
|
+
value: T;
|
|
71
|
+
easing?: FlycutKeyframeEasingDraft;
|
|
72
|
+
}
|
|
73
|
+
export interface FlycutClipAnimationTrackDraft<T = unknown> {
|
|
74
|
+
id: KeyframeTrackId;
|
|
75
|
+
property: string;
|
|
76
|
+
keyframes: Array<FlycutKeyframeDraft<T>>;
|
|
77
|
+
}
|
|
78
|
+
export interface FlycutClipAnimationDraft {
|
|
79
|
+
tracks: Array<FlycutClipAnimationTrackDraft>;
|
|
80
|
+
}
|
|
81
|
+
export interface FlycutClipAudioDraft {
|
|
82
|
+
gain?: number;
|
|
83
|
+
muted?: boolean;
|
|
84
|
+
fadeInSec?: number;
|
|
85
|
+
fadeOutSec?: number;
|
|
86
|
+
}
|
|
87
|
+
export interface FlycutVisualEffectDraft {
|
|
88
|
+
id: EffectId;
|
|
89
|
+
type: string;
|
|
90
|
+
enabled: boolean;
|
|
91
|
+
params: Record<string, unknown>;
|
|
92
|
+
}
|
|
93
|
+
export interface FlycutTextStyleDraft {
|
|
94
|
+
fontFamily?: string;
|
|
95
|
+
fontSize?: number;
|
|
96
|
+
fontWeight?: number | string;
|
|
97
|
+
fill?: string;
|
|
98
|
+
align?: "left" | "center" | "right" | "justify";
|
|
99
|
+
lineHeight?: number;
|
|
100
|
+
stroke?: string;
|
|
101
|
+
strokeWidth?: number;
|
|
102
|
+
background?: string;
|
|
103
|
+
}
|
|
104
|
+
export interface FlycutClipMetadataDraft {
|
|
105
|
+
assetType?: FlycutAssetTypeDraft;
|
|
106
|
+
role?: FlycutTrackRoleDraft;
|
|
107
|
+
visual?: FlycutClipVisualDraft;
|
|
108
|
+
animation?: FlycutClipAnimationDraft;
|
|
109
|
+
audio?: FlycutClipAudioDraft;
|
|
110
|
+
visualEffects?: Array<FlycutVisualEffectDraft>;
|
|
111
|
+
textStyle?: FlycutTextStyleDraft;
|
|
112
|
+
}
|
|
113
|
+
export interface FlycutTimelineMetadataContainerDraft {
|
|
114
|
+
flycut: FlycutTimelineMetadataDraft;
|
|
115
|
+
}
|
|
116
|
+
export interface FlycutTrackMetadataContainerDraft {
|
|
117
|
+
flycut: FlycutTrackMetadataDraft;
|
|
118
|
+
}
|
|
119
|
+
export interface FlycutClipMetadataContainerDraft {
|
|
120
|
+
flycut: FlycutClipMetadataDraft;
|
|
121
|
+
}
|
|
122
|
+
export interface FlycutPointDraft {
|
|
123
|
+
OTIO_SCHEMA: "V2d.1";
|
|
124
|
+
x: number;
|
|
125
|
+
y: number;
|
|
126
|
+
}
|
|
127
|
+
export interface FlycutBoundsDraft {
|
|
128
|
+
OTIO_SCHEMA: "Box2d.1";
|
|
129
|
+
min: FlycutPointDraft;
|
|
130
|
+
max: FlycutPointDraft;
|
|
131
|
+
}
|
|
132
|
+
export interface FlycutExternalReferenceDraft {
|
|
133
|
+
OTIO_SCHEMA: "ExternalReference.1";
|
|
134
|
+
target_url: string;
|
|
135
|
+
available_range?: TimeRange;
|
|
136
|
+
available_image_bounds?: FlycutBoundsDraft;
|
|
137
|
+
metadata?: Record<string, unknown>;
|
|
138
|
+
}
|
|
139
|
+
export interface FlycutGeneratorReferenceDraft {
|
|
140
|
+
OTIO_SCHEMA: "GeneratorReference.1";
|
|
141
|
+
generator_kind: string;
|
|
142
|
+
parameters: Record<string, unknown>;
|
|
143
|
+
metadata?: Record<string, unknown>;
|
|
144
|
+
}
|
|
145
|
+
export interface FlycutMissingReferenceDraft {
|
|
146
|
+
OTIO_SCHEMA: "MissingReference.1";
|
|
147
|
+
metadata?: Record<string, unknown>;
|
|
148
|
+
}
|
|
149
|
+
export type FlycutMediaReferenceDraft = FlycutExternalReferenceDraft | FlycutGeneratorReferenceDraft | FlycutMissingReferenceDraft;
|
|
150
|
+
export interface FlycutEffectDraft {
|
|
151
|
+
OTIO_SCHEMA: "Effect.1";
|
|
152
|
+
name: string;
|
|
153
|
+
effect_name: string;
|
|
154
|
+
metadata?: Record<string, unknown>;
|
|
155
|
+
}
|
|
156
|
+
export interface FlycutClipDraft {
|
|
157
|
+
OTIO_SCHEMA: "Clip.1";
|
|
158
|
+
id: ClipId;
|
|
159
|
+
name: string;
|
|
160
|
+
source_range: TimeRange;
|
|
161
|
+
media_reference: FlycutMediaReferenceDraft;
|
|
162
|
+
effects?: FlycutEffectDraft[];
|
|
163
|
+
metadata?: Record<string, unknown>;
|
|
164
|
+
}
|
|
165
|
+
export interface FlycutGapDraft {
|
|
166
|
+
OTIO_SCHEMA: "Gap.1";
|
|
167
|
+
source_range: TimeRange;
|
|
168
|
+
metadata?: Record<string, unknown>;
|
|
169
|
+
}
|
|
170
|
+
export interface FlycutTransitionDraft {
|
|
171
|
+
OTIO_SCHEMA: "Transition.1";
|
|
172
|
+
id: TransitionId;
|
|
173
|
+
name: string;
|
|
174
|
+
transition_type: string;
|
|
175
|
+
in_offset: RationalTime;
|
|
176
|
+
out_offset: RationalTime;
|
|
177
|
+
metadata?: Record<string, unknown>;
|
|
178
|
+
}
|
|
179
|
+
export type FlycutTrackItemDraft = FlycutClipDraft | FlycutGapDraft | FlycutTransitionDraft;
|
|
180
|
+
export interface FlycutTrackDraft {
|
|
181
|
+
OTIO_SCHEMA: "Track.1";
|
|
182
|
+
id: TrackId;
|
|
183
|
+
name: string;
|
|
184
|
+
kind: "Video" | "Audio";
|
|
185
|
+
metadata?: Record<string, unknown>;
|
|
186
|
+
children: FlycutTrackItemDraft[];
|
|
187
|
+
}
|
|
188
|
+
export interface FlycutStackDraft {
|
|
189
|
+
OTIO_SCHEMA: "Stack.1";
|
|
190
|
+
children: FlycutTrackDraft[];
|
|
191
|
+
}
|
|
192
|
+
export interface FlycutTimelineDraft {
|
|
193
|
+
OTIO_SCHEMA: "Timeline.1";
|
|
194
|
+
id: TimelineId;
|
|
195
|
+
name: string;
|
|
196
|
+
metadata?: Record<string, unknown>;
|
|
197
|
+
tracks: FlycutStackDraft;
|
|
198
|
+
}
|
|
199
|
+
export interface FlycutResolvedFrameNodeDraft {
|
|
200
|
+
clipId: ClipId;
|
|
201
|
+
assetId?: AssetId;
|
|
202
|
+
type: string;
|
|
203
|
+
visible: boolean;
|
|
204
|
+
opacity: number;
|
|
205
|
+
transform: {
|
|
206
|
+
x: number;
|
|
207
|
+
y: number;
|
|
208
|
+
scaleX: number;
|
|
209
|
+
scaleY: number;
|
|
210
|
+
rotation: number;
|
|
211
|
+
};
|
|
212
|
+
width?: number;
|
|
213
|
+
height?: number;
|
|
214
|
+
crop?: FlycutCropDraft;
|
|
215
|
+
blendMode?: FlycutBlendModeDraft;
|
|
216
|
+
content?: Record<string, unknown>;
|
|
217
|
+
effects: Array<{
|
|
218
|
+
id: EffectId;
|
|
219
|
+
type: string;
|
|
220
|
+
params: Record<string, unknown>;
|
|
221
|
+
}>;
|
|
222
|
+
}
|
|
223
|
+
export interface FlycutResolvedAudioNodeDraft {
|
|
224
|
+
clipId: ClipId;
|
|
225
|
+
assetId?: AssetId;
|
|
226
|
+
gain: number;
|
|
227
|
+
muted: boolean;
|
|
228
|
+
playbackRate: number;
|
|
229
|
+
}
|
|
230
|
+
export interface FlycutResolvedFrameSceneDraft {
|
|
231
|
+
time: number;
|
|
232
|
+
canvas: {
|
|
233
|
+
width: number;
|
|
234
|
+
height: number;
|
|
235
|
+
background?: string;
|
|
236
|
+
};
|
|
237
|
+
nodes: Array<FlycutResolvedFrameNodeDraft>;
|
|
238
|
+
audio: Array<FlycutResolvedAudioNodeDraft>;
|
|
239
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { Clip, Gap, TimelineItem, Track } from './types.js';
|
|
2
|
+
export declare function isClip(item: TimelineItem): item is Clip;
|
|
3
|
+
export declare function isGap(item: TimelineItem): item is Gap;
|
|
4
|
+
export declare function isAudioTrack(track: Track): boolean;
|
|
5
|
+
export declare function isVideoTrack(track: Track): boolean;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export * from './commands/helpers.js';
|
|
2
|
+
export * from './commands/insert.js';
|
|
3
|
+
export * from './commands/move.js';
|
|
4
|
+
export * from './commands/split.js';
|
|
5
|
+
export * from './commands/trim.js';
|
|
6
|
+
export * from './commands/create.js';
|
|
7
|
+
export * from './guards.js';
|
|
8
|
+
export * from './media/reference.js';
|
|
9
|
+
export type { FlyCutMediaAssetType, FlyCutMediaMetadata, FlyCutMediaStorage, } from './media/clipMetadata.js';
|
|
10
|
+
export * from './selectors/clip.js';
|
|
11
|
+
export * from './selectors/track.js';
|
|
12
|
+
export * from './selectors/timeline.js';
|
|
13
|
+
export * from './flycut-otio-draft.js';
|
|
14
|
+
export * from './types.js';
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export type FlyCutMediaAssetType = 'video' | 'audio' | 'image' | 'gif' | 'svg';
|
|
2
|
+
export type FlyCutMediaStorage = 'opfs' | 'handle';
|
|
3
|
+
export interface FlyCutMediaMetadata {
|
|
4
|
+
assetType: FlyCutMediaAssetType;
|
|
5
|
+
mediaId: string;
|
|
6
|
+
storage: FlyCutMediaStorage;
|
|
7
|
+
mimeType: string;
|
|
8
|
+
sourceUrl?: string;
|
|
9
|
+
sourceDurationSec?: number;
|
|
10
|
+
sourceFps?: number;
|
|
11
|
+
width?: number;
|
|
12
|
+
height?: number;
|
|
13
|
+
waveformId?: string;
|
|
14
|
+
filmstripId?: string;
|
|
15
|
+
thumbnailId?: string;
|
|
16
|
+
}
|
|
17
|
+
export declare function readFlyCutMediaMetadata(metadata: Record<string, unknown> | undefined): FlyCutMediaMetadata | undefined;
|
|
18
|
+
export declare function writeFlyCutMediaMetadata(metadata: Record<string, unknown> | undefined, flyCut: FlyCutMediaMetadata | undefined): Record<string, unknown> | undefined;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { ExternalReference } from '../types.js';
|
|
2
|
+
import { type FlyCutMediaMetadata } from './clipMetadata.js';
|
|
3
|
+
export declare function createManagedExternalReference(mediaId: string): ExternalReference;
|
|
4
|
+
export declare function isManagedExternalReference(reference: Pick<ExternalReference, 'target_url'>): boolean;
|
|
5
|
+
export declare function getManagedMediaId(reference: Pick<ExternalReference, 'target_url'>): string | undefined;
|
|
6
|
+
export declare function readFlyCutMediaMetadata(metadata: Record<string, unknown> | undefined): FlyCutMediaMetadata | undefined;
|
|
7
|
+
export declare function writeFlyCutMediaMetadata(metadata: Record<string, unknown> | undefined, flyCut: FlyCutMediaMetadata | undefined): Record<string, unknown> | undefined;
|
|
8
|
+
export declare function readFlyCutMediaMetadataFromReference(reference: ExternalReference): FlyCutMediaMetadata | undefined;
|
|
9
|
+
export declare function writeFlyCutMediaMetadataToReference(reference: ExternalReference, flyCut: FlyCutMediaMetadata | undefined): ExternalReference;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { RationalTime, Timeline, TimelineItem, Track } from '../types.js';
|
|
2
|
+
export declare function toSeconds(time: RationalTime): number;
|
|
3
|
+
export declare function getItemDurationSeconds(item: TimelineItem): number;
|
|
4
|
+
export declare function getTrackDurationSeconds(track: Track): number;
|
|
5
|
+
export declare function getTimelineDurationSeconds(timeline: Timeline): number;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { TimelineItem, Track } from '../types.js';
|
|
2
|
+
export interface TrackItemOffset {
|
|
3
|
+
item: TimelineItem;
|
|
4
|
+
start: number;
|
|
5
|
+
end: number;
|
|
6
|
+
}
|
|
7
|
+
export declare function getTrackItemOffsets(track: Track): TrackItemOffset[];
|
|
8
|
+
export declare function getTrackVisibleItemsAtTime(track: Track, timeSec: number): TrackItemOffset[];
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
export interface RationalTime {
|
|
2
|
+
value: number;
|
|
3
|
+
rate: number;
|
|
4
|
+
}
|
|
5
|
+
export interface TimeRange {
|
|
6
|
+
start_time: RationalTime;
|
|
7
|
+
duration: RationalTime;
|
|
8
|
+
}
|
|
9
|
+
export interface BaseMediaReference {
|
|
10
|
+
name?: string;
|
|
11
|
+
metadata?: Record<string, unknown>;
|
|
12
|
+
}
|
|
13
|
+
export interface ExternalReference extends BaseMediaReference {
|
|
14
|
+
OTIO_SCHEMA: 'ExternalReference.1';
|
|
15
|
+
target_url: string;
|
|
16
|
+
available_range?: TimeRange;
|
|
17
|
+
}
|
|
18
|
+
export interface GeneratorReference extends BaseMediaReference {
|
|
19
|
+
OTIO_SCHEMA: 'GeneratorReference.1';
|
|
20
|
+
generator_kind: string;
|
|
21
|
+
parameters: Record<string, unknown>;
|
|
22
|
+
}
|
|
23
|
+
export interface MissingReference extends BaseMediaReference {
|
|
24
|
+
OTIO_SCHEMA: 'MissingReference.1';
|
|
25
|
+
}
|
|
26
|
+
export type MediaReference = ExternalReference | GeneratorReference | MissingReference;
|
|
27
|
+
export interface BaseItem {
|
|
28
|
+
id: string;
|
|
29
|
+
name: string;
|
|
30
|
+
source_range: TimeRange;
|
|
31
|
+
metadata?: Record<string, unknown>;
|
|
32
|
+
}
|
|
33
|
+
export interface Clip extends BaseItem {
|
|
34
|
+
OTIO_SCHEMA: 'Clip.1';
|
|
35
|
+
media_reference: MediaReference;
|
|
36
|
+
}
|
|
37
|
+
export interface Gap extends BaseItem {
|
|
38
|
+
OTIO_SCHEMA: 'Gap.1';
|
|
39
|
+
}
|
|
40
|
+
export type TimelineItem = Clip | Gap;
|
|
41
|
+
export interface Track {
|
|
42
|
+
OTIO_SCHEMA: 'Track.1';
|
|
43
|
+
id: string;
|
|
44
|
+
name: string;
|
|
45
|
+
kind: 'Video' | 'Audio';
|
|
46
|
+
metadata?: Record<string, unknown>;
|
|
47
|
+
children: TimelineItem[];
|
|
48
|
+
}
|
|
49
|
+
export interface Stack {
|
|
50
|
+
OTIO_SCHEMA: 'Stack.1';
|
|
51
|
+
name?: string;
|
|
52
|
+
children: Track[];
|
|
53
|
+
}
|
|
54
|
+
export interface Timeline {
|
|
55
|
+
OTIO_SCHEMA: 'Timeline.1';
|
|
56
|
+
id: string;
|
|
57
|
+
name: string;
|
|
58
|
+
global_start_time?: RationalTime;
|
|
59
|
+
tracks: Stack;
|
|
60
|
+
metadata?: Record<string, unknown>;
|
|
61
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { TimelineDropEvent, TimelinePlugin } from './types.js';
|
|
2
|
+
export interface ExternalDropItem {
|
|
3
|
+
id?: string;
|
|
4
|
+
type: string;
|
|
5
|
+
name: string;
|
|
6
|
+
durationMs: number;
|
|
7
|
+
resource?: string;
|
|
8
|
+
meta?: Record<string, unknown>;
|
|
9
|
+
}
|
|
10
|
+
export interface ExternalDropPluginOptions {
|
|
11
|
+
resolveItem: (event: TimelineDropEvent) => ExternalDropItem | null | undefined;
|
|
12
|
+
}
|
|
13
|
+
export declare function createExternalDropPlugin(options: ExternalDropPluginOptions): TimelinePlugin;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { type ShortcutsPluginOptions } from './shortcutsPlugin.js';
|
|
2
|
+
import type { TimelinePlugin } from './types.js';
|
|
3
|
+
export * from './types.js';
|
|
4
|
+
export { InteractionManager, matchesKeyChord } from './interactionManager.js';
|
|
5
|
+
export { playheadSnapProvider, clipEdgeSnapProvider, createGridSnapProvider, type GridSnapProviderOptions } from './snapProviders.js';
|
|
6
|
+
export { createPlayheadPlugin } from './playheadPlugin.js';
|
|
7
|
+
export { createClipTrimPlugin } from './clipTrimPlugin.js';
|
|
8
|
+
export { createClipDragPlugin } from './clipDragPlugin.js';
|
|
9
|
+
export { createSelectionPlugin } from './selectionPlugin.js';
|
|
10
|
+
export { createWheelPlugin } from './wheelPlugin.js';
|
|
11
|
+
export { createShortcutsPlugin, DEFAULT_SHORTCUT_KEYMAP, type ShortcutsPluginOptions } from './shortcutsPlugin.js';
|
|
12
|
+
export { createMarqueeSelectPlugin } from './marqueeSelectPlugin.js';
|
|
13
|
+
export { createExternalDropPlugin, type ExternalDropItem, type ExternalDropPluginOptions } from './externalDropPlugin.js';
|
|
14
|
+
export interface DefaultPluginsOptions {
|
|
15
|
+
shortcuts?: boolean | ShortcutsPluginOptions;
|
|
16
|
+
}
|
|
17
|
+
export declare function createDefaultPlugins(options?: DefaultPluginsOptions): TimelinePlugin[];
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import type { SnapProvider } from '../engine/snap.js';
|
|
2
|
+
import type { KeyBinding, PluginContext, TimelineDropEvent, TimelinePlugin, TimelinePointerEvent, TimelineWheelEvent } from './types.js';
|
|
3
|
+
export declare function matchesKeyChord(event: KeyboardEvent, chord: string): boolean;
|
|
4
|
+
export declare class InteractionManager {
|
|
5
|
+
private readonly context;
|
|
6
|
+
private readonly plugins;
|
|
7
|
+
private readonly handlers;
|
|
8
|
+
private readonly snapProviders;
|
|
9
|
+
private readonly keymap;
|
|
10
|
+
private activeSession;
|
|
11
|
+
private shortcutsEnabled;
|
|
12
|
+
constructor(context: Omit<PluginContext, 'getSnapProviders'>);
|
|
13
|
+
getContext(): PluginContext;
|
|
14
|
+
getSnapProviders(): readonly SnapProvider[];
|
|
15
|
+
setShortcutsEnabled(enabled: boolean): void;
|
|
16
|
+
isShortcutsEnabled(): boolean;
|
|
17
|
+
setKeyBinding(chord: string, binding: KeyBinding | null): void;
|
|
18
|
+
use(plugin: TimelinePlugin): () => void;
|
|
19
|
+
remove(name: string): boolean;
|
|
20
|
+
hasPlugin(name: string): boolean;
|
|
21
|
+
hasActiveSession(): boolean;
|
|
22
|
+
handlePointerDown(event: TimelinePointerEvent): boolean;
|
|
23
|
+
handlePointerMove(event: TimelinePointerEvent): boolean;
|
|
24
|
+
handlePointerUp(event: TimelinePointerEvent): boolean;
|
|
25
|
+
cancelActiveSession(): boolean;
|
|
26
|
+
handleWheel(event: TimelineWheelEvent): boolean;
|
|
27
|
+
handleDragOver(event: TimelineDropEvent): boolean;
|
|
28
|
+
handleDragLeave(): void;
|
|
29
|
+
handleDrop(event: TimelineDropEvent): boolean;
|
|
30
|
+
handleKeyDown(event: KeyboardEvent): boolean;
|
|
31
|
+
handleKeyUp(event: KeyboardEvent): boolean;
|
|
32
|
+
destroy(): void;
|
|
33
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { KeyBinding, TimelinePlugin } from './types.js';
|
|
2
|
+
export declare const DEFAULT_SHORTCUT_KEYMAP: Record<string, KeyBinding>;
|
|
3
|
+
export interface ShortcutsPluginOptions {
|
|
4
|
+
enabled?: boolean;
|
|
5
|
+
keymap?: Record<string, KeyBinding | null>;
|
|
6
|
+
}
|
|
7
|
+
export declare function createShortcutsPlugin(options?: ShortcutsPluginOptions): TimelinePlugin;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { SnapProvider } from '../engine/snap.js';
|
|
2
|
+
export declare const playheadSnapProvider: SnapProvider;
|
|
3
|
+
export declare const clipEdgeSnapProvider: SnapProvider;
|
|
4
|
+
export interface GridSnapProviderOptions {
|
|
5
|
+
stepMs?: number;
|
|
6
|
+
enabled?: () => boolean;
|
|
7
|
+
radiusSteps?: number;
|
|
8
|
+
}
|
|
9
|
+
export declare function createGridSnapProvider(options?: GridSnapProviderOptions): SnapProvider;
|