@designcombo/state 0.1.33 → 0.1.35
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/events.d.ts +69 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.es.js +1605 -1526
- package/dist/index.umd.js +2 -2
- package/dist/state.d.ts +1 -0
- package/dist/utils/load-item.d.ts +142 -142
- package/package.json +6 -6
@@ -1,4 +1,4 @@
|
|
1
|
-
import { IAudio,
|
1
|
+
import { IAudio, ICaption, IDisplay, IImage, ISize, ITemplate, IText, ITrack, ITrackItem, ITrim, IVideo, IVideoDetails } from '@designcombo/types';
|
2
2
|
|
3
3
|
type OptionsType = {
|
4
4
|
size: {
|
@@ -17,11 +17,11 @@ export declare const loadVideoItem: (layer: ITrackItem & IVideo, options: Partia
|
|
17
17
|
duration: number;
|
18
18
|
id: string;
|
19
19
|
preview?: string;
|
20
|
-
position?: import('@designcombo/types').IPosition | null;
|
21
20
|
metadata: Record<string, any>;
|
22
21
|
isMain?: boolean;
|
23
22
|
animation?: any;
|
24
23
|
modifier?: IDisplay;
|
24
|
+
activeEdit?: boolean;
|
25
25
|
}>;
|
26
26
|
export declare const loadAudioItem: (payload: ITrackItem & IAudio) => Promise<{
|
27
27
|
id: string;
|
@@ -31,130 +31,28 @@ export declare const loadAudioItem: (payload: ITrackItem & IAudio) => Promise<{
|
|
31
31
|
trim: ITrim;
|
32
32
|
playbackRate: number;
|
33
33
|
details: {
|
34
|
-
src:
|
35
|
-
volume:
|
34
|
+
src: any;
|
35
|
+
volume: any;
|
36
36
|
};
|
37
37
|
metadata: {
|
38
38
|
[x: string]: any;
|
39
39
|
};
|
40
40
|
duration: number;
|
41
41
|
}>;
|
42
|
-
export declare const loadTemplateItem: (payload:
|
42
|
+
export declare const loadTemplateItem: (payload: ITemplate, options: {
|
43
43
|
size: ISize;
|
44
44
|
}) => Promise<{
|
45
45
|
id: string;
|
46
|
-
details:
|
47
|
-
trim: ITrim;
|
48
|
-
type: string;
|
49
|
-
name: string;
|
50
|
-
details: IVideoDetails;
|
51
|
-
playbackRate: number;
|
52
|
-
display: IDisplay;
|
53
|
-
duration: number;
|
54
|
-
id: string;
|
55
|
-
preview?: string;
|
56
|
-
position?: import('@designcombo/types').IPosition | null;
|
57
|
-
metadata: Record<string, any>;
|
58
|
-
isMain?: boolean;
|
59
|
-
animation?: any;
|
60
|
-
modifier?: IDisplay;
|
61
|
-
} | {
|
62
|
-
id: string;
|
63
|
-
name: string;
|
64
|
-
type: string;
|
65
|
-
display: IDisplay;
|
66
|
-
trim: ITrim;
|
67
|
-
playbackRate: number;
|
68
|
-
details: {
|
69
|
-
src: string;
|
70
|
-
volume: number;
|
71
|
-
};
|
72
|
-
metadata: {
|
73
|
-
[x: string]: any;
|
74
|
-
};
|
75
|
-
duration: number;
|
76
|
-
} | {
|
77
|
-
id: string;
|
78
|
-
name: string;
|
79
|
-
type: string;
|
80
|
-
display: IDisplay;
|
81
|
-
details: {
|
82
|
-
text: string;
|
83
|
-
height: number;
|
84
|
-
fontUrl: string;
|
85
|
-
top: string | number;
|
86
|
-
left: string | number;
|
87
|
-
borderWidth: number;
|
88
|
-
borderColor: string;
|
89
|
-
boxShadow: {
|
90
|
-
color: string;
|
91
|
-
x: number;
|
92
|
-
y: number;
|
93
|
-
blur: number;
|
94
|
-
};
|
95
|
-
fontSize: number;
|
96
|
-
fontFamily: string;
|
97
|
-
color: string;
|
98
|
-
lineHeight: number | string;
|
99
|
-
letterSpacing: number | string;
|
100
|
-
fontWeight: number;
|
101
|
-
fontStyle: string;
|
102
|
-
textDecoration: string;
|
103
|
-
textAlign: "center" | "left" | "right";
|
104
|
-
wordSpacing: number | string;
|
105
|
-
textShadow: string;
|
106
|
-
backgroundColor: string;
|
107
|
-
opacity: number;
|
108
|
-
width: number;
|
109
|
-
textTransform: "capitalize" | "uppercase" | "lowercase";
|
110
|
-
border: string;
|
111
|
-
wordWrap: "normal" | "break-word";
|
112
|
-
wordBreak: "normal" | "break-word" | "break-all";
|
113
|
-
WebkitTextStrokeColor: string;
|
114
|
-
WebkitTextStrokeWidth: string;
|
115
|
-
transform?: string;
|
116
|
-
borderRadius?: number;
|
117
|
-
};
|
118
|
-
metadata: {};
|
119
|
-
} | {
|
120
|
-
id: string;
|
121
|
-
type: string;
|
122
|
-
name: string;
|
123
|
-
display: IDisplay;
|
124
|
-
playbackRate: number;
|
125
|
-
details: {
|
126
|
-
src: string;
|
127
|
-
width: number;
|
128
|
-
height: number;
|
129
|
-
opacity: number;
|
130
|
-
transform: string;
|
131
|
-
border: string;
|
132
|
-
borderRadius: number;
|
133
|
-
boxShadow: IBoxShadow;
|
134
|
-
top: string;
|
135
|
-
left: string;
|
136
|
-
borderWidth: number;
|
137
|
-
borderColor: string;
|
138
|
-
blur: number;
|
139
|
-
brightness: number;
|
140
|
-
flipX: boolean;
|
141
|
-
flipY: boolean;
|
142
|
-
rotate: string;
|
143
|
-
visibility: "hidden" | "visible";
|
144
|
-
mediaWidth: number;
|
145
|
-
mediaHeight: number;
|
146
|
-
};
|
147
|
-
metadata: Record<string, any>;
|
148
|
-
} | undefined)[];
|
149
|
-
size: ISize;
|
150
|
-
position: {
|
46
|
+
details: {
|
151
47
|
top: number;
|
152
48
|
left: number;
|
49
|
+
scale: number;
|
50
|
+
rotate: number;
|
51
|
+
width: number;
|
52
|
+
height: number;
|
153
53
|
};
|
154
54
|
trim: IDisplay;
|
155
|
-
scale: number;
|
156
55
|
display: IDisplay;
|
157
|
-
rotate: number;
|
158
56
|
activeEdit: boolean;
|
159
57
|
}>;
|
160
58
|
export declare const loadImageItem: (payload: ITrackItem & IImage, options: {
|
@@ -170,26 +68,26 @@ export declare const loadImageItem: (payload: ITrackItem & IImage, options: {
|
|
170
68
|
display: IDisplay;
|
171
69
|
playbackRate: number;
|
172
70
|
details: {
|
173
|
-
src:
|
174
|
-
width:
|
175
|
-
height:
|
176
|
-
opacity:
|
177
|
-
transform:
|
178
|
-
border:
|
179
|
-
borderRadius:
|
180
|
-
boxShadow:
|
181
|
-
top:
|
182
|
-
left:
|
183
|
-
borderWidth:
|
184
|
-
borderColor:
|
185
|
-
blur:
|
186
|
-
brightness:
|
187
|
-
flipX:
|
188
|
-
flipY:
|
189
|
-
rotate:
|
190
|
-
visibility:
|
191
|
-
mediaWidth:
|
192
|
-
mediaHeight:
|
71
|
+
src: any;
|
72
|
+
width: any;
|
73
|
+
height: any;
|
74
|
+
opacity: any;
|
75
|
+
transform: any;
|
76
|
+
border: any;
|
77
|
+
borderRadius: any;
|
78
|
+
boxShadow: any;
|
79
|
+
top: any;
|
80
|
+
left: any;
|
81
|
+
borderWidth: any;
|
82
|
+
borderColor: any;
|
83
|
+
blur: any;
|
84
|
+
brightness: any;
|
85
|
+
flipX: any;
|
86
|
+
flipY: any;
|
87
|
+
rotate: any;
|
88
|
+
visibility: any;
|
89
|
+
mediaWidth: any;
|
90
|
+
mediaHeight: any;
|
193
91
|
};
|
194
92
|
metadata: Record<string, any>;
|
195
93
|
}>;
|
@@ -256,19 +154,118 @@ export declare const loadTextItem: (payload: ITrackItem & IText, options: {
|
|
256
154
|
type: string;
|
257
155
|
display: IDisplay;
|
258
156
|
details: {
|
259
|
-
text:
|
157
|
+
text: any;
|
260
158
|
height: number;
|
261
|
-
fontUrl:
|
159
|
+
fontUrl: any;
|
262
160
|
top: string | number;
|
263
161
|
left: string | number;
|
264
|
-
borderWidth:
|
265
|
-
borderColor:
|
266
|
-
boxShadow:
|
267
|
-
|
268
|
-
|
269
|
-
|
270
|
-
|
271
|
-
|
162
|
+
borderWidth: any;
|
163
|
+
borderColor: any;
|
164
|
+
boxShadow: any;
|
165
|
+
fontSize: number;
|
166
|
+
fontFamily: string;
|
167
|
+
color: string;
|
168
|
+
lineHeight: number | string;
|
169
|
+
letterSpacing: number | string;
|
170
|
+
fontWeight: number;
|
171
|
+
fontStyle: string;
|
172
|
+
textDecoration: string;
|
173
|
+
textAlign: "center" | "left" | "right";
|
174
|
+
wordSpacing: number | string;
|
175
|
+
textShadow: string;
|
176
|
+
backgroundColor: string;
|
177
|
+
opacity: number;
|
178
|
+
width: number;
|
179
|
+
textTransform: "capitalize" | "uppercase" | "lowercase";
|
180
|
+
border: string;
|
181
|
+
wordWrap: "normal" | "break-word";
|
182
|
+
wordBreak: "normal" | "break-word" | "break-all";
|
183
|
+
WebkitTextStrokeColor: string;
|
184
|
+
WebkitTextStrokeWidth: string;
|
185
|
+
transform?: string;
|
186
|
+
borderRadius?: number;
|
187
|
+
};
|
188
|
+
metadata: {};
|
189
|
+
}>;
|
190
|
+
export declare const loadTrackItem: (payload: ITrackItem & (IVideo | IAudio | IImage | IText | ICaption), options?: {
|
191
|
+
size?: {
|
192
|
+
width: number;
|
193
|
+
height: number;
|
194
|
+
};
|
195
|
+
origin?: number;
|
196
|
+
}) => Promise<{
|
197
|
+
trim: ITrim;
|
198
|
+
type: string;
|
199
|
+
name: string;
|
200
|
+
details: IVideoDetails;
|
201
|
+
playbackRate: number;
|
202
|
+
display: IDisplay;
|
203
|
+
duration: number;
|
204
|
+
id: string;
|
205
|
+
preview?: string;
|
206
|
+
metadata: Record<string, any>;
|
207
|
+
isMain?: boolean;
|
208
|
+
animation?: any;
|
209
|
+
modifier?: IDisplay;
|
210
|
+
activeEdit?: boolean;
|
211
|
+
} | {
|
212
|
+
id: string;
|
213
|
+
name: string;
|
214
|
+
type: string;
|
215
|
+
display: IDisplay;
|
216
|
+
trim: ITrim;
|
217
|
+
playbackRate: number;
|
218
|
+
details: {
|
219
|
+
src: any;
|
220
|
+
volume: any;
|
221
|
+
};
|
222
|
+
metadata: {
|
223
|
+
[x: string]: any;
|
224
|
+
};
|
225
|
+
duration: number;
|
226
|
+
} | {
|
227
|
+
id: string;
|
228
|
+
type: string;
|
229
|
+
name: string;
|
230
|
+
display: IDisplay;
|
231
|
+
playbackRate: number;
|
232
|
+
details: {
|
233
|
+
src: any;
|
234
|
+
width: any;
|
235
|
+
height: any;
|
236
|
+
opacity: any;
|
237
|
+
transform: any;
|
238
|
+
border: any;
|
239
|
+
borderRadius: any;
|
240
|
+
boxShadow: any;
|
241
|
+
top: any;
|
242
|
+
left: any;
|
243
|
+
borderWidth: any;
|
244
|
+
borderColor: any;
|
245
|
+
blur: any;
|
246
|
+
brightness: any;
|
247
|
+
flipX: any;
|
248
|
+
flipY: any;
|
249
|
+
rotate: any;
|
250
|
+
visibility: any;
|
251
|
+
mediaWidth: any;
|
252
|
+
mediaHeight: any;
|
253
|
+
};
|
254
|
+
metadata: Record<string, any>;
|
255
|
+
} | {
|
256
|
+
id: string;
|
257
|
+
name: string;
|
258
|
+
type: string;
|
259
|
+
display: IDisplay;
|
260
|
+
details: {
|
261
|
+
text: any;
|
262
|
+
height: number;
|
263
|
+
fontUrl: any;
|
264
|
+
top: string | number;
|
265
|
+
left: string | number;
|
266
|
+
borderWidth: any;
|
267
|
+
borderColor: any;
|
268
|
+
boxShadow: any;
|
272
269
|
fontSize: number;
|
273
270
|
fontFamily: string;
|
274
271
|
color: string;
|
@@ -294,4 +291,7 @@ export declare const loadTextItem: (payload: ITrackItem & IText, options: {
|
|
294
291
|
};
|
295
292
|
metadata: {};
|
296
293
|
}>;
|
294
|
+
export declare function checkIfItemIsInTrack(tracks: ITrack[], trackItemIds: string[]): boolean;
|
295
|
+
export declare function checkIfTrackExists(currentTracks: ITrack[], nextTracks: ITrack[]): boolean;
|
296
|
+
export declare const loadTracks: (tracks?: Partial<ITrack>[], trackItems?: ITrackItem[]) => ITrack[];
|
297
297
|
export {};
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@designcombo/state",
|
3
|
-
"version": "0.1.
|
3
|
+
"version": "0.1.35",
|
4
4
|
"private": false,
|
5
5
|
"files": [
|
6
6
|
"dist"
|
@@ -24,9 +24,9 @@
|
|
24
24
|
"typescript": "^5.3.3",
|
25
25
|
"vite": "^5.2.0",
|
26
26
|
"vite-plugin-dts": "^3.9.1",
|
27
|
-
"@designcombo/types": "0.1.
|
28
|
-
"@designcombo/
|
29
|
-
"@designcombo/
|
27
|
+
"@designcombo/types": "0.1.35",
|
28
|
+
"@designcombo/events": "0.1.35",
|
29
|
+
"@designcombo/typescript-config": "0.0.0"
|
30
30
|
},
|
31
31
|
"dependencies": {
|
32
32
|
"immer": "^10.1.1",
|
@@ -38,8 +38,8 @@
|
|
38
38
|
"nanoid": "^5.0.7"
|
39
39
|
},
|
40
40
|
"peerDependencies": {
|
41
|
-
"@designcombo/events": "0.1.
|
42
|
-
"@designcombo/types": "0.1.
|
41
|
+
"@designcombo/events": "0.1.35",
|
42
|
+
"@designcombo/types": "0.1.35"
|
43
43
|
},
|
44
44
|
"scripts": {
|
45
45
|
"dev": "vite",
|