@shotstack/shotstack-studio 2.0.0-beta.36 → 2.0.0-beta.38
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/internal.d.ts +16 -3
- package/dist/internal.es.js +1870 -1810
- package/dist/internal.umd.js +15 -15
- package/dist/shotstack-studio.es.js +5530 -5082
- package/dist/shotstack-studio.umd.js +160 -142
- package/package.json +2 -10
- package/dist/schema/assets/fonts/Arapey-Regular.ttf +0 -0
- package/dist/schema/assets/fonts/ClearSans-Regular.ttf +0 -0
- package/dist/schema/assets/fonts/DidactGothic-Regular.ttf +0 -0
- package/dist/schema/assets/fonts/Montserrat-ExtraBold.ttf +0 -0
- package/dist/schema/assets/fonts/Montserrat-SemiBold.ttf +0 -0
- package/dist/schema/assets/fonts/Montserrat.ttf +0 -0
- package/dist/schema/assets/fonts/MovLette.ttf +0 -0
- package/dist/schema/assets/fonts/OpenSans-Bold.ttf +0 -0
- package/dist/schema/assets/fonts/OpenSans.ttf +0 -0
- package/dist/schema/assets/fonts/PermanentMarker-Regular.ttf +0 -0
- package/dist/schema/assets/fonts/Roboto-BlackItalic.ttf +0 -0
- package/dist/schema/assets/fonts/Roboto.ttf +0 -0
- package/dist/schema/assets/fonts/SueEllenFrancisco.ttf +0 -0
- package/dist/schema/assets/fonts/UniNeue-Bold.otf +0 -0
- package/dist/schema/assets/fonts/WorkSans-Light.ttf +0 -0
- package/dist/schema/assets/fonts/WorkSans.ttf +0 -0
- package/dist/schema/assets/images/typescript.svg +0 -1
- package/dist/schema/hb.wasm +0 -0
- package/dist/schema/index.cjs +0 -1
- package/dist/schema/index.d.ts +0 -691
- package/dist/schema/index.mjs +0 -2181
package/dist/schema/index.d.ts
DELETED
|
@@ -1,691 +0,0 @@
|
|
|
1
|
-
import { components } from '@shotstack/schemas';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Payload passed to button click handlers.
|
|
5
|
-
*/
|
|
6
|
-
declare interface ButtonClickPayload {
|
|
7
|
-
/** Current playback position in seconds */
|
|
8
|
-
position: number;
|
|
9
|
-
/** Currently selected clip, if any */
|
|
10
|
-
selectedClip: {
|
|
11
|
-
trackIndex: number;
|
|
12
|
-
clipIndex: number;
|
|
13
|
-
} | null;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
export declare class Canvas {
|
|
17
|
-
private static extensionsRegistered;
|
|
18
|
-
private viewportSize;
|
|
19
|
-
private readonly edit;
|
|
20
|
-
private viewportContainer?;
|
|
21
|
-
private editBackground?;
|
|
22
|
-
private viewportMask?;
|
|
23
|
-
private container?;
|
|
24
|
-
private background?;
|
|
25
|
-
private timeline?;
|
|
26
|
-
private uiController;
|
|
27
|
-
private alignmentGuides;
|
|
28
|
-
private minZoom;
|
|
29
|
-
private maxZoom;
|
|
30
|
-
private currentZoom;
|
|
31
|
-
private onTickBound;
|
|
32
|
-
private onBackgroundClickBound;
|
|
33
|
-
private onWheelBound;
|
|
34
|
-
private canvasRoot;
|
|
35
|
-
constructor(edit: Edit);
|
|
36
|
-
load(): Promise<void>;
|
|
37
|
-
private setupTouchHandling;
|
|
38
|
-
private onWheel;
|
|
39
|
-
centerEdit(): void;
|
|
40
|
-
zoomToFit(padding?: number): void;
|
|
41
|
-
resize(): void;
|
|
42
|
-
setZoom(zoom: number): void;
|
|
43
|
-
getZoom(): number;
|
|
44
|
-
/**
|
|
45
|
-
* Sync overlay container and toolbar positions after content transforms change.
|
|
46
|
-
* Single point of update for all position-dependent UI elements.
|
|
47
|
-
*/
|
|
48
|
-
private syncContentTransforms;
|
|
49
|
-
/**
|
|
50
|
-
* Subscribe to Edit events for visual synchronization.
|
|
51
|
-
* Canvas reacts to these events to update PIXI visuals.
|
|
52
|
-
*/
|
|
53
|
-
private subscribeToEditEvents;
|
|
54
|
-
private onPlayerAddedToTrack;
|
|
55
|
-
private onPlayerMovedBetweenTracks;
|
|
56
|
-
private onPlayerRemovedFromTrack;
|
|
57
|
-
private onTrackContainerRemoved;
|
|
58
|
-
private onViewportSizeChanged;
|
|
59
|
-
private onViewportNeedsZoomToFit;
|
|
60
|
-
private registerExtensions;
|
|
61
|
-
private configureApplication;
|
|
62
|
-
private onTick;
|
|
63
|
-
private configureStage;
|
|
64
|
-
private onBackgroundClick;
|
|
65
|
-
dispose(): void;
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
declare type Clip = components["schemas"]["Clip"];
|
|
69
|
-
|
|
70
|
-
declare type ClipLocation = {
|
|
71
|
-
trackIndex: number;
|
|
72
|
-
clipIndex: number;
|
|
73
|
-
};
|
|
74
|
-
|
|
75
|
-
/**
|
|
76
|
-
* Reference to a clip from the document (source of truth).
|
|
77
|
-
* Contains original timing values like "auto", "end", and alias references.
|
|
78
|
-
* Used in public SDK events so consumers see the document state.
|
|
79
|
-
*/
|
|
80
|
-
declare type ClipReference = ClipLocation & {
|
|
81
|
-
clip: Clip;
|
|
82
|
-
};
|
|
83
|
-
|
|
84
|
-
export declare class Controls {
|
|
85
|
-
private edit;
|
|
86
|
-
private seekDistance;
|
|
87
|
-
private seekDistanceLarge;
|
|
88
|
-
private frameTime;
|
|
89
|
-
constructor(timeline: Edit);
|
|
90
|
-
load(): Promise<void>;
|
|
91
|
-
private shouldIgnoreKeyboardEvent;
|
|
92
|
-
private handleKeyDown;
|
|
93
|
-
private handleKeyUp;
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
declare type Destination = components["schemas"]["Destinations"];
|
|
97
|
-
|
|
98
|
-
export declare class Edit {
|
|
99
|
-
private static readonly MAX_HISTORY_SIZE;
|
|
100
|
-
private document;
|
|
101
|
-
private backgroundColor;
|
|
102
|
-
private tracks;
|
|
103
|
-
playbackTime: Seconds;
|
|
104
|
-
totalDuration: Seconds;
|
|
105
|
-
isPlaying: boolean;
|
|
106
|
-
private get clips();
|
|
107
|
-
private internalEvents;
|
|
108
|
-
events: ReadonlyEventEmitter<EditEventMap>;
|
|
109
|
-
private canvas;
|
|
110
|
-
private timingManager;
|
|
111
|
-
private lumaMaskController;
|
|
112
|
-
private playerReconciler;
|
|
113
|
-
private outputSettings;
|
|
114
|
-
private selectionManager;
|
|
115
|
-
private commandHistory;
|
|
116
|
-
private commandIndex;
|
|
117
|
-
private commandQueue;
|
|
118
|
-
private clipsToDispose;
|
|
119
|
-
private clipErrors;
|
|
120
|
-
private playerByClipId;
|
|
121
|
-
private lumaContentRelations;
|
|
122
|
-
private fontMetadata;
|
|
123
|
-
private isBatchingEvents;
|
|
124
|
-
private syncCorrectionCount;
|
|
125
|
-
private isExporting;
|
|
126
|
-
private lastResolved;
|
|
127
|
-
/**
|
|
128
|
-
* Create an Edit instance from a template configuration.
|
|
129
|
-
*/
|
|
130
|
-
constructor(template: Edit_2);
|
|
131
|
-
/**
|
|
132
|
-
* Load the edit session.
|
|
133
|
-
*/
|
|
134
|
-
load(): Promise<void>;
|
|
135
|
-
/**
|
|
136
|
-
* Initialize runtime from the document.
|
|
137
|
-
*/
|
|
138
|
-
private initializeFromDocument;
|
|
139
|
-
play(): void;
|
|
140
|
-
pause(): void;
|
|
141
|
-
seek(target: Seconds): void;
|
|
142
|
-
stop(): void;
|
|
143
|
-
/**
|
|
144
|
-
* Reload the edit with a new configuration (hot-reload).
|
|
145
|
-
*/
|
|
146
|
-
loadEdit(edit: Edit_2): Promise<void>;
|
|
147
|
-
private loadSoundtrack;
|
|
148
|
-
getEdit(): Edit_2;
|
|
149
|
-
addClip(trackIdx: number, clip: Clip): void | Promise<void>;
|
|
150
|
-
getClip(trackIdx: number, clipIdx: number): Clip | null;
|
|
151
|
-
/**
|
|
152
|
-
* Clear the error for a deleted clip and shift indices for remaining errors.
|
|
153
|
-
*/
|
|
154
|
-
private clearClipErrorAndShift;
|
|
155
|
-
deleteClip(trackIdx: number, clipIdx: number): Promise<void>;
|
|
156
|
-
splitClip(trackIndex: number, clipIndex: number, splitTime: number): Promise<void>;
|
|
157
|
-
addTrack(trackIdx: number, track: Track): Promise<void>;
|
|
158
|
-
getTrack(trackIdx: number): Track | null;
|
|
159
|
-
deleteTrack(trackIdx: number): void;
|
|
160
|
-
undo(): Promise<void>;
|
|
161
|
-
redo(): Promise<void>;
|
|
162
|
-
/**
|
|
163
|
-
* Add a command to history without executing it.
|
|
164
|
-
*/
|
|
165
|
-
private addCommandToHistory;
|
|
166
|
-
updateClip(trackIdx: number, clipIdx: number, updates: Partial<Clip>): Promise<void>;
|
|
167
|
-
/**
|
|
168
|
-
* Handle command result - only add to history if successful.
|
|
169
|
-
*/
|
|
170
|
-
private handleCommandResult;
|
|
171
|
-
/**
|
|
172
|
-
* Detects merge field placeholders in the raw edit before substitution.
|
|
173
|
-
*/
|
|
174
|
-
private detectMergeFieldBindings;
|
|
175
|
-
/**
|
|
176
|
-
* Recursively walks an object to find merge field placeholders.
|
|
177
|
-
*/
|
|
178
|
-
private detectBindingsInObject;
|
|
179
|
-
/**
|
|
180
|
-
* Checks if edit has structural changes requiring full reload.
|
|
181
|
-
*
|
|
182
|
-
* TODO: Expand granular path to handle more cases:
|
|
183
|
-
* - Clip add/remove: Use existing addClip()/deleteClip() commands
|
|
184
|
-
* - Soundtrack changes: Add/remove AudioPlayer via commands
|
|
185
|
-
* - Font changes: Load new fonts incrementally
|
|
186
|
-
* - Merge field changes: Re-resolve affected clips
|
|
187
|
-
*/
|
|
188
|
-
private hasStructuralChanges;
|
|
189
|
-
/**
|
|
190
|
-
* Transfers existing clip IDs from the current document to the new edit configuration.
|
|
191
|
-
*/
|
|
192
|
-
private preserveClipIdsForGranularUpdate;
|
|
193
|
-
/**
|
|
194
|
-
* Applies granular changes without full reload.
|
|
195
|
-
* @param newEdit - The new edit configuration
|
|
196
|
-
* @param oldTracks - The old tracks (captured before document update)
|
|
197
|
-
* @param oldOutput - The old output settings (captured before document update)
|
|
198
|
-
*/
|
|
199
|
-
private applyGranularChanges;
|
|
200
|
-
private queueDisposeClip;
|
|
201
|
-
/**
|
|
202
|
-
* Remove fonts from timeline.fonts that are no longer referenced by any clip.
|
|
203
|
-
*/
|
|
204
|
-
private cleanupUnusedFonts;
|
|
205
|
-
/**
|
|
206
|
-
* Extract the filename (without extension) from a font URL.
|
|
207
|
-
*/
|
|
208
|
-
private extractFilenameFromUrl;
|
|
209
|
-
private disposeClip;
|
|
210
|
-
private unloadClipAssets;
|
|
211
|
-
private movePlayerToTrackContainer;
|
|
212
|
-
private addPlayer;
|
|
213
|
-
setOutputSize(width: number, height: number): Promise<void>;
|
|
214
|
-
setOutputFps(fps: number): Promise<void>;
|
|
215
|
-
getOutputFps(): number;
|
|
216
|
-
setOutputFormat(format: string): Promise<void>;
|
|
217
|
-
getOutputFormat(): string;
|
|
218
|
-
setOutputDestinations(destinations: Destination[]): Promise<void>;
|
|
219
|
-
getOutputDestinations(): Destination[];
|
|
220
|
-
setOutputResolution(resolution: string): Promise<void>;
|
|
221
|
-
getOutputResolution(): string | undefined;
|
|
222
|
-
setOutputAspectRatio(aspectRatio: string): Promise<void>;
|
|
223
|
-
getOutputAspectRatio(): string | undefined;
|
|
224
|
-
setTimelineBackground(color: string): Promise<void>;
|
|
225
|
-
private setTimelineBackgroundInternal;
|
|
226
|
-
getTimelineBackground(): string;
|
|
227
|
-
/**
|
|
228
|
-
* Find the content clip that best matches a luma (by temporal overlap).
|
|
229
|
-
*/
|
|
230
|
-
private findBestContentMatch;
|
|
231
|
-
private setupIntentListeners;
|
|
232
|
-
}
|
|
233
|
-
|
|
234
|
-
declare type Edit_2 = components["schemas"]["Edit"];
|
|
235
|
-
|
|
236
|
-
/** Configuration for defining an edit - the structure passed to EditSession */
|
|
237
|
-
export declare type EditConfig = Edit_2;
|
|
238
|
-
|
|
239
|
-
declare const EditEvent: {
|
|
240
|
-
readonly PlaybackPlay: "playback:play";
|
|
241
|
-
readonly PlaybackPause: "playback:pause";
|
|
242
|
-
readonly TimelineUpdated: "timeline:updated";
|
|
243
|
-
readonly TimelineBackgroundChanged: "timeline:backgroundChanged";
|
|
244
|
-
readonly ClipAdded: "clip:added";
|
|
245
|
-
readonly ClipSplit: "clip:split";
|
|
246
|
-
readonly ClipSelected: "clip:selected";
|
|
247
|
-
readonly ClipUpdated: "clip:updated";
|
|
248
|
-
readonly ClipDeleted: "clip:deleted";
|
|
249
|
-
readonly ClipRestored: "clip:restored";
|
|
250
|
-
readonly ClipCopied: "clip:copied";
|
|
251
|
-
readonly ClipLoadFailed: "clip:loadFailed";
|
|
252
|
-
readonly ClipUnresolved: "clip:unresolved";
|
|
253
|
-
readonly SelectionCleared: "selection:cleared";
|
|
254
|
-
readonly EditChanged: "edit:changed";
|
|
255
|
-
readonly EditUndo: "edit:undo";
|
|
256
|
-
readonly EditRedo: "edit:redo";
|
|
257
|
-
readonly TrackAdded: "track:added";
|
|
258
|
-
readonly TrackRemoved: "track:removed";
|
|
259
|
-
readonly DurationChanged: "duration:changed";
|
|
260
|
-
readonly OutputResized: "output:resized";
|
|
261
|
-
readonly OutputResolutionChanged: "output:resolutionChanged";
|
|
262
|
-
readonly OutputAspectRatioChanged: "output:aspectRatioChanged";
|
|
263
|
-
readonly OutputFpsChanged: "output:fpsChanged";
|
|
264
|
-
readonly OutputFormatChanged: "output:formatChanged";
|
|
265
|
-
readonly OutputDestinationsChanged: "output:destinationsChanged";
|
|
266
|
-
readonly MergeFieldChanged: "mergefield:changed";
|
|
267
|
-
readonly TranscriptionProgress: "transcription:progress";
|
|
268
|
-
readonly TranscriptionCompleted: "transcription:completed";
|
|
269
|
-
readonly TranscriptionFailed: "transcription:failed";
|
|
270
|
-
readonly LumaAttached: "luma:attached";
|
|
271
|
-
readonly LumaDetached: "luma:detached";
|
|
272
|
-
};
|
|
273
|
-
|
|
274
|
-
declare type EditEventMap = {
|
|
275
|
-
[EditEvent.PlaybackPlay]: void;
|
|
276
|
-
[EditEvent.PlaybackPause]: void;
|
|
277
|
-
/** Contains the document (source of truth) with original timing values like "auto", "end" */
|
|
278
|
-
[EditEvent.TimelineUpdated]: {
|
|
279
|
-
current: Edit_2;
|
|
280
|
-
};
|
|
281
|
-
[EditEvent.TimelineBackgroundChanged]: {
|
|
282
|
-
color: string;
|
|
283
|
-
};
|
|
284
|
-
[EditEvent.ClipAdded]: ClipLocation;
|
|
285
|
-
[EditEvent.ClipSplit]: {
|
|
286
|
-
trackIndex: number;
|
|
287
|
-
originalClipIndex: number;
|
|
288
|
-
newClipIndex: number;
|
|
289
|
-
};
|
|
290
|
-
[EditEvent.ClipSelected]: ClipReference;
|
|
291
|
-
[EditEvent.ClipUpdated]: {
|
|
292
|
-
previous: ClipReference;
|
|
293
|
-
current: ClipReference;
|
|
294
|
-
};
|
|
295
|
-
[EditEvent.ClipDeleted]: ClipLocation;
|
|
296
|
-
[EditEvent.ClipRestored]: ClipLocation;
|
|
297
|
-
[EditEvent.ClipCopied]: ClipLocation;
|
|
298
|
-
[EditEvent.ClipLoadFailed]: ClipLocation & {
|
|
299
|
-
error: string;
|
|
300
|
-
assetType: string;
|
|
301
|
-
};
|
|
302
|
-
[EditEvent.ClipUnresolved]: ClipLocation & {
|
|
303
|
-
assetType: string;
|
|
304
|
-
clipId: string;
|
|
305
|
-
};
|
|
306
|
-
[EditEvent.SelectionCleared]: void;
|
|
307
|
-
[EditEvent.EditChanged]: {
|
|
308
|
-
source: string;
|
|
309
|
-
timestamp: number;
|
|
310
|
-
};
|
|
311
|
-
[EditEvent.EditUndo]: {
|
|
312
|
-
command: string;
|
|
313
|
-
};
|
|
314
|
-
[EditEvent.EditRedo]: {
|
|
315
|
-
command: string;
|
|
316
|
-
};
|
|
317
|
-
[EditEvent.TrackAdded]: {
|
|
318
|
-
trackIndex: number;
|
|
319
|
-
totalTracks: number;
|
|
320
|
-
};
|
|
321
|
-
[EditEvent.TrackRemoved]: {
|
|
322
|
-
trackIndex: number;
|
|
323
|
-
};
|
|
324
|
-
[EditEvent.DurationChanged]: {
|
|
325
|
-
duration: number;
|
|
326
|
-
};
|
|
327
|
-
[EditEvent.OutputResized]: {
|
|
328
|
-
width: number;
|
|
329
|
-
height: number;
|
|
330
|
-
};
|
|
331
|
-
[EditEvent.OutputResolutionChanged]: {
|
|
332
|
-
resolution: Output["resolution"];
|
|
333
|
-
};
|
|
334
|
-
[EditEvent.OutputAspectRatioChanged]: {
|
|
335
|
-
aspectRatio: Output["aspectRatio"];
|
|
336
|
-
};
|
|
337
|
-
[EditEvent.OutputFpsChanged]: {
|
|
338
|
-
fps: number;
|
|
339
|
-
};
|
|
340
|
-
[EditEvent.OutputFormatChanged]: {
|
|
341
|
-
format: Output["format"];
|
|
342
|
-
};
|
|
343
|
-
[EditEvent.OutputDestinationsChanged]: {
|
|
344
|
-
destinations: Destination[];
|
|
345
|
-
};
|
|
346
|
-
[EditEvent.MergeFieldChanged]: {
|
|
347
|
-
fields: MergeField[];
|
|
348
|
-
};
|
|
349
|
-
[EditEvent.TranscriptionProgress]: {
|
|
350
|
-
clipAlias: string;
|
|
351
|
-
message?: string;
|
|
352
|
-
};
|
|
353
|
-
[EditEvent.TranscriptionCompleted]: {
|
|
354
|
-
clipAlias: string;
|
|
355
|
-
cueCount: number;
|
|
356
|
-
};
|
|
357
|
-
[EditEvent.TranscriptionFailed]: {
|
|
358
|
-
clipAlias: string;
|
|
359
|
-
error: string;
|
|
360
|
-
};
|
|
361
|
-
[EditEvent.LumaAttached]: ClipLocation & {
|
|
362
|
-
lumaSrc: string;
|
|
363
|
-
lumaClipIndex: number;
|
|
364
|
-
};
|
|
365
|
-
[EditEvent.LumaDetached]: ClipLocation;
|
|
366
|
-
};
|
|
367
|
-
|
|
368
|
-
declare type EventPayloadMap<TPayload = any> = Record<string, TPayload>;
|
|
369
|
-
|
|
370
|
-
declare type Listener<TPayload = any> = (payload: TPayload) => void;
|
|
371
|
-
|
|
372
|
-
/**
|
|
373
|
-
* Merge field types for the Shotstack Studio SDK.
|
|
374
|
-
*
|
|
375
|
-
* Merge fields allow dynamic content substitution using {{ FIELD_NAME }} syntax.
|
|
376
|
-
* Values are replaced at render time, enabling template-based video generation.
|
|
377
|
-
*/
|
|
378
|
-
/**
|
|
379
|
-
* A merge field definition used throughout the SDK.
|
|
380
|
-
*/
|
|
381
|
-
declare interface MergeField {
|
|
382
|
-
/** Field identifier (uppercase convention: MY_FIELD) */
|
|
383
|
-
name: string;
|
|
384
|
-
/** Default value used for preview when no runtime value is provided */
|
|
385
|
-
defaultValue: string;
|
|
386
|
-
/** Optional description for UI display */
|
|
387
|
-
description?: string;
|
|
388
|
-
}
|
|
389
|
-
|
|
390
|
-
declare type Output = components["schemas"]["Output"];
|
|
391
|
-
|
|
392
|
-
/**
|
|
393
|
-
* Read-only view of an EventEmitter that only exposes subscription methods.
|
|
394
|
-
* Used as the public `events` type on Edit to prevent consumers from emitting events.
|
|
395
|
-
*/
|
|
396
|
-
declare interface ReadonlyEventEmitter<TEventPayloadMap extends EventPayloadMap> {
|
|
397
|
-
on<K extends keyof TEventPayloadMap>(name: K, listener: Listener<TEventPayloadMap[K]>): () => void;
|
|
398
|
-
once<K extends keyof TEventPayloadMap>(name: K, listener: Listener<TEventPayloadMap[K]>): () => void;
|
|
399
|
-
off<K extends keyof TEventPayloadMap>(name: K, listener: Listener<TEventPayloadMap[K]>): void;
|
|
400
|
-
}
|
|
401
|
-
|
|
402
|
-
/**
|
|
403
|
-
* A number representing time in seconds.
|
|
404
|
-
* Used at API/configuration boundaries where users specify timing.
|
|
405
|
-
*/
|
|
406
|
-
declare type Seconds = number & {
|
|
407
|
-
readonly [SecondsSymbol]: typeof SecondsSymbol;
|
|
408
|
-
};
|
|
409
|
-
|
|
410
|
-
declare const SecondsSymbol: unique symbol;
|
|
411
|
-
|
|
412
|
-
export declare class Timeline {
|
|
413
|
-
private readonly edit;
|
|
414
|
-
readonly element: HTMLElement;
|
|
415
|
-
private readonly container;
|
|
416
|
-
private readonly stateManager;
|
|
417
|
-
private clipRenderers;
|
|
418
|
-
private thumbnailGenerator;
|
|
419
|
-
private mediaThumbnailRenderer;
|
|
420
|
-
private toolbar;
|
|
421
|
-
private rulerTracksWrapper;
|
|
422
|
-
private ruler;
|
|
423
|
-
private trackList;
|
|
424
|
-
private playhead;
|
|
425
|
-
private playheadGhost;
|
|
426
|
-
private feedbackLayer;
|
|
427
|
-
private interactionController;
|
|
428
|
-
private animationFrameId;
|
|
429
|
-
private isRenderLoopActive;
|
|
430
|
-
private lastFrameTime;
|
|
431
|
-
private isInteracting;
|
|
432
|
-
private isLoaded;
|
|
433
|
-
private thumbnailRenderPending;
|
|
434
|
-
private readonly handleTimelineUpdated;
|
|
435
|
-
private readonly handlePlaybackPlay;
|
|
436
|
-
private readonly handlePlaybackPause;
|
|
437
|
-
private readonly handleClipSelected;
|
|
438
|
-
private readonly handleClipLoadFailed;
|
|
439
|
-
private readonly handleClipUpdated;
|
|
440
|
-
private readonly handleRulerMouseMove;
|
|
441
|
-
constructor(edit: Edit, container: HTMLElement);
|
|
442
|
-
/** Initialize and mount the timeline */
|
|
443
|
-
load(): Promise<void>;
|
|
444
|
-
/** Clean up and unmount the timeline */
|
|
445
|
-
dispose(): void;
|
|
446
|
-
/**
|
|
447
|
-
* Pre-compute AI asset numbers for all clips.
|
|
448
|
-
*/
|
|
449
|
-
private computeAiAssetNumbers;
|
|
450
|
-
private setupEventListeners;
|
|
451
|
-
private removeEventListeners;
|
|
452
|
-
/** Start continuous render loop (during playback or interaction) */
|
|
453
|
-
private startRenderLoop;
|
|
454
|
-
/** Stop continuous render loop */
|
|
455
|
-
private stopRenderLoop;
|
|
456
|
-
/** Animation frame callback */
|
|
457
|
-
private tick;
|
|
458
|
-
/** Request a single render (used when idle and data changes) */
|
|
459
|
-
private requestRender;
|
|
460
|
-
private buildComponents;
|
|
461
|
-
private disposeComponents;
|
|
462
|
-
zoomIn(): void;
|
|
463
|
-
zoomOut(): void;
|
|
464
|
-
}
|
|
465
|
-
|
|
466
|
-
/**
|
|
467
|
-
* Configuration for a toolbar button.
|
|
468
|
-
*/
|
|
469
|
-
export declare interface ToolbarButtonConfig {
|
|
470
|
-
/** Unique identifier for the button (used in event names) */
|
|
471
|
-
id: string;
|
|
472
|
-
/** SVG icon markup */
|
|
473
|
-
icon: string;
|
|
474
|
-
/** Tooltip text shown on hover */
|
|
475
|
-
tooltip: string;
|
|
476
|
-
/** Whether to show a divider before this button */
|
|
477
|
-
dividerBefore?: boolean;
|
|
478
|
-
}
|
|
479
|
-
|
|
480
|
-
declare type Track = components["schemas"]["Track"];
|
|
481
|
-
|
|
482
|
-
/**
|
|
483
|
-
* Controller for managing UI elements (toolbars, utilities) separately from Canvas.
|
|
484
|
-
*
|
|
485
|
-
* This enables:
|
|
486
|
-
* - Pure preview mode (Canvas without UI)
|
|
487
|
-
* - Optional UI element loading
|
|
488
|
-
*
|
|
489
|
-
* @example
|
|
490
|
-
* ```typescript
|
|
491
|
-
* const ui = UIController.create(edit, canvas, { mergeFields: true });
|
|
492
|
-
* ui.registerButton({ id: "text", icon: "...", tooltip: "Add Text" });
|
|
493
|
-
* ```
|
|
494
|
-
*/
|
|
495
|
-
export declare class UIController {
|
|
496
|
-
private toolbars;
|
|
497
|
-
private utilities;
|
|
498
|
-
private canvasOverlays;
|
|
499
|
-
private container;
|
|
500
|
-
private canvas;
|
|
501
|
-
private isDisposed;
|
|
502
|
-
/** Whether merge fields UI is enabled (Variables panel, autocomplete) */
|
|
503
|
-
readonly mergeFieldsEnabled: boolean;
|
|
504
|
-
/** Whether selection handles are enabled for drag/resize/rotate */
|
|
505
|
-
private readonly selectionHandlesEnabled;
|
|
506
|
-
/** Maximum total pixels for resolution picker (undefined = unlimited) */
|
|
507
|
-
private readonly maxPixels?;
|
|
508
|
-
private clipToolbar;
|
|
509
|
-
private toolbarMode;
|
|
510
|
-
private currentAssetType;
|
|
511
|
-
private currentTrackIndex;
|
|
512
|
-
private currentClipIndex;
|
|
513
|
-
private onKeyDownBound;
|
|
514
|
-
private modeButtonHandlers;
|
|
515
|
-
private buttonRegistry;
|
|
516
|
-
private buttonEvents;
|
|
517
|
-
private assetToolbar;
|
|
518
|
-
private canvasToolbar;
|
|
519
|
-
private lastAutoAssetX;
|
|
520
|
-
private lastAutoAssetY;
|
|
521
|
-
private lastAutoCanvasX;
|
|
522
|
-
private lastAutoCanvasY;
|
|
523
|
-
/**
|
|
524
|
-
* Create a UIController with all standard toolbars pre-registered.
|
|
525
|
-
* This is the recommended way to create a UIController for most use cases.
|
|
526
|
-
*
|
|
527
|
-
* @param edit - The Edit instance
|
|
528
|
-
* @param canvas - The Canvas instance
|
|
529
|
-
* @param options - Configuration options
|
|
530
|
-
* @returns A fully configured UIController
|
|
531
|
-
*
|
|
532
|
-
* @example
|
|
533
|
-
* ```typescript
|
|
534
|
-
* const ui = UIController.create(edit, canvas, { mergeFields: true });
|
|
535
|
-
* ui.registerButton({ id: "text", icon: "...", tooltip: "Add Text" });
|
|
536
|
-
* ui.on("button:text", ({ position }) => { ... });
|
|
537
|
-
* ```
|
|
538
|
-
*/
|
|
539
|
-
static create(edit: Edit, canvas: Canvas, options?: UIControllerOptions): UIController;
|
|
540
|
-
/**
|
|
541
|
-
* Create a minimal UIController without pre-registered toolbars.
|
|
542
|
-
* Use this when you only need custom buttons without default toolbars.
|
|
543
|
-
*
|
|
544
|
-
* @param edit - The Edit instance
|
|
545
|
-
* @param canvas - Optional Canvas instance
|
|
546
|
-
* @returns A minimal UIController ready for custom configuration
|
|
547
|
-
*
|
|
548
|
-
* @example
|
|
549
|
-
* ```typescript
|
|
550
|
-
* const ui = UIController.minimal(edit, canvas);
|
|
551
|
-
* ui.registerButton({ id: "text", icon: "...", tooltip: "Add Text" });
|
|
552
|
-
* ```
|
|
553
|
-
*/
|
|
554
|
-
static minimal(edit: Edit, canvas?: Canvas): UIController;
|
|
555
|
-
/**
|
|
556
|
-
* Private constructor - use UIController.create() or UIController.minimal() instead.
|
|
557
|
-
*/
|
|
558
|
-
private constructor();
|
|
559
|
-
private readonly edit;
|
|
560
|
-
/**
|
|
561
|
-
* Subscribe to edit events. Called by factory methods.
|
|
562
|
-
*/
|
|
563
|
-
private subscribeToEvents;
|
|
564
|
-
/**
|
|
565
|
-
* Register all standard toolbars. Called by create() factory.
|
|
566
|
-
*/
|
|
567
|
-
private registerStandardToolbars;
|
|
568
|
-
/**
|
|
569
|
-
* Mount all registered UI components to a container.
|
|
570
|
-
* Should be called after all registrations are complete.
|
|
571
|
-
*
|
|
572
|
-
* @param container - The DOM element to mount UI components into
|
|
573
|
-
*/
|
|
574
|
-
mount(container: HTMLElement): void;
|
|
575
|
-
/**
|
|
576
|
-
* Position a sidebar toolbar at autoX/autoY, applying the user's drag offset if present.
|
|
577
|
-
*/
|
|
578
|
-
private applySidebarPosition;
|
|
579
|
-
/**
|
|
580
|
-
* Dispose all registered UI components and clean up event listeners.
|
|
581
|
-
*/
|
|
582
|
-
dispose(): void;
|
|
583
|
-
/**
|
|
584
|
-
* Register a toolbar button.
|
|
585
|
-
* Buttons appear in the left toolbar and trigger events when clicked.
|
|
586
|
-
*
|
|
587
|
-
* @example
|
|
588
|
-
* ```typescript
|
|
589
|
-
* ui.registerButton({
|
|
590
|
-
* id: "text",
|
|
591
|
-
* icon: `<svg>...</svg>`,
|
|
592
|
-
* tooltip: "Add Text"
|
|
593
|
-
* });
|
|
594
|
-
*
|
|
595
|
-
* ui.on("button:text", ({ position }) => {
|
|
596
|
-
* edit.addTrack(0, { clips: [{ ... }] });
|
|
597
|
-
* });
|
|
598
|
-
* ```
|
|
599
|
-
*
|
|
600
|
-
* @param config - Button configuration
|
|
601
|
-
* @returns this (for chaining)
|
|
602
|
-
*/
|
|
603
|
-
registerButton(config: ToolbarButtonConfig): this;
|
|
604
|
-
/**
|
|
605
|
-
* Unregister a toolbar button.
|
|
606
|
-
*
|
|
607
|
-
* @param id - Button ID to remove
|
|
608
|
-
* @returns this (for chaining)
|
|
609
|
-
*/
|
|
610
|
-
unregisterButton(id: string): this;
|
|
611
|
-
/**
|
|
612
|
-
* Subscribe to a button click event.
|
|
613
|
-
*
|
|
614
|
-
* @example
|
|
615
|
-
* ```typescript
|
|
616
|
-
* ui.on("button:text", ({ position, selectedClip }) => {
|
|
617
|
-
* console.log("Text button clicked at position:", position);
|
|
618
|
-
* });
|
|
619
|
-
* ```
|
|
620
|
-
*
|
|
621
|
-
* @param event - Event name in format `button:${buttonId}`
|
|
622
|
-
* @param handler - Callback function
|
|
623
|
-
* @returns Unsubscribe function
|
|
624
|
-
*/
|
|
625
|
-
on<K extends `button:${string}`>(event: K, handler: (payload: ButtonClickPayload) => void): () => void;
|
|
626
|
-
/**
|
|
627
|
-
* Set the toolbar mode and update visibility accordingly.
|
|
628
|
-
* @param mode - "asset" shows asset-specific toolbar, "clip" shows ClipToolbar
|
|
629
|
-
*/
|
|
630
|
-
private setToolbarMode;
|
|
631
|
-
/**
|
|
632
|
-
* Hide all registered toolbars.
|
|
633
|
-
*/
|
|
634
|
-
private hideAllToolbars;
|
|
635
|
-
/**
|
|
636
|
-
* Update toolbar visibility based on current mode and selection.
|
|
637
|
-
*/
|
|
638
|
-
private updateToolbarVisibility;
|
|
639
|
-
/**
|
|
640
|
-
* Check if any toolbar is currently visible (clip is selected).
|
|
641
|
-
*/
|
|
642
|
-
private hasVisibleToolbar;
|
|
643
|
-
/**
|
|
644
|
-
* Check if an input element is focused (to avoid intercepting typing).
|
|
645
|
-
*/
|
|
646
|
-
private isInputFocused;
|
|
647
|
-
/**
|
|
648
|
-
* Handle backtick (`) key to toggle between asset and clip mode.
|
|
649
|
-
* Backtick is the video editor convention for mode/view toggling (Premiere, After Effects).
|
|
650
|
-
*/
|
|
651
|
-
private onKeyDown;
|
|
652
|
-
private onClipSelected;
|
|
653
|
-
private onSelectionCleared;
|
|
654
|
-
}
|
|
655
|
-
|
|
656
|
-
/**
|
|
657
|
-
* Options for UIController configuration.
|
|
658
|
-
*/
|
|
659
|
-
export declare interface UIControllerOptions {
|
|
660
|
-
/** Enable selection handles for drag/resize/rotate interactions. Default: true */
|
|
661
|
-
selectionHandles?: boolean;
|
|
662
|
-
/** Enable merge fields UI (Variables panel, autocomplete). Default: false (vanilla video editor) */
|
|
663
|
-
mergeFields?: boolean;
|
|
664
|
-
/** Maximum total pixels allowed for resolution picker input. Omit for unlimited. */
|
|
665
|
-
maxPixels?: number;
|
|
666
|
-
}
|
|
667
|
-
|
|
668
|
-
export declare const VERSION: string;
|
|
669
|
-
|
|
670
|
-
export declare class VideoExporter {
|
|
671
|
-
private readonly edit;
|
|
672
|
-
private readonly canvas;
|
|
673
|
-
private readonly app;
|
|
674
|
-
private isExporting;
|
|
675
|
-
private videoProcessor;
|
|
676
|
-
private audioProcessor;
|
|
677
|
-
private progressUI;
|
|
678
|
-
private exportCommand;
|
|
679
|
-
constructor(edit: Edit, canvas: Canvas);
|
|
680
|
-
export(filename?: string, fps?: number): Promise<void>;
|
|
681
|
-
private processFrames;
|
|
682
|
-
private handleKeyDown;
|
|
683
|
-
dispose(): void;
|
|
684
|
-
private prepareConfig;
|
|
685
|
-
private saveEditState;
|
|
686
|
-
private restoreEditState;
|
|
687
|
-
private isVideoPlayer;
|
|
688
|
-
private waitForPendingTranscriptions;
|
|
689
|
-
}
|
|
690
|
-
|
|
691
|
-
export { }
|