@shotstack/shotstack-studio 2.19.3 → 2.19.4

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.
@@ -11,7 +11,7 @@ import "pixi.js/text-html";
11
11
  import "pixi.js/sprite-tiling";
12
12
  import "pixi.js/filters";
13
13
  import "pixi.js/mesh";
14
- const GI = "2.19.2", qI = {
14
+ const GI = "2.19.3", qI = {
15
15
  version: GI
16
16
  };
17
17
  function av(e, t, i) {
@@ -46450,12 +46450,16 @@ class Ko {
46450
46450
  console.warn(`commitClipUpdate: clip ${t} not found in document`);
46451
46451
  return;
46452
46452
  }
46453
- Wd.parse(r);
46454
- const s = new kd(i, structuredClone(r), {
46453
+ const s = Wd.safeParse(r);
46454
+ if (!s.success) {
46455
+ console.warn(`commitClipUpdate: skipping invalid clip ${t}`, s.error);
46456
+ return;
46457
+ }
46458
+ const a = new kd(i, structuredClone(r), {
46455
46459
  trackIndex: n.trackIndex,
46456
46460
  clipIndex: n.clipIndex
46457
46461
  });
46458
- this.addCommandToHistory(s);
46462
+ this.addCommandToHistory(a);
46459
46463
  }
46460
46464
  /**
46461
46465
  * Manage command history: dispose redo stack, add command, prune old entries.
@@ -47635,7 +47639,7 @@ class Bn {
47635
47639
  * @internal
47636
47640
  */
47637
47641
  getContentBounds() {
47638
- const t = this.edit.size.width * this.currentZoom, i = this.edit.size.height * this.currentZoom, r = this.viewportContainer?.position.x ?? 0, n = this.viewportContainer?.position.y ?? 0;
47642
+ const t = this.edit.size.width * this.currentZoom, i = this.edit.size.height * this.currentZoom, r = this.viewportContainer?.position?.x ?? 0, n = this.viewportContainer?.position?.y ?? 0;
47639
47643
  return {
47640
47644
  left: r,
47641
47645
  right: r + t,
@@ -67155,8 +67159,8 @@ class Irt extends wa {
67155
67159
  const t = this.edit.getResolvedClip(this.selectedTrackIdx, this.selectedClipIdx);
67156
67160
  if (!t) return;
67157
67161
  const i = dv(t.asset), r = `asset.${i}`, n = this.promptInput?.value ?? "", s = n.trim() === "", a = this.edit.resolveMergeFields(n), o = this.edit.getDocument(), l = this.getSelectedClipId();
67158
- l && o && (!s && Hd.test(n) ? o.setClipBinding(l, r, { placeholder: n, resolvedValue: a }) : o.removeClipBinding(l, r)), this.edit.updateClip(this.selectedTrackIdx, this.selectedClipIdx, {
67159
- asset: { ...t.asset, [i]: s ? void 0 : a }
67162
+ l && o && (!s && Hd.test(n) ? o.setClipBinding(l, r, { placeholder: n, resolvedValue: a }) : o.removeClipBinding(l, r)), !s && this.edit.updateClip(this.selectedTrackIdx, this.selectedClipIdx, {
67163
+ asset: { ...t.asset, [i]: a }
67160
67164
  });
67161
67165
  }
67162
67166
  selectModel(t) {
@@ -71530,9 +71534,18 @@ class Xa extends wa {
71530
71534
  }, r = this.verticalAlignIcon.querySelector("path");
71531
71535
  r && r.setAttribute("d", i[t]);
71532
71536
  }
71537
+ assetSupportsStyle(t) {
71538
+ return t?.type === "rich-text" || t?.type === "rich-caption";
71539
+ }
71533
71540
  cycleTransform(t) {
71541
+ if (!this.assetSupportsStyle(t)) return;
71534
71542
  const i = t.style?.textTransform ?? "none", r = ["none", "uppercase", "lowercase"], s = (r.indexOf(i) + 1) % r.length;
71535
- this.updateClipProperty({ style: { textTransform: r[s] } });
71543
+ this.updateClipProperty({
71544
+ style: {
71545
+ ...t.style ?? {},
71546
+ textTransform: r[s]
71547
+ }
71548
+ });
71536
71549
  }
71537
71550
  toggleUnderline(t) {
71538
71551
  const r = (t.style?.textDecoration ?? "none") === "underline" ? "none" : "underline";
@@ -71622,6 +71635,8 @@ class Xa extends wa {
71622
71635
  });
71623
71636
  }
71624
71637
  updateClipProperty(t) {
71638
+ if ("style" in t && !this.assetSupportsStyle(this.getCurrentAsset()))
71639
+ return;
71625
71640
  const i = { asset: t };
71626
71641
  this.edit.updateClip(this.selectedTrackIdx, this.selectedClipIdx, i), this.syncState();
71627
71642
  }