reifyui 0.10.0 → 0.10.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
@@ -679,14 +679,22 @@ export interface TimelineClip {
679
679
  label?: string;
680
680
  /** Tooltip. Falls back to `label`. */
681
681
  title?: string;
682
- /** Artwork filling the block — a poster frame, a waveform. */
682
+ /** Artwork filling the block, tiled at a fixed tile size — a poster frame, a waveform. */
683
683
  poster?: string;
684
+ /** A playable file. Used only when there is no `poster`: its FIRST FRAME is shown, which is a
685
+ * real frame of the real clip rather than a stand-in. Loaded with preload="metadata", so the
686
+ * whole file is not fetched to paint one frame. */
687
+ video?: string;
684
688
  /** Shown centred when there is no poster. */
685
689
  glyph?: ReactNode;
686
690
  /** Small pill at the top left, e.g. an index. */
687
691
  badge?: ReactNode;
688
692
  /** 'failed' tints the block; any other value is yours to style as `.rui-tl-clip.is-<state>`. */
689
693
  state?: string;
694
+ /** Seconds still available BEYOND the current window on each side — how far a trim may pull the
695
+ * edge back OUT. Without it an edge can only come in, and one stray drag makes a clip
696
+ * unrecoverable even though the film is still in the file. */
697
+ headroom?: { start?: number; end?: number };
690
698
  /** Border colour for this clip, as a CSS colour. */
691
699
  accent?: string;
692
700
  }
package/dist/index.js CHANGED
@@ -4363,11 +4363,14 @@ function Clip({
4363
4363
  const tileW = Math.round((LANE_H - CLIP_INSET * 2) * (16 / 9));
4364
4364
  const startTrim = (e, edge) => {
4365
4365
  if (!onTrim || !known) return;
4366
+ const room = clip.headroom || {};
4367
+ const outward = Math.max(0, Number(edge === "end" ? room.end : room.start) || 0);
4368
+ const maxDur = clip.duration + outward;
4366
4369
  beginGesture(e, {
4367
4370
  kind: "trim",
4368
4371
  snapTimes,
4369
4372
  preview: (t) => {
4370
- const dur = edge === "end" ? clamp(t - t0, TL_MIN_CLIP_S, clip.duration) : clamp(t0 + clip.duration - t, TL_MIN_CLIP_S, clip.duration);
4373
+ const dur = edge === "end" ? clamp(t - t0, TL_MIN_CLIP_S, maxDur) : clamp(t0 + clip.duration - t, TL_MIN_CLIP_S, maxDur);
4371
4374
  const nextW = dur * pps;
4372
4375
  const nextLeft = edge === "end" ? x : x + (w - nextW);
4373
4376
  return {
@@ -4379,7 +4382,7 @@ function Clip({
4379
4382
  };
4380
4383
  },
4381
4384
  commit: (t) => {
4382
- const dur = edge === "end" ? clamp(t - t0, TL_MIN_CLIP_S, clip.duration) : clamp(t0 + clip.duration - t, TL_MIN_CLIP_S, clip.duration);
4385
+ const dur = edge === "end" ? clamp(t - t0, TL_MIN_CLIP_S, maxDur) : clamp(t0 + clip.duration - t, TL_MIN_CLIP_S, maxDur);
4383
4386
  if (Math.abs(dur - clip.duration) > 1e-3) onTrim(clip, edge, dur, track);
4384
4387
  }
4385
4388
  });
@@ -4431,7 +4434,18 @@ function Clip({
4431
4434
  clip.poster ? /* @__PURE__ */ jsx25("span", { className: "rui-tl-strip", style: {
4432
4435
  backgroundImage: `url("${String(clip.poster).replace(/"/g, '\\"')}")`,
4433
4436
  backgroundSize: `${tileW}px 100%`
4434
- } }) : /* @__PURE__ */ jsx25("span", { className: "rui-tl-blank", "aria-hidden": "true", children: clip.glyph }),
4437
+ } }) : clip.video ? /* @__PURE__ */ jsx25(
4438
+ "video",
4439
+ {
4440
+ className: "rui-tl-frame",
4441
+ src: clip.video,
4442
+ preload: "metadata",
4443
+ muted: true,
4444
+ playsInline: true,
4445
+ tabIndex: -1,
4446
+ "aria-hidden": "true"
4447
+ }
4448
+ ) : /* @__PURE__ */ jsx25("span", { className: "rui-tl-blank", "aria-hidden": "true", children: clip.glyph }),
4435
4449
  clip.badge && /* @__PURE__ */ jsx25("span", { className: "rui-tl-badge", children: clip.badge }),
4436
4450
  known && width > 46 && /* @__PURE__ */ jsx25("span", { className: "rui-tl-dur", children: durationLabel(clip.duration) }),
4437
4451
  clip.label && width > 104 && /* @__PURE__ */ jsx25("span", { className: "rui-tl-name", children: clip.label }),