feat(wysiwyg): implement backspace

This commit is contained in:
Juergen Kunz
2025-06-24 15:52:28 +00:00
parent 83f153f654
commit ca525ce7e3
7 changed files with 563 additions and 108 deletions

View File

@ -506,7 +506,7 @@ export class DeesWysiwygBlock extends DeesElement {
/**
* Get cursor position in the editable element
*/
private getCursorPosition(element: HTMLElement): number | null {
public getCursorPosition(element: HTMLElement): number | null {
// Get parent wysiwyg component's shadow root
const parentComponent = this.closest('dees-input-wysiwyg');
const parentShadowRoot = parentComponent?.shadowRoot;
@ -765,8 +765,10 @@ export class DeesWysiwygBlock extends DeesElement {
cursorPos,
beforeHtml,
beforeLength: beforeHtml.length,
beforeHtmlPreview: beforeHtml.substring(0, 100) + (beforeHtml.length > 100 ? '...' : ''),
afterHtml,
afterLength: afterHtml.length
afterLength: afterHtml.length,
afterHtmlPreview: afterHtml.substring(0, 100) + (afterHtml.length > 100 ? '...' : '')
});
return {