@cyca/react-timeline-editor 0.2.4-alpha.5 → 0.2.5-alpha.1
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 +7 -9
- package/dist/action-C-MnAPdg.d.cts +52 -0
- package/dist/action-C-MnAPdg.d.mts +52 -0
- package/dist/deal-data-BnM2yYM0.cjs +111 -0
- package/dist/deal-data-DH3Lh6kA.mjs +64 -0
- package/dist/react-timeline-editor.cjs +1597 -13
- package/dist/react-timeline-editor.d.cts +313 -0
- package/dist/react-timeline-editor.d.mts +313 -0
- package/dist/react-timeline-editor.mjs +1572 -0
- package/dist/styles.css +268 -1
- package/dist/styles.css.d.ts +3 -0
- package/dist/utils.cjs +9 -1
- package/dist/utils.d.cts +62 -0
- package/dist/utils.d.mts +62 -0
- package/dist/utils.mjs +2 -0
- package/package.json +53 -32
- package/dist/flag.png +0 -0
- package/dist/icon.png +0 -0
- package/dist/index-6kJWhJ-8.cjs +0 -1
- package/dist/index-aC1-xztU.js +0 -83
- package/dist/index.d.ts +0 -338
- package/dist/react-timeline-editor.js +0 -4159
- package/dist/soundWave.png +0 -0
- package/dist/utils.d.ts +0 -111
- package/dist/utils.js +0 -10
package/dist/styles.css
CHANGED
|
@@ -1 +1,268 @@
|
|
|
1
|
-
@layer base
|
|
1
|
+
@layer base;
|
|
2
|
+
|
|
3
|
+
@layer components {
|
|
4
|
+
.timeline-editor {
|
|
5
|
+
background-color: oklch(15.2% 0 0);
|
|
6
|
+
min-height: 2rem;
|
|
7
|
+
font-family: ui-sans-serif, system-ui, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol, Noto Color Emoji;
|
|
8
|
+
font-size: .75rem;
|
|
9
|
+
line-height: 1rem;
|
|
10
|
+
transition: all .3s ease-in-out;
|
|
11
|
+
position: relative;
|
|
12
|
+
overflow: hidden;
|
|
13
|
+
|
|
14
|
+
& [data-slot="scroll-area"] {
|
|
15
|
+
position: relative;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
& [data-slot="scroll-area-viewport"] {
|
|
19
|
+
border-radius: inherit;
|
|
20
|
+
outline: none;
|
|
21
|
+
width: 100%;
|
|
22
|
+
height: 100%;
|
|
23
|
+
transition-property: color, box-shadow;
|
|
24
|
+
transition-duration: .15s;
|
|
25
|
+
transition-timing-function: cubic-bezier(.4, 0, .2, 1);
|
|
26
|
+
|
|
27
|
+
& > div {
|
|
28
|
+
height: 100%;
|
|
29
|
+
position: relative;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
& [data-slot="scroll-area-viewport"]:focus-visible {
|
|
34
|
+
outline: 1px solid oklch(35.3% 0 0);
|
|
35
|
+
box-shadow: 0 0 0 3px oklch(35.3% 0 0 / .5);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
& [data-slot="scroll-area-scrollbar"] {
|
|
39
|
+
touch-action: none;
|
|
40
|
+
user-select: none;
|
|
41
|
+
padding: 1px;
|
|
42
|
+
transition-property: color;
|
|
43
|
+
transition-duration: .15s;
|
|
44
|
+
transition-timing-function: cubic-bezier(.4, 0, .2, 1);
|
|
45
|
+
display: flex;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
& [data-slot="scroll-area-scrollbar"][data-orientation="vertical"] {
|
|
49
|
+
border-left: 1px solid #0000;
|
|
50
|
+
width: .625rem;
|
|
51
|
+
height: 100%;
|
|
52
|
+
transition: width .15s ease-in-out;
|
|
53
|
+
|
|
54
|
+
&:hover {
|
|
55
|
+
width: 1rem;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
& [data-slot="scroll-area-scrollbar"][data-orientation="horizontal"] {
|
|
60
|
+
border-top: 1px solid #0000;
|
|
61
|
+
flex-direction: column;
|
|
62
|
+
height: .625rem;
|
|
63
|
+
transition: height .15s ease-in-out;
|
|
64
|
+
|
|
65
|
+
&:hover {
|
|
66
|
+
height: 1rem;
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
& [data-slot="scroll-area-thumb"] {
|
|
71
|
+
background-color: oklch(35.3% 0 0);
|
|
72
|
+
border-radius: 9999px;
|
|
73
|
+
flex: 1;
|
|
74
|
+
position: relative;
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
.timeline-editor-edit-area {
|
|
79
|
+
background-image: linear-gradient(#0000, #0000), linear-gradient(90deg, oklch(100% 0 0 / .08) 1px, #0000 0);
|
|
80
|
+
background-repeat: no-repeat, repeat;
|
|
81
|
+
min-height: calc(100% - 42px);
|
|
82
|
+
margin-top: .625rem;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
.timeline-editor-edit-row {
|
|
86
|
+
transition: height .35s, transform .35s;
|
|
87
|
+
transition-timing-function: linear(0,
|
|
88
|
+
.338 8%,
|
|
89
|
+
.605 16.5%,
|
|
90
|
+
.804 25.6%,
|
|
91
|
+
.878 30.4%,
|
|
92
|
+
.938 35.5%,
|
|
93
|
+
1.006 44.9%,
|
|
94
|
+
1.025 50.1%,
|
|
95
|
+
1.035 55.7%,
|
|
96
|
+
1.035 64.6%,
|
|
97
|
+
1.006 87.3%,
|
|
98
|
+
1);
|
|
99
|
+
flex-direction: row;
|
|
100
|
+
display: flex;
|
|
101
|
+
overflow: clip;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
.timeline-editor-collapsed-row-label {
|
|
105
|
+
z-index: 1;
|
|
106
|
+
pointer-events: none;
|
|
107
|
+
align-self: stretch;
|
|
108
|
+
align-items: center;
|
|
109
|
+
max-width: min(16rem, 50vw);
|
|
110
|
+
display: flex;
|
|
111
|
+
position: sticky;
|
|
112
|
+
left: 0;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
.timeline-editor-empty-row {
|
|
116
|
+
z-index: 1;
|
|
117
|
+
pointer-events: none;
|
|
118
|
+
align-self: stretch;
|
|
119
|
+
align-items: center;
|
|
120
|
+
display: flex;
|
|
121
|
+
position: sticky;
|
|
122
|
+
left: 0;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
.timeline-editor-action {
|
|
126
|
+
background-color: oklch(35.3% 0 0);
|
|
127
|
+
position: absolute;
|
|
128
|
+
top: 0;
|
|
129
|
+
left: 0;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
.timeline-editor-action-left-stretch, .timeline-editor-action-right-stretch {
|
|
133
|
+
cursor: ew-resize;
|
|
134
|
+
width: .625rem;
|
|
135
|
+
height: 100%;
|
|
136
|
+
position: absolute;
|
|
137
|
+
top: 0;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
.timeline-editor-action-left-stretch:after, .timeline-editor-action-right-stretch:after {
|
|
141
|
+
background: oklch(55.6% 0 0);
|
|
142
|
+
border-radius: 1rem;
|
|
143
|
+
width: .25rem;
|
|
144
|
+
position: absolute;
|
|
145
|
+
top: 20%;
|
|
146
|
+
bottom: 20%;
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
.timeline-editor-action-left-stretch {
|
|
150
|
+
left: 0;
|
|
151
|
+
|
|
152
|
+
&:hover:after {
|
|
153
|
+
opacity: 1;
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
.timeline-editor-action-left-stretch:after {
|
|
158
|
+
content: "";
|
|
159
|
+
opacity: 1;
|
|
160
|
+
transition: opacity .1s ease-in-out;
|
|
161
|
+
left: .2rem;
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
.timeline-editor-action-right-stretch {
|
|
165
|
+
right: 0;
|
|
166
|
+
|
|
167
|
+
&:hover:after {
|
|
168
|
+
opacity: 1;
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
.timeline-editor-action-right-stretch:after {
|
|
173
|
+
content: "";
|
|
174
|
+
opacity: 1;
|
|
175
|
+
transition: opacity .1s ease-in-out;
|
|
176
|
+
right: .2rem;
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
.timeline-editor-time-area {
|
|
180
|
+
cursor: crosshair;
|
|
181
|
+
z-index: 3;
|
|
182
|
+
text-align: center;
|
|
183
|
+
background-color: oklch(15.2% 0 0 / .8);
|
|
184
|
+
height: 2rem;
|
|
185
|
+
font-size: 1.125rem;
|
|
186
|
+
font-weight: 700;
|
|
187
|
+
line-height: 1.75rem;
|
|
188
|
+
position: sticky;
|
|
189
|
+
top: 0;
|
|
190
|
+
overflow: clip;
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
.timeline-editor-time-unit {
|
|
194
|
+
box-sizing: content-box;
|
|
195
|
+
pointer-events: none;
|
|
196
|
+
border-right: 1px solid oklch(35.3% 0 0);
|
|
197
|
+
position: absolute;
|
|
198
|
+
top: auto;
|
|
199
|
+
bottom: 0;
|
|
200
|
+
left: 0;
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
.timeline-editor-time-unit-big {
|
|
204
|
+
height: .5rem;
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
.timeline-editor-time-unit-small {
|
|
208
|
+
height: .25rem;
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
.timeline-editor-time-unit-scale {
|
|
212
|
+
pointer-events: none;
|
|
213
|
+
color: oklch(55.6% 0 0);
|
|
214
|
+
font-size: .75rem;
|
|
215
|
+
font-weight: 300;
|
|
216
|
+
line-height: 1rem;
|
|
217
|
+
position: absolute;
|
|
218
|
+
top: 0;
|
|
219
|
+
right: 0;
|
|
220
|
+
transform: translateX(50%) translateY(-100%);
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
.timeline-editor-cursor {
|
|
224
|
+
--scale-x: .5;
|
|
225
|
+
cursor: ew-resize;
|
|
226
|
+
box-sizing: border-box;
|
|
227
|
+
z-index: 2;
|
|
228
|
+
min-height: calc(100% - 32px);
|
|
229
|
+
position: absolute;
|
|
230
|
+
top: 2rem;
|
|
231
|
+
left: -4px;
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
.timeline-editor-cursor-top {
|
|
235
|
+
color: oklch(65.1% .197 250.3);
|
|
236
|
+
position: sticky;
|
|
237
|
+
top: 2rem;
|
|
238
|
+
transform: translateX(0) translateY(0) scaleX(2);
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
.timeline-editor-cursor-area {
|
|
242
|
+
box-sizing: content-box;
|
|
243
|
+
cursor: ew-resize;
|
|
244
|
+
border-left: 1px solid oklch(65.1% .197 250.3);
|
|
245
|
+
border-right: 1px solid oklch(65.1% .197 250.3);
|
|
246
|
+
width: 0;
|
|
247
|
+
height: calc(100% - 2px);
|
|
248
|
+
position: absolute;
|
|
249
|
+
top: 1px;
|
|
250
|
+
left: -1px;
|
|
251
|
+
transform: translateX(200%);
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
.timeline-editor-snap-line-container {
|
|
255
|
+
height: 100%;
|
|
256
|
+
position: absolute;
|
|
257
|
+
top: 0;
|
|
258
|
+
left: 0;
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
.timeline-editor-snap-line {
|
|
262
|
+
border-left: 1px dashed oklch(55.1% .033 250.1);
|
|
263
|
+
width: 0;
|
|
264
|
+
height: 99%;
|
|
265
|
+
position: absolute;
|
|
266
|
+
top: 0;
|
|
267
|
+
}
|
|
268
|
+
}
|
package/dist/utils.cjs
CHANGED
|
@@ -1 +1,9 @@
|
|
|
1
|
-
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
const require_deal_data = require("./deal-data-BnM2yYM0.cjs");
|
|
3
|
+
exports.getScaleCountByPixel = require_deal_data.getScaleCountByPixel;
|
|
4
|
+
exports.getScaleCountByRows = require_deal_data.getScaleCountByRows;
|
|
5
|
+
exports.parserActionsToPositions = require_deal_data.parserActionsToPositions;
|
|
6
|
+
exports.parserPixelToTime = require_deal_data.parserPixelToTime;
|
|
7
|
+
exports.parserTimeToPixel = require_deal_data.parserTimeToPixel;
|
|
8
|
+
exports.parserTimeToTransform = require_deal_data.parserTimeToTransform;
|
|
9
|
+
exports.parserTransformToTime = require_deal_data.parserTransformToTime;
|
package/dist/utils.d.cts
ADDED
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { n as TimelineRow, t as TimelineAction } from "./action-C-MnAPdg.cjs";
|
|
2
|
+
|
|
3
|
+
//#region src/utils/deal-data.d.ts
|
|
4
|
+
/** Convert time to pixels */
|
|
5
|
+
declare function parserTimeToPixel(data: number, param: {
|
|
6
|
+
startLeft: number;
|
|
7
|
+
scale: number;
|
|
8
|
+
scaleWidth: number;
|
|
9
|
+
}): number;
|
|
10
|
+
/** Convert pixels to time */
|
|
11
|
+
declare function parserPixelToTime(data: number, param: {
|
|
12
|
+
startLeft: number;
|
|
13
|
+
scale: number;
|
|
14
|
+
scaleWidth: number;
|
|
15
|
+
}): number;
|
|
16
|
+
/** Convert position + width to start + end */
|
|
17
|
+
declare function parserTransformToTime(data: {
|
|
18
|
+
left: number;
|
|
19
|
+
width: number;
|
|
20
|
+
}, param: {
|
|
21
|
+
startLeft: number;
|
|
22
|
+
scale: number;
|
|
23
|
+
scaleWidth: number;
|
|
24
|
+
}): {
|
|
25
|
+
start: number;
|
|
26
|
+
end: number;
|
|
27
|
+
};
|
|
28
|
+
/** Convert start + end to position + width */
|
|
29
|
+
declare function parserTimeToTransform(data: {
|
|
30
|
+
start: number;
|
|
31
|
+
end: number;
|
|
32
|
+
}, param: {
|
|
33
|
+
startLeft: number;
|
|
34
|
+
scale: number;
|
|
35
|
+
scaleWidth: number;
|
|
36
|
+
}): {
|
|
37
|
+
left: number;
|
|
38
|
+
width: number;
|
|
39
|
+
};
|
|
40
|
+
/** Get scale count based on data */
|
|
41
|
+
declare function getScaleCountByRows(data: TimelineRow[], param: {
|
|
42
|
+
scale: number;
|
|
43
|
+
pad?: number;
|
|
44
|
+
}): number;
|
|
45
|
+
/** Get current scale count based on time */
|
|
46
|
+
declare function getScaleCountByPixel(data: number, param: {
|
|
47
|
+
startLeft: number;
|
|
48
|
+
scaleWidth: number;
|
|
49
|
+
scaleCount: number;
|
|
50
|
+
}): number;
|
|
51
|
+
/** Get position set of all times for actions */
|
|
52
|
+
declare function parserActionsToPositions(actions: TimelineAction[], param: {
|
|
53
|
+
startLeft: number;
|
|
54
|
+
scale: number;
|
|
55
|
+
scaleWidth: number;
|
|
56
|
+
}): {
|
|
57
|
+
value: number;
|
|
58
|
+
actionId: string;
|
|
59
|
+
rowId?: string;
|
|
60
|
+
}[];
|
|
61
|
+
//#endregion
|
|
62
|
+
export { getScaleCountByPixel, getScaleCountByRows, parserActionsToPositions, parserPixelToTime, parserTimeToPixel, parserTimeToTransform, parserTransformToTime };
|
package/dist/utils.d.mts
ADDED
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { n as TimelineRow, t as TimelineAction } from "./action-C-MnAPdg.mjs";
|
|
2
|
+
|
|
3
|
+
//#region src/utils/deal-data.d.ts
|
|
4
|
+
/** Convert time to pixels */
|
|
5
|
+
declare function parserTimeToPixel(data: number, param: {
|
|
6
|
+
startLeft: number;
|
|
7
|
+
scale: number;
|
|
8
|
+
scaleWidth: number;
|
|
9
|
+
}): number;
|
|
10
|
+
/** Convert pixels to time */
|
|
11
|
+
declare function parserPixelToTime(data: number, param: {
|
|
12
|
+
startLeft: number;
|
|
13
|
+
scale: number;
|
|
14
|
+
scaleWidth: number;
|
|
15
|
+
}): number;
|
|
16
|
+
/** Convert position + width to start + end */
|
|
17
|
+
declare function parserTransformToTime(data: {
|
|
18
|
+
left: number;
|
|
19
|
+
width: number;
|
|
20
|
+
}, param: {
|
|
21
|
+
startLeft: number;
|
|
22
|
+
scale: number;
|
|
23
|
+
scaleWidth: number;
|
|
24
|
+
}): {
|
|
25
|
+
start: number;
|
|
26
|
+
end: number;
|
|
27
|
+
};
|
|
28
|
+
/** Convert start + end to position + width */
|
|
29
|
+
declare function parserTimeToTransform(data: {
|
|
30
|
+
start: number;
|
|
31
|
+
end: number;
|
|
32
|
+
}, param: {
|
|
33
|
+
startLeft: number;
|
|
34
|
+
scale: number;
|
|
35
|
+
scaleWidth: number;
|
|
36
|
+
}): {
|
|
37
|
+
left: number;
|
|
38
|
+
width: number;
|
|
39
|
+
};
|
|
40
|
+
/** Get scale count based on data */
|
|
41
|
+
declare function getScaleCountByRows(data: TimelineRow[], param: {
|
|
42
|
+
scale: number;
|
|
43
|
+
pad?: number;
|
|
44
|
+
}): number;
|
|
45
|
+
/** Get current scale count based on time */
|
|
46
|
+
declare function getScaleCountByPixel(data: number, param: {
|
|
47
|
+
startLeft: number;
|
|
48
|
+
scaleWidth: number;
|
|
49
|
+
scaleCount: number;
|
|
50
|
+
}): number;
|
|
51
|
+
/** Get position set of all times for actions */
|
|
52
|
+
declare function parserActionsToPositions(actions: TimelineAction[], param: {
|
|
53
|
+
startLeft: number;
|
|
54
|
+
scale: number;
|
|
55
|
+
scaleWidth: number;
|
|
56
|
+
}): {
|
|
57
|
+
value: number;
|
|
58
|
+
actionId: string;
|
|
59
|
+
rowId?: string;
|
|
60
|
+
}[];
|
|
61
|
+
//#endregion
|
|
62
|
+
export { getScaleCountByPixel, getScaleCountByRows, parserActionsToPositions, parserPixelToTime, parserTimeToPixel, parserTimeToTransform, parserTransformToTime };
|
package/dist/utils.mjs
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { a as parserTimeToPixel, i as parserPixelToTime, n as getScaleCountByRows, o as parserTimeToTransform, r as parserActionsToPositions, s as parserTransformToTime, t as getScaleCountByPixel } from "./deal-data-DH3Lh6kA.mjs";
|
|
2
|
+
export { getScaleCountByPixel, getScaleCountByRows, parserActionsToPositions, parserPixelToTime, parserTimeToPixel, parserTimeToTransform, parserTransformToTime };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cyca/react-timeline-editor",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.5-alpha.1",
|
|
4
4
|
"author": "cyca",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"keywords": [
|
|
@@ -20,33 +20,48 @@
|
|
|
20
20
|
},
|
|
21
21
|
"scripts": {
|
|
22
22
|
"dev": "storybook dev -p 6006",
|
|
23
|
-
"build": "
|
|
24
|
-
"
|
|
25
|
-
"lint
|
|
26
|
-
"lint:
|
|
23
|
+
"build": "vp pack",
|
|
24
|
+
"check": "vp check && tsc --noEmit",
|
|
25
|
+
"lint": "vp lint .",
|
|
26
|
+
"lint:fix": "vp lint . --fix",
|
|
27
|
+
"lint:package": "npx --yes @arethetypeswrong/cli -P --profile node16 --exclude-entrypoints ./styles.css",
|
|
28
|
+
"test": "vp test",
|
|
27
29
|
"typecheck": "tsc --noEmit",
|
|
28
30
|
"build-storybook": "storybook build",
|
|
29
|
-
"npm:publish": "
|
|
31
|
+
"npm:publish": "vp pack && npm publish --access public --tag alpha && npm dist-tag add $npm_package_name@$npm_package_version alpha && npm dist-tag add $npm_package_name@$npm_package_version latest"
|
|
30
32
|
},
|
|
31
33
|
"files": [
|
|
32
34
|
"dist"
|
|
33
35
|
],
|
|
34
36
|
"type": "module",
|
|
35
37
|
"main": "./dist/react-timeline-editor.cjs",
|
|
36
|
-
"module": "./dist/react-timeline-editor.
|
|
37
|
-
"types": "./dist/
|
|
38
|
+
"module": "./dist/react-timeline-editor.mjs",
|
|
39
|
+
"types": "./dist/react-timeline-editor.d.mts",
|
|
38
40
|
"exports": {
|
|
39
41
|
".": {
|
|
40
|
-
"
|
|
41
|
-
|
|
42
|
-
|
|
42
|
+
"import": {
|
|
43
|
+
"types": "./dist/react-timeline-editor.d.mts",
|
|
44
|
+
"default": "./dist/react-timeline-editor.mjs"
|
|
45
|
+
},
|
|
46
|
+
"require": {
|
|
47
|
+
"types": "./dist/react-timeline-editor.d.cts",
|
|
48
|
+
"default": "./dist/react-timeline-editor.cjs"
|
|
49
|
+
}
|
|
43
50
|
},
|
|
44
51
|
"./utils": {
|
|
45
|
-
"
|
|
46
|
-
|
|
47
|
-
|
|
52
|
+
"import": {
|
|
53
|
+
"types": "./dist/utils.d.mts",
|
|
54
|
+
"default": "./dist/utils.mjs"
|
|
55
|
+
},
|
|
56
|
+
"require": {
|
|
57
|
+
"types": "./dist/utils.d.cts",
|
|
58
|
+
"default": "./dist/utils.cjs"
|
|
59
|
+
}
|
|
60
|
+
},
|
|
61
|
+
"./styles.css": {
|
|
62
|
+
"types": "./dist/styles.css.d.ts",
|
|
63
|
+
"default": "./dist/styles.css"
|
|
48
64
|
},
|
|
49
|
-
"./styles.css": "./dist/styles.css",
|
|
50
65
|
"./package.json": "./package.json"
|
|
51
66
|
},
|
|
52
67
|
"peerDependencies": {
|
|
@@ -54,7 +69,6 @@
|
|
|
54
69
|
"react-dom": ">=19.2.0"
|
|
55
70
|
},
|
|
56
71
|
"dependencies": {
|
|
57
|
-
"@cyca/log": "^0.1.1",
|
|
58
72
|
"@tanstack/react-virtual": "^3.13.12",
|
|
59
73
|
"@use-gesture/react": "^10.3.1",
|
|
60
74
|
"framework-utils": "^1.1.0",
|
|
@@ -62,30 +76,37 @@
|
|
|
62
76
|
"radix-ui": "^1.4.3"
|
|
63
77
|
},
|
|
64
78
|
"devDependencies": {
|
|
65
|
-
"@
|
|
66
|
-
"@
|
|
67
|
-
"@storybook/
|
|
79
|
+
"@babel/core": "^7.29.7",
|
|
80
|
+
"@rolldown/plugin-babel": "^0.2.3",
|
|
81
|
+
"@storybook/addon-docs": "^10.4.1",
|
|
82
|
+
"@storybook/react-vite": "^10.4.1",
|
|
83
|
+
"@tsdown/css": "^0.22.1",
|
|
84
|
+
"@types/babel__core": "^7.20.5",
|
|
68
85
|
"@types/howler": "^2.2.12",
|
|
69
86
|
"@types/node": "^24.10.0",
|
|
70
87
|
"@types/react": "^19.2.2",
|
|
71
88
|
"@types/react-dom": "^19.2.2",
|
|
72
|
-
"@vitejs/plugin-react": "^
|
|
89
|
+
"@vitejs/plugin-react": "^6.0.2",
|
|
90
|
+
"@vitest/coverage-v8": "4.1.7",
|
|
91
|
+
"@voidzero-dev/vite-plus-core": "^0.1.23",
|
|
92
|
+
"@voidzero-dev/vite-plus-test": "^0.1.23",
|
|
73
93
|
"babel-plugin-react-compiler": "^1.0.0",
|
|
74
|
-
"eslint": "^9.39.1",
|
|
75
|
-
"eslint-plugin-react-hooks": "^7.0.1",
|
|
76
|
-
"eslint-plugin-react-refresh": "^0.4.24",
|
|
77
|
-
"eslint-plugin-storybook": "^10.0.5",
|
|
78
94
|
"gh-pages": "^3.2.3",
|
|
79
|
-
"
|
|
95
|
+
"happy-dom": "^20.9.0",
|
|
80
96
|
"less": "^4.4.2",
|
|
81
|
-
"prettier": "^2.8.8",
|
|
82
97
|
"react": "^19.2.0",
|
|
83
98
|
"react-dom": "^19.2.0",
|
|
84
|
-
"storybook": "^10.
|
|
85
|
-
"typescript": "~
|
|
86
|
-
"
|
|
87
|
-
"vite": "^
|
|
88
|
-
"vite-plugin-dts": "^4.5.4"
|
|
99
|
+
"storybook": "^10.4.1",
|
|
100
|
+
"typescript": "~6.0.3",
|
|
101
|
+
"vite": "npm:@voidzero-dev/vite-plus-core@latest",
|
|
102
|
+
"vite-plus": "^0.1.24"
|
|
89
103
|
},
|
|
90
|
-
"packageManager": "
|
|
104
|
+
"packageManager": "bun@1.3.13",
|
|
105
|
+
"trustedDependencies": [
|
|
106
|
+
"esbuild"
|
|
107
|
+
],
|
|
108
|
+
"overrides": {
|
|
109
|
+
"vite": "npm:@voidzero-dev/vite-plus-core@latest",
|
|
110
|
+
"vitest": "npm:@voidzero-dev/vite-plus-test@latest"
|
|
111
|
+
}
|
|
91
112
|
}
|
package/dist/flag.png
DELETED
|
Binary file
|
package/dist/icon.png
DELETED
|
Binary file
|
package/dist/index-6kJWhJ-8.cjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";const c="timeline-editor";function _(o,t){const{startLeft:T,scale:n,scaleWidth:s}=t;return T+o/n*s}function E(o,t){const{startLeft:T,scale:n,scaleWidth:s}=t;return(o-T)/s*n}function A(o,t){const{left:T,width:n}=o,s=E(T,t),e=E(T+n,t);return{start:s,end:e}}function r(o,t){const{start:T,end:n}=o,s=_(T,t),e=_(n,t)-s;return{left:s,width:e}}function L(o,t){let T=0;return o.forEach(s=>{s.actions.forEach(e=>{T=Math.max(T,e.end)})}),Math.ceil(T/t.scale)+(t.pad??2)}function i(o,t){const{startLeft:T,scaleWidth:n}=t,s=Math.ceil((o-T)/n);return Math.max(s+2,t.scaleCount)}function a(o,t){const T=[];return o.forEach(n=>{T.push({value:_(n.start,t),actionId:n.id}),T.push({value:_(n.end,t),actionId:n.id})}),T}exports.DEFAULT_MOVE_GRID=1;exports.DEFAULT_ROW_HEIGHT=32;exports.DEFAULT_SCALE=1;exports.DEFAULT_SCALE_SPLIT_COUNT=10;exports.DEFAULT_SCALE_WIDTH=160;exports.DEFAULT_SNAP_DISTANCE=8;exports.DEFAULT_START_LEFT=20;exports.MIN_SCALE_COUNT=20;exports.PREFIX=c;exports.START_CURSOR_TIME=0;exports.getScaleCountByPixel=i;exports.getScaleCountByRows=L;exports.parserActionsToPositions=a;exports.parserPixelToTime=E;exports.parserTimeToPixel=_;exports.parserTimeToTransform=r;exports.parserTransformToTime=A;
|
package/dist/index-aC1-xztU.js
DELETED
|
@@ -1,83 +0,0 @@
|
|
|
1
|
-
const T = "timeline-editor", i = 0, u = 1, _ = 10, E = 160, A = 20, l = 1, L = 8, f = 32, C = 20;
|
|
2
|
-
function e(o, t) {
|
|
3
|
-
const {
|
|
4
|
-
startLeft: s,
|
|
5
|
-
scale: n,
|
|
6
|
-
scaleWidth: c
|
|
7
|
-
} = t;
|
|
8
|
-
return s + o / n * c;
|
|
9
|
-
}
|
|
10
|
-
function r(o, t) {
|
|
11
|
-
const {
|
|
12
|
-
startLeft: s,
|
|
13
|
-
scale: n,
|
|
14
|
-
scaleWidth: c
|
|
15
|
-
} = t;
|
|
16
|
-
return (o - s) / c * n;
|
|
17
|
-
}
|
|
18
|
-
function D(o, t) {
|
|
19
|
-
const {
|
|
20
|
-
left: s,
|
|
21
|
-
width: n
|
|
22
|
-
} = o, c = r(s, t), a = r(s + n, t);
|
|
23
|
-
return {
|
|
24
|
-
start: c,
|
|
25
|
-
end: a
|
|
26
|
-
};
|
|
27
|
-
}
|
|
28
|
-
function d(o, t) {
|
|
29
|
-
const {
|
|
30
|
-
start: s,
|
|
31
|
-
end: n
|
|
32
|
-
} = o, c = e(s, t), a = e(n, t) - c;
|
|
33
|
-
return {
|
|
34
|
-
left: c,
|
|
35
|
-
width: a
|
|
36
|
-
};
|
|
37
|
-
}
|
|
38
|
-
function S(o, t) {
|
|
39
|
-
let s = 0;
|
|
40
|
-
return o.forEach((c) => {
|
|
41
|
-
c.actions.forEach((a) => {
|
|
42
|
-
s = Math.max(s, a.end);
|
|
43
|
-
});
|
|
44
|
-
}), Math.ceil(s / t.scale) + (t.pad ?? 2);
|
|
45
|
-
}
|
|
46
|
-
function h(o, t) {
|
|
47
|
-
const {
|
|
48
|
-
startLeft: s,
|
|
49
|
-
scaleWidth: n
|
|
50
|
-
} = t, c = Math.ceil((o - s) / n);
|
|
51
|
-
return Math.max(c + 2, t.scaleCount);
|
|
52
|
-
}
|
|
53
|
-
function U(o, t) {
|
|
54
|
-
const s = [];
|
|
55
|
-
return o.forEach((n) => {
|
|
56
|
-
s.push({
|
|
57
|
-
value: e(n.start, t),
|
|
58
|
-
actionId: n.id
|
|
59
|
-
}), s.push({
|
|
60
|
-
value: e(n.end, t),
|
|
61
|
-
actionId: n.id
|
|
62
|
-
});
|
|
63
|
-
}), s;
|
|
64
|
-
}
|
|
65
|
-
export {
|
|
66
|
-
u as D,
|
|
67
|
-
C as M,
|
|
68
|
-
T as P,
|
|
69
|
-
i as S,
|
|
70
|
-
_ as a,
|
|
71
|
-
E as b,
|
|
72
|
-
A as c,
|
|
73
|
-
f as d,
|
|
74
|
-
l as e,
|
|
75
|
-
L as f,
|
|
76
|
-
d as g,
|
|
77
|
-
D as h,
|
|
78
|
-
h as i,
|
|
79
|
-
r as j,
|
|
80
|
-
S as k,
|
|
81
|
-
U as l,
|
|
82
|
-
e as p
|
|
83
|
-
};
|