@designcombo/state 3.1.13 → 4.0.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, IShape, ISize, ITemplate, IText, ITrack, ITrackItem, ITrim, IVideo, IVideoDetails } from '@designcombo/types';
1
+ import { IAudio, ICaption, IComposition, ICustom, IDisplay, IIllustration, IImage, IShape, ISize, ITemplate, IText, ITrack, ITrackItem, ITrim, IVideo, IVideoDetails } from '@designcombo/types';
2
2
 
3
3
  type OptionsType = {
4
4
  size: {
@@ -7,6 +7,7 @@ type OptionsType = {
7
7
  };
8
8
  origin: number;
9
9
  scaleMode?: string;
10
+ scaleAspectRatio?: number;
10
11
  };
11
12
  export declare const loadVideoItem: (layer: ITrackItem & IVideo, options: Partial<OptionsType>) => Promise<{
12
13
  trim: ITrim;
@@ -22,6 +23,7 @@ export declare const loadVideoItem: (layer: ITrackItem & IVideo, options: Partia
22
23
  animations?: {
23
24
  in: import('@designcombo/types').IBasicAnimation;
24
25
  out: import('@designcombo/types').IBasicAnimation;
26
+ loop: import('@designcombo/types').IBasicAnimation;
25
27
  };
26
28
  modifier?: IDisplay;
27
29
  activeEdit?: boolean;
@@ -48,16 +50,51 @@ export declare const loadAudioItem: (payload: ITrackItem & IAudio) => Promise<{
48
50
  };
49
51
  duration: number;
50
52
  }>;
53
+ export declare const loadCustomItem: (payload: ITrackItem & ICustom, options: {
54
+ size: ISize;
55
+ scaleMode?: string;
56
+ scaleAspectRatio?: number;
57
+ }) => Promise<{
58
+ id: string;
59
+ name: string;
60
+ type: string;
61
+ display: IDisplay;
62
+ trim: ITrim | undefined;
63
+ duration: any;
64
+ details: {
65
+ width: any;
66
+ height: any;
67
+ top: any;
68
+ left: any;
69
+ firstBackgroundColor: any;
70
+ secondBackgroundColor: any;
71
+ border: any;
72
+ borderRadius: any;
73
+ borderWidth: any;
74
+ borderColor: any;
75
+ opacity: any;
76
+ flipX: any;
77
+ flipY: any;
78
+ inverted: any;
79
+ srcs: any;
80
+ reproduceAudio: any;
81
+ };
82
+ metadata: {};
83
+ }>;
51
84
  export declare const loadTemplateItem: (payload: ITemplate, options: {
52
85
  size: ISize;
86
+ scaleMode?: string;
87
+ scaleAspectRatio?: number;
53
88
  }) => Promise<{
54
89
  id: string;
55
90
  type: string;
56
91
  details: {
92
+ transform: any;
57
93
  top: any;
58
94
  left: any;
59
95
  scale: number;
60
96
  rotate: any;
97
+ background: any;
61
98
  width: number;
62
99
  height: number;
63
100
  type?: string;
@@ -69,10 +106,13 @@ export declare const loadTemplateItem: (payload: ITemplate, options: {
69
106
  }>;
70
107
  export declare const loadCompositionItem: (payload: IComposition, options: {
71
108
  size: ISize;
109
+ scaleMode?: string;
110
+ scaleAspectRatio?: number;
72
111
  }) => Promise<{
73
112
  id: string;
74
113
  type: string;
75
114
  details: {
115
+ transform: any;
76
116
  top: any;
77
117
  left: any;
78
118
  scale: number;
@@ -89,6 +129,8 @@ export declare const loadIllustrationItem: (payload: ITrackItem & IIllustration,
89
129
  width: number;
90
130
  height: number;
91
131
  };
132
+ scaleMode?: string;
133
+ scaleAspectRatio?: number;
92
134
  }) => Promise<{
93
135
  id: string;
94
136
  name: string;
@@ -122,6 +164,8 @@ export declare const loadShapeItem: (payload: ITrackItem & IShape, options: {
122
164
  width: number;
123
165
  height: number;
124
166
  };
167
+ scaleMode?: string;
168
+ scaleAspectRatio?: number;
125
169
  }) => Promise<{
126
170
  id: string;
127
171
  name: string;
@@ -155,6 +199,7 @@ export declare const loadImageItem: (payload: ITrackItem & IImage, options: {
155
199
  height: number;
156
200
  };
157
201
  scaleMode?: string;
202
+ scaleAspectRatio?: number;
158
203
  }) => Promise<{
159
204
  id: string;
160
205
  type: string;
@@ -292,6 +337,8 @@ export declare const loadTrackItem: (payload: ITrackItem & (IVideo | IAudio | II
292
337
  height: number;
293
338
  };
294
339
  origin?: number;
340
+ scaleMode?: string;
341
+ scaleAspectRatio?: number;
295
342
  }) => Promise<{
296
343
  trim: ITrim;
297
344
  type: string;
@@ -306,6 +353,7 @@ export declare const loadTrackItem: (payload: ITrackItem & (IVideo | IAudio | II
306
353
  animations?: {
307
354
  in: import('@designcombo/types').IBasicAnimation;
308
355
  out: import('@designcombo/types').IBasicAnimation;
356
+ loop: import('@designcombo/types').IBasicAnimation;
309
357
  };
310
358
  modifier?: IDisplay;
311
359
  activeEdit?: boolean;
@@ -334,10 +382,12 @@ export declare const loadTrackItem: (payload: ITrackItem & (IVideo | IAudio | II
334
382
  id: string;
335
383
  type: string;
336
384
  details: {
385
+ transform: any;
337
386
  top: any;
338
387
  left: any;
339
388
  scale: number;
340
389
  rotate: any;
390
+ background: any;
341
391
  width: number;
342
392
  height: number;
343
393
  type?: string;
@@ -0,0 +1,14 @@
1
+ import { State, ITrackType } from '@designcombo/types';
2
+
3
+ interface TrackOptions {
4
+ targetTrackIndex?: number;
5
+ targetTrackId?: string;
6
+ }
7
+ interface TrackItem {
8
+ id: string;
9
+ type: string | ITrackType;
10
+ details: any;
11
+ [key: string]: any;
12
+ }
13
+ export declare function manageTracks(currentState: State, trackItems: TrackItem[], options?: TrackOptions): State;
14
+ export {};
@@ -0,0 +1,3 @@
1
+ import { ITrack, ITrackItem, ITransition } from '@designcombo/types';
2
+
3
+ export declare function updateItemsNextTransition(transition: ITransition, tracks: ITrack[], trackItemsMap: Record<string, ITrackItem>): void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@designcombo/state",
3
- "version": "3.1.13",
3
+ "version": "4.0.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": "3.1.13",
28
+ "@designcombo/types": "4.0.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": "3.1.13"
42
+ "@designcombo/types": "4.0.0"
43
43
  },
44
44
  "scripts": {
45
45
  "dev": "vite",