@shotstack/shotstack-studio 1.3.0 → 1.4.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.
Files changed (58) hide show
  1. package/dist/shotstack-studio.es.js +4912 -4754
  2. package/dist/shotstack-studio.umd.js +7 -7
  3. package/dist/src/components/canvas/index.d.ts +14 -0
  4. package/dist/{core/entities → src/components/canvas}/players/audio-player.d.ts +4 -4
  5. package/dist/{core/entities → src/components/canvas}/players/html-player.d.ts +4 -4
  6. package/dist/{core/entities → src/components/canvas}/players/image-player.d.ts +4 -4
  7. package/dist/{core/entities → src/components/canvas}/players/luma-player.d.ts +4 -4
  8. package/dist/{core/entities/base → src/components/canvas/players}/player.d.ts +5 -4
  9. package/dist/{core/entities → src/components/canvas}/players/shape-player.d.ts +4 -4
  10. package/dist/{core/entities → src/components/canvas}/players/text-player.d.ts +1 -1
  11. package/dist/{core/entities → src/components/canvas}/players/video-player.d.ts +4 -4
  12. package/dist/{core → src/components/canvas}/shotstack-canvas.d.ts +2 -2
  13. package/dist/{core/entities → src/components/canvas}/system/inspector.d.ts +1 -1
  14. package/dist/{core/entities → src/components/canvas}/text/text-editor.d.ts +1 -1
  15. package/dist/src/core/commands/add-clip-command.d.ts +14 -0
  16. package/dist/src/core/commands/add-track-command.d.ts +8 -0
  17. package/dist/src/core/commands/delete-clip-command.d.ts +10 -0
  18. package/dist/src/core/commands/delete-track-command.d.ts +9 -0
  19. package/dist/src/core/commands/set-updated-clip-command.d.ts +17 -0
  20. package/dist/src/core/commands/types.d.ts +25 -0
  21. package/dist/src/core/commands/update-text-content-command.d.ts +16 -0
  22. package/dist/{core/entities/system → src/core}/edit.d.ts +13 -7
  23. package/dist/{core → src/core}/export/video-exporter.d.ts +2 -2
  24. package/dist/{core → src/core}/inputs/controls.d.ts +1 -1
  25. package/dist/{core → src/core}/schemas/asset.d.ts +42 -38
  26. package/dist/{core → src/core}/schemas/audio-asset.d.ts +18 -14
  27. package/dist/{core → src/core}/schemas/clip.d.ts +113 -99
  28. package/dist/{core → src/core}/schemas/edit.d.ts +372 -344
  29. package/dist/{core → src/core}/schemas/track.d.ts +141 -127
  30. package/dist/{core → src/core}/schemas/video-asset.d.ts +18 -14
  31. package/dist/src/index.d.ts +4 -0
  32. package/dist/vite.config.d.ts +2 -0
  33. package/package.json +1 -1
  34. package/readme.md +10 -0
  35. package/dist/core/entities/index.d.ts +0 -14
  36. package/dist/index.d.ts +0 -4
  37. package/dist/{core/entities → src/components/canvas}/text/text-cursor.d.ts +0 -0
  38. package/dist/{core/entities → src/components/canvas}/text/text-input-handler.d.ts +0 -0
  39. package/dist/{core → src/core}/animations/curve-interpolator.d.ts +0 -0
  40. package/dist/{core → src/core}/animations/effect-preset-builder.d.ts +0 -0
  41. package/dist/{core → src/core}/animations/keyframe-builder.d.ts +0 -0
  42. package/dist/{core → src/core}/animations/transition-preset-builder.d.ts +0 -0
  43. package/dist/{core → src/core}/events/asset-load-tracker.d.ts +0 -0
  44. package/dist/{core → src/core}/events/event-emitter.d.ts +0 -0
  45. package/dist/{core → src/core}/inputs/pointer.d.ts +0 -0
  46. package/dist/{core → src/core}/layouts/geometry.d.ts +0 -0
  47. package/dist/{core → src/core}/layouts/position-builder.d.ts +0 -0
  48. package/dist/{core → src/core}/loaders/asset-loader.d.ts +0 -0
  49. package/dist/{core → src/core}/loaders/audio-load-parser.d.ts +0 -0
  50. package/dist/{core → src/core}/loaders/font-load-parser.d.ts +0 -0
  51. package/dist/{core → src/core}/schemas/html-asset.d.ts +2 -2
  52. package/dist/{core → src/core}/schemas/image-asset.d.ts +2 -2
  53. package/dist/{core → src/core}/schemas/keyframe.d.ts +2 -2
  54. package/dist/{core → src/core}/schemas/luma-asset.d.ts +2 -2
  55. /package/dist/{core → src/core}/schemas/shape-asset.d.ts +0 -0
  56. /package/dist/{core → src/core}/schemas/text-asset.d.ts +0 -0
  57. /package/dist/{core/entities/base → src/core/shared}/entity.d.ts +0 -0
  58. /package/dist/{main.d.ts → src/main.d.ts} +0 -0
