@cliquify.me/state 3.1.8 → 3.1.10

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.
@@ -0,0 +1,339 @@
1
+ import { IAudio, ICaption, IDisplay, IImage, ISize, ITemplate, IText, ITrack, ITrackItem, ITrim, IVideo, IVideoDetails } from '@cliquify.me/types';
2
+
3
+ type OptionsType = {
4
+ size: {
5
+ width: number;
6
+ height: number;
7
+ };
8
+ origin: number;
9
+ scaleMode?: string;
10
+ };
11
+ export declare const loadVideoItem: (layer: ITrackItem & IVideo, options: Partial<OptionsType>) => Promise<{
12
+ trim: ITrim;
13
+ type: string;
14
+ name: string;
15
+ details: IVideoDetails;
16
+ playbackRate: number;
17
+ display: IDisplay;
18
+ duration: number;
19
+ id: string;
20
+ preview?: string;
21
+ isMain?: boolean;
22
+ animations?: {
23
+ in: import('@cliquify.me/types').IBasicAnimation;
24
+ out: import('@cliquify.me/types').IBasicAnimation;
25
+ };
26
+ modifier?: IDisplay;
27
+ activeEdit?: boolean;
28
+ metadata: Record<string, any>;
29
+ transitionInfo?: {
30
+ isFrom: boolean;
31
+ isTo: boolean;
32
+ transition: import('@cliquify.me/types').ITransition;
33
+ };
34
+ }>;
35
+ export declare const loadAudioItem: (payload: ITrackItem & IAudio) => Promise<{
36
+ id: string;
37
+ name: string;
38
+ type: string;
39
+ display: IDisplay;
40
+ trim: ITrim;
41
+ playbackRate: number;
42
+ details: {
43
+ src: any;
44
+ volume: any;
45
+ };
46
+ metadata: {
47
+ [x: string]: any;
48
+ };
49
+ duration: number;
50
+ }>;
51
+ export declare const loadTemplateItem: (payload: ITemplate, options: {
52
+ size: ISize;
53
+ }) => Promise<{
54
+ id: string;
55
+ type: string;
56
+ details: {
57
+ top: any;
58
+ left: any;
59
+ scale: number;
60
+ rotate: any;
61
+ width: number;
62
+ height: number;
63
+ type?: string;
64
+ name?: string;
65
+ };
66
+ trim: IDisplay;
67
+ display: IDisplay;
68
+ activeEdit: boolean;
69
+ }>;
70
+ export declare const loadImageItem: (payload: ITrackItem & IImage, options: {
71
+ origin?: number;
72
+ size?: {
73
+ width: number;
74
+ height: number;
75
+ };
76
+ scaleMode?: string;
77
+ }) => Promise<{
78
+ id: string;
79
+ type: string;
80
+ name: string;
81
+ display: IDisplay;
82
+ playbackRate: number;
83
+ details: {
84
+ src: any;
85
+ width: any;
86
+ height: any;
87
+ opacity: any;
88
+ transform: any;
89
+ border: any;
90
+ borderRadius: any;
91
+ boxShadow: any;
92
+ top: any;
93
+ left: any;
94
+ borderWidth: any;
95
+ borderColor: any;
96
+ blur: any;
97
+ brightness: any;
98
+ flipX: any;
99
+ flipY: any;
100
+ rotate: any;
101
+ visibility: any;
102
+ };
103
+ metadata: Record<string, any>;
104
+ }>;
105
+ export declare const loadCaptionItem: (trackItem: ITrackItem, options: {
106
+ origin?: number;
107
+ size?: {
108
+ width: number;
109
+ height: number;
110
+ };
111
+ }) => Promise<{
112
+ id: string;
113
+ name: string;
114
+ type: string;
115
+ display: IDisplay;
116
+ details: {
117
+ text: string;
118
+ height: number;
119
+ fontUrl: string;
120
+ top: string | number;
121
+ left: string | number;
122
+ borderWidth: number;
123
+ borderColor: string;
124
+ boxShadow: {
125
+ color: string;
126
+ x: number;
127
+ y: number;
128
+ blur: number;
129
+ };
130
+ words: import('@cliquify.me/types').ICaptionWord[];
131
+ appearedColor: string;
132
+ activeColor: string;
133
+ activeFillColor: string;
134
+ skewX: number;
135
+ skewY: number;
136
+ fontSize: number;
137
+ fontFamily: string;
138
+ color: string;
139
+ lineHeight: number | string;
140
+ letterSpacing: number | string;
141
+ fontWeight: number;
142
+ fontStyle: string;
143
+ textDecoration: string;
144
+ textAlign: "center" | "left" | "right";
145
+ wordSpacing: number | string;
146
+ textShadow: string;
147
+ backgroundColor: string;
148
+ opacity: number;
149
+ width: number;
150
+ textTransform: "capitalize" | "uppercase" | "lowercase";
151
+ border: string;
152
+ wordWrap: "normal" | "break-word";
153
+ wordBreak: "normal" | "break-word" | "break-all";
154
+ WebkitTextStrokeColor: string;
155
+ WebkitTextStrokeWidth: string;
156
+ transform?: string;
157
+ borderRadius?: number;
158
+ };
159
+ metadata: Record<string, any>;
160
+ }>;
161
+ export declare const loadTextItem: (payload: ITrackItem & IText, options: {
162
+ origin?: number;
163
+ size?: {
164
+ width: number;
165
+ height: number;
166
+ };
167
+ }) => Promise<{
168
+ id: string;
169
+ name: string;
170
+ type: string;
171
+ display: IDisplay;
172
+ details: {
173
+ text: any;
174
+ height: number;
175
+ fontUrl: any;
176
+ top: string | number;
177
+ left: string | number;
178
+ borderWidth: any;
179
+ borderColor: any;
180
+ boxShadow: any;
181
+ skewX: number;
182
+ skewY: number;
183
+ fontSize: number;
184
+ fontFamily: string;
185
+ color: string;
186
+ lineHeight: number | string;
187
+ letterSpacing: number | string;
188
+ fontWeight: number;
189
+ fontStyle: string;
190
+ textDecoration: string;
191
+ textAlign: "center" | "left" | "right";
192
+ wordSpacing: number | string;
193
+ textShadow: string;
194
+ backgroundColor: string;
195
+ opacity: number;
196
+ width: number;
197
+ textTransform: "capitalize" | "uppercase" | "lowercase";
198
+ border: string;
199
+ wordWrap: "normal" | "break-word";
200
+ wordBreak: "normal" | "break-word" | "break-all";
201
+ WebkitTextStrokeColor: string;
202
+ WebkitTextStrokeWidth: string;
203
+ transform?: string;
204
+ borderRadius?: number;
205
+ };
206
+ metadata: {};
207
+ }>;
208
+ export declare const loadTrackItem: (payload: ITrackItem & (IVideo | IAudio | IImage | IText | ICaption | ITemplate), options?: {
209
+ size?: {
210
+ width: number;
211
+ height: number;
212
+ };
213
+ origin?: number;
214
+ }) => Promise<{
215
+ trim: ITrim;
216
+ type: string;
217
+ name: string;
218
+ details: IVideoDetails;
219
+ playbackRate: number;
220
+ display: IDisplay;
221
+ duration: number;
222
+ id: string;
223
+ preview?: string;
224
+ isMain?: boolean;
225
+ animations?: {
226
+ in: import('@cliquify.me/types').IBasicAnimation;
227
+ out: import('@cliquify.me/types').IBasicAnimation;
228
+ };
229
+ modifier?: IDisplay;
230
+ activeEdit?: boolean;
231
+ metadata: Record<string, any>;
232
+ transitionInfo?: {
233
+ isFrom: boolean;
234
+ isTo: boolean;
235
+ transition: import('@cliquify.me/types').ITransition;
236
+ };
237
+ } | {
238
+ id: string;
239
+ name: string;
240
+ type: string;
241
+ display: IDisplay;
242
+ trim: ITrim;
243
+ playbackRate: number;
244
+ details: {
245
+ src: any;
246
+ volume: any;
247
+ };
248
+ metadata: {
249
+ [x: string]: any;
250
+ };
251
+ duration: number;
252
+ } | {
253
+ id: string;
254
+ type: string;
255
+ details: {
256
+ top: any;
257
+ left: any;
258
+ scale: number;
259
+ rotate: any;
260
+ width: number;
261
+ height: number;
262
+ type?: string;
263
+ name?: string;
264
+ };
265
+ trim: IDisplay;
266
+ display: IDisplay;
267
+ activeEdit: boolean;
268
+ } | {
269
+ id: string;
270
+ type: string;
271
+ name: string;
272
+ display: IDisplay;
273
+ playbackRate: number;
274
+ details: {
275
+ src: any;
276
+ width: any;
277
+ height: any;
278
+ opacity: any;
279
+ transform: any;
280
+ border: any;
281
+ borderRadius: any;
282
+ boxShadow: any;
283
+ top: any;
284
+ left: any;
285
+ borderWidth: any;
286
+ borderColor: any;
287
+ blur: any;
288
+ brightness: any;
289
+ flipX: any;
290
+ flipY: any;
291
+ rotate: any;
292
+ visibility: any;
293
+ };
294
+ metadata: Record<string, any>;
295
+ } | {
296
+ id: string;
297
+ name: string;
298
+ type: string;
299
+ display: IDisplay;
300
+ details: {
301
+ text: any;
302
+ height: number;
303
+ fontUrl: any;
304
+ top: string | number;
305
+ left: string | number;
306
+ borderWidth: any;
307
+ borderColor: any;
308
+ boxShadow: any;
309
+ skewX: number;
310
+ skewY: number;
311
+ fontSize: number;
312
+ fontFamily: string;
313
+ color: string;
314
+ lineHeight: number | string;
315
+ letterSpacing: number | string;
316
+ fontWeight: number;
317
+ fontStyle: string;
318
+ textDecoration: string;
319
+ textAlign: "center" | "left" | "right";
320
+ wordSpacing: number | string;
321
+ textShadow: string;
322
+ backgroundColor: string;
323
+ opacity: number;
324
+ width: number;
325
+ textTransform: "capitalize" | "uppercase" | "lowercase";
326
+ border: string;
327
+ wordWrap: "normal" | "break-word";
328
+ wordBreak: "normal" | "break-word" | "break-all";
329
+ WebkitTextStrokeColor: string;
330
+ WebkitTextStrokeWidth: string;
331
+ transform?: string;
332
+ borderRadius?: number;
333
+ };
334
+ metadata: {};
335
+ }>;
336
+ export declare function checkIfItemIsInTrack(tracks: ITrack[], trackItemIds: string[]): boolean;
337
+ export declare function checkIfTrackExists(currentTracks: ITrack[], nextTracks: ITrack[]): boolean;
338
+ export declare const loadTracks: (tracks?: Partial<ITrack>[], trackItems?: ITrackItem[]) => ITrack[];
339
+ export {};
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Clamps a value between a minimum and maximum range
3
+ * @param value The value to clamp
4
+ * @param min The minimum value
5
+ * @param max The maximum value
6
+ * @returns The clamped value
7
+ */
8
+ export declare function clamp(value: number, min: number, max: number): number;
@@ -0,0 +1,20 @@
1
+ import { ITrackItem } from '@cliquify.me/types';
2
+
3
+ export declare const getImageInfo: (src: string) => Promise<{
4
+ width: number;
5
+ height: number;
6
+ }>;
7
+ export declare const getAudioInfo: (src: string) => Promise<{
8
+ duration: number;
9
+ }>;
10
+ export declare const getVideoInfo: (src: string) => Promise<{
11
+ duration: number;
12
+ width: number;
13
+ height: number;
14
+ }>;
15
+ export declare const getIVideotemInfo: (item: ITrackItem) => Promise<{
16
+ duration: number;
17
+ width: any;
18
+ height: any;
19
+ }>;
20
+ export declare const getTextInfo: (text: string, styles: any) => number;
@@ -0,0 +1,22 @@
1
+ import { IItem, ITrackItem } from '@cliquify.me/types';
2
+
3
+ export declare const getDimension: (item: IItem, info: {
4
+ width: number;
5
+ height: number;
6
+ }) => {
7
+ newWidth: number;
8
+ newHeight: number;
9
+ crop: {
10
+ x: number;
11
+ y: number;
12
+ height: any;
13
+ width: any;
14
+ };
15
+ };
16
+ export declare const getTimeDuration: (item: ITrackItem, info: {
17
+ duration: number;
18
+ }) => {
19
+ duration: number;
20
+ trim: import('@cliquify.me/types').ITrim | undefined;
21
+ display: import('@cliquify.me/types').IDisplay;
22
+ };
@@ -0,0 +1,3 @@
1
+ import { ITrack } from '@cliquify.me/types';
2
+
3
+ export declare function removeItemsFromTrack(tracks: ITrack[], itemsToRemove: string[]): ITrack[];
package/package.json CHANGED
@@ -1,13 +1,20 @@
1
1
  {
2
2
  "name": "@cliquify.me/state",
3
- "version": "3.1.8",
3
+ "version": "3.1.10",
4
4
  "private": false,
5
5
  "files": [
6
6
  "dist"
7
7
  ],
8
- "main": "src/index.ts",
9
- "module": "src/index.ts",
10
- "types": "src/index.ts",
8
+ "main": "dist/index.umd.js",
9
+ "module": "dist/index.es.js",
10
+ "types": "dist/index.d.ts",
11
+ "exports": {
12
+ ".": {
13
+ "import": "./dist/index.es.js",
14
+ "require": "./dist/index.umd.js",
15
+ "types": "./dist/index.d.ts"
16
+ }
17
+ },
11
18
  "devDependencies": {
12
19
  "@designcombo/events": "^1.0.2",
13
20
  "@types/lodash.clonedeep": "^4.5.9",
@@ -18,7 +25,7 @@
18
25
  "typescript": "^5.3.3",
19
26
  "vite": "^5.2.0",
20
27
  "vite-plugin-dts": "^3.9.1",
21
- "@cliquify.me/types": "3.1.8",
28
+ "@cliquify.me/types": "3.1.10",
22
29
  "@cliquify.me/typescript-config": "0.0.2"
23
30
  },
24
31
  "dependencies": {
@@ -32,7 +39,7 @@
32
39
  },
33
40
  "peerDependencies": {
34
41
  "@designcombo/events": "^1.0.2",
35
- "@cliquify.me/types": "3.1.8"
42
+ "@cliquify.me/types": "3.1.10"
36
43
  },
37
44
  "scripts": {
38
45
  "dev": "vite",
package/src/index.ts DELETED
@@ -1,2 +0,0 @@
1
- export { default } from "./state";
2
- export * from "./events";