@linker-design-plus/timeline-track 1.0.9 → 1.0.11
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 +328 -372
- package/dist/components/interaction/globalPointerDragSession.d.ts +8 -0
- package/dist/components/panel/ClipConfigPanel.d.ts +48 -0
- package/dist/components/panel/TrackInfoPanel.d.ts +33 -0
- package/dist/components/scrollbar/KonvaScrollbarView.d.ts +58 -0
- package/dist/components/timeline/ManagedPlayhead.d.ts +29 -0
- package/dist/components/{Playhead.d.ts → timeline/Playhead.d.ts} +1 -1
- package/dist/components/{Timeline.d.ts → timeline/Timeline.d.ts} +27 -6
- package/dist/components/timeline/TimelineHeaderView.d.ts +45 -0
- package/dist/components/track/Clip.d.ts +16 -0
- package/dist/components/track/Track.d.ts +121 -0
- package/dist/components/track/trackClipLayout.d.ts +23 -0
- package/dist/components/track/trackInteractionState.d.ts +79 -0
- package/dist/core/commands/timelineCommands.d.ts +121 -0
- package/dist/core/controllers/demoPreviewRebuildState.d.ts +54 -0
- package/dist/core/controllers/domPreviewBackend.d.ts +5 -0
- package/dist/core/controllers/index.d.ts +13 -0
- package/dist/core/controllers/previewBackend.d.ts +53 -0
- package/dist/core/controllers/previewBackendSupport.d.ts +2 -0
- package/dist/core/controllers/previewClockController.d.ts +13 -0
- package/dist/core/controllers/previewTransformMath.d.ts +27 -0
- package/dist/core/controllers/previewTransformOverlay.d.ts +45 -0
- package/dist/core/controllers/timelineClipConfigController.d.ts +15 -0
- package/dist/core/controllers/timelineClipEventController.d.ts +32 -0
- package/dist/core/controllers/timelineClipWorkflowController.d.ts +30 -0
- package/dist/core/controllers/timelineDurationController.d.ts +14 -0
- package/dist/core/controllers/timelineEventDispatcher.d.ts +12 -0
- package/dist/core/controllers/timelinePlaybackResolver.d.ts +17 -0
- package/dist/core/controllers/timelinePreviewSession.d.ts +94 -0
- package/dist/core/controllers/timelineSelectionController.d.ts +17 -0
- package/dist/core/controllers/timelineTrackInfoPanelController.d.ts +19 -0
- package/dist/core/controllers/timelineTrackMutationController.d.ts +46 -0
- package/dist/core/facade/timelineManager.d.ts +382 -0
- package/dist/core/{history.d.ts → history/history.d.ts} +16 -14
- package/dist/core/history/index.d.ts +3 -0
- package/dist/core/history/timelineHistoryExecutor.d.ts +23 -0
- package/dist/core/history/timelineHistoryRecorder.d.ts +15 -0
- package/dist/core/layout/index.d.ts +1 -0
- package/dist/core/layout/timelineManagerDom.d.ts +22 -0
- package/dist/core/layout/timelineTrackLayout.d.ts +10 -0
- package/dist/core/models/clipState.d.ts +3 -0
- package/dist/core/{constants.d.ts → models/constants.d.ts} +4 -0
- package/dist/core/models/index.d.ts +3 -0
- package/dist/core/models/types.d.ts +392 -0
- package/dist/core/presentation/index.d.ts +1 -0
- package/dist/core/presentation/timelinePresentationAdapter.d.ts +22 -0
- package/dist/core/stores/index.d.ts +4 -0
- package/dist/core/stores/playbackStore.d.ts +17 -0
- package/dist/core/stores/selectionStore.d.ts +7 -0
- package/dist/core/stores/timelineStore.d.ts +44 -0
- package/dist/core/stores/viewportStore.d.ts +33 -0
- package/dist/core/testing/konva-test-stub.d.ts +81 -0
- package/dist/core/tracks/index.d.ts +3 -0
- package/dist/core/tracks/timelineTrackBridge.d.ts +37 -0
- package/dist/core/tracks/timelineTrackCollection.d.ts +50 -0
- package/dist/core/tracks/trackManager.d.ts +19 -0
- package/dist/core/utils/mountManager.d.ts +10 -0
- package/dist/index.cjs.js +29 -3
- package/dist/index.d.ts +12 -7
- package/dist/index.es.js +8914 -4353
- package/dist/utils/logging/Logger.d.ts +30 -0
- package/dist/utils/logging/index.d.ts +1 -0
- package/dist/utils/{KonvaUtils.d.ts → rendering/KonvaUtils.d.ts} +3 -43
- package/dist/utils/rendering/clipCoverRenderer.d.ts +23 -0
- package/dist/utils/rendering/clipVisualRenderer.d.ts +5 -0
- package/dist/utils/rendering/index.d.ts +4 -0
- package/dist/utils/rendering/timelineGridDrawing.d.ts +8 -0
- package/dist/utils/time/index.d.ts +1 -0
- package/dist/utils/{timeUtils.d.ts → time/timeUtils.d.ts} +4 -0
- package/package.json +5 -3
- package/dist/components/Clip.d.ts +0 -44
- package/dist/components/VideoTrack.d.ts +0 -126
- package/dist/core/timelineManager.d.ts +0 -212
- package/dist/core/types.d.ts +0 -183
- package/dist/utils/Logger.d.ts +0 -49
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import type { Clip, ClipConfig, PlayState, PreviewAspectRatio, Track, TrackInsertionPlacement, TrackType } from '../models/types';
|
|
2
|
+
export interface DemoPreviewClipSnapshot extends ClipConfig {
|
|
3
|
+
id: string;
|
|
4
|
+
previewAutoOrder?: number;
|
|
5
|
+
}
|
|
6
|
+
export interface DemoPreviewTrackSnapshot {
|
|
7
|
+
id: string;
|
|
8
|
+
type: TrackType;
|
|
9
|
+
name: string;
|
|
10
|
+
order: number;
|
|
11
|
+
isMuted: boolean;
|
|
12
|
+
clips: DemoPreviewClipSnapshot[];
|
|
13
|
+
}
|
|
14
|
+
export interface DemoPreviewRebuildSnapshot {
|
|
15
|
+
currentTime: number;
|
|
16
|
+
speed: number;
|
|
17
|
+
zoom: number;
|
|
18
|
+
playState: PlayState;
|
|
19
|
+
previewAspectRatio: PreviewAspectRatio;
|
|
20
|
+
selectedClipId: string | null;
|
|
21
|
+
isPreviewAttached: boolean;
|
|
22
|
+
tracks: DemoPreviewTrackSnapshot[];
|
|
23
|
+
}
|
|
24
|
+
interface DemoPreviewStateReader {
|
|
25
|
+
getCurrentTime(): number;
|
|
26
|
+
getPreviewAspectRatio(): PreviewAspectRatio;
|
|
27
|
+
getSpeed(): number;
|
|
28
|
+
getZoom(): number;
|
|
29
|
+
getPlayState(): PlayState;
|
|
30
|
+
getSelectedClip(): Clip | null;
|
|
31
|
+
getTracks(): Track[];
|
|
32
|
+
}
|
|
33
|
+
interface DemoPreviewStateWriter extends DemoPreviewStateReader {
|
|
34
|
+
addClip(clipConfig: DemoPreviewClipSnapshot): Promise<string>;
|
|
35
|
+
clearSelection(): void;
|
|
36
|
+
createTrack(type: TrackType, name?: string, insertionPlacement?: TrackInsertionPlacement, referenceTrackId?: string): string;
|
|
37
|
+
moveClipToTrack(clipId: string, targetTrackId: string): boolean;
|
|
38
|
+
muteTrack(trackId: string, isMuted: boolean): boolean;
|
|
39
|
+
pause(): void;
|
|
40
|
+
play(): void;
|
|
41
|
+
renameTrack(trackId: string, newName: string): boolean;
|
|
42
|
+
resetPreviewAspectRatioToAuto(): void;
|
|
43
|
+
selectClip(clipId: string): void;
|
|
44
|
+
setCurrentTime(time: number): void;
|
|
45
|
+
setPreviewAspectRatio(aspectRatio: {
|
|
46
|
+
width: number;
|
|
47
|
+
height: number;
|
|
48
|
+
}): void;
|
|
49
|
+
setSpeed(speed: number): void;
|
|
50
|
+
setZoomByInteraction(zoom: number): void;
|
|
51
|
+
}
|
|
52
|
+
export declare function captureDemoPreviewRebuildSnapshot(manager: DemoPreviewStateReader, isPreviewAttached: boolean): DemoPreviewRebuildSnapshot;
|
|
53
|
+
export declare function restoreDemoPreviewRebuildSnapshot(manager: DemoPreviewStateWriter, snapshot: DemoPreviewRebuildSnapshot): Promise<void>;
|
|
54
|
+
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export * from './timelineClipEventController';
|
|
2
|
+
export * from './timelineClipWorkflowController';
|
|
3
|
+
export { DomPreviewBackend } from './domPreviewBackend';
|
|
4
|
+
export * from './previewBackend';
|
|
5
|
+
export { resolvePreviewBackendType } from './previewBackendSupport';
|
|
6
|
+
export { PreviewClockController } from './previewClockController';
|
|
7
|
+
export * from './timelineDurationController';
|
|
8
|
+
export { TimelineEventDispatcher } from './timelineEventDispatcher';
|
|
9
|
+
export { TimelinePlaybackResolver } from './timelinePlaybackResolver';
|
|
10
|
+
export { TimelinePreviewSession } from './timelinePreviewSession';
|
|
11
|
+
export * from './timelineSelectionController';
|
|
12
|
+
export * from './timelineTrackMutationController';
|
|
13
|
+
export { TimelineTrackInfoPanelController } from './timelineTrackInfoPanelController';
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import type { ActiveClipPlaybackInfo, Clip, ClipVisualTransform, PlayState, PreviewAspectRatio, PreviewMediaSource, PreviewSourceResolver, TimeMs } from '../models/types';
|
|
2
|
+
export interface TimelinePreviewSyncPayload {
|
|
3
|
+
activeClips: ActiveClipPlaybackInfo[];
|
|
4
|
+
nextClips: ActiveClipPlaybackInfo[];
|
|
5
|
+
firstVideoClip: ActiveClipPlaybackInfo | null;
|
|
6
|
+
autoAspectRatioClip: ActiveClipPlaybackInfo | null;
|
|
7
|
+
currentTime: TimeMs;
|
|
8
|
+
playState: PlayState;
|
|
9
|
+
speed: number;
|
|
10
|
+
selectedClipId?: string | null;
|
|
11
|
+
syncRequestId?: number;
|
|
12
|
+
}
|
|
13
|
+
export interface TimelinePreviewBackendCallbacks {
|
|
14
|
+
onBufferingStateChange?: (isBuffering: boolean) => void;
|
|
15
|
+
onSourceLoadingChange?: (pending: number) => void;
|
|
16
|
+
onSyncProcessed?: (syncRequestId?: number) => void;
|
|
17
|
+
onAspectRatioChange?: (aspectRatio: PreviewAspectRatio) => void;
|
|
18
|
+
onVisualTransformCommit?: (clipId: string, visualTransform: ClipVisualTransform) => void;
|
|
19
|
+
onPendingPreviewRetry?: () => void;
|
|
20
|
+
onRuntimeError?: (error: unknown) => void;
|
|
21
|
+
}
|
|
22
|
+
export interface PreviewPendingState {
|
|
23
|
+
mode: 'seek' | 'scrub';
|
|
24
|
+
targetTime: TimeMs;
|
|
25
|
+
loadingPending: number;
|
|
26
|
+
isBuffering: boolean;
|
|
27
|
+
errorMessage: string | null;
|
|
28
|
+
}
|
|
29
|
+
export interface TimelinePreviewBackend {
|
|
30
|
+
attach(container: HTMLElement): void;
|
|
31
|
+
detach(): void;
|
|
32
|
+
sync(payload: TimelinePreviewSyncPayload): void;
|
|
33
|
+
applyAspectRatio(aspectRatio: PreviewAspectRatio): void;
|
|
34
|
+
getAspectRatio(): PreviewAspectRatio;
|
|
35
|
+
setPendingState?(state: PreviewPendingState | null): void;
|
|
36
|
+
hasPreview(): boolean;
|
|
37
|
+
destroy(): void;
|
|
38
|
+
}
|
|
39
|
+
export interface PreviewBackendClockState {
|
|
40
|
+
currentTime: TimeMs;
|
|
41
|
+
playState: PlayState;
|
|
42
|
+
speed: number;
|
|
43
|
+
}
|
|
44
|
+
export interface TimelinePreviewBackendOptions {
|
|
45
|
+
callbacks?: TimelinePreviewBackendCallbacks;
|
|
46
|
+
previewSourceResolver?: PreviewSourceResolver;
|
|
47
|
+
rootClassName?: string;
|
|
48
|
+
frameClassName?: string;
|
|
49
|
+
slotClassNamePrefix?: string;
|
|
50
|
+
}
|
|
51
|
+
export type ResolvedPreviewMediaSource = PreviewMediaSource & {
|
|
52
|
+
clipId: Clip['id'];
|
|
53
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { PlayState, TimeMs } from '../models/types';
|
|
2
|
+
import type { PreviewBackendClockState } from './previewBackend';
|
|
3
|
+
export interface PreviewClockTransition {
|
|
4
|
+
shouldSeek: boolean;
|
|
5
|
+
currentTime: TimeMs;
|
|
6
|
+
playState: PlayState;
|
|
7
|
+
speed: number;
|
|
8
|
+
}
|
|
9
|
+
export declare class PreviewClockController {
|
|
10
|
+
private lastState;
|
|
11
|
+
sync(nextState: PreviewBackendClockState): PreviewClockTransition;
|
|
12
|
+
reset(): void;
|
|
13
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { ClipVisualTransform } from '../models/types';
|
|
2
|
+
export interface PreviewRect {
|
|
3
|
+
left: number;
|
|
4
|
+
top: number;
|
|
5
|
+
width: number;
|
|
6
|
+
height: number;
|
|
7
|
+
centerX: number;
|
|
8
|
+
centerY: number;
|
|
9
|
+
}
|
|
10
|
+
export interface PreviewFrameSize {
|
|
11
|
+
width: number;
|
|
12
|
+
height: number;
|
|
13
|
+
}
|
|
14
|
+
export interface PreviewMediaSize {
|
|
15
|
+
width: number;
|
|
16
|
+
height: number;
|
|
17
|
+
}
|
|
18
|
+
export declare const DEFAULT_CLIP_VISUAL_TRANSFORM: ClipVisualTransform;
|
|
19
|
+
export declare const MIN_CLIP_VISUAL_SCALE = 0.1;
|
|
20
|
+
export declare const MAX_CLIP_VISUAL_SCALE = 8;
|
|
21
|
+
export declare function clampClipVisualScale(scale: number): number;
|
|
22
|
+
export declare function resolveClipVisualTransform(transform?: Partial<ClipVisualTransform> | null): ClipVisualTransform;
|
|
23
|
+
export declare function areClipVisualTransformsEqual(left?: Partial<ClipVisualTransform> | null, right?: Partial<ClipVisualTransform> | null, epsilon?: number): boolean;
|
|
24
|
+
export declare function calculateContainRect(frame: PreviewFrameSize, media: PreviewMediaSize): PreviewRect;
|
|
25
|
+
export declare function calculatePreviewDisplayRect(frame: PreviewFrameSize, media: PreviewMediaSize, transform?: Partial<ClipVisualTransform> | null): PreviewRect;
|
|
26
|
+
export declare function moveClipVisualTransform(startTransform: Partial<ClipVisualTransform> | null | undefined, deltaX: number, deltaY: number, frame: PreviewFrameSize): ClipVisualTransform;
|
|
27
|
+
export declare function scaleClipVisualTransformFromCenter(centerX: number, centerY: number, pointerX: number, pointerY: number, baseRect: PreviewRect, startTransform?: Partial<ClipVisualTransform> | null): ClipVisualTransform;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import type { ClipVisualTransform } from '../models/types';
|
|
2
|
+
import { type PreviewFrameSize, type PreviewRect } from './previewTransformMath';
|
|
3
|
+
export interface PreviewTransformOverlayState {
|
|
4
|
+
clipId: string;
|
|
5
|
+
transform: ClipVisualTransform;
|
|
6
|
+
frameSize: PreviewFrameSize;
|
|
7
|
+
baseRect: PreviewRect;
|
|
8
|
+
displayRect: PreviewRect;
|
|
9
|
+
}
|
|
10
|
+
interface PreviewTransformOverlayCallbacks {
|
|
11
|
+
onPreviewTransformChange?: (clipId: string, transform: ClipVisualTransform | null) => void;
|
|
12
|
+
onPreviewTransformCommit?: (clipId: string, transform: ClipVisualTransform) => void;
|
|
13
|
+
}
|
|
14
|
+
export declare class PreviewTransformOverlay {
|
|
15
|
+
private frameElement;
|
|
16
|
+
private overlayElement;
|
|
17
|
+
private boxElement;
|
|
18
|
+
private readonly handleElements;
|
|
19
|
+
private readonly handlePointerDownHandlers;
|
|
20
|
+
private state;
|
|
21
|
+
private interaction;
|
|
22
|
+
private readonly callbacks;
|
|
23
|
+
private readonly boundPointerMove;
|
|
24
|
+
private readonly boundPointerUp;
|
|
25
|
+
private readonly boundVisibilityChange;
|
|
26
|
+
private readonly boundWindowBlur;
|
|
27
|
+
constructor(callbacks?: PreviewTransformOverlayCallbacks);
|
|
28
|
+
attach(frameElement: HTMLElement): void;
|
|
29
|
+
detach(): void;
|
|
30
|
+
sync(state: PreviewTransformOverlayState | null): void;
|
|
31
|
+
private createHandle;
|
|
32
|
+
private readonly handleMovePointerDown;
|
|
33
|
+
private getHandlePointerDown;
|
|
34
|
+
private bindDocumentListeners;
|
|
35
|
+
private unbindDocumentListeners;
|
|
36
|
+
private handleDocumentPointerMove;
|
|
37
|
+
private finishInteraction;
|
|
38
|
+
private render;
|
|
39
|
+
private positionHandle;
|
|
40
|
+
private toLocalPoint;
|
|
41
|
+
private getFrameBounds;
|
|
42
|
+
private getDocument;
|
|
43
|
+
private setGlobalCursor;
|
|
44
|
+
}
|
|
45
|
+
export {};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Theme, Clip } from '../models';
|
|
2
|
+
export interface TimelineClipConfigControllerConfig {
|
|
3
|
+
container: HTMLElement;
|
|
4
|
+
theme: Theme;
|
|
5
|
+
getSelectedClip: () => Clip | null;
|
|
6
|
+
updateClip: (clipId: string, updates: Partial<Clip>) => void;
|
|
7
|
+
}
|
|
8
|
+
export declare class TimelineClipConfigController {
|
|
9
|
+
private panel;
|
|
10
|
+
private config;
|
|
11
|
+
init(config: TimelineClipConfigControllerConfig): void;
|
|
12
|
+
update(): void;
|
|
13
|
+
destroy(): void;
|
|
14
|
+
private convertTheme;
|
|
15
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import type { Clip, PlayState } from '../models/types';
|
|
2
|
+
export interface ClipMutationEffectHandlers {
|
|
3
|
+
notifySelectionChange: () => void;
|
|
4
|
+
emitSelectedClipChangeIfNeeded: () => void;
|
|
5
|
+
handleClipChange: () => void;
|
|
6
|
+
checkTrackDurationChange?: () => void;
|
|
7
|
+
}
|
|
8
|
+
export interface ClipUpdateMutationEffectHandlers extends ClipMutationEffectHandlers {
|
|
9
|
+
reloadClipThumbnailsIfNeeded?: () => void;
|
|
10
|
+
}
|
|
11
|
+
export interface ClipSelectPlan {
|
|
12
|
+
shouldJumpToTime: boolean;
|
|
13
|
+
jumpTime: number | null;
|
|
14
|
+
shouldSelectClip: boolean;
|
|
15
|
+
}
|
|
16
|
+
export declare function applyClipMutationEffects(handlers: ClipMutationEffectHandlers): void;
|
|
17
|
+
export declare function applyClipUpdateEffects(handlers: ClipUpdateMutationEffectHandlers): void;
|
|
18
|
+
export declare function shouldReloadClipThumbnails(clip: Clip, originalClip?: Clip, hasThumbnailProvider?: boolean): boolean;
|
|
19
|
+
export declare function calculateCanPlayState(clips: Pick<Clip, 'endTime'>[], currentTime: number): boolean;
|
|
20
|
+
interface SyncCanPlayStateOptions {
|
|
21
|
+
currentCanPlay: boolean;
|
|
22
|
+
nextCanPlay: boolean;
|
|
23
|
+
playState: PlayState;
|
|
24
|
+
clipEndTime: number;
|
|
25
|
+
setCanPlay: (value: boolean) => void;
|
|
26
|
+
pauseTimeline: () => void;
|
|
27
|
+
setCurrentTime: (time: number) => void;
|
|
28
|
+
emitCanPlayChange: (canPlay: boolean) => void;
|
|
29
|
+
}
|
|
30
|
+
export declare function syncCanPlayState(options: SyncCanPlayStateOptions): boolean;
|
|
31
|
+
export declare function createClipSelectPlan(clip: Pick<Clip, 'id' | 'startTime'>): ClipSelectPlan;
|
|
32
|
+
export {};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { Clip, Track } from '../models/types';
|
|
2
|
+
interface MutationWorkflowOptions {
|
|
3
|
+
applied: boolean;
|
|
4
|
+
isExecutingHistoryAction: boolean;
|
|
5
|
+
recordHistory?: () => void;
|
|
6
|
+
applyEffects: () => void;
|
|
7
|
+
}
|
|
8
|
+
interface MoveClipWorkflowOptions extends MutationWorkflowOptions {
|
|
9
|
+
clipId: string;
|
|
10
|
+
sourceTrackId: string;
|
|
11
|
+
targetTrackId: string;
|
|
12
|
+
clipBefore: Clip;
|
|
13
|
+
clipAfter: Clip;
|
|
14
|
+
sourceTrackSnapshot: Track | null;
|
|
15
|
+
targetTrackSnapshot: Track | null;
|
|
16
|
+
recordMoveClipBetweenTracks?: (clipId: string, sourceTrackId: string, targetTrackId: string, clipBefore: Clip, clipAfter: Clip, sourceTrackSnapshot: Track | null, targetTrackSnapshot: Track | null) => void;
|
|
17
|
+
}
|
|
18
|
+
interface SplitClipWorkflowOptions {
|
|
19
|
+
clip1: Clip;
|
|
20
|
+
clip2: Clip;
|
|
21
|
+
isExecutingHistoryAction: boolean;
|
|
22
|
+
recordSplitClip?: (clip1: Clip, clip2: Clip) => void;
|
|
23
|
+
emitClipUpdated: (clip: Clip) => void;
|
|
24
|
+
emitClipAdded: (clip: Clip) => void;
|
|
25
|
+
applyEffects: () => void;
|
|
26
|
+
}
|
|
27
|
+
export declare function applyClipMutationWorkflow(options: MutationWorkflowOptions): boolean;
|
|
28
|
+
export declare function applyMoveClipWorkflow(options: MoveClipWorkflowOptions): boolean;
|
|
29
|
+
export declare function applySplitClipWorkflow(options: SplitClipWorkflowOptions): void;
|
|
30
|
+
export {};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { Clip, TimeMs } from '../models/types';
|
|
2
|
+
export declare const MIN_TIMELINE_DURATION = 3600000;
|
|
3
|
+
export declare const TIMELINE_DURATION_PADDING = 300000;
|
|
4
|
+
interface SyncTrackDurationChangeOptions {
|
|
5
|
+
clips: Clip[];
|
|
6
|
+
lastTrackDuration: TimeMs;
|
|
7
|
+
setLastTrackDuration: (duration: TimeMs) => void;
|
|
8
|
+
setTimelineDuration: (duration: TimeMs) => void;
|
|
9
|
+
emitTrackDurationChange: (duration: TimeMs) => void;
|
|
10
|
+
}
|
|
11
|
+
export declare function calculateTrackTotalDuration(clips: Pick<Clip, 'startTime' | 'duration'>[]): TimeMs;
|
|
12
|
+
export declare function calculateTimelineDuration(trackDuration: TimeMs): TimeMs;
|
|
13
|
+
export declare function syncTrackDurationChange(options: SyncTrackDurationChangeOptions): TimeMs;
|
|
14
|
+
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { TimelineEvent, EventListener as TimelineEventListener } from '../models/types';
|
|
2
|
+
type InitialPayloadProvider = () => any;
|
|
3
|
+
export declare class TimelineEventDispatcher {
|
|
4
|
+
private readonly initialPayloadProviders;
|
|
5
|
+
private listeners;
|
|
6
|
+
constructor(initialPayloadProviders?: Partial<Record<TimelineEvent, InitialPayloadProvider>>);
|
|
7
|
+
on(event: TimelineEvent, listener: TimelineEventListener): void;
|
|
8
|
+
off(event: TimelineEvent, listener: TimelineEventListener): void;
|
|
9
|
+
emit(event: TimelineEvent, data?: any): void;
|
|
10
|
+
clear(): void;
|
|
11
|
+
}
|
|
12
|
+
export {};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { ActiveClipPlaybackInfo, Clip, TimeMs, TrackType } from '../models/types';
|
|
2
|
+
export interface PlaybackTrackSnapshot {
|
|
3
|
+
id: string;
|
|
4
|
+
type: TrackType;
|
|
5
|
+
order: number;
|
|
6
|
+
isMuted?: boolean;
|
|
7
|
+
clips: Clip[];
|
|
8
|
+
}
|
|
9
|
+
export interface ResolvedPlaybackPlan {
|
|
10
|
+
activeClips: ActiveClipPlaybackInfo[];
|
|
11
|
+
nextClips: ActiveClipPlaybackInfo[];
|
|
12
|
+
firstVideoClip: ActiveClipPlaybackInfo | null;
|
|
13
|
+
}
|
|
14
|
+
export declare class TimelinePlaybackResolver {
|
|
15
|
+
resolveActiveClipsAtTime(tracks: PlaybackTrackSnapshot[], time: TimeMs): ActiveClipPlaybackInfo[];
|
|
16
|
+
resolvePlaybackPlan(tracks: PlaybackTrackSnapshot[], time: TimeMs): ResolvedPlaybackPlan;
|
|
17
|
+
}
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import type { ActiveClipPlaybackInfo, ClipVisualTransform, PlayState, PreviewAspectRatio, TimeMs, TrackType } from '../models/types';
|
|
2
|
+
import type { PreviewPendingState } from './previewBackend';
|
|
3
|
+
interface TimelinePreviewSessionCallbacks {
|
|
4
|
+
onBufferingStateChange?: (isBuffering: boolean) => void;
|
|
5
|
+
onSourceLoadingChange?: (pending: number) => void;
|
|
6
|
+
onSyncProcessed?: (syncRequestId?: number) => void;
|
|
7
|
+
onAspectRatioChange?: (aspectRatio: PreviewAspectRatio) => void;
|
|
8
|
+
onVisualTransformCommit?: (clipId: string, visualTransform: ClipVisualTransform) => void;
|
|
9
|
+
onPendingPreviewRetry?: () => void;
|
|
10
|
+
}
|
|
11
|
+
interface TimelinePreviewSessionDependencies {
|
|
12
|
+
createMediaElement?: (kind: TrackType, role: 'current' | 'preload') => HTMLMediaElement;
|
|
13
|
+
createAspectRatioProbe?: () => HTMLVideoElement;
|
|
14
|
+
createAudioContext?: () => AudioContext | null;
|
|
15
|
+
rootClassName?: string;
|
|
16
|
+
frameClassName?: string;
|
|
17
|
+
slotClassNamePrefix?: string;
|
|
18
|
+
}
|
|
19
|
+
export interface TimelinePreviewSyncPayload {
|
|
20
|
+
activeClips: ActiveClipPlaybackInfo[];
|
|
21
|
+
nextClips: ActiveClipPlaybackInfo[];
|
|
22
|
+
firstVideoClip: ActiveClipPlaybackInfo | null;
|
|
23
|
+
autoAspectRatioClip: ActiveClipPlaybackInfo | null;
|
|
24
|
+
currentTime: TimeMs;
|
|
25
|
+
playState: PlayState;
|
|
26
|
+
speed: number;
|
|
27
|
+
selectedClipId?: string | null;
|
|
28
|
+
syncRequestId?: number;
|
|
29
|
+
}
|
|
30
|
+
export declare class TimelinePreviewSession {
|
|
31
|
+
private container;
|
|
32
|
+
private rootElement;
|
|
33
|
+
private frameElement;
|
|
34
|
+
private pendingOverlayElement;
|
|
35
|
+
private pendingOverlayStatusElement;
|
|
36
|
+
private pendingOverlayDetailElement;
|
|
37
|
+
private pendingOverlayActionElement;
|
|
38
|
+
private resizeObserver;
|
|
39
|
+
private readonly trackSlots;
|
|
40
|
+
private audioContext;
|
|
41
|
+
private masterGainNode;
|
|
42
|
+
private isBuffering;
|
|
43
|
+
private loadingCount;
|
|
44
|
+
private selectedClipId;
|
|
45
|
+
private transientVisualTransform;
|
|
46
|
+
private readonly callbacks;
|
|
47
|
+
private readonly dependencies;
|
|
48
|
+
private readonly transformOverlay;
|
|
49
|
+
private requestedAspectRatio;
|
|
50
|
+
private resolvedAutoAspectRatio;
|
|
51
|
+
private aspectRatioProbe;
|
|
52
|
+
private aspectRatioProbeSrc;
|
|
53
|
+
private isAspectRatioProbeLoading;
|
|
54
|
+
private pendingState;
|
|
55
|
+
constructor(callbacks?: TimelinePreviewSessionCallbacks, dependencies?: TimelinePreviewSessionDependencies);
|
|
56
|
+
hasPreview(): boolean;
|
|
57
|
+
attach(container: HTMLElement): void;
|
|
58
|
+
detach(): void;
|
|
59
|
+
setPendingState(state: PreviewPendingState | null): void;
|
|
60
|
+
sync(payload: TimelinePreviewSyncPayload): void;
|
|
61
|
+
applyAspectRatio(aspectRatio: PreviewAspectRatio): void;
|
|
62
|
+
getAspectRatio(): PreviewAspectRatio;
|
|
63
|
+
private createMediaElement;
|
|
64
|
+
private createSlot;
|
|
65
|
+
private destroySlot;
|
|
66
|
+
private getTrackSlots;
|
|
67
|
+
private swapTrackSlots;
|
|
68
|
+
private assignClipToSlot;
|
|
69
|
+
private configureAudioRouting;
|
|
70
|
+
private syncCurrentSlot;
|
|
71
|
+
private preparePreloadSlot;
|
|
72
|
+
private setSlotVisible;
|
|
73
|
+
private getAudioContext;
|
|
74
|
+
private getMasterGainNode;
|
|
75
|
+
private resumeAudioContext;
|
|
76
|
+
private updateFrameLayout;
|
|
77
|
+
private maybeResolveAutoAspectRatio;
|
|
78
|
+
private getAspectRatioProbe;
|
|
79
|
+
private tryResolveAutoAspectRatioFromSlot;
|
|
80
|
+
private handleResolvedAutoAspectRatio;
|
|
81
|
+
private refreshBufferingState;
|
|
82
|
+
private setBufferingState;
|
|
83
|
+
private refreshLoadingState;
|
|
84
|
+
private setLoadingCount;
|
|
85
|
+
private refreshPendingOverlay;
|
|
86
|
+
private handlePreviewTransformChange;
|
|
87
|
+
private refreshVisualLayout;
|
|
88
|
+
private refreshSlotVisualLayout;
|
|
89
|
+
private buildSelectedOverlayState;
|
|
90
|
+
private getFrameSize;
|
|
91
|
+
private getMediaSize;
|
|
92
|
+
private getEffectiveVisualTransform;
|
|
93
|
+
}
|
|
94
|
+
export {};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { Clip } from '../models/types';
|
|
2
|
+
export interface SelectedClipSnapshot {
|
|
3
|
+
clip: Clip | null;
|
|
4
|
+
hasSelectedClip: boolean;
|
|
5
|
+
}
|
|
6
|
+
interface ResolveSelectedClipOptions {
|
|
7
|
+
getSelectedClip: () => Clip | null;
|
|
8
|
+
findFallbackSelectedClip?: () => Clip | null;
|
|
9
|
+
}
|
|
10
|
+
interface EmitSelectedClipChangeOptions {
|
|
11
|
+
lastSelectedClipId: string | null;
|
|
12
|
+
resolveSelectedClip: () => SelectedClipSnapshot;
|
|
13
|
+
emitSelectedClipChange: (payload: SelectedClipSnapshot) => void;
|
|
14
|
+
}
|
|
15
|
+
export declare function resolveSelectedClipSnapshot(options: ResolveSelectedClipOptions): SelectedClipSnapshot;
|
|
16
|
+
export declare function emitSelectedClipChangeIfNeeded(options: EmitSelectedClipChangeOptions): string | null;
|
|
17
|
+
export {};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { Theme, Track } from '../models';
|
|
2
|
+
interface InitTrackInfoPanelOptions {
|
|
3
|
+
container: HTMLElement;
|
|
4
|
+
theme?: Theme;
|
|
5
|
+
timeScaleHeight?: number;
|
|
6
|
+
includeTimeScaleSpacer?: boolean;
|
|
7
|
+
onRenameTrack: (trackId: string, newName: string) => void;
|
|
8
|
+
onRemoveTrack: (trackId: string) => void;
|
|
9
|
+
onMuteTrack: (trackId: string, isMuted: boolean) => void;
|
|
10
|
+
}
|
|
11
|
+
export declare class TimelineTrackInfoPanelController {
|
|
12
|
+
private panel;
|
|
13
|
+
init(options: InitTrackInfoPanelOptions): void;
|
|
14
|
+
hasPanel(): boolean;
|
|
15
|
+
update(tracks: Track[]): void;
|
|
16
|
+
setScrollTop(scrollTop: number): void;
|
|
17
|
+
destroy(): void;
|
|
18
|
+
}
|
|
19
|
+
export {};
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import type { MoveClipToTrackCommandResult, RemoveClipCommandResult, TrackPlacementCommandResult } from '../commands/timelineCommands';
|
|
2
|
+
import type { Clip, TrackType } from '../models/types';
|
|
3
|
+
import type { TimelineTrackCollection } from '../tracks/timelineTrackCollection';
|
|
4
|
+
interface CreateTrackHandler {
|
|
5
|
+
(type: TrackType, name?: string): string;
|
|
6
|
+
}
|
|
7
|
+
interface ApplyClipPlacementOptions {
|
|
8
|
+
clip: Clip;
|
|
9
|
+
placement: TrackPlacementCommandResult;
|
|
10
|
+
trackCollection: TimelineTrackCollection;
|
|
11
|
+
createTrack: CreateTrackHandler;
|
|
12
|
+
}
|
|
13
|
+
interface ApplyPreparedClipMoveOptions {
|
|
14
|
+
command: Extract<MoveClipToTrackCommandResult, {
|
|
15
|
+
status: 'ready';
|
|
16
|
+
}>;
|
|
17
|
+
trackCollection: TimelineTrackCollection;
|
|
18
|
+
}
|
|
19
|
+
interface ApplyClipMoveToNewTrackOptions {
|
|
20
|
+
clip: Clip;
|
|
21
|
+
currentTrackId: string;
|
|
22
|
+
trackType: TrackType;
|
|
23
|
+
trackName?: string;
|
|
24
|
+
trackCollection: TimelineTrackCollection;
|
|
25
|
+
createTrack: CreateTrackHandler;
|
|
26
|
+
}
|
|
27
|
+
interface ClipMutationSideEffectHandlers {
|
|
28
|
+
checkTrackDurationChange?: () => void;
|
|
29
|
+
updateCanPlayState?: () => void;
|
|
30
|
+
updateTrackInfoPanel?: () => void;
|
|
31
|
+
handleClipChange?: () => void;
|
|
32
|
+
}
|
|
33
|
+
interface ClipMoveSideEffectHandlers {
|
|
34
|
+
notifySelectionChange: () => void;
|
|
35
|
+
updateTrackInfoPanel: () => void;
|
|
36
|
+
syncPreviewSession: () => void;
|
|
37
|
+
cleanupEmptyTracks?: () => void;
|
|
38
|
+
batchDraw?: () => void;
|
|
39
|
+
}
|
|
40
|
+
export declare function applyClipPlacement(options: ApplyClipPlacementOptions): boolean;
|
|
41
|
+
export declare function applyClipRemoval(trackCollection: TimelineTrackCollection, command: RemoveClipCommandResult, clipId: string): boolean;
|
|
42
|
+
export declare function applyPreparedClipMove(options: ApplyPreparedClipMoveOptions): boolean;
|
|
43
|
+
export declare function applyClipMoveToNewTrack(options: ApplyClipMoveToNewTrackOptions): boolean;
|
|
44
|
+
export declare function applyClipMutationSideEffects(handlers: ClipMutationSideEffectHandlers): void;
|
|
45
|
+
export declare function applyClipMoveSideEffects(handlers: ClipMoveSideEffectHandlers): void;
|
|
46
|
+
export {};
|