@twick/studio 0.14.5 → 0.14.6

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 CHANGED
@@ -1,122 +1,147 @@
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
- ## Installation
16
-
17
- ```bash
18
- pnpm add @twick/studio
19
- ```
20
-
21
- ## Quick Start
22
-
23
- ```tsx
24
- import { StudioProvider, VideoEditor } from '@twick/studio';
25
-
26
- function App() {
27
- return (
28
- <StudioProvider>
29
- <VideoEditor />
30
- </StudioProvider>
31
- );
32
- }
33
- ```
34
-
35
- ## Components
36
-
37
- ### VideoEditor
38
-
39
- The main editor component that combines all editing features.
40
-
41
- ```tsx
42
- <VideoEditor
43
- config={{
44
- canvas: {
45
- width: 1920,
46
- height: 1080
47
- }
48
- }}
49
- />
50
- ```
51
-
52
- ### ElementPanel
53
-
54
- Panel for managing different types of elements:
55
- - Videos
56
- - Images
57
- - Audio
58
- - Text
59
- - Icons
60
- - Shapes
61
- - Subtitles
62
-
63
- ```tsx
64
- <ElementPanel
65
- addElement={handleAddElement}
66
- />
67
- ```
68
-
69
- ### TextPanel
70
-
71
- Advanced text editing with features:
72
- - Font selection
73
- - Size control
74
- - Color picker
75
- - Shadow effects
76
- - Stroke settings
77
-
78
- ### IconPanel
79
-
80
- Icon library with features:
81
- - Search functionality
82
- - Category filtering
83
- - Color customization
84
- - Size adjustment
85
-
86
- ## Development
87
-
88
- ### Running Locally
89
-
90
- ```bash
91
- # Install dependencies
92
- pnpm install
93
-
94
- # Start development server
95
- pnpm dev
96
- ```
97
-
98
- ### Building
99
-
100
- ```bash
101
- pnpm build
102
- ```
103
-
104
- ## Browser Support
105
-
106
- Requires modern browsers with support for:
107
- - WebGL
108
- - Canvas API
109
- - Web Audio API
110
- - Modern JavaScript (ES2020+)
111
-
112
- ## License
113
-
114
- This package is licensed under the **Sustainable Use License (SUL) Version 1.0**.
115
-
116
- - Free for use in commercial and non-commercial apps
117
- - Can be modified and self-hosted
118
- - Cannot be sold, rebranded, or distributed as a standalone SDK
119
-
120
- For commercial licensing inquiries, contact: contact@kifferai.com
121
-
122
- For full license terms, see the main LICENSE.md file in the project root.
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 studioConfig={{
38
+ videoProps: {
39
+ width: 720,
40
+ height: 1280,
41
+ },
42
+ }}/>
43
+ </TimelineProvider>
44
+ </LivePlayerProvider>
45
+ );
46
+ }
47
+ ```
48
+
49
+ ## Components
50
+
51
+ ### TwickStudio
52
+
53
+ The main studio component that provides a complete video editing interface.
54
+
55
+ ```tsx
56
+ <TwickStudio
57
+ studioConfig={{
58
+ videoProps: {
59
+ width: 1920,
60
+ height: 1080
61
+ },
62
+ saveProject: async (project, fileName) => {
63
+ // Custom save logic
64
+ return { status: true, message: "Project saved" };
65
+ },
66
+ loadProject: async () => {
67
+ // Custom load logic
68
+ return projectData;
69
+ },
70
+ exportVideo: async (project, videoSettings) => {
71
+ // Custom export logic
72
+ return { status: true, message: "Video exported" };
73
+ }
74
+ }}
75
+ />
76
+ ```
77
+
78
+ ### StudioConfig
79
+
80
+ Configuration options for the studio:
81
+
82
+ ```tsx
83
+ interface StudioConfig {
84
+ videoProps?: {
85
+ width: number;
86
+ height: number;
87
+ };
88
+ saveProject?: (project: ProjectJSON, fileName: string) => Promise<Result>;
89
+ loadProject?: () => Promise<ProjectJSON>;
90
+ exportVideo?: (project: ProjectJSON, videoSettings: VideoSettings) => Promise<Result>;
91
+ }
92
+ ```
93
+
94
+ ### Individual Panels
95
+
96
+ The studio includes specialized panels for different element types:
97
+
98
+ - **AudioPanel**: Audio management and library
99
+ - **VideoPanel**: Video management and library
100
+ - **ImagePanel**: Image management and library
101
+ - **TextPanel**: Text editing with advanced styling
102
+ - **SubtitlesPanel**: Subtitle and caption management
103
+ - **CirclePanel**: Circle shape creation and editing
104
+ - **RectPanel**: Rectangle shape creation and editing
105
+ - **IconPanel**: Icon library with search and customization
106
+
107
+ ### Hooks
108
+
109
+ - **useStudioManager**: Hook for managing studio state, selected tools, and element manipulation
110
+
111
+ ## Development
112
+
113
+ ### Running Locally
114
+
115
+ ```bash
116
+ # Install dependencies
117
+ pnpm install
118
+
119
+ # Start development server
120
+ pnpm dev
121
+ ```
122
+
123
+ ### Building
124
+
125
+ ```bash
126
+ pnpm build
127
+ ```
128
+
129
+ ## Browser Support
130
+
131
+ Requires modern browsers with support for:
132
+ - WebGL
133
+ - Canvas API
134
+ - Web Audio API
135
+ - Modern JavaScript (ES2020+)
136
+
137
+ ## License
138
+
139
+ This package is licensed under the **Sustainable Use License (SUL) Version 1.0**.
140
+
141
+ - Free for use in commercial and non-commercial apps
142
+ - Can be modified and self-hosted
143
+ - Cannot be sold, rebranded, or distributed as a standalone SDK
144
+
145
+ For commercial licensing inquiries, contact: contact@kifferai.com
146
+
147
+ For full license terms, see the main LICENSE.md file in the project root.
@@ -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, hasMore, totalIcons, searchQuery, handleSearch, handleSelection, handleDownloadIcon, handleLoadMore, }: IconPanelProps): import("react/jsx-runtime").JSX.Element;
4
+ export declare function IconPanel({ icons, loading, totalIcons, searchQuery, handleSearch, handleSelection, handleDownloadIcon, handleLoadMore, }: IconPanelProps): 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;
@@ -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 | null;
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;
@@ -13,6 +13,7 @@ export interface CirclePanelState {
13
13
  opacity: number;
14
14
  strokeColor: string;
15
15
  lineWidth: number;
16
+ operation: string;
16
17
  }
17
18
  export interface CirclePanelActions {
18
19
  setRadius: (radius: number) => void;
@@ -13,6 +13,7 @@ export interface RectPanelState {
13
13
  opacity: number;
14
14
  strokeColor: string;
15
15
  lineWidth: number;
16
+ operation: string;
16
17
  }
17
18
  export interface RectPanelActions {
18
19
  setCornerRadius: (radius: number) => void;