@video-editor/ui 0.0.1-beta.12 → 0.0.1-beta.13

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.
@@ -1,303 +1,5 @@
1
- import { defineComponent as V, reactive as Y, watch as j, onBeforeUnmount as q, createElementBlock as g, openBlock as i, renderSlot as d, normalizeStyle as I, createElementVNode as u, Fragment as z, renderList as A, toDisplayString as T, createCommentVNode as D, computed as R, ref as x, createBlock as _, createSlots as G, withCtx as $, unref as P, normalizeProps as U, guardReactiveProps as B } from "vue";
2
- import { _ as F, V as K } from "./index-t1DKjcCO.js";
3
- import { generateThumbnails as Q } from "@video-editor/protocol";
4
- import { isVideoFramesSegment as W } from "@video-editor/shared";
5
- const X = { class: "frames-segment" }, Z = { class: "frames-segment__video" }, ee = {
6
- key: 1,
7
- class: "frames-segment__placeholder"
8
- }, te = { class: "frames-segment__placeholder" }, ne = {
9
- key: 0,
10
- class: "frames-segment__badge"
11
- }, se = /* @__PURE__ */ V({
12
- name: "FramesSegment",
13
- __name: "FramesSegment",
14
- props: {
15
- segment: {}
16
- },
17
- setup(r) {
18
- const p = r, n = Y({ items: [], loading: !1, error: null });
19
- let l = 0;
20
- j(() => p.segment, (s, a) => {
21
- if (!W(s))
22
- return;
23
- (!a || k(a, s)) && E(s);
24
- }, { immediate: !0, deep: !0 }), q(() => {
25
- h();
26
- });
27
- function k(s, a) {
28
- return s.url !== a.url || s.startTime !== a.startTime || s.endTime !== a.endTime || s.fromTime !== a.fromTime;
29
- }
30
- async function E(s) {
31
- if (!s.url)
32
- return;
33
- const a = ++l;
34
- h(), n.loading = !0, n.error = null;
35
- try {
36
- const m = C(s), f = await Q(s.url, m);
37
- if (l !== a)
38
- return;
39
- const v = f.map((b) => ({
40
- tsMs: Math.round(b.ts / 1e3),
41
- url: URL.createObjectURL(b.img)
42
- }));
43
- n.items = v, n.loading = !1;
44
- } catch (m) {
45
- if (l !== a)
46
- return;
47
- n.error = m instanceof Error ? m.message : String(m), n.loading = !1;
48
- }
49
- }
50
- function C(s) {
51
- const a = Math.max(s.fromTime ?? 0, 0) * 1e3, m = Math.max(s.endTime - s.startTime, 1), f = a + m * 1e3, b = Math.max(Math.floor((f - a) / 8), 2e5);
52
- return { start: a, end: f, step: b };
53
- }
54
- function h() {
55
- n.items.forEach((s) => URL.revokeObjectURL(s.url)), n.items = [];
56
- }
57
- function S() {
58
- return {
59
- backgroundImage: p.segment.url ? `url(${p.segment.url})` : "",
60
- backgroundRepeat: "repeat-x",
61
- backgroundSize: "56px 56px",
62
- backgroundPosition: "left center"
63
- };
64
- }
65
- return (s, a) => (i(), g("div", X, [
66
- r.segment.type === "image" ? d(s.$slots, "image", {
67
- key: 0,
68
- segment: r.segment,
69
- style: I(S())
70
- }, () => [
71
- u("div", {
72
- class: "frames-segment__image",
73
- style: I(S())
74
- }, null, 4)
75
- ], !0) : r.segment.type === "video" ? (i(), g(z, { key: 1 }, [
76
- n.items.length ? d(s.$slots, "video", {
77
- key: 0,
78
- segment: r.segment,
79
- thumbnails: n.items
80
- }, () => [
81
- u("div", Z, [
82
- (i(!0), g(z, null, A(n.items, (m) => (i(), g("div", {
83
- key: `${r.segment.id}-${m.tsMs}`,
84
- class: "frames-segment__thumb",
85
- style: I({ backgroundImage: `url(${m.url})` })
86
- }, null, 4))), 128))
87
- ])
88
- ], !0) : (i(), g("div", ee, [
89
- n.loading ? d(s.$slots, "loading", {
90
- key: 0,
91
- segment: r.segment
92
- }, () => [
93
- a[0] || (a[0] = u("span", null, "抽帧中…", -1))
94
- ], !0) : n.error ? d(s.$slots, "error", {
95
- key: 1,
96
- segment: r.segment,
97
- error: n.error
98
- }, () => [
99
- a[1] || (a[1] = u("span", null, "生成失败", -1))
100
- ], !0) : d(s.$slots, "empty", {
101
- key: 2,
102
- segment: r.segment
103
- }, () => [
104
- a[2] || (a[2] = u("span", null, "未生成缩略图", -1))
105
- ], !0)
106
- ]))
107
- ], 64)) : d(s.$slots, "fallback", {
108
- key: 2,
109
- segment: r.segment
110
- }, () => [
111
- u("div", te, [
112
- u("span", null, T(r.segment.type), 1)
113
- ])
114
- ], !0),
115
- d(s.$slots, "overlay", { segment: r.segment }, () => [
116
- r.segment.extra?.label ? (i(), g("span", ne, T(r.segment.extra?.label), 1)) : D("", !0)
117
- ], !0)
118
- ]));
119
- }
120
- }), re = /* @__PURE__ */ F(se, [["__scopeId", "data-v-4ab97cd2"]]), ae = { class: "segment-base" }, oe = { class: "segment-base__content" }, le = { class: "segment-base__pill segment-base__pill--primary" }, ie = { class: "segment-base__pill segment-base__pill--muted" }, me = {
121
- key: 0,
122
- class: "segment-base__badge"
123
- }, ce = /* @__PURE__ */ V({
124
- name: "SegmentBase",
125
- __name: "SegmentBase",
126
- props: {
127
- segment: {},
128
- trackType: {},
129
- accentColor: { default: "#222226" }
130
- },
131
- setup(r) {
132
- const p = r, n = R(() => {
133
- const l = p.segment?.extra?.label;
134
- return typeof l == "string" ? l : null;
135
- });
136
- return (l, k) => (i(), g("div", ae, [
137
- u("div", oe, [
138
- u("span", le, T(r.trackType), 1),
139
- u("span", ie, T(r.segment.segmentType), 1)
140
- ]),
141
- n.value ? (i(), g("span", me, T(n.value), 1)) : D("", !0)
142
- ]));
143
- }
144
- }), de = /* @__PURE__ */ F(ce, [["__scopeId", "data-v-d386af72"]]), ue = { class: "ve-editor-segment__preview" }, L = "#222226", ge = 0.4, fe = /* @__PURE__ */ V({
145
- name: "VideoEditorTimeline",
146
- __name: "index",
147
- props: {
148
- protocol: { default: null },
149
- currentTime: {},
150
- zoom: {},
151
- snapStep: { default: 0 },
152
- selectedSegmentId: { default: null },
153
- trackTypes: { default: void 0 },
154
- disableInteraction: { type: Boolean, default: !1 }
155
- },
156
- emits: ["update:currentTime", "update:zoom", "update:selectedSegmentId", "segmentClick", "segmentDragEnd", "segmentResizeEnd"],
157
- setup(r, { emit: p }) {
158
- const n = r, l = p, k = x(n.selectedSegmentId ?? null);
159
- j(() => n.selectedSegmentId, (e) => {
160
- k.value = e ?? null;
161
- });
162
- const E = {
163
- frames: L,
164
- audio: "#0ea5e9",
165
- text: "#16a34a",
166
- sticker: "#f97316",
167
- effect: "#a855f7",
168
- filter: "#64748b"
169
- }, C = R(() => n.protocol?.tracks?.length ? n.trackTypes?.length ? n.protocol.tracks.filter((e) => n.trackTypes?.includes(e.trackType)) : n.protocol.tracks : []), h = R(() => C.value.map((e, o) => {
170
- const t = E[e.trackType] || L, c = s(t, ge), M = e.trackType === "frames" && e.isMain === !0;
171
- return {
172
- id: e.trackId || `${e.trackType}-${o}`,
173
- label: e.trackType,
174
- type: e.trackType,
175
- color: t,
176
- isMain: M,
177
- payload: e,
178
- segments: e.children.map((y) => ({
179
- id: y.id,
180
- start: y.startTime,
181
- end: y.endTime,
182
- type: y.segmentType,
183
- color: c,
184
- payload: y
185
- }))
186
- };
187
- })), S = R(() => {
188
- if (!n.protocol?.tracks?.length)
189
- return 0;
190
- const e = n.protocol.tracks.flatMap((o) => o.children.map((t) => t.endTime));
191
- return e.length ? Math.max(...e) : 0;
192
- });
193
- function s(e, o) {
194
- const t = e.replace("#", "");
195
- if (!(t.length === 3 || t.length === 6))
196
- return e;
197
- const c = t.length === 3 ? t.split("").map((w) => w + w).join("") : t, M = Number.parseInt(c.slice(0, 2), 16), y = Number.parseInt(c.slice(2, 4), 16), J = Number.parseInt(c.slice(4, 6), 16);
198
- return `rgba(${M}, ${y}, ${J}, ${o})`;
199
- }
200
- function a(e) {
201
- return e && typeof e == "object" && "segmentType" in e ? e : null;
202
- }
203
- function m(e) {
204
- const o = e.payload;
205
- if (o)
206
- return o;
207
- if (n.protocol)
208
- return n.protocol.tracks.find((t) => t.trackId === e.id);
209
- }
210
- function f(e) {
211
- k.value = e, l("update:selectedSegmentId", e);
212
- }
213
- function v(e) {
214
- const o = a(e.segment.payload), t = m(e.track);
215
- o && (f(o.id), t && l("segmentClick", { segment: o, track: t }));
216
- }
217
- function b(e) {
218
- f(e.segment.id);
219
- }
220
- function N(e) {
221
- l("segmentDragEnd", e);
222
- }
223
- function O(e) {
224
- f(e.segment.id);
225
- }
226
- function H(e) {
227
- l("segmentResizeEnd", e);
228
- }
229
- return (e, o) => (i(), _(K, {
230
- tracks: h.value,
231
- duration: S.value,
232
- "current-time": r.currentTime,
233
- zoom: r.zoom,
234
- fps: r.protocol?.fps || 30,
235
- "snap-step": r.snapStep,
236
- "selected-segment-id": k.value ?? null,
237
- "disable-interaction": r.disableInteraction,
238
- "onUpdate:currentTime": o[0] || (o[0] = (t) => l("update:currentTime", t)),
239
- "onUpdate:zoom": o[1] || (o[1] = (t) => l("update:zoom", t)),
240
- onSegmentClick: v,
241
- onSegmentDragStart: b,
242
- onSegmentDragEnd: N,
243
- onSegmentResizeStart: O,
244
- onSegmentResizeEnd: H,
245
- onBackgroundClick: o[2] || (o[2] = (t) => f(null))
246
- }, G({
247
- segment: $(({ layout: t }) => [
248
- (i(!0), g(z, null, A([a(t.segment.payload)], (c) => (i(), g(z, {
249
- key: c?.id || t.segment.id
250
- }, [
251
- c ? (i(), g("div", {
252
- key: 0,
253
- class: "ve-editor-segment",
254
- style: I({ "--ve-segment-accent": t.track.color || L })
255
- }, [
256
- u("div", ue, [
257
- d(e.$slots, `segment-${c.segmentType}`, {
258
- segment: c,
259
- layout: t
260
- }, () => [
261
- c.segmentType === "frames" ? (i(), _(P(re), {
262
- key: 0,
263
- segment: c
264
- }, null, 8, ["segment"])) : (i(), _(P(de), {
265
- key: 1,
266
- segment: c,
267
- "track-type": t.track.type || "unknown",
268
- "accent-color": t.track.color
269
- }, null, 8, ["segment", "track-type", "accent-color"]))
270
- ], !0)
271
- ])
272
- ], 4)) : D("", !0)
273
- ], 64))), 128))
274
- ]),
275
- _: 2
276
- }, [
277
- e.$slots.toolbar ? {
278
- name: "toolbar",
279
- fn: $((t) => [
280
- d(e.$slots, "toolbar", U(B(t)), void 0, !0)
281
- ]),
282
- key: "0"
283
- } : void 0,
284
- e.$slots.ruler ? {
285
- name: "ruler",
286
- fn: $((t) => [
287
- d(e.$slots, "ruler", U(B(t)), void 0, !0)
288
- ]),
289
- key: "1"
290
- } : void 0,
291
- e.$slots.playhead ? {
292
- name: "playhead",
293
- fn: $((t) => [
294
- d(e.$slots, "playhead", U(B(t)), void 0, !0)
295
- ]),
296
- key: "2"
297
- } : void 0
298
- ]), 1032, ["tracks", "duration", "current-time", "zoom", "fps", "snap-step", "selected-segment-id", "disable-interaction"]));
299
- }
300
- }), Te = /* @__PURE__ */ F(fe, [["__scopeId", "data-v-8004be28"]]);
1
+ import { V as a } from "./index-BgON6Mut.js";
2
+ import "./index-t1DKjcCO.js";
301
3
  export {
302
- Te as default
4
+ a as default
303
5
  };
