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.cjs +17 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +9 -1
- package/dist/index.js +17 -3
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/index.d.ts +9 -1
- package/src/timeline/Timeline.jsx +27 -10
- package/styles/timeline.css +6 -0
package/dist/index.cjs
CHANGED
|
@@ -4602,11 +4602,14 @@ function Clip({
|
|
|
4602
4602
|
const tileW = Math.round((LANE_H - CLIP_INSET * 2) * (16 / 9));
|
|
4603
4603
|
const startTrim = (e, edge) => {
|
|
4604
4604
|
if (!onTrim || !known) return;
|
|
4605
|
+
const room = clip.headroom || {};
|
|
4606
|
+
const outward = Math.max(0, Number(edge === "end" ? room.end : room.start) || 0);
|
|
4607
|
+
const maxDur = clip.duration + outward;
|
|
4605
4608
|
beginGesture(e, {
|
|
4606
4609
|
kind: "trim",
|
|
4607
4610
|
snapTimes,
|
|
4608
4611
|
preview: (t) => {
|
|
4609
|
-
const dur = edge === "end" ? clamp(t - t0, TL_MIN_CLIP_S,
|
|
4612
|
+
const dur = edge === "end" ? clamp(t - t0, TL_MIN_CLIP_S, maxDur) : clamp(t0 + clip.duration - t, TL_MIN_CLIP_S, maxDur);
|
|
4610
4613
|
const nextW = dur * pps;
|
|
4611
4614
|
const nextLeft = edge === "end" ? x : x + (w - nextW);
|
|
4612
4615
|
return {
|
|
@@ -4618,7 +4621,7 @@ function Clip({
|
|
|
4618
4621
|
};
|
|
4619
4622
|
},
|
|
4620
4623
|
commit: (t) => {
|
|
4621
|
-
const dur = edge === "end" ? clamp(t - t0, TL_MIN_CLIP_S,
|
|
4624
|
+
const dur = edge === "end" ? clamp(t - t0, TL_MIN_CLIP_S, maxDur) : clamp(t0 + clip.duration - t, TL_MIN_CLIP_S, maxDur);
|
|
4622
4625
|
if (Math.abs(dur - clip.duration) > 1e-3) onTrim(clip, edge, dur, track);
|
|
4623
4626
|
}
|
|
4624
4627
|
});
|
|
@@ -4670,7 +4673,18 @@ function Clip({
|
|
|
4670
4673
|
clip.poster ? /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("span", { className: "rui-tl-strip", style: {
|
|
4671
4674
|
backgroundImage: `url("${String(clip.poster).replace(/"/g, '\\"')}")`,
|
|
4672
4675
|
backgroundSize: `${tileW}px 100%`
|
|
4673
|
-
} }) : /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
4676
|
+
} }) : clip.video ? /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
4677
|
+
"video",
|
|
4678
|
+
{
|
|
4679
|
+
className: "rui-tl-frame",
|
|
4680
|
+
src: clip.video,
|
|
4681
|
+
preload: "metadata",
|
|
4682
|
+
muted: true,
|
|
4683
|
+
playsInline: true,
|
|
4684
|
+
tabIndex: -1,
|
|
4685
|
+
"aria-hidden": "true"
|
|
4686
|
+
}
|
|
4687
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("span", { className: "rui-tl-blank", "aria-hidden": "true", children: clip.glyph }),
|
|
4674
4688
|
clip.badge && /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("span", { className: "rui-tl-badge", children: clip.badge }),
|
|
4675
4689
|
known && width > 46 && /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("span", { className: "rui-tl-dur", children: durationLabel(clip.duration) }),
|
|
4676
4690
|
clip.label && width > 104 && /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("span", { className: "rui-tl-name", children: clip.label }),
|