rn-shiki 0.0.8 → 0.0.9
Sign up to get free protection for your applications and to get access to all the features.
- package/eslint.config.mjs +1 -4
- package/lib/commonjs/components/syntax/SyntaxHighlighter.js +9 -3
- package/lib/commonjs/components/syntax/SyntaxHighlighter.js.map +1 -1
- package/lib/commonjs/hooks/useSyntaxHighlighter.js +6 -4
- package/lib/commonjs/hooks/useSyntaxHighlighter.js.map +1 -1
- package/lib/commonjs/index.js +10 -3
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/langs.js +28 -0
- package/lib/commonjs/langs.js.map +1 -0
- package/lib/commonjs/syntax/highlighter/index.js +5 -97
- package/lib/commonjs/syntax/highlighter/index.js.map +1 -1
- package/lib/commonjs/syntax/index.js +0 -7
- package/lib/commonjs/syntax/index.js.map +1 -1
- package/lib/commonjs/themes.js +28 -0
- package/lib/commonjs/themes.js.map +1 -0
- package/lib/module/components/syntax/SyntaxHighlighter.js +74 -0
- package/lib/module/components/syntax/SyntaxHighlighter.js.map +1 -0
- package/lib/module/components/syntax/SyntaxLine.js +31 -0
- package/lib/module/components/syntax/SyntaxLine.js.map +1 -0
- package/lib/module/components/syntax/index.js +5 -0
- package/lib/module/components/syntax/index.js.map +1 -0
- package/lib/module/hooks/useSyntaxHighlighter.js +60 -0
- package/lib/module/hooks/useSyntaxHighlighter.js.map +1 -0
- package/lib/module/index.js +6 -0
- package/lib/module/index.js.map +1 -0
- package/lib/module/langs.js +20 -0
- package/lib/module/langs.js.map +1 -0
- package/lib/module/package.json +1 -0
- package/lib/module/syntax/highlighter/index.js +33 -0
- package/lib/module/syntax/highlighter/index.js.map +1 -0
- package/lib/module/syntax/index.js +4 -0
- package/lib/module/syntax/index.js.map +1 -0
- package/lib/module/themes.js +20 -0
- package/lib/module/themes.js.map +1 -0
- package/lib/module/types/index.js +2 -0
- package/lib/module/types/index.js.map +1 -0
- package/lib/module/utils/index.js +4 -0
- package/lib/module/utils/index.js.map +1 -0
- package/lib/module/utils/string.js +22 -0
- package/lib/module/utils/string.js.map +1 -0
- package/lib/typescript/src/components/syntax/SyntaxHighlighter.d.ts +13 -0
- package/lib/typescript/src/components/syntax/SyntaxHighlighter.d.ts.map +1 -0
- package/lib/typescript/src/components/syntax/SyntaxLine.d.ts.map +1 -0
- package/lib/typescript/src/components/syntax/index.d.ts.map +1 -0
- package/lib/typescript/src/hooks/useSyntaxHighlighter.d.ts +15 -0
- package/lib/typescript/src/hooks/useSyntaxHighlighter.d.ts.map +1 -0
- package/lib/typescript/src/index.d.ts +4 -0
- package/lib/typescript/src/index.d.ts.map +1 -0
- package/lib/typescript/src/langs.d.ts +6 -0
- package/lib/typescript/src/langs.d.ts.map +1 -0
- package/lib/typescript/src/syntax/highlighter/index.d.ts +9 -0
- package/lib/typescript/src/syntax/highlighter/index.d.ts.map +1 -0
- package/lib/typescript/src/syntax/index.d.ts +2 -0
- package/lib/typescript/src/syntax/index.d.ts.map +1 -0
- package/lib/typescript/src/themes.d.ts +6 -0
- package/lib/typescript/src/themes.d.ts.map +1 -0
- package/lib/typescript/src/types/index.d.ts.map +1 -0
- package/lib/typescript/src/utils/index.d.ts.map +1 -0
- package/lib/typescript/src/utils/string.d.ts.map +1 -0
- package/package.json +4 -2
- package/scripts/build.js +98 -19
- package/src/components/syntax/SyntaxHighlighter.tsx +17 -4
- package/src/hooks/useSyntaxHighlighter.ts +15 -8
- package/src/index.ts +2 -2
- package/src/langs.ts +20 -0
- package/src/syntax/highlighter/index.ts +5 -127
- package/src/syntax/index.ts +0 -2
- package/src/themes.ts +20 -0
- package/vendor/shiki/langs/abap.d.ts +6 -0
- package/vendor/shiki/langs/actionscript-3.d.ts +6 -0
- package/vendor/shiki/langs/ada.d.ts +6 -0
- package/vendor/shiki/langs/adoc.d.ts +6 -0
- package/vendor/shiki/langs/angular-expression.d.ts +6 -0
- package/vendor/shiki/langs/angular-html.d.ts +6 -0
- package/vendor/shiki/langs/angular-inline-style.d.ts +6 -0
- package/vendor/shiki/langs/angular-inline-template.d.ts +6 -0
- package/vendor/shiki/langs/angular-let-declaration.d.ts +6 -0
- package/vendor/shiki/langs/angular-template-blocks.d.ts +6 -0
- package/vendor/shiki/langs/angular-template.d.ts +6 -0
- package/vendor/shiki/langs/angular-ts.d.ts +6 -0
- package/vendor/shiki/langs/apache.d.ts +6 -0
- package/vendor/shiki/langs/apex.d.ts +6 -0
- package/vendor/shiki/langs/apl.d.ts +6 -0
- package/vendor/shiki/langs/applescript.d.ts +6 -0
- package/vendor/shiki/langs/ara.d.ts +6 -0
- package/vendor/shiki/langs/asciidoc.d.ts +6 -0
- package/vendor/shiki/langs/asm.d.ts +6 -0
- package/vendor/shiki/langs/astro.d.ts +6 -0
- package/vendor/shiki/langs/awk.d.ts +6 -0
- package/vendor/shiki/langs/ballerina.d.ts +6 -0
- package/vendor/shiki/langs/bash.d.ts +6 -0
- package/vendor/shiki/langs/bat.d.ts +6 -0
- package/vendor/shiki/langs/batch.d.ts +6 -0
- package/vendor/shiki/langs/be.d.ts +6 -0
- package/vendor/shiki/langs/beancount.d.ts +6 -0
- package/vendor/shiki/langs/berry.d.ts +6 -0
- package/vendor/shiki/langs/bibtex.d.ts +6 -0
- package/vendor/shiki/langs/bicep.d.ts +6 -0
- package/vendor/shiki/langs/blade.d.ts +6 -0
- package/vendor/shiki/langs/c.d.ts +6 -0
- package/vendor/shiki/langs/cadence.d.ts +6 -0
- package/vendor/shiki/langs/cdc.d.ts +6 -0
- package/vendor/shiki/langs/clarity.d.ts +6 -0
- package/vendor/shiki/langs/clj.d.ts +6 -0
- package/vendor/shiki/langs/clojure.d.ts +6 -0
- package/vendor/shiki/langs/closure-templates.d.ts +6 -0
- package/vendor/shiki/langs/cmake.d.ts +6 -0
- package/vendor/shiki/langs/cmd.d.ts +6 -0
- package/vendor/shiki/langs/cobol.d.ts +6 -0
- package/vendor/shiki/langs/codeowners.d.ts +6 -0
- package/vendor/shiki/langs/codeql.d.ts +6 -0
- package/vendor/shiki/langs/coffee.d.ts +6 -0
- package/vendor/shiki/langs/coffeescript.d.ts +6 -0
- package/vendor/shiki/langs/common-lisp.d.ts +6 -0
- package/vendor/shiki/langs/console.d.ts +6 -0
- package/vendor/shiki/langs/coq.d.ts +6 -0
- package/vendor/shiki/langs/cpp-macro.d.ts +6 -0
- package/vendor/shiki/langs/cpp.d.ts +6 -0
- package/vendor/shiki/langs/cql.d.ts +6 -0
- package/vendor/shiki/langs/crystal.d.ts +6 -0
- package/vendor/shiki/langs/cs.d.ts +6 -0
- package/vendor/shiki/langs/csharp.d.ts +6 -0
- package/vendor/shiki/langs/css.d.ts +6 -0
- package/vendor/shiki/langs/csv.d.ts +6 -0
- package/vendor/shiki/langs/cue.d.ts +6 -0
- package/vendor/shiki/langs/cypher.d.ts +6 -0
- package/vendor/shiki/langs/d.d.ts +6 -0
- package/vendor/shiki/langs/dart.d.ts +6 -0
- package/vendor/shiki/langs/dax.d.ts +6 -0
- package/vendor/shiki/langs/desktop.d.ts +6 -0
- package/vendor/shiki/langs/diff.d.ts +6 -0
- package/vendor/shiki/langs/docker.d.ts +6 -0
- package/vendor/shiki/langs/dockerfile.d.ts +6 -0
- package/vendor/shiki/langs/dotenv.d.ts +6 -0
- package/vendor/shiki/langs/dream-maker.d.ts +6 -0
- package/vendor/shiki/langs/edge.d.ts +6 -0
- package/vendor/shiki/langs/elisp.d.ts +6 -0
- package/vendor/shiki/langs/elixir.d.ts +6 -0
- package/vendor/shiki/langs/elm.d.ts +6 -0
- package/vendor/shiki/langs/emacs-lisp.d.ts +6 -0
- package/vendor/shiki/langs/erb.d.ts +6 -0
- package/vendor/shiki/langs/erl.d.ts +6 -0
- package/vendor/shiki/langs/erlang.d.ts +6 -0
- package/vendor/shiki/langs/es-tag-css.d.ts +6 -0
- package/vendor/shiki/langs/es-tag-glsl.d.ts +6 -0
- package/vendor/shiki/langs/es-tag-html.d.ts +6 -0
- package/vendor/shiki/langs/es-tag-sql.d.ts +6 -0
- package/vendor/shiki/langs/es-tag-xml.d.ts +6 -0
- package/vendor/shiki/langs/f.d.ts +6 -0
- package/vendor/shiki/langs/f03.d.ts +6 -0
- package/vendor/shiki/langs/f08.d.ts +6 -0
- package/vendor/shiki/langs/f18.d.ts +6 -0
- package/vendor/shiki/langs/f77.d.ts +6 -0
- package/vendor/shiki/langs/f90.d.ts +6 -0
- package/vendor/shiki/langs/f95.d.ts +6 -0
- package/vendor/shiki/langs/fennel.d.ts +6 -0
- package/vendor/shiki/langs/fish.d.ts +6 -0
- package/vendor/shiki/langs/fluent.d.ts +6 -0
- package/vendor/shiki/langs/for.d.ts +6 -0
- package/vendor/shiki/langs/fortran-fixed-form.d.ts +6 -0
- package/vendor/shiki/langs/fortran-free-form.d.ts +6 -0
- package/vendor/shiki/langs/fs.d.ts +6 -0
- package/vendor/shiki/langs/fsharp.d.ts +6 -0
- package/vendor/shiki/langs/fsl.d.ts +6 -0
- package/vendor/shiki/langs/ftl.d.ts +6 -0
- package/vendor/shiki/langs/gdresource.d.ts +6 -0
- package/vendor/shiki/langs/gdscript.d.ts +6 -0
- package/vendor/shiki/langs/gdshader.d.ts +6 -0
- package/vendor/shiki/langs/genie.d.ts +6 -0
- package/vendor/shiki/langs/gherkin.d.ts +6 -0
- package/vendor/shiki/langs/git-commit.d.ts +6 -0
- package/vendor/shiki/langs/git-rebase.d.ts +6 -0
- package/vendor/shiki/langs/gjs.d.ts +6 -0
- package/vendor/shiki/langs/gleam.d.ts +6 -0
- package/vendor/shiki/langs/glimmer-js.d.ts +6 -0
- package/vendor/shiki/langs/glimmer-ts.d.ts +6 -0
- package/vendor/shiki/langs/glsl.d.ts +6 -0
- package/vendor/shiki/langs/gnuplot.d.ts +6 -0
- package/vendor/shiki/langs/go.d.ts +6 -0
- package/vendor/shiki/langs/gql.d.ts +6 -0
- package/vendor/shiki/langs/graphql.d.ts +6 -0
- package/vendor/shiki/langs/groovy.d.ts +6 -0
- package/vendor/shiki/langs/gts.d.ts +6 -0
- package/vendor/shiki/langs/hack.d.ts +6 -0
- package/vendor/shiki/langs/haml.d.ts +6 -0
- package/vendor/shiki/langs/handlebars.d.ts +6 -0
- package/vendor/shiki/langs/haskell.d.ts +6 -0
- package/vendor/shiki/langs/haxe.d.ts +6 -0
- package/vendor/shiki/langs/hbs.d.ts +6 -0
- package/vendor/shiki/langs/hcl.d.ts +6 -0
- package/vendor/shiki/langs/hjson.d.ts +6 -0
- package/vendor/shiki/langs/hlsl.d.ts +6 -0
- package/vendor/shiki/langs/hs.d.ts +6 -0
- package/vendor/shiki/langs/html-derivative.d.ts +6 -0
- package/vendor/shiki/langs/html.d.ts +6 -0
- package/vendor/shiki/langs/http.d.ts +6 -0
- package/vendor/shiki/langs/hxml.d.ts +6 -0
- package/vendor/shiki/langs/hy.d.ts +6 -0
- package/vendor/shiki/langs/imba.d.ts +6 -0
- package/vendor/shiki/langs/ini.d.ts +6 -0
- package/vendor/shiki/langs/jade.d.ts +6 -0
- package/vendor/shiki/langs/java.d.ts +6 -0
- package/vendor/shiki/langs/javascript.d.ts +6 -0
- package/vendor/shiki/langs/jinja-html.d.ts +6 -0
- package/vendor/shiki/langs/jinja.d.ts +6 -0
- package/vendor/shiki/langs/jison.d.ts +6 -0
- package/vendor/shiki/langs/jl.d.ts +6 -0
- package/vendor/shiki/langs/js.d.ts +6 -0
- package/vendor/shiki/langs/json.d.ts +6 -0
- package/vendor/shiki/langs/json5.d.ts +6 -0
- package/vendor/shiki/langs/jsonc.d.ts +6 -0
- package/vendor/shiki/langs/jsonl.d.ts +6 -0
- package/vendor/shiki/langs/jsonnet.d.ts +6 -0
- package/vendor/shiki/langs/jssm.d.ts +6 -0
- package/vendor/shiki/langs/jsx.d.ts +6 -0
- package/vendor/shiki/langs/julia.d.ts +6 -0
- package/vendor/shiki/langs/kotlin.d.ts +6 -0
- package/vendor/shiki/langs/kql.d.ts +6 -0
- package/vendor/shiki/langs/kt.d.ts +6 -0
- package/vendor/shiki/langs/kts.d.ts +6 -0
- package/vendor/shiki/langs/kusto.d.ts +6 -0
- package/vendor/shiki/langs/latex.d.ts +6 -0
- package/vendor/shiki/langs/lean.d.ts +6 -0
- package/vendor/shiki/langs/lean4.d.ts +6 -0
- package/vendor/shiki/langs/less.d.ts +6 -0
- package/vendor/shiki/langs/liquid.d.ts +6 -0
- package/vendor/shiki/langs/lisp.d.ts +6 -0
- package/vendor/shiki/langs/lit.d.ts +6 -0
- package/vendor/shiki/langs/log.d.ts +6 -0
- package/vendor/shiki/langs/logo.d.ts +6 -0
- package/vendor/shiki/langs/lua.d.ts +6 -0
- package/vendor/shiki/langs/luau.d.ts +6 -0
- package/vendor/shiki/langs/make.d.ts +6 -0
- package/vendor/shiki/langs/makefile.d.ts +6 -0
- package/vendor/shiki/langs/markdown-vue.d.ts +6 -0
- package/vendor/shiki/langs/markdown.d.ts +6 -0
- package/vendor/shiki/langs/marko.d.ts +6 -0
- package/vendor/shiki/langs/matlab.d.ts +6 -0
- package/vendor/shiki/langs/md.d.ts +6 -0
- package/vendor/shiki/langs/mdc.d.ts +6 -0
- package/vendor/shiki/langs/mdx.d.ts +6 -0
- package/vendor/shiki/langs/mediawiki.d.ts +6 -0
- package/vendor/shiki/langs/mermaid.d.ts +6 -0
- package/vendor/shiki/langs/mips.d.ts +6 -0
- package/vendor/shiki/langs/mipsasm.d.ts +6 -0
- package/vendor/shiki/langs/mmd.d.ts +6 -0
- package/vendor/shiki/langs/mojo.d.ts +6 -0
- package/vendor/shiki/langs/move.d.ts +6 -0
- package/vendor/shiki/langs/nar.d.ts +6 -0
- package/vendor/shiki/langs/narrat.d.ts +6 -0
- package/vendor/shiki/langs/nextflow.d.ts +6 -0
- package/vendor/shiki/langs/nf.d.ts +6 -0
- package/vendor/shiki/langs/nginx.d.ts +6 -0
- package/vendor/shiki/langs/nim.d.ts +6 -0
- package/vendor/shiki/langs/nix.d.ts +6 -0
- package/vendor/shiki/langs/nu.d.ts +6 -0
- package/vendor/shiki/langs/nushell.d.ts +6 -0
- package/vendor/shiki/langs/objc.d.ts +6 -0
- package/vendor/shiki/langs/objective-c.d.ts +6 -0
- package/vendor/shiki/langs/objective-cpp.d.ts +6 -0
- package/vendor/shiki/langs/ocaml.d.ts +6 -0
- package/vendor/shiki/langs/pascal.d.ts +6 -0
- package/vendor/shiki/langs/perl.d.ts +6 -0
- package/vendor/shiki/langs/perl6.d.ts +6 -0
- package/vendor/shiki/langs/php.d.ts +6 -0
- package/vendor/shiki/langs/plsql.d.ts +6 -0
- package/vendor/shiki/langs/po.d.ts +6 -0
- package/vendor/shiki/langs/postcss.d.ts +6 -0
- package/vendor/shiki/langs/pot.d.ts +6 -0
- package/vendor/shiki/langs/potx.d.ts +6 -0
- package/vendor/shiki/langs/powerquery.d.ts +6 -0
- package/vendor/shiki/langs/powershell.d.ts +6 -0
- package/vendor/shiki/langs/prisma.d.ts +6 -0
- package/vendor/shiki/langs/prolog.d.ts +6 -0
- package/vendor/shiki/langs/properties.d.ts +6 -0
- package/vendor/shiki/langs/proto.d.ts +6 -0
- package/vendor/shiki/langs/protobuf.d.ts +6 -0
- package/vendor/shiki/langs/ps.d.ts +6 -0
- package/vendor/shiki/langs/ps1.d.ts +6 -0
- package/vendor/shiki/langs/pug.d.ts +6 -0
- package/vendor/shiki/langs/puppet.d.ts +6 -0
- package/vendor/shiki/langs/purescript.d.ts +6 -0
- package/vendor/shiki/langs/py.d.ts +6 -0
- package/vendor/shiki/langs/python.d.ts +6 -0
- package/vendor/shiki/langs/ql.d.ts +6 -0
- package/vendor/shiki/langs/qml.d.ts +6 -0
- package/vendor/shiki/langs/qmldir.d.ts +6 -0
- package/vendor/shiki/langs/qss.d.ts +6 -0
- package/vendor/shiki/langs/r.d.ts +6 -0
- package/vendor/shiki/langs/racket.d.ts +6 -0
- package/vendor/shiki/langs/raku.d.ts +6 -0
- package/vendor/shiki/langs/razor.d.ts +6 -0
- package/vendor/shiki/langs/rb.d.ts +6 -0
- package/vendor/shiki/langs/reg.d.ts +6 -0
- package/vendor/shiki/langs/regex.d.ts +6 -0
- package/vendor/shiki/langs/regexp.d.ts +6 -0
- package/vendor/shiki/langs/rel.d.ts +6 -0
- package/vendor/shiki/langs/riscv.d.ts +6 -0
- package/vendor/shiki/langs/rs.d.ts +6 -0
- package/vendor/shiki/langs/rst.d.ts +6 -0
- package/vendor/shiki/langs/ruby.d.ts +6 -0
- package/vendor/shiki/langs/rust.d.ts +6 -0
- package/vendor/shiki/langs/sas.d.ts +6 -0
- package/vendor/shiki/langs/sass.d.ts +6 -0
- package/vendor/shiki/langs/scala.d.ts +6 -0
- package/vendor/shiki/langs/scheme.d.ts +6 -0
- package/vendor/shiki/langs/scss.d.ts +6 -0
- package/vendor/shiki/langs/sh.d.ts +6 -0
- package/vendor/shiki/langs/shader.d.ts +6 -0
- package/vendor/shiki/langs/shaderlab.d.ts +6 -0
- package/vendor/shiki/langs/shell.d.ts +6 -0
- package/vendor/shiki/langs/shellscript.d.ts +6 -0
- package/vendor/shiki/langs/shellsession.d.ts +6 -0
- package/vendor/shiki/langs/smalltalk.d.ts +6 -0
- package/vendor/shiki/langs/solidity.d.ts +6 -0
- package/vendor/shiki/langs/soy.d.ts +6 -0
- package/vendor/shiki/langs/sparql.d.ts +6 -0
- package/vendor/shiki/langs/spl.d.ts +6 -0
- package/vendor/shiki/langs/splunk.d.ts +6 -0
- package/vendor/shiki/langs/sql.d.ts +6 -0
- package/vendor/shiki/langs/ssh-config.d.ts +6 -0
- package/vendor/shiki/langs/stata.d.ts +6 -0
- package/vendor/shiki/langs/styl.d.ts +6 -0
- package/vendor/shiki/langs/stylus.d.ts +6 -0
- package/vendor/shiki/langs/svelte.d.ts +6 -0
- package/vendor/shiki/langs/swift.d.ts +6 -0
- package/vendor/shiki/langs/system-verilog.d.ts +6 -0
- package/vendor/shiki/langs/systemd.d.ts +6 -0
- package/vendor/shiki/langs/tasl.d.ts +6 -0
- package/vendor/shiki/langs/tcl.d.ts +6 -0
- package/vendor/shiki/langs/templ.d.ts +6 -0
- package/vendor/shiki/langs/terraform.d.ts +6 -0
- package/vendor/shiki/langs/tex.d.ts +6 -0
- package/vendor/shiki/langs/tf.d.ts +6 -0
- package/vendor/shiki/langs/tfvars.d.ts +6 -0
- package/vendor/shiki/langs/toml.d.ts +6 -0
- package/vendor/shiki/langs/ts-tags.d.ts +6 -0
- package/vendor/shiki/langs/ts.d.ts +6 -0
- package/vendor/shiki/langs/tsp.d.ts +6 -0
- package/vendor/shiki/langs/tsv.d.ts +6 -0
- package/vendor/shiki/langs/tsx.d.ts +6 -0
- package/vendor/shiki/langs/turtle.d.ts +6 -0
- package/vendor/shiki/langs/twig.d.ts +6 -0
- package/vendor/shiki/langs/typ.d.ts +6 -0
- package/vendor/shiki/langs/typescript.d.ts +6 -0
- package/vendor/shiki/langs/typespec.d.ts +6 -0
- package/vendor/shiki/langs/typst.d.ts +6 -0
- package/vendor/shiki/langs/v.d.ts +6 -0
- package/vendor/shiki/langs/vala.d.ts +6 -0
- package/vendor/shiki/langs/vb.d.ts +6 -0
- package/vendor/shiki/langs/verilog.d.ts +6 -0
- package/vendor/shiki/langs/vhdl.d.ts +6 -0
- package/vendor/shiki/langs/vim.d.ts +6 -0
- package/vendor/shiki/langs/viml.d.ts +6 -0
- package/vendor/shiki/langs/vimscript.d.ts +6 -0
- package/vendor/shiki/langs/vue-directives.d.ts +6 -0
- package/vendor/shiki/langs/vue-html.d.ts +6 -0
- package/vendor/shiki/langs/vue-interpolations.d.ts +6 -0
- package/vendor/shiki/langs/vue-sfc-style-variable-injection.d.ts +6 -0
- package/vendor/shiki/langs/vue.d.ts +6 -0
- package/vendor/shiki/langs/vy.d.ts +6 -0
- package/vendor/shiki/langs/vyper.d.ts +6 -0
- package/vendor/shiki/langs/wasm.d.ts +6 -0
- package/vendor/shiki/langs/wenyan.d.ts +6 -0
- package/vendor/shiki/langs/wgsl.d.ts +6 -0
- package/vendor/shiki/langs/wiki.d.ts +6 -0
- package/vendor/shiki/langs/wikitext.d.ts +6 -0
- package/vendor/shiki/langs/wl.d.ts +6 -0
- package/vendor/shiki/langs/wolfram.d.ts +6 -0
- package/vendor/shiki/langs/xml.d.ts +6 -0
- package/vendor/shiki/langs/xsl.d.ts +6 -0
- package/vendor/shiki/langs/yaml.d.ts +6 -0
- package/vendor/shiki/langs/yml.d.ts +6 -0
- package/vendor/shiki/langs/zenscript.d.ts +6 -0
- package/vendor/shiki/langs/zig.d.ts +6 -0
- package/vendor/shiki/langs/zsh.d.ts +6 -0
- package/vendor/shiki/manifest.json +1468 -0
- package/vendor/shiki/themes/andromeeda.d.ts +6 -0
- package/vendor/shiki/themes/aurora-x.d.ts +6 -0
- package/vendor/shiki/themes/ayu-dark.d.ts +6 -0
- package/vendor/shiki/themes/catppuccin-frappe.d.ts +6 -0
- package/vendor/shiki/themes/catppuccin-latte.d.ts +6 -0
- package/vendor/shiki/themes/catppuccin-macchiato.d.ts +6 -0
- package/vendor/shiki/themes/catppuccin-mocha.d.ts +6 -0
- package/vendor/shiki/themes/dark-plus.d.ts +6 -0
- package/vendor/shiki/themes/dracula-soft.d.ts +6 -0
- package/vendor/shiki/themes/dracula.d.ts +6 -0
- package/vendor/shiki/themes/everforest-dark.d.ts +6 -0
- package/vendor/shiki/themes/everforest-light.d.ts +6 -0
- package/vendor/shiki/themes/github-dark-default.d.ts +6 -0
- package/vendor/shiki/themes/github-dark-dimmed.d.ts +6 -0
- package/vendor/shiki/themes/github-dark-high-contrast.d.ts +6 -0
- package/vendor/shiki/themes/github-dark.d.ts +6 -0
- package/vendor/shiki/themes/github-light-default.d.ts +6 -0
- package/vendor/shiki/themes/github-light-high-contrast.d.ts +6 -0
- package/vendor/shiki/themes/github-light.d.ts +6 -0
- package/vendor/shiki/themes/houston.d.ts +6 -0
- package/vendor/shiki/themes/kanagawa-dragon.d.ts +6 -0
- package/vendor/shiki/themes/kanagawa-lotus.d.ts +6 -0
- package/vendor/shiki/themes/kanagawa-wave.d.ts +6 -0
- package/vendor/shiki/themes/laserwave.d.ts +6 -0
- package/vendor/shiki/themes/light-plus.d.ts +6 -0
- package/vendor/shiki/themes/material-theme-darker.d.ts +6 -0
- package/vendor/shiki/themes/material-theme-lighter.d.ts +6 -0
- package/vendor/shiki/themes/material-theme-ocean.d.ts +6 -0
- package/vendor/shiki/themes/material-theme-palenight.d.ts +6 -0
- package/vendor/shiki/themes/material-theme.d.ts +6 -0
- package/vendor/shiki/themes/min-dark.d.ts +6 -0
- package/vendor/shiki/themes/min-light.d.ts +6 -0
- package/vendor/shiki/themes/monokai.d.ts +6 -0
- package/vendor/shiki/themes/night-owl.d.ts +6 -0
- package/vendor/shiki/themes/nord.d.ts +6 -0
- package/vendor/shiki/themes/one-dark-pro.d.ts +6 -0
- package/vendor/shiki/themes/one-light.d.ts +6 -0
- package/vendor/shiki/themes/plastic.d.ts +6 -0
- package/vendor/shiki/themes/poimandres.d.ts +6 -0
- package/vendor/shiki/themes/red.d.ts +6 -0
- package/vendor/shiki/themes/rose-pine-dawn.d.ts +6 -0
- package/vendor/shiki/themes/rose-pine-moon.d.ts +6 -0
- package/vendor/shiki/themes/rose-pine.d.ts +6 -0
- package/vendor/shiki/themes/slack-dark.d.ts +6 -0
- package/vendor/shiki/themes/slack-ochin.d.ts +6 -0
- package/vendor/shiki/themes/snazzy-light.d.ts +6 -0
- package/vendor/shiki/themes/solarized-dark.d.ts +6 -0
- package/vendor/shiki/themes/solarized-light.d.ts +6 -0
- package/vendor/shiki/themes/tokyo-night.d.ts +6 -0
- package/vendor/shiki/themes/vesper.d.ts +6 -0
- package/vendor/shiki/themes/vitesse-black.d.ts +6 -0
- package/vendor/shiki/themes/vitesse-dark.d.ts +6 -0
- package/vendor/shiki/themes/vitesse-light.d.ts +6 -0
- package/lib/commonjs/syntax/parser/index.js +0 -26
- package/lib/commonjs/syntax/parser/index.js.map +0 -1
- package/lib/commonjs/types/shiki.d.js +0 -2
- package/lib/commonjs/types/shiki.d.js.map +0 -1
- package/lib/typescript/components/syntax/SyntaxHighlighter.d.ts +0 -11
- package/lib/typescript/components/syntax/SyntaxHighlighter.d.ts.map +0 -1
- package/lib/typescript/components/syntax/SyntaxLine.d.ts.map +0 -1
- package/lib/typescript/components/syntax/index.d.ts.map +0 -1
- package/lib/typescript/hooks/useSyntaxHighlighter.d.ts +0 -11
- package/lib/typescript/hooks/useSyntaxHighlighter.d.ts.map +0 -1
- package/lib/typescript/index.d.ts +0 -4
- package/lib/typescript/index.d.ts.map +0 -1
- package/lib/typescript/syntax/highlighter/index.d.ts +0 -18
- package/lib/typescript/syntax/highlighter/index.d.ts.map +0 -1
- package/lib/typescript/syntax/index.d.ts +0 -4
- package/lib/typescript/syntax/index.d.ts.map +0 -1
- package/lib/typescript/syntax/parser/index.d.ts +0 -10
- package/lib/typescript/syntax/parser/index.d.ts.map +0 -1
- package/lib/typescript/types/index.d.ts.map +0 -1
- package/lib/typescript/utils/index.d.ts.map +0 -1
- package/lib/typescript/utils/string.d.ts.map +0 -1
- package/src/syntax/parser/index.ts +0 -32
- package/src/types/shiki.d.ts +0 -17
- /package/lib/typescript/{components → src/components}/syntax/SyntaxLine.d.ts +0 -0
- /package/lib/typescript/{components → src/components}/syntax/index.d.ts +0 -0
- /package/lib/typescript/{types → src/types}/index.d.ts +0 -0
- /package/lib/typescript/{utils → src/utils}/index.d.ts +0 -0
- /package/lib/typescript/{utils → src/utils}/string.d.ts +0 -0
- /package/{dist/cache → vendor/shiki}/core/core.js +0 -0
- /package/{dist/cache → vendor/shiki}/core/engine-javascript.js +0 -0
- /package/{dist/cache → vendor/shiki}/langs/abap.js +0 -0
- /package/{dist/cache → vendor/shiki}/langs/actionscript-3.js +0 -0
- /package/{dist/cache → vendor/shiki}/langs/ada.js +0 -0
- /package/{dist/cache → vendor/shiki}/langs/adoc.js +0 -0
- /package/{dist/cache → vendor/shiki}/langs/angular-expression.js +0 -0
- /package/{dist/cache → vendor/shiki}/langs/angular-html.js +0 -0
- /package/{dist/cache → vendor/shiki}/langs/angular-inline-style.js +0 -0
- /package/{dist/cache → vendor/shiki}/langs/angular-inline-template.js +0 -0
- /package/{dist/cache → vendor/shiki}/langs/angular-let-declaration.js +0 -0
- /package/{dist/cache → vendor/shiki}/langs/angular-template-blocks.js +0 -0
- /package/{dist/cache → vendor/shiki}/langs/angular-template.js +0 -0
- /package/{dist/cache → vendor/shiki}/langs/angular-ts.js +0 -0
- /package/{dist/cache → vendor/shiki}/langs/apache.js +0 -0
- /package/{dist/cache → vendor/shiki}/langs/apex.js +0 -0
- /package/{dist/cache → vendor/shiki}/langs/apl.js +0 -0
- /package/{dist/cache → vendor/shiki}/langs/applescript.js +0 -0
- /package/{dist/cache → vendor/shiki}/langs/ara.js +0 -0
- /package/{dist/cache → vendor/shiki}/langs/asciidoc.js +0 -0
- /package/{dist/cache → vendor/shiki}/langs/asm.js +0 -0
- /package/{dist/cache → vendor/shiki}/langs/astro.js +0 -0
- /package/{dist/cache → vendor/shiki}/langs/awk.js +0 -0
- /package/{dist/cache → vendor/shiki}/langs/ballerina.js +0 -0
- /package/{dist/cache → vendor/shiki}/langs/bash.js +0 -0
- /package/{dist/cache → vendor/shiki}/langs/bat.js +0 -0
- /package/{dist/cache → vendor/shiki}/langs/batch.js +0 -0
- /package/{dist/cache → vendor/shiki}/langs/be.js +0 -0
- /package/{dist/cache → vendor/shiki}/langs/beancount.js +0 -0
- /package/{dist/cache → vendor/shiki}/langs/berry.js +0 -0
- /package/{dist/cache → vendor/shiki}/langs/bibtex.js +0 -0
- /package/{dist/cache → vendor/shiki}/langs/bicep.js +0 -0
- /package/{dist/cache → vendor/shiki}/langs/blade.js +0 -0
- /package/{dist/cache → vendor/shiki}/langs/c.js +0 -0
- /package/{dist/cache → vendor/shiki}/langs/cadence.js +0 -0
- /package/{dist/cache → vendor/shiki}/langs/cdc.js +0 -0
- /package/{dist/cache → vendor/shiki}/langs/clarity.js +0 -0
- /package/{dist/cache → vendor/shiki}/langs/clj.js +0 -0
- /package/{dist/cache → vendor/shiki}/langs/clojure.js +0 -0
- /package/{dist/cache → vendor/shiki}/langs/closure-templates.js +0 -0
- /package/{dist/cache → vendor/shiki}/langs/cmake.js +0 -0
- /package/{dist/cache → vendor/shiki}/langs/cmd.js +0 -0
- /package/{dist/cache → vendor/shiki}/langs/cobol.js +0 -0
- /package/{dist/cache → vendor/shiki}/langs/codeowners.js +0 -0
- /package/{dist/cache → vendor/shiki}/langs/codeql.js +0 -0
- /package/{dist/cache → vendor/shiki}/langs/coffee.js +0 -0
- /package/{dist/cache → vendor/shiki}/langs/coffeescript.js +0 -0
- /package/{dist/cache → vendor/shiki}/langs/common-lisp.js +0 -0
- /package/{dist/cache → vendor/shiki}/langs/console.js +0 -0
- /package/{dist/cache → vendor/shiki}/langs/coq.js +0 -0
- /package/{dist/cache → vendor/shiki}/langs/cpp-macro.js +0 -0
- /package/{dist/cache → vendor/shiki}/langs/cpp.js +0 -0
- /package/{dist/cache → vendor/shiki}/langs/cql.js +0 -0
- /package/{dist/cache → vendor/shiki}/langs/crystal.js +0 -0
- /package/{dist/cache → vendor/shiki}/langs/cs.js +0 -0
- /package/{dist/cache → vendor/shiki}/langs/csharp.js +0 -0
- /package/{dist/cache → vendor/shiki}/langs/css.js +0 -0
- /package/{dist/cache → vendor/shiki}/langs/csv.js +0 -0
- /package/{dist/cache → vendor/shiki}/langs/cue.js +0 -0
- /package/{dist/cache → vendor/shiki}/langs/cypher.js +0 -0
- /package/{dist/cache → vendor/shiki}/langs/d.js +0 -0
- /package/{dist/cache → vendor/shiki}/langs/dart.js +0 -0
- /package/{dist/cache → vendor/shiki}/langs/dax.js +0 -0
- /package/{dist/cache → vendor/shiki}/langs/desktop.js +0 -0
- /package/{dist/cache → vendor/shiki}/langs/diff.js +0 -0
- /package/{dist/cache → vendor/shiki}/langs/docker.js +0 -0
- /package/{dist/cache → vendor/shiki}/langs/dockerfile.js +0 -0
- /package/{dist/cache → vendor/shiki}/langs/dotenv.js +0 -0
- /package/{dist/cache → vendor/shiki}/langs/dream-maker.js +0 -0
- /package/{dist/cache → vendor/shiki}/langs/edge.js +0 -0
- /package/{dist/cache → vendor/shiki}/langs/elisp.js +0 -0
- /package/{dist/cache → vendor/shiki}/langs/elixir.js +0 -0
- /package/{dist/cache → vendor/shiki}/langs/elm.js +0 -0
- /package/{dist/cache → vendor/shiki}/langs/emacs-lisp.js +0 -0
- /package/{dist/cache → vendor/shiki}/langs/erb.js +0 -0
- /package/{dist/cache → vendor/shiki}/langs/erl.js +0 -0
- /package/{dist/cache → vendor/shiki}/langs/erlang.js +0 -0
- /package/{dist/cache → vendor/shiki}/langs/es-tag-css.js +0 -0
- /package/{dist/cache → vendor/shiki}/langs/es-tag-glsl.js +0 -0
- /package/{dist/cache → vendor/shiki}/langs/es-tag-html.js +0 -0
- /package/{dist/cache → vendor/shiki}/langs/es-tag-sql.js +0 -0
- /package/{dist/cache → vendor/shiki}/langs/es-tag-xml.js +0 -0
- /package/{dist/cache → vendor/shiki}/langs/f.js +0 -0
- /package/{dist/cache → vendor/shiki}/langs/f03.js +0 -0
- /package/{dist/cache → vendor/shiki}/langs/f08.js +0 -0
- /package/{dist/cache → vendor/shiki}/langs/f18.js +0 -0
- /package/{dist/cache → vendor/shiki}/langs/f77.js +0 -0
- /package/{dist/cache → vendor/shiki}/langs/f90.js +0 -0
- /package/{dist/cache → vendor/shiki}/langs/f95.js +0 -0
- /package/{dist/cache → vendor/shiki}/langs/fennel.js +0 -0
- /package/{dist/cache → vendor/shiki}/langs/fish.js +0 -0
- /package/{dist/cache → vendor/shiki}/langs/fluent.js +0 -0
- /package/{dist/cache → vendor/shiki}/langs/for.js +0 -0
- /package/{dist/cache → vendor/shiki}/langs/fortran-fixed-form.js +0 -0
- /package/{dist/cache → vendor/shiki}/langs/fortran-free-form.js +0 -0
- /package/{dist/cache → vendor/shiki}/langs/fs.js +0 -0
- /package/{dist/cache → vendor/shiki}/langs/fsharp.js +0 -0
- /package/{dist/cache → vendor/shiki}/langs/fsl.js +0 -0
- /package/{dist/cache → vendor/shiki}/langs/ftl.js +0 -0
- /package/{dist/cache → vendor/shiki}/langs/gdresource.js +0 -0
- /package/{dist/cache → vendor/shiki}/langs/gdscript.js +0 -0
- /package/{dist/cache → vendor/shiki}/langs/gdshader.js +0 -0
- /package/{dist/cache → vendor/shiki}/langs/genie.js +0 -0
- /package/{dist/cache → vendor/shiki}/langs/gherkin.js +0 -0
- /package/{dist/cache → vendor/shiki}/langs/git-commit.js +0 -0
- /package/{dist/cache → vendor/shiki}/langs/git-rebase.js +0 -0
- /package/{dist/cache → vendor/shiki}/langs/gjs.js +0 -0
- /package/{dist/cache → vendor/shiki}/langs/gleam.js +0 -0
- /package/{dist/cache → vendor/shiki}/langs/glimmer-js.js +0 -0
- /package/{dist/cache → vendor/shiki}/langs/glimmer-ts.js +0 -0
- /package/{dist/cache → vendor/shiki}/langs/glsl.js +0 -0
- /package/{dist/cache → vendor/shiki}/langs/gnuplot.js +0 -0
- /package/{dist/cache → vendor/shiki}/langs/go.js +0 -0
- /package/{dist/cache → vendor/shiki}/langs/gql.js +0 -0
- /package/{dist/cache → vendor/shiki}/langs/graphql.js +0 -0
- /package/{dist/cache → vendor/shiki}/langs/groovy.js +0 -0
- /package/{dist/cache → vendor/shiki}/langs/gts.js +0 -0
- /package/{dist/cache → vendor/shiki}/langs/hack.js +0 -0
- /package/{dist/cache → vendor/shiki}/langs/haml.js +0 -0
- /package/{dist/cache → vendor/shiki}/langs/handlebars.js +0 -0
- /package/{dist/cache → vendor/shiki}/langs/haskell.js +0 -0
- /package/{dist/cache → vendor/shiki}/langs/haxe.js +0 -0
- /package/{dist/cache → vendor/shiki}/langs/hbs.js +0 -0
- /package/{dist/cache → vendor/shiki}/langs/hcl.js +0 -0
- /package/{dist/cache → vendor/shiki}/langs/hjson.js +0 -0
- /package/{dist/cache → vendor/shiki}/langs/hlsl.js +0 -0
- /package/{dist/cache → vendor/shiki}/langs/hs.js +0 -0
- /package/{dist/cache → vendor/shiki}/langs/html-derivative.js +0 -0
- /package/{dist/cache → vendor/shiki}/langs/html.js +0 -0
- /package/{dist/cache → vendor/shiki}/langs/http.js +0 -0
- /package/{dist/cache → vendor/shiki}/langs/hxml.js +0 -0
- /package/{dist/cache → vendor/shiki}/langs/hy.js +0 -0
- /package/{dist/cache → vendor/shiki}/langs/imba.js +0 -0
- /package/{dist/cache → vendor/shiki}/langs/ini.js +0 -0
- /package/{dist/cache → vendor/shiki}/langs/jade.js +0 -0
- /package/{dist/cache → vendor/shiki}/langs/java.js +0 -0
- /package/{dist/cache → vendor/shiki}/langs/javascript.js +0 -0
- /package/{dist/cache → vendor/shiki}/langs/jinja-html.js +0 -0
- /package/{dist/cache → vendor/shiki}/langs/jinja.js +0 -0
- /package/{dist/cache → vendor/shiki}/langs/jison.js +0 -0
- /package/{dist/cache → vendor/shiki}/langs/jl.js +0 -0
- /package/{dist/cache → vendor/shiki}/langs/js.js +0 -0
- /package/{dist/cache → vendor/shiki}/langs/json.js +0 -0
- /package/{dist/cache → vendor/shiki}/langs/json5.js +0 -0
- /package/{dist/cache → vendor/shiki}/langs/jsonc.js +0 -0
- /package/{dist/cache → vendor/shiki}/langs/jsonl.js +0 -0
- /package/{dist/cache → vendor/shiki}/langs/jsonnet.js +0 -0
- /package/{dist/cache → vendor/shiki}/langs/jssm.js +0 -0
- /package/{dist/cache → vendor/shiki}/langs/jsx.js +0 -0
- /package/{dist/cache → vendor/shiki}/langs/julia.js +0 -0
- /package/{dist/cache → vendor/shiki}/langs/kotlin.js +0 -0
- /package/{dist/cache → vendor/shiki}/langs/kql.js +0 -0
- /package/{dist/cache → vendor/shiki}/langs/kt.js +0 -0
- /package/{dist/cache → vendor/shiki}/langs/kts.js +0 -0
- /package/{dist/cache → vendor/shiki}/langs/kusto.js +0 -0
- /package/{dist/cache → vendor/shiki}/langs/latex.js +0 -0
- /package/{dist/cache → vendor/shiki}/langs/lean.js +0 -0
- /package/{dist/cache → vendor/shiki}/langs/lean4.js +0 -0
- /package/{dist/cache → vendor/shiki}/langs/less.js +0 -0
- /package/{dist/cache → vendor/shiki}/langs/liquid.js +0 -0
- /package/{dist/cache → vendor/shiki}/langs/lisp.js +0 -0
- /package/{dist/cache → vendor/shiki}/langs/lit.js +0 -0
- /package/{dist/cache → vendor/shiki}/langs/log.js +0 -0
- /package/{dist/cache → vendor/shiki}/langs/logo.js +0 -0
- /package/{dist/cache → vendor/shiki}/langs/lua.js +0 -0
- /package/{dist/cache → vendor/shiki}/langs/luau.js +0 -0
- /package/{dist/cache → vendor/shiki}/langs/make.js +0 -0
- /package/{dist/cache → vendor/shiki}/langs/makefile.js +0 -0
- /package/{dist/cache → vendor/shiki}/langs/markdown-vue.js +0 -0
- /package/{dist/cache → vendor/shiki}/langs/markdown.js +0 -0
- /package/{dist/cache → vendor/shiki}/langs/marko.js +0 -0
- /package/{dist/cache → vendor/shiki}/langs/matlab.js +0 -0
- /package/{dist/cache → vendor/shiki}/langs/md.js +0 -0
- /package/{dist/cache → vendor/shiki}/langs/mdc.js +0 -0
- /package/{dist/cache → vendor/shiki}/langs/mdx.js +0 -0
- /package/{dist/cache → vendor/shiki}/langs/mediawiki.js +0 -0
- /package/{dist/cache → vendor/shiki}/langs/mermaid.js +0 -0
- /package/{dist/cache → vendor/shiki}/langs/mips.js +0 -0
- /package/{dist/cache → vendor/shiki}/langs/mipsasm.js +0 -0
- /package/{dist/cache → vendor/shiki}/langs/mmd.js +0 -0
- /package/{dist/cache → vendor/shiki}/langs/mojo.js +0 -0
- /package/{dist/cache → vendor/shiki}/langs/move.js +0 -0
- /package/{dist/cache → vendor/shiki}/langs/nar.js +0 -0
- /package/{dist/cache → vendor/shiki}/langs/narrat.js +0 -0
- /package/{dist/cache → vendor/shiki}/langs/nextflow.js +0 -0
- /package/{dist/cache → vendor/shiki}/langs/nf.js +0 -0
- /package/{dist/cache → vendor/shiki}/langs/nginx.js +0 -0
- /package/{dist/cache → vendor/shiki}/langs/nim.js +0 -0
- /package/{dist/cache → vendor/shiki}/langs/nix.js +0 -0
- /package/{dist/cache → vendor/shiki}/langs/nu.js +0 -0
- /package/{dist/cache → vendor/shiki}/langs/nushell.js +0 -0
- /package/{dist/cache → vendor/shiki}/langs/objc.js +0 -0
- /package/{dist/cache → vendor/shiki}/langs/objective-c.js +0 -0
- /package/{dist/cache → vendor/shiki}/langs/objective-cpp.js +0 -0
- /package/{dist/cache → vendor/shiki}/langs/ocaml.js +0 -0
- /package/{dist/cache → vendor/shiki}/langs/pascal.js +0 -0
- /package/{dist/cache → vendor/shiki}/langs/perl.js +0 -0
- /package/{dist/cache → vendor/shiki}/langs/perl6.js +0 -0
- /package/{dist/cache → vendor/shiki}/langs/php.js +0 -0
- /package/{dist/cache → vendor/shiki}/langs/plsql.js +0 -0
- /package/{dist/cache → vendor/shiki}/langs/po.js +0 -0
- /package/{dist/cache → vendor/shiki}/langs/postcss.js +0 -0
- /package/{dist/cache → vendor/shiki}/langs/pot.js +0 -0
- /package/{dist/cache → vendor/shiki}/langs/potx.js +0 -0
- /package/{dist/cache → vendor/shiki}/langs/powerquery.js +0 -0
- /package/{dist/cache → vendor/shiki}/langs/powershell.js +0 -0
- /package/{dist/cache → vendor/shiki}/langs/prisma.js +0 -0
- /package/{dist/cache → vendor/shiki}/langs/prolog.js +0 -0
- /package/{dist/cache → vendor/shiki}/langs/properties.js +0 -0
- /package/{dist/cache → vendor/shiki}/langs/proto.js +0 -0
- /package/{dist/cache → vendor/shiki}/langs/protobuf.js +0 -0
- /package/{dist/cache → vendor/shiki}/langs/ps.js +0 -0
- /package/{dist/cache → vendor/shiki}/langs/ps1.js +0 -0
- /package/{dist/cache → vendor/shiki}/langs/pug.js +0 -0
- /package/{dist/cache → vendor/shiki}/langs/puppet.js +0 -0
- /package/{dist/cache → vendor/shiki}/langs/purescript.js +0 -0
- /package/{dist/cache → vendor/shiki}/langs/py.js +0 -0
- /package/{dist/cache → vendor/shiki}/langs/python.js +0 -0
- /package/{dist/cache → vendor/shiki}/langs/ql.js +0 -0
- /package/{dist/cache → vendor/shiki}/langs/qml.js +0 -0
- /package/{dist/cache → vendor/shiki}/langs/qmldir.js +0 -0
- /package/{dist/cache → vendor/shiki}/langs/qss.js +0 -0
- /package/{dist/cache → vendor/shiki}/langs/r.js +0 -0
- /package/{dist/cache → vendor/shiki}/langs/racket.js +0 -0
- /package/{dist/cache → vendor/shiki}/langs/raku.js +0 -0
- /package/{dist/cache → vendor/shiki}/langs/razor.js +0 -0
- /package/{dist/cache → vendor/shiki}/langs/rb.js +0 -0
- /package/{dist/cache → vendor/shiki}/langs/reg.js +0 -0
- /package/{dist/cache → vendor/shiki}/langs/regex.js +0 -0
- /package/{dist/cache → vendor/shiki}/langs/regexp.js +0 -0
- /package/{dist/cache → vendor/shiki}/langs/rel.js +0 -0
- /package/{dist/cache → vendor/shiki}/langs/riscv.js +0 -0
- /package/{dist/cache → vendor/shiki}/langs/rs.js +0 -0
- /package/{dist/cache → vendor/shiki}/langs/rst.js +0 -0
- /package/{dist/cache → vendor/shiki}/langs/ruby.js +0 -0
- /package/{dist/cache → vendor/shiki}/langs/rust.js +0 -0
- /package/{dist/cache → vendor/shiki}/langs/sas.js +0 -0
- /package/{dist/cache → vendor/shiki}/langs/sass.js +0 -0
- /package/{dist/cache → vendor/shiki}/langs/scala.js +0 -0
- /package/{dist/cache → vendor/shiki}/langs/scheme.js +0 -0
- /package/{dist/cache → vendor/shiki}/langs/scss.js +0 -0
- /package/{dist/cache → vendor/shiki}/langs/sh.js +0 -0
- /package/{dist/cache → vendor/shiki}/langs/shader.js +0 -0
- /package/{dist/cache → vendor/shiki}/langs/shaderlab.js +0 -0
- /package/{dist/cache → vendor/shiki}/langs/shell.js +0 -0
- /package/{dist/cache → vendor/shiki}/langs/shellscript.js +0 -0
- /package/{dist/cache → vendor/shiki}/langs/shellsession.js +0 -0
- /package/{dist/cache → vendor/shiki}/langs/smalltalk.js +0 -0
- /package/{dist/cache → vendor/shiki}/langs/solidity.js +0 -0
- /package/{dist/cache → vendor/shiki}/langs/soy.js +0 -0
- /package/{dist/cache → vendor/shiki}/langs/sparql.js +0 -0
- /package/{dist/cache → vendor/shiki}/langs/spl.js +0 -0
- /package/{dist/cache → vendor/shiki}/langs/splunk.js +0 -0
- /package/{dist/cache → vendor/shiki}/langs/sql.js +0 -0
- /package/{dist/cache → vendor/shiki}/langs/ssh-config.js +0 -0
- /package/{dist/cache → vendor/shiki}/langs/stata.js +0 -0
- /package/{dist/cache → vendor/shiki}/langs/styl.js +0 -0
- /package/{dist/cache → vendor/shiki}/langs/stylus.js +0 -0
- /package/{dist/cache → vendor/shiki}/langs/svelte.js +0 -0
- /package/{dist/cache → vendor/shiki}/langs/swift.js +0 -0
- /package/{dist/cache → vendor/shiki}/langs/system-verilog.js +0 -0
- /package/{dist/cache → vendor/shiki}/langs/systemd.js +0 -0
- /package/{dist/cache → vendor/shiki}/langs/tasl.js +0 -0
- /package/{dist/cache → vendor/shiki}/langs/tcl.js +0 -0
- /package/{dist/cache → vendor/shiki}/langs/templ.js +0 -0
- /package/{dist/cache → vendor/shiki}/langs/terraform.js +0 -0
- /package/{dist/cache → vendor/shiki}/langs/tex.js +0 -0
- /package/{dist/cache → vendor/shiki}/langs/tf.js +0 -0
- /package/{dist/cache → vendor/shiki}/langs/tfvars.js +0 -0
- /package/{dist/cache → vendor/shiki}/langs/toml.js +0 -0
- /package/{dist/cache → vendor/shiki}/langs/ts-tags.js +0 -0
- /package/{dist/cache → vendor/shiki}/langs/ts.js +0 -0
- /package/{dist/cache → vendor/shiki}/langs/tsp.js +0 -0
- /package/{dist/cache → vendor/shiki}/langs/tsv.js +0 -0
- /package/{dist/cache → vendor/shiki}/langs/tsx.js +0 -0
- /package/{dist/cache → vendor/shiki}/langs/turtle.js +0 -0
- /package/{dist/cache → vendor/shiki}/langs/twig.js +0 -0
- /package/{dist/cache → vendor/shiki}/langs/typ.js +0 -0
- /package/{dist/cache → vendor/shiki}/langs/typescript.js +0 -0
- /package/{dist/cache → vendor/shiki}/langs/typespec.js +0 -0
- /package/{dist/cache → vendor/shiki}/langs/typst.js +0 -0
- /package/{dist/cache → vendor/shiki}/langs/v.js +0 -0
- /package/{dist/cache → vendor/shiki}/langs/vala.js +0 -0
- /package/{dist/cache → vendor/shiki}/langs/vb.js +0 -0
- /package/{dist/cache → vendor/shiki}/langs/verilog.js +0 -0
- /package/{dist/cache → vendor/shiki}/langs/vhdl.js +0 -0
- /package/{dist/cache → vendor/shiki}/langs/vim.js +0 -0
- /package/{dist/cache → vendor/shiki}/langs/viml.js +0 -0
- /package/{dist/cache → vendor/shiki}/langs/vimscript.js +0 -0
- /package/{dist/cache → vendor/shiki}/langs/vue-directives.js +0 -0
- /package/{dist/cache → vendor/shiki}/langs/vue-html.js +0 -0
- /package/{dist/cache → vendor/shiki}/langs/vue-interpolations.js +0 -0
- /package/{dist/cache → vendor/shiki}/langs/vue-sfc-style-variable-injection.js +0 -0
- /package/{dist/cache → vendor/shiki}/langs/vue.js +0 -0
- /package/{dist/cache → vendor/shiki}/langs/vy.js +0 -0
- /package/{dist/cache → vendor/shiki}/langs/vyper.js +0 -0
- /package/{dist/cache → vendor/shiki}/langs/wasm.js +0 -0
- /package/{dist/cache → vendor/shiki}/langs/wenyan.js +0 -0
- /package/{dist/cache → vendor/shiki}/langs/wgsl.js +0 -0
- /package/{dist/cache → vendor/shiki}/langs/wiki.js +0 -0
- /package/{dist/cache → vendor/shiki}/langs/wikitext.js +0 -0
- /package/{dist/cache → vendor/shiki}/langs/wl.js +0 -0
- /package/{dist/cache → vendor/shiki}/langs/wolfram.js +0 -0
- /package/{dist/cache → vendor/shiki}/langs/xml.js +0 -0
- /package/{dist/cache → vendor/shiki}/langs/xsl.js +0 -0
- /package/{dist/cache → vendor/shiki}/langs/yaml.js +0 -0
- /package/{dist/cache → vendor/shiki}/langs/yml.js +0 -0
- /package/{dist/cache → vendor/shiki}/langs/zenscript.js +0 -0
- /package/{dist/cache → vendor/shiki}/langs/zig.js +0 -0
- /package/{dist/cache → vendor/shiki}/langs/zsh.js +0 -0
- /package/{dist/cache → vendor/shiki}/themes/andromeeda.js +0 -0
- /package/{dist/cache → vendor/shiki}/themes/aurora-x.js +0 -0
- /package/{dist/cache → vendor/shiki}/themes/ayu-dark.js +0 -0
- /package/{dist/cache → vendor/shiki}/themes/catppuccin-frappe.js +0 -0
- /package/{dist/cache → vendor/shiki}/themes/catppuccin-latte.js +0 -0
- /package/{dist/cache → vendor/shiki}/themes/catppuccin-macchiato.js +0 -0
- /package/{dist/cache → vendor/shiki}/themes/catppuccin-mocha.js +0 -0
- /package/{dist/cache → vendor/shiki}/themes/dark-plus.js +0 -0
- /package/{dist/cache → vendor/shiki}/themes/dracula-soft.js +0 -0
- /package/{dist/cache → vendor/shiki}/themes/dracula.js +0 -0
- /package/{dist/cache → vendor/shiki}/themes/everforest-dark.js +0 -0
- /package/{dist/cache → vendor/shiki}/themes/everforest-light.js +0 -0
- /package/{dist/cache → vendor/shiki}/themes/github-dark-default.js +0 -0
- /package/{dist/cache → vendor/shiki}/themes/github-dark-dimmed.js +0 -0
- /package/{dist/cache → vendor/shiki}/themes/github-dark-high-contrast.js +0 -0
- /package/{dist/cache → vendor/shiki}/themes/github-dark.js +0 -0
- /package/{dist/cache → vendor/shiki}/themes/github-light-default.js +0 -0
- /package/{dist/cache → vendor/shiki}/themes/github-light-high-contrast.js +0 -0
- /package/{dist/cache → vendor/shiki}/themes/github-light.js +0 -0
- /package/{dist/cache → vendor/shiki}/themes/houston.js +0 -0
- /package/{dist/cache → vendor/shiki}/themes/kanagawa-dragon.js +0 -0
- /package/{dist/cache → vendor/shiki}/themes/kanagawa-lotus.js +0 -0
- /package/{dist/cache → vendor/shiki}/themes/kanagawa-wave.js +0 -0
- /package/{dist/cache → vendor/shiki}/themes/laserwave.js +0 -0
- /package/{dist/cache → vendor/shiki}/themes/light-plus.js +0 -0
- /package/{dist/cache → vendor/shiki}/themes/material-theme-darker.js +0 -0
- /package/{dist/cache → vendor/shiki}/themes/material-theme-lighter.js +0 -0
- /package/{dist/cache → vendor/shiki}/themes/material-theme-ocean.js +0 -0
- /package/{dist/cache → vendor/shiki}/themes/material-theme-palenight.js +0 -0
- /package/{dist/cache → vendor/shiki}/themes/material-theme.js +0 -0
- /package/{dist/cache → vendor/shiki}/themes/min-dark.js +0 -0
- /package/{dist/cache → vendor/shiki}/themes/min-light.js +0 -0
- /package/{dist/cache → vendor/shiki}/themes/monokai.js +0 -0
- /package/{dist/cache → vendor/shiki}/themes/night-owl.js +0 -0
- /package/{dist/cache → vendor/shiki}/themes/nord.js +0 -0
- /package/{dist/cache → vendor/shiki}/themes/one-dark-pro.js +0 -0
- /package/{dist/cache → vendor/shiki}/themes/one-light.js +0 -0
- /package/{dist/cache → vendor/shiki}/themes/plastic.js +0 -0
- /package/{dist/cache → vendor/shiki}/themes/poimandres.js +0 -0
- /package/{dist/cache → vendor/shiki}/themes/red.js +0 -0
- /package/{dist/cache → vendor/shiki}/themes/rose-pine-dawn.js +0 -0
- /package/{dist/cache → vendor/shiki}/themes/rose-pine-moon.js +0 -0
- /package/{dist/cache → vendor/shiki}/themes/rose-pine.js +0 -0
- /package/{dist/cache → vendor/shiki}/themes/slack-dark.js +0 -0
- /package/{dist/cache → vendor/shiki}/themes/slack-ochin.js +0 -0
- /package/{dist/cache → vendor/shiki}/themes/snazzy-light.js +0 -0
- /package/{dist/cache → vendor/shiki}/themes/solarized-dark.js +0 -0
- /package/{dist/cache → vendor/shiki}/themes/solarized-light.js +0 -0
- /package/{dist/cache → vendor/shiki}/themes/tokyo-night.js +0 -0
- /package/{dist/cache → vendor/shiki}/themes/vesper.js +0 -0
- /package/{dist/cache → vendor/shiki}/themes/vitesse-black.js +0 -0
- /package/{dist/cache → vendor/shiki}/themes/vitesse-dark.js +0 -0
- /package/{dist/cache → vendor/shiki}/themes/vitesse-light.js +0 -0
@@ -0,0 +1,33 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
import { createHighlighterCore, createJavaScriptRegexEngine } from 'shiki';
|
4
|
+
async function initializeHighlighter(langs, themes) {
|
5
|
+
return createHighlighterCore({
|
6
|
+
engine: createJavaScriptRegexEngine(),
|
7
|
+
langs,
|
8
|
+
themes
|
9
|
+
});
|
10
|
+
}
|
11
|
+
export async function createHighlighter({
|
12
|
+
langs,
|
13
|
+
themes
|
14
|
+
}) {
|
15
|
+
if (!langs?.length || !themes?.length) {
|
16
|
+
throw new Error('Please provide both `langs` and `themes` when creating a highlighter.');
|
17
|
+
}
|
18
|
+
try {
|
19
|
+
const highlighter = await initializeHighlighter(langs, themes);
|
20
|
+
return highlighter;
|
21
|
+
} catch (error) {
|
22
|
+
console.error('Failed to create highlighter:', error);
|
23
|
+
throw error;
|
24
|
+
}
|
25
|
+
}
|
26
|
+
export function processTokens(tokens) {
|
27
|
+
return tokens.map(token => ({
|
28
|
+
content: token.content,
|
29
|
+
color: token.color || '#000000',
|
30
|
+
fontStyle: token.fontStyle?.toString()
|
31
|
+
}));
|
32
|
+
}
|
33
|
+
//# sourceMappingURL=index.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"names":["createHighlighterCore","createJavaScriptRegexEngine","initializeHighlighter","langs","themes","engine","createHighlighter","length","Error","highlighter","error","console","processTokens","tokens","map","token","content","color","fontStyle","toString"],"sourceRoot":"../../../../src","sources":["syntax/highlighter/index.ts"],"mappings":";;AAEA,SAASA,qBAAqB,EAAEC,2BAA2B,QAAQ,OAAO;AAE1E,eAAeC,qBAAqBA,CAACC,KAAsB,EAAEC,MAAoB,EAA8D;EAC7I,OAAOJ,qBAAqB,CAAC;IAC3BK,MAAM,EAAEJ,2BAA2B,CAAC,CAAC;IACrCE,KAAK;IACLC;EACF,CAAC,CAAC;AACJ;AAEA,OAAO,eAAeE,iBAAiBA,CAAC;EAAEH,KAAK;EAAEC;AAAyD,CAAC,EAA8D;EACvK,IAAI,CAACD,KAAK,EAAEI,MAAM,IAAI,CAACH,MAAM,EAAEG,MAAM,EAAE;IACrC,MAAM,IAAIC,KAAK,CAAC,uEAAuE,CAAC;EAC1F;EAEA,IAAI;IACF,MAAMC,WAAW,GAAG,MAAMP,qBAAqB,CAACC,KAAK,EAAEC,MAAM,CAAC;IAC9D,OAAOK,WAAW;EACpB,CAAC,CACD,OAAOC,KAAK,EAAE;IACZC,OAAO,CAACD,KAAK,CAAC,+BAA+B,EAAEA,KAAK,CAAC;IACrD,MAAMA,KAAK;EACb;AACF;AAEA,OAAO,SAASE,aAAaA,CAACC,MAAqB,EAAe;EAChE,OAAOA,MAAM,CAACC,GAAG,CAACC,KAAK,KAAK;IAC1BC,OAAO,EAAED,KAAK,CAACC,OAAO;IACtBC,KAAK,EAAEF,KAAK,CAACE,KAAK,IAAI,SAAS;IAC/BC,SAAS,EAAEH,KAAK,CAACG,SAAS,EAAEC,QAAQ,CAAC;EACvC,CAAC,CAAC,CAAC;AACL","ignoreList":[]}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"names":["createHighlighter","processTokens"],"sourceRoot":"../../../src","sources":["syntax/index.ts"],"mappings":";;AAAA,SAASA,iBAAiB,EAAEC,aAAa,QAAQ,eAAe","ignoreList":[]}
|
@@ -0,0 +1,20 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
import manifest from '../vendor/shiki/manifest.json';
|
4
|
+
export const Themes = Object.keys(manifest.themes).reduce((acc, theme) => {
|
5
|
+
const key = theme.replace(/-/g, '_').toUpperCase();
|
6
|
+
return {
|
7
|
+
...acc,
|
8
|
+
[key]: theme
|
9
|
+
};
|
10
|
+
}, {});
|
11
|
+
export async function getTheme(themeName) {
|
12
|
+
try {
|
13
|
+
const theme = await import(`../vendor/shiki/themes/${String(themeName)}.js`);
|
14
|
+
return theme.default;
|
15
|
+
} catch (err) {
|
16
|
+
const error = err instanceof Error ? err.message : String(err);
|
17
|
+
throw new Error(`Theme '${String(themeName)}' failed to load: ${error}`);
|
18
|
+
}
|
19
|
+
}
|
20
|
+
//# sourceMappingURL=themes.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"names":["manifest","Themes","Object","keys","themes","reduce","acc","theme","key","replace","toUpperCase","getTheme","themeName","String","default","err","error","Error","message"],"sourceRoot":"../../src","sources":["themes.ts"],"mappings":";;AACA,OAAOA,QAAQ,MAAM,+BAA+B;AAIpD,OAAO,MAAMC,MAAM,GAAGC,MAAM,CAACC,IAAI,CAACH,QAAQ,CAACI,MAAM,CAAC,CAACC,MAAM,CAAiC,CAACC,GAAG,EAAEC,KAAK,KAAK;EACxG,MAAMC,GAAG,GAAID,KAAK,CAAoBE,OAAO,CAAC,IAAI,EAAE,GAAG,CAAC,CAACC,WAAW,CAAC,CAAC;EACtE,OAAO;IAAE,GAAGJ,GAAG;IAAE,CAACE,GAAG,GAAGD;EAAwB,CAAC;AACnD,CAAC,EAAE,CAAC,CAAmC,CAAC;AAExC,OAAO,eAAeI,QAAQA,CAACC,SAAyB,EAAuB;EAC7E,IAAI;IACF,MAAML,KAAK,GAAG,MAAM,MAAM,CAAC,0BAA0BM,MAAM,CAACD,SAAS,CAAC,KAAK,CAAC;IAC5E,OAAOL,KAAK,CAACO,OAAO;EACtB,CAAC,CACD,OAAOC,GAAG,EAAE;IACV,MAAMC,KAAK,GAAGD,GAAG,YAAYE,KAAK,GAAGF,GAAG,CAACG,OAAO,GAAGL,MAAM,CAACE,GAAG,CAAC;IAC9D,MAAM,IAAIE,KAAK,CAAC,UAAUJ,MAAM,CAACD,SAAS,CAAC,qBAAqBI,KAAK,EAAE,CAAC;EAC1E;AACF","ignoreList":[]}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"names":[],"sourceRoot":"../../../src","sources":["types/index.ts"],"mappings":"","ignoreList":[]}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"names":[],"sourceRoot":"../../../src","sources":["utils/index.ts"],"mappings":";;AAAA,cAAc,UAAU","ignoreList":[]}
|
@@ -0,0 +1,22 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
export function createContentPreview(tokens, maxLength = 20) {
|
4
|
+
return tokens.slice(0, 3).map(token => token.content).join('').slice(0, maxLength);
|
5
|
+
}
|
6
|
+
export function createLineKey(line, index) {
|
7
|
+
const contentPreview = createContentPreview(line);
|
8
|
+
return `line-${index}-${contentPreview}`;
|
9
|
+
}
|
10
|
+
export function removeExtraIndentation(text) {
|
11
|
+
const preserved = text.replace(/\\n/g, '§NEWLINE§');
|
12
|
+
const lines = preserved.split('\n');
|
13
|
+
const minIndent = Math.min(...lines.filter(line => line.trim().length > 0).map(line => line.match(/^\s*/)?.[0].length ?? 0));
|
14
|
+
const normalized = lines.map(line => {
|
15
|
+
if (line.trim().length === 0) return '';
|
16
|
+
const indent = line.match(/^\s*/)?.[0] ?? '';
|
17
|
+
const relativeIndent = ' '.repeat(Math.max(0, indent.length - minIndent));
|
18
|
+
return relativeIndent + line.trim();
|
19
|
+
}).join('\n');
|
20
|
+
return normalized.replace(/§NEWLINE§/g, '\\n');
|
21
|
+
}
|
22
|
+
//# sourceMappingURL=string.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"names":["createContentPreview","tokens","maxLength","slice","map","token","content","join","createLineKey","line","index","contentPreview","removeExtraIndentation","text","preserved","replace","lines","split","minIndent","Math","min","filter","trim","length","match","normalized","indent","relativeIndent","repeat","max"],"sourceRoot":"../../../src","sources":["utils/string.ts"],"mappings":";;AAEA,OAAO,SAASA,oBAAoBA,CAACC,MAAmB,EAAEC,SAAiB,GAAG,EAAE,EAAU;EACxF,OAAOD,MAAM,CACVE,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CACXC,GAAG,CAACC,KAAK,IAAIA,KAAK,CAACC,OAAO,CAAC,CAC3BC,IAAI,CAAC,EAAE,CAAC,CACRJ,KAAK,CAAC,CAAC,EAAED,SAAS,CAAC;AACxB;AAEA,OAAO,SAASM,aAAaA,CAACC,IAAiB,EAAEC,KAAa,EAAE;EAC9D,MAAMC,cAAc,GAAGX,oBAAoB,CAACS,IAAI,CAAC;EACjD,OAAO,QAAQC,KAAK,IAAIC,cAAc,EAAE;AAC1C;AAEA,OAAO,SAASC,sBAAsBA,CAACC,IAAY,EAAU;EAC3D,MAAMC,SAAS,GAAGD,IAAI,CAACE,OAAO,CAAC,MAAM,EAAE,WAAW,CAAC;EACnD,MAAMC,KAAK,GAAGF,SAAS,CAACG,KAAK,CAAC,IAAI,CAAC;EACnC,MAAMC,SAAS,GAAGC,IAAI,CAACC,GAAG,CACxB,GAAGJ,KAAK,CACLK,MAAM,CAACZ,IAAI,IAAIA,IAAI,CAACa,IAAI,CAAC,CAAC,CAACC,MAAM,GAAG,CAAC,CAAC,CACtCnB,GAAG,CAACK,IAAI,IAAIA,IAAI,CAACe,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAACD,MAAM,IAAI,CAAC,CACpD,CAAC;EAED,MAAME,UAAU,GAAGT,KAAK,CACrBZ,GAAG,CAAEK,IAAI,IAAK;IACb,IAAIA,IAAI,CAACa,IAAI,CAAC,CAAC,CAACC,MAAM,KAAK,CAAC,EAC1B,OAAO,EAAE;IAEX,MAAMG,MAAM,GAAGjB,IAAI,CAACe,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE;IAC5C,MAAMG,cAAc,GAAG,GAAG,CAACC,MAAM,CAACT,IAAI,CAACU,GAAG,CAAC,CAAC,EAAEH,MAAM,CAACH,MAAM,GAAGL,SAAS,CAAC,CAAC;IACzE,OAAOS,cAAc,GAAGlB,IAAI,CAACa,IAAI,CAAC,CAAC;EACrC,CAAC,CAAC,CACDf,IAAI,CAAC,IAAI,CAAC;EAEb,OAAOkB,UAAU,CAACV,OAAO,CAAC,YAAY,EAAE,KAAK,CAAC;AAChD","ignoreList":[]}
|
@@ -0,0 +1,13 @@
|
|
1
|
+
import type { LanguageInput, ThemeInput } from 'shiki';
|
2
|
+
import React from 'react';
|
3
|
+
interface SyntaxHighlighterProps {
|
4
|
+
text: string;
|
5
|
+
lang?: LanguageInput;
|
6
|
+
langName?: string;
|
7
|
+
theme?: ThemeInput;
|
8
|
+
themeName?: string;
|
9
|
+
fontSize?: number;
|
10
|
+
}
|
11
|
+
declare function SyntaxHighlighter({ text, lang, langName, theme, themeName, fontSize, }: SyntaxHighlighterProps): React.JSX.Element;
|
12
|
+
export default SyntaxHighlighter;
|
13
|
+
//# sourceMappingURL=SyntaxHighlighter.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"SyntaxHighlighter.d.ts","sourceRoot":"","sources":["../../../../../src/components/syntax/SyntaxHighlighter.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,OAAO,CAAA;AACtD,OAAO,KAAK,MAAM,OAAO,CAAA;AAMzB,UAAU,sBAAsB;IAC9B,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,CAAC,EAAE,aAAa,CAAA;IACpB,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,KAAK,CAAC,EAAE,UAAU,CAAA;IAClB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAA;CAClB;AAED,iBAAS,iBAAiB,CAAC,EACzB,IAAI,EACJ,IAAiB,EACjB,QAAuB,EACvB,KAAkB,EAClB,SAAyB,EACzB,QAAQ,GACT,EAAE,sBAAsB,qBA4CxB;AAED,eAAe,iBAAiB,CAAA"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"SyntaxLine.d.ts","sourceRoot":"","sources":["../../../../../src/components/syntax/SyntaxLine.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AAC5C,OAAO,KAAK,MAAM,OAAO,CAAA;AAGzB,UAAU,eAAe;IACvB,IAAI,EAAE,SAAS,EAAE,CAAA;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAA;CAClB;AAED,iBAAS,UAAU,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE,eAAe,qBAsBtD;AAED,eAAe,UAAU,CAAA"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/syntax/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,iBAAiB,EAAE,MAAM,qBAAqB,CAAA;AAClE,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,cAAc,CAAA"}
|
@@ -0,0 +1,15 @@
|
|
1
|
+
import type { LanguageInput, ThemedToken, ThemeInput } from 'shiki';
|
2
|
+
interface SyntaxHighlighterProps {
|
3
|
+
text: string;
|
4
|
+
lang: LanguageInput;
|
5
|
+
langName: string;
|
6
|
+
theme: ThemeInput;
|
7
|
+
themeName: string;
|
8
|
+
}
|
9
|
+
export declare function useSyntaxHighlighter({ text, lang, langName, theme, themeName }: SyntaxHighlighterProps): {
|
10
|
+
tokens: ThemedToken[][];
|
11
|
+
error: string | undefined;
|
12
|
+
isLoading: boolean;
|
13
|
+
};
|
14
|
+
export {};
|
15
|
+
//# sourceMappingURL=useSyntaxHighlighter.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"useSyntaxHighlighter.d.ts","sourceRoot":"","sources":["../../../../src/hooks/useSyntaxHighlighter.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,OAAO,CAAA;AAUnE,UAAU,sBAAsB;IAC9B,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,EAAE,aAAa,CAAA;IACnB,QAAQ,EAAE,MAAM,CAAA;IAChB,KAAK,EAAE,UAAU,CAAA;IACjB,SAAS,EAAE,MAAM,CAAA;CAClB;AAED,wBAAgB,oBAAoB,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAE,SAAS,EAAE,EAAE,sBAAsB;;;;EAqDtG"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAA;AACnE,OAAO,EAAE,WAAW,EAAE,MAAM,SAAS,CAAA;AACrC,OAAO,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAA"}
|
@@ -0,0 +1,6 @@
|
|
1
|
+
import type { LanguageInput } from 'shiki';
|
2
|
+
import manifest from '../vendor/shiki/manifest.json';
|
3
|
+
export type AvailableLanguage = keyof typeof manifest.langs;
|
4
|
+
export declare const Languages: Record<string, "typescript" | "abap" | "actionscript-3" | "ada" | "adoc" | "angular-expression" | "angular-html" | "angular-inline-style" | "angular-inline-template" | "angular-let-declaration" | "angular-template-blocks" | "angular-template" | "angular-ts" | "apache" | "apex" | "apl" | "applescript" | "ara" | "asciidoc" | "asm" | "astro" | "awk" | "ballerina" | "bash" | "bat" | "batch" | "be" | "beancount" | "berry" | "bibtex" | "bicep" | "blade" | "c" | "cadence" | "cdc" | "clarity" | "clj" | "clojure" | "closure-templates" | "cmake" | "cmd" | "cobol" | "codeowners" | "codeql" | "coffee" | "coffeescript" | "common-lisp" | "console" | "coq" | "cpp-macro" | "cpp" | "cql" | "crystal" | "cs" | "csharp" | "css" | "csv" | "cue" | "cypher" | "d" | "dart" | "dax" | "desktop" | "diff" | "docker" | "dockerfile" | "dotenv" | "dream-maker" | "edge" | "elisp" | "elixir" | "elm" | "emacs-lisp" | "erb" | "erl" | "erlang" | "es-tag-css" | "es-tag-glsl" | "es-tag-html" | "es-tag-sql" | "es-tag-xml" | "f" | "f03" | "f08" | "f18" | "f77" | "f90" | "f95" | "fennel" | "fish" | "fluent" | "for" | "fortran-fixed-form" | "fortran-free-form" | "fs" | "fsharp" | "fsl" | "ftl" | "gdresource" | "gdscript" | "gdshader" | "genie" | "gherkin" | "git-commit" | "git-rebase" | "gjs" | "gleam" | "glimmer-js" | "glimmer-ts" | "glsl" | "gnuplot" | "go" | "gql" | "graphql" | "groovy" | "gts" | "hack" | "haml" | "handlebars" | "haskell" | "haxe" | "hbs" | "hcl" | "hjson" | "hlsl" | "hs" | "html-derivative" | "html" | "http" | "hxml" | "hy" | "imba" | "ini" | "jade" | "java" | "javascript" | "jinja-html" | "jinja" | "jison" | "jl" | "js" | "json" | "json5" | "jsonc" | "jsonl" | "jsonnet" | "jssm" | "jsx" | "julia" | "kotlin" | "kql" | "kt" | "kts" | "kusto" | "latex" | "lean" | "lean4" | "less" | "liquid" | "lisp" | "lit" | "log" | "logo" | "lua" | "luau" | "make" | "makefile" | "markdown-vue" | "markdown" | "marko" | "matlab" | "md" | "mdc" | "mdx" | "mediawiki" | "mermaid" | "mips" | "mipsasm" | "mmd" | "mojo" | "move" | "nar" | "narrat" | "nextflow" | "nf" | "nginx" | "nim" | "nix" | "nu" | "nushell" | "objc" | "objective-c" | "objective-cpp" | "ocaml" | "pascal" | "perl" | "perl6" | "php" | "plsql" | "po" | "postcss" | "pot" | "potx" | "powerquery" | "powershell" | "prisma" | "prolog" | "properties" | "proto" | "protobuf" | "ps" | "ps1" | "pug" | "puppet" | "purescript" | "py" | "python" | "ql" | "qml" | "qmldir" | "qss" | "r" | "racket" | "raku" | "razor" | "rb" | "reg" | "regex" | "regexp" | "rel" | "riscv" | "rs" | "rst" | "ruby" | "rust" | "sas" | "sass" | "scala" | "scheme" | "scss" | "sh" | "shader" | "shaderlab" | "shell" | "shellscript" | "shellsession" | "smalltalk" | "solidity" | "soy" | "sparql" | "spl" | "splunk" | "sql" | "ssh-config" | "stata" | "styl" | "stylus" | "svelte" | "swift" | "system-verilog" | "systemd" | "tasl" | "tcl" | "templ" | "terraform" | "tex" | "tf" | "tfvars" | "toml" | "ts-tags" | "ts" | "tsp" | "tsv" | "tsx" | "turtle" | "twig" | "typ" | "typespec" | "typst" | "v" | "vala" | "vb" | "verilog" | "vhdl" | "vim" | "viml" | "vimscript" | "vue-directives" | "vue-html" | "vue-interpolations" | "vue-sfc-style-variable-injection" | "vue" | "vy" | "vyper" | "wasm" | "wenyan" | "wgsl" | "wiki" | "wikitext" | "wl" | "wolfram" | "xml" | "xsl" | "yaml" | "yml" | "zenscript" | "zig" | "zsh">;
|
5
|
+
export declare function getLanguage(langName: AvailableLanguage): Promise<LanguageInput>;
|
6
|
+
//# sourceMappingURL=langs.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"langs.d.ts","sourceRoot":"","sources":["../../../src/langs.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAA;AAC1C,OAAO,QAAQ,MAAM,+BAA+B,CAAA;AAEpD,MAAM,MAAM,iBAAiB,GAAG,MAAM,OAAO,QAAQ,CAAC,KAAK,CAAA;AAE3D,eAAO,MAAM,SAAS,8wGAGqB,CAAA;AAE3C,wBAAsB,WAAW,CAAC,QAAQ,EAAE,iBAAiB,GAAG,OAAO,CAAC,aAAa,CAAC,CASrF"}
|
@@ -0,0 +1,9 @@
|
|
1
|
+
import type { LanguageInput, ThemedToken, ThemeInput } from 'shiki';
|
2
|
+
import type { TokenType } from '../../types';
|
3
|
+
import { createHighlighterCore } from 'shiki';
|
4
|
+
export declare function createHighlighter({ langs, themes }: {
|
5
|
+
langs: LanguageInput[];
|
6
|
+
themes: ThemeInput[];
|
7
|
+
}): Promise<Awaited<ReturnType<typeof createHighlighterCore>>>;
|
8
|
+
export declare function processTokens(tokens: ThemedToken[]): TokenType[];
|
9
|
+
//# sourceMappingURL=index.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/syntax/highlighter/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,OAAO,CAAA;AACnE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AAC5C,OAAO,EAAE,qBAAqB,EAA+B,MAAM,OAAO,CAAA;AAU1E,wBAAsB,iBAAiB,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE;IAAE,KAAK,EAAE,aAAa,EAAE,CAAC;IAAC,MAAM,EAAE,UAAU,EAAE,CAAA;CAAE,GAAG,OAAO,CAAC,OAAO,CAAC,UAAU,CAAC,OAAO,qBAAqB,CAAC,CAAC,CAAC,CAavK;AAED,wBAAgB,aAAa,CAAC,MAAM,EAAE,WAAW,EAAE,GAAG,SAAS,EAAE,CAMhE"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/syntax/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,aAAa,EAAE,MAAM,eAAe,CAAA"}
|
@@ -0,0 +1,6 @@
|
|
1
|
+
import type { ThemeInput } from 'shiki';
|
2
|
+
import manifest from '../vendor/shiki/manifest.json';
|
3
|
+
export type AvailableTheme = keyof typeof manifest.themes;
|
4
|
+
export declare const Themes: Record<string, "github-dark" | "andromeeda" | "aurora-x" | "ayu-dark" | "catppuccin-frappe" | "catppuccin-latte" | "catppuccin-macchiato" | "catppuccin-mocha" | "dark-plus" | "dracula-soft" | "dracula" | "everforest-dark" | "everforest-light" | "github-dark-default" | "github-dark-dimmed" | "github-dark-high-contrast" | "github-light-default" | "github-light-high-contrast" | "github-light" | "houston" | "kanagawa-dragon" | "kanagawa-lotus" | "kanagawa-wave" | "laserwave" | "light-plus" | "material-theme-darker" | "material-theme-lighter" | "material-theme-ocean" | "material-theme-palenight" | "material-theme" | "min-dark" | "min-light" | "monokai" | "night-owl" | "nord" | "one-dark-pro" | "one-light" | "plastic" | "poimandres" | "red" | "rose-pine-dawn" | "rose-pine-moon" | "rose-pine" | "slack-dark" | "slack-ochin" | "snazzy-light" | "solarized-dark" | "solarized-light" | "synthwave-84" | "tokyo-night" | "vesper" | "vitesse-black" | "vitesse-dark" | "vitesse-light">;
|
5
|
+
export declare function getTheme(themeName: AvailableTheme): Promise<ThemeInput>;
|
6
|
+
//# sourceMappingURL=themes.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"themes.d.ts","sourceRoot":"","sources":["../../../src/themes.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,OAAO,CAAA;AACvC,OAAO,QAAQ,MAAM,+BAA+B,CAAA;AAEpD,MAAM,MAAM,cAAc,GAAG,MAAM,OAAO,QAAQ,CAAC,MAAM,CAAA;AAEzD,eAAO,MAAM,MAAM,u9BAGqB,CAAA;AAExC,wBAAsB,QAAQ,CAAC,SAAS,EAAE,cAAc,GAAG,OAAO,CAAC,UAAU,CAAC,CAS7E"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/types/index.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,SAAS;IACxB,OAAO,EAAE,MAAM,CAAA;IACf,KAAK,EAAE,MAAM,CAAA;IACb,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,UAAU,CAAC,EAAE,MAAM,CAAA;CACpB"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAA"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"string.d.ts","sourceRoot":"","sources":["../../../../src/utils/string.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,UAAU,CAAA;AAEzC,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,SAAS,EAAE,EAAE,SAAS,GAAE,MAAW,GAAG,MAAM,CAMxF;AAED,wBAAgB,aAAa,CAAC,IAAI,EAAE,SAAS,EAAE,EAAE,KAAK,EAAE,MAAM,UAG7D;AAED,wBAAgB,sBAAsB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAqB3D"}
|
package/package.json
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
{
|
2
2
|
"name": "rn-shiki",
|
3
3
|
"type": "module",
|
4
|
-
"version": "0.0.
|
4
|
+
"version": "0.0.9",
|
5
5
|
"description": "Shiki syntax highlighter for React Native.",
|
6
6
|
"author": "Ryan Skinner <hello@ryanskinner.com>",
|
7
7
|
"license": "MIT",
|
@@ -14,7 +14,8 @@
|
|
14
14
|
"web"
|
15
15
|
],
|
16
16
|
"main": "lib/commonjs/index",
|
17
|
-
"
|
17
|
+
"module": "lib/module/index",
|
18
|
+
"types": "lib/typescript/src/index.d.ts",
|
18
19
|
"react-native": "src/index",
|
19
20
|
"source": "src/index",
|
20
21
|
"scripts": {
|
@@ -53,6 +54,7 @@
|
|
53
54
|
"output": "lib",
|
54
55
|
"targets": [
|
55
56
|
"commonjs",
|
57
|
+
"module",
|
56
58
|
[
|
57
59
|
"typescript",
|
58
60
|
{
|
package/scripts/build.js
CHANGED
@@ -4,8 +4,38 @@ import { fileURLToPath } from 'node:url'
|
|
4
4
|
import esbuild from 'esbuild'
|
5
5
|
|
6
6
|
const __dirname = path.dirname(fileURLToPath(import.meta.url))
|
7
|
+
const VENDOR_DIR = path.join(__dirname, '../vendor/shiki')
|
7
8
|
|
8
|
-
|
9
|
+
function createDeclarationFile(outputPath, name) {
|
10
|
+
// Only create declarations for themes and langs
|
11
|
+
if (!outputPath.includes('/themes/') && !outputPath.includes('/langs/')) {
|
12
|
+
return
|
13
|
+
}
|
14
|
+
|
15
|
+
// Remove .js extension and create paths
|
16
|
+
const jsPath = outputPath.replace(/\\/g, '/')
|
17
|
+
const dtsPath = jsPath.replace('.js', '.d.ts')
|
18
|
+
const modulePath = jsPath.replace('.js', '')
|
19
|
+
|
20
|
+
// Get the correct type based on the path
|
21
|
+
const typeAnnotation = outputPath.includes('/themes/') ? 'import("shiki").ThemeInput' : 'import("shiki").LanguageInput'
|
22
|
+
|
23
|
+
// Replace hyphens in name to create a valid TypeScript identifier
|
24
|
+
const safeName = name.replace(/-/g, '_')
|
25
|
+
|
26
|
+
const dtsContent = `\
|
27
|
+
import type { ThemeInput, LanguageInput } from 'shiki'
|
28
|
+
|
29
|
+
declare module '${modulePath}' {
|
30
|
+
const ${safeName}: ${typeAnnotation}
|
31
|
+
export default ${safeName}
|
32
|
+
}
|
33
|
+
`
|
34
|
+
fs.writeFileSync(dtsPath, dtsContent)
|
35
|
+
}
|
36
|
+
|
37
|
+
// Build function
|
38
|
+
async function buildModule(inputPath, outputPath, typeName = 'any') {
|
9
39
|
try {
|
10
40
|
const result = await esbuild.build({
|
11
41
|
entryPoints: [inputPath],
|
@@ -33,6 +63,8 @@ async function buildModule(inputPath, outputPath) {
|
|
33
63
|
fs.writeFileSync(outputPath, result.outputFiles[0].text)
|
34
64
|
}
|
35
65
|
|
66
|
+
// Create declaration file for TypeScript, replacing hyphens in name
|
67
|
+
createDeclarationFile(outputPath, path.basename(outputPath, '.js').replace(/-/g, '_'), typeName)
|
36
68
|
return true
|
37
69
|
}
|
38
70
|
catch (error) {
|
@@ -41,13 +73,27 @@ async function buildModule(inputPath, outputPath) {
|
|
41
73
|
}
|
42
74
|
}
|
43
75
|
|
76
|
+
// Create initial manifest with metadata
|
77
|
+
function createManifest() {
|
78
|
+
const shikiPkg = JSON.parse(fs.readFileSync(path.join(__dirname, '../node_modules/shiki/package.json'), 'utf8'))
|
79
|
+
|
80
|
+
return {
|
81
|
+
version: shikiPkg.version,
|
82
|
+
buildDate: new Date().toISOString(),
|
83
|
+
core: [],
|
84
|
+
langs: {},
|
85
|
+
themes: {},
|
86
|
+
}
|
87
|
+
}
|
88
|
+
|
44
89
|
const shikiDir = path.join(__dirname, '../node_modules/shiki/dist')
|
45
90
|
const langFiles = fs
|
46
91
|
.readdirSync(path.join(shikiDir, 'langs'))
|
47
92
|
.filter(file => file.endsWith('.mjs'))
|
48
93
|
.map(file => ({
|
49
94
|
input: `shiki/dist/langs/${file}`,
|
50
|
-
output: `
|
95
|
+
output: `vendor/shiki/langs/${file.replace('.mjs', '.js')}`,
|
96
|
+
name: file.replace('.mjs', ''),
|
51
97
|
}))
|
52
98
|
|
53
99
|
const themeFiles = fs
|
@@ -55,44 +101,77 @@ const themeFiles = fs
|
|
55
101
|
.filter(file => file.endsWith('.mjs'))
|
56
102
|
.map(file => ({
|
57
103
|
input: `shiki/dist/themes/${file}`,
|
58
|
-
output: `
|
104
|
+
output: `vendor/shiki/themes/${file.replace('.mjs', '.js')}`,
|
105
|
+
name: file.replace('.mjs', ''),
|
59
106
|
}))
|
60
107
|
|
61
108
|
const coreModules = [
|
62
109
|
{
|
63
110
|
input: 'shiki/dist/core.mjs',
|
64
|
-
output: '
|
111
|
+
output: 'vendor/shiki/core/core.js',
|
112
|
+
name: 'core',
|
113
|
+
type: 'typeof import("shiki/core")',
|
65
114
|
},
|
66
115
|
{
|
67
116
|
input: 'shiki/dist/engine-javascript.mjs',
|
68
|
-
output: '
|
117
|
+
output: 'vendor/shiki/core/engine-javascript.js',
|
118
|
+
name: 'engine_javascript', // Use underscore in name to prevent TypeScript errors
|
119
|
+
type: 'typeof import("shiki/engine/javascript")',
|
69
120
|
},
|
70
121
|
...langFiles,
|
71
122
|
...themeFiles,
|
72
123
|
]
|
73
124
|
|
125
|
+
// Initialize manifest
|
126
|
+
const manifest = createManifest()
|
127
|
+
|
128
|
+
// Ensure vendor directory exists
|
129
|
+
if (!fs.existsSync(VENDOR_DIR)) {
|
130
|
+
fs.mkdirSync(VENDOR_DIR, { recursive: true })
|
131
|
+
}
|
132
|
+
|
133
|
+
// Create necessary subdirectories
|
134
|
+
;['core', 'langs', 'themes'].forEach((dir) => {
|
135
|
+
const fullPath = path.join(VENDOR_DIR, dir)
|
136
|
+
if (!fs.existsSync(fullPath)) {
|
137
|
+
fs.mkdirSync(fullPath, { recursive: true })
|
138
|
+
}
|
139
|
+
})
|
140
|
+
|
141
|
+
// Build all modules and update manifest
|
74
142
|
for (const module of coreModules) {
|
75
143
|
const inputPath = path.join(__dirname, '../node_modules', module.input)
|
76
144
|
const outputPath = path.join(__dirname, '..', module.output)
|
77
145
|
|
78
146
|
const dir = path.dirname(outputPath)
|
79
|
-
if (!fs.existsSync(dir))
|
147
|
+
if (!fs.existsSync(dir)) {
|
80
148
|
fs.mkdirSync(dir, { recursive: true })
|
149
|
+
}
|
81
150
|
|
82
|
-
await buildModule(inputPath, outputPath)
|
151
|
+
await buildModule(inputPath, outputPath, module.type || 'any')
|
83
152
|
console.log(`Built ${path.basename(module.input)} -> ${path.basename(module.output)}`)
|
84
|
-
}
|
85
|
-
|
86
|
-
export async function buildOnDemand(type, name) {
|
87
|
-
const inputPath = path.join(__dirname, `../node_modules/shiki/dist/${type}/${name}.mjs`)
|
88
|
-
const outputPath = path.join(__dirname, `../dist/cache/${type}/${name}.js`)
|
89
153
|
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
154
|
+
// Update manifest
|
155
|
+
if (module.input.includes('/langs/')) {
|
156
|
+
manifest.langs[module.name] = {
|
157
|
+
file: path.relative(VENDOR_DIR, outputPath),
|
158
|
+
built: new Date().toISOString(),
|
159
|
+
}
|
160
|
+
}
|
161
|
+
else if (module.input.includes('/themes/')) {
|
162
|
+
manifest.themes[module.name] = {
|
163
|
+
file: path.relative(VENDOR_DIR, outputPath),
|
164
|
+
built: new Date().toISOString(),
|
165
|
+
}
|
166
|
+
}
|
167
|
+
else {
|
168
|
+
manifest.core.push({
|
169
|
+
name: module.name,
|
170
|
+
file: path.relative(VENDOR_DIR, outputPath),
|
171
|
+
built: new Date().toISOString(),
|
172
|
+
})
|
96
173
|
}
|
97
|
-
return null
|
98
174
|
}
|
175
|
+
|
176
|
+
// Write manifest
|
177
|
+
fs.writeFileSync(path.join(VENDOR_DIR, 'manifest.json'), JSON.stringify(manifest, null, 2))
|
@@ -1,20 +1,33 @@
|
|
1
|
-
import type {
|
1
|
+
import type { LanguageInput, ThemeInput } from 'shiki'
|
2
2
|
import React from 'react'
|
3
3
|
import { Text, View } from 'react-native'
|
4
|
+
import typescript from '../../../vendor/shiki/langs/typescript'
|
5
|
+
import githubDark from '../../../vendor/shiki/themes/github-dark'
|
4
6
|
import { useSyntaxHighlighter } from '../../hooks/useSyntaxHighlighter'
|
5
7
|
|
6
8
|
interface SyntaxHighlighterProps {
|
7
9
|
text: string
|
8
|
-
lang
|
9
|
-
|
10
|
+
lang?: LanguageInput
|
11
|
+
langName?: string
|
12
|
+
theme?: ThemeInput
|
13
|
+
themeName?: string
|
10
14
|
fontSize?: number
|
11
15
|
}
|
12
16
|
|
13
|
-
function SyntaxHighlighter({
|
17
|
+
function SyntaxHighlighter({
|
18
|
+
text,
|
19
|
+
lang = typescript,
|
20
|
+
langName = 'typescript',
|
21
|
+
theme = githubDark,
|
22
|
+
themeName = 'github-dark',
|
23
|
+
fontSize,
|
24
|
+
}: SyntaxHighlighterProps) {
|
14
25
|
const { tokens, error, isLoading } = useSyntaxHighlighter({
|
15
26
|
text,
|
16
27
|
lang,
|
28
|
+
langName,
|
17
29
|
theme,
|
30
|
+
themeName,
|
18
31
|
})
|
19
32
|
|
20
33
|
if (error) {
|
@@ -1,5 +1,4 @@
|
|
1
|
-
import type {
|
2
|
-
import type { SupportedLanguage, SupportedTheme } from '../syntax/highlighter'
|
1
|
+
import type { LanguageInput, ThemedToken, ThemeInput } from 'shiki'
|
3
2
|
import { useEffect, useState } from 'react'
|
4
3
|
import { createHighlighter } from '../syntax'
|
5
4
|
|
@@ -9,7 +8,15 @@ interface ShikiResult {
|
|
9
8
|
fg: string
|
10
9
|
}
|
11
10
|
|
12
|
-
|
11
|
+
interface SyntaxHighlighterProps {
|
12
|
+
text: string
|
13
|
+
lang: LanguageInput
|
14
|
+
langName: string
|
15
|
+
theme: ThemeInput
|
16
|
+
themeName: string
|
17
|
+
}
|
18
|
+
|
19
|
+
export function useSyntaxHighlighter({ text, lang, langName, theme, themeName }: SyntaxHighlighterProps) {
|
13
20
|
const [tokens, setTokens] = useState<ThemedToken[][]>([])
|
14
21
|
const [error, setError] = useState<string>()
|
15
22
|
const [isLoading, setIsLoading] = useState(true)
|
@@ -27,13 +34,13 @@ export function useSyntaxHighlighter({ text, lang, theme }: { text: string, lang
|
|
27
34
|
|
28
35
|
try {
|
29
36
|
const highlighter = await createHighlighter({
|
30
|
-
langs: [lang
|
31
|
-
themes: [theme
|
37
|
+
langs: [lang],
|
38
|
+
themes: [theme],
|
32
39
|
})
|
33
40
|
|
34
41
|
const result = highlighter.codeToTokens(text, {
|
35
|
-
lang,
|
36
|
-
theme,
|
42
|
+
lang: langName,
|
43
|
+
theme: themeName,
|
37
44
|
}) as ShikiResult
|
38
45
|
|
39
46
|
if (mounted && result.tokens) {
|
@@ -59,7 +66,7 @@ export function useSyntaxHighlighter({ text, lang, theme }: { text: string, lang
|
|
59
66
|
return () => {
|
60
67
|
mounted = false
|
61
68
|
}
|
62
|
-
}, [text, lang, theme])
|
69
|
+
}, [text, lang, langName, theme, themeName])
|
63
70
|
|
64
71
|
return { tokens, error, isLoading }
|
65
72
|
}
|
package/src/index.ts
CHANGED
@@ -1,3 +1,3 @@
|
|
1
1
|
export { SyntaxHighlighter, SyntaxLine } from './components/syntax'
|
2
|
-
export {
|
3
|
-
export
|
2
|
+
export { getLanguage } from './langs'
|
3
|
+
export { getTheme } from './themes'
|
package/src/langs.ts
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
import type { LanguageInput } from 'shiki'
|
2
|
+
import manifest from '../vendor/shiki/manifest.json'
|
3
|
+
|
4
|
+
export type AvailableLanguage = keyof typeof manifest.langs
|
5
|
+
|
6
|
+
export const Languages = Object.keys(manifest.langs).reduce((acc, lang) => {
|
7
|
+
const key = lang.replace(/-/g, '_').toUpperCase()
|
8
|
+
return { ...acc, [key]: lang as AvailableLanguage }
|
9
|
+
}, {} as Record<string, AvailableLanguage>)
|
10
|
+
|
11
|
+
export async function getLanguage(langName: AvailableLanguage): Promise<LanguageInput> {
|
12
|
+
try {
|
13
|
+
const lang = await import(`../vendor/shiki/langs/${String(langName)}.js`)
|
14
|
+
return lang.default
|
15
|
+
}
|
16
|
+
catch (err) {
|
17
|
+
const error = err instanceof Error ? err.message : String(err)
|
18
|
+
throw new Error(`Language '${String(langName)}' failed to load: ${error}`)
|
19
|
+
}
|
20
|
+
}
|