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) {

View File

@@ -302,6 +302,7 @@
"Create link": "Create link",
"Sorry, an error occurred creating the link": "Sorry, an error occurred creating the link",
"Create a new doc": "Create a new doc",
"Create a new child doc": "Create a new child doc",
"Delete column": "Delete column",
"Delete row": "Delete row",
"Delete table": "Delete table",