@r2digisolutions/components 0.2.0 → 0.3.0
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/components/atoms/Playhead/Playhead.svelte +44 -5
- package/dist/components/atoms/Playhead/Playhead.svelte.d.ts +8 -0
- package/dist/components/atoms/TimeRuler/TimeRuler.svelte +75 -16
- package/dist/components/atoms/TimeRuler/TimeRuler.svelte.d.ts +7 -0
- package/dist/components/atoms/TimelineGrid/TimelineGrid.stories.js +8 -0
- package/dist/components/atoms/TimelineGrid/TimelineGrid.svelte +39 -0
- package/dist/components/atoms/TimelineGrid/TimelineGrid.svelte.d.ts +11 -0
- package/dist/components/atoms/TimelineGrid/TimelineGridStory.svelte +7 -0
- package/dist/components/atoms/TimelineGrid/TimelineGridStory.svelte.d.ts +18 -0
- package/dist/components/molecules/ColorPicker/ColorPicker.svelte +45 -4
- package/dist/components/molecules/ColorPicker/ColorPicker.svelte.d.ts +2 -0
- package/dist/components/molecules/ContextMenu/ContextMenu.svelte +38 -11
- package/dist/components/molecules/MediaAssetBrowser/MediaAssetBrowser.svelte +17 -2
- package/dist/components/molecules/MediaAssetBrowser/MediaAssetBrowser.svelte.d.ts +5 -0
- package/dist/components/molecules/MediaTimeline/MediaTimeline.svelte +362 -52
- package/dist/components/molecules/MediaTimeline/MediaTimeline.svelte.d.ts +22 -2
- package/dist/components/molecules/PdfViewer/PdfViewer.svelte.d.ts +1 -1
- package/dist/components/molecules/ProgramMonitor/ProgramMonitor.svelte +751 -29
- package/dist/components/molecules/ProgramMonitor/ProgramMonitor.svelte.d.ts +14 -1
- package/dist/components/molecules/SplitPane/SplitPane.svelte +2 -2
- package/dist/components/molecules/TimelineClip/TimelineClip.svelte +95 -18
- package/dist/components/molecules/TimelineClip/TimelineClip.svelte.d.ts +3 -0
- package/dist/components/molecules/TimelineTrack/TimelineTrack.svelte +82 -12
- package/dist/components/molecules/TimelineTrack/TimelineTrack.svelte.d.ts +13 -2
- package/dist/components/molecules/TransportControls/TransportControls.svelte +84 -2
- package/dist/components/molecules/TransportControls/TransportControls.svelte.d.ts +13 -1
- package/dist/components/molecules/TransportControls/TransportControlsStory.svelte +33 -11
- package/dist/components/molecules/VideoAnimationsPanel/VideoAnimationsPanel.stories.js +8 -0
- package/dist/components/molecules/VideoAnimationsPanel/VideoAnimationsPanel.svelte +213 -0
- package/dist/components/molecules/VideoAnimationsPanel/VideoAnimationsPanel.svelte.d.ts +22 -0
- package/dist/components/molecules/VideoAnimationsPanel/VideoAnimationsPanelStory.svelte +7 -0
- package/dist/components/molecules/VideoAnimationsPanel/VideoAnimationsPanelStory.svelte.d.ts +18 -0
- package/dist/components/molecules/VideoComponentsPanel/VideoComponentsPanel.stories.js +8 -0
- package/dist/components/molecules/VideoComponentsPanel/VideoComponentsPanel.svelte +524 -0
- package/dist/components/molecules/VideoComponentsPanel/VideoComponentsPanel.svelte.d.ts +32 -0
- package/dist/components/molecules/VideoComponentsPanel/VideoComponentsPanelStory.svelte +7 -0
- package/dist/components/molecules/VideoComponentsPanel/VideoComponentsPanelStory.svelte.d.ts +18 -0
- package/dist/components/molecules/VideoTrackHeader/VideoTrackHeader.svelte +85 -32
- package/dist/components/molecules/VideoTrackHeader/VideoTrackHeader.svelte.d.ts +6 -0
- package/dist/components/molecules/VideoTransitionsPanel/VideoTransitionsPanel.stories.js +8 -0
- package/dist/components/molecules/VideoTransitionsPanel/VideoTransitionsPanel.svelte +113 -0
- package/dist/components/molecules/VideoTransitionsPanel/VideoTransitionsPanel.svelte.d.ts +18 -0
- package/dist/components/molecules/VideoTransitionsPanel/VideoTransitionsPanelStory.svelte +7 -0
- package/dist/components/molecules/VideoTransitionsPanel/VideoTransitionsPanelStory.svelte.d.ts +18 -0
- package/dist/components/organisms/AudioEditor/AudioEditor.svelte +52 -1
- package/dist/components/organisms/EditorShell/EditorShell.svelte +102 -92
- package/dist/components/organisms/FileUploader/FileUploader.stories.d.ts +10 -0
- package/dist/components/organisms/FileUploader/FileUploader.stories.js +21 -0
- package/dist/components/organisms/FileUploader/FileUploader.svelte +61 -21
- package/dist/components/organisms/FileUploader/FileUploader.svelte.d.ts +9 -0
- package/dist/components/organisms/FileUploader/FileUploaderStory.svelte +7 -1
- package/dist/components/organisms/FileUploader/FileUploaderStory.svelte.d.ts +3 -0
- package/dist/components/organisms/VideoEditor/VideoEditor.svelte +1457 -78
- package/dist/components/organisms/VideoEditor/VideoEditor.svelte.d.ts +2 -1
- package/dist/components/organisms/VideoEditor/VideoEditorStory.svelte +3 -2
- package/dist/index.d.ts +11 -3
- package/dist/index.js +6 -2
- package/dist/utils/mediaTime.d.ts +14 -4
- package/dist/utils/mediaTime.js +27 -8
- package/dist/utils/mediaTracks.d.ts +154 -0
- package/dist/utils/mediaTracks.js +697 -1
- package/dist/utils/videoSequence.js +35 -4
- package/package.json +1 -1
|
@@ -0,0 +1,524 @@
|
|
|
1
|
+
<script lang="ts" module>
|
|
2
|
+
export type VideoComponentKind = 'text' | 'image' | 'solid';
|
|
3
|
+
|
|
4
|
+
export type VideoComponentRectPreset =
|
|
5
|
+
| 'center'
|
|
6
|
+
| 'lower-third'
|
|
7
|
+
| 'top'
|
|
8
|
+
| 'watermark'
|
|
9
|
+
| 'full'
|
|
10
|
+
| 'badge'
|
|
11
|
+
| 'ticker'
|
|
12
|
+
| 'side';
|
|
13
|
+
|
|
14
|
+
export interface VideoComponentDef {
|
|
15
|
+
id: string;
|
|
16
|
+
label: string;
|
|
17
|
+
group: string;
|
|
18
|
+
glyph?: string;
|
|
19
|
+
kind: VideoComponentKind;
|
|
20
|
+
text?: string;
|
|
21
|
+
durationMs: number;
|
|
22
|
+
color?: string;
|
|
23
|
+
textColor?: string;
|
|
24
|
+
fontSize?: number;
|
|
25
|
+
fontWeight?: number | string;
|
|
26
|
+
fontFamily?: string;
|
|
27
|
+
/** @deprecated use previewOpacity — kept for catalog entries */
|
|
28
|
+
opacity?: number;
|
|
29
|
+
/** Program monitor opacity when added */
|
|
30
|
+
previewOpacity?: number;
|
|
31
|
+
src?: string;
|
|
32
|
+
textAlign?: 'left' | 'center' | 'right';
|
|
33
|
+
/** Default placement on the program frame */
|
|
34
|
+
rectPreset?: VideoComponentRectPreset;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export const VIDEO_COMPONENT_MIME = 'application/x-r2-video-component';
|
|
38
|
+
</script>
|
|
39
|
+
|
|
40
|
+
<script lang="ts">
|
|
41
|
+
interface VideoComponentsPanelProps {
|
|
42
|
+
class?: string;
|
|
43
|
+
onadd?: (def: VideoComponentDef) => void;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
let { class: className = '', onadd }: VideoComponentsPanelProps = $props();
|
|
47
|
+
|
|
48
|
+
const components: VideoComponentDef[] = [
|
|
49
|
+
/* —— Text —— */
|
|
50
|
+
{
|
|
51
|
+
id: 'heading',
|
|
52
|
+
label: 'Heading',
|
|
53
|
+
group: 'Text',
|
|
54
|
+
glyph: 'H',
|
|
55
|
+
kind: 'text',
|
|
56
|
+
text: 'Add a heading',
|
|
57
|
+
durationMs: 4000,
|
|
58
|
+
color: '#6366f1',
|
|
59
|
+
fontSize: 56,
|
|
60
|
+
fontWeight: 700,
|
|
61
|
+
textColor: '#ffffff',
|
|
62
|
+
rectPreset: 'top'
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
id: 'title',
|
|
66
|
+
label: 'Title',
|
|
67
|
+
group: 'Text',
|
|
68
|
+
glyph: 'T',
|
|
69
|
+
kind: 'text',
|
|
70
|
+
text: 'Title',
|
|
71
|
+
durationMs: 4000,
|
|
72
|
+
color: '#6366f1',
|
|
73
|
+
fontSize: 42,
|
|
74
|
+
fontWeight: 700,
|
|
75
|
+
textColor: '#ffffff',
|
|
76
|
+
rectPreset: 'center'
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
id: 'subtitle',
|
|
80
|
+
label: 'Subtitle',
|
|
81
|
+
group: 'Text',
|
|
82
|
+
glyph: 'S',
|
|
83
|
+
kind: 'text',
|
|
84
|
+
text: 'Subtitle',
|
|
85
|
+
durationMs: 4000,
|
|
86
|
+
color: '#8b5cf6',
|
|
87
|
+
fontSize: 28,
|
|
88
|
+
fontWeight: 600,
|
|
89
|
+
textColor: '#e2e8f0',
|
|
90
|
+
rectPreset: 'center'
|
|
91
|
+
},
|
|
92
|
+
{
|
|
93
|
+
id: 'body',
|
|
94
|
+
label: 'Body',
|
|
95
|
+
group: 'Text',
|
|
96
|
+
glyph: 'B',
|
|
97
|
+
kind: 'text',
|
|
98
|
+
text: 'Body text for the scene',
|
|
99
|
+
durationMs: 5000,
|
|
100
|
+
color: '#64748b',
|
|
101
|
+
fontSize: 18,
|
|
102
|
+
fontWeight: 400,
|
|
103
|
+
textColor: '#f8fafc',
|
|
104
|
+
rectPreset: 'center'
|
|
105
|
+
},
|
|
106
|
+
{
|
|
107
|
+
id: 'caption',
|
|
108
|
+
label: 'Caption',
|
|
109
|
+
group: 'Text',
|
|
110
|
+
glyph: 'Cc',
|
|
111
|
+
kind: 'text',
|
|
112
|
+
text: 'Caption text',
|
|
113
|
+
durationMs: 3000,
|
|
114
|
+
color: '#14b8a6',
|
|
115
|
+
fontSize: 16,
|
|
116
|
+
fontWeight: 500,
|
|
117
|
+
textColor: '#ffffff',
|
|
118
|
+
rectPreset: 'lower-third'
|
|
119
|
+
},
|
|
120
|
+
{
|
|
121
|
+
id: 'quote',
|
|
122
|
+
label: 'Quote',
|
|
123
|
+
group: 'Text',
|
|
124
|
+
glyph: '“',
|
|
125
|
+
kind: 'text',
|
|
126
|
+
text: '“A short quote”',
|
|
127
|
+
durationMs: 5000,
|
|
128
|
+
color: '#a78bfa',
|
|
129
|
+
fontSize: 28,
|
|
130
|
+
fontWeight: 500,
|
|
131
|
+
textColor: '#faf5ff',
|
|
132
|
+
rectPreset: 'center'
|
|
133
|
+
},
|
|
134
|
+
{
|
|
135
|
+
id: 'code',
|
|
136
|
+
label: 'Code',
|
|
137
|
+
group: 'Text',
|
|
138
|
+
glyph: '</>',
|
|
139
|
+
kind: 'text',
|
|
140
|
+
text: 'const x = 1;',
|
|
141
|
+
durationMs: 4000,
|
|
142
|
+
color: '#0f172a',
|
|
143
|
+
fontSize: 16,
|
|
144
|
+
fontWeight: 500,
|
|
145
|
+
fontFamily: 'ui-monospace, SFMono-Regular, Menlo, monospace',
|
|
146
|
+
textColor: '#e2e8f0',
|
|
147
|
+
rectPreset: 'center'
|
|
148
|
+
},
|
|
149
|
+
{
|
|
150
|
+
id: 'bullet',
|
|
151
|
+
label: 'Bullets',
|
|
152
|
+
group: 'Text',
|
|
153
|
+
glyph: '•',
|
|
154
|
+
kind: 'text',
|
|
155
|
+
text: '• Point one\n• Point two\n• Point three',
|
|
156
|
+
durationMs: 5000,
|
|
157
|
+
color: '#38bdf8',
|
|
158
|
+
fontSize: 22,
|
|
159
|
+
fontWeight: 500,
|
|
160
|
+
textColor: '#f0f9ff',
|
|
161
|
+
textAlign: 'left',
|
|
162
|
+
rectPreset: 'center'
|
|
163
|
+
},
|
|
164
|
+
|
|
165
|
+
/* —— Overlays —— */
|
|
166
|
+
{
|
|
167
|
+
id: 'lower-third',
|
|
168
|
+
label: 'Lower third',
|
|
169
|
+
group: 'Overlays',
|
|
170
|
+
glyph: 'LT',
|
|
171
|
+
kind: 'text',
|
|
172
|
+
text: 'Name · Role',
|
|
173
|
+
durationMs: 5000,
|
|
174
|
+
color: '#0ea5e9',
|
|
175
|
+
fontSize: 22,
|
|
176
|
+
fontWeight: 600,
|
|
177
|
+
textColor: '#ffffff',
|
|
178
|
+
rectPreset: 'lower-third'
|
|
179
|
+
},
|
|
180
|
+
{
|
|
181
|
+
id: 'name-plate',
|
|
182
|
+
label: 'Name plate',
|
|
183
|
+
group: 'Overlays',
|
|
184
|
+
glyph: 'NP',
|
|
185
|
+
kind: 'text',
|
|
186
|
+
text: 'Jane Doe',
|
|
187
|
+
durationMs: 5000,
|
|
188
|
+
color: '#0284c7',
|
|
189
|
+
fontSize: 20,
|
|
190
|
+
fontWeight: 700,
|
|
191
|
+
textColor: '#ffffff',
|
|
192
|
+
rectPreset: 'lower-third'
|
|
193
|
+
},
|
|
194
|
+
{
|
|
195
|
+
id: 'end-card',
|
|
196
|
+
label: 'End card',
|
|
197
|
+
group: 'Overlays',
|
|
198
|
+
glyph: 'End',
|
|
199
|
+
kind: 'text',
|
|
200
|
+
text: 'Thanks for watching',
|
|
201
|
+
durationMs: 5000,
|
|
202
|
+
color: '#f59e0b',
|
|
203
|
+
fontSize: 36,
|
|
204
|
+
fontWeight: 700,
|
|
205
|
+
textColor: '#ffffff',
|
|
206
|
+
rectPreset: 'center'
|
|
207
|
+
},
|
|
208
|
+
{
|
|
209
|
+
id: 'watermark',
|
|
210
|
+
label: 'Watermark',
|
|
211
|
+
group: 'Overlays',
|
|
212
|
+
glyph: '©',
|
|
213
|
+
kind: 'text',
|
|
214
|
+
text: '© Brand',
|
|
215
|
+
durationMs: 10_000,
|
|
216
|
+
color: '#64748b',
|
|
217
|
+
fontSize: 14,
|
|
218
|
+
previewOpacity: 0.55,
|
|
219
|
+
textColor: '#ffffff',
|
|
220
|
+
rectPreset: 'watermark'
|
|
221
|
+
},
|
|
222
|
+
{
|
|
223
|
+
id: 'countdown',
|
|
224
|
+
label: 'Countdown',
|
|
225
|
+
group: 'Overlays',
|
|
226
|
+
glyph: '3',
|
|
227
|
+
kind: 'text',
|
|
228
|
+
text: '3',
|
|
229
|
+
durationMs: 3000,
|
|
230
|
+
color: '#ef4444',
|
|
231
|
+
fontSize: 96,
|
|
232
|
+
fontWeight: 800,
|
|
233
|
+
textColor: '#ffffff',
|
|
234
|
+
rectPreset: 'center'
|
|
235
|
+
},
|
|
236
|
+
{
|
|
237
|
+
id: 'chapter',
|
|
238
|
+
label: 'Chapter',
|
|
239
|
+
group: 'Overlays',
|
|
240
|
+
glyph: 'Ch',
|
|
241
|
+
kind: 'text',
|
|
242
|
+
text: 'Chapter 1',
|
|
243
|
+
durationMs: 2500,
|
|
244
|
+
color: '#22d3ee',
|
|
245
|
+
fontSize: 32,
|
|
246
|
+
fontWeight: 700,
|
|
247
|
+
textColor: '#ecfeff',
|
|
248
|
+
rectPreset: 'top'
|
|
249
|
+
},
|
|
250
|
+
{
|
|
251
|
+
id: 'location',
|
|
252
|
+
label: 'Location',
|
|
253
|
+
group: 'Overlays',
|
|
254
|
+
glyph: 'Loc',
|
|
255
|
+
kind: 'text',
|
|
256
|
+
text: 'Madrid, ES',
|
|
257
|
+
durationMs: 4000,
|
|
258
|
+
color: '#84cc16',
|
|
259
|
+
fontSize: 18,
|
|
260
|
+
fontWeight: 600,
|
|
261
|
+
textColor: '#ffffff',
|
|
262
|
+
rectPreset: 'badge'
|
|
263
|
+
},
|
|
264
|
+
{
|
|
265
|
+
id: 'live-badge',
|
|
266
|
+
label: 'Live',
|
|
267
|
+
group: 'Overlays',
|
|
268
|
+
glyph: '●',
|
|
269
|
+
kind: 'text',
|
|
270
|
+
text: 'LIVE',
|
|
271
|
+
durationMs: 10_000,
|
|
272
|
+
color: '#dc2626',
|
|
273
|
+
fontSize: 16,
|
|
274
|
+
fontWeight: 800,
|
|
275
|
+
textColor: '#ffffff',
|
|
276
|
+
rectPreset: 'badge'
|
|
277
|
+
},
|
|
278
|
+
{
|
|
279
|
+
id: 'ticker',
|
|
280
|
+
label: 'Ticker',
|
|
281
|
+
group: 'Overlays',
|
|
282
|
+
glyph: '…',
|
|
283
|
+
kind: 'text',
|
|
284
|
+
text: 'Breaking · Latest update scrolls here',
|
|
285
|
+
durationMs: 8000,
|
|
286
|
+
color: '#1e293b',
|
|
287
|
+
fontSize: 16,
|
|
288
|
+
fontWeight: 600,
|
|
289
|
+
textColor: '#f8fafc',
|
|
290
|
+
textAlign: 'left',
|
|
291
|
+
rectPreset: 'ticker'
|
|
292
|
+
},
|
|
293
|
+
{
|
|
294
|
+
id: 'callout',
|
|
295
|
+
label: 'Callout',
|
|
296
|
+
group: 'Overlays',
|
|
297
|
+
glyph: '!',
|
|
298
|
+
kind: 'text',
|
|
299
|
+
text: 'Key takeaway',
|
|
300
|
+
durationMs: 4000,
|
|
301
|
+
color: '#f97316',
|
|
302
|
+
fontSize: 24,
|
|
303
|
+
fontWeight: 700,
|
|
304
|
+
textColor: '#fff7ed',
|
|
305
|
+
rectPreset: 'center'
|
|
306
|
+
},
|
|
307
|
+
|
|
308
|
+
/* —— Solids / plates —— */
|
|
309
|
+
{
|
|
310
|
+
id: 'solid-black',
|
|
311
|
+
label: 'Black',
|
|
312
|
+
group: 'Solids',
|
|
313
|
+
glyph: '■',
|
|
314
|
+
kind: 'solid',
|
|
315
|
+
durationMs: 2000,
|
|
316
|
+
color: '#000000',
|
|
317
|
+
textColor: '#000000',
|
|
318
|
+
rectPreset: 'full'
|
|
319
|
+
},
|
|
320
|
+
{
|
|
321
|
+
id: 'solid-white',
|
|
322
|
+
label: 'White',
|
|
323
|
+
group: 'Solids',
|
|
324
|
+
glyph: '□',
|
|
325
|
+
kind: 'solid',
|
|
326
|
+
durationMs: 2000,
|
|
327
|
+
color: '#ffffff',
|
|
328
|
+
textColor: '#ffffff',
|
|
329
|
+
rectPreset: 'full'
|
|
330
|
+
},
|
|
331
|
+
{
|
|
332
|
+
id: 'solid-brand',
|
|
333
|
+
label: 'Brand',
|
|
334
|
+
group: 'Solids',
|
|
335
|
+
glyph: '■',
|
|
336
|
+
kind: 'solid',
|
|
337
|
+
durationMs: 2000,
|
|
338
|
+
color: '#2563eb',
|
|
339
|
+
rectPreset: 'full'
|
|
340
|
+
},
|
|
341
|
+
{
|
|
342
|
+
id: 'vignette',
|
|
343
|
+
label: 'Vignette',
|
|
344
|
+
group: 'Solids',
|
|
345
|
+
glyph: '◎',
|
|
346
|
+
kind: 'solid',
|
|
347
|
+
durationMs: 5000,
|
|
348
|
+
color: '#000000',
|
|
349
|
+
previewOpacity: 0.45,
|
|
350
|
+
rectPreset: 'full'
|
|
351
|
+
},
|
|
352
|
+
{
|
|
353
|
+
id: 'color-bars',
|
|
354
|
+
label: 'Color bars',
|
|
355
|
+
group: 'Solids',
|
|
356
|
+
glyph: '▦',
|
|
357
|
+
kind: 'image',
|
|
358
|
+
durationMs: 3000,
|
|
359
|
+
color: '#f97316',
|
|
360
|
+
src: 'https://picsum.photos/seed/colorbar/1280/720',
|
|
361
|
+
rectPreset: 'full'
|
|
362
|
+
},
|
|
363
|
+
{
|
|
364
|
+
id: 'slate',
|
|
365
|
+
label: 'Slate',
|
|
366
|
+
group: 'Solids',
|
|
367
|
+
glyph: 'Sl',
|
|
368
|
+
kind: 'text',
|
|
369
|
+
text: 'SCENE 01 · TAKE 01',
|
|
370
|
+
durationMs: 3000,
|
|
371
|
+
color: '#1e293b',
|
|
372
|
+
fontSize: 28,
|
|
373
|
+
fontWeight: 700,
|
|
374
|
+
textColor: '#f8fafc',
|
|
375
|
+
rectPreset: 'center'
|
|
376
|
+
},
|
|
377
|
+
{
|
|
378
|
+
id: 'bar-left',
|
|
379
|
+
label: 'Side bar',
|
|
380
|
+
group: 'Solids',
|
|
381
|
+
glyph: '▌',
|
|
382
|
+
kind: 'solid',
|
|
383
|
+
durationMs: 5000,
|
|
384
|
+
color: '#0f172a',
|
|
385
|
+
previewOpacity: 0.85,
|
|
386
|
+
rectPreset: 'side'
|
|
387
|
+
},
|
|
388
|
+
{
|
|
389
|
+
id: 'matte',
|
|
390
|
+
label: 'Matte',
|
|
391
|
+
group: 'Solids',
|
|
392
|
+
glyph: '▣',
|
|
393
|
+
kind: 'solid',
|
|
394
|
+
durationMs: 5000,
|
|
395
|
+
color: '#111827',
|
|
396
|
+
previewOpacity: 0.7,
|
|
397
|
+
rectPreset: 'full'
|
|
398
|
+
},
|
|
399
|
+
|
|
400
|
+
/* —— Shapes / accents —— */
|
|
401
|
+
{
|
|
402
|
+
id: 'pill-label',
|
|
403
|
+
label: 'Pill',
|
|
404
|
+
group: 'Shapes',
|
|
405
|
+
glyph: '◯',
|
|
406
|
+
kind: 'text',
|
|
407
|
+
text: 'NEW',
|
|
408
|
+
durationMs: 4000,
|
|
409
|
+
color: '#22c55e',
|
|
410
|
+
fontSize: 14,
|
|
411
|
+
fontWeight: 800,
|
|
412
|
+
textColor: '#052e16',
|
|
413
|
+
rectPreset: 'badge'
|
|
414
|
+
},
|
|
415
|
+
{
|
|
416
|
+
id: 'callout',
|
|
417
|
+
label: 'Callout',
|
|
418
|
+
group: 'Shapes',
|
|
419
|
+
glyph: '!',
|
|
420
|
+
kind: 'text',
|
|
421
|
+
text: 'Look here',
|
|
422
|
+
durationMs: 3500,
|
|
423
|
+
color: '#f97316',
|
|
424
|
+
fontSize: 20,
|
|
425
|
+
fontWeight: 700,
|
|
426
|
+
textColor: '#fff7ed',
|
|
427
|
+
rectPreset: 'side'
|
|
428
|
+
},
|
|
429
|
+
{
|
|
430
|
+
id: 'sticker-star',
|
|
431
|
+
label: 'Star',
|
|
432
|
+
group: 'Shapes',
|
|
433
|
+
glyph: '★',
|
|
434
|
+
kind: 'text',
|
|
435
|
+
text: '★',
|
|
436
|
+
durationMs: 3000,
|
|
437
|
+
color: '#eab308',
|
|
438
|
+
fontSize: 72,
|
|
439
|
+
fontWeight: 700,
|
|
440
|
+
textColor: '#fef08a',
|
|
441
|
+
rectPreset: 'center'
|
|
442
|
+
},
|
|
443
|
+
{
|
|
444
|
+
id: 'emoji-react',
|
|
445
|
+
label: 'React',
|
|
446
|
+
group: 'Shapes',
|
|
447
|
+
glyph: '🔥',
|
|
448
|
+
kind: 'text',
|
|
449
|
+
text: '🔥',
|
|
450
|
+
durationMs: 2500,
|
|
451
|
+
color: '#ef4444',
|
|
452
|
+
fontSize: 64,
|
|
453
|
+
fontWeight: 700,
|
|
454
|
+
textColor: '#ffffff',
|
|
455
|
+
rectPreset: 'badge'
|
|
456
|
+
},
|
|
457
|
+
{
|
|
458
|
+
id: 'progress-bar',
|
|
459
|
+
label: 'Bar',
|
|
460
|
+
group: 'Shapes',
|
|
461
|
+
glyph: '▬',
|
|
462
|
+
kind: 'solid',
|
|
463
|
+
durationMs: 5000,
|
|
464
|
+
color: '#3b82f6',
|
|
465
|
+
previewOpacity: 0.9,
|
|
466
|
+
rectPreset: 'ticker'
|
|
467
|
+
},
|
|
468
|
+
{
|
|
469
|
+
id: 'vignette',
|
|
470
|
+
label: 'Vignette',
|
|
471
|
+
group: 'Shapes',
|
|
472
|
+
glyph: '◎',
|
|
473
|
+
kind: 'solid',
|
|
474
|
+
durationMs: 8000,
|
|
475
|
+
color: '#000000',
|
|
476
|
+
previewOpacity: 0.35,
|
|
477
|
+
rectPreset: 'full'
|
|
478
|
+
}
|
|
479
|
+
];
|
|
480
|
+
|
|
481
|
+
const groups = $derived(
|
|
482
|
+
[...new Set(components.map((c) => c.group))].map((group) => ({
|
|
483
|
+
group,
|
|
484
|
+
items: components.filter((c) => c.group === group)
|
|
485
|
+
}))
|
|
486
|
+
);
|
|
487
|
+
|
|
488
|
+
function onDragStart(e: DragEvent, item: VideoComponentDef) {
|
|
489
|
+
e.dataTransfer?.setData(VIDEO_COMPONENT_MIME, JSON.stringify(item));
|
|
490
|
+
e.dataTransfer?.setData('text/plain', item.label);
|
|
491
|
+
if (e.dataTransfer) e.dataTransfer.effectAllowed = 'copy';
|
|
492
|
+
}
|
|
493
|
+
</script>
|
|
494
|
+
|
|
495
|
+
<div class={['flex flex-col gap-4 p-2', className]}>
|
|
496
|
+
<p class="px-1 text-[10px] leading-relaxed text-muted">
|
|
497
|
+
Click to add on a new track, or drag onto the timeline.
|
|
498
|
+
</p>
|
|
499
|
+
{#each groups as { group, items } (group)}
|
|
500
|
+
<section class="flex flex-col gap-2">
|
|
501
|
+
<h3 class="px-1 text-[10px] font-semibold uppercase tracking-wide text-muted">{group}</h3>
|
|
502
|
+
<div class="grid grid-cols-3 gap-1.5">
|
|
503
|
+
{#each items as item (item.id)}
|
|
504
|
+
<button
|
|
505
|
+
type="button"
|
|
506
|
+
draggable="true"
|
|
507
|
+
ondragstart={(e) => onDragStart(e, item)}
|
|
508
|
+
class="flex cursor-grab flex-col items-center gap-1.5 rounded-lg border border-border bg-surface-elevated px-1.5 py-2 text-center transition-colors hover:border-brand-500/50 hover:bg-surface-overlay active:cursor-grabbing"
|
|
509
|
+
onclick={() => onadd?.(item)}
|
|
510
|
+
>
|
|
511
|
+
<span
|
|
512
|
+
class="flex h-9 w-full items-center justify-center rounded-md bg-surface text-xs font-semibold text-secondary"
|
|
513
|
+
style:color={item.color}
|
|
514
|
+
style:background={item.kind === 'solid' ? item.color : undefined}
|
|
515
|
+
>
|
|
516
|
+
{item.glyph ?? item.label.slice(0, 2)}
|
|
517
|
+
</span>
|
|
518
|
+
<span class="text-[10px] font-medium text-secondary">{item.label}</span>
|
|
519
|
+
</button>
|
|
520
|
+
{/each}
|
|
521
|
+
</div>
|
|
522
|
+
</section>
|
|
523
|
+
{/each}
|
|
524
|
+
</div>
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
export type VideoComponentKind = 'text' | 'image' | 'solid';
|
|
2
|
+
export type VideoComponentRectPreset = 'center' | 'lower-third' | 'top' | 'watermark' | 'full' | 'badge' | 'ticker' | 'side';
|
|
3
|
+
export interface VideoComponentDef {
|
|
4
|
+
id: string;
|
|
5
|
+
label: string;
|
|
6
|
+
group: string;
|
|
7
|
+
glyph?: string;
|
|
8
|
+
kind: VideoComponentKind;
|
|
9
|
+
text?: string;
|
|
10
|
+
durationMs: number;
|
|
11
|
+
color?: string;
|
|
12
|
+
textColor?: string;
|
|
13
|
+
fontSize?: number;
|
|
14
|
+
fontWeight?: number | string;
|
|
15
|
+
fontFamily?: string;
|
|
16
|
+
/** @deprecated use previewOpacity — kept for catalog entries */
|
|
17
|
+
opacity?: number;
|
|
18
|
+
/** Program monitor opacity when added */
|
|
19
|
+
previewOpacity?: number;
|
|
20
|
+
src?: string;
|
|
21
|
+
textAlign?: 'left' | 'center' | 'right';
|
|
22
|
+
/** Default placement on the program frame */
|
|
23
|
+
rectPreset?: VideoComponentRectPreset;
|
|
24
|
+
}
|
|
25
|
+
export declare const VIDEO_COMPONENT_MIME = "application/x-r2-video-component";
|
|
26
|
+
interface VideoComponentsPanelProps {
|
|
27
|
+
class?: string;
|
|
28
|
+
onadd?: (def: VideoComponentDef) => void;
|
|
29
|
+
}
|
|
30
|
+
declare const VideoComponentsPanel: import("svelte").Component<VideoComponentsPanelProps, {}, "">;
|
|
31
|
+
type VideoComponentsPanel = ReturnType<typeof VideoComponentsPanel>;
|
|
32
|
+
export default VideoComponentsPanel;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
|
|
2
|
+
new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
|
|
3
|
+
$$bindings?: Bindings;
|
|
4
|
+
} & Exports;
|
|
5
|
+
(internal: unknown, props: {
|
|
6
|
+
$$events?: Events;
|
|
7
|
+
$$slots?: Slots;
|
|
8
|
+
}): Exports & {
|
|
9
|
+
$set?: any;
|
|
10
|
+
$on?: any;
|
|
11
|
+
};
|
|
12
|
+
z_$$bindings?: Bindings;
|
|
13
|
+
}
|
|
14
|
+
declare const VideoComponentsPanelStory: $$__sveltets_2_IsomorphicComponent<Record<string, never>, {
|
|
15
|
+
[evt: string]: CustomEvent<any>;
|
|
16
|
+
}, {}, {}, string>;
|
|
17
|
+
type VideoComponentsPanelStory = InstanceType<typeof VideoComponentsPanelStory>;
|
|
18
|
+
export default VideoComponentsPanelStory;
|