UMB_EMBEDDED_MEDIA_MODAL

This commit is contained in:
Niels Lyngsø
2023-03-23 21:44:27 +01:00
parent 99d430b650
commit 96e7c8f1fc
4 changed files with 14 additions and 9 deletions

View File

@@ -0,0 +1,35 @@
import { UmbModalToken } from '@umbraco-cms/backoffice/modal';
export enum OEmbedStatus {
NotSupported,
Error,
Success,
}
interface UmbEmbeddedMediaDimensions {
width?: number;
height?: number;
constrain?: boolean;
}
export interface UmbEmbeddedMediaModalData extends UmbEmbeddedMediaDimensions {
url?: string;
}
export interface OEmbedResult extends UmbEmbeddedMediaDimensions {
oEmbedStatus: OEmbedStatus;
supportsDimensions: boolean;
markup?: string;
}
export type UmbEmbeddedMediaModalResult = {
selection: OEmbedResult;
};
export const UMB_EMBEDDED_MEDIA_MODAL = new UmbModalToken<UmbEmbeddedMediaModalData, UmbEmbeddedMediaModalResult>(
'Umb.Modal.EmbeddedMedia',
{
type: 'sidebar',
size: 'small',
}
);