@linker-design-plus/timeline-track 2.0.24 → 2.1.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.
@@ -58,10 +58,10 @@ export declare class TimelineManager {
58
58
  private previewStateController?;
59
59
  private previewPlaybackSuspendedByBuffering;
60
60
  private previewPlaybackAutoResume;
61
- private previewBufferingSuspendTimeoutId;
62
61
  private lastSelectedClipId;
63
62
  private previewAspectRatio;
64
63
  private readonly bodyViewportScrollListener;
64
+ private stageMouseDownListener;
65
65
  private readonly bodyCanvasHostClickListener;
66
66
  private readonly rootWheelListener;
67
67
  private keyboardShortcutsController;
@@ -106,10 +106,7 @@ export declare class TimelineManager {
106
106
  set runtimePreviewBackendOverride(value: Exclude<PreviewBackendType, 'auto'> | null);
107
107
  get activePreviewCallbackToken(): number;
108
108
  set activePreviewCallbackToken(value: number);
109
- private get previewSourceLoadingCount();
110
- private set previewSourceLoadingCount(value);
111
- get previewBuffering(): boolean;
112
- set previewBuffering(value: boolean);
109
+ private getPreviewLoadingState;
113
110
  private get pendingPreviewState();
114
111
  private set pendingPreviewState(value);
115
112
  get nextPendingPreviewSyncRequestId(): number;
@@ -159,7 +156,8 @@ export declare class TimelineManager {
159
156
  private getTracksSortedByOrder;
160
157
  private getPlaybackTracksSnapshot;
161
158
  private buildPlaybackPlan;
162
- private hasTimelineVideoClip;
159
+ private playbackPlanHasActiveVideoClip;
160
+ private hasActiveTimelineVideoClip;
163
161
  private getPreviewAutoAspectRatioClipOrderMap;
164
162
  private getNextPreviewAutoAspectRatioOrder;
165
163
  private getAutoAspectRatioClip;
@@ -167,11 +165,18 @@ export declare class TimelineManager {
167
165
  private buildPreviewSyncSignature;
168
166
  private shouldSkipSteadyPlaybackPreviewSync;
169
167
  private syncPreviewSession;
168
+ private resolvePreviewSyncPlayState;
170
169
  private syncPreviewPlaybackStateIfNeeded;
170
+ private shouldUsePreviewClockPlayback;
171
+ private handlePreviewClockStateChange;
172
+ private isPreviewClockForCurrentActiveClip;
173
+ private shouldCommitUnavailablePreviewClock;
174
+ private commitPlaybackTimeFromPreviewClock;
175
+ private syncPreviewAfterPreviewClockCommitIfNeeded;
176
+ private resumeWallClockPlaybackIfPreviewClockUnavailable;
171
177
  private beginPendingPreview;
172
178
  updatePendingPreviewState(): void;
173
179
  private buildPreviewPendingState;
174
- private buildPreviewIndicatorState;
175
180
  private clearPendingPreviewState;
176
181
  private resetPreviewRuntimeState;
177
182
  private destroyPreviewSession;
@@ -218,8 +223,12 @@ export declare class TimelineManager {
218
223
  pause(): void;
219
224
  togglePlay(): void;
220
225
  private animate;
221
- private syncPlaybackClockToPreviewBuffering;
222
- private clearPreviewBufferingSuspendTimeout;
226
+ private cancelPlaybackAnimationFrame;
227
+ private emitPlayStateChangeEvent;
228
+ private suspendPlaybackForMediaPending;
229
+ private resumePlaybackAfterMediaPending;
230
+ private shouldSuspendPreviewPlaybackForLoadingState;
231
+ private syncPlaybackClockToPreviewLoadingState;
223
232
  /** 播放头不得超过全部片段的最大 endTime(与 canPlay / 播放结束对齐);无片段时不设上限(由别处处理空轨道) */
224
233
  private clampPlaybackSeekTime;
225
234
  setCurrentTime(time: TimeMs): void;
@@ -346,6 +355,9 @@ export declare class TimelineManager {
346
355
  private findClipById;
347
356
  private buildGeneratedAudioClipName;
348
357
  private normalizeGeneratedAudioDuration;
358
+ private resolveVoiceTextContent;
359
+ private findSourceTextClipForTtsAudio;
360
+ private resolveTtsAudioVoiceGenerationSource;
349
361
  private getVoiceLinkedAudioClips;
350
362
  private hasVoiceLinkedAudioClipsToRegenerate;
351
363
  private scheduleVoiceLinkedTextRegeneration;
@@ -37,7 +37,7 @@ export declare class HistoryManager {
37
37
  /**
38
38
  * 创建添加片段操作
39
39
  */
40
- createAddClipAction(clip: Clip): AddClipAction;
40
+ createAddClipAction(clip: Clip, targetTrackId?: string | null, targetTrackSnapshot?: Track | null, targetTrackRestoreAnchor?: TrackRestoreAnchor | null): AddClipAction;
41
41
  /**
42
42
  * 创建移除片段操作
43
43
  */
@@ -23,6 +23,7 @@ export declare class TimelineHistoryExecutor {
23
23
  private executeRedoInternal;
24
24
  private restoreMovedClip;
25
25
  private normalizeRemoveClipActionData;
26
+ private normalizeAddClipActionData;
26
27
  private resolveTrackIdForHistorySnapshot;
27
28
  private resolveRestoreAnchor;
28
29
  }
@@ -4,8 +4,8 @@ export declare class TimelineHistoryRecorder {
4
4
  private readonly history;
5
5
  private readonly transactionStack;
6
6
  constructor(history: HistoryManager);
7
- createAddClipAction(clip: Clip): Action;
8
- recordAddClip(clip: Clip): Action;
7
+ createAddClipAction(clip: Clip, targetTrackId?: string | null, targetTrackSnapshot?: Track | null, targetTrackRestoreAnchor?: TrackRestoreAnchor | null): Action;
8
+ recordAddClip(clip: Clip, targetTrackId?: string | null, targetTrackSnapshot?: Track | null, targetTrackRestoreAnchor?: TrackRestoreAnchor | null): Action;
9
9
  createRemoveClipAction(clip: Clip, sourceTrackId?: string | null, sourceTrackSnapshot?: Track | null, sourceTrackRestoreAnchor?: TrackRestoreAnchor | null): Action;
10
10
  recordRemoveClip(clip: Clip, sourceTrackId?: string | null, sourceTrackSnapshot?: Track | null, sourceTrackRestoreAnchor?: TrackRestoreAnchor | null): Action;
11
11
  recordClipUpdate(clip: Clip, originalClip?: Clip, clipUpdates?: ClipStateUpdate[]): Action | null;
@@ -9,6 +9,20 @@ export declare const ZOOM_PRESETS: {
9
9
  LARGE: number;
10
10
  MAX: number;
11
11
  };
12
+ export declare const DEFAULT_TIMELINE_DURATION_MS = 3600000;
13
+ export declare const ZOOM_GESTURE: {
14
+ SENSITIVITY_FACTOR: number;
15
+ CONVERGENCE_THRESHOLD: number;
16
+ };
17
+ export declare const DEFAULT_TEXT_CLIP_DURATION_MS = 3000;
18
+ export declare const VOICE_LINKED_TEXT_REGEN_DEBOUNCE_MS = 450;
19
+ export declare const SNAP_SCORING: {
20
+ ANCHOR_INDEX_WEIGHT: number;
21
+ };
22
+ export declare const TEXT_CLIP_FONT_SIZE_LIMITS: {
23
+ MIN: number;
24
+ MAX: number;
25
+ };
12
26
  export declare const ZOOM_ANIMATION: {
13
27
  DURATION: number;
14
28
  EASING: string;
@@ -58,6 +58,8 @@ export interface VoiceOption {
58
58
  audiofile?: string;
59
59
  source?: Record<string, unknown>;
60
60
  }
61
+ export declare function isAudioOnlyTtsClipCandidate(clip: Pick<ClipConfig, 'type' | 'textContent' | 'ttsVoiceId'> | Pick<ClipEntity, 'type' | 'textContent' | 'ttsVoiceId'> | Pick<Clip, 'type' | 'textContent' | 'ttsVoiceId'>): boolean;
62
+ export declare function isTtsAudioClip(clip: Pick<ClipConfig, 'type' | 'ttsSourceTextClipId' | 'textContent' | 'ttsVoiceId'> | Pick<ClipEntity, 'type' | 'ttsSourceTextClipId' | 'textContent' | 'ttsVoiceId'> | Pick<Clip, 'type' | 'ttsSourceTextClipId' | 'textContent' | 'ttsVoiceId'>): boolean;
61
63
  export interface GenerateVoiceRequest {
62
64
  requestId: string;
63
65
  sourceTextClipId: string;
@@ -270,9 +272,15 @@ export interface ClipStateUpdate {
270
272
  newState: Clip;
271
273
  previousState: Clip;
272
274
  }
275
+ export type AddClipActionData = Clip | {
276
+ clip: Clip;
277
+ targetTrackId: string | null;
278
+ targetTrackSnapshot: Track | null;
279
+ targetTrackRestoreAnchor: TrackRestoreAnchor | null;
280
+ };
273
281
  export interface AddClipAction {
274
282
  type: 'add_clip';
275
- data: Clip;
283
+ data: AddClipActionData;
276
284
  timestamp: number;
277
285
  }
278
286
  export interface RemoveClipAction {
@@ -404,7 +412,7 @@ export interface HistoryState {
404
412
  past: Action[];
405
413
  future: Action[];
406
414
  }
407
- export type TimelineEvent = 'time_change' | 'play_state_change' | 'clip_added' | 'clip_removed' | 'clip_updated' | 'zoom_change' | 'history_change' | 'track_duration_change' | 'clip_selected' | 'selected_clip_change' | 'speed_change' | 'can_play_change' | 'buffering_state_change' | 'source_loading_change' | 'preview_aspect_ratio_change' | 'draft_loaded' | 'selection_change';
415
+ export type TimelineEvent = 'time_change' | 'play_state_change' | 'clip_added' | 'clip_removed' | 'clip_updated' | 'zoom_change' | 'history_change' | 'track_duration_change' | 'clip_selected' | 'selected_clip_change' | 'speed_change' | 'can_play_change' | 'loading_state_change' | 'preview_aspect_ratio_change' | 'draft_loaded' | 'selection_change';
408
416
  export interface TimeChangeData {
409
417
  time: TimeMs;
410
418
  }
@@ -437,12 +445,12 @@ export interface ClipRemovedEventData {
437
445
  export interface CanPlayChangeData {
438
446
  canPlay: boolean;
439
447
  }
440
- export interface BufferingStateChangeData {
441
- isBuffering: boolean;
442
- }
443
- export interface SourceLoadingChangeData {
448
+ export type LoadingStateStatus = 'idle' | 'loading' | 'ready' | 'failed';
449
+ export type LoadingStateReason = 'syncing' | 'resolving-source' | 'seeking' | 'media-pending' | 'failed' | null;
450
+ export interface LoadingStateChangeData {
451
+ status: LoadingStateStatus;
444
452
  isLoading: boolean;
445
- pending: number;
453
+ reason: LoadingStateReason;
446
454
  }
447
455
  export interface PreviewAspectRatioChangeData {
448
456
  aspectRatio: PreviewAspectRatio;