@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/README.md
ADDED
|
@@ -0,0 +1,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
|
+
|
|
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.
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Size, TrackElement } from '@twick/timeline';
|
|
2
|
+
|
|
3
|
+
interface ElementPanelContainerProps {
|
|
4
|
+
selectedTool: string;
|
|
5
|
+
selectedElement: TrackElement | null;
|
|
6
|
+
videoResolution: Size;
|
|
7
|
+
setSelectedTool: (tool: string) => void;
|
|
8
|
+
addElement: (element: TrackElement) => void;
|
|
9
|
+
updateElement: (element: TrackElement) => void;
|
|
10
|
+
}
|
|
11
|
+
declare const ElementPanelContainer: ({ selectedTool, setSelectedTool, videoResolution, selectedElement, addElement, updateElement, }: ElementPanelContainerProps) => JSX.Element;
|
|
12
|
+
export default ElementPanelContainer;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { TrackElement } from '@twick/timeline';
|
|
2
|
+
|
|
3
|
+
interface PropertiesPanelContainerProps {
|
|
4
|
+
selectedProp: string;
|
|
5
|
+
selectedElement: TrackElement | null;
|
|
6
|
+
updateElement: (element: TrackElement) => void;
|
|
7
|
+
}
|
|
8
|
+
export declare function PropertiesPanelContainer({ selectedProp, selectedElement, updateElement, }: PropertiesPanelContainerProps): import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { TrackElement } from '@twick/timeline';
|
|
2
|
+
|
|
3
|
+
interface TextPanelContainerProps {
|
|
4
|
+
selectedElement: TrackElement | null;
|
|
5
|
+
addElement: (element: TrackElement) => void;
|
|
6
|
+
updateElement: (element: TrackElement) => void;
|
|
7
|
+
}
|
|
8
|
+
export declare function TextPanelContainer(props: TextPanelContainerProps): import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Size } from '@twick/timeline';
|
|
2
|
+
|
|
3
|
+
interface StudioHeaderProps {
|
|
4
|
+
setVideoResolution: (resolution: Size) => void;
|
|
5
|
+
onLoadProject: () => void;
|
|
6
|
+
onSaveProject: () => void;
|
|
7
|
+
onExportVideo: () => void;
|
|
8
|
+
}
|
|
9
|
+
export declare const StudioHeader: ({ setVideoResolution, onLoadProject, onSaveProject, onExportVideo, }: StudioHeaderProps) => import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
export default StudioHeader;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { CirclePanelState, CirclePanelActions } from '../../hooks/use-circle-panel';
|
|
2
|
+
|
|
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;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { IconPanelState, IconPanelActions } from '../../hooks/use-icon-panel';
|
|
2
|
+
|
|
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;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { RectPanelState, RectPanelActions } from '../../hooks/use-rect-panel';
|
|
2
|
+
|
|
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;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* SubtitlesPanel Component
|
|
3
|
+
*
|
|
4
|
+
* A panel for managing video subtitles in the studio. Provides functionality
|
|
5
|
+
* for creating, editing, and managing subtitle entries with timing and text.
|
|
6
|
+
* Supports both manual entry and automatic generation (TODO).
|
|
7
|
+
*
|
|
8
|
+
* @component
|
|
9
|
+
* @example
|
|
10
|
+
* ```tsx
|
|
11
|
+
* <SubtitlesPanel />
|
|
12
|
+
* ```
|
|
13
|
+
*
|
|
14
|
+
* Features:
|
|
15
|
+
* - Add/delete subtitle entries
|
|
16
|
+
* - Set start/end times
|
|
17
|
+
* - Edit subtitle text
|
|
18
|
+
* - Automatic subtitle generation (planned)
|
|
19
|
+
* - Save subtitles to timeline
|
|
20
|
+
*
|
|
21
|
+
* Each subtitle entry includes:
|
|
22
|
+
* - Start time (in seconds)
|
|
23
|
+
* - End time (in seconds)
|
|
24
|
+
* - Subtitle text
|
|
25
|
+
* - Delete and save actions
|
|
26
|
+
*/
|
|
27
|
+
export declare function SubtitlesPanel(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { TextPanelState, TextPanelActions } from '../../hooks/use-text-panel';
|
|
2
|
+
|
|
3
|
+
export type TextPanelProps = TextPanelState & TextPanelActions;
|
|
4
|
+
export declare function TextPanel({ textContent, fontSize, selectedFont, isBold, isItalic, textColor, strokeColor, applyShadow, shadowColor, strokeWidth, fonts, operation, setTextContent, setFontSize, setSelectedFont, setIsBold, setIsItalic, setTextColor, setStrokeColor, setApplyShadow, setShadowColor, setStrokeWidth, handleApplyChanges, }: TextPanelProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { PropertiesPanelProps } from '../../types';
|
|
2
|
+
|
|
3
|
+
export declare const CAPTION_STYLE: {
|
|
4
|
+
WORD_BG_HIGHLIGHT: string;
|
|
5
|
+
WORD_BY_WORD: string;
|
|
6
|
+
WORD_BY_WORD_WITH_BG: string;
|
|
7
|
+
};
|
|
8
|
+
export declare const CAPTION_STYLE_OPTIONS: {
|
|
9
|
+
[CAPTION_STYLE.WORD_BG_HIGHLIGHT]: {
|
|
10
|
+
label: string;
|
|
11
|
+
value: string;
|
|
12
|
+
};
|
|
13
|
+
[CAPTION_STYLE.WORD_BY_WORD]: {
|
|
14
|
+
label: string;
|
|
15
|
+
value: string;
|
|
16
|
+
};
|
|
17
|
+
[CAPTION_STYLE.WORD_BY_WORD_WITH_BG]: {
|
|
18
|
+
label: string;
|
|
19
|
+
value: string;
|
|
20
|
+
};
|
|
21
|
+
};
|
|
22
|
+
export declare const CAPTION_FONT: {
|
|
23
|
+
size: number;
|
|
24
|
+
family: string;
|
|
25
|
+
};
|
|
26
|
+
export declare const CAPTION_COLOR: {
|
|
27
|
+
text: string;
|
|
28
|
+
highlight: string;
|
|
29
|
+
bgColor: string;
|
|
30
|
+
};
|
|
31
|
+
interface SubtitlePropPanelProps {
|
|
32
|
+
setApplyPropsToAllSubtitle: (apply: boolean) => void;
|
|
33
|
+
}
|
|
34
|
+
export declare function SubtitlePropPanel({ selectedElement, updateElement, setApplyPropsToAllSubtitle, }: SubtitlePropPanelProps & PropertiesPanelProps): import("react/jsx-runtime").JSX.Element | null;
|
|
35
|
+
export default SubtitlePropPanel;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { TrackElement } from '@twick/timeline';
|
|
2
|
+
|
|
3
|
+
export declare function PropsToolbar({ selectedElement, selectedProp, setSelectedProp, }: {
|
|
4
|
+
selectedElement: TrackElement | null;
|
|
5
|
+
selectedProp: string;
|
|
6
|
+
setSelectedProp: (prop: string) => void;
|
|
7
|
+
}): import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
interface AccordionItemProps {
|
|
2
|
+
title: string;
|
|
3
|
+
icon: React.ReactNode;
|
|
4
|
+
children: React.ReactNode;
|
|
5
|
+
isOpen: boolean;
|
|
6
|
+
onToggle: () => void;
|
|
7
|
+
}
|
|
8
|
+
export declare function AccordionItem({ title, icon, children, isOpen, onToggle }: AccordionItemProps): import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Toolbar Component
|
|
3
|
+
*
|
|
4
|
+
* A vertical toolbar that provides quick access to different editing tools
|
|
5
|
+
* and media types. Displays icons with labels and optional keyboard shortcuts.
|
|
6
|
+
*
|
|
7
|
+
* @component
|
|
8
|
+
* @param {Object} props
|
|
9
|
+
* @param {string} props.selectedTool - Currently selected tool ID
|
|
10
|
+
* @param {(tool: string) => void} props.setSelectedTool - Callback to update selected tool
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* ```tsx
|
|
14
|
+
* <Toolbar
|
|
15
|
+
* selectedTool="text"
|
|
16
|
+
* setSelectedTool={(tool) => console.log(`Selected ${tool}`)}
|
|
17
|
+
* />
|
|
18
|
+
* ```
|
|
19
|
+
*/
|
|
20
|
+
export declare function Toolbar({ selectedTool, setSelectedTool }: {
|
|
21
|
+
selectedTool: string;
|
|
22
|
+
setSelectedTool: (tool: string) => void;
|
|
23
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { MediaItem } from '@twick/video-editor';
|
|
3
|
+
|
|
4
|
+
type MediaType = "video" | "audio" | "image";
|
|
5
|
+
export declare function MediaProvider({ children }: {
|
|
6
|
+
children: ReactNode;
|
|
7
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
export declare function useMedia(type: MediaType): {
|
|
9
|
+
items: MediaItem[];
|
|
10
|
+
searchQuery: string;
|
|
11
|
+
isLoading: boolean;
|
|
12
|
+
setSearchQuery: (query: string) => void;
|
|
13
|
+
addItem: (item: MediaItem) => void;
|
|
14
|
+
};
|
|
15
|
+
export {};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { MediaItem } from '@twick/video-editor';
|
|
3
|
+
|
|
4
|
+
interface VideoPanelContextType {
|
|
5
|
+
items: MediaItem[];
|
|
6
|
+
searchQuery: string;
|
|
7
|
+
setSearchQuery: (query: string) => void;
|
|
8
|
+
addItem: (item: MediaItem) => void;
|
|
9
|
+
isLoading: boolean;
|
|
10
|
+
}
|
|
11
|
+
export declare function VideoPanelProvider({ children }: {
|
|
12
|
+
children: ReactNode;
|
|
13
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
export declare function useVideoPanel(): VideoPanelContextType;
|
|
15
|
+
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { MediaItem } from '@twick/video-editor';
|
|
2
|
+
|
|
3
|
+
export interface AudioPreviewState {
|
|
4
|
+
playingAudio: string | null;
|
|
5
|
+
audioElement: HTMLAudioElement | null;
|
|
6
|
+
}
|
|
7
|
+
export interface AudioPreviewActions {
|
|
8
|
+
togglePlayPause: (item: MediaItem) => void;
|
|
9
|
+
stopPlayback: () => void;
|
|
10
|
+
}
|
|
11
|
+
export declare const useAudioPreview: () => AudioPreviewState & AudioPreviewActions;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { TrackElement } from '@twick/timeline';
|
|
2
|
+
|
|
3
|
+
export declare const DEFAULT_CIRCLE_PROPS: {
|
|
4
|
+
radius: number;
|
|
5
|
+
fillColor: string;
|
|
6
|
+
opacity: number;
|
|
7
|
+
strokeColor: string;
|
|
8
|
+
lineWidth: number;
|
|
9
|
+
};
|
|
10
|
+
export interface CirclePanelState {
|
|
11
|
+
radius: number;
|
|
12
|
+
fillColor: string;
|
|
13
|
+
opacity: number;
|
|
14
|
+
strokeColor: string;
|
|
15
|
+
lineWidth: number;
|
|
16
|
+
}
|
|
17
|
+
export interface CirclePanelActions {
|
|
18
|
+
setRadius: (radius: number) => void;
|
|
19
|
+
setFillColor: (color: string) => void;
|
|
20
|
+
setOpacity: (opacity: number) => void;
|
|
21
|
+
setStrokeColor: (color: string) => void;
|
|
22
|
+
setLineWidth: (width: number) => void;
|
|
23
|
+
handleApplyChanges: () => void;
|
|
24
|
+
}
|
|
25
|
+
export declare const useCirclePanel: ({ selectedElement, addElement, updateElement, }: {
|
|
26
|
+
selectedElement: TrackElement | null;
|
|
27
|
+
addElement: (element: TrackElement) => void;
|
|
28
|
+
updateElement: (element: TrackElement) => void;
|
|
29
|
+
}) => CirclePanelState & CirclePanelActions;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { TrackElement } from '@twick/timeline';
|
|
2
|
+
|
|
3
|
+
export interface Icon {
|
|
4
|
+
name: string;
|
|
5
|
+
svg: string;
|
|
6
|
+
}
|
|
7
|
+
export interface IconPanelState {
|
|
8
|
+
icons: Icon[];
|
|
9
|
+
loading: boolean;
|
|
10
|
+
hasMore: boolean;
|
|
11
|
+
totalIcons: number;
|
|
12
|
+
searchQuery: string;
|
|
13
|
+
}
|
|
14
|
+
export interface IconPanelActions {
|
|
15
|
+
handleSearch: (query: string) => void;
|
|
16
|
+
handleSelection: (icon: Icon) => void;
|
|
17
|
+
handleDownloadIcon: (icon: Icon) => void;
|
|
18
|
+
handleLoadMore: () => void;
|
|
19
|
+
}
|
|
20
|
+
export declare const useIconPanel: ({ selectedElement, addElement, updateElement, }: {
|
|
21
|
+
selectedElement: TrackElement | null;
|
|
22
|
+
addElement: (element: TrackElement) => void;
|
|
23
|
+
updateElement: (element: TrackElement) => void;
|
|
24
|
+
}) => IconPanelState & IconPanelActions;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { TrackElement, Size } from '@twick/timeline';
|
|
2
|
+
import { MediaItem } from '@twick/video-editor';
|
|
3
|
+
|
|
4
|
+
export interface MediaPanelState {
|
|
5
|
+
items: MediaItem[];
|
|
6
|
+
searchQuery: string;
|
|
7
|
+
isLoading: boolean;
|
|
8
|
+
acceptFileTypes: string[];
|
|
9
|
+
}
|
|
10
|
+
export interface MediaPanelActions {
|
|
11
|
+
setSearchQuery: (query: string) => void;
|
|
12
|
+
handleSelection: (item: MediaItem, forceAdd?: boolean) => void;
|
|
13
|
+
handleFileUpload: (fileData: {
|
|
14
|
+
file: File;
|
|
15
|
+
blobUrl: string;
|
|
16
|
+
}) => void;
|
|
17
|
+
}
|
|
18
|
+
export type MediaType = "video" | "audio" | "image";
|
|
19
|
+
export declare const useMediaPanel: (type: MediaType, { selectedElement, addElement, updateElement, }: {
|
|
20
|
+
selectedElement: TrackElement | null;
|
|
21
|
+
addElement: (element: TrackElement) => void;
|
|
22
|
+
updateElement: (element: TrackElement) => void;
|
|
23
|
+
}, videoResolution: Size) => MediaPanelState & MediaPanelActions;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { TrackElement } from '@twick/timeline';
|
|
2
|
+
|
|
3
|
+
export declare const DEFAULT_RECT_PROPS: {
|
|
4
|
+
cornerRadius: number;
|
|
5
|
+
fillColor: string;
|
|
6
|
+
opacity: number;
|
|
7
|
+
strokeColor: string;
|
|
8
|
+
lineWidth: number;
|
|
9
|
+
};
|
|
10
|
+
export interface RectPanelState {
|
|
11
|
+
cornerRadius: number;
|
|
12
|
+
fillColor: string;
|
|
13
|
+
opacity: number;
|
|
14
|
+
strokeColor: string;
|
|
15
|
+
lineWidth: number;
|
|
16
|
+
}
|
|
17
|
+
export interface RectPanelActions {
|
|
18
|
+
setCornerRadius: (radius: number) => void;
|
|
19
|
+
setFillColor: (color: string) => void;
|
|
20
|
+
setOpacity: (opacity: number) => void;
|
|
21
|
+
setStrokeColor: (color: string) => void;
|
|
22
|
+
setLineWidth: (width: number) => void;
|
|
23
|
+
handleApplyChanges: () => void;
|
|
24
|
+
}
|
|
25
|
+
export declare const useRectPanel: ({ selectedElement, addElement, updateElement, }: {
|
|
26
|
+
selectedElement: TrackElement | null;
|
|
27
|
+
addElement: (element: TrackElement) => void;
|
|
28
|
+
updateElement: (element: TrackElement) => void;
|
|
29
|
+
}) => RectPanelState & RectPanelActions;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { TrackElement } from '@twick/timeline';
|
|
2
|
+
|
|
3
|
+
export declare const useStudioManager: () => {
|
|
4
|
+
selectedProp: string;
|
|
5
|
+
setSelectedProp: import('react').Dispatch<import('react').SetStateAction<string>>;
|
|
6
|
+
selectedTool: string;
|
|
7
|
+
setSelectedTool: import('react').Dispatch<import('react').SetStateAction<string>>;
|
|
8
|
+
selectedElement: TrackElement | null;
|
|
9
|
+
addElement: (element: TrackElement) => void;
|
|
10
|
+
updateElement: (element: TrackElement) => void;
|
|
11
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { StudioConfig } from '../types';
|
|
2
|
+
|
|
3
|
+
declare const useStudioOperation: (studioConfig?: StudioConfig) => {
|
|
4
|
+
onLoadProject: () => Promise<void>;
|
|
5
|
+
onSaveProject: () => Promise<void>;
|
|
6
|
+
onExportVideo: () => Promise<void>;
|
|
7
|
+
};
|
|
8
|
+
export default useStudioOperation;
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { TrackElement, TextAlign } from '@twick/timeline';
|
|
2
|
+
|
|
3
|
+
export declare const DEFAULT_TEXT_PROPS: {
|
|
4
|
+
text: string;
|
|
5
|
+
fontSize: number;
|
|
6
|
+
fontFamily: string;
|
|
7
|
+
fontWeight: number;
|
|
8
|
+
fontStyle: string;
|
|
9
|
+
textColor: string;
|
|
10
|
+
strokeColor: string;
|
|
11
|
+
strokeWidth: number;
|
|
12
|
+
applyShadow: boolean;
|
|
13
|
+
shadowColor: string;
|
|
14
|
+
textAlign: TextAlign;
|
|
15
|
+
shadowOffset: number[];
|
|
16
|
+
shadowBlur: number;
|
|
17
|
+
shadowOpacity: number;
|
|
18
|
+
};
|
|
19
|
+
export interface TextPanelState {
|
|
20
|
+
textContent: string;
|
|
21
|
+
fontSize: number;
|
|
22
|
+
selectedFont: string;
|
|
23
|
+
isBold: boolean;
|
|
24
|
+
isItalic: boolean;
|
|
25
|
+
textColor: string;
|
|
26
|
+
strokeColor: string;
|
|
27
|
+
applyShadow: boolean;
|
|
28
|
+
shadowColor: string;
|
|
29
|
+
strokeWidth: number;
|
|
30
|
+
fonts: string[];
|
|
31
|
+
operation: string;
|
|
32
|
+
}
|
|
33
|
+
export interface TextPanelActions {
|
|
34
|
+
setTextContent: (text: string) => void;
|
|
35
|
+
setFontSize: (size: number) => void;
|
|
36
|
+
setSelectedFont: (font: string) => void;
|
|
37
|
+
setIsBold: (bold: boolean) => void;
|
|
38
|
+
setIsItalic: (italic: boolean) => void;
|
|
39
|
+
setTextColor: (color: string) => void;
|
|
40
|
+
setStrokeColor: (color: string) => void;
|
|
41
|
+
setApplyShadow: (shadow: boolean) => void;
|
|
42
|
+
setShadowColor: (color: string) => void;
|
|
43
|
+
setStrokeWidth: (width: number) => void;
|
|
44
|
+
handleApplyChanges: () => void;
|
|
45
|
+
}
|
|
46
|
+
export declare const useTextPanel: ({ selectedElement, addElement, updateElement, }: {
|
|
47
|
+
selectedElement: TrackElement | null;
|
|
48
|
+
addElement: (element: TrackElement) => void;
|
|
49
|
+
updateElement: (element: TrackElement) => void;
|
|
50
|
+
}) => TextPanelState & TextPanelActions;
|