@@ -0,0 +1,305 @@
1
+ import { defineComponent as F, reactive as Y, watch as j, onBeforeUnmount as q, createElementBlock as g, openBlock as i, renderSlot as d, normalizeStyle as I, createElementVNode as u, Fragment as z, renderList as A, toDisplayString as T, createCommentVNode as L, computed as R, ref as x, createBlock as _, createSlots as G, withCtx as $, unref as P, normalizeProps as U, guardReactiveProps as B } from "vue";
2
+ import { _ as D, V as K } from "./index-t1DKjcCO.js";
3
+ import { generateThumbnails as Q } from "@video-editor/protocol";
4
+ import { isVideoFramesSegment as W } from "@video-editor/shared";
5
+ const X = { class: "frames-segment" }, Z = { class: "frames-segment__video" }, ee = {
6
+ key: 1,
7
+ class: "frames-segment__placeholder"
8
+ }, te = { class: "frames-segment__placeholder" }, ne = {
9
+ key: 0,
10
+ class: "frames-segment__badge"
11
+ }, se = /* @__PURE__ */ F({
12
+ name: "FramesSegment",
13
+ __name: "FramesSegment",
14
+ props: {
15
+ segment: {}
16
+ },
17
+ setup(r) {
18
+ const p = r, n = Y({ items: [], loading: !1, error: null });
19
+ let l = 0;
20
+ j(() => p.segment, (s, a) => {
21
+ if (!W(s))
22
+ return;
23
+ (!a || k(a, s)) && E(s);
24
+ }, { immediate: !0, deep: !0 }), q(() => {
25
+ h();
26
+ });
27
+ function k(s, a) {
28
+ return s.url !== a.url || s.startTime !== a.startTime || s.endTime !== a.endTime || s.fromTime !== a.fromTime;
29
+ }
30
+ async function E(s) {
31
+ if (!s.url)
32
+ return;
33
+ const a = ++l;
34
+ h(), n.loading = !0, n.error = null;
35
+ try {
36
+ const m = C(s), f = await Q(s.url, m);
37
+ if (l !== a)
38
+ return;
39
+ const v = f.map((b) => ({
40
+ tsMs: Math.round(b.ts / 1e3),
41
+ url: URL.createObjectURL(b.img)
42
+ }));
43
+ n.items = v, n.loading = !1;
44
+ } catch (m) {
45
+ if (l !== a)
46
+ return;
47
+ n.error = m instanceof Error ? m.message : String(m), n.loading = !1;
48
+ }
49
+ }
50
+ function C(s) {
51
+ const a = Math.max(s.fromTime ?? 0, 0) * 1e3, m = Math.max(s.endTime - s.startTime, 1), f = a + m * 1e3, b = Math.max(Math.floor((f - a) / 8), 2e5);
52
+ return { start: a, end: f, step: b };
53
+ }
54
+ function h() {
55
+ n.items.forEach((s) => URL.revokeObjectURL(s.url)), n.items = [];
56
+ }
57
+ function S() {
58
+ return {
59
+ backgroundImage: p.segment.url ? `url(${p.segment.url})` : "",
60
+ backgroundRepeat: "repeat-x",
61
+ backgroundSize: "56px 56px",
62
+ backgroundPosition: "left center"
63
+ };
64
+ }
65
+ return (s, a) => (i(), g("div", X, [
66
+ r.segment.type === "image" ? d(s.$slots, "image", {
67
+ key: 0,
68
+ segment: r.segment,
69
+ style: I(S())
70
+ }, () => [
71
+ u("div", {
72
+ class: "frames-segment__image",
73
+ style: I(S())
74
+ }, null, 4)
75
+ ], !0) : r.segment.type === "video" ? (i(), g(z, { key: 1 }, [
76
+ n.items.length ? d(s.$slots, "video", {
77
+ key: 0,
78
+ segment: r.segment,
79
+ thumbnails: n.items
80
+ }, () => [
81
+ u("div", Z, [
82
+ (i(!0), g(z, null, A(n.items, (m) => (i(), g("div", {
83
+ key: `${r.segment.id}-${m.tsMs}`,
84
+ class: "frames-segment__thumb",
85
+ style: I({ backgroundImage: `url(${m.url})` })
86
+ }, null, 4))), 128))
87
+ ])
88
+ ], !0) : (i(), g("div", ee, [
89
+ n.loading ? d(s.$slots, "loading", {
90
+ key: 0,
91
+ segment: r.segment
92
+ }, () => [
93
+ a[0] || (a[0] = u("span", null, "抽帧中…", -1))
94
+ ], !0) : n.error ? d(s.$slots, "error", {
95
+ key: 1,
96
+ segment: r.segment,
97
+ error: n.error
98
+ }, () => [
99
+ a[1] || (a[1] = u("span", null, "生成失败", -1))
100
+ ], !0) : d(s.$slots, "empty", {
101
+ key: 2,
102
+ segment: r.segment
103
+ }, () => [
104
+ a[2] || (a[2] = u("span", null, "未生成缩略图", -1))
105
+ ], !0)
106
+ ]))
107
+ ], 64)) : d(s.$slots, "fallback", {
108
+ key: 2,
109
+ segment: r.segment
110
+ }, () => [
111
+ u("div", te, [
112
+ u("span", null, T(r.segment.type), 1)
113
+ ])
114
+ ], !0),
115
+ d(s.$slots, "overlay", { segment: r.segment }, () => [
116
+ r.segment.extra?.label ? (i(), g("span", ne, T(r.segment.extra?.label), 1)) : L("", !0)
117
+ ], !0)
118
+ ]));
119
+ }
120
+ }), re = /* @__PURE__ */ D(se, [["__scopeId", "data-v-4ab97cd2"]]), ae = { class: "segment-base" }, oe = { class: "segment-base__content" }, le = { class: "segment-base__pill segment-base__pill--primary" }, ie = { class: "segment-base__pill segment-base__pill--muted" }, me = {
121
+ key: 0,
122
+ class: "segment-base__badge"
123
+ }, ce = /* @__PURE__ */ F({
124
+ name: "SegmentBase",
125
+ __name: "SegmentBase",
126
+ props: {
127
+ segment: {},
128
+ trackType: {},
129
+ accentColor: { default: "#222226" }
130
+ },
131
+ setup(r) {
132
+ const p = r, n = R(() => {
133
+ const l = p.segment?.extra?.label;
134
+ return typeof l == "string" ? l : null;
135
+ });
136
+ return (l, k) => (i(), g("div", ae, [
137
+ u("div", oe, [
138
+ u("span", le, T(r.trackType), 1),
139
+ u("span", ie, T(r.segment.segmentType), 1)
140
+ ]),
141
+ n.value ? (i(), g("span", me, T(n.value), 1)) : L("", !0)
142
+ ]));
143
+ }
144
+ }), de = /* @__PURE__ */ D(ce, [["__scopeId", "data-v-d386af72"]]), ue = { class: "ve-editor-segment__preview" }, V = "#222226", ge = 0.4, fe = /* @__PURE__ */ F({
145
+ name: "VideoEditorTimeline",
146
+ __name: "index",
147
+ props: {
148
+ protocol: { default: null },
149
+ currentTime: {},
150
+ zoom: {},
151
+ snapStep: { default: 0 },
152
+ selectedSegmentId: { default: null },
153
+ trackTypes: { default: void 0 },
154
+ disableInteraction: { type: Boolean, default: !1 }
155
+ },
156
+ emits: ["update:currentTime", "update:zoom", "update:selectedSegmentId", "segmentClick", "segmentDragEnd", "segmentResizeEnd"],
157
+ setup(r, { emit: p }) {
158
+ const n = r, l = p, k = x(n.selectedSegmentId ?? null);
159
+ j(() => n.selectedSegmentId, (e) => {
160
+ k.value = e ?? null;
161
+ });
162
+ const E = {
163
+ frames: V,
164
+ audio: "#0ea5e9",
165
+ text: "#16a34a",
166
+ sticker: "#f97316",
167
+ effect: "#a855f7",
168
+ filter: "#64748b"
169
+ }, C = R(() => n.protocol?.tracks?.length ? n.trackTypes?.length ? n.protocol.tracks.filter((e) => n.trackTypes?.includes(e.trackType)) : n.protocol.tracks : []), h = R(() => C.value.map((e, o) => {
170
+ const t = E[e.trackType] || V, c = s(t, ge), M = e.trackType === "frames" && e.isMain === !0;
171
+ return {
172
+ id: e.trackId || `${e.trackType}-${o}`,
173
+ label: e.trackType,
174
+ type: e.trackType,
175
+ color: t,
176
+ isMain: M,
177
+ payload: e,
178
+ segments: e.children.map((y) => ({
179
+ id: y.id,
180
+ start: y.startTime,
181
+ end: y.endTime,
182
+ type: y.segmentType,
183
+ color: c,
184
+ payload: y
185
+ }))
186
+ };
187
+ })), S = R(() => {
188
+ if (!n.protocol?.tracks?.length)
189
+ return 0;
190
+ const e = n.protocol.tracks.flatMap((o) => o.children.map((t) => t.endTime));
191
+ return e.length ? Math.max(...e) : 0;
192
+ });
193
+ function s(e, o) {
194
+ const t = e.replace("#", "");
195
+ if (!(t.length === 3 || t.length === 6))
196
+ return e;
197
+ const c = t.length === 3 ? t.split("").map((w) => w + w).join("") : t, M = Number.parseInt(c.slice(0, 2), 16), y = Number.parseInt(c.slice(2, 4), 16), J = Number.parseInt(c.slice(4, 6), 16);
198
+ return `rgba(${M}, ${y}, ${J}, ${o})`;
199
+ }
200
+ function a(e) {
201
+ return e && typeof e == "object" && "segmentType" in e ? e : null;
202
+ }
203
+ function m(e) {
204
+ const o = e.payload;
205
+ if (o)
206
+ return o;
207
+ if (n.protocol)
208
+ return n.protocol.tracks.find((t) => t.trackId === e.id);
209
+ }
210
+ function f(e) {
211
+ k.value = e, l("update:selectedSegmentId", e);
212
+ }
213
+ function v(e) {
214
+ const o = a(e.segment.payload), t = m(e.track);
215
+ o && (f(o.id), t && l("segmentClick", { segment: o, track: t }));
216
+ }
217
+ function b(e) {
218
+ f(e.segment.id);
219
+ }
220
+ function N(e) {
221
+ l("segmentDragEnd", e);
222
+ }
223
+ function O(e) {
224
+ f(e.segment.id);
225
+ }
226
+ function H(e) {
227
+ l("segmentResizeEnd", e);
228
+ }
229
+ return (e, o) => (i(), _(K, {
230
+ tracks: h.value,
231
+ duration: S.value,
232
+ "current-time": r.currentTime,
233
+ zoom: r.zoom,
234
+ fps: r.protocol?.fps || 30,
235
+ "snap-step": r.snapStep,
236
+ "selected-segment-id": k.value ?? null,
237
+ "disable-interaction": r.disableInteraction,
238
+ "onUpdate:currentTime": o[0] || (o[0] = (t) => l("update:currentTime", t)),
239
+ "onUpdate:zoom": o[1] || (o[1] = (t) => l("update:zoom", t)),
240
+ onSegmentClick: v,
241
+ onSegmentDragStart: b,
242
+ onSegmentDragEnd: N,
243
+ onSegmentResizeStart: O,
244
+ onSegmentResizeEnd: H,
245
+ onBackgroundClick: o[2] || (o[2] = (t) => f(null))
246
+ }, G({
247
+ segment: $(({ layout: t }) => [
248
+ (i(!0), g(z, null, A([a(t.segment.payload)], (c) => (i(), g(z, {
249
+ key: c?.id || t.segment.id
250
+ }, [
251
+ c ? (i(), g("div", {
252
+ key: 0,
253
+ class: "ve-editor-segment",
254
+ style: I({ "--ve-segment-accent": t.track.color || V })
255
+ }, [
256
+ u("div", ue, [
257
+ d(e.$slots, `segment-${c.segmentType}`, {
258
+ segment: c,
259
+ layout: t
260
+ }, () => [
261
+ c.segmentType === "frames" ? (i(), _(P(re), {
262
+ key: 0,
263
+ segment: c
264
+ }, null, 8, ["segment"])) : (i(), _(P(de), {
265
+ key: 1,
266
+ segment: c,
267
+ "track-type": t.track.type || "unknown",
268
+ "accent-color": t.track.color
269
+ }, null, 8, ["segment", "track-type", "accent-color"]))
270
+ ], !0)
271
+ ])
272
+ ], 4)) : L("", !0)
273
+ ], 64))), 128))
274
+ ]),
275
+ _: 2
276
+ }, [
277
+ e.$slots.toolbar ? {
278
+ name: "toolbar",
279
+ fn: $((t) => [
280
+ d(e.$slots, "toolbar", U(B(t)), void 0, !0)
281
+ ]),
282
+ key: "0"
283
+ } : void 0,
284
+ e.$slots.ruler ? {
285
+ name: "ruler",
286
+ fn: $((t) => [
287
+ d(e.$slots, "ruler", U(B(t)), void 0, !0)
288
+ ]),
289
+ key: "1"
290
+ } : void 0,
291
+ e.$slots.playhead ? {
292
+ name: "playhead",
293
+ fn: $((t) => [
294
+ d(e.$slots, "playhead", U(B(t)), void 0, !0)
295
+ ]),
296
+ key: "2"
297
+ } : void 0
298
+ ]), 1032, ["tracks", "duration", "current-time", "zoom", "fps", "snap-step", "selected-segment-id", "disable-interaction"]));
299
+ }
300
+ }), Te = /* @__PURE__ */ D(fe, [["__scopeId", "data-v-8004be28"]]);
301
+ export {
302
+ re as F,
303
+ de as S,
304
+ Te as V
305
+ };
package/dist/index.d.ts CHANGED
@@ -2,7 +2,11 @@ import { App } from 'vue';
2
2
  import { ComponentOptionsMixin } from 'vue';
