feat: Add option to 'Create new child doc' from link editor

This commit is contained in:
Tom Moor
2023-12-27 22:40:21 -05:00
parent 7be71fda61
commit bd7d5c338d
8 changed files with 56 additions and 28 deletions

View File

@@ -38,14 +38,15 @@ const createAndInsertLink = async function (
href: string,
options: {
dictionary: any;
onCreateLink: (title: string) => Promise<string>;
nested?: boolean;
onCreateLink: (title: string, nested?: boolean) => Promise<string>;
}
) {
const { dispatch, state } = view;
const { onCreateLink } = options;
try {
const url = await onCreateLink(title);
const url = await onCreateLink(title, options.nested);
const result = findPlaceholderLink(view.state.doc, href);
if (!result) {