@linker-design-plus/timeline-track 2.0.20 → 2.0.21
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 +3 -3
- package/dist/components/track/Track.d.ts +0 -33
- package/dist/core/controllers/previewBackend.d.ts +2 -0
- package/dist/core/controllers/previewTransformOverlay.d.ts +11 -0
- package/dist/core/controllers/timelinePreviewSession.d.ts +4 -0
- package/dist/core/facade/timelineManager.d.ts +2 -1
- package/dist/index.cjs.js +112 -70
- package/dist/index.d.ts +0 -2
- package/dist/index.es.js +3018 -3366
- package/dist/utils/rendering/KonvaUtils.d.ts +0 -4
- package/package.json +1 -1
- package/dist/components/timeline/Playhead.d.ts +0 -27
- package/dist/components/timeline/Timeline.d.ts +0 -91
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# @linker-design-plus/timeline-track
|
|
2
2
|
|
|
3
|
-
基于 TypeScript、Konva 和 Vue demo 的时间线编辑组件库,对外以 `TimelineManager`
|
|
3
|
+
基于 TypeScript、Konva 和 Vue demo 的时间线编辑组件库,对外以 `TimelineManager` 为统一入口,提供多轨片段编辑、拖拽/拉伸/分割、撤销重做、选中态同步、封面渲染和预览挂载能力。时间轴主体仍由 Konva 驱动,播放指针使用独立的 SVG/DOM 覆盖层渲染。
|
|
4
4
|
|
|
5
5
|
## 当前状态
|
|
6
6
|
|
|
@@ -188,7 +188,7 @@ flowchart TB
|
|
|
188
188
|
FACADE --> TRACKS["Tracks\nTrackManager / Bridge / Collection"]
|
|
189
189
|
FACADE --> PRESENTATION["Presentation\nTimelinePresentationAdapter"]
|
|
190
190
|
FACADE --> PREVIEW["Preview\nDomPreviewBackend"]
|
|
191
|
-
FACADE --> COMPONENTS["
|
|
191
|
+
FACADE --> COMPONENTS["Presentation Views\nTimeline / Track / Clip / Panels / ManagedPlayhead"]
|
|
192
192
|
```
|
|
193
193
|
|
|
194
194
|
当前最值得关注的热点:
|
|
@@ -202,7 +202,7 @@ flowchart TB
|
|
|
202
202
|
|
|
203
203
|
```text
|
|
204
204
|
src/
|
|
205
|
-
components/
|
|
205
|
+
components/ 时间轴视图、SVG/DOM 覆盖层与交互 helper
|
|
206
206
|
core/ stores / commands / controllers / facade / models
|
|
207
207
|
utils/ 渲染、时间和日志工具
|
|
208
208
|
styles/ 样式入口
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import Konva from 'konva';
|
|
2
2
|
import { Clip as ClipType, ClipStateUpdate, TrackConfig, TimeMs, Theme, TrackType } from '../../core/models';
|
|
3
|
-
import { type TrackPointerOperation } from './trackInteractionState';
|
|
4
3
|
import type { MultiDragMoveRequest } from '../../core/tracks/timelineTrackBridge';
|
|
5
4
|
export declare class Track {
|
|
6
5
|
private static readonly DEFAULT_DRAG_ACTIVATION_THRESHOLD;
|
|
@@ -28,7 +27,6 @@ export declare class Track {
|
|
|
28
27
|
private multiDragOriginalPositions;
|
|
29
28
|
private promotedClipParents;
|
|
30
29
|
private interactionState;
|
|
31
|
-
private legacyInteractionSnapshot?;
|
|
32
30
|
private isVisualUpdate;
|
|
33
31
|
private onClipUpdate;
|
|
34
32
|
private onClipAdd;
|
|
@@ -58,37 +56,8 @@ export declare class Track {
|
|
|
58
56
|
private handleGlobalPointerMove;
|
|
59
57
|
private handleGlobalPointerEnd;
|
|
60
58
|
private handleWindowBlur;
|
|
61
|
-
get hasDragMoved(): boolean;
|
|
62
|
-
set hasDragMoved(value: boolean);
|
|
63
|
-
get activePointerOperation(): TrackPointerOperation | null;
|
|
64
|
-
set activePointerOperation(value: TrackPointerOperation | null);
|
|
65
|
-
get originalClipsState(): ClipType[];
|
|
66
|
-
set originalClipsState(value: ClipType[]);
|
|
67
|
-
get nonDraggedClips(): ClipType[];
|
|
68
|
-
set nonDraggedClips(value: ClipType[]);
|
|
69
|
-
get snapCandidateClips(): ClipType[];
|
|
70
|
-
set snapCandidateClips(value: ClipType[]);
|
|
71
|
-
get dragStartY(): number;
|
|
72
|
-
set dragStartY(value: number);
|
|
73
|
-
get dragTargetTrackY(): number;
|
|
74
|
-
set dragTargetTrackY(value: number);
|
|
75
|
-
get crossTrackDragOffsetY(): number;
|
|
76
|
-
set crossTrackDragOffsetY(value: number);
|
|
77
|
-
get crossTrackDragStartX(): number;
|
|
78
|
-
set crossTrackDragStartX(value: number);
|
|
79
|
-
get dragStartScrollLeft(): number;
|
|
80
|
-
set dragStartScrollLeft(value: number);
|
|
81
|
-
get dragGestureStartClientX(): number | null;
|
|
82
|
-
set dragGestureStartClientX(value: number | null);
|
|
83
|
-
get dragGestureStartClientY(): number | null;
|
|
84
|
-
set dragGestureStartClientY(value: number | null);
|
|
85
|
-
get lastDragClientX(): number | null;
|
|
86
|
-
set lastDragClientX(value: number | null);
|
|
87
|
-
get lastDragClientY(): number | null;
|
|
88
|
-
set lastDragClientY(value: number | null);
|
|
89
59
|
constructor(layer: Konva.Layer, config: TrackConfig, trackType: TrackType, zoom: number, trackY: number, trackHeight: number, theme: Theme, onClipUpdate: (clip: ClipType, originalClip?: ClipType, clipUpdates?: ClipStateUpdate[]) => void, onClipAdd: (clip: ClipType) => void, onClipRemove: (clipId: string) => void, onClipSplit: (clip1: ClipType, clip2: ClipType) => void, onClipSelect: (clip: ClipType) => void, onTimeJump: (time: TimeMs) => void, onHorizontalDragAutoScroll?: (nextScrollLeft: number) => number, onClipOverlap?: (clip: ClipType, currentTrackId: string, originalClip?: ClipType | null) => void, onClipCrossTrackPreview?: (clip: ClipType, targetTrackY: number, currentTrackId: string) => 'self' | 'external' | 'clear', onClipCrossTrack?: (clip: ClipType, originalClip: ClipType | null, targetTrackY: number, currentTrackId: string) => boolean | void, onClearDropPreview?: () => void, onClearSelection?: () => void, onSnapGuideChange?: (guideTime: TimeMs | null) => void, onClipToggleSelection?: (clipId: string) => void, onSetSingleSelection?: (clipId: string) => void, getMultiDragClipIds?: (clipId: string) => string[] | null, onMultiDragMove?: (request: MultiDragMoveRequest) => boolean | void, onMultiDragInteractionEnd?: () => void, dragActivationThreshold?: number, enableClipSnap?: boolean, clipSnapThreshold?: number);
|
|
90
60
|
private initClips;
|
|
91
|
-
private getLegacyInteractionSnapshot;
|
|
92
61
|
private ensureDropPreviewGroup;
|
|
93
62
|
private createDropPreviewRect;
|
|
94
63
|
private showDropPreview;
|
|
@@ -113,8 +82,6 @@ export declare class Track {
|
|
|
113
82
|
private finishPointerInteraction;
|
|
114
83
|
private resolveDraggedClipForInteraction;
|
|
115
84
|
private applyInteractionTransition;
|
|
116
|
-
private resolveInteractionState;
|
|
117
|
-
private syncLegacyInteractionMirror;
|
|
118
85
|
private handleClipMoveEnd;
|
|
119
86
|
private updateAllClips;
|
|
120
87
|
private buildAndSendUpdates;
|
|
@@ -22,6 +22,8 @@ export interface TimelinePreviewBackendCallbacks {
|
|
|
22
22
|
onAspectRatioChange?: (aspectRatio: PreviewAspectRatio) => void;
|
|
23
23
|
onPreviewClipSelect?: (clipId: string) => void;
|
|
24
24
|
onVisualTransformCommit?: (clipId: string, visualTransform: ClipVisualTransform) => void;
|
|
25
|
+
onTextFontSizeCommit?: (clipId: string, fontSize: number) => void;
|
|
26
|
+
onTextRotationCommit?: (clipId: string, rotation: number) => void;
|
|
25
27
|
onPendingPreviewRetry?: () => void;
|
|
26
28
|
onRuntimeError?: (error: unknown) => void;
|
|
27
29
|
}
|
|
@@ -6,15 +6,24 @@ export interface PreviewTransformOverlayState {
|
|
|
6
6
|
frameSize: PreviewFrameSize;
|
|
7
7
|
baseRect: PreviewRect;
|
|
8
8
|
displayRect: PreviewRect;
|
|
9
|
+
clipType?: 'text' | 'video';
|
|
10
|
+
currentFontSize?: number;
|
|
11
|
+
currentRotation?: number;
|
|
9
12
|
}
|
|
10
13
|
interface PreviewTransformOverlayCallbacks {
|
|
11
14
|
onPreviewTransformChange?: (clipId: string, transform: ClipVisualTransform | null) => void;
|
|
12
15
|
onPreviewTransformCommit?: (clipId: string, transform: ClipVisualTransform) => void;
|
|
16
|
+
onFontSizeChange?: (clipId: string, fontSize: number | null) => void;
|
|
17
|
+
onFontSizeCommit?: (clipId: string, fontSize: number) => void;
|
|
18
|
+
onRotationChange?: (clipId: string, rotation: number | null) => void;
|
|
19
|
+
onRotationCommit?: (clipId: string, rotation: number) => void;
|
|
13
20
|
}
|
|
14
21
|
export declare class PreviewTransformOverlay {
|
|
15
22
|
private frameElement;
|
|
16
23
|
private overlayElement;
|
|
17
24
|
private boxElement;
|
|
25
|
+
private rotateHandleElement;
|
|
26
|
+
private rotateHandlePointerDownHandler;
|
|
18
27
|
private readonly handleElements;
|
|
19
28
|
private readonly handlePointerDownHandlers;
|
|
20
29
|
private state;
|
|
@@ -28,6 +37,8 @@ export declare class PreviewTransformOverlay {
|
|
|
28
37
|
attach(frameElement: HTMLElement): void;
|
|
29
38
|
detach(): void;
|
|
30
39
|
sync(state: PreviewTransformOverlayState | null): void;
|
|
40
|
+
private createRotateHandle;
|
|
41
|
+
private getRotateHandlePointerDown;
|
|
31
42
|
private createHandle;
|
|
32
43
|
private readonly handleMovePointerDown;
|
|
33
44
|
private getHandlePointerDown;
|
|
@@ -11,6 +11,8 @@ interface TimelinePreviewSessionCallbacks {
|
|
|
11
11
|
onAspectRatioChange?: (aspectRatio: PreviewAspectRatio) => void;
|
|
12
12
|
onPreviewClipSelect?: (clipId: string) => void;
|
|
13
13
|
onVisualTransformCommit?: (clipId: string, visualTransform: ClipVisualTransform) => void;
|
|
14
|
+
onTextFontSizeCommit?: (clipId: string, fontSize: number) => void;
|
|
15
|
+
onTextRotationCommit?: (clipId: string, rotation: number) => void;
|
|
14
16
|
onPendingPreviewRetry?: () => void;
|
|
15
17
|
}
|
|
16
18
|
interface TimelinePreviewSessionDependencies {
|
|
@@ -59,6 +61,8 @@ export declare class TimelinePreviewSession {
|
|
|
59
61
|
private lastSettledSyncRequestId;
|
|
60
62
|
private primarySelectedClipId;
|
|
61
63
|
private transientVisualTransform;
|
|
64
|
+
private transientFontSize;
|
|
65
|
+
private transientRotation;
|
|
62
66
|
private textPreviewDragState;
|
|
63
67
|
private textPreviewFontStyleElement;
|
|
64
68
|
private textPreviewFontSignature;
|
|
@@ -176,7 +176,6 @@ export declare class TimelineManager {
|
|
|
176
176
|
removeTrack(trackId: string): boolean;
|
|
177
177
|
renameTrack(trackId: string, newName: string): boolean;
|
|
178
178
|
getTracks(): any[];
|
|
179
|
-
initTrackInfoPanel(container: HTMLElement): void;
|
|
180
179
|
updateTrackInfoPanel(): void;
|
|
181
180
|
muteTrack(trackId: string, isMuted: boolean): boolean;
|
|
182
181
|
isTrackMuted(trackId: string): boolean;
|
|
@@ -575,5 +574,7 @@ export declare class TimelineManager {
|
|
|
575
574
|
private resolveSelectedClipSnapshot;
|
|
576
575
|
private resolveSelectionChangeData;
|
|
577
576
|
private commitPreviewVisualTransform;
|
|
577
|
+
private commitPreviewTextFontSize;
|
|
578
|
+
private commitPreviewTextRotation;
|
|
578
579
|
clearAllTracksAndClips(): void;
|
|
579
580
|
}
|