@linker-design-plus/timeline-track 1.0.8 → 1.0.9
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 +1 -0
- package/dist/components/Timeline.d.ts +0 -1
- package/dist/core/constants.d.ts +1 -0
- package/dist/core/timelineManager.d.ts +36 -3
- package/dist/core/types.d.ts +8 -1
- package/dist/index.cjs.js +3 -3
- package/dist/index.es.js +1969 -1824
- package/dist/utils/KonvaUtils.d.ts +12 -4
- package/package.json +1 -1
|
@@ -4,7 +4,9 @@ import type { Theme } from '../core/types';
|
|
|
4
4
|
* Konva工具类,封装常用的Konva操作
|
|
5
5
|
*/
|
|
6
6
|
export declare class KonvaUtils {
|
|
7
|
-
static readonly RESIZE_AREA_WIDTH =
|
|
7
|
+
static readonly RESIZE_AREA_WIDTH = 3;
|
|
8
|
+
/** 单张封面图的最小展示宽度(px),zoom 过小时通过减少显示段数保证每段不低于此宽度,且仍填满整条 */
|
|
9
|
+
static readonly MIN_IMAGE_DISPLAY_WIDTH = 24;
|
|
8
10
|
private static keyframeDimensionsCache;
|
|
9
11
|
private static imageCache;
|
|
10
12
|
private static readonly MAX_CACHE_SIZE;
|
|
@@ -56,8 +58,8 @@ export declare class KonvaUtils {
|
|
|
56
58
|
*/
|
|
57
59
|
static formatDuration(ms: number): string;
|
|
58
60
|
/**
|
|
59
|
-
*
|
|
60
|
-
* @param videoSrc 视频源的URL
|
|
61
|
+
* 获取关键帧的尺寸信息(按 keyframeUrl 缓存,保证每张缩略图使用自身真实比例)
|
|
62
|
+
* @param videoSrc 视频源的URL(用于兼容旧调用)
|
|
61
63
|
* @param keyframeUrl 关键帧图片的URL
|
|
62
64
|
* @returns Promise<{ width: number; height: number }> 关键帧的宽度和高度
|
|
63
65
|
*/
|
|
@@ -70,6 +72,7 @@ export declare class KonvaUtils {
|
|
|
70
72
|
private static getCachedImage;
|
|
71
73
|
/**
|
|
72
74
|
* 检查并清理缓存,防止内存占用过大
|
|
75
|
+
* 优先驱逐未加载完成的图片,已加载的图片尽量保留,避免滚动时重复请求
|
|
73
76
|
*/
|
|
74
77
|
private static checkAndTrimCache;
|
|
75
78
|
/**
|
|
@@ -92,8 +95,13 @@ export declare class KonvaUtils {
|
|
|
92
95
|
* 时间到像素的转换
|
|
93
96
|
*/
|
|
94
97
|
static timeToPixels(time: number, zoom: number): number;
|
|
98
|
+
private static readonly COVER_RENDER_VERSION_KEY;
|
|
95
99
|
/**
|
|
96
|
-
*
|
|
100
|
+
* 渲染关键帧封面(统一放大/缩小逻辑,始终填满无空轴)
|
|
101
|
+
* - 将 coverWidth 等分为若干段,每段对应一张缩略图(时间对应)。
|
|
102
|
+
* - 放大:段数 = N,段宽可能很大 → 用同一张图重复平铺填满该段。
|
|
103
|
+
* - 缩小:段数减少以保证每段宽度 ≥ MIN_IMAGE_DISPLAY_WIDTH,从 N 张中均匀抽样;每段仍用一张图缩放或重复填满。
|
|
104
|
+
* - 使用版本号避免 zoom 快速变化时,旧渲染覆盖新渲染导致空轴。
|
|
97
105
|
*/
|
|
98
106
|
static renderClipCovers(coversGroup: Konva.Group, coverSource: string[], coverWidth: number, coverHeight: number, videoSrc?: string): Promise<void>;
|
|
99
107
|
/**
|
package/package.json
CHANGED