components/ui and the pages now use only the style.css scale: text-[0.8rem]→text-label, text-[0.625rem]→text-micro, text-base/text-sm→ text-label (rows and controls), text-xs→text-caption (captions and secondary text), text-lg/text-xl/text-2xl→text-title (panel and page titles). Rendered markdown (ChatMarkdown/ChatInline/markdown.ts) keeps Tailwind steps as the issue allows. 196 files, class-token swaps only.
39 lines
1.1 KiB
Vue
39 lines
1.1 KiB
Vue
<script setup lang="ts">
|
|
import { cn } from "@/lib/utils";
|
|
import {
|
|
CodeBlock,
|
|
CodeBlockActions,
|
|
CodeBlockContent,
|
|
CodeBlockCopyButton,
|
|
CodeBlockLine,
|
|
CodeBlockToken,
|
|
useHighlightedCode,
|
|
} from "@/components/ui/code-block";
|
|
|
|
/**
|
|
* Code or a payload with a copy button that appears on hover or focus. The
|
|
* text is shown verbatim and wrapped: stored payloads are mostly long unbroken
|
|
* tokens (URLs, hashes, base64), which must not push the panel past its edge.
|
|
* A language the highlighter does not know renders plain.
|
|
*/
|
|
const props = defineProps<{ code: string; lang?: string; class?: string }>();
|
|
|
|
const lines = useHighlightedCode(
|
|
() => props.code,
|
|
() => props.lang || "text",
|
|
);
|
|
</script>
|
|
|
|
<template>
|
|
<CodeBlock :class="cn('bg-muted', props.class)">
|
|
<CodeBlockActions>
|
|
<CodeBlockCopyButton :value="code" />
|
|
</CodeBlockActions>
|
|
<CodeBlockContent wrap class="max-h-[60vh] pe-10 text-caption">
|
|
<CodeBlockLine v-for="(line, index) in lines" :key="index">
|
|
<CodeBlockToken v-for="(token, i) in line" :key="i" :token="token" />
|
|
</CodeBlockLine>
|
|
</CodeBlockContent>
|
|
</CodeBlock>
|
|
</template>
|