@cyca/react-timeline-editor 0.2.4-alpha.1 → 0.2.4-alpha.3
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/dist/index.d.ts +32 -45
- package/dist/react-timeline-editor.cjs +4 -4
- package/dist/react-timeline-editor.js +1406 -1343
- package/dist/styles.css +1 -1
- package/package.json +2 -2
package/dist/index.d.ts
CHANGED
|
@@ -56,6 +56,11 @@ export declare interface EditData {
|
|
|
56
56
|
* @default false
|
|
57
57
|
*/
|
|
58
58
|
snap?: boolean;
|
|
59
|
+
/**
|
|
60
|
+
* @description Enable cursor snap to action endpoints when dragging
|
|
61
|
+
* @default false
|
|
62
|
+
*/
|
|
63
|
+
cursorSnap?: boolean;
|
|
59
64
|
/**
|
|
60
65
|
* @description Whether to hide cursor
|
|
61
66
|
* @default false
|
|
@@ -105,7 +110,7 @@ export declare interface EditData {
|
|
|
105
110
|
onActionResizeStart?: (params: {
|
|
106
111
|
action: TimelineAction;
|
|
107
112
|
row: TimelineRow;
|
|
108
|
-
dir:
|
|
113
|
+
dir: "right" | "left";
|
|
109
114
|
}) => void;
|
|
110
115
|
/**
|
|
111
116
|
* @description Resize callback (return false to prevent resize)
|
|
@@ -115,7 +120,7 @@ export declare interface EditData {
|
|
|
115
120
|
row: TimelineRow;
|
|
116
121
|
start: number;
|
|
117
122
|
end: number;
|
|
118
|
-
dir:
|
|
123
|
+
dir: "right" | "left";
|
|
119
124
|
}) => void | boolean;
|
|
120
125
|
/**
|
|
121
126
|
* @description Resize end callback (return false to prevent onChange trigger)
|
|
@@ -125,7 +130,7 @@ export declare interface EditData {
|
|
|
125
130
|
row: TimelineRow;
|
|
126
131
|
start: number;
|
|
127
132
|
end: number;
|
|
128
|
-
dir:
|
|
133
|
+
dir: "right" | "left";
|
|
129
134
|
}) => void;
|
|
130
135
|
/**
|
|
131
136
|
* @description Click row callback
|
|
@@ -204,17 +209,24 @@ export declare interface EditData {
|
|
|
204
209
|
* @description Click time area event, return false to prevent setting time
|
|
205
210
|
*/
|
|
206
211
|
onClickTimeArea?: (time: number, e: React_2.MouseEvent<HTMLDivElement, MouseEvent>) => boolean | undefined;
|
|
212
|
+
/**
|
|
213
|
+
* @description Virtualization overscan count (unstable API, may change or be removed)
|
|
214
|
+
* @default 5
|
|
215
|
+
*/
|
|
216
|
+
unstable_rowActionsOverscan?: number;
|
|
207
217
|
}
|
|
208
218
|
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
/**
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
219
|
+
declare type ScrollToTimeBlock = "start" | "center" | "end";
|
|
220
|
+
|
|
221
|
+
declare interface ScrollToTimeOptions {
|
|
222
|
+
block?: ScrollToTimeBlock;
|
|
223
|
+
offset?: number;
|
|
224
|
+
/**
|
|
225
|
+
* @description Only scroll if the time is not currently visible in the viewport
|
|
226
|
+
* @default false
|
|
227
|
+
*/
|
|
228
|
+
onlyIfNotVisible?: boolean;
|
|
229
|
+
behavior?: "instant" | "smooth" | "auto";
|
|
218
230
|
}
|
|
219
231
|
|
|
220
232
|
export declare function Timeline({ ref, ...props }: TimelineEditor & {
|
|
@@ -268,11 +280,6 @@ export declare interface TimelineEditor extends EditData {
|
|
|
268
280
|
* @description Custom timeline style
|
|
269
281
|
*/
|
|
270
282
|
style?: React_2.CSSProperties;
|
|
271
|
-
/**
|
|
272
|
-
* @description Whether to auto re-render (update tick when data changes or cursor time changes)
|
|
273
|
-
* @default true
|
|
274
|
-
*/
|
|
275
|
-
autoReRender?: boolean;
|
|
276
283
|
/**
|
|
277
284
|
* @description Data change callback, triggered after action end changes data (return false to prevent automatic engine synchronization, used to reduce performance overhead)
|
|
278
285
|
*/
|
|
@@ -284,26 +291,6 @@ export declare interface TimelineEffect {
|
|
|
284
291
|
id: string;
|
|
285
292
|
/** Effect name */
|
|
286
293
|
name?: string;
|
|
287
|
-
/** Effect execution code */
|
|
288
|
-
source?: TimeLineEffectSource;
|
|
289
|
-
}
|
|
290
|
-
|
|
291
|
-
/**
|
|
292
|
-
* Effect execution callback
|
|
293
|
-
* @export
|
|
294
|
-
* @interface TimeLineEffectSource
|
|
295
|
-
*/
|
|
296
|
-
export declare interface TimeLineEffectSource {
|
|
297
|
-
/** Callback when playback starts in the current action time region */
|
|
298
|
-
start?: (param: EffectSourceParam) => void;
|
|
299
|
-
/** Callback executed when time enters the action */
|
|
300
|
-
enter?: (param: EffectSourceParam) => void;
|
|
301
|
-
/** Callback when action updates */
|
|
302
|
-
update?: (param: EffectSourceParam) => void;
|
|
303
|
-
/** Callback executed when time leaves the action */
|
|
304
|
-
leave?: (param: EffectSourceParam) => void;
|
|
305
|
-
/** Callback when playback stops in the current action time region */
|
|
306
|
-
stop?: (param: EffectSourceParam) => void;
|
|
307
294
|
}
|
|
308
295
|
|
|
309
296
|
/**
|
|
@@ -325,16 +312,16 @@ export declare interface TimelineRow {
|
|
|
325
312
|
}
|
|
326
313
|
|
|
327
314
|
export declare interface TimelineState {
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
/** Get current playback time */
|
|
333
|
-
get time(): number;
|
|
334
|
-
/** Set scroll left */
|
|
315
|
+
readonly target: HTMLDivElement;
|
|
316
|
+
time: number;
|
|
317
|
+
getTime(): number;
|
|
318
|
+
setTime(time: number): void;
|
|
335
319
|
setScrollLeft: (val: number) => void;
|
|
336
|
-
/** Set scroll top */
|
|
337
320
|
setScrollTop: (val: number) => void;
|
|
321
|
+
scrollLeft: number;
|
|
322
|
+
scrollTop: number;
|
|
323
|
+
scrollToTime(time: number, options?: ScrollToTimeOptions): void;
|
|
324
|
+
getTimePixelPosition(time?: number): number;
|
|
338
325
|
}
|
|
339
326
|
|
|
340
327
|
export { }
|