@designcombo/state 5.0.5 → 5.1.1

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, IProgressSquare, 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,47 @@ 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;
137
+ };
138
+ metadata: {};
139
+ }>;
140
+ export declare const loadProgressSquareItem: (payload: ITrackItem & IProgressSquare, options: {
141
+ size: ISize;
142
+ scaleMode?: string;
143
+ scaleAspectRatio?: number;
144
+ }) => Promise<{
145
+ id: string;
146
+ name: "progressSquare";
147
+ type: "progressSquare";
148
+ display: IDisplay;
149
+ details: {
150
+ width: number;
151
+ height: number;
152
+ top: string;
153
+ left: string;
154
+ border: string;
155
+ borderRadius: number;
156
+ borderWidth: number;
157
+ borderColor: string;
158
+ opacity: number;
159
+ strokeColors: string[];
160
+ strokeWidth: number;
161
+ strokeBackground: string;
162
+ flipX: boolean;
163
+ flipY: boolean;
164
+ rotate: string;
165
+ transform: string;
128
166
  };
129
167
  metadata: {};
130
168
  }>;
@@ -141,34 +179,34 @@ export declare const loadLinealAudioBarsItem: (payload: ITrackItem & ILinealAudi
141
179
  to: number;
142
180
  };
143
181
  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;
182
+ width: number;
183
+ height: number;
184
+ top: string;
185
+ left: string;
186
+ border: string;
187
+ borderRadius: number;
188
+ borderWidth: number;
189
+ borderColor: string;
190
+ opacity: number;
191
+ flipX: boolean;
192
+ flipY: boolean;
193
+ inverted: boolean;
194
+ linealBarColor: string;
195
+ lineThickness: number;
196
+ gapSize: number;
197
+ roundness: number;
198
+ placement: string | null;
199
+ strokeColor: string;
200
+ fillColor: string | null;
201
+ strokeWidth: number | null;
202
+ copies: number | null;
203
+ offsetPixelSpeed: number;
204
+ lineColor: string | string[];
205
+ lineGap: number;
206
+ topRoundness: number;
207
+ bottomRoundness: number;
208
+ lines: number;
209
+ sections: number;
172
210
  };
173
211
  metadata: {};
174
212
  }>;
@@ -229,24 +267,24 @@ export declare const loadIllustrationItem: (payload: ITrackItem & IIllustration,
229
267
  display: IDisplay;
230
268
  playbackRate: number;
231
269
  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;
270
+ src: string;
271
+ width: number;
272
+ height: number;
273
+ opacity: number;
274
+ transform: string;
275
+ border: string;
276
+ borderRadius: number;
277
+ top: string;
278
+ left: string;
279
+ borderWidth: number;
280
+ borderColor: string;
281
+ flipX: boolean;
282
+ flipY: boolean;
283
+ rotate: string;
284
+ visibility: "hidden" | "visible";
247
285
  svgString: string;
248
286
  initialSvgString: string;
249
- colorMap: any;
287
+ colorMap: Record<string, string>;
250
288
  };
251
289
  metadata: Record<string, any>;
252
290
  }>;
@@ -264,22 +302,22 @@ export declare const loadShapeItem: (payload: ITrackItem & IShape, options: {
264
302
  display: IDisplay;
265
303
  playbackRate: number;
266
304
  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;
305
+ src: string;
306
+ width: number;
307
+ height: number;
308
+ opacity: number;
309
+ transform: string;
310
+ border: string;
311
+ borderRadius: number;
312
+ top: string;
313
+ left: string;
314
+ borderWidth: number;
315
+ borderColor: string;
316
+ flipX: boolean;
317
+ flipY: boolean;
318
+ rotate: string;
319
+ visibility: "hidden" | "visible";
320
+ backgroundColor: string;
283
321
  };
284
322
  metadata: Record<string, any>;
285
323
  }>;
@@ -297,24 +335,24 @@ export declare const loadRectItem: (payload: ITrackItem & IRect, options: {
297
335
  display: IDisplay;
298
336
  playbackRate: number;
299
337
  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;
338
+ width: number;
339
+ height: number;
340
+ opacity: number;
341
+ transform: string;
342
+ border: string;
343
+ borderRadius: number;
344
+ top: string;
345
+ left: string;
346
+ borderWidth: number;
347
+ borderColor: string;
348
+ flipX: boolean;
349
+ flipY: boolean;
350
+ rotate: string;
351
+ visibility: "hidden" | "visible";
352
+ backgroundColor: string;
353
+ boxShadow: IBoxShadow;
354
+ blur: number;
355
+ brightness: number;
318
356
  };
319
357
  metadata: Record<string, any>;
320
358
  }>;
@@ -333,24 +371,24 @@ export declare const loadImageItem: (payload: ITrackItem & IImage, options: {
333
371
  display: IDisplay;
334
372
  playbackRate: number;
335
373
  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;
374
+ src: string;
375
+ width: number;
376
+ height: number;
377
+ opacity: number;
378
+ transform: string;
379
+ border: string;
380
+ borderRadius: number;
381
+ boxShadow: IBoxShadow;
382
+ top: string;
383
+ left: string;
384
+ borderWidth: number;
385
+ borderColor: string;
386
+ blur: number;
387
+ brightness: number;
388
+ flipX: boolean;
389
+ flipY: boolean;
390
+ rotate: string;
391
+ visibility: "hidden" | "visible";
354
392
  };
355
393
  metadata: Record<string, any>;
356
394
  }>;
