From bfe539d74722648dc42ed9f19348d61d63d57d95 Mon Sep 17 00:00:00 2001 From: Lars Gebhardt-Kusche Date: Thu, 5 Feb 2026 00:29:42 +0100 Subject: [PATCH] asdasd --- config/current.ver | 2 +- public/assets/js/bridge/blocks-api.js | 12 ++++++++++++ public/editor/bridge-core.js | 14 ++++++++++++++ 3 files changed, 27 insertions(+), 1 deletion(-) diff --git a/config/current.ver b/config/current.ver index 9030779..fc89a67 100644 --- a/config/current.ver +++ b/config/current.ver @@ -1 +1 @@ -1.2.51 \ No newline at end of file +1.2.52 \ No newline at end of file diff --git a/public/assets/js/bridge/blocks-api.js b/public/assets/js/bridge/blocks-api.js index eec5a09..7b6b78d 100644 --- a/public/assets/js/bridge/blocks-api.js +++ b/public/assets/js/bridge/blocks-api.js @@ -509,7 +509,19 @@ return false; }; +<<<<<<< ours // 1) Selection im DOM suchen (bevorzugt) +======= + // 1) Bevorzugt: ausgewähltes Component-Element aus der View + if (selected) { + const selEl = (selected.getEl && selected.getEl()) || (selected.view && selected.view.el); + if (selEl && (selEl.isContentEditable || (selEl.getAttribute && selEl.getAttribute('contenteditable') === 'true'))) { + syncFromElement(selected, selEl, 'selected:view'); + } + } + + // 2) Fallback: Selection im DOM suchen +>>>>>>> theirs if (!syncResult && doc && selectionEl && (selectionEl.isContentEditable || (selectionEl.getAttribute && selectionEl.getAttribute('contenteditable') === 'true'))) { const root = (selectionEl.closest && selectionEl.closest('[data-gjs-type="text"]')) || selectionEl; const id = root && root.getAttribute ? root.getAttribute('id') : null; diff --git a/public/editor/bridge-core.js b/public/editor/bridge-core.js index f82c6bf..f5b411f 100644 --- a/public/editor/bridge-core.js +++ b/public/editor/bridge-core.js @@ -772,6 +772,12 @@ if (!target) return; const isEditable = !!(target.isContentEditable || (target.getAttribute && target.getAttribute('contenteditable') === 'true')); if (!isEditable) return; + try { + const win = target.ownerDocument && target.ownerDocument.defaultView; + if (win) { + win.__bridgeLastEditableEl = target; + } + } catch {} const selected = editor.getSelected && editor.getSelected(); const selectedEl = selected && selected.view && selected.view.el; let editorHtml = ''; @@ -792,6 +798,14 @@ const selectedEl = selected && selected.view && selected.view.el; if (!selected || !selectedEl) return; if (syncing.has(selected)) return; + try { + const win = target.ownerDocument && target.ownerDocument.defaultView; + if (win) { + win.__bridgeLastEditableEl = target; + const id = selected.getId ? selected.getId() : (selected.get && selected.get('id')); + if (id) win.__bridgeLastEditableCompId = id; + } + } catch {} try { const viewHtml = normalizeViewHtml(selectedEl.innerHTML || ''); if (!viewHtml) return;