yssdsad
This commit is contained in:
@@ -879,6 +879,32 @@
|
||||
}
|
||||
});
|
||||
|
||||
const configureInlineRte = (editor) => {
|
||||
try {
|
||||
const rte = editor && editor.RichTextEditor;
|
||||
if (!rte) return;
|
||||
const allowed = new Set(['bold', 'italic', 'underline', 'placeholder', 'bridge-placeholder', 'bridge-placeholder:edit']);
|
||||
const getId = (action) => {
|
||||
if (!action) return '';
|
||||
if (action.id) return action.id;
|
||||
if (typeof action.getId === 'function') return action.getId();
|
||||
if (action.get && action.get('id')) return action.get('id');
|
||||
return '';
|
||||
};
|
||||
const all = typeof rte.getAll === 'function' ? rte.getAll() : (rte.actions || []);
|
||||
if (Array.isArray(all)) {
|
||||
all.forEach((action) => {
|
||||
const id = getId(action);
|
||||
if (!id) return;
|
||||
if (allowed.has(id) || String(id).toLowerCase().includes('placeholder')) return;
|
||||
if (typeof rte.remove === 'function') {
|
||||
rte.remove(id);
|
||||
}
|
||||
});
|
||||
}
|
||||
} catch {}
|
||||
};
|
||||
|
||||
const ensureCommandStubs = (editor) => {
|
||||
if (!editor || !editor.Commands || !editor.Commands.add) return;
|
||||
editor.Commands.add('bridge-placeholder:edit', {
|
||||
@@ -941,6 +967,7 @@
|
||||
if (B.ENABLE_EDITOR_EXTENSIONS !== false && B.ENABLE_EDITOR_BEHAVIOR !== false) {
|
||||
setupPlainTextPreserver(ed);
|
||||
}
|
||||
configureInlineRte(ed);
|
||||
setupBlurLogger(ed);
|
||||
loadDynamicFonts();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user