@twick/studio 0.14.5
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 +122 -0
- package/dist/components/container/audio-panel-container.d.ts +3 -0
- package/dist/components/container/circle-panel-container.d.ts +3 -0
- package/dist/components/container/element-panel-container.d.ts +12 -0
- package/dist/components/container/icon-panel-container.d.ts +3 -0
- package/dist/components/container/image-panel-container.d.ts +3 -0
- package/dist/components/container/properties-panel-container.d.ts +9 -0
- package/dist/components/container/rect-panel-container.d.ts +3 -0
- package/dist/components/container/text-panel-container.d.ts +9 -0
- package/dist/components/container/video-panel-container.d.ts +3 -0
- package/dist/components/header.d.ts +10 -0
- package/dist/components/panel/audio-panel.d.ts +3 -0
- package/dist/components/panel/circle-panel.d.ts +4 -0
- package/dist/components/panel/icon-panel.d.ts +4 -0
- package/dist/components/panel/image-panel.d.ts +3 -0
- package/dist/components/panel/rect-panel.d.ts +4 -0
- package/dist/components/panel/subtitles-panel.d.ts +27 -0
- package/dist/components/panel/text-panel.d.ts +4 -0
- package/dist/components/panel/video-panel.d.ts +3 -0
- package/dist/components/properties/animation.d.ts +3 -0
- package/dist/components/properties/element-props.d.ts +3 -0
- package/dist/components/properties/playback-props.d.ts +3 -0
- package/dist/components/properties/subtitlte-prop.d.ts +35 -0
- package/dist/components/properties/text-effects.d.ts +3 -0
- package/dist/components/props-toolbar.d.ts +7 -0
- package/dist/components/shared/accordion-item.d.ts +9 -0
- package/dist/components/shared/color-input.d.ts +5 -0
- package/dist/components/shared/file-input.d.ts +7 -0
- package/dist/components/shared/index.d.ts +3 -0
- package/dist/components/shared/media-manager.d.ts +3 -0
- package/dist/components/shared/prop-container.d.ts +7 -0
- package/dist/components/shared/search-input.d.ts +5 -0
- package/dist/components/toolbar.d.ts +23 -0
- package/dist/components/twick-studio.d.ts +5 -0
- package/dist/context/media-context.d.ts +15 -0
- package/dist/context/video-panel-context.d.ts +15 -0
- package/dist/hooks/use-audio-preview.d.ts +11 -0
- package/dist/hooks/use-circle-panel.d.ts +29 -0
- package/dist/hooks/use-icon-panel.d.ts +24 -0
- package/dist/hooks/use-media-panel.d.ts +23 -0
- package/dist/hooks/use-rect-panel.d.ts +29 -0
- package/dist/hooks/use-studio-manager.d.ts +11 -0
- package/dist/hooks/use-studio-operation.d.ts +8 -0
- package/dist/hooks/use-text-panel.d.ts +50 -0
- package/dist/hooks/use-video-preview.d.ts +11 -0
- package/dist/index.d.ts +41 -0
- package/dist/index.js +3254 -0
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +3254 -0
- package/dist/index.mjs.map +1 -0
- package/dist/studio.css +284 -0
- package/dist/styles/input-styles.d.ts +39 -0
- package/dist/twick.svg +3 -0
- package/dist/types/index.d.ts +134 -0
- package/dist/types/media-panel.d.ts +21 -0
- package/package.json +50 -0
package/dist/studio.css
ADDED
|
@@ -0,0 +1,284 @@
|
|
|
1
|
+
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500;600&display=swap');
|
|
2
|
+
@tailwind base;
|
|
3
|
+
@tailwind components;
|
|
4
|
+
@tailwind utilities;
|
|
5
|
+
@layer base {
|
|
6
|
+
* {
|
|
7
|
+
@apply border-gray-600;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
body {
|
|
11
|
+
@apply bg-neutral-900 text-gray-100 font-sans;
|
|
12
|
+
font-feature-settings: "rlig" 1, "calt" 1;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
html {
|
|
16
|
+
@apply scroll-smooth;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
@layer components {
|
|
20
|
+
/* Custom scrollbar */
|
|
21
|
+
.custom-scrollbar {
|
|
22
|
+
scrollbar-width: thin;
|
|
23
|
+
scrollbar-color: theme('colors.purple.600') theme('colors.gray.700');
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.custom-scrollbar::-webkit-scrollbar {
|
|
27
|
+
width: 6px;
|
|
28
|
+
height: 6px;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
.custom-scrollbar::-webkit-scrollbar-track {
|
|
32
|
+
@apply bg-neutral-700;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.custom-scrollbar::-webkit-scrollbar-thumb {
|
|
36
|
+
@apply bg-purple-600 rounded-full;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.custom-scrollbar::-webkit-scrollbar-thumb:hover {
|
|
40
|
+
@apply bg-purple-500;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/* Glass morphism effect */
|
|
44
|
+
.glass {
|
|
45
|
+
@apply bg-neutral-800/70 backdrop-blur-md border border-gray-600/50 shadow-lg;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
/* Button styles */
|
|
49
|
+
.btn {
|
|
50
|
+
@apply inline-flex items-center justify-center rounded-lg px-3 py-2 text-sm font-medium transition-all duration-200 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-offset-gray-800 disabled:opacity-50 disabled:cursor-not-allowed;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
.btn-primary {
|
|
54
|
+
@apply bg-gradient-to-r from-purple-600 to-purple-700 text-white hover:from-purple-700 hover:to-purple-800 focus:ring-purple-500 shadow-lg shadow-purple-500/25 hover:shadow-xl hover:shadow-purple-500/30;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
.btn-secondary {
|
|
58
|
+
@apply bg-gradient-to-r from-purple-200 to-purple-300 text-gray-600 hover:from-purple-200 hover:to-purple-300 focus:ring-purple-100 shadow-lg shadow-purple-100/25 hover:shadow-xl hover:shadow-purple-100/30;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
.btn-ghost {
|
|
62
|
+
@apply text-gray-300 hover:text-white hover:bg-neutral-700/50 focus:ring-gray-500;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
.btn-outline {
|
|
66
|
+
@apply border border-purple-500 text-purple-400 hover:bg-purple-500 hover:text-white focus:ring-purple-500;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
.btn-danger {
|
|
70
|
+
@apply bg-gradient-to-r from-red-600 to-red-700 text-white hover:from-red-700 hover:to-red-800 focus:ring-red-500;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
/* Input styles */
|
|
74
|
+
.input {
|
|
75
|
+
@apply w-full rounded-lg border border-gray-600 bg-neutral-700/80 px-3 py-2 text-sm text-gray-100 placeholder-gray-400 focus:border-purple-500 focus:outline-none focus:ring-2 focus:ring-purple-500/20 transition-all duration-200 backdrop-blur-sm shadow-sm;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
/* Card styles */
|
|
79
|
+
.card {
|
|
80
|
+
@apply rounded-xl border border-gray-600/50 bg-neutral-800/60 backdrop-blur-md shadow-lg;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
/* Panel styles */
|
|
84
|
+
.panel {
|
|
85
|
+
@apply card p-4;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
/* Sidebar styles */
|
|
89
|
+
.sidebar {
|
|
90
|
+
@apply w-16 bg-neutral-800/80 border-r border-gray-600/50 flex flex-col backdrop-blur-md shadow-lg;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
/* Timeline track styles */
|
|
94
|
+
.timeline-track {
|
|
95
|
+
@apply relative h-12 bg-neutral-700/50 border border-gray-600/50 rounded-lg overflow-hidden backdrop-blur-sm shadow-md;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
.timeline-element {
|
|
99
|
+
@apply absolute top-1 bottom-1 rounded-md border border-purple-500/50 bg-gradient-to-r from-purple-600/30 to-purple-600/30 hover:from-purple-600/50 hover:to-purple-600/50 transition-all duration-200 cursor-pointer shadow-lg;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
/* Canvas styles */
|
|
103
|
+
.canvas-container {
|
|
104
|
+
@apply relative overflow-hidden shadow-xl;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
/* Toolbar styles */
|
|
108
|
+
.toolbar {
|
|
109
|
+
@apply flex items-center gap-2 p-3 bg-neutral-800/80 backdrop-blur-md border-b border-gray-600/50 shadow-md;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
/* Header styles */
|
|
113
|
+
.header {
|
|
114
|
+
@apply h-14 bg-neutral-800/90 border-b border-gray-600/50 flex items-center justify-between px-4 backdrop-blur-md shadow-lg;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
/* Media library styles */
|
|
118
|
+
.media-item {
|
|
119
|
+
@apply transition-all duration-200 hover:scale-105 hover:shadow-lg hover:shadow-purple-500/20;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
/* Progress bar styling */
|
|
123
|
+
.progress-bar {
|
|
124
|
+
@apply transition-all duration-150 ease-out bg-gradient-to-r from-purple-500 to-purple-500;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
/* Button hover effects */
|
|
128
|
+
.btn-hover {
|
|
129
|
+
@apply transform hover:scale-105 active:scale-95 transition-transform duration-200;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
/* Accent colors */
|
|
133
|
+
.accent-purple {
|
|
134
|
+
@apply text-purple-400;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
.accent-blue {
|
|
138
|
+
@apply text-purple-400;
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
/* Gradient text */
|
|
142
|
+
.text-gradient-purple {
|
|
143
|
+
@apply bg-gradient-to-r from-purple-400 to-purple-600 bg-clip-text text-transparent;
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
.text-gradient-blue {
|
|
147
|
+
@apply bg-gradient-to-r from-purple-400 to-purple-600 bg-clip-text text-transparent;
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
/* Glow effects */
|
|
151
|
+
.glow-purple {
|
|
152
|
+
box-shadow: 0 0 20px theme('colors.purple.500/20');
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
.glow-blue {
|
|
156
|
+
box-shadow: 0 0 20px theme('colors.blue.500/20');
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
/* Form elements */
|
|
160
|
+
.aspect-ratio-btn {
|
|
161
|
+
@apply px-3 py-1.5 rounded-lg border border-gray-600 text-gray-300 hover:border-purple-500 hover:text-purple-400 transition-all duration-200 text-sm;
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
.aspect-ratio-btn.active {
|
|
165
|
+
@apply border-purple-500 bg-purple-500/20 text-purple-400 shadow-md shadow-purple-500/25;
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
.slider-thumb {
|
|
169
|
+
@apply appearance-none bg-transparent cursor-pointer;
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
.slider-thumb::-webkit-slider-thumb {
|
|
173
|
+
@apply appearance-none w-3 h-3 bg-gradient-to-r from-purple-500 to-purple-500 rounded-full shadow-lg cursor-pointer hover:shadow-xl hover:shadow-purple-500/30 transition-all duration-200;
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
.slider-thumb::-moz-range-thumb {
|
|
177
|
+
@apply appearance-none w-3 h-3 bg-gradient-to-r from-purple-500 to-purple-500 rounded-full shadow-lg cursor-pointer border-0 hover:shadow-xl hover:shadow-purple-500/30 transition-all duration-200;
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
.slider-thumb::-webkit-slider-track {
|
|
181
|
+
@apply w-full h-1.5 bg-neutral-600/50 rounded-full;
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
.slider-thumb::-moz-range-track {
|
|
185
|
+
@apply w-full h-1.5 bg-neutral-600/50 rounded-full border-0;
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
/* Form control buttons */
|
|
189
|
+
.form-btn {
|
|
190
|
+
@apply w-8 h-8 bg-gradient-to-br from-gray-700 to-gray-800 hover:from-gray-600 hover:to-gray-700 rounded-lg flex items-center justify-center text-gray-300 hover:text-white transition-all duration-200 shadow-sm hover:shadow-md hover:shadow-purple-500/20;
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
.form-btn.active {
|
|
194
|
+
@apply bg-gradient-to-br from-purple-500 to-purple-600 text-white shadow-md shadow-purple-500/25;
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
/* Toolbar buttons */
|
|
198
|
+
.toolbar-btn {
|
|
199
|
+
@apply w-12 max-h-12 rounded-lg flex flex-col items-center justify-center transition-all duration-200 shadow-sm hover:shadow-md;
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
.toolbar-btn.active {
|
|
203
|
+
@apply bg-gradient-to-br from-purple-500 to-purple-600 text-white shadow-lg shadow-purple-500/25;
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
.toolbar-btn:not(.active) {
|
|
207
|
+
@apply text-gray-400 hover:text-white hover:bg-neutral-700/50;
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
/* Props Toolbar buttons */
|
|
211
|
+
.props-toolbar-btn {
|
|
212
|
+
@apply w-14 max-h-14 rounded-lg flex flex-col items-center justify-center transition-all duration-200 shadow-sm hover:shadow-md;
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
.props-toolbar-btn.active {
|
|
216
|
+
@apply bg-gradient-to-br from-purple-500 to-purple-600 text-white shadow-lg shadow-purple-500/25;
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
.props-toolbar-btn:not(.active) {
|
|
220
|
+
@apply text-gray-400 hover:text-white hover:bg-neutral-700/50;
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
@layer utilities {
|
|
224
|
+
/* Text gradients */
|
|
225
|
+
.text-gradient {
|
|
226
|
+
@apply bg-gradient-to-r from-purple-400 to-purple-400 bg-clip-text text-transparent;
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
/* Glow effects */
|
|
230
|
+
.glow-primary {
|
|
231
|
+
box-shadow: 0 0 20px theme('colors.purple.500/20');
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
.glow-accent {
|
|
235
|
+
box-shadow: 0 0 20px theme('colors.blue.500/20');
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
/* Grid layouts */
|
|
239
|
+
.grid-auto-fit {
|
|
240
|
+
grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
.grid-auto-fill {
|
|
244
|
+
grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
/* Backdrop blur utilities */
|
|
248
|
+
.backdrop-blur-sm {
|
|
249
|
+
-webkit-backdrop-filter: blur(4px);
|
|
250
|
+
backdrop-filter: blur(4px);
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
.backdrop-blur-md {
|
|
254
|
+
-webkit-backdrop-filter: blur(12px);
|
|
255
|
+
backdrop-filter: blur(12px);
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
.backdrop-blur-lg {
|
|
259
|
+
-webkit-backdrop-filter: blur(16px);
|
|
260
|
+
backdrop-filter: blur(16px);
|
|
261
|
+
}
|
|
262
|
+
}
|
|
263
|
+
/* Video player customizations */
|
|
264
|
+
video::-webkit-media-controls,
|
|
265
|
+
video::-webkit-media-controls-panel {
|
|
266
|
+
display: none;
|
|
267
|
+
}
|
|
268
|
+
.main-container {
|
|
269
|
+
max-width: calc(100% - 634px);
|
|
270
|
+
}
|
|
271
|
+
/* Custom scrollbar */
|
|
272
|
+
::-webkit-scrollbar {
|
|
273
|
+
width: 6px;
|
|
274
|
+
}
|
|
275
|
+
::-webkit-scrollbar-track {
|
|
276
|
+
background: #374151;
|
|
277
|
+
}
|
|
278
|
+
::-webkit-scrollbar-thumb {
|
|
279
|
+
background: #9333ea;
|
|
280
|
+
border-radius: 3px;
|
|
281
|
+
}
|
|
282
|
+
::-webkit-scrollbar-thumb:hover {
|
|
283
|
+
background: #a855f7;
|
|
284
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
export declare const inputStyles: {
|
|
2
|
+
container: string;
|
|
3
|
+
label: {
|
|
4
|
+
base: string;
|
|
5
|
+
small: string;
|
|
6
|
+
};
|
|
7
|
+
input: {
|
|
8
|
+
base: string;
|
|
9
|
+
small: string;
|
|
10
|
+
};
|
|
11
|
+
range: {
|
|
12
|
+
base: string;
|
|
13
|
+
gradient: string;
|
|
14
|
+
container: string;
|
|
15
|
+
value: string;
|
|
16
|
+
};
|
|
17
|
+
color: {
|
|
18
|
+
container: string;
|
|
19
|
+
picker: string;
|
|
20
|
+
preview: string;
|
|
21
|
+
};
|
|
22
|
+
toggle: {
|
|
23
|
+
base: string;
|
|
24
|
+
active: string;
|
|
25
|
+
inactive: string;
|
|
26
|
+
};
|
|
27
|
+
radio: {
|
|
28
|
+
base: string;
|
|
29
|
+
label: string;
|
|
30
|
+
container: string;
|
|
31
|
+
};
|
|
32
|
+
button: {
|
|
33
|
+
primary: string;
|
|
34
|
+
};
|
|
35
|
+
panel: {
|
|
36
|
+
container: string;
|
|
37
|
+
title: string;
|
|
38
|
+
};
|
|
39
|
+
};
|
package/dist/twick.svg
ADDED
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
import { ProjectJSON, Size, TrackElement } from '@twick/timeline';
|
|
2
|
+
import { VideoEditorConfig } from '@twick/video-editor';
|
|
3
|
+
|
|
4
|
+
export interface MediaItem {
|
|
5
|
+
id: string;
|
|
6
|
+
name: string;
|
|
7
|
+
type: 'video' | 'image' | 'audio';
|
|
8
|
+
url: string;
|
|
9
|
+
thumbnail?: string;
|
|
10
|
+
duration?: number;
|
|
11
|
+
size: number;
|
|
12
|
+
width?: number;
|
|
13
|
+
height?: number;
|
|
14
|
+
createdAt: Date;
|
|
15
|
+
}
|
|
16
|
+
export interface VideoSettings {
|
|
17
|
+
outFile: string;
|
|
18
|
+
fps: number;
|
|
19
|
+
resolution: {
|
|
20
|
+
width: number;
|
|
21
|
+
height: number;
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
export interface Result {
|
|
25
|
+
status: boolean;
|
|
26
|
+
message: string;
|
|
27
|
+
result?: any;
|
|
28
|
+
}
|
|
29
|
+
export interface StudioConfig extends VideoEditorConfig {
|
|
30
|
+
saveProject?: (project: ProjectJSON, fileName: string) => Promise<Result>;
|
|
31
|
+
loadProject?: () => Promise<ProjectJSON>;
|
|
32
|
+
exportVideo?: (project: ProjectJSON, videoSettings: VideoSettings) => Promise<Result>;
|
|
33
|
+
}
|
|
34
|
+
export interface PanelProps {
|
|
35
|
+
selectedElement?: TrackElement | null;
|
|
36
|
+
videoResolution: Size;
|
|
37
|
+
addElement?: (item: TrackElement) => void;
|
|
38
|
+
updateElement?: (item: TrackElement) => void;
|
|
39
|
+
}
|
|
40
|
+
export interface PropertiesPanelProps {
|
|
41
|
+
selectedElement?: TrackElement | null;
|
|
42
|
+
updateElement?: (element: TrackElement) => void;
|
|
43
|
+
}
|
|
44
|
+
export interface TextElement {
|
|
45
|
+
id: string;
|
|
46
|
+
text: string;
|
|
47
|
+
font: string;
|
|
48
|
+
fontSize: number;
|
|
49
|
+
fontWeight: 'normal' | 'bold';
|
|
50
|
+
fontStyle: 'normal' | 'italic';
|
|
51
|
+
textDecoration: 'none' | 'underline' | 'line-through';
|
|
52
|
+
color: string;
|
|
53
|
+
backgroundColor?: string;
|
|
54
|
+
alignment: 'left' | 'center' | 'right' | 'justify';
|
|
55
|
+
verticalAlignment: 'top' | 'middle' | 'bottom';
|
|
56
|
+
position: {
|
|
57
|
+
x: number;
|
|
58
|
+
y: number;
|
|
59
|
+
};
|
|
60
|
+
size: {
|
|
61
|
+
width: number;
|
|
62
|
+
height: number;
|
|
63
|
+
};
|
|
64
|
+
rotation: number;
|
|
65
|
+
borderRadius: {
|
|
66
|
+
topLeft: number;
|
|
67
|
+
topRight: number;
|
|
68
|
+
bottomLeft: number;
|
|
69
|
+
bottomRight: number;
|
|
70
|
+
};
|
|
71
|
+
border?: {
|
|
72
|
+
width: number;
|
|
73
|
+
color: string;
|
|
74
|
+
style: 'solid' | 'dashed' | 'dotted';
|
|
75
|
+
};
|
|
76
|
+
shadow?: {
|
|
77
|
+
x: number;
|
|
78
|
+
y: number;
|
|
79
|
+
blur: number;
|
|
80
|
+
color: string;
|
|
81
|
+
};
|
|
82
|
+
}
|
|
83
|
+
export interface TimelineElement {
|
|
84
|
+
id: string;
|
|
85
|
+
type: 'video' | 'image' | 'audio' | 'text';
|
|
86
|
+
startTime: number;
|
|
87
|
+
endTime: number;
|
|
88
|
+
mediaId?: string;
|
|
89
|
+
textElement?: TextElement;
|
|
90
|
+
volume: number;
|
|
91
|
+
muted: boolean;
|
|
92
|
+
position: {
|
|
93
|
+
x: number;
|
|
94
|
+
y: number;
|
|
95
|
+
};
|
|
96
|
+
size: {
|
|
97
|
+
width: number;
|
|
98
|
+
height: number;
|
|
99
|
+
};
|
|
100
|
+
rotation: number;
|
|
101
|
+
opacity: number;
|
|
102
|
+
effects: string[];
|
|
103
|
+
}
|
|
104
|
+
export interface Track {
|
|
105
|
+
id: string;
|
|
106
|
+
name: string;
|
|
107
|
+
type: 'video' | 'audio' | 'text' | 'subtitle';
|
|
108
|
+
elements: TimelineElement[];
|
|
109
|
+
locked: boolean;
|
|
110
|
+
visible: boolean;
|
|
111
|
+
volume: number;
|
|
112
|
+
muted: boolean;
|
|
113
|
+
height: number;
|
|
114
|
+
color: string;
|
|
115
|
+
}
|
|
116
|
+
export interface Timeline {
|
|
117
|
+
id: string;
|
|
118
|
+
name: string;
|
|
119
|
+
tracks: Track[];
|
|
120
|
+
duration: number;
|
|
121
|
+
fps: number;
|
|
122
|
+
width: number;
|
|
123
|
+
height: number;
|
|
124
|
+
backgroundColor: string;
|
|
125
|
+
createdAt: Date;
|
|
126
|
+
updatedAt: Date;
|
|
127
|
+
}
|
|
128
|
+
export interface ToolCategory {
|
|
129
|
+
id: string;
|
|
130
|
+
name: string;
|
|
131
|
+
icon: string;
|
|
132
|
+
description: string;
|
|
133
|
+
shortcut?: string;
|
|
134
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { MediaItem } from '@twick/video-editor';
|
|
2
|
+
|
|
3
|
+
export type MediaType = "video" | "audio" | "image";
|
|
4
|
+
export interface MediaPanelBaseProps {
|
|
5
|
+
items: MediaItem[];
|
|
6
|
+
searchQuery: string;
|
|
7
|
+
isLoading: boolean;
|
|
8
|
+
acceptFileTypes: string[];
|
|
9
|
+
onSearchChange: (query: string) => void;
|
|
10
|
+
onItemSelect: (item: MediaItem, forceAdd?: boolean) => void;
|
|
11
|
+
onFileUpload: (fileData: {
|
|
12
|
+
file: File;
|
|
13
|
+
blobUrl: string;
|
|
14
|
+
}) => void;
|
|
15
|
+
}
|
|
16
|
+
export interface VideoPanelProps extends MediaPanelBaseProps {
|
|
17
|
+
}
|
|
18
|
+
export interface AudioPanelProps extends MediaPanelBaseProps {
|
|
19
|
+
}
|
|
20
|
+
export interface ImagePanelProps extends MediaPanelBaseProps {
|
|
21
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@twick/studio",
|
|
3
|
+
"version": "0.14.5",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"main": "./dist/index.js",
|
|
6
|
+
"module": "./dist/index.mjs",
|
|
7
|
+
"types": "./dist/index.d.ts",
|
|
8
|
+
"sideEffects": [
|
|
9
|
+
"**/*.css"
|
|
10
|
+
],
|
|
11
|
+
"license": "SEE LICENSE IN LICENSE.md",
|
|
12
|
+
"files": [
|
|
13
|
+
"dist"
|
|
14
|
+
],
|
|
15
|
+
"scripts": {
|
|
16
|
+
"build": "vite build",
|
|
17
|
+
"dev": "vite build --watch",
|
|
18
|
+
"lint": "eslint src/",
|
|
19
|
+
"clean": "rimraf .turbo node_modules dist",
|
|
20
|
+
"docs": "typedoc --options ./typedoc.json"
|
|
21
|
+
},
|
|
22
|
+
"publishConfig": {
|
|
23
|
+
"access": "public"
|
|
24
|
+
},
|
|
25
|
+
"peerDependencies": {
|
|
26
|
+
"@twick/media-utils": "^0.14.5",
|
|
27
|
+
"@twick/timeline": "^0.14.5",
|
|
28
|
+
"@twick/video-editor": "^0.14.5"
|
|
29
|
+
},
|
|
30
|
+
"dependencies": {
|
|
31
|
+
"lucide-react": "^0.511.0",
|
|
32
|
+
"react": "^18.2.0",
|
|
33
|
+
"react-dom": "^18.2.0"
|
|
34
|
+
},
|
|
35
|
+
"devDependencies": {
|
|
36
|
+
"@types/node": "^20.11.24",
|
|
37
|
+
"@types/react": "^18.2.55",
|
|
38
|
+
"@types/react-dom": "^18.2.19",
|
|
39
|
+
"@twick/timeline": "^0.14.5",
|
|
40
|
+
"@twick/video-editor": "^0.14.5",
|
|
41
|
+
"rimraf": "^5.0.5",
|
|
42
|
+
"typedoc": "^0.25.8",
|
|
43
|
+
"typedoc-plugin-markdown": "^3.17.1",
|
|
44
|
+
"typescript": "^5.4.2",
|
|
45
|
+
"vite": "^5.4.20",
|
|
46
|
+
"vite-plugin-dts": "^3.7.3",
|
|
47
|
+
"postcss": "^8.4.35",
|
|
48
|
+
"autoprefixer": "^10.4.17"
|
|
49
|
+
}
|
|
50
|
+
}
|