Add interstitial endpoints and enhance media and template functionalities: implement MapInterstitialEndpoints in Program.cs, add preview functionality for media assets in MediaEndpoints, and introduce template preview capabilities in TemplateEndpoints. Remove obsolete bumper settings from Channel and related classes to streamline configuration.
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
/**
|
||||
* Перетаскивание на экране роликов. В сборку блока едут только ролики, в группу — и ролики,
|
||||
* и готовые блоки, поэтому в переносимых данных лежит вид элемента, а не только идентификатор.
|
||||
*/
|
||||
export type ClipDragItem = {
|
||||
kind: 'clip' | 'block'
|
||||
id: string
|
||||
name: string
|
||||
seconds: number
|
||||
}
|
||||
|
||||
const MIME = 'application/x-telewave-clip'
|
||||
|
||||
export function setDragItem(event: React.DragEvent, item: ClipDragItem) {
|
||||
event.dataTransfer.setData(MIME, JSON.stringify(item))
|
||||
event.dataTransfer.effectAllowed = 'copy'
|
||||
}
|
||||
|
||||
export function readDragItem(event: React.DragEvent): ClipDragItem | null {
|
||||
const raw = event.dataTransfer.getData(MIME)
|
||||
if (!raw) return null
|
||||
try {
|
||||
return JSON.parse(raw) as ClipDragItem
|
||||
} catch {
|
||||
return null
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user