@vosjs/studio-core 0.19.0 → 0.19.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.js CHANGED
@@ -7249,7 +7249,7 @@ function copyLayout(from, to, opts = {}) {
7249
7249
  return { doc, notes };
7250
7250
  }
7251
7251
  function trailingFreeze(doc) {
7252
- const last = doc.segments.at(-1);
7252
+ const last = doc.segments?.at(-1);
7253
7253
  if (!last) return null;
7254
7254
  return docFreezes(doc).find((f) => Math.abs(f.at - last.out) < 1e-9) ?? null;
7255
7255
  }
@@ -7343,16 +7343,16 @@ function applyTemplate(template, take, opts) {
7343
7343
  }
7344
7344
  if (objects.length || doc.objects) doc.objects = objects;
7345
7345
  const audio = doc.audio.filter(
7346
- (a) => !template.audio.some((t) => t.id === a.id)
7346
+ (a) => !(template.audio ?? []).some((t) => t.id === a.id)
7347
7347
  );
7348
- for (const clip of template.audio) {
7348
+ for (const clip of template.audio ?? []) {
7349
7349
  const next = structuredClone(clip);
7350
7350
  next.start = Math.max(0, round34(clip.start + shift));
7351
7351
  next.from = from;
7352
7352
  audio.push(next);
7353
7353
  }
7354
7354
  doc.audio = audio;
7355
- if (template.frame.anim) {
7355
+ if (template.frame?.anim) {
7356
7356
  doc.frame = {
7357
7357
  ...doc.frame,
7358
7358
  anim: { ...doc.frame.anim ?? {}, ...template.frame.anim }