From b0ae4d53bd880d4ef781dd113e824c43cf3b1522 Mon Sep 17 00:00:00 2001 From: iskaktoltay Date: Fri, 29 Nov 2024 18:48:46 +0500 Subject: [PATCH] fixed changing link types to mention and embed --- .../api/nodeConversions/nodeConversions.ts | 5 +++- frontend/apps/desktop/src/pages/draft.tsx | 29 ++++++++++--------- 2 files changed, 20 insertions(+), 14 deletions(-) diff --git a/frontend/apps/desktop/src/editor/blocknote/core/api/nodeConversions/nodeConversions.ts b/frontend/apps/desktop/src/editor/blocknote/core/api/nodeConversions/nodeConversions.ts index 6114d708d..f24cc7af6 100644 --- a/frontend/apps/desktop/src/editor/blocknote/core/api/nodeConversions/nodeConversions.ts +++ b/frontend/apps/desktop/src/editor/blocknote/core/api/nodeConversions/nodeConversions.ts @@ -410,7 +410,10 @@ export function nodeToBlock( })) { const blockSpec = blockSchema[blockInfo.contentType.name] if (!blockSpec) { - if (blockInfo.contentType.name === 'code-block') { + if ( + blockInfo.contentType.name === 'code-block' || + blockInfo.contentType.name === 'inline-embed' + ) { break } else throw Error( diff --git a/frontend/apps/desktop/src/pages/draft.tsx b/frontend/apps/desktop/src/pages/draft.tsx index 72e6e6f0d..de3a6b977 100644 --- a/frontend/apps/desktop/src/pages/draft.tsx +++ b/frontend/apps/desktop/src/pages/draft.tsx @@ -54,6 +54,7 @@ import {useEffect, useMemo, useRef, useState} from 'react' import {ErrorBoundary} from 'react-error-boundary' import {GestureResponderEvent} from 'react-native' // import 'show-keys' +import {EmbedToolbarProvider} from '@/editor/embed-toolbar-context' import {Spinner, YStack} from '@shm/ui' import {ActorRefFrom} from 'xstate' import {useShowTitleObserver} from './app-title' @@ -250,19 +251,21 @@ function DocumentEditor({ showCover={showCover} setShowCover={setShowCover} /> - { - // this prevents to fire handleFocusAtMousePos on click - e.stopPropagation() - // editor?._tiptapEditor.commands.focus() - }} - > - {editor ? ( - - ) : null} - + + { + // this prevents to fire handleFocusAtMousePos on click + e.stopPropagation() + // editor?._tiptapEditor.commands.focus() + }} + > + {editor ? ( + + ) : null} + +