Scan your whole stack
Are you using @orz/ui-code?
Find out what’s in your code.
Scan your apps free in minutes (opens in a new tab)Latest version: v0.1.2-master.20261127083915.gf6fce9e
@orz/ui-code was last scanned on 27 Nov 2026 at version 0.1.2-master.20261127083915.gf6fce9e. Risk score 0 of 100. No malicious behavior was detected.
| Version | Published | Status |
|---|---|---|
| 0.1.2-master.20261127083915.gf6fce9e LATEST | 27 Nov 2026 | No rules fired |
| 0.1.2-master.20261127075817.gdd5b46d | 27 Nov 2026 | No rules fired |
| 0.1.2-master.20261126185430.ga3bf9ac | 26 Nov 2026 | No rules fired |
| 0.1.2-master.20261126061418.gf2622ab | 26 Nov 2026 | Not shown |
| 0.1.2-master.20261125204259.gaf8791f | 25 Nov 2026 | Not shown |
Findings for v0.1.2-master.20261127083915.gf6fce9e. The score is a capped sum of the weights of the rules that fired — not CVSS, not exploitability, and not a probability. It is not comparable across packages with different scan coverage.
The score describes 0.1.2-master.20261127083915.gf6fce9e; other versions have their own rules, not their own score.
The publisher’s own README, as collected from the registry.
Read-only code and diff blocks, syntax-highlighted by pierre
on shiki and themed by @orz/ui, plus a word differ that segments CJK as well as English. The
package contributes two renderers to @orz/ui-content's registry: codeContent for code and
patchContent for unified diffs.
pnpm add @orz/ui-code @orz/query @orz/themes @orz/ui @orz/ui-content @pierre/diffs lucide-react \
radix-ui react react-dom sonner
@orz/ui-content is a peer dependency so that the app and every content package share one registry.
@pierre/diffs is a peer dependency. pierre's highlighter is a module singleton, and its engine is
fixed by whichever surface creates it first. An app that renders pierre surfaces of its own has to
share that one copy with these blocks: a second copy would bring its own singleton, its own shiki
and its own wasm, and two highlighters that disagree about the engine.
@import "tailwindcss";
@import "@orz/ui/styles.css";
@import "@orz/ui-code/styles.css";
Import it after @orz/ui/styles.css. It pins every diffs-container to the app theme's
color-scheme and paints pierre's background and foreground from --background and
--foreground, so a block matches the page under every theme, including themes with no syntax
counterpart. It also colours a patch's +/− counts from the theme's --diff-addition and
--diff-deletion. Like @orz/ui's stylesheet, it registers @source "./dist" on its own.
Blocks follow @orz/ui's ThemeProvider. A palette's syntax (or its variant's) names the shiki
theme for its token colors, or is a theme object of its own, which is registered with pierre under
its name the first time it is picked; a palette without one uses that slot of pierre's own
light/dark pair. Under system each slot comes from its own palette, so Solarized highlights as
solarized-light by day and solarized-dark at night. A pinned mode or a one-palette theme fills both
slots from the side on screen. Outside a provider, blocks use pierre's pair.
| Import | Contents |
|---|---|
@orz/ui-code |
CodeBlock, CodeDiffBlock, CodeWorkerProvider, useCodeWorkerFactory, fenceFilename, codeContent, patchContent, PatchView, useSyntaxTheme, PIERRE_THEME, PIERRE_THEME_TYPE, PIERRE_HIGHLIGHTER, LazyMultiFileDiff, type SyntaxTheme |
@orz/ui-code/word-diff |
wordDiff, coalescedWordDiff, wordBag, bagWith, types |
@orz/ui-code/styles.css |
the diffs-container rules |
pierre is only reached through lazy(), so a bundler splits it and shiki into their own chunks,
fetched when the first block renders.
@orz/ui-codeCodeBlock takes a filename and infers the language from its extension. fenceFilename turns a
markdown fence's language tag into such a filename, falling back to plain text for a tag pierre
does not know:
import { CodeBlock, CodeDiffBlock, fenceFilename } from "@orz/ui-code";
<CodeBlock filename={fenceFilename(lang)} contents={code} />
<CodeBlock filename="main.ts" contents={file} lineNumbers />
<CodeDiffBlock filename="main.ts" before={previous} after={current} />
CodeBlock takes plain to skip highlighting, and a className that caps a long file's height:
the code view virtualizes against its own box.
pierre tokenizes a whole file even when it draws a screenful: 1 MiB of log held the tab for 9.3 s
on the main thread, 0.2 s in pierre's worker. CodeWorkerProvider lends that worker to every
CodeBlock below it that sets offThread, which codeContent does for files. The lines show as
plain text at once and their colours follow. The worker script has to come from the app's bundler,
so the app starts it:
import { CodeWorkerProvider } from "@orz/ui-code";
import PierreWorker from "@pierre/diffs/worker/worker.js?worker"; // Vite
<CodeWorkerProvider workerFactory={() => new PierreWorker()}>{app}</CodeWorkerProvider>
Without a provider those blocks tokenize on the main thread, as every other block does. The pool
is a page-wide singleton of two workers, created from the first factory and terminated when the
last block using it unmounts. offThread only pays off with a height cap in className:
uncapped, laying out every line of 1 MiB still held the main thread for 2.2 s.
CodeDiffBlock is a unified line diff of one block; with identical sides it renders a CodeBlock.
codeContentThe renderer this package contributes to @orz/ui-content's registry. It
accepts every inline source, whatever its lang, and every file isTextFile calls text, in either
placement:
CodeBlock named fenceFilename(lang).useSourceText and drawn as a CodeBlock under its own name, with
line numbers and without its final newline, tokenized off the main thread when a
CodeWorkerProvider is mounted, and capped to the viewer's pane or a card's collapsed body. While it loads, it is the registry's fallback: a
download link, or the bare name when there is no url. A failed load shows that fallback, the
error and a Retry button.It takes everything a narrower renderer would, so it goes after them in the list:
import { codeContent } from "@orz/ui-code";
import { ContentRenderers } from "@orz/ui-content";
import { markdownContent } from "@orz/ui-markdown";
import { mermaidContent } from "@orz/ui-mermaid";
const RENDERERS = [mermaidContent, markdownContent(), codeContent];
<ContentRenderers renderers={RENDERERS}>{app}</ContentRenderers>;
It highlights at most TEXT_PREVIEW_MAX_BYTES (1 MiB, from @orz/ui-content), so a path that
reaches it with a large file cannot freeze the tab:
size is over TEXT_PREVIEW_HARD_MAX_BYTES (10 MiB) is not loaded: it draws the
registry's fallback and "This file is too large to preview."attachmentCard ask before they draw a file that large.patchContentDraws a unified diff as one diff per file, each commit's subject, author, date and hash in a row
above its message and files, with a file list (with +/− counts, jumping to a file) and a raw
toggle back to the text as written. It accepts a source tagged diff or patch (a fenced block)
and a file isPatchFile calls a patch, in either placement, so it goes before codeContent:
const RENDERERS = [attachmentCard(), markdownContent(), patchContent, codeContent];
format-patch mail, show / log -p output and a plain diff -u all read. The mail headers
and the --stat are left to raw; a diff command line or an Index: banner above a plain diff
names no commit.+/- snippet, stays highlighted text; a file that is not one says so above it.useContentTitleBar;
attachmentCard lends its card's). With none, the patch draws a framed bar of its own, which is
what a fence gets, so a fence inside a markdown card never takes over the card's bar.collapsedClassName caps it below one screen: past it,
the patch is cut at one screen.LARGE_DIFF_LINES (2,000) changed lines is drawn as its header row with a
Load diff button, unless it is the patch's only file: not for speed (a 40,000-line file drew in
0.1 s) but so a generated file does not bury the files around it.codeContent caps it, except that a patch up to 10 MiB is never
asked about: its view is virtualized per file, and a 20 MiB one held the tab for 0.6 s at most.PatchView is the same view on its own, for a surface outside the registry:
<PatchView filename="fix.patch" text={text} lineNumbers invalidNote titleBar={bar} />
@orz/ui-code/word-diffImporting it pulls in neither React nor pierre.
import { coalescedWordDiff, wordDiff } from "@orz/ui-code/word-diff";
const { ins, del } = coalescedWordDiff(oldText, newText);
// ins: [start, end) ranges in newText
// del: { at, from, to }, a caret in newText and the deleted range in oldText
wordDiff is the bare word-level diff, for measuring how much changed. coalescedWordDiff folds
anchors lighter than the changes around them into those changes, which is what a reader should see
for a heavily rewritten line.
To render a pierre surface of your own that matches these blocks, build its options from the same
pieces. Naming the same preferredHighlighter is what keeps it on the shared singleton:
import {
LazyMultiFileDiff,
PIERRE_HIGHLIGHTER,
PIERRE_THEME_TYPE,
useSyntaxTheme,
} from "@orz/ui-code";
const theme = useSyntaxTheme();
const options = useMemo(
() => ({
theme,
themeType: PIERRE_THEME_TYPE,
preferredHighlighter: PIERRE_HIGHLIGHTER,
}),
[theme],
);
<Suspense>
<LazyMultiFileDiff oldFile={oldFile} newFile={newFile} options={options} />
</Suspense>;
<pre>.console.warn
naming the file.Find threats in your stack.
OX Radar can check high-priority threats, like critical package CVEs, against your context.
Each incident is marked Detected or Not Detected with a remediation plan and proof all tracked in the Response Center.
The probe returned only these fields for this server — auth requirement, protocol and tool list weren’t observed, so they’re not shown (never guessed).
The publisher’s own links, as the registry reports them. These are not sources for the assessment on this page.