@linker-design-plus/timeline-track 2.0.10 → 2.0.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +22 -1
- package/dist/assets/AlibabaPuHuiTi-3-55-Regular.woff2 +0 -0
- package/dist/components/panel/ClipConfigPanel.d.ts +76 -38
- package/dist/components/panel/ClipConfigPanelRenderer.d.ts +104 -0
- package/dist/components/panel/TrackInfoPanel.d.ts +3 -3
- package/dist/components/panel/TrackInfoPanelRenderer.d.ts +33 -0
- package/dist/components/track/Track.d.ts +4 -0
- package/dist/core/commands/timelineCommands.d.ts +1 -0
- package/dist/core/controllers/index.d.ts +1 -0
- package/dist/core/controllers/previewBackend.d.ts +4 -1
- package/dist/core/controllers/previewPendingOverlayRenderer.d.ts +17 -0
- package/dist/core/controllers/timelineClipConfigController.d.ts +5 -1
- package/dist/core/controllers/timelineClipEventController.d.ts +1 -0
- package/dist/core/controllers/timelineKeyboardShortcutsController.d.ts +29 -0
- package/dist/core/controllers/timelinePreviewSession.d.ts +36 -4
- package/dist/core/controllers/timelineSelectionController.d.ts +7 -1
- package/dist/core/controllers/timelineTrackMutationController.d.ts +2 -2
- package/dist/core/facade/timelineManager.d.ts +38 -6
- package/dist/core/layout/TimelineManagerLayoutRenderer.d.ts +25 -0
- package/dist/core/layout/timelineManagerDom.d.ts +2 -11
- package/dist/core/models/constants.d.ts +1 -0
- package/dist/core/models/types.d.ts +90 -10
- package/dist/core/renderers/domRenderer.d.ts +17 -0
- package/dist/core/resources/sourceMediaRegistry.d.ts +24 -0
- package/dist/core/testing/konva-test-stub.d.ts +2 -0
- package/dist/core/theme/colorTokens.d.ts +147 -0
- package/dist/index.cjs.js +521 -74
- package/dist/index.es.js +7543 -4865
- package/dist/utils/rendering/KonvaUtils.d.ts +2 -2
- package/dist/utils/rendering/clipCoverRenderer.d.ts +1 -0
- package/dist/utils/rendering/clipVisualRenderer.d.ts +2 -2
- package/dist/utils/svgIcon.d.ts +1 -0
- package/dist/utils/time/timeUtils.d.ts +8 -1
- package/package.json +3 -2
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type TimelinePreviewBackend } from '../controllers';
|
|
2
|
-
import { TimelineConfig, Clip, ClipConfig, TimeMs, PlayState, Action, TimelineEvent, EventListener as TimelineEventListener, TimelineExportData, Track as TrackEntity, ThumbnailProvider, TrackInsertionPlacement, TrackType, ActiveClipPlaybackInfo, PreviewAspectRatio, PreviewMountConfig, PreviewBackendType } from '../models';
|
|
2
|
+
import { TimelineConfig, Clip, ClipConfig, TimeMs, PlayState, Action, TimelineEvent, EventListener as TimelineEventListener, TimelineExportData, Track as TrackEntity, ThumbnailProvider, TrackInsertionPlacement, TrackType, ActiveClipPlaybackInfo, PreviewAspectRatio, PreviewMountConfig, PreviewBackendType, SelectedClipAudioAction, ClipConfigVoicePanelOptions } from '../models';
|
|
3
3
|
import type { ResolvedPlaybackPlan } from '../controllers/timelinePlaybackResolver';
|
|
4
4
|
import { TimelineClipConfigController } from '../controllers/timelineClipConfigController';
|
|
5
5
|
export declare class TimelineManager {
|
|
@@ -38,8 +38,11 @@ export declare class TimelineManager {
|
|
|
38
38
|
private verticalScrollbar;
|
|
39
39
|
private isExecutingHistoryAction;
|
|
40
40
|
private lastTrackDuration;
|
|
41
|
-
private
|
|
41
|
+
private lastReportedTrackDuration;
|
|
42
42
|
private thumbnailProvider;
|
|
43
|
+
private thumbnailProviderVersion;
|
|
44
|
+
private clipThumbnailLoadStates;
|
|
45
|
+
private sourceMediaRegistry;
|
|
43
46
|
private canPlay;
|
|
44
47
|
private sourceLoadingCount;
|
|
45
48
|
private timelineStore?;
|
|
@@ -59,11 +62,13 @@ export declare class TimelineManager {
|
|
|
59
62
|
private readonly bodyViewportScrollListener;
|
|
60
63
|
private readonly bodyCanvasHostClickListener;
|
|
61
64
|
private readonly rootWheelListener;
|
|
65
|
+
private keyboardShortcutsController;
|
|
62
66
|
private mountManager;
|
|
63
67
|
private pendingDraftData;
|
|
64
68
|
private selectionStore;
|
|
65
69
|
private multiDragSession;
|
|
66
70
|
private clipRemovalBatchDepth;
|
|
71
|
+
private splitOperationDepth;
|
|
67
72
|
constructor(config?: Partial<TimelineConfig>);
|
|
68
73
|
private getTimelineStore;
|
|
69
74
|
private getTimelineCommands;
|
|
@@ -169,6 +174,7 @@ export declare class TimelineManager {
|
|
|
169
174
|
private renderBodyBackground;
|
|
170
175
|
private handleBodyBackgroundClick;
|
|
171
176
|
private handleBodyCanvasHostClick;
|
|
177
|
+
private getSnapGuideAccentColor;
|
|
172
178
|
private ensureSnapGuideLine;
|
|
173
179
|
private refreshSnapGuideLine;
|
|
174
180
|
private updateSnapGuideLine;
|
|
@@ -261,6 +267,9 @@ export declare class TimelineManager {
|
|
|
261
267
|
* 批量添加片段。批量模式下仅维护一段连续的视频源加载状态。
|
|
262
268
|
*/
|
|
263
269
|
addClips(clipConfigs: ClipConfig[]): Promise<string[]>;
|
|
270
|
+
private resolveBatchClipConfig;
|
|
271
|
+
private resolveBatchAppendTrackId;
|
|
272
|
+
private getTrackTimelineExtentById;
|
|
264
273
|
private addClipInternal;
|
|
265
274
|
removeClip(clipId: string): void;
|
|
266
275
|
removeClipsByExternalId(externalId: string): boolean;
|
|
@@ -269,6 +278,7 @@ export declare class TimelineManager {
|
|
|
269
278
|
splitCurrentClip(): void;
|
|
270
279
|
getClips(): Clip[];
|
|
271
280
|
private getExportComposition;
|
|
281
|
+
private getExportCoverUrl;
|
|
272
282
|
exportTimeline(): TimelineExportData;
|
|
273
283
|
importTimeline(data: TimelineExportData): Promise<void>;
|
|
274
284
|
private resolveImportedTrackRoles;
|
|
@@ -304,6 +314,24 @@ export declare class TimelineManager {
|
|
|
304
314
|
* 更新 canPlay 状态
|
|
305
315
|
*/
|
|
306
316
|
private updateCanPlayState;
|
|
317
|
+
private findClipById;
|
|
318
|
+
private buildGeneratedAudioClipName;
|
|
319
|
+
private normalizeGeneratedAudioDuration;
|
|
320
|
+
private getVoiceLinkedAudioClips;
|
|
321
|
+
private applyGeneratedAudioClipResult;
|
|
322
|
+
private syncTextClipDurationToAudio;
|
|
323
|
+
private doesClipOverlapOnTrack;
|
|
324
|
+
private findNearestAvailableTrackForClip;
|
|
325
|
+
private relocateGeneratedAudioClipIfNeeded;
|
|
326
|
+
private regenerateVoiceLinkedAudioClips;
|
|
327
|
+
private handleVoiceGenerateAction;
|
|
328
|
+
private primeOrLoadClipThumbnails;
|
|
329
|
+
private markClipThumbnailLoadCompleted;
|
|
330
|
+
private buildClipThumbnailLoadSignature;
|
|
331
|
+
private buildSourceMediaKey;
|
|
332
|
+
private buildClipThumbnailResourceKey;
|
|
333
|
+
private isClipThumbnailLoadCurrent;
|
|
334
|
+
private areThumbnailArraysEqual;
|
|
307
335
|
private handleClipSplit;
|
|
308
336
|
private handleClipSelect;
|
|
309
337
|
private handleActionUndo;
|
|
@@ -379,7 +407,8 @@ export declare class TimelineManager {
|
|
|
379
407
|
getPrimarySelectedClip(): Clip | null;
|
|
380
408
|
getSelectedClips(): Clip[];
|
|
381
409
|
canDeleteSelectedClips(): boolean;
|
|
382
|
-
|
|
410
|
+
canSplitSelectedClip(): boolean;
|
|
411
|
+
getSelectedClipAudioAction(): SelectedClipAudioAction;
|
|
383
412
|
canToggleSelectedClipsAudio(): boolean;
|
|
384
413
|
toggleSelectedClipsAudio(): Promise<boolean>;
|
|
385
414
|
getCurrentActiveClips(): ActiveClipPlaybackInfo[];
|
|
@@ -388,7 +417,7 @@ export declare class TimelineManager {
|
|
|
388
417
|
getActiveClipsAtTime(time: TimeMs): ActiveClipPlaybackInfo[];
|
|
389
418
|
attachPreview(containerOrConfig: HTMLElement | PreviewMountConfig): void;
|
|
390
419
|
detachPreview(): void;
|
|
391
|
-
attachClipConfig(container: HTMLElement): TimelineClipConfigController;
|
|
420
|
+
attachClipConfig(container: HTMLElement, options?: ClipConfigVoicePanelOptions): TimelineClipConfigController;
|
|
392
421
|
getPreviewBackendType(): Exclude<PreviewBackendType, 'auto'>;
|
|
393
422
|
hasAttachedPreview(): boolean;
|
|
394
423
|
getPreviewAspectRatio(): PreviewAspectRatio;
|
|
@@ -418,15 +447,17 @@ export declare class TimelineManager {
|
|
|
418
447
|
moveClipToTrack(clipId: string, targetTrackId: string): boolean;
|
|
419
448
|
private moveClipToTrackWithHistorySnapshot;
|
|
420
449
|
/**
|
|
421
|
-
*
|
|
422
|
-
* @returns
|
|
450
|
+
* 获取时间轴总时长
|
|
451
|
+
* @returns 从 0 到最后一个音视频 clip 终点的时长(毫秒)
|
|
423
452
|
*/
|
|
424
453
|
getTrackTotalDuration(): TimeMs;
|
|
425
454
|
destroy(): void;
|
|
455
|
+
private initKeyboardShortcuts;
|
|
426
456
|
/** 清除历史堆栈 */
|
|
427
457
|
clearHistory(): void;
|
|
428
458
|
private handleClipChange;
|
|
429
459
|
private withClipRemovalBatch;
|
|
460
|
+
private withSplitOperation;
|
|
430
461
|
private resolveClipIdsForExternalIdRemoval;
|
|
431
462
|
private shouldClearSelectionForClipIds;
|
|
432
463
|
private resolveSelectedClipAtTime;
|
|
@@ -479,6 +510,7 @@ export declare class TimelineManager {
|
|
|
479
510
|
*/
|
|
480
511
|
private checkTrackDurationChange;
|
|
481
512
|
private resolveSelectedClipSnapshot;
|
|
513
|
+
private resolveSelectionChangeData;
|
|
482
514
|
private commitPreviewVisualTransform;
|
|
483
515
|
clearAllTracksAndClips(): void;
|
|
484
516
|
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { Theme } from '../models/types';
|
|
2
|
+
export interface TimelineManagerLayoutElements {
|
|
3
|
+
headerCorner: HTMLDivElement;
|
|
4
|
+
headerViewport: HTMLDivElement;
|
|
5
|
+
headerCanvasHost: HTMLDivElement;
|
|
6
|
+
trackInfoViewport: HTMLDivElement;
|
|
7
|
+
bodyViewport: HTMLDivElement;
|
|
8
|
+
bodyCanvasHost: HTMLDivElement;
|
|
9
|
+
verticalScrollbarCanvasHost: HTMLDivElement;
|
|
10
|
+
horizontalScrollbarCanvasHost: HTMLDivElement;
|
|
11
|
+
playheadOverlay: HTMLDivElement;
|
|
12
|
+
}
|
|
13
|
+
export interface CreateTimelineManagerLayoutOptions {
|
|
14
|
+
theme: Theme;
|
|
15
|
+
timeScaleHeight: number;
|
|
16
|
+
leftPanelWidth: number;
|
|
17
|
+
scrollbarSize: number;
|
|
18
|
+
}
|
|
19
|
+
export declare class TimelineManagerLayoutRenderer {
|
|
20
|
+
private container;
|
|
21
|
+
mount(container: HTMLElement, options: CreateTimelineManagerLayoutOptions): TimelineManagerLayoutElements;
|
|
22
|
+
destroy(): void;
|
|
23
|
+
private renderTemplate;
|
|
24
|
+
private requireElement;
|
|
25
|
+
}
|
|
@@ -1,17 +1,8 @@
|
|
|
1
1
|
import type { Theme } from '../models/types';
|
|
2
|
+
import { type TimelineManagerLayoutElements } from './TimelineManagerLayoutRenderer';
|
|
2
3
|
export declare const TIMELINE_MANAGER_LEFT_PANEL_WIDTH = 200;
|
|
3
4
|
export declare const TIMELINE_MANAGER_SCROLLBAR_SIZE = 8;
|
|
4
|
-
export
|
|
5
|
-
headerCorner: HTMLDivElement;
|
|
6
|
-
headerViewport: HTMLDivElement;
|
|
7
|
-
headerCanvasHost: HTMLDivElement;
|
|
8
|
-
trackInfoViewport: HTMLDivElement;
|
|
9
|
-
bodyViewport: HTMLDivElement;
|
|
10
|
-
bodyCanvasHost: HTMLDivElement;
|
|
11
|
-
verticalScrollbarCanvasHost: HTMLDivElement;
|
|
12
|
-
horizontalScrollbarCanvasHost: HTMLDivElement;
|
|
13
|
-
playheadOverlay: HTMLDivElement;
|
|
14
|
-
}
|
|
5
|
+
export type { TimelineManagerLayoutElements };
|
|
15
6
|
export interface CreateTimelineManagerLayoutOptions {
|
|
16
7
|
theme: Theme;
|
|
17
8
|
timeScaleHeight: number;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export type TrackType = 'video' | 'audio';
|
|
1
|
+
export type TrackType = 'video' | 'audio' | 'text';
|
|
2
2
|
export type PlayState = 'playing' | 'paused';
|
|
3
3
|
export type TimeMs = number;
|
|
4
4
|
export type LogLevel = 'debug' | 'info' | 'warn' | 'error';
|
|
@@ -20,6 +20,17 @@ export interface ClipVisualTransform {
|
|
|
20
20
|
y: number;
|
|
21
21
|
scale: number;
|
|
22
22
|
}
|
|
23
|
+
export interface TextClipStyle {
|
|
24
|
+
fontSize: number;
|
|
25
|
+
color: string;
|
|
26
|
+
rotation: number;
|
|
27
|
+
strokeColor: string;
|
|
28
|
+
strokeWidth: number;
|
|
29
|
+
lineHeight: number;
|
|
30
|
+
paddingX: number;
|
|
31
|
+
}
|
|
32
|
+
export declare const DEFAULT_TEXT_CLIP_STYLE: TextClipStyle;
|
|
33
|
+
export declare function resolveTextClipStyle(style?: Partial<TextClipStyle> | null): TextClipStyle;
|
|
23
34
|
export type PreviewBackendType = 'dom' | 'canvas' | 'auto';
|
|
24
35
|
export interface Mp4PreviewMediaSource {
|
|
25
36
|
url: string;
|
|
@@ -33,15 +44,49 @@ export interface HlsFmp4PreviewMediaSource {
|
|
|
33
44
|
}
|
|
34
45
|
export type PreviewMediaSource = Mp4PreviewMediaSource | HlsFmp4PreviewMediaSource;
|
|
35
46
|
export type PreviewSourceResolver = (clip: Clip) => PreviewMediaSource | null | Promise<PreviewMediaSource | null>;
|
|
47
|
+
export interface TextPreviewFontConfig {
|
|
48
|
+
fontName: string;
|
|
49
|
+
fontSourceUrl: string;
|
|
50
|
+
}
|
|
51
|
+
export interface VoiceOption {
|
|
52
|
+
id: string;
|
|
53
|
+
name: string;
|
|
54
|
+
lang: string;
|
|
55
|
+
emotion: string;
|
|
56
|
+
tags: string[];
|
|
57
|
+
avatar?: string;
|
|
58
|
+
audiofile?: string;
|
|
59
|
+
source?: Record<string, unknown>;
|
|
60
|
+
}
|
|
61
|
+
export interface GenerateVoiceRequest {
|
|
62
|
+
requestId: string;
|
|
63
|
+
sourceTextClipId: string;
|
|
64
|
+
targetAudioClipId?: string;
|
|
65
|
+
text: string;
|
|
66
|
+
voiceId: string;
|
|
67
|
+
followTextUpdates: boolean;
|
|
68
|
+
mode: 'create' | 'replace';
|
|
69
|
+
}
|
|
70
|
+
export interface GenerateVoiceResult {
|
|
71
|
+
requestId: string;
|
|
72
|
+
audioSrc: string;
|
|
73
|
+
duration: number;
|
|
74
|
+
voiceId: string;
|
|
75
|
+
voiceName: string;
|
|
76
|
+
}
|
|
77
|
+
export interface ClipConfigVoicePanelOptions {
|
|
78
|
+
voiceCatalog?: VoiceOption[];
|
|
79
|
+
generateVoiceBatch?: (requests: GenerateVoiceRequest[]) => Promise<GenerateVoiceResult[]>;
|
|
80
|
+
}
|
|
36
81
|
export interface ClipConfig {
|
|
37
82
|
id?: string;
|
|
38
83
|
type?: TrackType;
|
|
39
84
|
externalId?: string;
|
|
40
|
-
src
|
|
41
|
-
name
|
|
85
|
+
src?: string;
|
|
86
|
+
name?: string;
|
|
42
87
|
isMuted?: boolean;
|
|
43
88
|
startTime?: TimeMs;
|
|
44
|
-
duration
|
|
89
|
+
duration?: TimeMs;
|
|
45
90
|
startTimeAtSource?: TimeMs;
|
|
46
91
|
endTimeAtSource?: TimeMs;
|
|
47
92
|
sourceDuration?: TimeMs;
|
|
@@ -52,6 +97,12 @@ export interface ClipConfig {
|
|
|
52
97
|
separatedFromVideoClipId?: string;
|
|
53
98
|
trackId?: string;
|
|
54
99
|
volume?: number;
|
|
100
|
+
textContent?: string;
|
|
101
|
+
textStyle?: Partial<TextClipStyle>;
|
|
102
|
+
ttsSourceTextClipId?: string;
|
|
103
|
+
ttsVoiceId?: string;
|
|
104
|
+
ttsVoiceName?: string;
|
|
105
|
+
ttsFollowTextUpdates?: boolean;
|
|
55
106
|
}
|
|
56
107
|
export interface ClipEntity {
|
|
57
108
|
id: string;
|
|
@@ -72,6 +123,12 @@ export interface ClipEntity {
|
|
|
72
123
|
separatedAudioClipId?: string;
|
|
73
124
|
separatedFromVideoClipId?: string;
|
|
74
125
|
volume?: number;
|
|
126
|
+
textContent?: string;
|
|
127
|
+
textStyle?: TextClipStyle;
|
|
128
|
+
ttsSourceTextClipId?: string;
|
|
129
|
+
ttsVoiceId?: string;
|
|
130
|
+
ttsVoiceName?: string;
|
|
131
|
+
ttsFollowTextUpdates?: boolean;
|
|
75
132
|
}
|
|
76
133
|
export interface ClipViewState {
|
|
77
134
|
isDragging: boolean;
|
|
@@ -114,15 +171,9 @@ export interface Theme {
|
|
|
114
171
|
clipDuration: string;
|
|
115
172
|
clipHandle: string;
|
|
116
173
|
clipCoverBackground: string;
|
|
117
|
-
audioClipBackground?: string;
|
|
118
174
|
audioClipText?: string;
|
|
119
175
|
audioClipAccent?: string;
|
|
120
|
-
clipSelectedBackground: string;
|
|
121
176
|
clipSelectedBorder: string;
|
|
122
|
-
clipSelectedName: string;
|
|
123
|
-
clipSelectedDuration: string;
|
|
124
|
-
clipSelectedHandle: string;
|
|
125
|
-
clipSelectedCoverBackground: string;
|
|
126
177
|
playhead: string;
|
|
127
178
|
grid: string;
|
|
128
179
|
snapGuideLineColor?: string;
|
|
@@ -136,6 +187,12 @@ export type ThemeConfig = Partial<Theme>;
|
|
|
136
187
|
export type ResolvedTimelineConfig = Omit<TimelineConfig, 'theme'> & {
|
|
137
188
|
theme: Theme;
|
|
138
189
|
};
|
|
190
|
+
export type TimelineKeyboardShortcutAction = 'togglePlay' | 'deleteSelectedClips' | 'toggleSelectedClipsAudio' | 'splitCurrentClip' | 'undo' | 'redo';
|
|
191
|
+
export type TimelineKeyboardShortcutBindings = Partial<Record<TimelineKeyboardShortcutAction, string | string[]>>;
|
|
192
|
+
export interface TimelineKeyboardShortcutsConfig {
|
|
193
|
+
enabled?: boolean;
|
|
194
|
+
bindings?: TimelineKeyboardShortcutBindings;
|
|
195
|
+
}
|
|
139
196
|
export declare const defaultDarkTheme: Theme;
|
|
140
197
|
export declare function resolveTheme(theme?: ThemeConfig): Theme;
|
|
141
198
|
export interface TimelineConfig {
|
|
@@ -154,7 +211,9 @@ export interface TimelineConfig {
|
|
|
154
211
|
thumbnailProvider?: ThumbnailProvider;
|
|
155
212
|
previewBackend?: PreviewBackendType;
|
|
156
213
|
previewSourceResolver?: PreviewSourceResolver;
|
|
214
|
+
textPreviewFont?: TextPreviewFontConfig | null;
|
|
157
215
|
draftData?: TimelineExportData;
|
|
216
|
+
keyboardShortcuts?: false | TimelineKeyboardShortcutsConfig;
|
|
158
217
|
}
|
|
159
218
|
export type PreviewAspectRatioMode = 'auto-first-added-video' | 'auto-first-video' | 'manual';
|
|
160
219
|
export interface PreviewAspectRatio {
|
|
@@ -167,11 +226,16 @@ export interface PreviewAspectRatioPreset {
|
|
|
167
226
|
label: string;
|
|
168
227
|
aspectRatio: PreviewAspectRatio;
|
|
169
228
|
}
|
|
229
|
+
export declare const ASPECT_RATIO_BASELINE_SHORT_EDGE_PX = 720;
|
|
170
230
|
export declare const DEFAULT_PREVIEW_ASPECT_RATIO: PreviewAspectRatio;
|
|
171
231
|
export declare const PREVIEW_ASPECT_RATIO_PRESETS: PreviewAspectRatioPreset[];
|
|
172
232
|
export declare function normalizePreviewAspectRatioMode(mode?: PreviewAspectRatioMode | null): PreviewAspectRatioMode;
|
|
173
233
|
export declare function isAutoPreviewAspectRatioMode(mode?: PreviewAspectRatioMode | null): boolean;
|
|
174
234
|
export declare function normalizePreviewAspectRatio(aspectRatio?: Partial<PreviewAspectRatio> | null): PreviewAspectRatio;
|
|
235
|
+
export declare function resolveAspectRatioBaselineDimensions(aspectRatio: Pick<PreviewAspectRatio, 'width' | 'height'>, shortEdge?: number): {
|
|
236
|
+
width: number;
|
|
237
|
+
height: number;
|
|
238
|
+
};
|
|
175
239
|
export interface PreviewMountConfig {
|
|
176
240
|
container: HTMLElement;
|
|
177
241
|
aspectRatio?: {
|
|
@@ -347,6 +411,16 @@ export interface SelectedClipChangeData {
|
|
|
347
411
|
clip: Clip | null;
|
|
348
412
|
hasSelectedClip: boolean;
|
|
349
413
|
}
|
|
414
|
+
export type SelectedClipAudioAction = 'separate' | 'restore' | null;
|
|
415
|
+
export interface SelectionChangeData {
|
|
416
|
+
clip: Clip | null;
|
|
417
|
+
hasSelectedClip: boolean;
|
|
418
|
+
selectedClipIds: string[];
|
|
419
|
+
canDeleteSelectedClips: boolean;
|
|
420
|
+
canSplitSelectedClip: boolean;
|
|
421
|
+
selectedClipAudioAction: SelectedClipAudioAction;
|
|
422
|
+
canToggleSelectedClipsAudio: boolean;
|
|
423
|
+
}
|
|
350
424
|
export interface ClipRemovedEventData {
|
|
351
425
|
clipId: string;
|
|
352
426
|
}
|
|
@@ -422,4 +496,10 @@ export interface ClipExportData {
|
|
|
422
496
|
separatedAudioClipId?: string;
|
|
423
497
|
separatedFromVideoClipId?: string;
|
|
424
498
|
volume?: number;
|
|
499
|
+
textContent?: string;
|
|
500
|
+
textStyle?: TextClipStyle;
|
|
501
|
+
ttsSourceTextClipId?: string;
|
|
502
|
+
ttsVoiceId?: string;
|
|
503
|
+
ttsVoiceName?: string;
|
|
504
|
+
ttsFollowTextUpdates?: boolean;
|
|
425
505
|
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { type TemplateResult } from 'lit';
|
|
2
|
+
export interface DomRenderer<TViewModel> {
|
|
3
|
+
mount(container: HTMLElement): void;
|
|
4
|
+
update(viewModel: TViewModel): void;
|
|
5
|
+
destroy(): void;
|
|
6
|
+
}
|
|
7
|
+
export declare abstract class LitDomRenderer<TViewModel> implements DomRenderer<TViewModel> {
|
|
8
|
+
private container;
|
|
9
|
+
private viewModel;
|
|
10
|
+
mount(container: HTMLElement): void;
|
|
11
|
+
update(viewModel: TViewModel): void;
|
|
12
|
+
destroy(): void;
|
|
13
|
+
protected get mountedContainer(): HTMLElement | null;
|
|
14
|
+
protected abstract renderTemplate(viewModel: TViewModel): TemplateResult;
|
|
15
|
+
protected afterRender(_container: HTMLElement, _viewModel: TViewModel): void;
|
|
16
|
+
private renderCurrent;
|
|
17
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { Clip, ClipConfig, PreviewMediaSource } from '../models/types';
|
|
2
|
+
type SourceLike = Pick<Clip, 'src' | 'externalId'> | Pick<ClipConfig, 'src' | 'externalId'>;
|
|
3
|
+
type ThumbnailLike = Pick<Clip, 'src' | 'externalId' | 'startTimeAtSource' | 'endTimeAtSource' | 'duration' | 'type'>;
|
|
4
|
+
export declare class SourceMediaRegistry {
|
|
5
|
+
private readonly durationCache;
|
|
6
|
+
private readonly thumbnailCache;
|
|
7
|
+
private readonly previewSourceCache;
|
|
8
|
+
static buildSourceKey(source: SourceLike): string;
|
|
9
|
+
static buildThumbnailKey(clip: ThumbnailLike): string;
|
|
10
|
+
getDuration(sourceKey: string, loader: () => Promise<number>, options?: {
|
|
11
|
+
force?: boolean;
|
|
12
|
+
}): Promise<number>;
|
|
13
|
+
primeDuration(sourceKey: string, duration: number): void;
|
|
14
|
+
getThumbnails(thumbnailKey: string, loader: () => Promise<string[]>, options?: {
|
|
15
|
+
force?: boolean;
|
|
16
|
+
}): Promise<string[]>;
|
|
17
|
+
primeThumbnails(thumbnailKey: string, thumbnails: string[]): void;
|
|
18
|
+
clearThumbnailCache(): void;
|
|
19
|
+
getPreviewSource(sourceKey: string, loader: () => PreviewMediaSource | null | Promise<PreviewMediaSource | null>, options?: {
|
|
20
|
+
force?: boolean;
|
|
21
|
+
}): PreviewMediaSource | null | Promise<PreviewMediaSource | null>;
|
|
22
|
+
primePreviewSource(sourceKey: string, value: PreviewMediaSource | null): void;
|
|
23
|
+
}
|
|
24
|
+
export {};
|
|
@@ -18,6 +18,8 @@ declare class MockNode {
|
|
|
18
18
|
cornerRadius(value?: number): any;
|
|
19
19
|
text(value?: string): any;
|
|
20
20
|
ellipsis(value?: boolean): any;
|
|
21
|
+
lineHeight(value?: number): any;
|
|
22
|
+
wrap(value?: string): any;
|
|
21
23
|
points(value?: number[]): any;
|
|
22
24
|
setAttr(key: string, value: any): void;
|
|
23
25
|
getAttr(key: string): any;
|
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
export declare const SHARED_COLOR_TOKENS: {
|
|
2
|
+
readonly transparent: "transparent";
|
|
3
|
+
readonly white: "#ffffff";
|
|
4
|
+
readonly black: "#000000";
|
|
5
|
+
readonly panelSurface: "#0f0f0f";
|
|
6
|
+
readonly panelSurfaceAlt: "#1e1e1e";
|
|
7
|
+
readonly buttonSurface: "#2a2a2a";
|
|
8
|
+
readonly inputSurface: "#2d2d2d";
|
|
9
|
+
readonly clipSurface: "#2e2e2e";
|
|
10
|
+
readonly videoClipBackground: "#1e5679";
|
|
11
|
+
readonly textClipBackground: "#604c32";
|
|
12
|
+
readonly audioClipBackground: "#254428";
|
|
13
|
+
readonly selectedTrackSurface: "#292929";
|
|
14
|
+
readonly borderStrong: "#333333";
|
|
15
|
+
readonly borderMedium: "#444444";
|
|
16
|
+
readonly borderSubtle: "#555555";
|
|
17
|
+
readonly textPrimary: "#ffffff";
|
|
18
|
+
readonly textSecondary: "#e0e0e0";
|
|
19
|
+
readonly textMuted: "#cccccc";
|
|
20
|
+
readonly textSubtle: "#aaaaaa";
|
|
21
|
+
readonly textHint: "#999999";
|
|
22
|
+
readonly textAudio: "#d0d0d0";
|
|
23
|
+
readonly textInactive: "#b5b6bf";
|
|
24
|
+
readonly audioClipAccent: "#b8b8c0";
|
|
25
|
+
readonly accentFocus: "#409eff";
|
|
26
|
+
readonly accentSelectedBorder: "#50E3C2";
|
|
27
|
+
readonly clipSelectedBorder: "#ffffff";
|
|
28
|
+
readonly accentSelectionBox: "#5082e6";
|
|
29
|
+
readonly accentAction: "#4c8dff";
|
|
30
|
+
readonly accentDanger: "#dc3545";
|
|
31
|
+
readonly accentPlayheadGrip: "#8c90ff";
|
|
32
|
+
readonly accentCoverFallback: "#FFF2A0";
|
|
33
|
+
readonly accentAudioPreview: "#b5baff";
|
|
34
|
+
readonly activeTabBackground: "#595A5D";
|
|
35
|
+
readonly gridLine: "#E0E0E0";
|
|
36
|
+
readonly playheadMarker: "#FF0000";
|
|
37
|
+
readonly overlayPreview: "rgba(0, 0, 0, 0.56)";
|
|
38
|
+
readonly overlayShadow: "rgba(0, 0, 0, 0.22)";
|
|
39
|
+
readonly overlayTransformHandle: "rgba(80, 227, 194, 0.95)";
|
|
40
|
+
readonly overlaySelectionBoxFill: "rgba(80, 130, 230, 0.15)";
|
|
41
|
+
readonly overlayVideoDropPreview: "rgba(80, 227, 194, 0.18)";
|
|
42
|
+
readonly overlayAudioDropPreview: "rgba(181, 186, 255, 0.18)";
|
|
43
|
+
readonly overlayHitArea: "rgba(0, 0, 0, 0.001)";
|
|
44
|
+
readonly sliderFillStart: "#f6f8ff";
|
|
45
|
+
readonly sliderFillEnd: "#dfe4f2";
|
|
46
|
+
readonly sliderRoad: "rgba(116, 128, 163, 0.26)";
|
|
47
|
+
readonly sliderThumbBorder: "rgba(230, 236, 250, 0.96)";
|
|
48
|
+
readonly sliderThumbGlowStart: "#ffffff";
|
|
49
|
+
readonly sliderThumbGlowEnd: "#eef2fb";
|
|
50
|
+
readonly sliderThumbInnerShadow: "rgba(255, 255, 255, 0.92)";
|
|
51
|
+
readonly sliderThumbShadow: "rgba(8, 24, 56, 0.24)";
|
|
52
|
+
readonly demoSliderThumbShadow: "rgba(8, 24, 56, 0.18)";
|
|
53
|
+
};
|
|
54
|
+
export declare const TIMELINE_DEFAULT_THEME_COLORS: {
|
|
55
|
+
readonly background: "#000000";
|
|
56
|
+
readonly border: "#333333";
|
|
57
|
+
readonly timeTick: "#e0e0e0";
|
|
58
|
+
readonly timeText: "#aaaaaa";
|
|
59
|
+
readonly trackBackground: "#000000";
|
|
60
|
+
readonly trackSelectedBackground: "#292929";
|
|
61
|
+
readonly trackBorder: "#333333";
|
|
62
|
+
readonly clipBackground: "#2e2e2e";
|
|
63
|
+
readonly clipBorder: "#000000";
|
|
64
|
+
readonly clipName: "#ffffff";
|
|
65
|
+
readonly clipDuration: "#cccccc";
|
|
66
|
+
readonly clipHandle: "#ffffff";
|
|
67
|
+
readonly clipSelectedBorder: "#ffffff";
|
|
68
|
+
readonly clipCoverBackground: "#333333";
|
|
69
|
+
readonly audioClipText: "#d0d0d0";
|
|
70
|
+
readonly audioClipAccent: "#b8b8c0";
|
|
71
|
+
readonly playhead: "#ffffff";
|
|
72
|
+
readonly grid: "#333333";
|
|
73
|
+
readonly snapGuideLineColor: "#50E3C2";
|
|
74
|
+
readonly scrollbarBackground: "#333333";
|
|
75
|
+
readonly scrollbarBorder: "#555555";
|
|
76
|
+
readonly scrollbarThumb: "#444444";
|
|
77
|
+
};
|
|
78
|
+
export declare const CLIP_CONFIG_PANEL_DEFAULT_THEME: {
|
|
79
|
+
readonly backgroundColor: "#0f0f0f";
|
|
80
|
+
readonly borderColor: "#333333";
|
|
81
|
+
readonly textColor: "#e0e0e0";
|
|
82
|
+
readonly labelColor: "#999999";
|
|
83
|
+
readonly inputBackground: "#2d2d2d";
|
|
84
|
+
readonly inputBorder: "#444444";
|
|
85
|
+
readonly inputFocusBorder: "#409eff";
|
|
86
|
+
readonly buttonBackground: "#2d2d2d";
|
|
87
|
+
readonly buttonBorder: "#444444";
|
|
88
|
+
readonly buttonActiveBackground: "#409eff";
|
|
89
|
+
readonly buttonActiveBorder: "#409eff";
|
|
90
|
+
readonly buttonActiveText: "#ffffff";
|
|
91
|
+
};
|
|
92
|
+
export declare const TRACK_INFO_PANEL_DEFAULT_THEME: {
|
|
93
|
+
readonly background: "#0f0f0f";
|
|
94
|
+
readonly border: "#333333";
|
|
95
|
+
readonly text: "#ffffff";
|
|
96
|
+
readonly buttonBackground: "#2a2a2a";
|
|
97
|
+
readonly buttonHover: "#3a3a3a";
|
|
98
|
+
readonly buttonDanger: "#dc3545";
|
|
99
|
+
};
|
|
100
|
+
export declare const SCROLLBAR_DEFAULT_COLORS: {
|
|
101
|
+
readonly background: "#333333";
|
|
102
|
+
readonly border: "#555555";
|
|
103
|
+
readonly thumb: "#444444";
|
|
104
|
+
readonly hitArea: "rgba(0, 0, 0, 0.001)";
|
|
105
|
+
};
|
|
106
|
+
export declare const KONVA_DEFAULT_COLORS: {
|
|
107
|
+
readonly fill: "#ffffff";
|
|
108
|
+
readonly stroke: "#000000";
|
|
109
|
+
readonly text: "#000000";
|
|
110
|
+
};
|
|
111
|
+
export declare const CLIP_CONFIG_PANEL_RENDERER_COLORS: {
|
|
112
|
+
readonly tabBarBackground: "#2a2a2a";
|
|
113
|
+
readonly actionBarBackground: "#2a2a2a";
|
|
114
|
+
readonly activeTabBackground: "#595A5D";
|
|
115
|
+
readonly activeTabText: "#ffffff";
|
|
116
|
+
readonly inactiveTabText: "#b5b6bf";
|
|
117
|
+
readonly sliderThumbShadow: "0 8px 20px rgba(8, 24, 56, 0.24)";
|
|
118
|
+
readonly sliderThumbInnerShadow: "inset 0 1px 1px rgba(255, 255, 255, 0.92)";
|
|
119
|
+
};
|
|
120
|
+
export declare const PLAYHEAD_DEFAULT_COLORS: {
|
|
121
|
+
readonly grip: "#8c90ff";
|
|
122
|
+
readonly shadow: "rgba(0, 0, 0, 0.22)";
|
|
123
|
+
readonly marker: "#FF0000";
|
|
124
|
+
};
|
|
125
|
+
export declare const PREVIEW_PENDING_OVERLAY_COLORS: {
|
|
126
|
+
readonly background: "rgba(0, 0, 0, 0.56)";
|
|
127
|
+
readonly text: "#ffffff";
|
|
128
|
+
readonly actionBackground: "#4c8dff";
|
|
129
|
+
readonly actionText: "#ffffff";
|
|
130
|
+
};
|
|
131
|
+
export declare const PREVIEW_TRANSFORM_OVERLAY_COLORS: {
|
|
132
|
+
readonly border: "rgba(80, 227, 194, 0.95)";
|
|
133
|
+
readonly handleBackground: "#000000";
|
|
134
|
+
};
|
|
135
|
+
export declare const SELECTION_BOX_COLORS: {
|
|
136
|
+
readonly fill: "rgba(80, 130, 230, 0.15)";
|
|
137
|
+
readonly stroke: "#5082e6";
|
|
138
|
+
};
|
|
139
|
+
export declare const DROP_PREVIEW_COLORS: {
|
|
140
|
+
readonly videoFill: "rgba(80, 227, 194, 0.18)";
|
|
141
|
+
readonly videoStroke: "#50E3C2";
|
|
142
|
+
readonly audioFill: "rgba(181, 186, 255, 0.18)";
|
|
143
|
+
readonly audioStroke: "#b5baff";
|
|
144
|
+
};
|
|
145
|
+
export declare const GRID_DEFAULT_COLORS: {
|
|
146
|
+
readonly line: "#E0E0E0";
|
|
147
|
+
};
|