@twick/studio 0.15.3 → 0.15.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/dist/index.d.ts +88 -11
- package/dist/index.js +228 -10
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +79 -14
- package/dist/index.mjs.map +1 -1
- package/package.json +12 -12
package/dist/index.mjs
CHANGED
|
@@ -4,11 +4,11 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
4
4
|
import { jsx, jsxs, Fragment } from "react/jsx-runtime";
|
|
5
5
|
import { forwardRef, createElement, useState, useEffect, useRef, createContext, useContext, useCallback, useMemo } from "react";
|
|
6
6
|
import { useTimelineContext, TrackElement, Track, ImageElement, AudioElement, VideoElement, TextElement, IconElement, RectElement, CircleElement, CAPTION_STYLE, CaptionElement, ElementTextEffect, ElementAnimation, PLAYER_STATE } from "@twick/timeline";
|
|
7
|
-
import { INITIAL_TIMELINE_DATA, TimelineProvider } from "@twick/timeline";
|
|
7
|
+
import { AudioElement as AudioElement2, CAPTION_COLOR, CAPTION_FONT, CAPTION_STYLE as CAPTION_STYLE2, CAPTION_STYLE_OPTIONS, CaptionElement as CaptionElement2, CircleElement as CircleElement2, ElementAdder, ElementAnimation as ElementAnimation2, ElementCloner, ElementDeserializer, ElementFrameEffect, ElementRemover, ElementSerializer, ElementSplitter, ElementTextEffect as ElementTextEffect2, ElementUpdater, ElementValidator, INITIAL_TIMELINE_DATA, IconElement as IconElement2, ImageElement as ImageElement2, PROCESS_STATE, RectElement as RectElement2, TIMELINE_ACTION, TIMELINE_ELEMENT_TYPE, TextElement as TextElement2, TimelineEditor, TimelineProvider, Track as Track2, TrackElement as TrackElement2, VideoElement as VideoElement2, WORDS_PER_PHRASE, generateShortUuid, getCurrentElements, getTotalDuration, isElementId, isTrackId } from "@twick/timeline";
|
|
8
8
|
import VideoEditor, { useEditorManager, BrowserMediaManager, AVAILABLE_TEXT_FONTS, TEXT_EFFECTS, ANIMATIONS } from "@twick/video-editor";
|
|
9
|
-
import { default as default2 } from "@twick/video-editor";
|
|
9
|
+
import { ANIMATIONS as ANIMATIONS2, BaseMediaManager, BrowserMediaManager as BrowserMediaManager2, PlayerControls, TEXT_EFFECTS as TEXT_EFFECTS2, TimelineManager, default as default2, animationGifs, getAnimationGif, setElementColors, useEditorManager as useEditorManager2, usePlayerControl, useTimelineControl } from "@twick/video-editor";
|
|
10
10
|
import { useLivePlayerContext } from "@twick/live-player";
|
|
11
|
-
import { LivePlayer, LivePlayerProvider } from "@twick/live-player";
|
|
11
|
+
import { LivePlayer, LivePlayerProvider, PLAYER_STATE as PLAYER_STATE2, generateId, getBaseProject, useLivePlayerContext as useLivePlayerContext2 } from "@twick/live-player";
|
|
12
12
|
/**
|
|
13
13
|
* @license lucide-react v0.511.0 - ISC
|
|
14
14
|
*
|
|
@@ -2834,11 +2834,25 @@ function PropsToolbar({
|
|
|
2834
2834
|
}) });
|
|
2835
2835
|
}
|
|
2836
2836
|
function ElementProps({ selectedElement, updateElement }) {
|
|
2837
|
-
const
|
|
2838
|
-
const
|
|
2839
|
-
const
|
|
2837
|
+
const opacity = (selectedElement == null ? void 0 : selectedElement.getOpacity()) || 1;
|
|
2838
|
+
const rotation = (selectedElement == null ? void 0 : selectedElement.getRotation()) || 0;
|
|
2839
|
+
const position = (selectedElement == null ? void 0 : selectedElement.getPosition()) || { x: 0, y: 0 };
|
|
2840
|
+
const handleRotationChange = (rotation2) => {
|
|
2840
2841
|
if (selectedElement) {
|
|
2841
|
-
|
|
2842
|
+
selectedElement.setRotation(rotation2);
|
|
2843
|
+
updateElement == null ? void 0 : updateElement(selectedElement);
|
|
2844
|
+
}
|
|
2845
|
+
};
|
|
2846
|
+
const handleOpacityChange = (opacity2) => {
|
|
2847
|
+
if (selectedElement) {
|
|
2848
|
+
selectedElement.setOpacity(opacity2);
|
|
2849
|
+
updateElement == null ? void 0 : updateElement(selectedElement);
|
|
2850
|
+
}
|
|
2851
|
+
};
|
|
2852
|
+
const handlePositionChange = (props) => {
|
|
2853
|
+
if (selectedElement) {
|
|
2854
|
+
selectedElement.setPosition({ x: props.x ?? 0, y: props.y ?? 0 });
|
|
2855
|
+
updateElement == null ? void 0 : updateElement(selectedElement);
|
|
2842
2856
|
}
|
|
2843
2857
|
};
|
|
2844
2858
|
return /* @__PURE__ */ jsxs("div", { className: "panel-container", children: [
|
|
@@ -2852,8 +2866,8 @@ function ElementProps({ selectedElement, updateElement }) {
|
|
|
2852
2866
|
"input",
|
|
2853
2867
|
{
|
|
2854
2868
|
type: "number",
|
|
2855
|
-
value: x ?? 0,
|
|
2856
|
-
onChange: (e) =>
|
|
2869
|
+
value: position.x ?? 0,
|
|
2870
|
+
onChange: (e) => handlePositionChange({ x: Number(e.target.value) }),
|
|
2857
2871
|
className: "input-dark"
|
|
2858
2872
|
}
|
|
2859
2873
|
)
|
|
@@ -2864,8 +2878,8 @@ function ElementProps({ selectedElement, updateElement }) {
|
|
|
2864
2878
|
"input",
|
|
2865
2879
|
{
|
|
2866
2880
|
type: "number",
|
|
2867
|
-
value: y ?? 0,
|
|
2868
|
-
onChange: (e) =>
|
|
2881
|
+
value: position.y ?? 0,
|
|
2882
|
+
onChange: (e) => handlePositionChange({ y: Number(e.target.value) }),
|
|
2869
2883
|
className: "input-dark"
|
|
2870
2884
|
}
|
|
2871
2885
|
)
|
|
@@ -2882,7 +2896,7 @@ function ElementProps({ selectedElement, updateElement }) {
|
|
|
2882
2896
|
min: "0",
|
|
2883
2897
|
max: "100",
|
|
2884
2898
|
value: (opacity ?? 1) * 100,
|
|
2885
|
-
onChange: (e) =>
|
|
2899
|
+
onChange: (e) => handleOpacityChange(Number(e.target.value) / 100),
|
|
2886
2900
|
className: "slider-purple"
|
|
2887
2901
|
}
|
|
2888
2902
|
),
|
|
@@ -2902,7 +2916,7 @@ function ElementProps({ selectedElement, updateElement }) {
|
|
|
2902
2916
|
min: "0",
|
|
2903
2917
|
max: "360",
|
|
2904
2918
|
value: rotation ?? 0,
|
|
2905
|
-
onChange: (e) =>
|
|
2919
|
+
onChange: (e) => handleRotationChange(Number(e.target.value)),
|
|
2906
2920
|
className: "slider-purple"
|
|
2907
2921
|
}
|
|
2908
2922
|
),
|
|
@@ -3749,25 +3763,76 @@ function TwickStudio({ studioConfig }) {
|
|
|
3749
3763
|
] }) });
|
|
3750
3764
|
}
|
|
3751
3765
|
export {
|
|
3766
|
+
ANIMATIONS2 as ANIMATIONS,
|
|
3767
|
+
AudioElement2 as AudioElement,
|
|
3752
3768
|
AudioPanel,
|
|
3769
|
+
BaseMediaManager,
|
|
3770
|
+
BrowserMediaManager2 as BrowserMediaManager,
|
|
3771
|
+
CAPTION_COLOR,
|
|
3772
|
+
CAPTION_FONT,
|
|
3753
3773
|
CAPTION_PROPS,
|
|
3774
|
+
CAPTION_STYLE2 as CAPTION_STYLE,
|
|
3775
|
+
CAPTION_STYLE_OPTIONS,
|
|
3776
|
+
CaptionElement2 as CaptionElement,
|
|
3777
|
+
CircleElement2 as CircleElement,
|
|
3754
3778
|
CirclePanel,
|
|
3779
|
+
ElementAdder,
|
|
3780
|
+
ElementAnimation2 as ElementAnimation,
|
|
3781
|
+
ElementCloner,
|
|
3782
|
+
ElementDeserializer,
|
|
3783
|
+
ElementFrameEffect,
|
|
3784
|
+
ElementRemover,
|
|
3785
|
+
ElementSerializer,
|
|
3786
|
+
ElementSplitter,
|
|
3787
|
+
ElementTextEffect2 as ElementTextEffect,
|
|
3788
|
+
ElementUpdater,
|
|
3789
|
+
ElementValidator,
|
|
3755
3790
|
INITIAL_TIMELINE_DATA,
|
|
3791
|
+
IconElement2 as IconElement,
|
|
3756
3792
|
IconPanel,
|
|
3793
|
+
ImageElement2 as ImageElement,
|
|
3757
3794
|
ImagePanel,
|
|
3758
3795
|
LivePlayer,
|
|
3759
3796
|
LivePlayerProvider,
|
|
3797
|
+
PLAYER_STATE2 as PLAYER_STATE,
|
|
3798
|
+
PROCESS_STATE,
|
|
3799
|
+
PlayerControls,
|
|
3800
|
+
RectElement2 as RectElement,
|
|
3760
3801
|
RectPanel,
|
|
3761
3802
|
StudioHeader,
|
|
3762
3803
|
SubtitlesPanel,
|
|
3804
|
+
TEXT_EFFECTS2 as TEXT_EFFECTS,
|
|
3805
|
+
TIMELINE_ACTION,
|
|
3806
|
+
TIMELINE_ELEMENT_TYPE,
|
|
3807
|
+
TextElement2 as TextElement,
|
|
3763
3808
|
TextPanel,
|
|
3809
|
+
TimelineEditor,
|
|
3810
|
+
TimelineManager,
|
|
3764
3811
|
TimelineProvider,
|
|
3765
3812
|
Toolbar,
|
|
3813
|
+
Track2 as Track,
|
|
3814
|
+
TrackElement2 as TrackElement,
|
|
3766
3815
|
TwickStudio,
|
|
3767
3816
|
default2 as VideoEditor,
|
|
3817
|
+
VideoElement2 as VideoElement,
|
|
3768
3818
|
VideoPanel,
|
|
3819
|
+
WORDS_PER_PHRASE,
|
|
3820
|
+
animationGifs,
|
|
3769
3821
|
TwickStudio as default,
|
|
3822
|
+
generateId,
|
|
3823
|
+
generateShortUuid,
|
|
3824
|
+
getAnimationGif,
|
|
3825
|
+
getBaseProject,
|
|
3826
|
+
getCurrentElements,
|
|
3827
|
+
getTotalDuration,
|
|
3828
|
+
isElementId,
|
|
3829
|
+
isTrackId,
|
|
3830
|
+
setElementColors,
|
|
3831
|
+
useEditorManager2 as useEditorManager,
|
|
3770
3832
|
useGenerateSubtitles,
|
|
3771
|
-
|
|
3833
|
+
useLivePlayerContext2 as useLivePlayerContext,
|
|
3834
|
+
usePlayerControl,
|
|
3835
|
+
useStudioManager,
|
|
3836
|
+
useTimelineControl
|
|
3772
3837
|
};
|
|
3773
3838
|
//# sourceMappingURL=index.mjs.map
|