v2 message format and upgrade to ai sdk v5 (#743)

Co-authored-by: GitHub Action <action@github.com>
Co-authored-by: Liang-Shih Lin <liangshihlin@proton.me>
Co-authored-by: Dominik Engelhardt <dominikengelhardt@ymail.com>
Co-authored-by: Jay V <air@live.ca>
Co-authored-by: adamdottv <2363879+adamdottv@users.noreply.github.com>
This commit is contained in:
Dax
2025-07-07 15:53:43 -04:00
committed by GitHub
parent 76b2e4539c
commit f884766445
116 changed files with 4707 additions and 6950 deletions

View File

@@ -0,0 +1,32 @@
import { type JSX, splitProps, createResource, Suspense } from "solid-js"
import { codeToHtml } from "shiki"
import style from "./content-code.module.css"
import { transformerNotationDiff } from "@shikijs/transformers"
interface Props {
code: string
lang?: string
flush?: boolean
}
export function ContentCode(props: Props) {
const [html] = createResource(
() => [props.code, props.lang],
async ([code, lang]) => {
// TODO: For testing delays
// await new Promise((resolve) => setTimeout(resolve, 3000))
return (await codeToHtml(code || "", {
lang: lang || "text",
themes: {
light: "github-light",
dark: "github-dark",
},
transformers: [transformerNotationDiff()],
})) as string
},
)
return (
<Suspense>
<div innerHTML={html()} class={style.root} data-flush={props.flush === true ? true : undefined} />
</Suspense>
)
}