fix: 🐛

This commit is contained in:
codytseng
2025-07-16 09:24:14 +08:00
parent a710e40747
commit 53e9aea82f
2 changed files with 9 additions and 5 deletions

View File

@@ -82,9 +82,13 @@ export const ClipboardAndDropHandler = Extension.create<ClipboardAndDropHandlerO
if (i > 0) nodes.push(schema.nodes.hardBreak.create())
if (parts[i]) nodes.push(schema.text(parts[i]))
}
const fragment = schema.nodes.paragraph.create(null, nodes)
const tr = view.state.tr.replaceSelectionWith(fragment)
view.dispatch(tr)
if (nodes.length > 0) {
const tr = view.state.tr.replaceSelectionWith(nodes[0])
for (let i = 1; i < nodes.length; i++) {
tr.insert(tr.selection.from, nodes[i])
}
view.dispatch(tr)
}
})
handled = true
}

View File

@@ -112,7 +112,7 @@ function ExternalRoot({ value }: { value: string }) {
return (
<div>
<Card
className="flex space-x-1 p-1 items-center clickable text-sm text-muted-foreground hover:text-foreground"
className="flex space-x-1 px-1.5 py-1 items-center clickable text-sm text-muted-foreground hover:text-foreground"
onClick={() => push(toNoteList({ externalContentId: value }))}
>
<div className="truncate">{value}</div>
@@ -136,7 +136,7 @@ function ParentNote({
if (isFetching) {
return (
<div>
<Card className="flex space-x-1 px-2 py-1 items-center clickable text-sm text-muted-foreground">
<Card className="flex space-x-1 px-1.5 py-1 items-center clickable text-sm text-muted-foreground">
<Skeleton className="shrink w-4 h-4 rounded-full" />
<div className="py-1 flex-1">
<Skeleton className="h-3" />