reifyui 0.10.1 → 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
@@ -691,6 +691,10 @@ export interface TimelineClip {
691
691
  badge?: ReactNode;
692
692
  /** 'failed' tints the block; any other value is yours to style as `.rui-tl-clip.is-<state>`. */
693
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 };
694
698
  /** Border colour for this clip, as a CSS colour. */
695
699
  accent?: string;
696
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
  });