fablecut 1.14.0 → 1.16.0

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/comp.js CHANGED
@@ -76,11 +76,15 @@
76
76
  if (parentId === childId) return true;
77
77
  return usedComps(doc, childId).has(parentId);
78
78
  }
79
- /** Where comp `id` is used: [{in: compId | null (main), clip}] */
79
+ /** Where comp `id` is used: [{in: compId | null (a timeline), clip, sequence?}] — the open
80
+ * timeline, other comps, and the sequences that aren't open (see sequences.js). */
80
81
  function usages(doc, id) {
81
82
  const out = [];
82
83
  for (const c of doc.clips || []) if (c.kind === "comp" && c.compId === id) out.push({ in: null, clip: c });
83
84
  for (const comp of doc.comps || []) for (const c of comp.clips || []) if (c.kind === "comp" && c.compId === id) out.push({ in: comp.id, clip: c });
85
+ const seqs = Array.isArray(doc.sequences) ? doc.sequences : [];
86
+ const act = seqs.some((s) => s.id === doc.sequence) ? doc.sequence : seqs[0] && seqs[0].id;
87
+ for (const s of seqs) if (s && s.id !== act) for (const c of s.clips || []) if (c.kind === "comp" && c.compId === id) out.push({ in: null, sequence: s.id, clip: c });
84
88
  return out;
85
89
  }
86
90