Skip to content

Commit

Permalink
fixed changing link types to mention and embed
Browse files Browse the repository at this point in the history
  • Loading branch information
iskaktoltay committed Nov 29, 2024
1 parent 050d756 commit b0ae4d5
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -410,7 +410,10 @@ export function nodeToBlock<BSchema extends BlockSchema>(
})) {
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(
Expand Down
29 changes: 16 additions & 13 deletions frontend/apps/desktop/src/pages/draft.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down Expand Up @@ -250,19 +251,21 @@ function DocumentEditor({
showCover={showCover}
setShowCover={setShowCover}
/>
<Container
paddingLeft="$4"
marginBottom={300}
onPress={(e: GestureResponderEvent) => {
// this prevents to fire handleFocusAtMousePos on click
e.stopPropagation()
// editor?._tiptapEditor.commands.focus()
}}
>
{editor ? (
<HyperMediaEditorView editable={true} editor={editor} />
) : null}
</Container>
<EmbedToolbarProvider>
<Container
paddingLeft="$4"
marginBottom={300}
onPress={(e: GestureResponderEvent) => {
// this prevents to fire handleFocusAtMousePos on click
e.stopPropagation()
// editor?._tiptapEditor.commands.focus()
}}
>
{editor ? (
<HyperMediaEditorView editable={true} editor={editor} />
) : null}
</Container>
</EmbedToolbarProvider>
</YStack>
</YStack>
</AppDocContentProvider>
Expand Down

0 comments on commit b0ae4d5

Please sign in to comment.