@shotstack/shotstack-studio 2.0.0-beta.14 → 2.0.0-beta.16

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.
package/dist/index.d.ts CHANGED
@@ -196,6 +196,8 @@ export declare class Canvas {
196
196
  private currentZoom;
197
197
  private onTickBound;
198
198
  private onBackgroundClickBound;
199
+ private onWheelBound;
200
+ private canvasRoot;
199
201
  constructor(edit: Edit);
200
202
  /**
201
203
  * Register a UIController to receive tick updates for canvas overlays.
@@ -204,6 +206,7 @@ export declare class Canvas {
204
206
  registerUIController(controller: UIController): void;
205
207
  load(): Promise<void>;
206
208
  private setupTouchHandling;
209
+ private onWheel;
207
210
  centerEdit(): void;
208
211
  zoomToFit(padding?: number): void;
209
212
  resize(): void;
@@ -278,9 +281,10 @@ export declare class CanvasToolbar {
278
281
  private backgroundChangeCallback;
279
282
  private clickOutsideHandler;
280
283
  private showMergeFields;
281
- constructor(edit?: Edit, options?: {
282
- mergeFields?: boolean;
283
- });
284
+ private maxPixels?;
285
+ constructor(edit?: Edit, options?: CanvasToolbarOptions);
286
+ /** Check if given dimensions exceed the configured pixel limit */
287
+ private isOverLimit;
284
288
  /** Get the edit as ShotstackEdit if it has merge field capabilities */
285
289
  private getShotstackEdit;
286
290
  setPosition(screenX: number, screenY: number): void;
@@ -299,6 +303,8 @@ export declare class CanvasToolbar {
299
303
  private renderVariablesList;
300
304
  private addVariable;
301
305
  setResolution(width: number, height: number): void;
306
+ /** Update warning state for inputs when loaded resolution exceeds configured limit */
307
+ private updateConstraintWarning;
302
308
  setFps(fps: number): void;
303
309
  setBackground(color: string): void;
304
310
  onResolutionChange(callback: ResolutionChangeCallback): void;
@@ -307,6 +313,12 @@ export declare class CanvasToolbar {
307
313
  dispose(): void;
308
314
  }
309
315
 
316
+ declare interface CanvasToolbarOptions {
317
+ mergeFields?: boolean;
318
+ /** Maximum total pixels allowed for custom resolution input. Omit for unlimited. */
319
+ maxPixels?: number;
320
+ }
321
+
310
322
  export declare type CaptionAsset = components["schemas"]["CaptionAsset"];
311
323
 
312
324
  export { CaptionAssetSchema }
@@ -403,6 +415,15 @@ declare type CommandContext = {
403
415
  untrackEndLengthClip(clip: Player): void;
404
416
  trackEndLengthClip(clip: Player): void;
405
417
  getMergeFields(): MergeFieldService;
418
+ getOutputSize(): {
419
+ width: number;
420
+ height: number;
421
+ };
422
+ setOutputSize(width: number, height: number): void;
423
+ getOutputFps(): number;
424
+ setOutputFps(fps: number): void;
425
+ getTimelineBackground(): string;
426
+ setTimelineBackground(color: string): void;
406
427
  };
407
428
 
408
429
  export declare class Controls {
@@ -514,6 +535,12 @@ export declare const DestinationSchema: z.ZodUnion<readonly [z.ZodIntersection<z
514
535
 
515
536
  export declare class Edit extends Entity {
516
537
  private static readonly ZIndexPadding;
538
+ /**
539
+ * Maximum number of commands to keep in undo history.
540
+ * Prevents unbounded memory growth in long editing sessions.
541
+ * Each command may hold Player references and deep-cloned configs.
542
+ */
543
+ private static readonly MAX_HISTORY_SIZE;
517
544
  assetLoader: AssetLoader;
518
545
  events: EventEmitter<EditEventMap & InternalEventMap>;
519
546
  private edit;
@@ -557,6 +584,8 @@ export declare class Edit extends Entity {
557
584
  */
558
585
  private initializeFromDocument;
559
586
  private updateViewportMask;
587
+ /** Update canvas visuals after size change (viewport mask, background, zoom) */
588
+ private updateCanvasForSize;
560
589
  play(): void;
561
590
  pause(): void;
562
591
  seek(target: number): void;
@@ -795,6 +824,10 @@ export declare class Edit extends Entity {
795
824
  getOutputFormat(): string;
796
825
  setOutputDestinations(destinations: Destination[]): void;
797
826
  getOutputDestinations(): Destination[];
827
+ setOutputResolution(resolution: string): void;
828
+ getOutputResolution(): string | undefined;
829
+ setOutputAspectRatio(aspectRatio: string): void;
830
+ getOutputAspectRatio(): string | undefined;
798
831
  getTimelineFonts(): Array<{
799
832
  src: string;
800
833
  }>;
@@ -908,6 +941,11 @@ declare type Edit_2 = components["schemas"]["Edit"];
908
941
  declare type EditCommand = {
909
942
  execute(context?: CommandContext): void | Promise<void>;
910
943
  undo?(context?: CommandContext): void | Promise<void>;
944
+ /**
945
+ * Optional cleanup when command is pruned from history.
946
+ * Called when command is removed to free memory (e.g., Player references, deep-cloned configs).
947
+ */
948
+ dispose?(): void;
911
949
  readonly name: string;
912
950
  };
913
951
 
@@ -935,6 +973,8 @@ export declare const EditEvent: {
935
973
  readonly TrackRemoved: "track:removed";
936
974
  readonly DurationChanged: "duration:changed";
937
975
  readonly OutputResized: "output:resized";
976
+ readonly OutputResolutionChanged: "output:resolutionChanged";
977
+ readonly OutputAspectRatioChanged: "output:aspectRatioChanged";
938
978
  readonly OutputFpsChanged: "output:fpsChanged";
939
979
  readonly OutputFormatChanged: "output:formatChanged";
940
980
  readonly OutputDestinationsChanged: "output:destinationsChanged";
@@ -1002,6 +1042,12 @@ export declare type EditEventMap = {
1002
1042
  width: number;
1003
1043
  height: number;
1004
1044
  };
1045
+ [EditEvent.OutputResolutionChanged]: {
1046
+ resolution: string | undefined;
1047
+ };
1048
+ [EditEvent.OutputAspectRatioChanged]: {
1049
+ aspectRatio: string | undefined;
1050
+ };
1005
1051
  [EditEvent.OutputFpsChanged]: {
1006
1052
  fps: number;
1007
1053
  };
@@ -1346,6 +1392,14 @@ export { OffsetSchema }
1346
1392
 
1347
1393
  export declare type Output = components["schemas"]["Output"];
1348
1394
 
1395
+ export declare const OutputAspectRatioSchema: z.ZodOptional<z.ZodEnum<{
1396
+ "16:9": "16:9";
1397
+ "9:16": "9:16";
1398
+ "1:1": "1:1";
1399
+ "4:3": "4:3";
1400
+ "4:5": "4:5";
1401
+ }>>;
1402
+
1349
1403
  export declare const OutputFormatSchema: z.ZodEnum<{
1350
1404
  mp4: "mp4";
1351
1405
  gif: "gif";
@@ -1357,6 +1411,15 @@ export declare const OutputFormatSchema: z.ZodEnum<{
1357
1411
 
1358
1412
  export declare const OutputFpsSchema: z.ZodUnion<readonly [z.ZodLiteral<12>, z.ZodLiteral<15>, z.ZodLiteral<23.976>, z.ZodLiteral<24>, z.ZodLiteral<25>, z.ZodLiteral<29.97>, z.ZodLiteral<30>, z.ZodLiteral<48>, z.ZodLiteral<50>, z.ZodLiteral<59.94>, z.ZodLiteral<60>]>;
1359
1413
 
1414
+ export declare const OutputResolutionSchema: z.ZodOptional<z.ZodEnum<{
1415
+ preview: "preview";
1416
+ mobile: "mobile";
1417
+ sd: "sd";
1418
+ hd: "hd";
1419
+ 1080: "1080";
1420
+ "4k": "4k";
1421
+ }>>;
1422
+
1360
1423
  export { OutputSchema }
1361
1424
 
1362
1425
  export declare const OutputSizeSchema: z.ZodObject<{
@@ -1864,6 +1927,7 @@ export declare class Timeline extends TimelineEntity {
1864
1927
  private readonly handlePlaybackPause;
1865
1928
  private readonly handleClipSelected;
1866
1929
  private readonly handleClipLoadFailed;
1930
+ private readonly handleRulerMouseMove;
1867
1931
  constructor(edit: Edit, container: HTMLElement, options?: TimelineOptions);
1868
1932
  /** Initialize and mount the timeline */
1869
1933
  load(): Promise<void>;
@@ -2185,6 +2249,8 @@ export declare class UIController {
2185
2249
  readonly mergeFieldsEnabled: boolean;
2186
2250
  /** Whether selection handles are enabled for drag/resize/rotate */
2187
2251
  private readonly selectionHandlesEnabled;
2252
+ /** Maximum total pixels for resolution picker (undefined = unlimited) */
2253
+ private readonly maxPixels?;
2188
2254
  private clipToolbar;
2189
2255
  private toolbarMode;
2190
2256
  private currentAssetType;
@@ -2384,6 +2450,8 @@ export declare interface UIControllerOptions {
2384
2450
  selectionHandles?: boolean;
2385
2451
  /** Enable merge fields UI (Variables panel, autocomplete). Default: false (vanilla video editor) */
2386
2452
  mergeFields?: boolean;
2453
+ /** Maximum total pixels allowed for resolution picker input. Omit for unlimited. */
2454
+ maxPixels?: number;
2387
2455
  }
2388
2456
 
2389
2457
  /**