@linker-design-plus/timeline-track 2.0.0 → 2.0.1
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.es.js
CHANGED
|
@@ -10215,39 +10215,32 @@ class Po {
|
|
|
10215
10215
|
}
|
|
10216
10216
|
renderPresetGrid(t) {
|
|
10217
10217
|
const e = document.createElement("div");
|
|
10218
|
-
e.className = st.presetGrid, e.style.display = "grid", e.style.gridTemplateColumns = "repeat(3, 1fr)", e.style.gap = "4px",
|
|
10219
|
-
|
|
10220
|
-
|
|
10221
|
-
|
|
10222
|
-
|
|
10223
|
-
|
|
10224
|
-
|
|
10225
|
-
|
|
10226
|
-
|
|
10227
|
-
|
|
10228
|
-
|
|
10229
|
-
{ label: "↓ 下中", x: 0.5, y: 1 - s },
|
|
10230
|
-
{ label: "↘ 右下", x: 1 - s, y: 1 - s }
|
|
10231
|
-
];
|
|
10232
|
-
})().forEach((n) => {
|
|
10218
|
+
e.className = st.presetGrid, e.style.display = "grid", e.style.gridTemplateColumns = "repeat(3, 1fr)", e.style.gap = "4px", [
|
|
10219
|
+
{ label: "↖ 左上", x: "left", y: "top" },
|
|
10220
|
+
{ label: "↑ 上中", x: "center", y: "top" },
|
|
10221
|
+
{ label: "↗ 右上", x: "right", y: "top" },
|
|
10222
|
+
{ label: "← 左中", x: "left", y: "center" },
|
|
10223
|
+
{ label: "● 居中", x: "center", y: "center" },
|
|
10224
|
+
{ label: "右中 →", x: "right", y: "center" },
|
|
10225
|
+
{ label: "↙ 左下", x: "left", y: "bottom" },
|
|
10226
|
+
{ label: "↓ 下中", x: "center", y: "bottom" },
|
|
10227
|
+
{ label: "↘ 右下", x: "right", y: "bottom" }
|
|
10228
|
+
].forEach((n) => {
|
|
10233
10229
|
const s = document.createElement("button");
|
|
10234
10230
|
s.className = st.presetButton, s.textContent = n.label, s.style.padding = "6px", s.style.border = `1px solid ${this.theme.buttonBorder}`, s.style.borderRadius = "4px", s.style.background = this.theme.buttonBackground, s.style.fontSize = "11px", s.style.cursor = "pointer", s.style.color = this.theme.textColor, s.addEventListener("click", () => {
|
|
10235
|
-
|
|
10236
|
-
|
|
10237
|
-
|
|
10238
|
-
|
|
10239
|
-
|
|
10240
|
-
"← 左中": { x: o, y: 0.5 },
|
|
10241
|
-
"● 居中": { x: 0.5, y: 0.5 },
|
|
10242
|
-
"右中 →": { x: 1 - o, y: 0.5 },
|
|
10243
|
-
"↙ 左下": { x: o, y: 1 - o },
|
|
10244
|
-
"↓ 下中": { x: 0.5, y: 1 - o },
|
|
10245
|
-
"↘ 右下": { x: 1 - o, y: 1 - o }
|
|
10246
|
-
}[n.label];
|
|
10247
|
-
h && this.handleTransformChanges({ x: h.x, y: h.y });
|
|
10231
|
+
const { x: a, y: o } = this.calculatePresetPosition(
|
|
10232
|
+
n.x,
|
|
10233
|
+
n.y
|
|
10234
|
+
);
|
|
10235
|
+
this.handleTransformChanges({ x: a, y: o });
|
|
10248
10236
|
}), e.appendChild(s);
|
|
10249
10237
|
}), t.appendChild(e);
|
|
10250
10238
|
}
|
|
10239
|
+
calculatePresetPosition(t, e) {
|
|
10240
|
+
var o, l;
|
|
10241
|
+
const n = (((l = (o = this.currentClip) == null ? void 0 : o.visualTransform) == null ? void 0 : l.scale) ?? 1) / 2, s = { left: n, center: 0.5, right: 1 - n }, a = { top: n, center: 0.5, bottom: 1 - n };
|
|
10242
|
+
return { x: s[t], y: a[e] };
|
|
10243
|
+
}
|
|
10251
10244
|
renderScaleControl(t) {
|
|
10252
10245
|
var a, o, l, h;
|
|
10253
10246
|
const e = document.createElement("div");
|
|
@@ -10273,7 +10266,10 @@ class Po {
|
|
|
10273
10266
|
updateUIControls() {
|
|
10274
10267
|
var s;
|
|
10275
10268
|
const t = ((s = this.currentClip) == null ? void 0 : s.visualTransform) ?? { x: 0.5, y: 0.5, scale: 1 }, e = t.scale / 2, i = -e, n = 1 + e;
|
|
10276
|
-
this.
|
|
10269
|
+
this.updateSliderAndInput(this.xSlider, this.xInput, t.x, i, n), this.updateSliderAndInput(this.ySlider, this.yInput, t.y, i, n), this.scaleSlider && (this.scaleSlider.value = String(t.scale)), this.scaleInput && (this.scaleInput.value = String(t.scale));
|
|
10270
|
+
}
|
|
10271
|
+
updateSliderAndInput(t, e, i, n, s) {
|
|
10272
|
+
t && (t.value = String(i), t.min = String(n), t.max = String(s)), e && (e.value = String(i), e.min = String(n), e.max = String(s));
|
|
10277
10273
|
}
|
|
10278
10274
|
handleTransformChange(t, e) {
|
|
10279
10275
|
if (!this.currentClip || !this.onClipUpdate) return;
|
|
@@ -11396,7 +11392,7 @@ class Uo {
|
|
|
11396
11392
|
}
|
|
11397
11393
|
this.detach(), this.container = t;
|
|
11398
11394
|
const e = document.createElement("div");
|
|
11399
|
-
e.className = this.dependencies.rootClassName ?? "timeline-preview-root", e.style.position = "relative", e.style.width = "100%", e.style.height = "100%", e.style.overflow = "hidden"
|
|
11395
|
+
e.className = this.dependencies.rootClassName ?? "timeline-preview-root", e.style.position = "relative", e.style.width = "100%", e.style.height = "100%", e.style.overflow = "hidden";
|
|
11400
11396
|
const i = document.createElement("div");
|
|
11401
11397
|
i.className = this.dependencies.frameClassName ?? "timeline-preview-frame", i.style.position = "absolute", i.style.left = "0", i.style.top = "0", i.style.overflow = "hidden", i.style.background = "#000000", e.appendChild(i);
|
|
11402
11398
|
const n = document.createElement("div");
|
|
@@ -11544,7 +11540,13 @@ class Uo {
|
|
|
11544
11540
|
syncCurrentSlot(t, e, i, n) {
|
|
11545
11541
|
t.isActive = !0, t.entry = e, t.element.playbackRate = i;
|
|
11546
11542
|
const s = e.mediaTime / 1e3, a = Math.max(0.1, i * 0.15);
|
|
11547
|
-
Math.abs(t.element.currentTime - s) > a
|
|
11543
|
+
if (Math.abs(t.element.currentTime - s) > a)
|
|
11544
|
+
t.isSeeking = !0, t.isBuffering = !0, vn(t.element, s);
|
|
11545
|
+
else {
|
|
11546
|
+
const l = t.element.readyState >= HTMLMediaElement.HAVE_FUTURE_DATA;
|
|
11547
|
+
t.isBuffering = !l;
|
|
11548
|
+
}
|
|
11549
|
+
this.refreshBufferingState(), n === "playing" ? (this.resumeAudioContext(), Xo(t.element)) : jt(t.element), this.setSlotVisible(t, e.hasVisual, 1e3 - e.trackOrder);
|
|
11548
11550
|
}
|
|
11549
11551
|
preparePreloadSlot(t, e) {
|
|
11550
11552
|
if (t.isActive = !1, t.isBuffering = !1, t.isSeeking = !1, !e) {
|
|
@@ -12871,7 +12873,6 @@ class Tl {
|
|
|
12871
12873
|
const t = this.config.getSelectedClip();
|
|
12872
12874
|
this.panel.setClip(t);
|
|
12873
12875
|
}
|
|
12874
|
-
// 外部更新时调用(如预览组件更新 visualTransform)
|
|
12875
12876
|
updateFromExternal() {
|
|
12876
12877
|
this.isInternalUpdate || this.update();
|
|
12877
12878
|
}
|
package/package.json
CHANGED