add onSelectionUpdate callback to edra editor
This commit is contained in:
parent
0339a3f832
commit
180c26a244
2 changed files with 4 additions and 1 deletions
|
|
@ -43,6 +43,7 @@
|
||||||
editable = true,
|
editable = true,
|
||||||
content,
|
content,
|
||||||
onUpdate,
|
onUpdate,
|
||||||
|
onSelectionUpdate,
|
||||||
autofocus = false,
|
autofocus = false,
|
||||||
class: className
|
class: className
|
||||||
}: EdraEditorProps = $props();
|
}: EdraEditorProps = $props();
|
||||||
|
|
@ -70,7 +71,8 @@
|
||||||
slashcommand(SlashCommandList)
|
slashcommand(SlashCommandList)
|
||||||
],
|
],
|
||||||
{
|
{
|
||||||
onUpdate,
|
...(onUpdate && { onUpdate }),
|
||||||
|
...(onSelectionUpdate && { onSelectionUpdate }),
|
||||||
onTransaction(props) {
|
onTransaction(props) {
|
||||||
// Only update if editor instance actually changed
|
// Only update if editor instance actually changed
|
||||||
// The old pattern (editor = undefined; editor = props.editor) was a Svelte 4
|
// The old pattern (editor = undefined; editor = props.editor) was a Svelte 4
|
||||||
|
|
|
||||||
|
|
@ -9,6 +9,7 @@ export interface EdraEditorProps {
|
||||||
editor?: Editor;
|
editor?: Editor;
|
||||||
autofocus?: boolean;
|
autofocus?: boolean;
|
||||||
onUpdate?: () => void;
|
onUpdate?: () => void;
|
||||||
|
onSelectionUpdate?: () => void;
|
||||||
class?: string;
|
class?: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue