@shotstack/shotstack-studio 2.13.1 → 2.13.2

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,7 +196,8 @@ export declare class Edit {
196
196
  }): Edit_2;
197
197
  /**
198
198
  * Look up a clip by its stable ID.
199
- * @returns The clip or null if no clip with that ID exists.
199
+ * @returns A copy of the clip, or null if no clip with that ID exists. Mutating the
200
+ * returned object has no effect on the edit — use `updateClipById` to make changes.
200
201
  */
201
202
  getClipById(clipId: string): Clip | null;
202
203
  /**
@@ -85,7 +85,8 @@ export declare class Edit {
85
85
  }): Edit_2;
86
86
  /**
87
87
  * Look up a clip by its stable ID.
88
- * @returns The clip or null if no clip with that ID exists.
88
+ * @returns A copy of the clip, or null if no clip with that ID exists. Mutating the
89
+ * returned object has no effect on the edit — use `updateClipById` to make changes.
89
90
  */
90
91
  getClipById(clipId: string): Clip | null;
91
92
  /**
@@ -42433,10 +42433,12 @@ class Da {
42433
42433
  // ─── ID-Based Clip Mutations (public passthroughs) ─────────────────────────
42434
42434
  /**
42435
42435
  * Look up a clip by its stable ID.
42436
- * @returns The clip or null if no clip with that ID exists.
42436
+ * @returns A copy of the clip, or null if no clip with that ID exists. Mutating the
42437
+ * returned object has no effect on the edit — use `updateClipById` to make changes.
42437
42438
  */
42438
42439
  getClipById(e) {
42439
- return this.document.getClipById(e)?.clip ?? null;
42440
+ const r = this.document.getClipById(e)?.clip;
42441
+ return r ? structuredClone(r) : null;
42440
42442
  }
42441
42443
  /**
42442
42444
  * Look up the (trackIndex, clipIndex) position of a clip by its stable ID.
@@ -42639,7 +42641,7 @@ class Da {
42639
42641
  }
42640
42642
  getClip(e, r) {
42641
42643
  const n = this.tracks[e];
42642
- return !n || r < 0 || r >= n.length ? null : n[r].clipConfiguration;
42644
+ return !n || r < 0 || r >= n.length ? null : structuredClone(n[r].clipConfiguration);
42643
42645
  }
42644
42646
  /**
42645
42647
  * Get the error state for a clip that failed to load.
@@ -42849,7 +42851,8 @@ class Da {
42849
42851
  getTrack(e) {
42850
42852
  const r = this.clips.filter((n) => n.layer === e + 1);
42851
42853
  return r.length === 0 ? null : {
42852
- clips: r.map((n) => n.clipConfiguration)
42854
+ // Copy so callers can't mutate (or freeze) live player state through the return value
42855
+ clips: r.map((n) => structuredClone(n.clipConfiguration))
42853
42856
  };
42854
42857
  }
42855
42858
  /**