@seanmozeik/markdown-display 0.3.5 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +41 -20
- package/dist/abap-9xbv043v.js +2 -0
- package/dist/actionscript-3-ffr5ydrs.js +2 -0
- package/dist/ada-jk2gn0pn.js +2 -0
- package/dist/andromeeda-24gktw4d.js +2 -0
- package/dist/angular-html-xg28445y.js +2 -0
- package/dist/angular-ts-1xq6mw7g.js +2 -0
- package/dist/apache-4b3b0eyy.js +2 -0
- package/dist/apex-a3awgdsm.js +2 -0
- package/dist/apl-f630k1vx.js +2 -0
- package/dist/applescript-qreypzb3.js +2 -0
- package/dist/ara-a0ghw0xy.js +2 -0
- package/dist/asciidoc-17amrzcg.js +2 -0
- package/dist/asm-1ybpdpc6.js +2 -0
- package/dist/astro-2vzy1qg5.js +2 -0
- package/dist/aurora-x-pb2h8m75.js +2 -0
- package/dist/awk-4g14sdfr.js +2 -0
- package/dist/ayu-dark-a6e49das.js +2 -0
- package/dist/ayu-light-ac787hyf.js +2 -0
- package/dist/ayu-mirage-zjtmb0bg.js +2 -0
- package/dist/ballerina-fd1yzyy8.js +2 -0
- package/dist/banner-ng06wc8g.js +12 -0
- package/dist/bat-x024z34k.js +2 -0
- package/dist/beancount-4aa1ce0k.js +2 -0
- package/dist/berry-1157ed3y.js +2 -0
- package/dist/bibtex-s0jadepe.js +2 -0
- package/dist/bicep-gx08m1nz.js +2 -0
- package/dist/bird2-3g0vanh0.js +2 -0
- package/dist/blade-22gzdntq.js +2 -0
- package/dist/bsl-r8cmv6pz.js +2 -0
- package/dist/c-g33d1744.js +2 -0
- package/dist/c3-02s6n09a.js +2 -0
- package/dist/cadence-b5x3mzqg.js +2 -0
- package/dist/cairo-4v5k49bw.js +2 -0
- package/dist/catppuccin-frappe-zze8rp4c.js +2 -0
- package/dist/catppuccin-latte-ebmyxk6e.js +2 -0
- package/dist/catppuccin-macchiato-8m9avkeq.js +2 -0
- package/dist/catppuccin-mocha-caq0gmr7.js +2 -0
- package/dist/clarity-x08cc58e.js +2 -0
- package/dist/cli-0y1zeg7v.js +3 -0
- package/dist/cli-1hj5h9f9.js +3 -0
- package/dist/cli-2h1yfjdw.js +3 -0
- package/dist/cli-30n24kzz.js +3 -0
- package/dist/cli-3fzyv189.js +3 -0
- package/dist/cli-3wvgjq8z.js +3 -0
- package/dist/cli-3z230jhh.js +3 -0
- package/dist/cli-48yac15g.js +3 -0
- package/dist/cli-58p99hkc.js +3 -0
- package/dist/cli-5jp9npt1.js +3 -0
- package/dist/cli-5v8q61ce.js +3 -0
- package/dist/cli-6jzqb50s.js +3 -0
- package/dist/cli-79y9hz07.js +3 -0
- package/dist/cli-81dmk4ts.js +3 -0
- package/dist/cli-81w52zkt.js +3 -0
- package/dist/cli-8nneg522.js +3 -0
- package/dist/cli-8qe0pqv6.js +3 -0
- package/dist/cli-a8250sbe.js +3 -0
- package/dist/cli-ac5hc1dt.js +3 -0
- package/dist/cli-app-6kzbj8e4.js +411 -0
- package/dist/cli-ayvxq7qa.js +3 -0
- package/dist/cli-banpa4vr.js +7 -0
- package/dist/cli-bt5bw9b4.js +3 -0
- package/dist/cli-c0mb9wq6.js +3 -0
- package/dist/cli-dg73jpjs.js +3 -0
- package/dist/cli-e21h859y.js +3 -0
- package/dist/cli-g0wwxff6.js +3 -0
- package/dist/cli-gtjpq1mb.js +3 -0
- package/dist/cli-ha8pqpt8.js +3 -0
- package/dist/cli-hsvv3jzh.js +3 -0
- package/dist/cli-hxsnf2x8.js +3 -0
- package/dist/cli-jewjtf3e.js +3 -0
- package/dist/cli-jkvh6m6e.js +3 -0
- package/dist/cli-jqdxtesj.js +3 -0
- package/dist/cli-k2dtsfh9.js +3 -0
- package/dist/cli-m8zynty7.js +3 -0
- package/dist/cli-n5czz7gz.js +3 -0
- package/dist/cli-r2h3ee8w.js +3 -0
- package/dist/cli-rkqs0vcv.js +3 -0
- package/dist/cli-ss2qwkcc.js +3 -0
- package/dist/cli-tse5g5yz.js +3 -0
- package/dist/cli-v04mbmxe.js +3 -0
- package/dist/cli-v37wd532.js +3 -0
- package/dist/cli-vbncttvd.js +3 -0
- package/dist/cli-vt93z537.js +3 -0
- package/dist/cli-w37ddf7r.js +3 -0
- package/dist/cli-yjt0k8jp.js +3 -0
- package/dist/cli-yxfvsvk9.js +3 -0
- package/dist/clojure-vzmv55wf.js +2 -0
- package/dist/cmake-7y22bc67.js +2 -0
- package/dist/cobol-kdnhdmjz.js +2 -0
- package/dist/codeowners-x6m7bhdc.js +2 -0
- package/dist/codeql-6rz9fzqw.js +2 -0
- package/dist/coffee-hdfzr8ps.js +2 -0
- package/dist/common-lisp-zmr06g7n.js +2 -0
- package/dist/coq-r8j5c36h.js +2 -0
- package/dist/cpp-cnh8n6p9.js +2 -0
- package/dist/crystal-mrgdvpq4.js +2 -0
- package/dist/csharp-q48m96qr.js +2 -0
- package/dist/css-bd0hqx8d.js +2 -0
- package/dist/csv-4m85ky3s.js +2 -0
- package/dist/cue-tkch0b5s.js +2 -0
- package/dist/cypher-9v66whj2.js +2 -0
- package/dist/d-h7frep7v.js +2 -0
- package/dist/dark-plus-3mz49csr.js +2 -0
- package/dist/dart-0ts3fbr7.js +2 -0
- package/dist/dax-epx6f5sr.js +2 -0
- package/dist/desktop-ga56hzcd.js +2 -0
- package/dist/diff-nj0camxe.js +2 -0
- package/dist/docker-ck9z05s1.js +2 -0
- package/dist/dotenv-n24rx33c.js +2 -0
- package/dist/dracula-rt7zm8kp.js +2 -0
- package/dist/dracula-soft-ny1w766n.js +2 -0
- package/dist/dream-maker-5bdhk1xw.js +2 -0
- package/dist/edge-nes62z5q.js +2 -0
- package/dist/elixir-t2dacwg4.js +2 -0
- package/dist/elm-efkwc9kb.js +2 -0
- package/dist/emacs-lisp-aeyrqndc.js +2 -0
- package/dist/erb-1jnjam5w.js +2 -0
- package/dist/erlang-q2nxsk7t.js +2 -0
- package/dist/everforest-dark-q5afr5gg.js +2 -0
- package/dist/everforest-light-gwf12vcx.js +2 -0
- package/dist/fennel-qcrnckrq.js +2 -0
- package/dist/fish-fybdeyvp.js +2 -0
- package/dist/fluent-71z72985.js +2 -0
- package/dist/fortran-fixed-form-1gqb01bw.js +2 -0
- package/dist/fortran-free-form-kxkmegqs.js +2 -0
- package/dist/fsharp-cgvxcgsx.js +2 -0
- package/dist/gdresource-46k5gmzt.js +2 -0
- package/dist/gdscript-68kq1xvg.js +2 -0
- package/dist/gdshader-b3674jka.js +2 -0
- package/dist/genie-jyymh6js.js +2 -0
- package/dist/gherkin-7e2sjv5d.js +2 -0
- package/dist/git-commit-9wk0r5sb.js +2 -0
- package/dist/git-rebase-prhzk4j5.js +2 -0
- package/dist/github-dark-default-0vxh5df6.js +2 -0
- package/dist/github-dark-dimmed-mrkg0dkj.js +2 -0
- package/dist/github-dark-high-contrast-dfjvzvs1.js +2 -0
- package/dist/github-dark-vmmv282e.js +2 -0
- package/dist/github-light-79sz9hnx.js +2 -0
- package/dist/github-light-default-1jr038w7.js +2 -0
- package/dist/github-light-high-contrast-r2s26c8v.js +2 -0
- package/dist/gleam-0915n1m3.js +2 -0
- package/dist/glimmer-js-k7czmdfm.js +2 -0
- package/dist/glimmer-ts-194ejtg4.js +2 -0
- package/dist/glsl-dj78d5j4.js +2 -0
- package/dist/gn-1hvwh71v.js +2 -0
- package/dist/gnuplot-3hmy4dt7.js +2 -0
- package/dist/go-33wfsnyk.js +2 -0
- package/dist/graphql-0aac9yec.js +2 -0
- package/dist/groovy-ja0xcaxz.js +2 -0
- package/dist/gruvbox-dark-hard-5s80mtba.js +2 -0
- package/dist/gruvbox-dark-medium-n4khhzte.js +2 -0
- package/dist/gruvbox-dark-soft-e71n00ep.js +2 -0
- package/dist/gruvbox-light-hard-pbvye0e8.js +2 -0
- package/dist/gruvbox-light-medium-ta1n6jez.js +2 -0
- package/dist/gruvbox-light-soft-ymh9etvc.js +2 -0
- package/dist/hack-wbm9q4mm.js +2 -0
- package/dist/haml-gx26k3n5.js +2 -0
- package/dist/handlebars-x15bnv4j.js +2 -0
- package/dist/haskell-gphr2mx4.js +2 -0
- package/dist/haxe-jjqygeb7.js +2 -0
- package/dist/hcl-cr0bx0fz.js +2 -0
- package/dist/hjson-f1xxjn7x.js +2 -0
- package/dist/hlsl-dx0egzxe.js +2 -0
- package/dist/horizon-bright-4xdqr7cd.js +2 -0
- package/dist/horizon-ztsnzjdn.js +2 -0
- package/dist/houston-61g9eh8r.js +2 -0
- package/dist/html-derivative-hvxv75a7.js +2 -0
- package/dist/html-wqddzypw.js +2 -0
- package/dist/http-kh76rh1s.js +2 -0
- package/dist/hurl-4c8qps7w.js +2 -0
- package/dist/hxml-3bkn4jp8.js +2 -0
- package/dist/hy-fxpg7aaw.js +2 -0
- package/dist/imba-q8na79n7.js +2 -0
- package/dist/index-pdw64t43.js +15 -0
- package/dist/ini-s6y2n2r0.js +2 -0
- package/dist/java-bcf5924q.js +2 -0
- package/dist/javascript-qmy7d5mk.js +2 -0
- package/dist/jinja-y1162pxj.js +2 -0
- package/dist/jison-444dx63z.js +2 -0
- package/dist/json-gwwdj89t.js +2 -0
- package/dist/json5-3100ynmc.js +2 -0
- package/dist/jsonc-v2rnz0h1.js +2 -0
- package/dist/jsonl-axvqz7sn.js +2 -0
- package/dist/jsonnet-zfn0ptb5.js +2 -0
- package/dist/jssm-gej4xq4j.js +2 -0
- package/dist/jsx-zc0j90dq.js +2 -0
- package/dist/julia-as91r849.js +2 -0
- package/dist/just-zmsqbkqy.js +2 -0
- package/dist/kanagawa-dragon-d76szdr9.js +2 -0
- package/dist/kanagawa-lotus-wd9eezwr.js +2 -0
- package/dist/kanagawa-wave-acc5532t.js +2 -0
- package/dist/kdl-0nd9fhgr.js +2 -0
- package/dist/kotlin-v71xk1rn.js +2 -0
- package/dist/kusto-9mpsj4vk.js +2 -0
- package/dist/laserwave-db8954kv.js +2 -0
- package/dist/latex-xs0c2nvw.js +2 -0
- package/dist/lean-vdhz6cqv.js +2 -0
- package/dist/less-312pw0ev.js +2 -0
- package/dist/light-plus-aq99ra4y.js +2 -0
- package/dist/liquid-dmnzg3ty.js +2 -0
- package/dist/llvm-t6bzgxkv.js +2 -0
- package/dist/log-ssjyybt8.js +2 -0
- package/dist/logo-qb8mz41r.js +2 -0
- package/dist/lua-kk3ewrfz.js +2 -0
- package/dist/luau-1332gd7k.js +2 -0
- package/dist/make-ym3y5he3.js +2 -0
- package/dist/markdown-yakp348x.js +2 -0
- package/dist/marko-t2xabqrz.js +2 -0
- package/dist/material-theme-darker-vyfbvm1v.js +2 -0
- package/dist/material-theme-e94sgaj2.js +2 -0
- package/dist/material-theme-lighter-12stms50.js +2 -0
- package/dist/material-theme-ocean-vbjhpav2.js +2 -0
- package/dist/material-theme-palenight-zvsby2j7.js +2 -0
- package/dist/matlab-7z9bsz8e.js +2 -0
- package/dist/md.js +4 -0
- package/dist/mdc-fnzmnxrv.js +2 -0
- package/dist/mdx-txks2jee.js +2 -0
- package/dist/mermaid-2geg9v5h.js +2 -0
- package/dist/min-dark-p6btg8dq.js +2 -0
- package/dist/min-light-v3br1wzp.js +2 -0
- package/dist/mipsasm-npsfhz7p.js +2 -0
- package/dist/mojo-53s8q8kz.js +2 -0
- package/dist/monokai-j1kkm1ja.js +2 -0
- package/dist/moonbit-gcr903w0.js +2 -0
- package/dist/move-4vm43y7r.js +2 -0
- package/dist/narrat-4dfafp1n.js +2 -0
- package/dist/nextflow-gen0wthn.js +2 -0
- package/dist/nextflow-groovy-rntv4ct1.js +2 -0
- package/dist/nginx-md97v71f.js +2 -0
- package/dist/night-owl-bgdmn1df.js +2 -0
- package/dist/night-owl-light-jka34m0q.js +2 -0
- package/dist/nim-fngvzh2t.js +2 -0
- package/dist/nix-x4emth0n.js +2 -0
- package/dist/nord-xscwecj8.js +2 -0
- package/dist/nushell-tjxswzet.js +2 -0
- package/dist/objective-c-nk9a9yrs.js +2 -0
- package/dist/objective-cpp-p6sapemd.js +2 -0
- package/dist/ocaml-bcy7sgka.js +2 -0
- package/dist/odin-5vrv5d1s.js +2 -0
- package/dist/one-dark-pro-r96tb03e.js +2 -0
- package/dist/one-light-bfcdemmg.js +2 -0
- package/dist/openscad-w36wsg83.js +2 -0
- package/dist/pascal-zje13224.js +2 -0
- package/dist/perl-jb96y2dw.js +2 -0
- package/dist/php-66y7zdam.js +2 -0
- package/dist/pkl-j08f73a2.js +2 -0
- package/dist/plastic-d95k0yjm.js +2 -0
- package/dist/plsql-a5tqv6r5.js +2 -0
- package/dist/po-z4zztbvf.js +2 -0
- package/dist/poimandres-ft3p00vk.js +2 -0
- package/dist/polar-45ka4fdw.js +2 -0
- package/dist/postcss-ak75ftnf.js +2 -0
- package/dist/powerquery-j6z2e9xw.js +2 -0
- package/dist/powershell-ca63wk2e.js +2 -0
- package/dist/prisma-b2y4avdt.js +2 -0
- package/dist/prolog-wktkj1zv.js +2 -0
- package/dist/proto-5pd1z1zv.js +2 -0
- package/dist/pug-80k5jz6p.js +2 -0
- package/dist/puppet-66683nhq.js +2 -0
- package/dist/purescript-cmqqet79.js +2 -0
- package/dist/python-jabyzx3d.js +2 -0
- package/dist/qml-d92cbtkt.js +2 -0
- package/dist/qmldir-za85z5zc.js +2 -0
- package/dist/qss-gh7cf1zk.js +2 -0
- package/dist/r-s39xqqt9.js +2 -0
- package/dist/racket-gbjk3es0.js +2 -0
- package/dist/raku-zqwbnxmq.js +2 -0
- package/dist/razor-zg3bck80.js +2 -0
- package/dist/red-k6970d1d.js +2 -0
- package/dist/reg-gserh519.js +2 -0
- package/dist/regexp-a95pq17y.js +2 -0
- package/dist/rel-gaefrfhc.js +2 -0
- package/dist/riscv-cszphkwv.js +2 -0
- package/dist/ron-yf5x21c5.js +2 -0
- package/dist/rose-pine-1zbcjg1b.js +2 -0
- package/dist/rose-pine-dawn-tmsqdesr.js +2 -0
- package/dist/rose-pine-moon-cmwgg41b.js +2 -0
- package/dist/rosmsg-8j5zf8wv.js +2 -0
- package/dist/rst-7trgmfaq.js +2 -0
- package/dist/ruby-2svq4615.js +2 -0
- package/dist/rust-q5spk848.js +2 -0
- package/dist/sas-qhcyyrbt.js +2 -0
- package/dist/sass-qwyex0n3.js +2 -0
- package/dist/scala-jmhd870s.js +2 -0
- package/dist/scheme-5dvkrg0d.js +2 -0
- package/dist/scss-7v9m0m7d.js +2 -0
- package/dist/sdbl-93kewz9d.js +2 -0
- package/dist/shaderlab-97e0480d.js +2 -0
- package/dist/shellscript-6mxk36va.js +2 -0
- package/dist/shellsession-c7mva2xt.js +2 -0
- package/dist/slack-dark-y62znhvd.js +2 -0
- package/dist/slack-ochin-esm65n7t.js +2 -0
- package/dist/smalltalk-fkw0jz97.js +2 -0
- package/dist/snazzy-light-gdz5rv1k.js +2 -0
- package/dist/solarized-dark-zgcy8wm4.js +2 -0
- package/dist/solarized-light-66pg8xzk.js +2 -0
- package/dist/solidity-q5d4ht8n.js +2 -0
- package/dist/soy-hhhx5cj0.js +2 -0
- package/dist/sparql-hm2pqpge.js +2 -0
- package/dist/splunk-w5h843nw.js +2 -0
- package/dist/sql-pas3x5ke.js +2 -0
- package/dist/ssh-config-n2kt2cym.js +2 -0
- package/dist/stata-9j4p5d8c.js +2 -0
- package/dist/stylus-9s01c3kp.js +2 -0
- package/dist/surrealql-gxntasn8.js +2 -0
- package/dist/svelte-nvgnrg0t.js +2 -0
- package/dist/swift-j07yna4k.js +2 -0
- package/dist/synthwave-84-d7yw2bf0.js +2 -0
- package/dist/system-verilog-30bs377q.js +2 -0
- package/dist/systemd-4252hbv8.js +2 -0
- package/dist/talonscript-qbxwesm0.js +2 -0
- package/dist/tasl-m18yj07w.js +2 -0
- package/dist/tcl-qfvbg90f.js +2 -0
- package/dist/templ-msv3jzfx.js +2 -0
- package/dist/terraform-w6q6kyy0.js +2 -0
- package/dist/tex-1h8385qh.js +2 -0
- package/dist/tokyo-night-11kv01fx.js +2 -0
- package/dist/toml-02rkjp4b.js +2 -0
- package/dist/ts-tags-zmwja4z5.js +2 -0
- package/dist/tsv-t7svepav.js +2 -0
- package/dist/tsx-5ck84m8p.js +2 -0
- package/dist/turtle-synzazfp.js +2 -0
- package/dist/twig-41166c5j.js +2 -0
- package/dist/typescript-cqey3bjn.js +2 -0
- package/dist/typespec-ddd8ynv9.js +2 -0
- package/dist/typst-ex558216.js +2 -0
- package/dist/v-1bn5h0en.js +2 -0
- package/dist/vala-078a3s0x.js +2 -0
- package/dist/vb-5sq26hr3.js +2 -0
- package/dist/verilog-ekh48e1e.js +2 -0
- package/dist/vesper-j18bqpbg.js +2 -0
- package/dist/vhdl-fhjza3xz.js +2 -0
- package/dist/viml-9jfzgmge.js +2 -0
- package/dist/vitesse-black-3b8qwvte.js +2 -0
- package/dist/vitesse-dark-bsvtvg1h.js +2 -0
- package/dist/vitesse-light-egp8j39z.js +2 -0
- package/dist/vue-6yd2mg34.js +2 -0
- package/dist/vue-html-y5mtwexa.js +2 -0
- package/dist/vue-vine-732a4732.js +2 -0
- package/dist/vyper-h4fr87vt.js +2 -0
- package/dist/wasm-c0hbsbpk.js +2 -0
- package/dist/wasm-xe5dxyky.js +2 -0
- package/dist/wenyan-pf79c6ns.js +2 -0
- package/dist/wgsl-20v05k5y.js +2 -0
- package/dist/wikitext-6vf691aw.js +2 -0
- package/dist/wit-gp0gbqxw.js +2 -0
- package/dist/wolfram-y1r4y7zp.js +2 -0
- package/dist/xml-9fqvyqnc.js +2 -0
- package/dist/xsl-xpzpqrmc.js +2 -0
- package/dist/yaml-885sffq4.js +2 -0
- package/dist/zenscript-0k3ar154.js +2 -0
- package/dist/zig-h5gys7p5.js +2 -0
- package/package.json +51 -23
- package/src/app/cli-info.ts +90 -0
- package/src/app/errors.ts +19 -0
- package/src/app/file-not-found-error.ts +6 -0
- package/src/app/format-error.ts +35 -0
- package/src/app/invalid-theme-error.ts +6 -0
- package/src/app/pager-error.ts +5 -0
- package/src/app/run-md.ts +197 -0
- package/src/app/stdin-read-error.ts +5 -0
- package/src/cli/options.ts +20 -0
- package/src/cli-app.ts +113 -0
- package/src/cli.ts +64 -0
- package/src/config/errors.ts +6 -0
- package/src/config/index.ts +183 -0
- package/src/config/read-error.ts +6 -0
- package/src/constants.ts +2 -0
- package/src/index.ts +51 -0
- package/src/lib/ansi.ts +24 -0
- package/src/lib/config.ts +2 -0
- package/src/lib/default-config.toml +25 -0
- package/src/lib/elements/blockquote.ts +34 -0
- package/src/lib/elements/code.ts +326 -0
- package/src/lib/elements/heading.ts +39 -0
- package/src/lib/elements/link.ts +33 -0
- package/src/lib/elements/list.ts +89 -0
- package/src/lib/elements/table.ts +65 -0
- package/src/lib/elements/text.ts +237 -0
- package/src/lib/languages.ts +123 -0
- package/src/lib/layout.ts +67 -0
- package/src/lib/pager.ts +121 -0
- package/src/lib/parser.ts +299 -0
- package/src/lib/render-code-blocks.ts +25 -0
- package/src/lib/render.ts +37 -0
- package/src/lib/shiki.ts +197 -0
- package/src/lib/width.ts +21 -0
- package/src/paths.ts +14 -0
- package/src/ui/banner.ts +23 -0
- package/src/ui/picker.ts +120 -0
- package/src/ui/themes/ansi.ts +161 -0
- package/src/ui/themes/color-support.ts +106 -0
- package/src/ui/themes/generated.ts +748 -0
- package/src/ui/themes/index.ts +58 -0
- package/src/ui/themes/overrides.ts +83 -0
- package/src/ui/themes/semantic.ts +125 -0
- package/src/ui/themes/types.ts +67 -0
- package/dist/index.js +0 -194
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
// Src/ui/themes/index.ts
|
|
2
|
+
import { type ThemeId, themeIds, themes } from './generated';
|
|
3
|
+
import type { ThemePalette } from './types';
|
|
4
|
+
|
|
5
|
+
const DEFAULT_THEME: ThemeId = 'catppuccin-frappe';
|
|
6
|
+
const fallbackTheme: ThemePalette = {
|
|
7
|
+
colors: {
|
|
8
|
+
accent: '#8caaee',
|
|
9
|
+
auxiliary: '#232634',
|
|
10
|
+
bg: '#303446',
|
|
11
|
+
emphasis: '#c6d0f5',
|
|
12
|
+
error: '#e78284',
|
|
13
|
+
info: '#8caaee',
|
|
14
|
+
muted: '#838ba7',
|
|
15
|
+
subtle: '#51576d',
|
|
16
|
+
success: '#a6d189',
|
|
17
|
+
surface: '#292c3c',
|
|
18
|
+
text: '#c6d0f5',
|
|
19
|
+
warning: '#ef9f76',
|
|
20
|
+
},
|
|
21
|
+
id: DEFAULT_THEME,
|
|
22
|
+
name: 'Catppuccin Frappe',
|
|
23
|
+
shikiTheme: DEFAULT_THEME,
|
|
24
|
+
type: 'dark',
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
const requireTheme = (id: ThemeId): ThemePalette => {
|
|
28
|
+
const palette = themes[id];
|
|
29
|
+
return palette ?? themes[DEFAULT_THEME] ?? fallbackTheme;
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
let activeTheme: ThemePalette = requireTheme(DEFAULT_THEME);
|
|
33
|
+
|
|
34
|
+
/** Check if a theme ID is valid */
|
|
35
|
+
const isValidTheme = (id: string): id is ThemeId => id in themes;
|
|
36
|
+
|
|
37
|
+
/** Get a theme by ID, returns default theme if not found */
|
|
38
|
+
const getTheme = (id: string): ThemePalette => {
|
|
39
|
+
if (isValidTheme(id)) {
|
|
40
|
+
return requireTheme(id);
|
|
41
|
+
}
|
|
42
|
+
return requireTheme(DEFAULT_THEME);
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
/** Set the active theme */
|
|
46
|
+
const loadTheme = (id: string): void => {
|
|
47
|
+
activeTheme = getTheme(id);
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
/** Get the currently active theme */
|
|
51
|
+
const theme = (): ThemePalette => activeTheme;
|
|
52
|
+
|
|
53
|
+
/** Get all available theme IDs */
|
|
54
|
+
const availableThemes = (): readonly ThemeId[] => themeIds;
|
|
55
|
+
|
|
56
|
+
export type { ThemeColors, ThemeOverrides, ThemePalette } from './types';
|
|
57
|
+
export { ansiBg, ansiBold, ansiFg, ansiFgBg, ansiItalic, hexToAnsi256 } from './ansi';
|
|
58
|
+
export { availableThemes, getTheme, isValidTheme, loadTheme, theme, themeIds, type ThemeId };
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
// Src/ui/themes/overrides.ts
|
|
2
|
+
import type { ThemeOverrides } from './types';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Manual overrides for themes with specific character.
|
|
6
|
+
* Only define what differs from the auto-extracted base palette.
|
|
7
|
+
*/
|
|
8
|
+
export const themeOverrides: Record<string, ThemeOverrides> = {
|
|
9
|
+
'catppuccin-frappe': {
|
|
10
|
+
// Pink
|
|
11
|
+
bold: '#f4b8e4',
|
|
12
|
+
// Mauve
|
|
13
|
+
h1: '#ca9ee6',
|
|
14
|
+
// Lavender
|
|
15
|
+
h2: '#babbf1',
|
|
16
|
+
// Blue
|
|
17
|
+
h3: '#8caaee',
|
|
18
|
+
// Teal
|
|
19
|
+
h4: '#81c8be',
|
|
20
|
+
// Rosewater on mantle
|
|
21
|
+
inlineCode: { bg: '#292c3c', fg: '#f2d5cf' },
|
|
22
|
+
// Sky
|
|
23
|
+
italic: '#99d1db',
|
|
24
|
+
},
|
|
25
|
+
'catppuccin-latte': {
|
|
26
|
+
bold: '#ea76cb',
|
|
27
|
+
h1: '#8839ef',
|
|
28
|
+
h2: '#7287fd',
|
|
29
|
+
h3: '#1e66f5',
|
|
30
|
+
h4: '#179299',
|
|
31
|
+
inlineCode: { bg: '#e6e9ef', fg: '#dc8a78' },
|
|
32
|
+
italic: '#04a5e5',
|
|
33
|
+
},
|
|
34
|
+
'catppuccin-macchiato': {
|
|
35
|
+
bold: '#f5bde6',
|
|
36
|
+
h1: '#c6a0f6',
|
|
37
|
+
h2: '#b7bdf8',
|
|
38
|
+
h3: '#8aadf4',
|
|
39
|
+
h4: '#8bd5ca',
|
|
40
|
+
inlineCode: { bg: '#1e2030', fg: '#f4dbd6' },
|
|
41
|
+
italic: '#91d7e3',
|
|
42
|
+
},
|
|
43
|
+
'catppuccin-mocha': {
|
|
44
|
+
bold: '#f5c2e7',
|
|
45
|
+
h1: '#cba6f7',
|
|
46
|
+
h2: '#b4befe',
|
|
47
|
+
h3: '#89b4fa',
|
|
48
|
+
h4: '#94e2d5',
|
|
49
|
+
inlineCode: { bg: '#181825', fg: '#f5e0dc' },
|
|
50
|
+
italic: '#89dceb',
|
|
51
|
+
},
|
|
52
|
+
dracula: { bold: '#ff79c6', h1: '#bd93f9', h2: '#ff79c6', h3: '#8be9fd', italic: '#8be9fd' },
|
|
53
|
+
'dracula-soft': {
|
|
54
|
+
bold: '#ff79c6',
|
|
55
|
+
h1: '#bd93f9',
|
|
56
|
+
h2: '#ff79c6',
|
|
57
|
+
h3: '#8be9fd',
|
|
58
|
+
italic: '#8be9fd',
|
|
59
|
+
},
|
|
60
|
+
nord: { bold: '#88c0d0', h1: '#88c0d0', h2: '#81a1c1', h3: '#5e81ac', italic: '#81a1c1' },
|
|
61
|
+
'rose-pine': { bold: '#ebbcba', h1: '#c4a7e7', h2: '#ebbcba', h3: '#9ccfd8', italic: '#9ccfd8' },
|
|
62
|
+
'rose-pine-dawn': {
|
|
63
|
+
bold: '#d7827e',
|
|
64
|
+
h1: '#907aa9',
|
|
65
|
+
h2: '#d7827e',
|
|
66
|
+
h3: '#56949f',
|
|
67
|
+
italic: '#56949f',
|
|
68
|
+
},
|
|
69
|
+
'rose-pine-moon': {
|
|
70
|
+
bold: '#ebbcba',
|
|
71
|
+
h1: '#c4a7e7',
|
|
72
|
+
h2: '#ebbcba',
|
|
73
|
+
h3: '#9ccfd8',
|
|
74
|
+
italic: '#9ccfd8',
|
|
75
|
+
},
|
|
76
|
+
'tokyo-night': {
|
|
77
|
+
bold: '#bb9af7',
|
|
78
|
+
h1: '#bb9af7',
|
|
79
|
+
h2: '#7aa2f7',
|
|
80
|
+
h3: '#7dcfff',
|
|
81
|
+
italic: '#7dcfff',
|
|
82
|
+
},
|
|
83
|
+
};
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
// Src/ui/themes/semantic.ts
|
|
2
|
+
|
|
3
|
+
import { ansiBold, ansiFg, ansiFgBg, ansiFgTransition, ansiItalic } from './ansi';
|
|
4
|
+
import { theme } from './index';
|
|
5
|
+
|
|
6
|
+
type StyleFn = (text: string) => string;
|
|
7
|
+
|
|
8
|
+
interface HexColors {
|
|
9
|
+
accent: string;
|
|
10
|
+
h1: string;
|
|
11
|
+
subtle: string;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
interface GradientColors {
|
|
15
|
+
banner: string[];
|
|
16
|
+
error: string[];
|
|
17
|
+
success: string[];
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
/** Get bold text style (uses override or emphasis color) */
|
|
21
|
+
export const getBoldStyle = (): StyleFn => {
|
|
22
|
+
const t = theme();
|
|
23
|
+
const color = t.overrides?.bold ?? t.colors.emphasis;
|
|
24
|
+
return ansiBold(color);
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
/** Get italic text style (uses override or auxiliary color) */
|
|
28
|
+
export const getItalicStyle = (): StyleFn => {
|
|
29
|
+
const t = theme();
|
|
30
|
+
const color = t.overrides?.italic ?? t.colors.auxiliary;
|
|
31
|
+
return ansiItalic(color);
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
/** Get inline code style (fg + bg) */
|
|
35
|
+
export const getInlineCodeStyle = (): StyleFn => {
|
|
36
|
+
const t = theme();
|
|
37
|
+
if (t.overrides?.inlineCode) {
|
|
38
|
+
return ansiFgBg(t.overrides.inlineCode.fg, t.overrides.inlineCode.bg);
|
|
39
|
+
}
|
|
40
|
+
return ansiFgBg(t.colors.accent, t.colors.surface);
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
/** Get heading color by level (1-5) */
|
|
44
|
+
export const getHeadingColor = (level: number): StyleFn => {
|
|
45
|
+
const t = theme();
|
|
46
|
+
const o = t.overrides;
|
|
47
|
+
const heading = o?.heading;
|
|
48
|
+
|
|
49
|
+
switch (level) {
|
|
50
|
+
case 1: {
|
|
51
|
+
return ansiFg(o?.h1 ?? heading ?? t.colors.accent);
|
|
52
|
+
}
|
|
53
|
+
case 2: {
|
|
54
|
+
return ansiFg(o?.h2 ?? heading ?? t.colors.accent);
|
|
55
|
+
}
|
|
56
|
+
case 3: {
|
|
57
|
+
return ansiFg(o?.h3 ?? heading ?? t.colors.info);
|
|
58
|
+
}
|
|
59
|
+
case 4: {
|
|
60
|
+
return ansiFg(o?.h4 ?? heading ?? t.colors.auxiliary);
|
|
61
|
+
}
|
|
62
|
+
default: {
|
|
63
|
+
return ansiFg(t.colors.muted);
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
/** Get link color */
|
|
69
|
+
export const getLinkColor = (): StyleFn => {
|
|
70
|
+
const t = theme();
|
|
71
|
+
return ansiFg(t.overrides?.link ?? t.colors.accent);
|
|
72
|
+
};
|
|
73
|
+
|
|
74
|
+
/** Get body text color */
|
|
75
|
+
export const getTextColor = (): StyleFn => ansiFg(theme().colors.text);
|
|
76
|
+
|
|
77
|
+
/** Get muted/secondary text color */
|
|
78
|
+
export const getMutedColor = (): StyleFn => ansiFg(theme().colors.muted);
|
|
79
|
+
|
|
80
|
+
/** Get subtle/border color */
|
|
81
|
+
export const getSubtleColor = (): StyleFn => ansiFg(theme().colors.subtle);
|
|
82
|
+
|
|
83
|
+
/** Get error color */
|
|
84
|
+
export const getErrorColor = (): StyleFn => ansiFg(theme().colors.error);
|
|
85
|
+
|
|
86
|
+
/** Get success color */
|
|
87
|
+
export const getSuccessColor = (): StyleFn => ansiFg(theme().colors.success);
|
|
88
|
+
|
|
89
|
+
/** Get accent color (headings, links, list markers) */
|
|
90
|
+
export const getAccentColor = (): StyleFn => ansiFg(theme().colors.accent);
|
|
91
|
+
|
|
92
|
+
/** Get hex color values for libraries that need hex (boxen, gradient-string) */
|
|
93
|
+
export const getHexColors = (): HexColors => {
|
|
94
|
+
const t = theme();
|
|
95
|
+
return {
|
|
96
|
+
accent: t.colors.accent,
|
|
97
|
+
h1: t.overrides?.h1 ?? t.overrides?.heading ?? t.colors.accent,
|
|
98
|
+
subtle: t.colors.subtle,
|
|
99
|
+
};
|
|
100
|
+
};
|
|
101
|
+
|
|
102
|
+
/** Style box title that transitions back to border color instead of resetting */
|
|
103
|
+
export const getBoxTitleStyle = (): StyleFn => {
|
|
104
|
+
const t = theme();
|
|
105
|
+
const titleColor = t.overrides?.link ?? t.colors.accent;
|
|
106
|
+
const borderColor = t.colors.subtle;
|
|
107
|
+
return ansiFgTransition(titleColor, borderColor);
|
|
108
|
+
};
|
|
109
|
+
|
|
110
|
+
/** Get gradient color arrays for gradient-string library */
|
|
111
|
+
export const getGradientColors = (): GradientColors => {
|
|
112
|
+
const t = theme();
|
|
113
|
+
const o = t.overrides;
|
|
114
|
+
|
|
115
|
+
const banner = [
|
|
116
|
+
o?.h1 ?? o?.heading ?? t.colors.accent,
|
|
117
|
+
o?.bold ?? o?.h2 ?? t.colors.emphasis,
|
|
118
|
+
o?.h2 ?? t.colors.info,
|
|
119
|
+
];
|
|
120
|
+
|
|
121
|
+
const success = [t.colors.success, t.colors.info];
|
|
122
|
+
const error = [t.colors.error, t.colors.warning];
|
|
123
|
+
|
|
124
|
+
return { banner, error, success };
|
|
125
|
+
};
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
// Src/ui/themes/types.ts
|
|
2
|
+
|
|
3
|
+
/** Core color roles for markdown rendering */
|
|
4
|
+
export interface ThemeColors {
|
|
5
|
+
/** Main background */
|
|
6
|
+
bg: string;
|
|
7
|
+
/** Elevated surfaces (code blocks, boxes) */
|
|
8
|
+
surface: string;
|
|
9
|
+
/** Body text */
|
|
10
|
+
text: string;
|
|
11
|
+
/** Secondary text, blockquotes */
|
|
12
|
+
muted: string;
|
|
13
|
+
/** Borders, decorations */
|
|
14
|
+
subtle: string;
|
|
15
|
+
/** Headings, links */
|
|
16
|
+
accent: string;
|
|
17
|
+
/** Bold text */
|
|
18
|
+
emphasis: string;
|
|
19
|
+
/** Italic text */
|
|
20
|
+
auxiliary: string;
|
|
21
|
+
error: string;
|
|
22
|
+
warning: string;
|
|
23
|
+
success: string;
|
|
24
|
+
info: string;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
/** Optional overrides for theme-specific character */
|
|
28
|
+
export interface ThemeOverrides {
|
|
29
|
+
bold?: string;
|
|
30
|
+
italic?: string;
|
|
31
|
+
inlineCode?: { fg: string; bg: string };
|
|
32
|
+
link?: string;
|
|
33
|
+
heading?: string;
|
|
34
|
+
h1?: string;
|
|
35
|
+
h2?: string;
|
|
36
|
+
h3?: string;
|
|
37
|
+
h4?: string;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
/** Complete theme definition */
|
|
41
|
+
export interface ThemePalette {
|
|
42
|
+
/** Display name (e.g., "Catppuccin Frappe") */
|
|
43
|
+
name: string;
|
|
44
|
+
/** Theme ID (e.g., "catppuccin-frappe") */
|
|
45
|
+
id: string;
|
|
46
|
+
/** Shiki theme ID for code highlighting */
|
|
47
|
+
shikiTheme: string;
|
|
48
|
+
type: 'light' | 'dark';
|
|
49
|
+
colors: ThemeColors;
|
|
50
|
+
overrides?: ThemeOverrides;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
/** Mapping from Shiki theme JSON keys to our color roles */
|
|
54
|
+
export interface ShikiColorMapping {
|
|
55
|
+
bg: string;
|
|
56
|
+
surface: string;
|
|
57
|
+
text: string;
|
|
58
|
+
muted: string;
|
|
59
|
+
subtle: string;
|
|
60
|
+
accent: string;
|
|
61
|
+
emphasis: string;
|
|
62
|
+
auxiliary: string;
|
|
63
|
+
error: string;
|
|
64
|
+
warning: string;
|
|
65
|
+
success: string;
|
|
66
|
+
info: string;
|
|
67
|
+
}
|