@linker-design-plus/timeline-track 2.0.21 → 2.0.23

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.
@@ -13,6 +13,17 @@ export interface ClipConfigPanelTheme {
13
13
  buttonActiveBorder: string;
14
14
  buttonActiveText: string;
15
15
  }
16
+ export type ClipConfigPanelGroupKind = 'video' | 'audio' | 'text' | 'mixed' | 'empty';
17
+ export interface ClipConfigPanelSelectionState {
18
+ primaryClip: Clip | null;
19
+ selectedClips: Clip[];
20
+ selectionCount: number;
21
+ groupKind: ClipConfigPanelGroupKind;
22
+ supportsVoiceBatch: boolean;
23
+ supportsTextContentBatch: boolean;
24
+ supportsVisualBatch: boolean;
25
+ supportsVolumeBatch: boolean;
26
+ }
16
27
  export declare const defaultDarkTheme: ClipConfigPanelTheme;
17
28
  export interface ClipConfigPanelConfig {
18
29
  container: HTMLElement;
@@ -75,6 +86,7 @@ export declare class ClipConfigPanel {
75
86
  private readonly onGenerateVoice?;
76
87
  private readonly voiceCatalog;
77
88
  private currentClip;
89
+ private selectionState;
78
90
  private activeTab;
79
91
  private readonly iconCache;
80
92
  private pendingPreferredTab;
@@ -91,13 +103,15 @@ export declare class ClipConfigPanel {
91
103
  private previewingVoiceId;
92
104
  constructor(config: ClipConfigPanelConfig);
93
105
  setClip(clip: Clip | null): void;
106
+ setSelectionState(selectionState: ClipConfigPanelSelectionState): void;
94
107
  setPreferredTab(tab: 'voice' | null): void;
95
108
  setVoiceGenerationBusy(isBusy: boolean): void;
96
109
  destroy(): void;
97
110
  private render;
98
111
  private getAvailableTabs;
112
+ private getEmptyStateMessage;
99
113
  private resetVoiceState;
100
- private syncVoiceStateForClip;
114
+ private syncVoiceStateForSelection;
101
115
  private syncActiveTab;
102
116
  private supportsVoicePanel;
103
117
  private ensureVoiceFilters;
@@ -1,7 +1,7 @@
1
1
  import { type TemplateResult } from 'lit';
2
2
  import { type Clip, type VoiceOption } from '../../core/models';
3
3
  import { LitDomRenderer } from '../../core/renderers/domRenderer';
4
- import type { ClipConfigPanelTheme } from './ClipConfigPanel';
4
+ import type { ClipConfigPanelSelectionState, ClipConfigPanelTheme } from './ClipConfigPanel';
5
5
  export type ClipConfigPanelTabKey = 'visual' | 'audio' | 'text' | 'voice';
6
6
  export interface ClipConfigPanelCallbacks {
7
7
  onTabChange: (tab: ClipConfigPanelTabKey) => void;
@@ -18,9 +18,12 @@ export interface ClipConfigPanelCallbacks {
18
18
  }
19
19
  export interface ClipConfigPanelViewModel {
20
20
  clip: Clip | null;
21
+ selectionState: ClipConfigPanelSelectionState;
21
22
  activeTab: ClipConfigPanelTabKey;
23
+ availableTabs: ClipConfigPanelTabKey[];
22
24
  theme: ClipConfigPanelTheme;
23
- emptyStateIconSvg: string;
25
+ emptyStateMessage: string | null;
26
+ isTextContentEditable: boolean;
24
27
  loadingIconSvg: string;
25
28
  selectedIconSvg: string;
26
29
  textDraftContent: string;
@@ -107,7 +110,6 @@ export declare class ClipConfigPanelRenderer extends LitDomRenderer<ClipConfigPa
107
110
  private renderLabeledNumberInput;
108
111
  private getContainerStyle;
109
112
  private getSliderStyle;
110
- private getAvailableTabs;
111
113
  private supportsVoicePanel;
112
114
  private getTransform;
113
115
  private calculatePresetPosition;
@@ -133,7 +133,7 @@ export declare class Track {
133
133
  private buildPreviewClip;
134
134
  private constrainResizePreviewToTrackBounds;
135
135
  private getResizeLeftBoundaryStart;
136
- private getResizeRightBoundaryEnd;
136
+ private computeResizeRightPushFollowers;
137
137
  private buildResizeLeftPreviewClip;
138
138
  private buildResizeRightPreviewClip;
139
139
  private applyClipSnap;
@@ -3,6 +3,7 @@ export interface TimelineClipConfigControllerConfig {
3
3
  container: HTMLElement;
4
4
  theme: Theme;
5
5
  getPrimarySelectedClip: () => Clip | null;
6
+ getSelectedClips: () => Clip[];
6
7
  voiceCatalog: VoiceOption[];
7
8
  updateClip: (clipId: string, updates: Partial<Clip>) => void;
8
9
  onGenerateVoice?: (clip: Clip, voice: VoiceOption, followTextUpdates: boolean) => Promise<void>;
@@ -10,6 +11,7 @@ export interface TimelineClipConfigControllerConfig {
10
11
  export declare class TimelineClipConfigController {
11
12
  private panel;
12
13
  private config;
14
+ private currentSelectionState;
13
15
  private isInternalUpdate;
14
16
  init(config: TimelineClipConfigControllerConfig): void;
15
17
  update(): void;
@@ -17,5 +19,7 @@ export declare class TimelineClipConfigController {
17
19
  destroy(): void;
18
20
  setPreferredTab(tab: 'voice' | null): void;
19
21
  setVoiceGenerationBusy(isBusy: boolean): void;
22
+ private buildSelectionState;
23
+ private resolveUpdateTargets;
20
24
  private convertTheme;
21
25
  }
@@ -81,6 +81,9 @@ export declare class TimelineManager {
81
81
  private lastSteadyPlaybackPreviewSyncAt;
82
82
  private previewSyncInteractionMode;
83
83
  private readonly resourceCacheManager;
84
+ private voiceLinkedTextRegenerationTimer;
85
+ private pendingVoiceLinkedTextRegeneration;
86
+ private historyRecordingSuppressionDepth;
84
87
  constructor(config?: Partial<TimelineConfig>);
85
88
  private createPlaybackAttemptId;
86
89
  private refreshPlaybackAttempt;
@@ -120,6 +123,9 @@ export declare class TimelineManager {
120
123
  private getDefaultTrackForHistory;
121
124
  private getTimelineHistoryRecorder;
122
125
  private getTimelineHistoryExecutor;
126
+ private withHistoryBoundary;
127
+ private shouldSkipHistoryRecording;
128
+ private withHistoryTransaction;
123
129
  private get selectedClipId();
124
130
  private set selectedClipId(value);
125
131
  private ensureConfigState;
@@ -214,6 +220,8 @@ export declare class TimelineManager {
214
220
  private animate;
215
221
  private syncPlaybackClockToPreviewBuffering;
216
222
  private clearPreviewBufferingSuspendTimeout;
223
+ /** 播放头不得超过全部片段的最大 endTime(与 canPlay / 播放结束对齐);无片段时不设上限(由别处处理空轨道) */
224
+ private clampPlaybackSeekTime;
217
225
  setCurrentTime(time: TimeMs): void;
218
226
  getCurrentTime(): TimeMs;
219
227
  setEnableClipSnap(enabled: boolean): void;
@@ -339,6 +347,9 @@ export declare class TimelineManager {
339
347
  private buildGeneratedAudioClipName;
340
348
  private normalizeGeneratedAudioDuration;
341
349
  private getVoiceLinkedAudioClips;
350
+ private hasVoiceLinkedAudioClipsToRegenerate;
351
+ private scheduleVoiceLinkedTextRegeneration;
352
+ private flushPendingVoiceLinkedTextRegeneration;
342
353
  private applyGeneratedAudioClipResult;
343
354
  private syncTextClipDurationToAudio;
344
355
  private doesClipOverlapOnTrack;
@@ -348,6 +359,7 @@ export declare class TimelineManager {
348
359
  private relocateClipToAvoidOverlap;
349
360
  private buildClipboardPasteGroups;
350
361
  private createTracksForTypeBoundary;
362
+ private selectBestClipboardPasteStartIndex;
351
363
  private buildClipboardPasteGroupPlacementClips;
352
364
  private ensureClipboardPasteSourceTracks;
353
365
  private resolveClipboardPasteTypeGroupAssignments;
@@ -356,6 +368,7 @@ export declare class TimelineManager {
356
368
  private relocateClipIfNeeded;
357
369
  private regenerateVoiceLinkedAudioClips;
358
370
  private getSelectedTextClipsForVoiceGeneration;
371
+ private getSelectedTtsAudioClipsForVoiceGeneration;
359
372
  private handleVoiceGenerateAction;
360
373
  private primeOrLoadClipThumbnails;
361
374
  private markClipThumbnailLoadCompleted;
@@ -537,6 +550,14 @@ export declare class TimelineManager {
537
550
  private haveSameClipIds;
538
551
  private restoreDraggedClipSnapshot;
539
552
  private syncMultiDragPeerClips;
553
+ private createMultiDragPlacementContext;
554
+ private doesMultiDragPlacementOverlap;
555
+ private reserveMultiDragPlacement;
556
+ private registerMultiDragPlacementTrack;
557
+ private findNearestAvailableTrackForMultiDragPlacement;
558
+ private resolveMultiDragOverlapTargetTrackId;
559
+ private commitMultiDragPlacements;
560
+ private finalizeMultiDragSameTrack;
540
561
  private previewMultiDragCrossTrack;
541
562
  private finalizeMultiDragCrossTrack;
542
563
  private resolveTrackIndexDelta;
@@ -549,7 +570,6 @@ export declare class TimelineManager {
549
570
  private ensureTrackIdByRelativeIndex;
550
571
  private findTrackIdByRelativeIndex;
551
572
  private getTrackIdsByType;
552
- private updateClipPositionWithHistory;
553
573
  private updateClipPositionSilently;
554
574
  private ensureSelectionBoxRect;
555
575
  private showSelectionBoxRect;
@@ -2,6 +2,7 @@ import { HistoryManager } from '../history/history';
2
2
  import type { Action, Clip, ClipStateUpdate, Track, TrackRestoreAnchor } from '../models/types';
3
3
  export declare class TimelineHistoryRecorder {
4
4
  private readonly history;
5
+ private readonly transactionStack;
5
6
  constructor(history: HistoryManager);
6
7
  createAddClipAction(clip: Clip): Action;
7
8
  recordAddClip(clip: Clip): Action;
@@ -16,5 +17,10 @@ export declare class TimelineHistoryRecorder {
16
17
  createSeparateClipAudioAction(videoClipBefore: Clip, videoClipAfter: Clip, audioClip: Clip | null, audioTrackId: string | null): Action;
17
18
  createRestoreClipAudioAction(videoClipBefore: Clip, videoClipAfter: Clip, audioClip: Clip | null, audioTrackId: string | null): Action;
18
19
  recordCompoundAction(actions: Action[], label?: string): Action | null;
19
- private createClipUpdateAction;
20
+ createClipUpdateAction(clip: Clip, originalClip?: Clip, clipUpdates?: ClipStateUpdate[]): Action | null;
21
+ withTransaction<T>(label: string | undefined, callback: () => T): T;
22
+ withTransaction<T>(label: string | undefined, callback: () => Promise<T>): Promise<T>;
23
+ recordAction(action: Action): Action;
24
+ private finalizeTransaction;
25
+ private normalizeTransactionActions;
20
26
  }
@@ -1,6 +1,6 @@
1
1
  import type { Theme } from '../models/types';
2
2
  import { type TimelineManagerLayoutElements } from './TimelineManagerLayoutRenderer';
3
- export declare const TIMELINE_MANAGER_LEFT_PANEL_WIDTH = 200;
3
+ export declare const TIMELINE_MANAGER_LEFT_PANEL_WIDTH = 80;
4
4
  export declare const TIMELINE_MANAGER_SCROLLBAR_SIZE = 8;
5
5
  export type { TimelineManagerLayoutElements };
6
6
  export interface CreateTimelineManagerLayoutOptions {