@pixerate/editor-react 0.61.0 → 0.63.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.
@@ -201,6 +201,7 @@ import {
201
201
  planVideoClipDrag,
202
202
  videoDragLabel,
203
203
  videoAssetMap,
204
+ videoSequenceMap,
204
205
  videoClipLabel,
205
206
  videoClipShowsWaveform,
206
207
  videoClipWaveformPath,
@@ -264,6 +265,7 @@ function VideoTimeline({ controller, pxPerSecond, onPxPerSecondChange, editable
264
265
  const rows = useRef4(/* @__PURE__ */ new Map());
265
266
  const ruler = useRef4(null);
266
267
  const assets = videoAssetMap(project);
268
+ const sequences = videoSequenceMap(project);
267
269
  const msToPx = (ms) => ms * px / 1e3;
268
270
  const span = Math.max(duration + 5e3, 1e4);
269
271
  const width = msToPx(span);
@@ -473,7 +475,7 @@ function VideoTimeline({ controller, pxPerSecond, onPxPerSecondChange, editable
473
475
  children: clips.map(({ clip, home, start, duration: length, dragging }) => {
474
476
  const asset = clip.type === "media" ? assets.get(clip.asset) : void 0;
475
477
  const selected = selection.includes(clip.id);
476
- const label = videoClipLabel(clip, asset);
478
+ const label = videoClipLabel(clip, asset, clip.type === "sequence" ? sequences.get(clip.sequence) : void 0);
477
479
  return /* @__PURE__ */ jsxs3(
478
480
  "div",
479
481
  {
@@ -488,6 +490,7 @@ function VideoTimeline({ controller, pxPerSecond, onPxPerSecondChange, editable
488
490
  },
489
491
  title: `${label} \xB7 ${formatVideoSeconds(start)}\u2013${formatVideoSeconds(start + length)}`,
490
492
  "data-clip": clip.id,
493
+ "data-compound": clip.type === "sequence" ? clip.sequence : void 0,
491
494
  "data-selected": selected ? "" : void 0,
492
495
  "data-dragging": dragging ? "" : void 0,
493
496
  "aria-selected": selected,
@@ -664,7 +667,7 @@ function ClipInspector({ controller, className = "" }) {
664
667
  const transition = clip.transition;
665
668
  return /* @__PURE__ */ jsxs4("div", { className: `flex flex-col gap-1.5 ${className}`, "data-clip-inspector": "", "data-clip-id": clip.id, children: [
666
669
  /* @__PURE__ */ jsxs4("div", { className: "flex items-center gap-2 text-xs", children: [
667
- /* @__PURE__ */ jsx5("span", { className: "font-medium", children: clip.type === "media" ? "Media clip" : clip.type === "text" ? "Title" : "Colour clip" }),
670
+ /* @__PURE__ */ jsx5("span", { className: "font-medium", children: clip.type === "media" ? "Media clip" : clip.type === "text" ? "Title" : clip.type === "sequence" ? "Compound clip" : "Colour clip" }),
668
671
  /* @__PURE__ */ jsx5("code", { className: "text-muted-foreground", children: clip.id }),
669
672
  at.track.locked && /* @__PURE__ */ jsx5("span", { className: "text-amber-500", children: "locked track" })
670
673
  ] }),
@@ -812,6 +815,14 @@ function ClipInspector({ controller, className = "" }) {
812
815
  /* @__PURE__ */ jsx5(Row, { label: "Font size", name: "fontSize", children: number("fontSize", "Font size", { min: 1, step: 2 }) }),
813
816
  /* @__PURE__ */ jsx5(Row, { label: "Background", name: "background", children: text("background", "Background") })
814
817
  ] }),
818
+ clip.type === "sequence" && /* @__PURE__ */ jsxs4(Fragment3, { children: [
819
+ /* @__PURE__ */ jsx5(Row, { label: "Sequence", name: "sequence", children: /* @__PURE__ */ jsxs4("span", { className: "truncate", title: "A compound clip plays its sequence as one picture and sound; its clips cannot be edited here yet", children: [
820
+ project.sequences?.find((q) => q.id === clip.sequence)?.name ?? clip.sequence,
821
+ " \xB7 from ",
822
+ formatVideoSeconds2(clip.in ?? 0)
823
+ ] }) }),
824
+ /* @__PURE__ */ jsx5(Row, { label: "Muted", name: "muted", children: /* @__PURE__ */ jsx5("input", { type: "checkbox", className: "justify-self-start", checked: !!clip.muted, disabled, "aria-label": "Muted", onChange: (e) => set("muted", e.target.checked || void 0, e.target.checked ? "Mute clip" : "Unmute clip") }) })
825
+ ] }),
815
826
  clip.type === "color" && /* @__PURE__ */ jsx5(Row, { label: "Colour", name: "color", children: /* @__PURE__ */ jsx5(Commit, { value: clip.color, "aria-label": "Colour", disabled, onCommit: (raw) => raw.trim() && set("color", raw.trim(), "Change colour") }) }),
816
827
  /* @__PURE__ */ jsx5(Row, { label: "Transition in", name: "transition", children: /* @__PURE__ */ jsxs4(
817
828
  "select",