@shotstack/shotstack-studio 2.31.0 → 2.31.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.
package/dist/index.d.ts CHANGED
@@ -150,8 +150,10 @@ export declare class Controls {
150
150
  private seekDistanceLarge;
151
151
  private frameTime;
152
152
  private pendingPaste;
153
+ private disposed;
153
154
  constructor(edit: Edit);
154
155
  load(): Promise<void>;
156
+ dispose(): void;
155
157
  private shouldIgnoreKeyboardEvent;
156
158
  private handleKeyDown;
157
159
  private handlePaste;
@@ -42118,10 +42118,10 @@ class Js extends nr {
42118
42118
  super.dispose(), this.loadComplete = !1, this.texture && this.texture.destroy(), this.texture = null, this.sprite && (this.sprite.destroy(), this.sprite = null), this.cleanupResources();
42119
42119
  }
42120
42120
  getSize() {
42121
- const e = this.edit.getEdit();
42121
+ const e = this.edit.getDocument()?.getOutput().size;
42122
42122
  return {
42123
- width: this.clipConfiguration.width || e?.output?.size?.width || this.edit.size.width,
42124
- height: this.clipConfiguration.height || e?.output?.size?.height || this.edit.size.height
42123
+ width: this.clipConfiguration.width || e?.width || this.edit.size.width,
42124
+ height: this.clipConfiguration.height || e?.height || this.edit.size.height
42125
42125
  };
42126
42126
  }
42127
42127
  getContentSize() {
@@ -42289,14 +42289,14 @@ class Vr extends nr {
42289
42289
  const { baseFontFamily: n } = Fr(e), i = this.edit.getFontUrlByFamilyAndWeight(n, r);
42290
42290
  if (i)
42291
42291
  return { url: i, baseFontFamily: n, fontWeight: r };
42292
- const o = (this.edit.getEdit()?.timeline?.fonts || []).find((l) => {
42293
- const { full: c, base: h } = Pl(l.src), d = e.toLowerCase();
42294
- return c.toLowerCase() === d || h.toLowerCase() === d;
42292
+ const s = this.edit.getTimelineFonts().find((u) => {
42293
+ const { full: l, base: c } = Pl(u.src), h = e.toLowerCase();
42294
+ return l.toLowerCase() === h || c.toLowerCase() === h;
42295
42295
  });
42296
- if (o)
42297
- return { url: o.src, baseFontFamily: n, fontWeight: r };
42298
- const u = as(e, r);
42299
- return u ? { url: u, baseFontFamily: n, fontWeight: r } : null;
42296
+ if (s)
42297
+ return { url: s.src, baseFontFamily: n, fontWeight: r };
42298
+ const o = as(e, r);
42299
+ return o ? { url: o, baseFontFamily: n, fontWeight: r } : null;
42300
42300
  }
42301
42301
  reconfigureAfterRestore() {
42302
42302
  super.reconfigureAfterRestore(), this.reconfigure(this.clipConfiguration.asset);
@@ -42359,35 +42359,35 @@ class Vr extends nr {
42359
42359
  }
42360
42360
  }
42361
42361
  createFallbackText(e) {
42362
- const r = this.edit.getEdit(), n = this.clipConfiguration.width || r?.output?.size?.width || this.edit.size.width, i = this.clipConfiguration.height || r?.output?.size?.height || this.edit.size.height, a = new et.TextStyle({
42362
+ const { width: r, height: n } = this.getSize(), i = new et.TextStyle({
42363
42363
  fontFamily: e.font?.family || "Arial",
42364
42364
  fontSize: e.font?.size || 48,
42365
42365
  fill: e.font?.color || "#ffffff",
42366
42366
  align: e.align?.horizontal || "center",
42367
42367
  wordWrap: !0,
42368
- wordWrapWidth: n
42369
- }), s = new et.Text(e.text, a);
42368
+ wordWrapWidth: r
42369
+ }), a = new et.Text(e.text, i);
42370
42370
  switch (e.align?.horizontal) {
42371
42371
  case "left":
42372
- s.anchor.set(0, 0.5), s.x = 0;
42372
+ a.anchor.set(0, 0.5), a.x = 0;
42373
42373
  break;
42374
42374
  case "right":
42375
- s.anchor.set(1, 0.5), s.x = n;
42375
+ a.anchor.set(1, 0.5), a.x = r;
42376
42376
  break;
42377
42377
  default:
42378
- s.anchor.set(0.5, 0.5), s.x = n / 2;
42378
+ a.anchor.set(0.5, 0.5), a.x = r / 2;
42379
42379
  }
42380
42380
  switch (e.align?.vertical) {
42381
42381
  case "top":
42382
- s.anchor.set(s.anchor.x, 0), s.y = 0;
42382
+ a.anchor.set(a.anchor.x, 0), a.y = 0;
42383
42383
  break;
42384
42384
  case "bottom":
42385
- s.anchor.set(s.anchor.x, 1), s.y = i;
42385
+ a.anchor.set(a.anchor.x, 1), a.y = n;
42386
42386
  break;
42387
42387
  default:
42388
- s.anchor.set(s.anchor.x, 0.5), s.y = i / 2;
42388
+ a.anchor.set(a.anchor.x, 0.5), a.y = n / 2;
42389
42389
  }
42390
- this.contentContainer.addChild(s), this.configureKeyframes();
42390
+ this.contentContainer.addChild(a), this.configureKeyframes();
42391
42391
  }
42392
42392
  renderFrameSafe(e) {
42393
42393
  if (this.isRendering) {
@@ -42428,10 +42428,10 @@ class Vr extends nr {
42428
42428
  super.dispose(), this.loadComplete = !1, this.texture?.destroy(), this.texture = null, this.sprite && (this.sprite.destroy(), this.sprite = null), this.canvas && (this.canvas = null), this.textEngine && (this.textEngine.destroy(), this.textEngine = null), this.renderer = null, this.validatedAsset = null;
42429
42429
  }
42430
42430
  getSize() {
42431
- const e = this.edit.getEdit();
42431
+ const e = this.edit.getDocument()?.getOutput().size;
42432
42432
  return {
42433
- width: this.clipConfiguration.width || e?.output?.size?.width || this.edit.size.width,
42434
- height: this.clipConfiguration.height || e?.output?.size?.height || this.edit.size.height
42433
+ width: this.clipConfiguration.width || e?.width || this.edit.size.width,
42434
+ height: this.clipConfiguration.height || e?.height || this.edit.size.height
42435
42435
  };
42436
42436
  }
42437
42437
  getContentSize() {