UMB_EMBEDDED_MEDIA_MODAL
This commit is contained in:
@@ -26,7 +26,7 @@ export type UmbEmbeddedMediaModalResult = {
|
||||
selection: OEmbedResult;
|
||||
};
|
||||
|
||||
export const UMB_EMBEDDED_MEDIA_MODAL_TOKEN = new UmbModalToken<UmbEmbeddedMediaModalData, UmbEmbeddedMediaModalResult>(
|
||||
export const UMB_EMBEDDED_MEDIA_MODAL = new UmbModalToken<UmbEmbeddedMediaModalData, UmbEmbeddedMediaModalResult>(
|
||||
'Umb.Modal.EmbeddedMedia',
|
||||
{
|
||||
type: 'sidebar',
|
||||
@@ -3,7 +3,12 @@ import { UUITextStyles } from '@umbraco-ui/uui-css/lib';
|
||||
import { customElement, property, state } from 'lit/decorators.js';
|
||||
import { when } from 'lit-html/directives/when.js';
|
||||
import { unsafeHTML } from 'lit-html/directives/unsafe-html.js';
|
||||
import { OEmbedResult, OEmbedStatus, UmbEmbeddedMediaModalData, UmbEmbeddedMediaModalResult } from '.';
|
||||
import {
|
||||
OEmbedResult,
|
||||
OEmbedStatus,
|
||||
UmbEmbeddedMediaModalData,
|
||||
UmbEmbeddedMediaModalResult,
|
||||
} from '../../../../../libs/modal/token/embedded-media-modal.token';
|
||||
import { umbracoPath } from '@umbraco-cms/backoffice/utils';
|
||||
import { UmbLitElement } from '@umbraco-cms/internal/lit-element';
|
||||
import { UmbModalHandler } from '@umbraco-cms/backoffice/modal';
|
||||
|
||||
@@ -3,7 +3,7 @@ import './embedded-media-modal.element';
|
||||
|
||||
import { Meta } from '@storybook/web-components';
|
||||
import { html } from 'lit';
|
||||
import { UmbEmbeddedMediaModalData } from '.';
|
||||
import { UmbEmbeddedMediaModalData } from '../../../../../libs/modal/token/embedded-media-modal.token';
|
||||
|
||||
export default {
|
||||
title: 'API/Modals/Layouts/Embedded Media',
|
||||
|
||||
@@ -1,17 +1,17 @@
|
||||
import { rest } from "msw";
|
||||
import { OEmbedResult, OEmbedStatus } from "../../../backoffice/shared/modals/embedded-media";
|
||||
import { umbracoPath } from "@umbraco-cms/backoffice/utils";
|
||||
import { rest } from 'msw';
|
||||
import { OEmbedResult, OEmbedStatus } from '../../../../libs/modal/token/embedded-media-modal.token';
|
||||
import { umbracoPath } from '@umbraco-cms/backoffice/utils';
|
||||
|
||||
export const handlers = [
|
||||
rest.get(umbracoPath('/rteembed'), (req, res, ctx) => {
|
||||
const width = req.url.searchParams.get('width') ?? 360;
|
||||
const height = req.url.searchParams.get('height') ?? 240;
|
||||
const response: OEmbedResult = {
|
||||
supportsDimensions: true,
|
||||
supportsDimensions: true,
|
||||
markup: `<iframe width="${width}" height="${height}" src="https://www.youtube.com/embed/wJNbtYdr-Hg?feature=oembed" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" allowfullscreen title="Sleep Token - The Summoning"></iframe>`,
|
||||
oEmbedStatus: OEmbedStatus.Success,
|
||||
oEmbedStatus: OEmbedStatus.Success,
|
||||
};
|
||||
|
||||
return res(ctx.status(200), ctx.json(response));
|
||||
}),
|
||||
];
|
||||
];
|
||||
|
||||
Reference in New Issue
Block a user