Upgrades (#1419)
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
3bc77653ad
commit
453f5bb3e6
94 changed files with 4029 additions and 8199 deletions
|
|
@ -253,7 +253,7 @@ export const patchTextNodes = (schema, oldNode, newNode) => {
|
|||
const node = createTextNode(
|
||||
schema,
|
||||
sentence,
|
||||
type !== DiffType.Unchanged ? [createDiffMark(schema, type)] : []
|
||||
type === DiffType.Unchanged ? [] : [createDiffMark(schema, type)]
|
||||
);
|
||||
return node;
|
||||
});
|
||||
|
|
|
|||
|
|
@ -5,14 +5,16 @@ import { DOMParser, type Node } from "prosemirror-model";
|
|||
import { Decoration, DecorationSet, type EditorView } from "prosemirror-view";
|
||||
import { renderToString } from "react-dom/server";
|
||||
|
||||
import { Response } from "@/components/elements/response";
|
||||
import { MessageResponse } from "@/components/ai-elements/message";
|
||||
|
||||
import { documentSchema } from "./config";
|
||||
import { createSuggestionWidget, type UISuggestion } from "./suggestions";
|
||||
|
||||
export const buildDocumentFromContent = (content: string) => {
|
||||
const parser = DOMParser.fromSchema(documentSchema);
|
||||
const stringFromMarkdown = renderToString(<Response>{content}</Response>);
|
||||
const stringFromMarkdown = renderToString(
|
||||
<MessageResponse>{content}</MessageResponse>
|
||||
);
|
||||
const tempContainer = document.createElement("div");
|
||||
tempContainer.innerHTML = stringFromMarkdown;
|
||||
return parser.parse(tempContainer);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue