@twick/studio 0.14.5 → 0.14.7
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 +214 -122
- package/dist/components/panel/audio-panel.d.ts +1 -1
- package/dist/components/panel/circle-panel.d.ts +1 -1
- package/dist/components/panel/icon-panel.d.ts +1 -1
- package/dist/components/panel/image-panel.d.ts +1 -1
- package/dist/components/panel/rect-panel.d.ts +1 -1
- package/dist/components/panel/video-panel.d.ts +1 -1
- package/dist/components/props-toolbar.d.ts +1 -1
- package/dist/components/shared/file-input.d.ts +3 -1
- package/dist/components/shared/index.d.ts +1 -0
- package/dist/components/shared/url-input.d.ts +6 -0
- package/dist/hooks/use-circle-panel.d.ts +1 -0
- package/dist/hooks/use-rect-panel.d.ts +1 -0
- package/dist/index.js +671 -669
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +671 -669
- package/dist/index.mjs.map +1 -1
- package/dist/studio.css +2176 -284
- package/dist/twick.svg +3 -3
- package/dist/types/media-panel.d.ts +11 -6
- package/package.json +48 -50
- package/dist/components/shared/prop-container.d.ts +0 -7
- package/dist/styles/input-styles.d.ts +0 -39
package/README.md
CHANGED
|
@@ -1,122 +1,214 @@
|
|
|
1
|
-
# @twick/studio
|
|
2
|
-
|
|
3
|
-
The main video editing interface for Twick, providing a professional-grade editing experience in the browser.
|
|
4
|
-
|
|
5
|
-
## Features
|
|
6
|
-
|
|
7
|
-
- **Modern Interface**: Clean, intuitive dark theme design
|
|
8
|
-
- **Media Management**: Integrated video, audio, and image library
|
|
9
|
-
- **Text Tools**: Advanced text editing with multiple fonts and styles
|
|
10
|
-
- **Timeline Control**: Precise timeline-based editing
|
|
11
|
-
- **Element Library**: Rich set of editing elements (shapes, icons, etc.)
|
|
12
|
-
- **Audio Support**: Audio track management and editing
|
|
13
|
-
- **Effects**: Visual effects and transitions
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
```
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
#
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
1
|
+
# @twick/studio
|
|
2
|
+
|
|
3
|
+
The main video editing interface for Twick, providing a professional-grade editing experience in the browser.
|
|
4
|
+
|
|
5
|
+
## Features
|
|
6
|
+
|
|
7
|
+
- **Modern Interface**: Clean, intuitive dark theme design
|
|
8
|
+
- **Media Management**: Integrated video, audio, and image library
|
|
9
|
+
- **Text Tools**: Advanced text editing with multiple fonts and styles
|
|
10
|
+
- **Timeline Control**: Precise timeline-based editing
|
|
11
|
+
- **Element Library**: Rich set of editing elements (shapes, icons, etc.)
|
|
12
|
+
- **Audio Support**: Audio track management and editing
|
|
13
|
+
- **Effects**: Visual effects and transitions
|
|
14
|
+
- **Project Management**: Save, load, and export video projects
|
|
15
|
+
|
|
16
|
+
## Installation
|
|
17
|
+
|
|
18
|
+
```bash
|
|
19
|
+
pnpm add @twick/timeline @twick/live-player @twick/studio
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
## Quick Start
|
|
23
|
+
|
|
24
|
+
```tsx
|
|
25
|
+
import { LivePlayerProvider } from "@twick/live-player";
|
|
26
|
+
import { TwickStudio } from "@twick/studio";
|
|
27
|
+
import { TimelineProvider, INITIAL_TIMELINE_DATA } from "@twick/timeline";
|
|
28
|
+
import "@twick/studio/dist/studio.css";
|
|
29
|
+
|
|
30
|
+
export default function App() {
|
|
31
|
+
return (
|
|
32
|
+
<LivePlayerProvider>
|
|
33
|
+
<TimelineProvider
|
|
34
|
+
initialData={INITIAL_TIMELINE_DATA}
|
|
35
|
+
contextId={"studio-demo"}
|
|
36
|
+
>
|
|
37
|
+
<TwickStudio
|
|
38
|
+
studioConfig={{
|
|
39
|
+
videoProps: {
|
|
40
|
+
width: 720,
|
|
41
|
+
height: 1280,
|
|
42
|
+
},
|
|
43
|
+
// Optional: Customize timeline tick marks
|
|
44
|
+
timelineTickConfigs: [
|
|
45
|
+
{ durationThreshold: 30, majorInterval: 5, minorTicks: 5 },
|
|
46
|
+
{ durationThreshold: 300, majorInterval: 30, minorTicks: 6 }
|
|
47
|
+
],
|
|
48
|
+
// Optional: Customize zoom behavior
|
|
49
|
+
timelineZoomConfig: {
|
|
50
|
+
min: 0.5, max: 2.0, step: 0.25, default: 1.0
|
|
51
|
+
},
|
|
52
|
+
// Optional: Customize element colors
|
|
53
|
+
elementColors: {
|
|
54
|
+
video: "#8B5FBF",
|
|
55
|
+
audio: "#3D8B8B",
|
|
56
|
+
image: "#D4956C",
|
|
57
|
+
text: "#A78EC8",
|
|
58
|
+
caption: "#9B8ACE",
|
|
59
|
+
fragment: "#1A1A1A"
|
|
60
|
+
}
|
|
61
|
+
}}
|
|
62
|
+
/>
|
|
63
|
+
</TimelineProvider>
|
|
64
|
+
</LivePlayerProvider>
|
|
65
|
+
);
|
|
66
|
+
}
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
## Components
|
|
70
|
+
|
|
71
|
+
### TwickStudio
|
|
72
|
+
|
|
73
|
+
The main studio component that provides a complete video editing interface.
|
|
74
|
+
|
|
75
|
+
```tsx
|
|
76
|
+
<TwickStudio
|
|
77
|
+
studioConfig={{
|
|
78
|
+
videoProps: {
|
|
79
|
+
width: 1920,
|
|
80
|
+
height: 1080
|
|
81
|
+
},
|
|
82
|
+
// Optional: Customize timeline tick marks
|
|
83
|
+
timelineTickConfigs: [
|
|
84
|
+
{ durationThreshold: 30, majorInterval: 5, minorTicks: 5 },
|
|
85
|
+
{ durationThreshold: 300, majorInterval: 30, minorTicks: 6 }
|
|
86
|
+
],
|
|
87
|
+
// Optional: Customize zoom behavior
|
|
88
|
+
timelineZoomConfig: {
|
|
89
|
+
min: 0.5, max: 2.0, step: 0.25, default: 1.0
|
|
90
|
+
},
|
|
91
|
+
// Optional: Customize element colors
|
|
92
|
+
elementColors: {
|
|
93
|
+
video: "#8B5FBF",
|
|
94
|
+
audio: "#3D8B8B",
|
|
95
|
+
image: "#D4956C",
|
|
96
|
+
text: "#A78EC8",
|
|
97
|
+
caption: "#9B8ACE",
|
|
98
|
+
fragment: "#1A1A1A"
|
|
99
|
+
},
|
|
100
|
+
saveProject: async (project, fileName) => {
|
|
101
|
+
// Custom save logic
|
|
102
|
+
return { status: true, message: "Project saved" };
|
|
103
|
+
},
|
|
104
|
+
loadProject: async () => {
|
|
105
|
+
// Custom load logic
|
|
106
|
+
return projectData;
|
|
107
|
+
},
|
|
108
|
+
exportVideo: async (project, videoSettings) => {
|
|
109
|
+
// Custom export logic
|
|
110
|
+
return { status: true, message: "Video exported" };
|
|
111
|
+
}
|
|
112
|
+
}}
|
|
113
|
+
/>
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
### StudioConfig
|
|
117
|
+
|
|
118
|
+
Configuration options for the studio:
|
|
119
|
+
|
|
120
|
+
```tsx
|
|
121
|
+
interface StudioConfig {
|
|
122
|
+
videoProps?: {
|
|
123
|
+
width: number;
|
|
124
|
+
height: number;
|
|
125
|
+
};
|
|
126
|
+
// Timeline tick configuration
|
|
127
|
+
timelineTickConfigs?: TimelineTickConfig[];
|
|
128
|
+
// Zoom configuration
|
|
129
|
+
timelineZoomConfig?: TimelineZoomConfig;
|
|
130
|
+
// Element colors
|
|
131
|
+
elementColors?: ElementColors;
|
|
132
|
+
// Project management callbacks
|
|
133
|
+
saveProject?: (project: ProjectJSON, fileName: string) => Promise<Result>;
|
|
134
|
+
loadProject?: () => Promise<ProjectJSON>;
|
|
135
|
+
exportVideo?: (project: ProjectJSON, videoSettings: VideoSettings) => Promise<Result>;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
interface TimelineTickConfig {
|
|
139
|
+
durationThreshold: number; // Applies when duration < threshold
|
|
140
|
+
majorInterval: number; // Major tick interval in seconds
|
|
141
|
+
minorTicks: number; // Number of minor ticks between majors
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
interface TimelineZoomConfig {
|
|
145
|
+
min: number; // Minimum zoom level
|
|
146
|
+
max: number; // Maximum zoom level
|
|
147
|
+
step: number; // Zoom step increment/decrement
|
|
148
|
+
default: number; // Default zoom level
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
interface ElementColors {
|
|
152
|
+
video: string;
|
|
153
|
+
audio: string;
|
|
154
|
+
image: string;
|
|
155
|
+
text: string;
|
|
156
|
+
caption: string;
|
|
157
|
+
fragment: string;
|
|
158
|
+
}
|
|
159
|
+
```
|
|
160
|
+
|
|
161
|
+
### Individual Panels
|
|
162
|
+
|
|
163
|
+
The studio includes specialized panels for different element types:
|
|
164
|
+
|
|
165
|
+
- **AudioPanel**: Audio management and library
|
|
166
|
+
- **VideoPanel**: Video management and library
|
|
167
|
+
- **ImagePanel**: Image management and library
|
|
168
|
+
- **TextPanel**: Text editing with advanced styling
|
|
169
|
+
- **SubtitlesPanel**: Subtitle and caption management
|
|
170
|
+
- **CirclePanel**: Circle shape creation and editing
|
|
171
|
+
- **RectPanel**: Rectangle shape creation and editing
|
|
172
|
+
- **IconPanel**: Icon library with search and customization
|
|
173
|
+
|
|
174
|
+
### Hooks
|
|
175
|
+
|
|
176
|
+
- **useStudioManager**: Hook for managing studio state, selected tools, and element manipulation
|
|
177
|
+
|
|
178
|
+
## Development
|
|
179
|
+
|
|
180
|
+
### Running Locally
|
|
181
|
+
|
|
182
|
+
```bash
|
|
183
|
+
# Install dependencies
|
|
184
|
+
pnpm install
|
|
185
|
+
|
|
186
|
+
# Start development server
|
|
187
|
+
pnpm dev
|
|
188
|
+
```
|
|
189
|
+
|
|
190
|
+
### Building
|
|
191
|
+
|
|
192
|
+
```bash
|
|
193
|
+
pnpm build
|
|
194
|
+
```
|
|
195
|
+
|
|
196
|
+
## Browser Support
|
|
197
|
+
|
|
198
|
+
Requires modern browsers with support for:
|
|
199
|
+
- WebGL
|
|
200
|
+
- Canvas API
|
|
201
|
+
- Web Audio API
|
|
202
|
+
- Modern JavaScript (ES2020+)
|
|
203
|
+
|
|
204
|
+
## License
|
|
205
|
+
|
|
206
|
+
This package is licensed under the **Sustainable Use License (SUL) Version 1.0**.
|
|
207
|
+
|
|
208
|
+
- Free for use in commercial and non-commercial apps
|
|
209
|
+
- Can be modified and self-hosted
|
|
210
|
+
- Cannot be sold, rebranded, or distributed as a standalone SDK
|
|
211
|
+
|
|
212
|
+
For commercial licensing inquiries, contact: contact@kifferai.com
|
|
213
|
+
|
|
214
|
+
For full license terms, see the main LICENSE.md file in the project root.
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { AudioPanelProps } from '../../types/media-panel';
|
|
2
2
|
|
|
3
|
-
export declare const AudioPanel: ({ items,
|
|
3
|
+
export declare const AudioPanel: ({ items, onItemSelect, onFileUpload, acceptFileTypes, onUrlAdd, }: AudioPanelProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { CirclePanelState, CirclePanelActions } from '../../hooks/use-circle-panel';
|
|
2
2
|
|
|
3
3
|
export type CirclePanelProps = CirclePanelState & CirclePanelActions;
|
|
4
|
-
export declare function CirclePanel({ radius, fillColor, opacity, strokeColor, lineWidth, setRadius, setFillColor, setOpacity, setStrokeColor, setLineWidth, handleApplyChanges, }: CirclePanelProps): import("react/jsx-runtime").JSX.Element;
|
|
4
|
+
export declare function CirclePanel({ radius, fillColor, opacity, strokeColor, lineWidth, operation, setRadius, setFillColor, setOpacity, setStrokeColor, setLineWidth, handleApplyChanges, }: CirclePanelProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { IconPanelState, IconPanelActions } from '../../hooks/use-icon-panel';
|
|
2
2
|
|
|
3
3
|
export type IconPanelProps = IconPanelState & IconPanelActions;
|
|
4
|
-
export declare function IconPanel({ icons, loading,
|
|
4
|
+
export declare function IconPanel({ icons, loading, totalIcons, searchQuery, handleSearch, handleSelection, handleDownloadIcon, handleLoadMore, }: IconPanelProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { ImagePanelProps } from '../../types/media-panel';
|
|
2
2
|
|
|
3
|
-
export declare function ImagePanel({ items,
|
|
3
|
+
export declare function ImagePanel({ items, onItemSelect, onFileUpload, acceptFileTypes, onUrlAdd, }: ImagePanelProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { RectPanelState, RectPanelActions } from '../../hooks/use-rect-panel';
|
|
2
2
|
|
|
3
3
|
export type RectPanelProps = RectPanelState & RectPanelActions;
|
|
4
|
-
export declare function RectPanel({ cornerRadius, fillColor, opacity, strokeColor, lineWidth, setCornerRadius, setFillColor, setOpacity, setStrokeColor, setLineWidth, handleApplyChanges, }: RectPanelProps): import("react/jsx-runtime").JSX.Element;
|
|
4
|
+
export declare function RectPanel({ cornerRadius, fillColor, opacity, strokeColor, lineWidth, operation, setCornerRadius, setFillColor, setOpacity, setStrokeColor, setLineWidth, handleApplyChanges, }: RectPanelProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { VideoPanelProps } from '../../types/media-panel';
|
|
2
2
|
|
|
3
|
-
export declare function VideoPanel({ items,
|
|
3
|
+
export declare function VideoPanel({ items, onItemSelect, onFileUpload, acceptFileTypes, onUrlAdd, }: VideoPanelProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -4,4 +4,4 @@ export declare function PropsToolbar({ selectedElement, selectedProp, setSelecte
|
|
|
4
4
|
selectedElement: TrackElement | null;
|
|
5
5
|
selectedProp: string;
|
|
6
6
|
setSelectedProp: (prop: string) => void;
|
|
7
|
-
}): import("react/jsx-runtime").JSX.Element
|
|
7
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
declare const FileInput: ({ acceptFileTypes, onFileLoad, buttonText, id, }: {
|
|
1
|
+
declare const FileInput: ({ acceptFileTypes, onFileLoad, buttonText, id, className, icon, }: {
|
|
2
2
|
acceptFileTypes: string[];
|
|
3
3
|
onFileLoad: (content: any) => void;
|
|
4
4
|
buttonText: string;
|
|
5
5
|
id: string;
|
|
6
|
+
className?: string;
|
|
7
|
+
icon?: React.ReactNode;
|
|
6
8
|
}) => import("react/jsx-runtime").JSX.Element;
|
|
7
9
|
export default FileInput;
|