@cyca/react-timeline-editor 0.2.4-alpha.6 → 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/dist/styles.css CHANGED
@@ -1 +1,268 @@
1
- @layer base,components;@layer components{.timeline-editor{min-height:2rem;position:relative;font-size:.75rem;line-height:1rem;font-family:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";background-color:#0c0c0c;overflow:hidden;transition:all .3s ease-in-out}.timeline-editor [data-slot=scroll-area]{position:relative}.timeline-editor [data-slot=scroll-area-viewport]{width:100%;height:100%;border-radius:inherit;outline:none;transition-property:color,box-shadow;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.timeline-editor [data-slot=scroll-area-viewport]>div{position:relative;height:100%}.timeline-editor [data-slot=scroll-area-viewport]:focus-visible{outline-width:1px;outline-style:solid;outline-color:#3b3b3b;box-shadow:0 0 0 3px #3b3b3b80}.timeline-editor [data-slot=scroll-area-scrollbar]{display:flex;touch-action:none;padding:1px;transition-property:color;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s;-webkit-user-select:none;user-select:none}.timeline-editor [data-slot=scroll-area-scrollbar][data-orientation=vertical]{height:100%;width:.625rem;border-left-width:1px;border-left-style:solid;border-left-color:transparent;transition:width .15s ease-in-out}.timeline-editor [data-slot=scroll-area-scrollbar][data-orientation=vertical]:hover{width:1rem}.timeline-editor [data-slot=scroll-area-scrollbar][data-orientation=horizontal]{height:.625rem;flex-direction:column;border-top-width:1px;border-top-style:solid;border-top-color:transparent;transition:height .15s ease-in-out}.timeline-editor [data-slot=scroll-area-scrollbar][data-orientation=horizontal]:hover{height:1rem}.timeline-editor [data-slot=scroll-area-thumb]{position:relative;flex:1 1 0%;border-radius:9999px;background-color:#3b3b3b}.timeline-editor-edit-area{margin-top:.625rem;min-height:calc(100% - 42px);background-repeat:no-repeat,repeat;background-image:linear-gradient(transparent,transparent),linear-gradient(90deg,oklch(100% 0 0 / .08) 1px,transparent 0)}.timeline-editor-edit-row{display:flex;flex-direction:row}.timeline-editor-action{position:absolute;left:0;top:0;background-color:#3b3b3b}.timeline-editor-action-left-stretch,.timeline-editor-action-right-stretch{position:absolute;width:.625rem;height:100%;top:0;cursor:ew-resize}.timeline-editor-action-left-stretch:after,.timeline-editor-action-right-stretch:after{position:absolute;width:.25rem;background:#737373;top:20%;bottom:20%;border-radius:1rem}.timeline-editor-action-left-stretch{left:0}.timeline-editor-action-left-stretch:hover:after{opacity:1}.timeline-editor-action-left-stretch:after{content:"";opacity:1;transition:opacity .1s ease-in-out;left:.2rem}.timeline-editor-action-right-stretch{right:0}.timeline-editor-action-right-stretch:hover:after{opacity:1}.timeline-editor-action-right-stretch:after{content:"";opacity:1;right:.2rem;transition:opacity .1s ease-in-out}.timeline-editor-time-area{cursor:crosshair;z-index:3;background-color:#0c0c0ccc;position:sticky;top:0;height:2rem;text-align:center;font-weight:700;font-size:1.125rem;line-height:1.75rem;overflow:clip}.timeline-editor-time-unit{box-sizing:content-box;position:absolute;left:0;border-right-width:1px;border-right-style:solid;border-right-color:#3b3b3b;bottom:0;top:auto;pointer-events:none}.timeline-editor-time-unit-big{height:.5rem}.timeline-editor-time-unit-small{height:.25rem}.timeline-editor-time-unit-scale{position:absolute;top:0;right:0;transform:translate(50%) translateY(-100%);pointer-events:none;color:#737373;font-size:.75rem;line-height:1rem;font-weight:300}.timeline-editor-cursor{--scale-x: .5;cursor:ew-resize;position:absolute;left:-4px;box-sizing:border-box;top:2rem;min-height:calc(100% - 32px);z-index:2}.timeline-editor-cursor-top{position:sticky;transform:translate(0) translateY(0) scaleX(2);color:#0092fb;color:oklch(65.1% .197 250.3);top:2rem}.timeline-editor-cursor-area{box-sizing:content-box;border-left-width:1px;border-left-style:solid;border-left-color:#0092fb;border-left-color:oklch(65.1% .197 250.3);border-right-width:1px;border-right-style:solid;border-right-color:#0092fb;border-right-color:oklch(65.1% .197 250.3);width:0px;height:calc(100% - 2px);cursor:ew-resize;position:absolute;top:1px;left:-1px;transform:translate(200%)}.timeline-editor-snap-line-container{position:absolute;height:100%;left:0;top:0}.timeline-editor-snap-line{width:0;position:absolute;height:99%;border-left-color:#647485;border-left-width:1px;border-left-style:dashed;top:0}}
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
+ }
@@ -0,0 +1,3 @@
1
+ declare const styles: string;
2
+
3
+ export default styles;
package/dist/utils.cjs CHANGED
@@ -1 +1,9 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-6kJWhJ-8.cjs");exports.getScaleCountByPixel=e.getScaleCountByPixel;exports.getScaleCountByRows=e.getScaleCountByRows;exports.parserActionsToPositions=e.parserActionsToPositions;exports.parserPixelToTime=e.parserPixelToTime;exports.parserTimeToPixel=e.parserTimeToPixel;exports.parserTimeToTransform=e.parserTimeToTransform;exports.parserTransformToTime=e.parserTransformToTime;
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;
@@ -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 };
@@ -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.4-alpha.6",
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": "vite build",
24
- "lint": "eslint . --ext .ts,.tsx",
25
- "lint:fix": "eslint . --ext .ts,.tsx --fix",
26
- "lint:package": "npx --yes @arethetypeswrong/cli -P",
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": "npm run build && npm publish --access public --tag alpha"
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.js",
37
- "types": "./dist/index.d.ts",
38
+ "module": "./dist/react-timeline-editor.mjs",
39
+ "types": "./dist/react-timeline-editor.d.mts",
38
40
  "exports": {
39
41
  ".": {
40
- "types": "./dist/index.d.ts",
41
- "import": "./dist/react-timeline-editor.js",
42
- "require": "./dist/react-timeline-editor.cjs"
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
- "types": "./dist/utils.d.ts",
46
- "import": "./dist/utils.js",
47
- "require": "./dist/utils.cjs"
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
- "@eslint/js": "^9.36.0",
66
- "@storybook/addon-docs": "^10.0.5",
67
- "@storybook/react-vite": "^10.0.5",
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": "^5.1.0",
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
- "globals": "^16.5.0",
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.0.5",
85
- "typescript": "~5.9.3",
86
- "typescript-eslint": "^8.46.3",
87
- "vite": "^7.2.1",
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": "pnpm@10.22.0+sha512.bf049efe995b28f527fd2b41ae0474ce29186f7edcb3bf545087bd61fbbebb2bf75362d1307fda09c2d288e1e499787ac12d4fcb617a974718a6051f2eee741c"
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
@@ -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;
@@ -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
- };