@linker-design-plus/timeline-track 1.0.5 → 1.0.7

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.
@@ -4,6 +4,7 @@ export declare class Clip {
4
4
  private onUpdate;
5
5
  private onSplit;
6
6
  private isMoving;
7
+ private isMovingVisualApplied;
7
8
  private dragStartPos;
8
9
  private originalStart;
9
10
  private originalDuration;
@@ -14,6 +14,11 @@ export declare class Timeline {
14
14
  private onScrollChange;
15
15
  private animationFrameId;
16
16
  private isZooming;
17
+ private scrollbarHeight;
18
+ private scrollbarY;
19
+ private isScrollbarDragging;
20
+ private scrollbarDragStartX;
21
+ private scrollbarDragStartScrollLeft;
17
22
  private leftPadding;
18
23
  constructor(stage: Konva.Stage, gridLayer: Konva.Layer, config: Partial<TimelineConfig>, onTimeChange: (time: TimeMs) => void, onZoomChange: (zoom: number) => void, onScrollChange: (scrollLeft: number) => void);
19
24
  private initEventListeners;
@@ -30,6 +35,10 @@ export declare class Timeline {
30
35
  setPlayState(playState: 'playing' | 'paused'): void;
31
36
  update(): void;
32
37
  private render;
38
+ /**
39
+ * 绘制滚动条
40
+ */
41
+ private renderScrollbar;
33
42
  private renderTimeTicks;
34
43
  getConfig(): TimelineConfig;
35
44
  getScrollLeft(): number;
@@ -19,6 +19,7 @@ export declare class TimelineManager {
19
19
  private isExecutingHistoryAction;
20
20
  private lastTrackDuration;
21
21
  private thumbnailProvider;
22
+ private canPlay;
22
23
  constructor(config?: Partial<TimelineConfig>);
23
24
  init(container: HTMLElement): void;
24
25
  play(): void;
@@ -39,6 +40,11 @@ export declare class TimelineManager {
39
40
  * @returns 当前播放倍速
40
41
  */
41
42
  getSpeed(): number;
43
+ /**
44
+ * 获取当前是否可以播放
45
+ * @returns 是否可以播放
46
+ */
47
+ getCanPlay(): boolean;
42
48
  /**
43
49
  * 设置缩略图提供器
44
50
  * @param provider 缩略图提供器
@@ -89,6 +95,16 @@ export declare class TimelineManager {
89
95
  private handleClipUpdate;
90
96
  private handleClipAdd;
91
97
  private handleClipRemove;
98
+ /**
99
+ * 检查并重新加载关键帧(如果需要)
100
+ * @param clip 更新后的片段
101
+ * @param originalClip 原始片段
102
+ */
103
+ private reloadClipThumbnailsIfNeeded;
104
+ /**
105
+ * 更新 canPlay 状态
106
+ */
107
+ private updateCanPlayState;
92
108
  private handleClipSplit;
93
109
  private handleClipSelect;
94
110
  private handleActionUndo;
@@ -76,6 +76,10 @@ export interface Theme {
76
76
  clipSelectedCoverBackground: string;
77
77
  playhead: string;
78
78
  grid: string;
79
+ scrollbarBackground?: string;
80
+ scrollbarBorder?: string;
81
+ scrollbarThumb?: string;
82
+ scrollbarThumbBorder?: string;
79
83
  }
80
84
  export declare const defaultDarkTheme: Theme;
81
85
  export interface TimelineConfig {
@@ -119,7 +123,7 @@ export interface HistoryState {
119
123
  past: Action[];
120
124
  future: Action[];
121
125
  }
122
- export type TimelineEvent = 'time_change' | 'play_state_change' | 'clip_added' | 'clip_removed' | 'clip_updated' | 'zoom_change' | 'history_change' | 'track_duration_change' | 'clip_selected' | 'speed_change';
126
+ export type TimelineEvent = 'time_change' | 'play_state_change' | 'clip_added' | 'clip_removed' | 'clip_updated' | 'zoom_change' | 'history_change' | 'track_duration_change' | 'clip_selected' | 'speed_change' | 'can_play_change';
123
127
  export interface TimeChangeData {
124
128
  time: TimeMs;
125
129
  }
@@ -135,6 +139,9 @@ export interface ClipEventData {
135
139
  export interface ClipRemovedEventData {
136
140
  clipId: string;
137
141
  }
142
+ export interface CanPlayChangeData {
143
+ canPlay: boolean;
144
+ }
138
145
  export interface EventListener {
139
146
  (event: TimelineEvent, data?: any): void;
140
147
  }