From 340fc71e83cff88438c23d5ef2a0738adfd4f57f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Niels=20Lyngs=C3=B8?= Date: Mon, 27 May 2024 11:52:07 +0200 Subject: [PATCH] comments and clean up --- .../components/input-tiny-mce/input-tiny-mce.defaults.ts | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/Umbraco.Web.UI.Client/src/packages/tiny-mce/components/input-tiny-mce/input-tiny-mce.defaults.ts b/src/Umbraco.Web.UI.Client/src/packages/tiny-mce/components/input-tiny-mce/input-tiny-mce.defaults.ts index 7c5d84c669..58edc6512d 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/tiny-mce/components/input-tiny-mce/input-tiny-mce.defaults.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/tiny-mce/components/input-tiny-mce/input-tiny-mce.defaults.ts @@ -40,15 +40,16 @@ export const defaultFallbackConfig: RawEditorOptions = { editor.iframeElement.dispatchEvent(event.clone()); }) as EventListener); + // Transfer our import-map to the iframe: [NL] const importMapTag = document.head.querySelector('script[type="importmap"]'); if (importMapTag) { - //const p = JSON.parse(importMapTag.innerHTML ?? ''); const importMap = document.createElement('script'); importMap.type = 'importmap'; importMap.text = importMapTag.innerHTML; editor.dom.doc.head.appendChild(importMap); } + // Load the umb-rte-block component inside the iframe [NL] const script = document.createElement('script'); script.type = 'text/javascript'; script.setAttribute('type', 'module'); @@ -56,9 +57,6 @@ export const defaultFallbackConfig: RawEditorOptions = { script.text = `import { UmbBlockRteEntryElement, UmbBlockRteEntryInlineElement } from "${UMB_BLOCK_ENTRY_WEB_COMPONENTS_ABSOLUTE_PATH}";`; editor.dom.doc.head.appendChild(script); - - //editor.iframeElement?.contentWindow?.customElements.define('umb-rte-block', UmbBlockRteEntryElement); - //editor.iframeElement?.contentWindow?.customElements.define('umb-rte-block-inline', UmbBlockRteEntryInlineElement); }, style_formats: [