3
3
  import { ComponentProvideOptions } from 'vue';
4
4
  import { DefineComponent } from 'vue';
5
+ import { I3DFramesSegment } from '@video-editor/shared';
6
+ import { IFramesSegmentUnion } from '@video-editor/shared';
7
+ import { IImageFramesSegment } from '@video-editor/shared';
5
8
  import { ITrackType } from '@video-editor/shared';
9
+ import { IVideoFramesSegment } from '@video-editor/shared';
6
10
  import { IVideoProtocol } from '@video-editor/shared';
7
11
  import { PublicProps } from 'vue';
8
12
  import { SegmentUnion } from '@video-editor/shared';
@@ -78,6 +82,8 @@ contentRef: HTMLDivElement;
78
82
  tracksRef: HTMLDivElement;
79
83
  }, HTMLDivElement>;
80
84
 
85
+ declare const __VLS_component_3: DefineComponent<__VLS_Props_3, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<__VLS_Props_3> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {}, HTMLDivElement>;
86
+
81
87
  declare type __VLS_Props = {
82
88
  protocol?: IVideoProtocol | null;
83
89
  currentTime: number;
@@ -105,6 +111,16 @@ declare type __VLS_Props_2 = {
105
111
  fps?: number;
106
112
  };
107
113
 
114
+ declare type __VLS_Props_3 = {
115
+ segment: IFramesSegmentUnion;
116
+ };
117
+
118
+ declare type __VLS_Props_4 = {
119
+ segment: SegmentUnion;
120
+ trackType: string;
121
+ accentColor?: string;
122
+ };
123
+
108
124
  declare function __VLS_template(): {
109
125
  attrs: Partial<{}>;
110
126
  slots: Partial<Record<NonNullable<"segment-filter" | "segment-audio" | "segment-text" | "segment-frames" | "segment-sticker" | "segment-effect">, (_: {
@@ -201,10 +217,52 @@ declare function __VLS_template_2(): {
201
217
  rootEl: HTMLDivElement;
202
218
  };
203
219
 
220
+ declare function __VLS_template_3(): {
221
+ attrs: Partial<{}>;
222
+ slots: {
223
+ image?(_: {
224
+ style: {
225
+ backgroundImage: string;
226
+ backgroundRepeat: string;
227
+ backgroundSize: string;
228
+ backgroundPosition: string;
229
+ };
230
+ segment: IImageFramesSegment;
231
+ }): any;
232
+ video?(_: {
233
+ segment: IVideoFramesSegment;
234
+ thumbnails: {
235
+ tsMs: number;
236
+ url: string;
237
+ }[];
238
+ }): any;
239
+ loading?(_: {
240
+ segment: IVideoFramesSegment;
241
+ }): any;
242
+ error?(_: {
243
+ segment: IVideoFramesSegment;
244
+ error: string;
245
+ }): any;
246
+ empty?(_: {
247
+ segment: IVideoFramesSegment;
248
+ }): any;
249
+ fallback?(_: {
250
+ segment: I3DFramesSegment;
251
+ }): any;
252
+ overlay?(_: {
253
+ segment: IFramesSegmentUnion;
254
+ }): any;
255
+ };
256
+ refs: {};
257
+ rootEl: HTMLDivElement;
258
+ };
259
+
204
260
  declare type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
205
261
 
206
262
  declare type __VLS_TemplateResult_2 = ReturnType<typeof __VLS_template_2>;
207
263
 
264
+ declare type __VLS_TemplateResult_3 = ReturnType<typeof __VLS_template_3>;
265
+
208
266
  declare type __VLS_WithTemplateSlots<T, S> = T & {
209
267
  new (): {
210
268
  $slots: S;
@@ -217,6 +275,12 @@ declare type __VLS_WithTemplateSlots_2<T, S> = T & {
217
275
  };
218
276
  };
219
277
 
278
+ declare type __VLS_WithTemplateSlots_3<T, S> = T & {
279
+ new (): {
280
+ $slots: S;
281
+ };
282
+ };
283
+
220
284
  declare const _default: {
221
285
  install(app: App): void;
222
286
  };
@@ -224,6 +288,12 @@ export default _default;
224
288
 
225
289
  declare function formatTime(ms: number): string;
226
290
 
291
+ export declare const FramesSegment: __VLS_WithTemplateSlots_3<typeof __VLS_component_3, __VLS_TemplateResult_3["slots"]>;
292
+
293
+ export declare const SegmentBase: DefineComponent<__VLS_Props_4, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<__VLS_Props_4> & Readonly<{}>, {
294
+ accentColor: string;
295
+ }, {}, {}, {}, string, ComponentProvideOptions, false, {}, HTMLDivElement>;
296
+
227
297
  export declare interface SegmentDragPayload {
228
298
  segment: TimelineSegment;
229
299
  track: TimelineTrack;
package/dist/index.js CHANGED
@@ -1,4 +1,5 @@
1
- import i from "./VideoEditorTimeline.js";
1
+ import { V as i } from "./index-BgON6Mut.js";
2
+ import { F as s, S as d } from "./index-BgON6Mut.js";
2
3
  import { V as o } from "./index-t1DKjcCO.js";
3
4
  const t = {
4
5
  install(e) {
@@ -6,6 +7,8 @@ const t = {
6
7
  }
7
8
  };
8
9
  export {
10
+ s as FramesSegment,
11
+ d as SegmentBase,
9
12
  i as VideoEditorTimeline,
10
13
  o as VideoTimeline,
11
14
  t as default
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.12",
4
+ "version": "0.0.1-beta.13",
5
5
  "exports": {
6
6
  ".": {
7
7
  "types": "./dist/index.d.ts",
@@ -20,8 +20,8 @@
20
20
  "vue": "^3.5.25"
21
21
  },
22
22
  "dependencies": {
23
- "@video-editor/protocol": "0.0.1-beta.12",
24
- "@video-editor/shared": "0.0.1-beta.12"
23
+ "@video-editor/protocol": "0.0.1-beta.13",
24
+ "@video-editor/shared": "0.0.1-beta.13"
25
25
  },
26
26
  "scripts": {
27
27
  "build": "vite build",