@@ -383,6 +421,8 @@ export declare const loadCaptionItem: (trackItem: ITrackItem, options: {
383
421
  appearedColor: string;
384
422
  activeColor: string;
385
423
  activeFillColor: string;
424
+ isKeywordColor: string;
425
+ preservedColorKeyWord: boolean;
386
426
  skewX: number;
387
427
  skewY: number;
388
428
  fontSize: number;
@@ -407,6 +447,7 @@ export declare const loadCaptionItem: (trackItem: ITrackItem, options: {
407
447
  WebkitTextStrokeWidth: string;
408
448
  transform?: string;
409
449
  borderRadius?: number;
450
+ animation?: string;
410
451
  };
411
452
  metadata: Record<string, any>;
412
453
  }>;
@@ -422,14 +463,19 @@ export declare const loadTextItem: (payload: ITrackItem & IText, options: {
422
463
  type: string;
423
464
  display: IDisplay;
424
465
  details: {
425
- text: any;
466
+ text: string;
426
467
  height: number;
427
- fontUrl: any;
468
+ fontUrl: string;
428
469
  top: string | number;
429
470
  left: string | number;
430
- borderWidth: any;
431
- borderColor: any;
432
- boxShadow: any;
471
+ borderWidth: number;
472
+ borderColor: string;
473
+ boxShadow: {
474
+ color: string;
475
+ x: number;
476
+ y: number;
477
+ blur: number;
478
+ };
433
479
  skewX: number;
434
480
  skewY: number;
435
481
  fontSize: number;
@@ -497,8 +543,8 @@ export declare const loadTrackItem: (payload: ITrackItem & (IVideo | IAudio | II
497
543
  trim: ITrim;
498
544
  playbackRate: number;
499
545
  details: {
500
- src: any;
501
- volume: any;
546
+ src: string;
547
+ volume: number;
502
548
  };
503
549
  metadata: {
504
550
  [x: string]: any;
@@ -529,24 +575,24 @@ export declare const loadTrackItem: (payload: ITrackItem & (IVideo | IAudio | II
529
575
  display: IDisplay;
530
576
  playbackRate: number;
531
577
  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;
578
+ src: string;
579
+ width: number;
580
+ height: number;
581
+ opacity: number;
582
+ transform: string;
583
+ border: string;
584
+ borderRadius: number;
585
+ boxShadow: IBoxShadow;
586
+ top: string;
587
+ left: string;
588
+ borderWidth: number;
589
+ borderColor: string;
590
+ blur: number;
591
+ brightness: number;
592
+ flipX: boolean;
593
+ flipY: boolean;
594
+ rotate: string;
595
+ visibility: "hidden" | "visible";
550
596
  };
551
597
  metadata: Record<string, any>;
552
598
  } | {
@@ -555,14 +601,19 @@ export declare const loadTrackItem: (payload: ITrackItem & (IVideo | IAudio | II
555
601
  type: string;
556
602
  display: IDisplay;
557
603
  details: {
558
- text: any;
604
+ text: string;
559
605
  height: number;
560
- fontUrl: any;
606
+ fontUrl: string;
561
607
  top: string | number;
562
608
  left: string | number;
563
- borderWidth: any;
564
- borderColor: any;
565
- boxShadow: any;
609
+ borderWidth: number;
610
+ borderColor: string;
611
+ boxShadow: {
612
+ color: string;
613
+ x: number;
614
+ y: number;
615
+ blur: number;
616
+ };
566
617
  skewX: number;
567
618
  skewY: number;
568
619
  fontSize: number;
@@ -3,6 +3,7 @@ import { State, ITrackType } from '@designcombo/types';
3
3
  interface TrackOptions {
4
4
  targetTrackIndex?: number;
5
5
  targetTrackId?: string;
6
+ isNewTrack?: boolean;
6
7
  }
7
8
  interface TrackItem {
8
9
  id: string;
@@ -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
  }) => {
@@ -0,0 +1,4 @@
1
+ import { ITrackItem, ItemStructure } from '@designcombo/types';
2
+
3
+ export declare function updateStringIds(ids: string[], jsonString: string): string;
4
+ export declare function findItemIdsTemplateComposition(structure: ItemStructure[], itemId: string, trackItemsMap: Record<string, ITrackItem>): string[];
@@ -0,0 +1,6 @@
1
+ import { ITrackItem, State } from '@designcombo/types';
2
+
3
+ export declare function validateDisplay(trackItems: ITrackItem[], { idTrack, idItems }: {
4
+ idTrack: string;
5
+ idItems: string[];
6
+ }, state: State): void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@designcombo/state",
3
- "version": "5.0.5",
3
+ "version": "5.1.1",
4
4
  "private": false,
5
5
  "files": [
6
6
  "dist"
@@ -25,8 +25,8 @@
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.5",
29
- "@designcombo/typescript-config": "0.0.0"
28
+ "@designcombo/typescript-config": "0.0.0",
29
+ "@designcombo/types": "5.1.1"
30
30
  },
31
31
  "dependencies": {
32
32
  "immer": "^10.1.1",
@@ -39,7 +39,7 @@
39
39
  },
40
40
  "peerDependencies": {
41
41
  "@designcombo/events": "^1.0.2",
42
- "@designcombo/types": "5.0.5"
42
+ "@designcombo/types": "5.1.1"
43
43
  },
44
44
  "scripts": {
45
45
  "dev": "vite",
@@ -1,3 +0,0 @@
1
- import { ITrack, ITrackItem, ITransition } from '@designcombo/types';
2
-
3
- export declare function updateItemsNextTransition(transition: ITransition, tracks: ITrack[], trackItemsMap: Record<string, ITrackItem>): void;