@designcombo/state 5.0.4 → 5.1.0

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.
@@ -1,4 +1,4 @@
1
- import { IAudio, ICaption, IComposition, IDisplay, IIllustration, IImage, ILinealAudioBars, IProgressBar, IProgressFrame, IRadialAudioBars, IRect, IShape, ISize, ITemplate, IText, ITrack, ITrackItem, ITrim, IVideo, IVideoDetails } from '@designcombo/types';
1
+ import { IAudio, IBoxShadow, ICaption, IComposition, IDisplay, IIllustration, IImage, ILinealAudioBars, IProgressBar, IProgressFrame, IRadialAudioBars, IRect, IShape, ISize, ITemplate, IText, ITrack, ITrackItem, ITrim, IVideo, IVideoDetails } from '@designcombo/types';
2
2
 
3
3
  type OptionsType = {
4
4
  size: {
@@ -9,6 +9,15 @@ type OptionsType = {
9
9
  scaleMode?: string;
10
10
  scaleAspectRatio?: number;
11
11
  };
12
+ type TargetSize = {
13
+ width: number;
14
+ height: number;
15
+ };
16
+ export declare function getTextPosition(options: Partial<OptionsType>, info: TargetSize): {
17
+ top: string;
18
+ left: string;
19
+ transform: string;
20
+ };
12
21
  export declare const loadVideoItem: (layer: ITrackItem & IVideo, options: Partial<OptionsType>) => Promise<{
13
22
  trim: ITrim;
14
23
  type: string;
@@ -42,8 +51,8 @@ export declare const loadAudioItem: (payload: ITrackItem & IAudio) => Promise<{
42
51
  trim: ITrim;
43
52
  playbackRate: number;
44
53
  details: {
45
- src: any;
46
- volume: any;
54
+ src: string;
55
+ volume: number;
47
56
  };
48
57
  metadata: {
49
58
  [x: string]: any;
@@ -60,19 +69,19 @@ export declare const loadProgressBarItem: (payload: ITrackItem & IProgressBar, o
60
69
  type: "progressBar";
61
70
  display: IDisplay;
62
71
  details: {
63
- width: any;
64
- height: any;
65
- top: any;
66
- left: any;
67
- border: any;
68
- borderRadius: any;
69
- borderWidth: any;
70
- borderColor: any;
71
- opacity: any;
72
- flipX: any;
73
- flipY: any;
74
- inverted: any;
75
- backgroundColors: any;
72
+ width: number;
73
+ height: number;
74
+ top: string;
75
+ left: string;
76
+ border: string;
77
+ borderRadius: number;
78
+ borderWidth: number;
79
+ borderColor: string;
80
+ opacity: number;
81
+ flipX: boolean;
82
+ flipY: boolean;
83
+ inverted: boolean;
84
+ backgroundColors: string[];
76
85
  };
77
86
  metadata: {};
78
87
  }>;
@@ -86,20 +95,20 @@ export declare const loadProgressFrameItem: (payload: ITrackItem & IProgressFram
86
95
  type: "progressFrame";
87
96
  display: IDisplay;
88
97
  details: {
89
- width: any;
90
- height: any;
91
- top: any;
92
- left: any;
93
- border: any;
94
- borderRadius: any;
95
- borderWidth: any;
96
- borderColor: any;
97
- opacity: any;
98
- flipX: any;
99
- flipY: any;
100
- inverted: any;
101
- backgroundColors: any;
102
- barThickness: any;
98
+ width: number;
99
+ height: number;
100
+ top: string;
101
+ left: string;
102
+ border: string;
103
+ borderRadius: number;
104
+ borderWidth: number;
105
+ borderColor: string;
106
+ opacity: number;
107
+ flipX: boolean;
108
+ flipY: boolean;
109
+ inverted: boolean;
110
+ backgroundColors: string[];
111
+ barThickness: number;
103
112
  };
104
113
  metadata: {};
105
114
  }>;
@@ -113,18 +122,18 @@ export declare const loadRadialAudioBarsItem: (payload: ITrackItem & IRadialAudi
113
122
  type: "radialAudioBars";
114
123
  display: IDisplay;
115
124
  details: {
116
- width: any;
117
- height: any;
118
- top: any;
119
- left: any;
120
- radialBarColor: any;
121
- border: any;
122
- borderRadius: any;
123
- borderWidth: any;
124
- borderColor: any;
125
- opacity: any;
126
- flipX: any;
127
- flipY: any;
125
+ width: number;
126
+ height: number;
127
+ top: string;
128
+ left: string;
129
+ radialBarColor: string;
130
+ border: string;
131
+ borderRadius: number;
132
+ borderWidth: number;
133
+ borderColor: string;
134
+ opacity: number;
135
+ flipX: boolean;
136
+ flipY: boolean;
128
137
  };
129
138
  metadata: {};
130
139
  }>;
@@ -141,34 +150,34 @@ export declare const loadLinealAudioBarsItem: (payload: ITrackItem & ILinealAudi
141
150
  to: number;
142
151
  };
143
152
  details: {
144
- width: any;
145
- height: any;
146
- top: any;
147
- left: any;
148
- border: any;
149
- borderRadius: any;
150
- borderWidth: any;
151
- borderColor: any;
152
- opacity: any;
153
- flipX: any;
154
- flipY: any;
155
- inverted: any;
156
- linealBarColor: any;
157
- lineThickness: any;
158
- gapSize: any;
159
- roundness: any;
160
- placement: any;
161
- strokeColor: any;
162
- fillColor: any;
163
- strokeWidth: any;
164
- copies: any;
165
- offsetPixelSpeed: any;
166
- lineColor: any;
167
- lineGap: any;
168
- topRoundness: any;
169
- bottomRoundness: any;
170
- lines: any;
171
- sections: any;
153
+ width: number;
154
+ height: number;
155
+ top: string;
156
+ left: string;
157
+ border: string;
158
+ borderRadius: number;
159
+ borderWidth: number;
160
+ borderColor: string;
161
+ opacity: number;
162
+ flipX: boolean;
163
+ flipY: boolean;
164
+ inverted: boolean;
165
+ linealBarColor: string;
166
+ lineThickness: number;
167
+ gapSize: number;
168
+ roundness: number;
169
+ placement: string | null;
170
+ strokeColor: string;
171
+ fillColor: string | null;
172
+ strokeWidth: number | null;
173
+ copies: number | null;
174
+ offsetPixelSpeed: number;
175
+ lineColor: string | string[];
176
+ lineGap: number;
177
+ topRoundness: number;
178
+ bottomRoundness: number;
179
+ lines: number;
180
+ sections: number;
172
181
  };
173
182
  metadata: {};
174
183
  }>;
@@ -229,24 +238,24 @@ export declare const loadIllustrationItem: (payload: ITrackItem & IIllustration,
229
238
  display: IDisplay;
230
239
  playbackRate: number;
231
240
  details: {
232
- src: any;
233
- width: any;
234
- height: any;
235
- opacity: any;
236
- transform: any;
237
- border: any;
238
- borderRadius: any;
239
- top: any;
240
- left: any;
241
- borderWidth: any;
242
- borderColor: any;
243
- flipX: any;
244
- flipY: any;
245
- rotate: any;
246
- visibility: any;
241
+ src: string;
242
+ width: number;
243
+ height: number;
244
+ opacity: number;
245
+ transform: string;
246
+ border: string;
247
+ borderRadius: number;
248
+ top: string;
249
+ left: string;
250
+ borderWidth: number;
251
+ borderColor: string;
252
+ flipX: boolean;
253
+ flipY: boolean;
254
+ rotate: string;
255
+ visibility: "hidden" | "visible";
247
256
  svgString: string;
248
257
  initialSvgString: string;
249
- colorMap: any;
258
+ colorMap: Record<string, string>;
250
259
  };
251
260
  metadata: Record<string, any>;
252
261
  }>;
@@ -264,22 +273,22 @@ export declare const loadShapeItem: (payload: ITrackItem & IShape, options: {
264
273
  display: IDisplay;
265
274
  playbackRate: number;
266
275
  details: {
267
- src: any;
268
- width: any;
269
- height: any;
270
- opacity: any;
271
- transform: any;
272
- border: any;
273
- borderRadius: any;
274
- top: any;
275
- left: any;
276
- borderWidth: any;
277
- borderColor: any;
278
- flipX: any;
279
- flipY: any;
280
- rotate: any;
281
- visibility: any;
282
- backgroundColor: any;
276
+ src: string;
277
+ width: number;
278
+ height: number;
279
+ opacity: number;
280
+ transform: string;
281
+ border: string;
282
+ borderRadius: number;
283
+ top: string;
284
+ left: string;
285
+ borderWidth: number;
286
+ borderColor: string;
287
+ flipX: boolean;
288
+ flipY: boolean;
289
+ rotate: string;
290
+ visibility: "hidden" | "visible";
291
+ backgroundColor: string;
283
292
  };
284
293
  metadata: Record<string, any>;
285
294
  }>;
@@ -297,24 +306,24 @@ export declare const loadRectItem: (payload: ITrackItem & IRect, options: {
297
306
  display: IDisplay;
298
307
  playbackRate: number;
299
308
  details: {
300
- width: any;
301
- height: any;
302
- opacity: any;
303
- transform: any;
304
- border: any;
305
- borderRadius: any;
306
- top: any;
307
- left: any;
308
- borderWidth: any;
309
- borderColor: any;
310
- flipX: any;
311
- flipY: any;
312
- rotate: any;
313
- visibility: any;
314
- backgroundColor: any;
315
- boxShadow: any;
316
- blur: any;
317
- brightness: any;
309
+ width: number;
310
+ height: number;
311
+ opacity: number;
312
+ transform: string;
313
+ border: string;
314
+ borderRadius: number;
315
+ top: string;
316
+ left: string;
317
+ borderWidth: number;
318
+ borderColor: string;
319
+ flipX: boolean;
320
+ flipY: boolean;
321
+ rotate: string;
322
+ visibility: "hidden" | "visible";
323
+ backgroundColor: string;
324
+ boxShadow: IBoxShadow;
325
+ blur: number;
326
+ brightness: number;
318
327
  };
319
328
  metadata: Record<string, any>;
320
329
  }>;
@@ -333,24 +342,24 @@ export declare const loadImageItem: (payload: ITrackItem & IImage, options: {
333
342
  display: IDisplay;
334
343
  playbackRate: number;
335
344
  details: {
336
- src: any;
337
- width: any;
338
- height: any;
339
- opacity: any;
340
- transform: any;
341
- border: any;
342
- borderRadius: any;
343
- boxShadow: any;
344
- top: any;
345
- left: any;
346
- borderWidth: any;
347
- borderColor: any;
348
- blur: any;
349
- brightness: any;
350
- flipX: any;
351
- flipY: any;
352
- rotate: any;
353
- visibility: any;
345
+ src: string;
346
+ width: number;
347
+ height: number;
348
+ opacity: number;
349
+ transform: string;
350
+ border: string;
351
+ borderRadius: number;
352
+ boxShadow: IBoxShadow;
353
+ top: string;
354
+ left: string;
355
+ borderWidth: number;
356
+ borderColor: string;
357
+ blur: number;
358
+ brightness: number;
359
+ flipX: boolean;
360
+ flipY: boolean;
361
+ rotate: string;
362
+ visibility: "hidden" | "visible";
354
363
  };
355
364
  metadata: Record<string, any>;
356
365
  }>;
@@ -407,6 +416,7 @@ export declare const loadCaptionItem: (trackItem: ITrackItem, options: {
407
416
  WebkitTextStrokeWidth: string;
408
417
  transform?: string;
409
418
  borderRadius?: number;
419
+ animation?: string;
410
420
  };
411
421
  metadata: Record<string, any>;
412
422
  }>;
@@ -422,14 +432,19 @@ export declare const loadTextItem: (payload: ITrackItem & IText, options: {
422
432
  type: string;
423
433
  display: IDisplay;
424
434
  details: {
425
- text: any;
435
+ text: string;
426
436
  height: number;
427
- fontUrl: any;
437
+ fontUrl: string;
428
438
  top: string | number;
429
439
  left: string | number;
430
- borderWidth: any;
431
- borderColor: any;
432
- boxShadow: any;
440
+ borderWidth: number;
441
+ borderColor: string;
442
+ boxShadow: {
443
+ color: string;
444
+ x: number;
445
+ y: number;
446
+ blur: number;
447
+ };
433
448
  skewX: number;
434
449
  skewY: number;
435
450
  fontSize: number;
@@ -497,8 +512,8 @@ export declare const loadTrackItem: (payload: ITrackItem & (IVideo | IAudio | II
497
512
  trim: ITrim;
498
513
  playbackRate: number;
499
514
  details: {
500
- src: any;
501
- volume: any;
515
+ src: string;
516
+ volume: number;
502
517
  };
503
518
  metadata: {
504
519
  [x: string]: any;
@@ -529,24 +544,24 @@ export declare const loadTrackItem: (payload: ITrackItem & (IVideo | IAudio | II
529
544
  display: IDisplay;
530
545
  playbackRate: number;
531
546
  details: {
532
- src: any;
533
- width: any;
534
- height: any;
535
- opacity: any;
536
- transform: any;
537
- border: any;
538
- borderRadius: any;
539
- boxShadow: any;
540
- top: any;
541
- left: any;
542
- borderWidth: any;
543
- borderColor: any;
544
- blur: any;
545
- brightness: any;
546
- flipX: any;
547
- flipY: any;
548
- rotate: any;
549
- visibility: any;
547
+ src: string;
548
+ width: number;
549
+ height: number;
550
+ opacity: number;
551
+ transform: string;
552
+ border: string;
553
+ borderRadius: number;
554
+ boxShadow: IBoxShadow;
555
+ top: string;
556
+ left: string;
557
+ borderWidth: number;
558
+ borderColor: string;
559
+ blur: number;
560
+ brightness: number;
561
+ flipX: boolean;
562
+ flipY: boolean;
563
+ rotate: string;
564
+ visibility: "hidden" | "visible";
550
565
  };
551
566
  metadata: Record<string, any>;
552
567
  } | {
@@ -555,14 +570,19 @@ export declare const loadTrackItem: (payload: ITrackItem & (IVideo | IAudio | II
555
570
  type: string;
556
571
  display: IDisplay;
557
572
  details: {
558
- text: any;
573
+ text: string;
559
574
  height: number;
560
- fontUrl: any;
575
+ fontUrl: string;
561
576
  top: string | number;
562
577
  left: string | number;
563
- borderWidth: any;
564
- borderColor: any;
565
- boxShadow: any;
578
+ borderWidth: number;
579
+ borderColor: string;
580
+ boxShadow: {
581
+ color: string;
582
+ x: number;
583
+ y: number;
584
+ blur: number;
585
+ };
566
586
  skewX: number;
567
587
  skewY: number;
568
588
  fontSize: number;
@@ -1,6 +1,6 @@
1
- import { IItem, ITrackItem } from '@designcombo/types';
1
+ import { ITrackItem } from '@designcombo/types';
2
2
 
3
- export declare const getDimension: (item: IItem, info: {
3
+ export declare const getDimension: (item: ITrackItem, info: {
4
4
  width: number;
5
5
  height: number;
6
6
  }) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@designcombo/state",
3
- "version": "5.0.4",
3
+ "version": "5.1.0",
4
4
  "private": false,
5
5
  "files": [
6
6
  "dist"
@@ -25,7 +25,7 @@
25
25
  "typescript": "^5.3.3",
26
26
  "vite": "^5.2.0",
27
27
  "vite-plugin-dts": "^3.9.1",
28
- "@designcombo/types": "5.0.4",
28
+ "@designcombo/types": "5.1.0",
29
29
  "@designcombo/typescript-config": "0.0.0"
30
30
  },
31
31
  "dependencies": {
@@ -39,7 +39,7 @@
39
39
  },
40
40
  "peerDependencies": {
41
41
  "@designcombo/events": "^1.0.2",
42
- "@designcombo/types": "5.0.4"
42
+ "@designcombo/types": "5.1.0"
43
43
  },
44
44
  "scripts": {
45
45
  "dev": "vite",