From 2a16d662d7a56dc9d2fc80cf56c036d5d6be4daf Mon Sep 17 00:00:00 2001 From: Lars Gebhardt-Kusche Date: Sat, 31 Jan 2026 01:31:16 +0100 Subject: [PATCH] asdasd --- config/current.ver | 2 +- public/assets/js/bridge/blocks-placeholder.js | 2 +- public/assets/js/bridge/rte-editor.js | 52 +++++++++++++++++++ 3 files changed, 54 insertions(+), 2 deletions(-) diff --git a/config/current.ver b/config/current.ver index 40e7d1a..b099e4c 100644 --- a/config/current.ver +++ b/config/current.ver @@ -1 +1 @@ -1.1.70 \ No newline at end of file +1.1.71 \ No newline at end of file diff --git a/public/assets/js/bridge/blocks-placeholder.js b/public/assets/js/bridge/blocks-placeholder.js index 4cb4a3f..0c3e6b9 100644 --- a/public/assets/js/bridge/blocks-placeholder.js +++ b/public/assets/js/bridge/blocks-placeholder.js @@ -333,7 +333,7 @@ const refreshPlaceholderComponent = (component) => { const openPlaceholderModal = (editor, component, opts = {}) => { if (!editor) return; - const modal = editor.Modal; + const modal = opts.modal || editor.Modal; if (!modal) return; ensureInlinePlaceholderStyles(); diff --git a/public/assets/js/bridge/rte-editor.js b/public/assets/js/bridge/rte-editor.js index 5f8dafc..8c2afc1 100644 --- a/public/assets/js/bridge/rte-editor.js +++ b/public/assets/js/bridge/rte-editor.js @@ -1039,6 +1039,56 @@ return (payload.key || 'PLATZHALTER').toUpperCase(); }; const buildPlaceholderText = (payload) => `{{${buildPlaceholderLabel(payload)}}}`; + const createInlineModal = () => { + const overlay = doc.createElement('div'); + overlay.style.display = 'none'; + overlay.style.position = 'absolute'; + overlay.style.inset = '0'; + overlay.style.background = 'rgba(15,23,42,0.35)'; + overlay.style.alignItems = 'center'; + overlay.style.justifyContent = 'center'; + overlay.style.zIndex = '30'; + + const panel = doc.createElement('div'); + panel.style.display = 'flex'; + panel.style.flexDirection = 'column'; + panel.style.gap = '10px'; + panel.style.padding = '12px'; + panel.style.border = '1px solid #cbd5f5'; + panel.style.borderRadius = '8px'; + panel.style.background = '#ffffff'; + panel.style.boxShadow = '0 6px 24px rgba(15,23,42,0.2)'; + panel.style.minWidth = '320px'; + panel.style.maxWidth = '640px'; + panel.style.maxHeight = '80vh'; + panel.style.overflow = 'auto'; + + const titleEl = doc.createElement('div'); + titleEl.style.fontWeight = '600'; + titleEl.style.fontSize = '14px'; + + const bodyEl = doc.createElement('div'); + panel.appendChild(titleEl); + panel.appendChild(bodyEl); + overlay.appendChild(panel); + container.appendChild(overlay); + + let closeCb = null; + return { + el: overlay, + setTitle(text) { titleEl.textContent = text || ''; }, + setContent(node) { + bodyEl.innerHTML = ''; + if (node) bodyEl.appendChild(node); + }, + open() { overlay.style.display = 'flex'; }, + close() { + overlay.style.display = 'none'; + if (typeof closeCb === 'function') closeCb(); + }, + onceClose(cb) { closeCb = cb; }, + }; + }; const insertTextAtSelection = (text) => { try { content.focus(); @@ -1084,7 +1134,9 @@ saveSelection(); const api = window.BridgeBlocksPlaceholder; if (!api || typeof api.openModal !== 'function') return; + const inlineModal = createInlineModal(); api.openModal(editor, null, { + modal: inlineModal, onCancel: () => { if (content && typeof content.focus === 'function') { setTimeout(() => content.focus(), 0);