diff --git a/src/components/block/index.ts b/src/components/block/index.ts index aed0076c..cd4d79b7 100644 --- a/src/components/block/index.ts +++ b/src/components/block/index.ts @@ -643,34 +643,6 @@ export default class Block extends EventsDispatcher { return isValid; } - /** - * Returns rendered custom block tunes - */ - public getTunesRendered(): DocumentFragment { - const tunesElement = document.createDocumentFragment(); - - // this.tunesInstances.forEach((tune) => { - // $.append(tunesElement, tune.render()); - // }); - - return tunesElement; - } - - /** - * Returns list of tunes available for block in popover format - */ - public getTunesList(): PopoverItem[] { - const customTunesInstances = Array.from(this.tunesInstances.values()); - const defaultTunesInstances = Array.from(this.defaultTunesInstances.values()); - const tunesDefinedInTool = [ this.toolInstance.render() ].flat(); - - const otherTunes = customTunesInstances.concat(defaultTunesInstances) - .map(tune => tune.render()) - .filter(item => !!item); - - return tunesDefinedInTool.concat(otherTunes).filter(item => !item.isActive); - } - /** * Returns data to render in tunes menu. * Splits block tunes settings into 2 groups: popover items and custom html. @@ -688,7 +660,9 @@ export default class Block extends EventsDispatcher { const otherTunes = customTunesInstances.concat(defaultTunesInstances).map(item => item.render()); tunesDefinedInTool.concat(otherTunes).forEach(rendered => { - if (rendered instanceof HTMLElement) { + const isHTMLElement = rendered.nodeName !== undefined; + + if (isHTMLElement) { tunesElement.appendChild(rendered); } else { const normalized = [ rendered ].flat(); @@ -768,16 +742,6 @@ export default class Block extends EventsDispatcher { } } - /** - * Call Tool instance renderSettings method - */ - public renderSettings(): HTMLElement | undefined { - return undefined; - // if (_.isFunction(this.toolInstance.renderSettings)) { - // return this.toolInstance.renderSettings(); - // } - } - /** * Tool could specify several entries to be displayed at the Toolbox (for example, "Heading 1", "Heading 2", "Heading 3") * This method returns the entry that is related to the Block (depended on the Block data) diff --git a/src/styles/popover.css b/src/styles/popover.css index f22d8738..155e7bba 100644 --- a/src/styles/popover.css +++ b/src/styles/popover.css @@ -142,7 +142,7 @@ visibility: hidden; } - &__custom-content { + &__custom-content:not(:empty) { padding: 4px; @media (--not-mobile) { diff --git a/types/tools/block-tool.d.ts b/types/tools/block-tool.d.ts index 74094da9..e513fbaa 100644 --- a/types/tools/block-tool.d.ts +++ b/types/tools/block-tool.d.ts @@ -30,8 +30,6 @@ export interface BlockTool extends BaseTool { */ renderSettings?(): HTMLElement | TunesMenuConfig; - - /** * Validate Block's data * @param {BlockToolData} blockData