@@ -16,26 +16,28 @@ export declare const VideoAssetCropSchema: zod.ZodObject<{
16
16
  bottom?: number | undefined;
17
17
  left?: number | undefined;
18
18
  }>;
19
- export declare const VideoAssetVolumeSchema: zod.ZodUnion<[zod.ZodArray<zod.ZodObject<{
19
+ export declare const VideoAssetVolumeSchema: zod.ZodUnion<[zod.ZodArray<zod.ZodObject<zod.objectUtil.extendShape<{
20
+ from: zod.ZodNumber;
21
+ to: zod.ZodNumber;
20
22
  start: zod.ZodNumber;
21
23
  length: zod.ZodNumber;
22
24
  interpolation: zod.ZodOptional<zod.ZodEnum<["linear", "bezier", "constant"]>>;
23
25
  easing: zod.ZodOptional<zod.ZodEnum<["ease", "easeIn", "easeOut", "easeInOut", "easeInQuad", "easeInCubic", "easeInQuart", "easeInQuint", "easeInSine", "easeInExpo", "easeInCirc", "easeInBack", "easeOutQuad", "easeOutCubic", "easeOutQuart", "easeOutQuint", "easeOutSine", "easeOutExpo", "easeOutCirc", "easeOutBack", "easeInOutQuad", "easeInOutCubic", "easeInOutQuart", "easeInOutQuint", "easeInOutSine", "easeInOutExpo", "easeInOutCirc", "easeInOutBack"]>>;
24
- } & {
26
+ }, {
25
27
  from: zod.ZodNumber;
26
28
  to: zod.ZodNumber;
27
- }, "strip", zod.ZodTypeAny, {
28
- length: number;
29
+ }>, "strip", zod.ZodTypeAny, {
29
30
  from: number;
30
31
  to: number;
31
32
  start: number;
33
+ length: number;
32
34
  interpolation?: "linear" | "bezier" | "constant" | undefined;
33
35
  easing?: "ease" | "easeIn" | "easeOut" | "easeInOut" | "easeInQuad" | "easeInCubic" | "easeInQuart" | "easeInQuint" | "easeInSine" | "easeInExpo" | "easeInCirc" | "easeInBack" | "easeOutQuad" | "easeOutCubic" | "easeOutQuart" | "easeOutQuint" | "easeOutSine" | "easeOutExpo" | "easeOutCirc" | "easeOutBack" | "easeInOutQuad" | "easeInOutCubic" | "easeInOutQuart" | "easeInOutQuint" | "easeInOutSine" | "easeInOutExpo" | "easeInOutCirc" | "easeInOutBack" | undefined;
34
36
  }, {
35
- length: number;
36
37
  from: number;
37
38
  to: number;
38
39
  start: number;
40
+ length: number;
39
41
  interpolation?: "linear" | "bezier" | "constant" | undefined;
40
42
  easing?: "ease" | "easeIn" | "easeOut" | "easeInOut" | "easeInQuad" | "easeInCubic" | "easeInQuart" | "easeInQuint" | "easeInSine" | "easeInExpo" | "easeInCirc" | "easeInBack" | "easeOutQuad" | "easeOutCubic" | "easeOutQuart" | "easeOutQuint" | "easeOutSine" | "easeOutExpo" | "easeOutCirc" | "easeOutBack" | "easeInOutQuad" | "easeInOutCubic" | "easeInOutQuart" | "easeInOutQuint" | "easeInOutSine" | "easeInOutExpo" | "easeInOutCirc" | "easeInOutBack" | undefined;
41
43
  }>, "many">, zod.ZodNumber]>;
@@ -59,38 +61,40 @@ export declare const VideoAssetSchema: zod.ZodObject<{
59
61
  bottom?: number | undefined;
60
62
  left?: number | undefined;
61
63
  }>>;
62
- volume: zod.ZodOptional<zod.ZodUnion<[zod.ZodArray<zod.ZodObject<{
64
+ volume: zod.ZodOptional<zod.ZodUnion<[zod.ZodArray<zod.ZodObject<zod.objectUtil.extendShape<{
65
+ from: zod.ZodNumber;
66
+ to: zod.ZodNumber;
63
67
  start: zod.ZodNumber;
64
68
  length: zod.ZodNumber;
65
69
  interpolation: zod.ZodOptional<zod.ZodEnum<["linear", "bezier", "constant"]>>;
66
70
  easing: zod.ZodOptional<zod.ZodEnum<["ease", "easeIn", "easeOut", "easeInOut", "easeInQuad", "easeInCubic", "easeInQuart", "easeInQuint", "easeInSine", "easeInExpo", "easeInCirc", "easeInBack", "easeOutQuad", "easeOutCubic", "easeOutQuart", "easeOutQuint", "easeOutSine", "easeOutExpo", "easeOutCirc", "easeOutBack", "easeInOutQuad", "easeInOutCubic", "easeInOutQuart", "easeInOutQuint", "easeInOutSine", "easeInOutExpo", "easeInOutCirc", "easeInOutBack"]>>;
67
- } & {
71
+ }, {
68
72
  from: zod.ZodNumber;
69
73
  to: zod.ZodNumber;
70
- }, "strip", zod.ZodTypeAny, {
71
- length: number;
74
+ }>, "strip", zod.ZodTypeAny, {
72
75
  from: number;
73
76
  to: number;
74
77
  start: number;
78
+ length: number;
75
79
  interpolation?: "linear" | "bezier" | "constant" | undefined;
76
80
  easing?: "ease" | "easeIn" | "easeOut" | "easeInOut" | "easeInQuad" | "easeInCubic" | "easeInQuart" | "easeInQuint" | "easeInSine" | "easeInExpo" | "easeInCirc" | "easeInBack" | "easeOutQuad" | "easeOutCubic" | "easeOutQuart" | "easeOutQuint" | "easeOutSine" | "easeOutExpo" | "easeOutCirc" | "easeOutBack" | "easeInOutQuad" | "easeInOutCubic" | "easeInOutQuart" | "easeInOutQuint" | "easeInOutSine" | "easeInOutExpo" | "easeInOutCirc" | "easeInOutBack" | undefined;
77
81
  }, {
78
- length: number;
79
82
  from: number;
80
83
  to: number;
81
84
  start: number;
85
+ length: number;
82
86
  interpolation?: "linear" | "bezier" | "constant" | undefined;
83
87
  easing?: "ease" | "easeIn" | "easeOut" | "easeInOut" | "easeInQuad" | "easeInCubic" | "easeInQuart" | "easeInQuint" | "easeInSine" | "easeInExpo" | "easeInCirc" | "easeInBack" | "easeOutQuad" | "easeOutCubic" | "easeOutQuart" | "easeOutQuint" | "easeOutSine" | "easeOutExpo" | "easeOutCirc" | "easeOutBack" | "easeInOutQuad" | "easeInOutCubic" | "easeInOutQuart" | "easeInOutQuint" | "easeInOutSine" | "easeInOutExpo" | "easeInOutCirc" | "easeInOutBack" | undefined;
84
88
  }>, "many">, zod.ZodNumber]>>;
85
89
  }, "strip", zod.ZodTypeAny, {
86
- src: string;
87
90
  type: "video";
91
+ src: string;
88
92
  trim?: number | undefined;
89
93
  volume?: number | {
90
- length: number;
91
94
  from: number;
92
95
  to: number;
93
96
  start: number;
97
+ length: number;
94
98
  interpolation?: "linear" | "bezier" | "constant" | undefined;
95
99
  easing?: "ease" | "easeIn" | "easeOut" | "easeInOut" | "easeInQuad" | "easeInCubic" | "easeInQuart" | "easeInQuint" | "easeInSine" | "easeInExpo" | "easeInCirc" | "easeInBack" | "easeOutQuad" | "easeOutCubic" | "easeOutQuart" | "easeOutQuint" | "easeOutSine" | "easeOutExpo" | "easeOutCirc" | "easeOutBack" | "easeInOutQuad" | "easeInOutCubic" | "easeInOutQuart" | "easeInOutQuint" | "easeInOutSine" | "easeInOutExpo" | "easeInOutCirc" | "easeInOutBack" | undefined;
96
100
  }[] | undefined;
@@ -101,14 +105,14 @@ export declare const VideoAssetSchema: zod.ZodObject<{
101
105
  left?: number | undefined;
102
106
  } | undefined;
103
107
  }, {
104
- src: string;
105
108
  type: "video";
109
+ src: string;
106
110
  trim?: number | undefined;
107
111
  volume?: number | {
108
- length: number;
109
112
  from: number;
110
113
  to: number;
111
114
  start: number;
115
+ length: number;
112
116
  interpolation?: "linear" | "bezier" | "constant" | undefined;
113
117
  easing?: "ease" | "easeIn" | "easeOut" | "easeInOut" | "easeInQuad" | "easeInCubic" | "easeInQuart" | "easeInQuint" | "easeInSine" | "easeInExpo" | "easeInCirc" | "easeInBack" | "easeOutQuad" | "easeOutCubic" | "easeOutQuart" | "easeOutQuint" | "easeOutSine" | "easeOutExpo" | "easeOutCirc" | "easeOutBack" | "easeInOutQuad" | "easeInOutCubic" | "easeInOutQuart" | "easeInOutQuint" | "easeInOutSine" | "easeInOutExpo" | "easeInOutCirc" | "easeInOutBack" | undefined;
114
118
  }[] | undefined;
@@ -0,0 +1,4 @@
1
+ export { Edit } from "@core/edit";
2
+ export { Canvas } from "@canvas/shotstack-canvas";
3
+ export { Controls } from "@core/inputs/controls";
4
+ export { VideoExporter } from "@core/export/video-exporter";
@@ -0,0 +1,2 @@
1
+ declare const _default: import("vite").UserConfig;
2
+ export default _default;
package/package.json CHANGED
@@ -5,7 +5,7 @@
5
5
  "cpuccino",
6
6
  "dazzatron"
7
7
  ],
8
- "version": "1.3.0",
8
+ "version": "1.4.0",
9
9
  "description": "A video editing library for creating and editing videos with Shotstack",
10
10
  "type": "module",
11
11
  "main": "dist/shotstack-studio.umd.js",
package/readme.md CHANGED
@@ -109,6 +109,10 @@ edit.addTrack(1, { clips: [] });
109
109
  edit.deleteClip(0, 0);
110
110
  edit.deleteTrack(1);
111
111
 
112
+ // Undo/Redo
113
+ edit.undo();
114
+ edit.redo();
115
+
112
116
  // Get edit information
113
117
  const clip = edit.getClip(0, 0);
114
118
  const track = edit.getTrack(0);
@@ -174,6 +178,8 @@ await controls.load();
174
178
  // Shift + Arrow - Seek larger amount
175
179
  // Comma - Step backward one frame
176
180
  // Period - Step forward one frame
181
+ // Cmd/Ctrl + Z - Undo
182
+ // Cmd/Ctrl + Shift + Z - Redo
177
183
  ```
178
184
 
179
185
  ### VideoExporter
@@ -277,11 +283,15 @@ Creates a new Edit instance with the specified dimensions and background color.
277
283
  - `getTrack(trackIdx: number)` - Get a track by index
278
284
  - `deleteTrack(trackIdx: number)` - Delete a track
279
285
  - `getEdit()` - Get the full edit configuration as a JSON object
286
+ - `undo()` - Undo the last editing operation
287
+ - `redo()` - Redo the last undone operation
280
288
 
281
289
  #### Events
282
290
 
283
291
  - `clip:selected` - Triggered when a clip is selected
284
292
  - `clip:updated` - Triggered when a clip is modified
293
+ - `edit:undo` - Triggered when an undo operation is performed
294
+ - `edit:redo` - Triggered when a redo operation is performed
285
295
 
286
296
  ### Canvas
287
297
 
@@ -1,14 +0,0 @@
1
- export { Entity } from './base/entity';
2
- export { Player } from './base/player';
3
- export { AudioPlayer } from './players/audio-player';
4
- export { HtmlPlayer } from './players/html-player';
5
- export { ImagePlayer } from './players/image-player';
6
- export { LumaPlayer } from './players/luma-player';
7
- export { ShapePlayer } from './players/shape-player';
8
- export { TextPlayer } from './players/text-player';
9
- export { VideoPlayer } from './players/video-player';
10
- export { TextCursor } from './text/text-cursor';
11
- export { TextEditor } from './text/text-editor';
12
- export { TextInputHandler } from './text/text-input-handler';
13
- export { Edit } from './system/edit';
14
- export { Inspector } from './system/inspector';
package/dist/index.d.ts DELETED
@@ -1,4 +0,0 @@
1
- export { Edit } from "@entities/system/edit";
2
- export { Canvas } from "./core/shotstack-canvas";
3
- export { Controls } from "./core/inputs/controls";
4
- export { VideoExporter } from "./core/export/video-exporter";
File without changes
File without changes
@@ -8,15 +8,15 @@ export declare const HtmlAssetSchema: zod.ZodObject<{
8
8
  height: zod.ZodOptional<zod.ZodNumber>;
9
9
  position: zod.ZodOptional<zod.ZodEnum<["top", "topRight", "right", "bottomRight", "bottom", "bottomLeft", "left", "topLeft", "center"]>>;
10
10
  }, "strip", zod.ZodTypeAny, {
11
- html: string;
12
11
  type: "html";
12
+ html: string;
13
13
  css: string;
14
14
  width?: number | undefined;
15
15
  height?: number | undefined;
16
16
  position?: "top" | "topRight" | "right" | "bottomRight" | "bottom" | "bottomLeft" | "left" | "topLeft" | "center" | undefined;
17
17
  }, {
18
- html: string;
19
18
  type: "html";
19
+ html: string;
20
20
  css: string;
21
21
  width?: number | undefined;
22
22
  height?: number | undefined;
@@ -36,8 +36,8 @@ export declare const ImageAssetSchema: zod.ZodObject<{
36
36
  left?: number | undefined;
37
37
  }>>;
38
38
  }, "strip", zod.ZodTypeAny, {
39
- src: string;
40
39
  type: "image";
40
+ src: string;
41
41
  crop?: {
42
42
  top?: number | undefined;
43
43
  right?: number | undefined;
@@ -45,8 +45,8 @@ export declare const ImageAssetSchema: zod.ZodObject<{
45
45
  left?: number | undefined;
46
46
  } | undefined;
47
47
  }, {
48
- src: string;
49
48
  type: "image";
49
+ src: string;
50
50
  crop?: {
51
51
  top?: number | undefined;
52
52
  right?: number | undefined;
@@ -9,17 +9,17 @@ export declare const KeyframeSchema: zod.ZodObject<{
9
9
  interpolation: zod.ZodOptional<zod.ZodEnum<["linear", "bezier", "constant"]>>;
10
10
  easing: zod.ZodOptional<zod.ZodEnum<["ease", "easeIn", "easeOut", "easeInOut", "easeInQuad", "easeInCubic", "easeInQuart", "easeInQuint", "easeInSine", "easeInExpo", "easeInCirc", "easeInBack", "easeOutQuad", "easeOutCubic", "easeOutQuart", "easeOutQuint", "easeOutSine", "easeOutExpo", "easeOutCirc", "easeOutBack", "easeInOutQuad", "easeInOutCubic", "easeInOutQuart", "easeInOutQuint", "easeInOutSine", "easeInOutExpo", "easeInOutCirc", "easeInOutBack"]>>;
11
11
  }, "strip", zod.ZodTypeAny, {
12
- length: number;
13
12
  from: number;
14
13
  to: number;
15
14
  start: number;
15
+ length: number;
16
16
  interpolation?: "linear" | "bezier" | "constant" | undefined;
17
17
  easing?: "ease" | "easeIn" | "easeOut" | "easeInOut" | "easeInQuad" | "easeInCubic" | "easeInQuart" | "easeInQuint" | "easeInSine" | "easeInExpo" | "easeInCirc" | "easeInBack" | "easeOutQuad" | "easeOutCubic" | "easeOutQuart" | "easeOutQuint" | "easeOutSine" | "easeOutExpo" | "easeOutCirc" | "easeOutBack" | "easeInOutQuad" | "easeInOutCubic" | "easeInOutQuart" | "easeInOutQuint" | "easeInOutSine" | "easeInOutExpo" | "easeInOutCirc" | "easeInOutBack" | undefined;
18
18
  }, {
19
- length: number;
20
19
  from: number;
21
20
  to: number;
22
21
  start: number;
22
+ length: number;
23
23
  interpolation?: "linear" | "bezier" | "constant" | undefined;
24
24
  easing?: "ease" | "easeIn" | "easeOut" | "easeInOut" | "easeInQuad" | "easeInCubic" | "easeInQuart" | "easeInQuint" | "easeInSine" | "easeInExpo" | "easeInCirc" | "easeInBack" | "easeOutQuad" | "easeOutCubic" | "easeOutQuart" | "easeOutQuint" | "easeOutSine" | "easeOutExpo" | "easeOutCirc" | "easeOutBack" | "easeInOutQuad" | "easeInOutCubic" | "easeInOutQuart" | "easeInOutQuint" | "easeInOutSine" | "easeInOutExpo" | "easeInOutCirc" | "easeInOutBack" | undefined;
25
25
  }>;
@@ -4,10 +4,10 @@ export declare const LumaAssetSchema: zod.ZodObject<{
4
4
  type: zod.ZodLiteral<"luma">;
5
5
  src: zod.ZodString;
6
6
  }, "strip", zod.ZodTypeAny, {
7
- src: string;
8
7
  type: "luma";
9
- }, {
10
8
  src: string;
9
+ }, {
11
10
  type: "luma";
11
+ src: string;
12
12
  }>;
13
13
  export type LumaAsset = zod.infer<typeof LumaAssetSchema>;
File without changes
File without changes