From e3bf9f5c30656fd71336d21740b3511b43fe8786 Mon Sep 17 00:00:00 2001 From: Lars Gebhardt-Kusche Date: Thu, 15 Jan 2026 01:55:21 +0100 Subject: [PATCH] yysds --- public/editor/bridge-core.js | 43 ++++++++++++++++++++++++------------ 1 file changed, 29 insertions(+), 14 deletions(-) diff --git a/public/editor/bridge-core.js b/public/editor/bridge-core.js index 756939d..b0b490a 100644 --- a/public/editor/bridge-core.js +++ b/public/editor/bridge-core.js @@ -79,7 +79,7 @@             try {                  done && done();              } catch(e){  -                if (e.message.includes('setting getter-only property "defaults"')) { +                if (e.message.includes('setting getter-only property "defaults"') || e.message.includes('Cannot set property defaults')) {                     log('RUNTIME WARNING', `IGNORIERE Block-Konflikt in ${filename}: ${e.message}`, 'orange', 'warn');                 } else {                     // 🛑 KORREKTUR: force: true explizit auf false setzen (oder weglassen) @@ -798,22 +798,34 @@ const BaseView = baseType.view; domc.addType('bridge-table', { model: BaseModel.extend({ - defaults: Object.assign({}, (typeof BaseModel.prototype.defaults === 'function' ? BaseModel.prototype.defaults() : (BaseModel.prototype.defaults || {})), { - tagName: 'table', - attributes: { + initialize(props = {}, opts = {}) { + if (BaseModel.prototype.initialize) { + BaseModel.prototype.initialize.apply(this, [props, opts]); + } + const attrs = this.getAttributes ? this.getAttributes() : {}; + const nextAttrs = Object.assign({ 'data-bridge-table': '1', 'data-bridge-rows': '3', 'data-bridge-cols': '2', role: 'presentation', - }, - toolbar: [ - { - label: tableIcon, - command: 'bridge-table:edit', - attributes: { title: 'Tabelle bearbeiten' }, - }, - ], - }), + }, attrs || {}); + if (this.addAttributes) { + this.addAttributes(nextAttrs); + } else if (this.set) { + this.set('attributes', nextAttrs, { silent: true }); + } + const toolbar = this.get && this.get('toolbar'); + if (!Array.isArray(toolbar) || !toolbar.some(btn => btn && btn.command === 'bridge-table:edit')) { + this.set && this.set('toolbar', [ + ...(Array.isArray(toolbar) ? toolbar : []), + { + label: tableIcon, + command: 'bridge-table:edit', + attributes: { title: 'Tabelle bearbeiten' }, + }, + ]); + } + }, }), view: BaseView, isComponent: el => { @@ -1165,13 +1177,16 @@ log('CONTENT', 'JSON-Projektzustand angewendet.', 'orange'); } catch (e) { log('CONTENT ERROR', `JSON loadProjectData Fehler: ${e.message}`, 'red', 'error'); + if (!html) { + html = jsonPayload; + } } finally { window.__GJS_IS_PARSING = false; isParsing = false; } } - if (!applied && html && !ed.getComponents().length) { + if (!applied && html) { window.__GJS_IS_PARSING = true;  isParsing = true; eventCounts = {};