@video-editor/ui 0.0.1-beta.20 → 0.0.1-beta.22
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/VideoEditorTimeline.d.ts +12 -0
- package/dist/VideoEditorTimeline.js +2 -2
- package/dist/VideoTimeline.d.ts +12 -0
- package/dist/VideoTimeline.js +1 -1
- package/dist/index-C0eQjJkj.js +915 -0
- package/dist/{index-CGpG5Nmn.js → index-CzWd59zK.js} +113 -108
- package/dist/index.d.ts +24 -0
- package/dist/index.js +3 -3
- package/dist/ui.css +1 -1
- package/package.json +3 -3
- package/dist/index--01NyScE.js +0 -814
|
@@ -1,53 +1,53 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { generateThumbnails as
|
|
3
|
-
import { isVideoFramesSegment as
|
|
4
|
-
import { _ as
|
|
5
|
-
const
|
|
1
|
+
import { defineComponent as _, reactive as O, watch as J, onBeforeUnmount as Z, createElementBlock as f, openBlock as u, renderSlot as i, normalizeStyle as C, createElementVNode as g, Fragment as D, renderList as H, toDisplayString as R, createCommentVNode as U, computed as V, ref as x, watchEffect as ee, createBlock as te, createSlots as ne, withCtx as w, createVNode as v, unref as $, normalizeProps as F, guardReactiveProps as L } from "vue";
|
|
2
|
+
import { generateThumbnails as re, getMp4Meta as se } from "@video-editor/protocol";
|
|
3
|
+
import { isVideoFramesSegment as P, isAudioSegment as oe } from "@video-editor/shared";
|
|
4
|
+
import { _ as j, V as ae } from "./index-C0eQjJkj.js";
|
|
5
|
+
const le = { class: "frames-segment" }, ie = { class: "frames-segment__video" }, ce = {
|
|
6
6
|
key: 1,
|
|
7
7
|
class: "frames-segment__placeholder"
|
|
8
|
-
},
|
|
8
|
+
}, me = { class: "frames-segment__placeholder" }, de = {
|
|
9
9
|
key: 0,
|
|
10
10
|
class: "frames-segment__badge"
|
|
11
|
-
},
|
|
11
|
+
}, ue = /* @__PURE__ */ _({
|
|
12
12
|
name: "FramesSegment",
|
|
13
13
|
__name: "FramesSegment",
|
|
14
14
|
props: {
|
|
15
15
|
segment: {}
|
|
16
16
|
},
|
|
17
|
-
setup(
|
|
18
|
-
const p =
|
|
17
|
+
setup(a) {
|
|
18
|
+
const p = a, n = O({ items: [], loading: !1, error: null });
|
|
19
19
|
let c = 0;
|
|
20
20
|
J(() => p.segment, (r, l) => {
|
|
21
|
-
if (!
|
|
21
|
+
if (!P(r))
|
|
22
22
|
return;
|
|
23
|
-
(!l || k(l, r)) &&
|
|
24
|
-
}, { immediate: !0, deep: !0 }),
|
|
23
|
+
(!l || k(l, r)) && B(r);
|
|
24
|
+
}, { immediate: !0, deep: !0 }), Z(() => {
|
|
25
25
|
y();
|
|
26
26
|
});
|
|
27
27
|
function k(r, l) {
|
|
28
28
|
return r.url !== l.url || r.startTime !== l.startTime || r.endTime !== l.endTime || r.fromTime !== l.fromTime;
|
|
29
29
|
}
|
|
30
|
-
async function
|
|
30
|
+
async function B(r) {
|
|
31
31
|
if (!r.url)
|
|
32
32
|
return;
|
|
33
33
|
const l = ++c;
|
|
34
34
|
y(), n.loading = !0, n.error = null;
|
|
35
35
|
try {
|
|
36
|
-
const m =
|
|
36
|
+
const m = z(r), b = await re(r.url, m);
|
|
37
37
|
if (c !== l)
|
|
38
38
|
return;
|
|
39
|
-
const
|
|
39
|
+
const I = b.map((h) => ({
|
|
40
40
|
tsMs: Math.round(h.ts / 1e3),
|
|
41
41
|
url: URL.createObjectURL(h.img)
|
|
42
42
|
}));
|
|
43
|
-
n.items =
|
|
43
|
+
n.items = I, n.loading = !1;
|
|
44
44
|
} catch (m) {
|
|
45
45
|
if (c !== l)
|
|
46
46
|
return;
|
|
47
47
|
n.error = m instanceof Error ? m.message : String(m), n.loading = !1;
|
|
48
48
|
}
|
|
49
49
|
}
|
|
50
|
-
function
|
|
50
|
+
function z(r) {
|
|
51
51
|
const l = Math.max(r.fromTime ?? 0, 0) * 1e3, m = Math.max(r.endTime - r.startTime, 1), b = l + m * 1e3, h = Math.max(Math.floor((b - l) / 8), 2e5);
|
|
52
52
|
return { start: l, end: b, step: h };
|
|
53
53
|
}
|
|
@@ -62,65 +62,65 @@ const ae = { class: "frames-segment" }, le = { class: "frames-segment__video" },
|
|
|
62
62
|
backgroundPosition: "left center"
|
|
63
63
|
};
|
|
64
64
|
}
|
|
65
|
-
return (r, l) => (u(), f("div",
|
|
66
|
-
|
|
65
|
+
return (r, l) => (u(), f("div", le, [
|
|
66
|
+
a.segment.type === "image" ? i(r.$slots, "image", {
|
|
67
67
|
key: 0,
|
|
68
|
-
segment:
|
|
69
|
-
style:
|
|
68
|
+
segment: a.segment,
|
|
69
|
+
style: C(T())
|
|
70
70
|
}, () => [
|
|
71
71
|
g("div", {
|
|
72
72
|
class: "frames-segment__image",
|
|
73
|
-
style:
|
|
73
|
+
style: C(T())
|
|
74
74
|
}, null, 4)
|
|
75
|
-
], !0) :
|
|
75
|
+
], !0) : a.segment.type === "video" ? (u(), f(D, { key: 1 }, [
|
|
76
76
|
n.items.length ? i(r.$slots, "video", {
|
|
77
77
|
key: 0,
|
|
78
|
-
segment:
|
|
78
|
+
segment: a.segment,
|
|
79
79
|
thumbnails: n.items
|
|
80
80
|
}, () => [
|
|
81
|
-
g("div",
|
|
82
|
-
(u(!0), f(
|
|
83
|
-
key: `${
|
|
81
|
+
g("div", ie, [
|
|
82
|
+
(u(!0), f(D, null, H(n.items, (m) => (u(), f("div", {
|
|
83
|
+
key: `${a.segment.id}-${m.tsMs}`,
|
|
84
84
|
class: "frames-segment__thumb",
|
|
85
|
-
style:
|
|
85
|
+
style: C({ backgroundImage: `url(${m.url})` })
|
|
86
86
|
}, null, 4))), 128))
|
|
87
87
|
])
|
|
88
|
-
], !0) : (u(), f("div",
|
|
88
|
+
], !0) : (u(), f("div", ce, [
|
|
89
89
|
n.loading ? i(r.$slots, "loading", {
|
|
90
90
|
key: 0,
|
|
91
|
-
segment:
|
|
91
|
+
segment: a.segment
|
|
92
92
|
}, () => [
|
|
93
93
|
l[0] || (l[0] = g("span", null, "抽帧中…", -1))
|
|
94
94
|
], !0) : n.error ? i(r.$slots, "error", {
|
|
95
95
|
key: 1,
|
|
96
|
-
segment:
|
|
96
|
+
segment: a.segment,
|
|
97
97
|
error: n.error
|
|
98
98
|
}, () => [
|
|
99
99
|
l[1] || (l[1] = g("span", null, "生成失败", -1))
|
|
100
100
|
], !0) : i(r.$slots, "empty", {
|
|
101
101
|
key: 2,
|
|
102
|
-
segment:
|
|
102
|
+
segment: a.segment
|
|
103
103
|
}, () => [
|
|
104
104
|
l[2] || (l[2] = g("span", null, "未生成缩略图", -1))
|
|
105
105
|
], !0)
|
|
106
106
|
]))
|
|
107
107
|
], 64)) : i(r.$slots, "fallback", {
|
|
108
108
|
key: 2,
|
|
109
|
-
segment:
|
|
109
|
+
segment: a.segment
|
|
110
110
|
}, () => [
|
|
111
|
-
g("div",
|
|
112
|
-
g("span", null,
|
|
111
|
+
g("div", me, [
|
|
112
|
+
g("span", null, R(a.segment.type), 1)
|
|
113
113
|
])
|
|
114
114
|
], !0),
|
|
115
|
-
i(r.$slots, "overlay", { segment:
|
|
116
|
-
|
|
115
|
+
i(r.$slots, "overlay", { segment: a.segment }, () => [
|
|
116
|
+
a.segment.extra?.label ? (u(), f("span", de, R(a.segment.extra?.label), 1)) : U("", !0)
|
|
117
117
|
], !0)
|
|
118
118
|
]));
|
|
119
119
|
}
|
|
120
|
-
}),
|
|
120
|
+
}), ge = /* @__PURE__ */ j(ue, [["__scopeId", "data-v-4ab97cd2"]]), fe = { class: "segment-base" }, pe = { class: "segment-base__content" }, ke = { class: "segment-base__pill segment-base__pill--primary" }, ye = { class: "segment-base__pill segment-base__pill--muted" }, Te = {
|
|
121
121
|
key: 0,
|
|
122
122
|
class: "segment-base__badge"
|
|
123
|
-
},
|
|
123
|
+
}, be = /* @__PURE__ */ _({
|
|
124
124
|
name: "SegmentBase",
|
|
125
125
|
__name: "SegmentBase",
|
|
126
126
|
props: {
|
|
@@ -128,20 +128,20 @@ const ae = { class: "frames-segment" }, le = { class: "frames-segment__video" },
|
|
|
128
128
|
trackType: {},
|
|
129
129
|
accentColor: { default: "#222226" }
|
|
130
130
|
},
|
|
131
|
-
setup(
|
|
132
|
-
const p =
|
|
131
|
+
setup(a) {
|
|
132
|
+
const p = a, n = V(() => {
|
|
133
133
|
const c = p.segment?.extra?.label;
|
|
134
134
|
return typeof c == "string" ? c : null;
|
|
135
135
|
});
|
|
136
|
-
return (c, k) => (u(), f("div",
|
|
137
|
-
g("div",
|
|
138
|
-
g("span",
|
|
139
|
-
g("span",
|
|
136
|
+
return (c, k) => (u(), f("div", fe, [
|
|
137
|
+
g("div", pe, [
|
|
138
|
+
g("span", ke, R(a.trackType), 1),
|
|
139
|
+
g("span", ye, R(a.segment.segmentType), 1)
|
|
140
140
|
]),
|
|
141
|
-
n.value ? (u(), f("span",
|
|
141
|
+
n.value ? (u(), f("span", Te, R(n.value), 1)) : U("", !0)
|
|
142
142
|
]));
|
|
143
143
|
}
|
|
144
|
-
}),
|
|
144
|
+
}), M = /* @__PURE__ */ j(be, [["__scopeId", "data-v-d386af72"]]), he = { class: "ve-editor-segment__preview" }, A = "#222226", Se = 0.4, ve = /* @__PURE__ */ _({
|
|
145
145
|
name: "VideoEditorTimeline",
|
|
146
146
|
__name: "index",
|
|
147
147
|
props: {
|
|
@@ -153,45 +153,45 @@ const ae = { class: "frames-segment" }, le = { class: "frames-segment__video" },
|
|
|
153
153
|
trackTypes: { default: void 0 },
|
|
154
154
|
disableInteraction: { type: Boolean, default: !1 }
|
|
155
155
|
},
|
|
156
|
-
emits: ["update:currentTime", "update:zoom", "update:selectedSegmentId", "segmentClick", "segmentDragEnd", "segmentResizeEnd"],
|
|
157
|
-
setup(
|
|
158
|
-
const n =
|
|
156
|
+
emits: ["update:currentTime", "update:zoom", "update:selectedSegmentId", "segmentClick", "segmentDragEnd", "segmentResizeEnd", "add-segment"],
|
|
157
|
+
setup(a, { emit: p }) {
|
|
158
|
+
const n = a, c = p, k = x(n.selectedSegmentId ?? null);
|
|
159
159
|
J(() => n.selectedSegmentId, (e) => {
|
|
160
160
|
k.value = e ?? null;
|
|
161
161
|
});
|
|
162
|
-
const
|
|
163
|
-
frames:
|
|
162
|
+
const B = {
|
|
163
|
+
frames: A,
|
|
164
164
|
audio: "#0ea5e9",
|
|
165
165
|
text: "#16a34a",
|
|
166
166
|
sticker: "#f97316",
|
|
167
167
|
effect: "#a855f7",
|
|
168
168
|
filter: "#64748b"
|
|
169
|
-
},
|
|
169
|
+
}, z = V(() => n.protocol?.tracks?.length ? n.trackTypes?.length ? n.protocol.tracks.filter((e) => n.trackTypes?.includes(e.trackType)) : n.protocol.tracks : []), y = O(/* @__PURE__ */ new Map()), T = /* @__PURE__ */ new Map();
|
|
170
170
|
function r(e) {
|
|
171
171
|
if (!e || y.has(e) || T.has(e))
|
|
172
172
|
return;
|
|
173
|
-
const
|
|
173
|
+
const o = (async () => {
|
|
174
174
|
try {
|
|
175
|
-
const t = await
|
|
175
|
+
const t = await se(e);
|
|
176
176
|
y.set(e, t.durationMs);
|
|
177
177
|
} catch {
|
|
178
178
|
}
|
|
179
179
|
})().finally(() => {
|
|
180
180
|
T.delete(e);
|
|
181
181
|
});
|
|
182
|
-
T.set(e,
|
|
182
|
+
T.set(e, o);
|
|
183
183
|
}
|
|
184
|
-
const l =
|
|
185
|
-
const t =
|
|
184
|
+
const l = V(() => z.value.map((e, o) => {
|
|
185
|
+
const t = B[e.trackType] || A, s = b(t, Se), S = e.trackType === "frames" && e.isMain === !0;
|
|
186
186
|
return {
|
|
187
|
-
id: e.trackId || `${e.trackType}-${
|
|
187
|
+
id: e.trackId || `${e.trackType}-${o}`,
|
|
188
188
|
label: e.trackType,
|
|
189
189
|
type: e.trackType,
|
|
190
190
|
color: t,
|
|
191
|
-
isMain:
|
|
191
|
+
isMain: S,
|
|
192
192
|
payload: e,
|
|
193
193
|
segments: e.children.map((d) => ({
|
|
194
|
-
...
|
|
194
|
+
...P(d) ? { fromTime: d.fromTime ?? 0, sourceDurationMs: y.get(d.url) } : oe(d) ? { fromTime: d.fromTime ?? 0 } : {},
|
|
195
195
|
id: d.id,
|
|
196
196
|
start: d.startTime,
|
|
197
197
|
end: d.endTime,
|
|
@@ -201,93 +201,98 @@ const ae = { class: "frames-segment" }, le = { class: "frames-segment__video" },
|
|
|
201
201
|
}))
|
|
202
202
|
};
|
|
203
203
|
}));
|
|
204
|
-
|
|
205
|
-
for (const e of
|
|
206
|
-
for (const
|
|
207
|
-
|
|
204
|
+
ee(() => {
|
|
205
|
+
for (const e of z.value)
|
|
206
|
+
for (const o of e.children)
|
|
207
|
+
P(o) && r(o.url);
|
|
208
208
|
});
|
|
209
|
-
const m =
|
|
209
|
+
const m = V(() => {
|
|
210
210
|
if (!n.protocol?.tracks?.length)
|
|
211
211
|
return 0;
|
|
212
|
-
const e = n.protocol.tracks.flatMap((
|
|
212
|
+
const e = n.protocol.tracks.flatMap((o) => o.children.map((t) => t.endTime));
|
|
213
213
|
return e.length ? Math.max(...e) : 0;
|
|
214
214
|
});
|
|
215
|
-
function b(e,
|
|
215
|
+
function b(e, o) {
|
|
216
216
|
const t = e.replace("#", "");
|
|
217
217
|
if (!(t.length === 3 || t.length === 6))
|
|
218
218
|
return e;
|
|
219
|
-
const s = t.length === 3 ? t.split("").map((
|
|
220
|
-
return `rgba(${
|
|
219
|
+
const s = t.length === 3 ? t.split("").map((N) => N + N).join("") : t, S = Number.parseInt(s.slice(0, 2), 16), d = Number.parseInt(s.slice(2, 4), 16), X = Number.parseInt(s.slice(4, 6), 16);
|
|
220
|
+
return `rgba(${S}, ${d}, ${X}, ${o})`;
|
|
221
221
|
}
|
|
222
|
-
function
|
|
222
|
+
function I(e) {
|
|
223
223
|
return e && typeof e == "object" && "segmentType" in e ? e : null;
|
|
224
224
|
}
|
|
225
225
|
function h(e) {
|
|
226
|
-
const
|
|
227
|
-
if (
|
|
228
|
-
return
|
|
226
|
+
const o = e.payload;
|
|
227
|
+
if (o)
|
|
228
|
+
return o;
|
|
229
229
|
if (n.protocol)
|
|
230
230
|
return n.protocol.tracks.find((t) => t.trackId === e.id);
|
|
231
231
|
}
|
|
232
|
-
function
|
|
232
|
+
function E(e) {
|
|
233
233
|
k.value = e, c("update:selectedSegmentId", e);
|
|
234
234
|
}
|
|
235
235
|
function Y(e) {
|
|
236
|
-
const
|
|
237
|
-
|
|
236
|
+
const o = I(e.segment.payload), t = h(e.track);
|
|
237
|
+
o && (E(o.id), t && c("segmentClick", { segment: o, track: t }));
|
|
238
238
|
}
|
|
239
239
|
function q(e) {
|
|
240
|
-
|
|
240
|
+
E(e.segment.id);
|
|
241
241
|
}
|
|
242
242
|
function G(e) {
|
|
243
243
|
c("segmentDragEnd", e);
|
|
244
244
|
}
|
|
245
245
|
function K(e) {
|
|
246
|
-
|
|
246
|
+
E(e.segment.id);
|
|
247
247
|
}
|
|
248
248
|
function Q(e) {
|
|
249
249
|
c("segmentResizeEnd", e);
|
|
250
250
|
}
|
|
251
|
-
|
|
251
|
+
function W({ track: e, startTime: o, endTime: t, event: s }) {
|
|
252
|
+
const S = e.payload;
|
|
253
|
+
S && c("add-segment", { track: S, startTime: o, endTime: t, event: s });
|
|
254
|
+
}
|
|
255
|
+
return (e, o) => (u(), te(ae, {
|
|
252
256
|
tracks: l.value,
|
|
253
257
|
duration: m.value,
|
|
254
|
-
"current-time":
|
|
255
|
-
zoom:
|
|
256
|
-
fps:
|
|
257
|
-
"snap-step":
|
|
258
|
+
"current-time": a.currentTime,
|
|
259
|
+
zoom: a.zoom,
|
|
260
|
+
fps: a.protocol?.fps || 30,
|
|
261
|
+
"snap-step": a.snapStep,
|
|
258
262
|
"selected-segment-id": k.value ?? null,
|
|
259
|
-
"disable-interaction":
|
|
260
|
-
"onUpdate:currentTime":
|
|
261
|
-
"onUpdate:zoom":
|
|
263
|
+
"disable-interaction": a.disableInteraction,
|
|
264
|
+
"onUpdate:currentTime": o[0] || (o[0] = (t) => c("update:currentTime", t)),
|
|
265
|
+
"onUpdate:zoom": o[1] || (o[1] = (t) => c("update:zoom", t)),
|
|
262
266
|
onSegmentClick: Y,
|
|
263
267
|
onSegmentDragStart: q,
|
|
264
268
|
onSegmentDragEnd: G,
|
|
265
269
|
onSegmentResizeStart: K,
|
|
266
270
|
onSegmentResizeEnd: Q,
|
|
267
|
-
onBackgroundClick:
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
+
onBackgroundClick: o[2] || (o[2] = (t) => E(null)),
|
|
272
|
+
onAddSegment: W
|
|
273
|
+
}, ne({
|
|
274
|
+
segment: w(({ layout: t }) => [
|
|
275
|
+
(u(!0), f(D, null, H([I(t.segment.payload)], (s) => (u(), f(D, {
|
|
271
276
|
key: s?.id || t.segment.id
|
|
272
277
|
}, [
|
|
273
278
|
s ? (u(), f("div", {
|
|
274
279
|
key: 0,
|
|
275
280
|
class: "ve-editor-segment",
|
|
276
|
-
style:
|
|
281
|
+
style: C({ "--ve-segment-accent": t.track.color || A })
|
|
277
282
|
}, [
|
|
278
|
-
g("div",
|
|
283
|
+
g("div", he, [
|
|
279
284
|
s.segmentType === "frames" ? i(e.$slots, "segment-frames", {
|
|
280
285
|
key: 0,
|
|
281
286
|
segment: s,
|
|
282
287
|
layout: t
|
|
283
288
|
}, () => [
|
|
284
|
-
|
|
289
|
+
v($(ge), { segment: s }, null, 8, ["segment"])
|
|
285
290
|
], !0) : s.segmentType === "text" ? i(e.$slots, "segment-text", {
|
|
286
291
|
key: 1,
|
|
287
292
|
segment: s,
|
|
288
293
|
layout: t
|
|
289
294
|
}, () => [
|
|
290
|
-
|
|
295
|
+
v($(M), {
|
|
291
296
|
segment: s,
|
|
292
297
|
"track-type": t.track.type || "unknown",
|
|
293
298
|
"accent-color": t.track.color
|
|
@@ -297,7 +302,7 @@ const ae = { class: "frames-segment" }, le = { class: "frames-segment__video" },
|
|
|
297
302
|
segment: s,
|
|
298
303
|
layout: t
|
|
299
304
|
}, () => [
|
|
300
|
-
|
|
305
|
+
v($(M), {
|
|
301
306
|
segment: s,
|
|
302
307
|
"track-type": t.track.type || "unknown",
|
|
303
308
|
"accent-color": t.track.color
|
|
@@ -307,7 +312,7 @@ const ae = { class: "frames-segment" }, le = { class: "frames-segment__video" },
|
|
|
307
312
|
segment: s,
|
|
308
313
|
layout: t
|
|
309
314
|
}, () => [
|
|
310
|
-
|
|
315
|
+
v($(M), {
|
|
311
316
|
segment: s,
|
|
312
317
|
"track-type": t.track.type || "unknown",
|
|
313
318
|
"accent-color": t.track.color
|
|
@@ -317,7 +322,7 @@ const ae = { class: "frames-segment" }, le = { class: "frames-segment__video" },
|
|
|
317
322
|
segment: s,
|
|
318
323
|
layout: t
|
|
319
324
|
}, () => [
|
|
320
|
-
|
|
325
|
+
v($(M), {
|
|
321
326
|
segment: s,
|
|
322
327
|
"track-type": t.track.type || "unknown",
|
|
323
328
|
"accent-color": t.track.color
|
|
@@ -327,44 +332,44 @@ const ae = { class: "frames-segment" }, le = { class: "frames-segment__video" },
|
|
|
327
332
|
segment: s,
|
|
328
333
|
layout: t
|
|
329
334
|
}, () => [
|
|
330
|
-
|
|
335
|
+
v($(M), {
|
|
331
336
|
segment: s,
|
|
332
337
|
"track-type": t.track.type || "unknown",
|
|
333
338
|
"accent-color": t.track.color
|
|
334
339
|
}, null, 8, ["segment", "track-type", "accent-color"])
|
|
335
|
-
], !0) :
|
|
340
|
+
], !0) : U("", !0)
|
|
336
341
|
])
|
|
337
|
-
], 4)) :
|
|
342
|
+
], 4)) : U("", !0)
|
|
338
343
|
], 64))), 128))
|
|
339
344
|
]),
|
|
340
345
|
_: 2
|
|
341
346
|
}, [
|
|
342
347
|
e.$slots.toolbar ? {
|
|
343
348
|
name: "toolbar",
|
|
344
|
-
fn:
|
|
349
|
+
fn: w((t) => [
|
|
345
350
|
i(e.$slots, "toolbar", F(L(t)), void 0, !0)
|
|
346
351
|
]),
|
|
347
352
|
key: "0"
|
|
348
353
|
} : void 0,
|
|
349
354
|
e.$slots.ruler ? {
|
|
350
355
|
name: "ruler",
|
|
351
|
-
fn:
|
|
356
|
+
fn: w((t) => [
|
|
352
357
|
i(e.$slots, "ruler", F(L(t)), void 0, !0)
|
|
353
358
|
]),
|
|
354
359
|
key: "1"
|
|
355
360
|
} : void 0,
|
|
356
361
|
e.$slots.playhead ? {
|
|
357
362
|
name: "playhead",
|
|
358
|
-
fn:
|
|
363
|
+
fn: w((t) => [
|
|
359
364
|
i(e.$slots, "playhead", F(L(t)), void 0, !0)
|
|
360
365
|
]),
|
|
361
366
|
key: "2"
|
|
362
367
|
} : void 0
|
|
363
368
|
]), 1032, ["tracks", "duration", "current-time", "zoom", "fps", "snap-step", "selected-segment-id", "disable-interaction"]));
|
|
364
369
|
}
|
|
365
|
-
}),
|
|
370
|
+
}), ze = /* @__PURE__ */ j(ve, [["__scopeId", "data-v-4366b771"]]);
|
|
366
371
|
export {
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
372
|
+
ge as F,
|
|
373
|
+
M as S,
|
|
374
|
+
ze as V
|
|
370
375
|
};
|
package/dist/index.d.ts
CHANGED
|
@@ -21,6 +21,12 @@ import { TimelineTick as TimelineTick_2 } from '..';
|
|
|
21
21
|
import { TrackUnion } from '@video-editor/shared';
|
|
22
22
|
|
|
23
23
|
declare const __VLS_component: DefineComponent<__VLS_Props, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {} & {
|
|
24
|
+
"add-segment": (args_0: {
|
|
25
|
+
track: TrackUnion;
|
|
26
|
+
startTime: number;
|
|
27
|
+
endTime?: number;
|
|
28
|
+
event?: MouseEvent;
|
|
29
|
+
}) => any;
|
|
24
30
|
"update:currentTime": (value: number) => any;
|
|
25
31
|
"update:zoom": (value: number) => any;
|
|
26
32
|
segmentClick: (payload: {
|
|
@@ -31,6 +37,12 @@ segmentDragEnd: (payload: SegmentDragPayload) => any;
|
|
|
31
37
|
segmentResizeEnd: (payload: SegmentResizePayload) => any;
|
|
32
38
|
"update:selectedSegmentId": (value: string | null) => any;
|
|
33
39
|
}, string, PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
40
|
+
"onAdd-segment"?: ((args_0: {
|
|
41
|
+
track: TrackUnion;
|
|
42
|
+
startTime: number;
|
|
43
|
+
endTime?: number;
|
|
44
|
+
event?: MouseEvent;
|
|
45
|
+
}) => any) | undefined;
|
|
34
46
|
"onUpdate:currentTime"?: ((value: number) => any) | undefined;
|
|
35
47
|
"onUpdate:zoom"?: ((value: number) => any) | undefined;
|
|
36
48
|
onSegmentClick?: ((payload: {
|
|
@@ -49,6 +61,12 @@ trackTypes: ITrackType[];
|
|
|
49
61
|
}, {}, {}, {}, string, ComponentProvideOptions, false, {}, HTMLDivElement>;
|
|
50
62
|
|
|
51
63
|
declare const __VLS_component_2: DefineComponent<__VLS_Props_2, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {} & {
|
|
64
|
+
"add-segment": (args_0: {
|
|
65
|
+
track: TimelineTrack;
|
|
66
|
+
startTime: number;
|
|
67
|
+
endTime?: number;
|
|
68
|
+
event?: MouseEvent;
|
|
69
|
+
}) => any;
|
|
52
70
|
"update:currentTime": (value: number) => any;
|
|
53
71
|
"update:zoom": (value: number) => any;
|
|
54
72
|
segmentClick: (layout: SegmentLayout, event: MouseEvent) => any;
|
|
@@ -60,6 +78,12 @@ segmentResize: (payload: SegmentResizePayload) => any;
|
|
|
60
78
|
segmentResizeEnd: (payload: SegmentResizePayload) => any;
|
|
61
79
|
backgroundClick: (event: MouseEvent) => any;
|
|
62
80
|
}, string, PublicProps, Readonly<__VLS_Props_2> & Readonly<{
|
|
81
|
+
"onAdd-segment"?: ((args_0: {
|
|
82
|
+
track: TimelineTrack;
|
|
83
|
+
startTime: number;
|
|
84
|
+
endTime?: number;
|
|
85
|
+
event?: MouseEvent;
|
|
86
|
+
}) => any) | undefined;
|
|
63
87
|
"onUpdate:currentTime"?: ((value: number) => any) | undefined;
|
|
64
88
|
"onUpdate:zoom"?: ((value: number) => any) | undefined;
|
|
65
89
|
onSegmentClick?: ((layout: SegmentLayout, event: MouseEvent) => any) | undefined;
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { V as i } from "./index-
|
|
2
|
-
import { F as s, S as d } from "./index-
|
|
3
|
-
import { V as o } from "./index
|
|
1
|
+
import { V as i } from "./index-CzWd59zK.js";
|
|
2
|
+
import { F as s, S as d } from "./index-CzWd59zK.js";
|
|
3
|
+
import { V as o } from "./index-C0eQjJkj.js";
|
|
4
4
|
const t = {
|
|
5
5
|
install(e) {
|
|
6
6
|
e.component(o.name || "VeVideoTimeline", o), e.component(i.name || "VeVideoEditorTimeline", i);
|
package/dist/ui.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
:where(.ve-playhead[data-v-8e647d40]){--ve-playhead-nudge: 0px;--at-apply: absolute z-20 pointer-events-auto cursor-ew-resize h-full;transform:translate(calc(-50% - var(--ve-playhead-nudge)))}:where(.ve-playhead__icon[data-v-8e647d40]){--at-apply: text-[#222226] pointer-events-none relative z-2}:where(.ve-playhead__line[data-v-8e647d40]){--at-apply: bg-[#222226] bottom-0 w-px translate-x--50% left-50% top-2px absolute pointer-events-none}:where(.ve-ruler[data-v-30f91636]){--ve-ruler-major: 8px;--ve-ruler-minor: 4px;--at-apply: sticky top-0 left-0 right-0 bg-white z-3 border-b border-[#e5e7eb] overflow-hidden}:where(.ve-ruler .ve-ruler__ticks[data-v-30f91636]){--at-apply: relative h-full w-full box-border}:where(.ve-ruler .ve-ruler__tick[data-v-30f91636]){--at-apply: absolute top-0 h-full text-center text-[#6b7280] text-[11px]}:where(.ve-ruler .ve-ruler__line[data-v-30f91636]){--at-apply: h-[var(--ve-ruler-minor)] w-px mx-auto bg-[#cbd5e1]}:where(.ve-ruler .ve-ruler__tick--major .ve-ruler__line[data-v-30f91636]){--at-apply: relative h-[var(--ve-ruler-major)] bg-[#94a3b8]}:where(.ve-ruler .ve-ruler__label[data-v-30f91636]){--at-apply: absolute font-mono text-right whitespace-nowrap left-4px bottom-0;transform:translateY(-50%)}:where(.ve-toolbar[data-v-85ddeb0f]){--at-apply: flex items-center justify-between gap-2 px-3 py-2.5 border-b border-[#eceff3]}:where(.ve-toolbar .ve-toolbar__group[data-v-85ddeb0f]){--at-apply: inline-flex items-center gap-2}:where(.ve-toolbar .ve-zoom[data-v-85ddeb0f]){--at-apply: min-w-14 text-center text-xs text-[#222226] px-2 py-1 border border-[#e5e7eb] rounded-lg bg-white}:where(.ve-toolbar .ve-btn[data-v-85ddeb0f]){--at-apply: border border-[#d1d5db] bg-white text-[#222226] rounded-lg h-7 w-7 cursor-pointer transition-all duration-150}:where(.ve-toolbar .ve-btn[data-v-85ddeb0f]:disabled){--at-apply: cursor-not-allowed opacity-45}:where(.ve-toolbar .ve-btn[data-v-85ddeb0f]:not(:disabled):hover){--at-apply: border-[#222226] text-[#222226]}:where(.ve-toolbar .ve-toolbar__time[data-v-85ddeb0f]){--at-apply: inline-flex items-center gap-1.5 text-xs font-mono text-[#222226] ml-auto}:where(.ve-toolbar .ve-toolbar__time-divider[data-v-85ddeb0f]){--at-apply: text-[#9ca3af]}.ve-timeline__tracks[data-v-
|
|
1
|
+
:where(.ve-playhead[data-v-8e647d40]){--ve-playhead-nudge: 0px;--at-apply: absolute z-20 pointer-events-auto cursor-ew-resize h-full;transform:translate(calc(-50% - var(--ve-playhead-nudge)))}:where(.ve-playhead__icon[data-v-8e647d40]){--at-apply: text-[#222226] pointer-events-none relative z-2}:where(.ve-playhead__line[data-v-8e647d40]){--at-apply: bg-[#222226] bottom-0 w-px translate-x--50% left-50% top-2px absolute pointer-events-none}:where(.ve-ruler[data-v-30f91636]){--ve-ruler-major: 8px;--ve-ruler-minor: 4px;--at-apply: sticky top-0 left-0 right-0 bg-white z-3 border-b border-[#e5e7eb] overflow-hidden}:where(.ve-ruler .ve-ruler__ticks[data-v-30f91636]){--at-apply: relative h-full w-full box-border}:where(.ve-ruler .ve-ruler__tick[data-v-30f91636]){--at-apply: absolute top-0 h-full text-center text-[#6b7280] text-[11px]}:where(.ve-ruler .ve-ruler__line[data-v-30f91636]){--at-apply: h-[var(--ve-ruler-minor)] w-px mx-auto bg-[#cbd5e1]}:where(.ve-ruler .ve-ruler__tick--major .ve-ruler__line[data-v-30f91636]){--at-apply: relative h-[var(--ve-ruler-major)] bg-[#94a3b8]}:where(.ve-ruler .ve-ruler__label[data-v-30f91636]){--at-apply: absolute font-mono text-right whitespace-nowrap left-4px bottom-0;transform:translateY(-50%)}:where(.ve-toolbar[data-v-85ddeb0f]){--at-apply: flex items-center justify-between gap-2 px-3 py-2.5 border-b border-[#eceff3]}:where(.ve-toolbar .ve-toolbar__group[data-v-85ddeb0f]){--at-apply: inline-flex items-center gap-2}:where(.ve-toolbar .ve-zoom[data-v-85ddeb0f]){--at-apply: min-w-14 text-center text-xs text-[#222226] px-2 py-1 border border-[#e5e7eb] rounded-lg bg-white}:where(.ve-toolbar .ve-btn[data-v-85ddeb0f]){--at-apply: border border-[#d1d5db] bg-white text-[#222226] rounded-lg h-7 w-7 cursor-pointer transition-all duration-150}:where(.ve-toolbar .ve-btn[data-v-85ddeb0f]:disabled){--at-apply: cursor-not-allowed opacity-45}:where(.ve-toolbar .ve-btn[data-v-85ddeb0f]:not(:disabled):hover){--at-apply: border-[#222226] text-[#222226]}:where(.ve-toolbar .ve-toolbar__time[data-v-85ddeb0f]){--at-apply: inline-flex items-center gap-1.5 text-xs font-mono text-[#222226] ml-auto}:where(.ve-toolbar .ve-toolbar__time-divider[data-v-85ddeb0f]){--at-apply: text-[#9ca3af]}.ve-timeline__tracks[data-v-902b9363]{position:relative;z-index:1;padding-bottom:.75rem;display:flex;flex-direction:column;gap:2px;flex:1}.ve-track[data-v-902b9363]{position:relative;background-color:#f8fafc;overflow:hidden}.ve-track--main[data-v-902b9363]{background-color:#f4f4f6}.ve-track--has-selection[data-v-902b9363]{background-color:#f2f2fa!important;box-shadow:inset 0 1px #e4e4fc,inset 0 -1px #e4e4fc}.ve-track__body[data-v-902b9363]{position:relative;height:100%}.ve-segment[data-v-902b9363]{position:absolute;top:0;bottom:0;border-radius:4px;color:#0f172a;cursor:pointer;display:flex;align-items:center;overflow:hidden;transition-duration:.15s}.ve-segment__content[data-v-902b9363]{display:flex;flex-direction:column;gap:.25rem;padding:.375rem .625rem}.ve-segment__title[data-v-902b9363]{font-size:12px;font-weight:700;text-transform:capitalize}.ve-segment__time[data-v-902b9363]{font-size:11px;color:#0f172acc;font-family:monospace}.ve-segment__selection[data-v-902b9363]{position:absolute;inset:0;pointer-events:none;z-index:10}.ve-segment__handle[data-v-902b9363]{position:absolute;height:100%;width:4px;background-color:#222226;cursor:ew-resize;pointer-events:auto;border:2px solid #222226}.ve-segment__handle--left[data-v-902b9363]{left:0;top:0;border-radius:.25rem 0 0 .25rem}.ve-segment__handle--right[data-v-902b9363]{right:0;top:0;border-radius:0 .25rem .25rem 0}.ve-segment__handle-dots[data-v-902b9363]{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);display:flex;flex-direction:column;align-items:center;gap:.125rem;justify-content:center}.ve-segment__handle-dot[data-v-902b9363]{border-radius:9999px;background-color:#fff;width:1px;height:1px}.ve-track__add-button[data-v-902b9363]{position:absolute;top:50%;transform:translateY(-50%);margin-left:.5rem;width:2.5rem;height:2.5rem;border-radius:.5rem;display:flex;align-items:center;justify-content:center;color:#222226;background-color:#f2f2fa;cursor:pointer;transition:background-color .2s;border:1px solid #222226}.ve-track__add-button[data-v-902b9363]:hover{background-color:#e5e5e5}.ve-track__gap-add[data-v-902b9363]{position:absolute;top:0;bottom:0;height:100%;display:flex;align-items:center;justify-content:center;cursor:pointer}.ve-track__gap-add[data-v-902b9363]:hover{background-color:#efefef}.ve-track__gap-add-icon[data-v-902b9363]{display:none;color:#fff;background-color:#222226;padding:4px;border-radius:4px}.ve-track__gap-add:hover .ve-track__gap-add-icon[data-v-902b9363]{display:block}:where(.ve-timeline[data-v-4e3078d5]){--ve-primary: #222226;--at-apply: flex flex-col w-full max-w-full min-w-0 rounded-10px h-full}:where(.ve-timeline .ve-timeline__viewport[data-v-4e3078d5]){--at-apply: relative overflow-auto w-full flex-1 bg-white}:where(.ve-timeline .ve-timeline__content[data-v-4e3078d5]){--at-apply: min-h-full min-w-full}:where(.ve-timeline .ve-segment--dragging[data-v-4e3078d5]){--at-apply: absolute z-50 rounded-[4px] text-[#0f172a] cursor-pointer flex items-center overflow-hidden pointer-events-none;box-shadow:0 4px 16px #0000004d,inset 0 0 0 2px #ffffff80}:where(.ve-timeline .ve-segment--preview[data-v-4e3078d5]){--at-apply: absolute z-45 rounded-[4px] pointer-events-none;opacity:.7;box-shadow:0 2px 8px #0003,inset 0 0 0 2px #fff6}:where(.ve-timeline .ve-segment__content[data-v-4e3078d5]){--at-apply: flex flex-col gap-1 px-2.5 py-1.5}:where(.ve-timeline .ve-segment__title[data-v-4e3078d5]){--at-apply: text-[12px] font-bold capitalize}:where(.ve-timeline .ve-segment__time[data-v-4e3078d5]){--at-apply: text-[11px] text-[rgba(15,23,42,.8)] font-mono}:where(.ve-timeline .ve-segment--placeholder[data-v-4e3078d5]){--at-apply: absolute pointer-events-none rounded-[4px] z-24;background:#2222261f;border:2px solid rgba(34,34,38,.6)}:where(.ve-timeline .ve-segment--placeholder-inner[data-v-4e3078d5]){--at-apply: absolute inset-0 rounded-[2px];opacity:.2}:where(.ve-timeline .ve-snap-guide[data-v-4e3078d5]){--at-apply: absolute pointer-events-none z-20;width:1px;background:var(--ve-primary);opacity:.7}:where(.ve-timeline .ve-new-track-line[data-v-4e3078d5]){--at-apply: absolute pointer-events-none z-25;height:1px;background:var(--ve-primary);opacity:.8}:where(.frames-segment[data-v-4ab97cd2]){--at-apply: relative flex items-stretch w-full h-full overflow-hidden rounded-4px}:where(.frames-segment .frames-segment__image[data-v-4ab97cd2]){--at-apply: w-full h-full rounded-4px;background-color:color-mix(in srgb,var(--ve-segment-accent, #222226) 15%,transparent)}:where(.frames-segment .frames-segment__video[data-v-4ab97cd2]){--at-apply: flex items-center w-full h-full overflow-hidden;background:#f1f5f9}:where(.frames-segment .frames-segment__thumb[data-v-4ab97cd2]){--at-apply: flex-1 min-w-14;aspect-ratio:1 / 1;background-size:cover;background-position:center}:where(.frames-segment .frames-segment__placeholder[data-v-4ab97cd2]){--at-apply: flex items-center justify-center w-full h-full text-[12px] rounded-4px whitespace-nowrap;color:#0f172abf;background:#0000000d}:where(.frames-segment .frames-segment__badge[data-v-4ab97cd2]){--at-apply: absolute top-1.5 left-2 px-1.5 py-0.5 text-[11px] rounded-4px pointer-events-none;background:#00000040;color:#fff;transform-origin:left top;transform:scale(.9)}:where(.segment-base[data-v-d386af72]){--at-apply: relative flex items-center w-full h-full p-1.5 rounded-4px;background:#ffffff52;box-shadow:inset 0 0 0 1px #fff3}:where(.segment-base .segment-base__content[data-v-d386af72]){--at-apply: flex items-center justify-start gap-1.5 w-full}:where(.segment-base .segment-base__pill[data-v-d386af72]){--at-apply: inline-flex items-center gap-1.5 px-2.5 py-1.5 rounded-full text-[11px] font-semibold whitespace-nowrap;box-shadow:inset 0 0 0 1px #ffffff4d}:where(.segment-base .segment-base__pill--primary[data-v-d386af72]){color:var(--ve-segment-accent, #222226);background:#22222614}:where(.segment-base .segment-base__pill--muted[data-v-d386af72]){color:#0f172ab3;background:#2222260d}:where(.segment-base .segment-base__badge[data-v-d386af72]){--at-apply: absolute top-1.5 left-2 px-1.5 py-0.5 text-[11px] rounded-4px pointer-events-none;background:#00000040;color:#fff;transform-origin:left top;transform:scale(.9)}:where(.ve-editor-segment[data-v-4366b771]){--at-apply: relative flex flex-col gap-1.5 w-full h-full text-[#0f172a]}:where(.ve-editor-segment .ve-editor-segment__preview[data-v-4366b771]){--at-apply: flex items-stretch w-full min-h-14}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@video-editor/ui",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.0.1-beta.
|
|
4
|
+
"version": "0.0.1-beta.22",
|
|
5
5
|
"exports": {
|
|
6
6
|
".": {
|
|
7
7
|
"types": "./dist/index.d.ts",
|
|
@@ -20,8 +20,8 @@
|
|
|
20
20
|
"vue": "^3.5.26"
|
|
21
21
|
},
|
|
22
22
|
"dependencies": {
|
|
23
|
-
"@video-editor/
|
|
24
|
-
"@video-editor/
|
|
23
|
+
"@video-editor/protocol": "0.0.1-beta.22",
|
|
24
|
+
"@video-editor/shared": "0.0.1-beta.22"
|
|
25
25
|
},
|
|
26
26
|
"scripts": {
|
|
27
27
|
"build": "vite build",
|