X-Git-Url: http://source.bookstackapp.com/bookstack/blobdiff_plain/a62d8381be1b5736b625f516c303b84c8a64c47a..refs/pull/5689/head:/resources/js/wysiwyg/ui/index.ts diff --git a/resources/js/wysiwyg/ui/index.ts b/resources/js/wysiwyg/ui/index.ts index 3811f44b9..e7ec6adbc 100644 --- a/resources/js/wysiwyg/ui/index.ts +++ b/resources/js/wysiwyg/ui/index.ts @@ -1,10 +1,10 @@ import {LexicalEditor} from "lexical"; import { - getCodeToolbarContent, + getCodeToolbarContent, getDetailsToolbarContent, getImageToolbarContent, getLinkToolbarContent, - getMainEditorFullToolbar, getTableToolbarContent -} from "./toolbars"; + getMainEditorFullToolbar, getMediaToolbarContent, getTableToolbarContent +} from "./defaults/toolbars"; import {EditorUIManager} from "./framework/manager"; import {EditorUiContext} from "./framework/core"; import {CodeBlockDecorator} from "./decorators/code-block"; @@ -44,6 +44,10 @@ export function buildEditorUI(container: HTMLElement, element: HTMLElement, scro selector: 'img:not([drawio-diagram] img)', content: getImageToolbarContent(), }); + manager.registerContextToolbar('media', { + selector: '.editor-media-wrap', + content: getMediaToolbarContent(), + }); manager.registerContextToolbar('link', { selector: 'a', content: getLinkToolbarContent(), @@ -56,7 +60,6 @@ export function buildEditorUI(container: HTMLElement, element: HTMLElement, scro selector: '.editor-code-block-wrap', content: getCodeToolbarContent(), }); - manager.registerContextToolbar('table', { selector: 'td,th', content: getTableToolbarContent(), @@ -64,6 +67,10 @@ export function buildEditorUI(container: HTMLElement, element: HTMLElement, scro return originalTarget.closest('table') as HTMLTableElement; } }); + manager.registerContextToolbar('details', { + selector: 'details', + content: getDetailsToolbarContent(), + }); // Register image decorator listener manager.registerDecoratorType('code', CodeBlockDecorator);