@djangocfg/widget-code
v0.1.9
Published
Code surfaces: a Monaco editor, a diff viewer, a Prism listing, a JSON editor and the markdown renderer that embeds them
Maintainers
Readme
@djangocfg/widget-code
Code surfaces: an editor, a diff, a highlighted listing, a JSON editor, and the markdown renderer that embeds them.
Install
pnpm add @djangocfg/widget-code @djangocfg/ui-core @djangocfg/i18n| Subpath | What | Weight |
|---|---|---|
| ./editor | Monaco, single file or diff | ~550 KB, lazy |
| ./json-editor | an editable JSON tree | json-edit-react |
| ./pretty-code | a read-only listing with a panel header | Prism |
| ./diff-viewer | unified or split diff, virtualised | Prism + virtuoso |
| ./diff-viewer/full | the same, eagerly | |
| ./markdown-message | markdown with embedded code, diagrams and chips | |
| ./role-tokens | the ANCHOR / TOGGLE class contracts | |
No root barrel worth importing
Monaco alone is ~550 KB, and Prism and json-edit-react sit behind their own
subpaths. The root exports the role tokens and nothing else, on purpose.
Read-only code elsewhere
@djangocfg/widget-media/code renders a listing with shiki, and a console
should pick one highlighter rather than match two themes by hand. Prefer it for
a new surface; this package's Prism stack stays because DiffViewer and
MarkdownMessage are built on it.
Verify
pnpm --filter @djangocfg/widget-code check-types test