Element rebuild

This commit is contained in:
2026-02-07 23:24:58 +01:00
parent 764d427b1c
commit fe846f66de
5 changed files with 34 additions and 58 deletions

View File

@@ -20,7 +20,8 @@
if (window.__PLACEHOLDER_BLOCKS_LOADED) return;
window.__PLACEHOLDER_BLOCKS_LOADED = true;
const TARGET_CAT_ID = 'placeholders';
const TARGET_CAT_ID = 'placeholders';
const SHOW_PLACEHOLDER_BLOCKS = (B && B.SHOW_PLACEHOLDER_BLOCKS === true);
const PLACEHOLDER_COMPONENT = 'placeholder-block';
const ALL_PLACEHOLDER_BLOCK_IDS = [];
const INLINE_PLACEHOLDER_CLASS = 'bridge-placeholder-inline';
@@ -1088,11 +1089,13 @@ const refreshPlaceholderComponent = (component) => {
editor.on('load', bindRteButton, { once: true });
}
addOnce(bm, 'cust-placeholder-custom', {
id: 'cust-placeholder-custom',
label: '🔖 Placeholder (Text)',
content: `<span data-gjs-type="${PLACEHOLDER_COMPONENT}" data-placeholder-type="custom" data-placeholder-key="UEBERSCHRIFT">{{UEBERSCHRIFT}}</span>`
});
if (SHOW_PLACEHOLDER_BLOCKS) {
addOnce(bm, 'cust-placeholder-custom', {
id: 'cust-placeholder-custom',
label: '🔖 Placeholder (Text)',
content: `<span data-gjs-type="${PLACEHOLDER_COMPONENT}" data-placeholder-type="custom" data-placeholder-key="UEBERSCHRIFT">{{UEBERSCHRIFT}}</span>`
});
}
const ensureDbBlock = (tables) => {
const fallback = { table: 'tabelle', column: 'feld' };
@@ -1109,6 +1112,7 @@ const refreshPlaceholderComponent = (component) => {
const blockId = 'cust-placeholder-db';
const label = '🗄️ Placeholder (DB)';
const existing = typeof bm.get === 'function' ? bm.get(blockId) : null;
if (!SHOW_PLACEHOLDER_BLOCKS) return;
if (existing && typeof existing.set === 'function') {
existing.set('content', content);
existing.set('label', label);