@bilal-fazlani/mock-server 0.2.1 → 0.3.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/.next/standalone/.next/BUILD_ID +1 -1
- package/.next/standalone/.next/build-manifest.json +3 -3
- package/.next/standalone/.next/node_modules/shiki-43d062b67f27bbdc/dist/bundle-full.mjs +41 -0
- package/.next/standalone/.next/node_modules/shiki-43d062b67f27bbdc/dist/engine-oniguruma.mjs +8 -0
- package/.next/standalone/.next/node_modules/shiki-43d062b67f27bbdc/dist/index.mjs +29 -0
- package/.next/standalone/.next/node_modules/shiki-43d062b67f27bbdc/dist/langs-bundle-full-4noeO3oH.mjs +1283 -0
- package/.next/standalone/.next/node_modules/shiki-43d062b67f27bbdc/dist/rolldown-runtime-BBjsoOtd.mjs +27 -0
- package/.next/standalone/.next/node_modules/shiki-43d062b67f27bbdc/dist/themes.mjs +396 -0
- package/.next/standalone/.next/node_modules/shiki-43d062b67f27bbdc/dist/wasm.mjs +3 -0
- package/.next/standalone/.next/node_modules/shiki-43d062b67f27bbdc/package.json +73 -0
- package/.next/standalone/.next/prerender-manifest.json +3 -3
- package/.next/standalone/.next/required-server-files.json +4 -1
- package/.next/standalone/.next/server/app/[...path]/route.js +2 -2
- package/.next/standalone/.next/server/app/[...path]/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/_global-error.html +1 -1
- package/.next/standalone/.next/server/app/_global-error.rsc +1 -1
- package/.next/standalone/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/_not-found.html +1 -1
- package/.next/standalone/.next/server/app/_not-found.rsc +2 -2
- package/.next/standalone/.next/server/app/_not-found.segments/_full.segment.rsc +2 -2
- package/.next/standalone/.next/server/app/_not-found.segments/_head.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/_not-found.segments/_index.segment.rsc +2 -2
- package/.next/standalone/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/_not-found.segments/_tree.segment.rsc +2 -2
- package/.next/standalone/.next/server/app/index.html +1 -1
- package/.next/standalone/.next/server/app/index.rsc +2 -2
- package/.next/standalone/.next/server/app/index.segments/__PAGE__.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/index.segments/_full.segment.rsc +2 -2
- package/.next/standalone/.next/server/app/index.segments/_head.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/index.segments/_index.segment.rsc +2 -2
- package/.next/standalone/.next/server/app/index.segments/_tree.segment.rsc +2 -2
- package/.next/standalone/.next/server/app/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/ui/[...notFound]/page.js +1 -1
- package/.next/standalone/.next/server/app/ui/[...notFound]/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/ui/[...notFound]/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/ui/api/catalog/route.js +2 -2
- package/.next/standalone/.next/server/app/ui/api/catalog/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/ui/api/global-mocks/[system]/[endpoint]/route.js +2 -2
- package/.next/standalone/.next/server/app/ui/api/global-mocks/[system]/[endpoint]/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/ui/api/global-mocks/route.js +1 -1
- package/.next/standalone/.next/server/app/ui/api/global-mocks/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/ui/api/health/route.js +1 -1
- package/.next/standalone/.next/server/app/ui/api/health/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/ui/api/logs/[logId]/route.js +1 -1
- package/.next/standalone/.next/server/app/ui/api/logs/[logId]/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/ui/api/logs/route.js +1 -1
- package/.next/standalone/.next/server/app/ui/api/logs/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/ui/api/profiles/[profileId]/reset/route.js +1 -1
- package/.next/standalone/.next/server/app/ui/api/profiles/[profileId]/reset/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/ui/api/profiles/[profileId]/route.js +2 -2
- package/.next/standalone/.next/server/app/ui/api/profiles/[profileId]/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/ui/catalog/[system]/[endpoint]/page.js +8 -7
- package/.next/standalone/.next/server/app/ui/catalog/[system]/[endpoint]/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/ui/catalog/[system]/[endpoint]/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/ui/catalog/page.js +5 -5
- package/.next/standalone/.next/server/app/ui/catalog/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/ui/catalog/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/ui/environment/page.js +4 -4
- package/.next/standalone/.next/server/app/ui/environment/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/ui/environment/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/ui/global-mocks/page/server-reference-manifest.json +2 -2
- package/.next/standalone/.next/server/app/ui/global-mocks/page.js +4 -4
- package/.next/standalone/.next/server/app/ui/global-mocks/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/ui/global-mocks/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/ui/logs/page/server-reference-manifest.json +1 -1
- package/.next/standalone/.next/server/app/ui/logs/page.js +5 -5
- package/.next/standalone/.next/server/app/ui/logs/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/ui/logs/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/ui/page.js +4 -4
- package/.next/standalone/.next/server/app/ui/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/ui/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/ui/profiles/[profileId]/page/server-reference-manifest.json +4 -4
- package/.next/standalone/.next/server/app/ui/profiles/[profileId]/page.js +6 -6
- package/.next/standalone/.next/server/app/ui/profiles/[profileId]/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/ui/profiles/[profileId]/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/ui/profiles/new/page/server-reference-manifest.json +4 -4
- package/.next/standalone/.next/server/app/ui/profiles/new/page.js +5 -5
- package/.next/standalone/.next/server/app/ui/profiles/new/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/ui/profiles/new/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/ui/profiles/new.html +1 -1
- package/.next/standalone/.next/server/app/ui/profiles/new.rsc +31 -31
- package/.next/standalone/.next/server/app/ui/profiles/new.segments/_full.segment.rsc +31 -31
- package/.next/standalone/.next/server/app/ui/profiles/new.segments/_head.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/ui/profiles/new.segments/_index.segment.rsc +2 -2
- package/.next/standalone/.next/server/app/ui/profiles/new.segments/_tree.segment.rsc +2 -2
- package/.next/standalone/.next/server/app/ui/profiles/new.segments/ui/profiles/new/__PAGE__.segment.rsc +18 -17
- package/.next/standalone/.next/server/app/ui/profiles/new.segments/ui/profiles/new.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/ui/profiles/new.segments/ui/profiles.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/ui/profiles/new.segments/ui.segment.rsc +3 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0_w4w88._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0eo49or._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0om7kg8._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0s6drot._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0t8o5f7._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__14hrty_._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__1d3vxpt._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__1e407ve._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__1islaxo._.js +3 -0
- package/.next/standalone/.next/server/chunks/{_01xbyam._.js → _0qbx9v1._.js} +6 -6
- package/.next/standalone/.next/server/chunks/{_0022gwg._.js → _16q11je._.js} +6 -6
- package/.next/standalone/.next/server/chunks/node_modules_next_dist_esm_build_templates_app-route_1hi1g43.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__095ld3v._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0c_8sxb._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__131d-3a._.js → [root-of-the-server]__0ok8mg5._.js} +2 -2
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0uln_1r._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0xmt17v._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__16y93ju._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__18_kqdp._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__18z_8pt._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__1ac328a._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__1ffkjjl._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__1gmmta4._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__1k-7k5k._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__1po4if1._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__1r99_25._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__1xkfxwl._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__20xpe3a._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/_0ceyznt._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/{_1s8xzfs._.js → _0dcewjo._.js} +5 -5
- package/.next/standalone/.next/server/chunks/ssr/_0dp2bez._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/_0hv6b4i._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/_0txvxmw._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/_13ez5qw._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/_142--49._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/_1nyvjoj._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/src_1s6weq_._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/src_app_ui_logs_LogRow_tsx_1mzipt8._.js +1 -1
- package/.next/standalone/.next/server/middleware-build-manifest.js +3 -3
- package/.next/standalone/.next/server/pages/404.html +1 -1
- package/.next/standalone/.next/server/pages/500.html +1 -1
- package/.next/standalone/.next/server/server-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/server-reference-manifest.json +8 -8
- package/.next/standalone/.next/static/chunks/12ny879muwkxw.js +1 -0
- package/.next/standalone/.next/static/chunks/18hh57jv94a5e.js +1 -0
- package/.next/standalone/.next/static/chunks/1rml3lmlc_-1c.js +1 -0
- package/.next/standalone/.next/static/chunks/1zxhmuljxo270.js +1 -0
- package/.next/standalone/.next/static/chunks/2bqfpygv3x9-k.js +1 -0
- package/.next/standalone/.next/static/chunks/3fpjbzbf26aey.js +1 -0
- package/.next/standalone/.next/static/chunks/3ivfq435-2tni.css +3 -0
- package/.next/standalone/next.config.ts +32 -0
- package/.next/standalone/node_modules/@shikijs/core/dist/index.mjs +1406 -0
- package/.next/standalone/node_modules/@shikijs/core/package.json +60 -0
- package/.next/standalone/node_modules/@shikijs/engine-javascript/dist/engine-compile.mjs +47 -0
- package/.next/standalone/node_modules/@shikijs/engine-javascript/dist/engine-raw.mjs +27 -0
- package/.next/standalone/node_modules/@shikijs/engine-javascript/dist/index.mjs +4 -0
- package/.next/standalone/node_modules/@shikijs/engine-javascript/dist/scanner-DX8LRFGE.mjs +77 -0
- package/.next/standalone/node_modules/@shikijs/engine-javascript/package.json +42 -0
- package/.next/standalone/node_modules/@shikijs/engine-oniguruma/dist/index.mjs +449 -0
- package/.next/standalone/node_modules/@shikijs/engine-oniguruma/dist/wasm-inlined.mjs +8 -0
- package/.next/standalone/node_modules/@shikijs/engine-oniguruma/package.json +45 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/abap.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/actionscript-3.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/ada.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/angular-expression.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/angular-html.mjs +16 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/angular-inline-style.mjs +8 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/angular-inline-template.mjs +10 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/angular-let-declaration.mjs +8 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/angular-template-blocks.mjs +10 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/angular-template.mjs +8 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/angular-ts.mjs +18 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/apache.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/apex.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/apl.mjs +16 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/applescript.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/ara.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/asciidoc.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/asm.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/astro.mjs +18 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/awk.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/ballerina.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/bat.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/beancount.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/berry.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/bibtex.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/bicep.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/bird2.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/blade.mjs +20 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/bsl.mjs +8 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/c.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/c3.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/cadence.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/cairo.mjs +8 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/clarity.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/clojure.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/cmake.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/cobol.mjs +10 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/codeowners.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/codeql.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/coffee.mjs +8 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/common-lisp.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/coq.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/cpp-macro.mjs +12 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/cpp.mjs +14 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/crystal.mjs +18 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/csharp.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/css.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/csv.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/cue.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/cypher.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/d.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/dart.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/dax.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/desktop.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/diff.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/docker.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/dotenv.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/dream-maker.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/edge.mjs +12 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/elixir.mjs +8 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/elm.mjs +8 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/emacs-lisp.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/erb.mjs +10 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/erlang.mjs +8 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/es-tag-css.mjs +12 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/es-tag-glsl.mjs +12 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/es-tag-html.mjs +12 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/es-tag-sql.mjs +10 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/es-tag-xml.mjs +8 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/fennel.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/fish.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/fluent.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/fortran-fixed-form.mjs +8 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/fortran-free-form.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/fsharp.mjs +8 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/gdresource.mjs +10 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/gdscript.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/gdshader.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/genie.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/gherkin.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/git-commit.mjs +8 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/git-rebase.mjs +8 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/gleam.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/glimmer-js.mjs +14 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/glimmer-ts.mjs +14 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/glsl.mjs +8 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/gn.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/gnuplot.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/go.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/graphql.mjs +14 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/groovy.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/hack.mjs +10 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/haml.mjs +10 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/handlebars.mjs +14 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/haskell.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/haxe.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/hcl.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/hjson.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/hlsl.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/html-derivative.mjs +8 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/html.mjs +10 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/http.mjs +14 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/hurl.mjs +12 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/hxml.mjs +8 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/hy.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/imba.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/ini.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/java.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/javascript.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/jinja-html.mjs +8 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/jinja.mjs +8 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/jison.mjs +8 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/json.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/json5.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/jsonc.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/jsonl.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/jsonnet.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/jssm.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/jsx.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/julia.mjs +16 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/just.mjs +18 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/kdl.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/kotlin.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/kusto.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/latex.mjs +8 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/lean.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/less.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/liquid.mjs +14 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/llvm.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/log.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/logo.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/lua.mjs +8 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/luau.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/make.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/markdown-nix.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/markdown-vue.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/markdown.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/marko.mjs +14 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/matlab.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/mdc.mjs +12 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/mdx.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/mermaid.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/mipsasm.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/mojo.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/moonbit.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/move.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/narrat.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/nextflow-groovy.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/nextflow.mjs +8 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/nginx.mjs +8 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/nim.mjs +20 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/nix.mjs +8 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/nushell.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/objective-c.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/objective-cpp.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/ocaml.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/odin.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/openscad.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/pascal.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/perl.mjs +16 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/php.mjs +18 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/pkl.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/plsql.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/po.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/polar.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/postcss.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/powerquery.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/powershell.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/prisma.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/prolog.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/proto.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/pug.mjs +12 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/puppet.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/purescript.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/python.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/qml.mjs +8 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/qmldir.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/qss.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/r.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/racket.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/raku.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/razor.mjs +10 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/reg.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/regexp.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/rel.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/riscv.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/ron.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/rosmsg.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/rst.mjs +22 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/ruby.mjs +30 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/rust.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/sas.mjs +8 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/sass.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/scala.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/scheme.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/scss.mjs +8 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/sdbl.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/shaderlab.mjs +8 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/shellscript.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/shellsession.mjs +8 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/smalltalk.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/solidity.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/soy.mjs +8 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/sparql.mjs +8 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/splunk.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/sql.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/ssh-config.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/stata.mjs +8 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/stylus.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/surrealql.mjs +8 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/svelte.mjs +14 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/swift.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/system-verilog.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/systemd.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/talonscript.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/tasl.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/tcl.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/templ.mjs +12 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/terraform.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/tex.mjs +8 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/toml.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/ts-tags.mjs +18 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/tsv.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/tsx.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/turtle.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/twig.mjs +18 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/typescript.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/typespec.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/typst.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/v.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/vala.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/vb.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/verilog.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/vhdl.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/viml.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/vue-directives.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/vue-html.mjs +8 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/vue-interpolations.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/vue-sfc-style-variable-injection.mjs +8 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/vue-vine.mjs +18 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/vue.mjs +26 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/vyper.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/wasm.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/wenyan.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/wgsl.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/wikitext.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/wit.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/wolfram.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/xml.mjs +8 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/xsl.mjs +8 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/yaml.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/zenscript.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/zig.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/package.json +387 -0
- package/.next/standalone/node_modules/@shikijs/primitive/dist/index.mjs +834 -0
- package/.next/standalone/node_modules/@shikijs/primitive/package.json +56 -0
- package/.next/standalone/node_modules/@shikijs/themes/dist/andromeeda.mjs +2 -0
- package/.next/standalone/node_modules/@shikijs/themes/dist/aurora-x.mjs +2 -0
- package/.next/standalone/node_modules/@shikijs/themes/dist/ayu-dark.mjs +2 -0
- package/.next/standalone/node_modules/@shikijs/themes/dist/ayu-light.mjs +2 -0
- package/.next/standalone/node_modules/@shikijs/themes/dist/ayu-mirage.mjs +2 -0
- package/.next/standalone/node_modules/@shikijs/themes/dist/catppuccin-frappe.mjs +2 -0
- package/.next/standalone/node_modules/@shikijs/themes/dist/catppuccin-latte.mjs +2 -0
- package/.next/standalone/node_modules/@shikijs/themes/dist/catppuccin-macchiato.mjs +2 -0
- package/.next/standalone/node_modules/@shikijs/themes/dist/catppuccin-mocha.mjs +2 -0
- package/.next/standalone/node_modules/@shikijs/themes/dist/dark-plus.mjs +2 -0
- package/.next/standalone/node_modules/@shikijs/themes/dist/dracula-soft.mjs +2 -0
- package/.next/standalone/node_modules/@shikijs/themes/dist/dracula.mjs +2 -0
- package/.next/standalone/node_modules/@shikijs/themes/dist/everforest-dark.mjs +2 -0
- package/.next/standalone/node_modules/@shikijs/themes/dist/everforest-light.mjs +2 -0
- package/.next/standalone/node_modules/@shikijs/themes/dist/github-dark-default.mjs +2 -0
- package/.next/standalone/node_modules/@shikijs/themes/dist/github-dark-dimmed.mjs +2 -0
- package/.next/standalone/node_modules/@shikijs/themes/dist/github-dark-high-contrast.mjs +2 -0
- package/.next/standalone/node_modules/@shikijs/themes/dist/github-dark.mjs +2 -0
- package/.next/standalone/node_modules/@shikijs/themes/dist/github-light-default.mjs +2 -0
- package/.next/standalone/node_modules/@shikijs/themes/dist/github-light-high-contrast.mjs +2 -0
- package/.next/standalone/node_modules/@shikijs/themes/dist/github-light.mjs +2 -0
- package/.next/standalone/node_modules/@shikijs/themes/dist/gruvbox-dark-hard.mjs +2 -0
- package/.next/standalone/node_modules/@shikijs/themes/dist/gruvbox-dark-medium.mjs +2 -0
- package/.next/standalone/node_modules/@shikijs/themes/dist/gruvbox-dark-soft.mjs +2 -0
- package/.next/standalone/node_modules/@shikijs/themes/dist/gruvbox-light-hard.mjs +2 -0
- package/.next/standalone/node_modules/@shikijs/themes/dist/gruvbox-light-medium.mjs +2 -0
- package/.next/standalone/node_modules/@shikijs/themes/dist/gruvbox-light-soft.mjs +2 -0
- package/.next/standalone/node_modules/@shikijs/themes/dist/horizon-bright.mjs +2 -0
- package/.next/standalone/node_modules/@shikijs/themes/dist/horizon.mjs +2 -0
- package/.next/standalone/node_modules/@shikijs/themes/dist/houston.mjs +2 -0
- package/.next/standalone/node_modules/@shikijs/themes/dist/kanagawa-dragon.mjs +2 -0
- package/.next/standalone/node_modules/@shikijs/themes/dist/kanagawa-lotus.mjs +2 -0
- package/.next/standalone/node_modules/@shikijs/themes/dist/kanagawa-wave.mjs +2 -0
- package/.next/standalone/node_modules/@shikijs/themes/dist/laserwave.mjs +2 -0
- package/.next/standalone/node_modules/@shikijs/themes/dist/light-plus.mjs +2 -0
- package/.next/standalone/node_modules/@shikijs/themes/dist/material-theme-darker.mjs +2 -0
- package/.next/standalone/node_modules/@shikijs/themes/dist/material-theme-lighter.mjs +2 -0
- package/.next/standalone/node_modules/@shikijs/themes/dist/material-theme-ocean.mjs +2 -0
- package/.next/standalone/node_modules/@shikijs/themes/dist/material-theme-palenight.mjs +2 -0
- package/.next/standalone/node_modules/@shikijs/themes/dist/material-theme.mjs +2 -0
- package/.next/standalone/node_modules/@shikijs/themes/dist/min-dark.mjs +2 -0
- package/.next/standalone/node_modules/@shikijs/themes/dist/min-light.mjs +2 -0
- package/.next/standalone/node_modules/@shikijs/themes/dist/monokai.mjs +2 -0
- package/.next/standalone/node_modules/@shikijs/themes/dist/night-owl-light.mjs +2 -0
- package/.next/standalone/node_modules/@shikijs/themes/dist/night-owl.mjs +2 -0
- package/.next/standalone/node_modules/@shikijs/themes/dist/nord.mjs +2 -0
- package/.next/standalone/node_modules/@shikijs/themes/dist/one-dark-pro.mjs +2 -0
- package/.next/standalone/node_modules/@shikijs/themes/dist/one-light.mjs +2 -0
- package/.next/standalone/node_modules/@shikijs/themes/dist/plastic.mjs +2 -0
- package/.next/standalone/node_modules/@shikijs/themes/dist/poimandres.mjs +2 -0
- package/.next/standalone/node_modules/@shikijs/themes/dist/red.mjs +2 -0
- package/.next/standalone/node_modules/@shikijs/themes/dist/rose-pine-dawn.mjs +2 -0
- package/.next/standalone/node_modules/@shikijs/themes/dist/rose-pine-moon.mjs +2 -0
- package/.next/standalone/node_modules/@shikijs/themes/dist/rose-pine.mjs +2 -0
- package/.next/standalone/node_modules/@shikijs/themes/dist/slack-dark.mjs +2 -0
- package/.next/standalone/node_modules/@shikijs/themes/dist/slack-ochin.mjs +2 -0
- package/.next/standalone/node_modules/@shikijs/themes/dist/snazzy-light.mjs +2 -0
- package/.next/standalone/node_modules/@shikijs/themes/dist/solarized-dark.mjs +2 -0
- package/.next/standalone/node_modules/@shikijs/themes/dist/solarized-light.mjs +2 -0
- package/.next/standalone/node_modules/@shikijs/themes/dist/synthwave-84.mjs +2 -0
- package/.next/standalone/node_modules/@shikijs/themes/dist/tokyo-night.mjs +2 -0
- package/.next/standalone/node_modules/@shikijs/themes/dist/vesper.mjs +2 -0
- package/.next/standalone/node_modules/@shikijs/themes/dist/vitesse-black.mjs +2 -0
- package/.next/standalone/node_modules/@shikijs/themes/dist/vitesse-dark.mjs +2 -0
- package/.next/standalone/node_modules/@shikijs/themes/dist/vitesse-light.mjs +2 -0
- package/.next/standalone/node_modules/@shikijs/themes/package.json +106 -0
- package/.next/standalone/node_modules/@shikijs/types/dist/index.mjs +9 -0
- package/.next/standalone/node_modules/@shikijs/types/package.json +39 -0
- package/.next/standalone/node_modules/@shikijs/vscode-textmate/dist/index.js +3216 -0
- package/.next/standalone/node_modules/@shikijs/vscode-textmate/package.json +46 -0
- package/.next/standalone/node_modules/ccount/index.js +27 -0
- package/.next/standalone/node_modules/ccount/package.json +71 -0
- package/.next/standalone/node_modules/character-entities-html4/index.js +259 -0
- package/.next/standalone/node_modules/character-entities-html4/package.json +79 -0
- package/.next/standalone/node_modules/character-entities-legacy/index.js +113 -0
- package/.next/standalone/node_modules/character-entities-legacy/package.json +77 -0
- package/.next/standalone/node_modules/comma-separated-tokens/index.js +74 -0
- package/.next/standalone/node_modules/comma-separated-tokens/package.json +72 -0
- package/.next/standalone/node_modules/hast-util-to-html/index.js +8 -0
- package/.next/standalone/node_modules/hast-util-to-html/lib/handle/comment.js +52 -0
- package/.next/standalone/node_modules/hast-util-to-html/lib/handle/doctype.js +27 -0
- package/.next/standalone/node_modules/hast-util-to-html/lib/handle/element.js +265 -0
- package/.next/standalone/node_modules/hast-util-to-html/lib/handle/index.js +47 -0
- package/.next/standalone/node_modules/hast-util-to-html/lib/handle/raw.js +27 -0
- package/.next/standalone/node_modules/hast-util-to-html/lib/handle/root.js +22 -0
- package/.next/standalone/node_modules/hast-util-to-html/lib/handle/text.js +38 -0
- package/.next/standalone/node_modules/hast-util-to-html/lib/index.js +257 -0
- package/.next/standalone/node_modules/hast-util-to-html/lib/omission/closing.js +358 -0
- package/.next/standalone/node_modules/hast-util-to-html/lib/omission/omission.js +44 -0
- package/.next/standalone/node_modules/hast-util-to-html/lib/omission/opening.js +148 -0
- package/.next/standalone/node_modules/hast-util-to-html/lib/omission/util/siblings.js +50 -0
- package/.next/standalone/node_modules/hast-util-to-html/package.json +106 -0
- package/.next/standalone/node_modules/hast-util-whitespace/index.js +1 -0
- package/.next/standalone/node_modules/hast-util-whitespace/lib/index.js +34 -0
- package/.next/standalone/node_modules/hast-util-whitespace/package.json +83 -0
- package/.next/standalone/node_modules/html-void-elements/index.js +27 -0
- package/.next/standalone/node_modules/html-void-elements/package.json +79 -0
- package/.next/standalone/node_modules/oniguruma-parser/dist/parser/node-utils.js +2 -0
- package/.next/standalone/node_modules/oniguruma-parser/dist/parser/parse.js +2 -0
- package/.next/standalone/node_modules/oniguruma-parser/dist/tokenizer/tokenize.js +34 -0
- package/.next/standalone/node_modules/oniguruma-parser/dist/traverser/traverse.js +2 -0
- package/.next/standalone/node_modules/oniguruma-parser/dist/utils.js +2 -0
- package/.next/standalone/node_modules/oniguruma-parser/package.json +64 -0
- package/.next/standalone/node_modules/oniguruma-to-es/dist/esm/index.js +1878 -0
- package/.next/standalone/node_modules/oniguruma-to-es/dist/esm/package.json +1 -0
- package/.next/standalone/node_modules/oniguruma-to-es/package.json +61 -0
- package/.next/standalone/node_modules/property-information/index.js +17 -0
- package/.next/standalone/node_modules/property-information/lib/aria.js +61 -0
- package/.next/standalone/node_modules/property-information/lib/find.js +97 -0
- package/.next/standalone/node_modules/property-information/lib/hast-to-react.js +30 -0
- package/.next/standalone/node_modules/property-information/lib/html.js +332 -0
- package/.next/standalone/node_modules/property-information/lib/normalize.js +12 -0
- package/.next/standalone/node_modules/property-information/lib/svg.js +569 -0
- package/.next/standalone/node_modules/property-information/lib/util/case-insensitive-transform.js +13 -0
- package/.next/standalone/node_modules/property-information/lib/util/case-sensitive-transform.js +11 -0
- package/.next/standalone/node_modules/property-information/lib/util/create.js +69 -0
- package/.next/standalone/node_modules/property-information/lib/util/defined-info.js +60 -0
- package/.next/standalone/node_modules/property-information/lib/util/info.js +32 -0
- package/.next/standalone/node_modules/property-information/lib/util/merge.js +27 -0
- package/.next/standalone/node_modules/property-information/lib/util/schema.js +29 -0
- package/.next/standalone/node_modules/property-information/lib/util/types.js +13 -0
- package/.next/standalone/node_modules/property-information/lib/xlink.js +17 -0
- package/.next/standalone/node_modules/property-information/lib/xml.js +9 -0
- package/.next/standalone/node_modules/property-information/lib/xmlns.js +9 -0
- package/.next/standalone/node_modules/property-information/package.json +84 -0
- package/.next/standalone/node_modules/regex/package.json +60 -0
- package/.next/standalone/node_modules/regex/src/atomic.js +224 -0
- package/.next/standalone/node_modules/regex/src/internals.js +2 -0
- package/.next/standalone/node_modules/regex/src/subclass.js +98 -0
- package/.next/standalone/node_modules/regex/src/utils-internals.js +33 -0
- package/.next/standalone/node_modules/regex-recursion/package.json +47 -0
- package/.next/standalone/node_modules/regex-recursion/src/index.js +365 -0
- package/.next/standalone/node_modules/regex-utilities/package.json +35 -0
- package/.next/standalone/node_modules/regex-utilities/src/index.js +170 -0
- package/.next/standalone/node_modules/shiki/dist/bundle-full.mjs +41 -0
- package/.next/standalone/node_modules/shiki/dist/engine-oniguruma.mjs +8 -0
- package/.next/standalone/node_modules/shiki/dist/index.mjs +29 -0
- package/.next/standalone/node_modules/shiki/dist/langs-bundle-full-4noeO3oH.mjs +1283 -0
- package/.next/standalone/node_modules/shiki/dist/rolldown-runtime-BBjsoOtd.mjs +27 -0
- package/.next/standalone/node_modules/shiki/dist/themes.mjs +396 -0
- package/.next/standalone/node_modules/shiki/dist/wasm.mjs +3 -0
- package/.next/standalone/node_modules/shiki/package.json +73 -0
- package/.next/standalone/node_modules/space-separated-tokens/index.js +24 -0
- package/.next/standalone/node_modules/space-separated-tokens/package.json +67 -0
- package/.next/standalone/node_modules/stringify-entities/index.js +6 -0
- package/.next/standalone/node_modules/stringify-entities/lib/constant/dangerous.js +16 -0
- package/.next/standalone/node_modules/stringify-entities/lib/core.js +117 -0
- package/.next/standalone/node_modules/stringify-entities/lib/index.js +36 -0
- package/.next/standalone/node_modules/stringify-entities/lib/util/format-basic.js +9 -0
- package/.next/standalone/node_modules/stringify-entities/lib/util/format-smart.js +69 -0
- package/.next/standalone/node_modules/stringify-entities/lib/util/to-decimal.js +16 -0
- package/.next/standalone/node_modules/stringify-entities/lib/util/to-hexadecimal.js +16 -0
- package/.next/standalone/node_modules/stringify-entities/lib/util/to-named.js +57 -0
- package/.next/standalone/node_modules/stringify-entities/package.json +86 -0
- package/.next/standalone/node_modules/zwitch/index.js +118 -0
- package/.next/standalone/node_modules/zwitch/package.json +72 -0
- package/.next/standalone/package-lock.json +719 -672
- package/.next/standalone/package.json +2 -1
- package/.next/standalone/release-please-config.json +1 -0
- package/.next/standalone/scripts/validate-catalog.ts +38 -0
- package/.next/standalone/server.js +1 -1
- package/.next/standalone/src/app/[...path]/route.ts +41 -0
- package/.next/standalone/src/app/ui/api/catalog/route.ts +32 -0
- package/.next/standalone/src/app/ui/api/global-mocks/[system]/[endpoint]/route.ts +53 -0
- package/.next/standalone/src/app/ui/api/global-mocks/route.ts +8 -0
- package/.next/standalone/src/app/ui/api/health/route.ts +47 -0
- package/.next/standalone/src/app/ui/api/logs/[logId]/route.ts +15 -0
- package/.next/standalone/src/app/ui/api/logs/route.ts +24 -0
- package/.next/standalone/src/app/ui/api/profiles/[profileId]/reset/route.ts +25 -0
- package/.next/standalone/src/app/ui/api/profiles/[profileId]/route.ts +64 -0
- package/.next/standalone/src/app/ui/catalog/highlight.ts +12 -0
- package/.next/standalone/src/app/ui/catalog/scenario-view.ts +68 -0
- package/.next/standalone/src/app/ui/global-mocks/actions.ts +50 -0
- package/.next/standalone/src/app/ui/logs/actions.ts +11 -0
- package/.next/standalone/src/app/ui/logs/list-state.ts +64 -0
- package/.next/standalone/src/app/ui/logs/types.ts +17 -0
- package/.next/standalone/src/app/ui/profiles/actions.ts +60 -0
- package/.next/standalone/src/lib/build-info.ts +13 -0
- package/.next/standalone/src/lib/catalog/find.ts +17 -0
- package/.next/standalone/src/lib/catalog/load.ts +226 -0
- package/.next/standalone/src/lib/catalog/path-template.ts +63 -0
- package/.next/standalone/src/lib/catalog/request-example.ts +96 -0
- package/.next/standalone/src/lib/catalog/schema.ts +154 -0
- package/.next/standalone/src/lib/catalog/selector.ts +153 -0
- package/.next/standalone/src/lib/catalog/types.ts +43 -0
- package/.next/standalone/src/lib/catalog/validate.ts +290 -0
- package/.next/standalone/src/lib/config.ts +93 -0
- package/.next/standalone/src/lib/dynamic/history-store.ts +68 -0
- package/.next/standalone/src/lib/environment.ts +155 -0
- package/.next/standalone/src/lib/format.ts +3 -0
- package/.next/standalone/src/lib/logs/admin-log.ts +27 -0
- package/.next/standalone/src/lib/logs/store.ts +153 -0
- package/.next/standalone/src/lib/mock-engine/fixtures.ts +38 -0
- package/.next/standalone/src/lib/mock-engine/resolver.ts +110 -0
- package/.next/standalone/src/lib/mock-engine/template.ts +71 -0
- package/.next/standalone/src/lib/mongo/embedded.ts +40 -0
- package/.next/standalone/src/lib/profiles/api-scenarios.ts +69 -0
- package/.next/standalone/src/lib/profiles/form.ts +64 -0
- package/.next/standalone/src/lib/profiles/stale.ts +56 -0
- package/.next/standalone/src/lib/profiles/store.ts +420 -0
- package/.next/standalone/src/lib/router/handler.ts +187 -0
- package/.next/standalone/src/lib/router/passthrough.ts +86 -0
- package/.next/standalone/src/lib/router/route-request.ts +645 -0
- package/.next/standalone/src/lib/runtime.ts +150 -0
- package/.next/standalone/src/lib/scenarios.ts +52 -0
- package/.next/standalone/src/lib/utils.ts +6 -0
- package/.next/standalone/tests/api/catalog-route.test.ts +72 -0
- package/.next/standalone/tests/api/global-mocks-route.test.ts +171 -0
- package/.next/standalone/tests/api/profiles-reset-route.test.ts +50 -0
- package/.next/standalone/tests/api/profiles-route.test.ts +132 -0
- package/.next/standalone/tests/bin/args.test.ts +42 -0
- package/.next/standalone/tests/catalog/find.test.ts +40 -0
- package/.next/standalone/tests/catalog/load.test.ts +258 -0
- package/.next/standalone/tests/catalog/path-template.test.ts +79 -0
- package/.next/standalone/tests/catalog/request-example.test.ts +86 -0
- package/.next/standalone/tests/catalog/schema.test.ts +249 -0
- package/.next/standalone/tests/catalog/selector.test.ts +175 -0
- package/.next/standalone/tests/catalog/validate.test.ts +462 -0
- package/.next/standalone/tests/dynamic/history-store.test.ts +82 -0
- package/.next/standalone/tests/global-mocks/actions.test.ts +192 -0
- package/.next/standalone/tests/lib/config-catalog-dir.test.ts +17 -0
- package/.next/standalone/tests/lib/config.test.ts +99 -0
- package/.next/standalone/tests/lib/environment.test.ts +115 -0
- package/.next/standalone/tests/lib/format.test.ts +8 -0
- package/.next/standalone/tests/lib/runtime.test.ts +153 -0
- package/.next/standalone/tests/lib/scenarios.test.ts +88 -0
- package/.next/standalone/tests/logs/admin-log.test.ts +51 -0
- package/.next/standalone/tests/logs/store.test.ts +233 -0
- package/.next/standalone/tests/mock-engine/fixtures.test.ts +33 -0
- package/.next/standalone/tests/mock-engine/resolver.test.ts +117 -0
- package/.next/standalone/tests/mock-engine/template.test.ts +74 -0
- package/.next/standalone/tests/mongo/embedded.test.ts +78 -0
- package/.next/standalone/tests/profiles/actions.test.ts +183 -0
- package/.next/standalone/tests/profiles/api-scenarios.test.ts +105 -0
- package/.next/standalone/tests/profiles/form.test.ts +181 -0
- package/.next/standalone/tests/profiles/request-log-ttl-index.test.ts +62 -0
- package/.next/standalone/tests/profiles/stale.test.ts +174 -0
- package/.next/standalone/tests/profiles/store.test.ts +470 -0
- package/.next/standalone/tests/router/dynamic.e2e.test.ts +147 -0
- package/.next/standalone/tests/router/handler.e2e.test.ts +97 -0
- package/.next/standalone/tests/router/handler.test.ts +344 -0
- package/.next/standalone/tests/router/passthrough.test.ts +100 -0
- package/.next/standalone/tests/router/route-request.test.ts +1147 -0
- package/.next/standalone/tests/testdata/fixtures/test-system/hello_world/by_amount.ts +3 -0
- package/.next/standalone/tests/testdata/fixtures/test-system/resolver_default/hold.json +1 -0
- package/.next/standalone/tests/testdata/fixtures/test-system/resolver_default/success.json +1 -0
- package/.next/standalone/tests/ui/list-state.test.ts +84 -0
- package/.next/standalone/tests/ui/log-summary-view.test.ts +24 -0
- package/.next/standalone/tests/ui/scenario-view.test.ts +138 -0
- package/.next/standalone/vitest.config.ts +19 -0
- package/package.json +2 -1
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0668hgm._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__078olc9._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0f-_c79._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0geqpjb._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0uudiqz._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0wg041t._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__19qak1g._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__1eiw7ks._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__1qb7sih._.js +0 -3
- package/.next/standalone/.next/server/chunks/_095ilyi._.js +0 -11
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__05255v2._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0dmadib._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0jey74_._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0nj8b73._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__12oahit._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__14u5l1_._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__1bbz1wr._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__1eoh3gn._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__1kd5kn_._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__1kie6ah._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__1u6i1bm._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__1ypwv93._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/_0a347_9._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/_0btcklf._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/_0exg_3l._.js +0 -11
- package/.next/standalone/.next/server/chunks/ssr/_1_7ssjl._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/_1hdkp-g._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/_1jfkfx-._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/node_modules_10liiot._.js +0 -3
- package/.next/standalone/.next/static/chunks/08ghjqetuoc_b.js +0 -1
- package/.next/standalone/.next/static/chunks/19w2nv_pvssix.js +0 -1
- package/.next/standalone/.next/static/chunks/1ljc320o2yhky.js +0 -1
- package/.next/standalone/.next/static/chunks/2akx4rvdzbimg.css +0 -3
- package/.next/standalone/.next/static/chunks/2kg3qe34tmgob.js +0 -1
- package/.next/standalone/.next/static/chunks/2nlgh2oq4eg96.js +0 -1
- package/.next/standalone/.next/static/chunks/30olthhuj56a1.js +0 -1
- /package/.next/standalone/.next/static/{SV1UWx8kQm3m26f1jMoBU → 8CkjRpETX_8CM0X2xtdJ7}/_buildManifest.js +0 -0
- /package/.next/standalone/.next/static/{SV1UWx8kQm3m26f1jMoBU → 8CkjRpETX_8CM0X2xtdJ7}/_clientMiddlewareManifest.js +0 -0
- /package/.next/standalone/.next/static/{SV1UWx8kQm3m26f1jMoBU → 8CkjRpETX_8CM0X2xtdJ7}/_ssgManifest.js +0 -0
- /package/.next/standalone/catalog/hello-system/account_balance/{_dynamic.ts → dynamic.ts} +0 -0
|
@@ -0,0 +1,1406 @@
|
|
|
1
|
+
import { ShikiError as ShikiError$1 } from "@shikijs/types";
|
|
2
|
+
import { ShikiError, applyColorReplacements, codeToTokensBase as codeToTokensBase$1, codeToTokensWithThemes, codeToTokensWithThemes as codeToTokensWithThemes$1, createShikiInternal, createShikiInternalSync, createShikiPrimitive, createShikiPrimitive as createShikiPrimitive$1, createShikiPrimitiveAsync, createShikiPrimitiveAsync as createShikiPrimitiveAsync$1, getLastGrammarState, getLastGrammarStateFromMap, isNoneTheme, isPlainLang, isSpecialLang, isSpecialTheme, normalizeGetter, normalizeTheme, resolveColorReplacements, setLastGrammarStateToMap, splitLines, splitLines as splitLines$1, toArray, tokenizeWithTheme } from "@shikijs/primitive";
|
|
3
|
+
import { FontStyle } from "@shikijs/vscode-textmate";
|
|
4
|
+
import { toHtml } from "hast-util-to-html";
|
|
5
|
+
export * from "@shikijs/types";
|
|
6
|
+
//#region src/utils/hast.ts
|
|
7
|
+
const RE_WHITESPACE = /\s+/g;
|
|
8
|
+
/**
|
|
9
|
+
* Utility to append class to a hast node
|
|
10
|
+
*
|
|
11
|
+
* If the `property.class` is a string, it will be splitted by space and converted to an array.
|
|
12
|
+
*/
|
|
13
|
+
function addClassToHast(node, className) {
|
|
14
|
+
if (!className) return node;
|
|
15
|
+
node.properties ||= {};
|
|
16
|
+
node.properties.class ||= [];
|
|
17
|
+
if (typeof node.properties.class === "string") node.properties.class = node.properties.class.split(RE_WHITESPACE);
|
|
18
|
+
if (!Array.isArray(node.properties.class)) node.properties.class = [];
|
|
19
|
+
const targets = Array.isArray(className) ? className : className.split(RE_WHITESPACE);
|
|
20
|
+
for (const c of targets) if (c && !node.properties.class.includes(c)) node.properties.class.push(c);
|
|
21
|
+
return node;
|
|
22
|
+
}
|
|
23
|
+
//#endregion
|
|
24
|
+
//#region src/utils/strings.ts
|
|
25
|
+
const RE_LANG_ATTR = /:?lang=["']([^"']+)["']/g;
|
|
26
|
+
const RE_CODE_FENCE = /(?:```|~~~)([\w-]+)/g;
|
|
27
|
+
const RE_LATEX_BEGIN = /\\begin\{([\w-]+)\}/g;
|
|
28
|
+
const RE_SCRIPT_LANG = /<script\s+(?:type|lang)=["']([^"']+)["']/gi;
|
|
29
|
+
/**
|
|
30
|
+
* Creates a converter between index and position in a code block.
|
|
31
|
+
*
|
|
32
|
+
* Overflow/underflow are unchecked.
|
|
33
|
+
*/
|
|
34
|
+
function createPositionConverter(code) {
|
|
35
|
+
const lines = splitLines$1(code, true).map(([line]) => line);
|
|
36
|
+
function indexToPos(index) {
|
|
37
|
+
if (index === code.length) return {
|
|
38
|
+
line: lines.length - 1,
|
|
39
|
+
character: lines.at(-1).length
|
|
40
|
+
};
|
|
41
|
+
let character = index;
|
|
42
|
+
let line = 0;
|
|
43
|
+
for (const lineText of lines) {
|
|
44
|
+
if (character < lineText.length) break;
|
|
45
|
+
character -= lineText.length;
|
|
46
|
+
line++;
|
|
47
|
+
}
|
|
48
|
+
return {
|
|
49
|
+
line,
|
|
50
|
+
character
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
function posToIndex(line, character) {
|
|
54
|
+
let index = 0;
|
|
55
|
+
for (let i = 0; i < line; i++) index += lines[i].length;
|
|
56
|
+
index += character;
|
|
57
|
+
return index;
|
|
58
|
+
}
|
|
59
|
+
return {
|
|
60
|
+
lines,
|
|
61
|
+
indexToPos,
|
|
62
|
+
posToIndex
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* Guess embedded languages from given code and highlighter.
|
|
67
|
+
*
|
|
68
|
+
* When highlighter is provided, only bundled languages will be included.
|
|
69
|
+
*
|
|
70
|
+
* @param code - The code string to analyze
|
|
71
|
+
* @param _lang - The primary language of the code (currently unused)
|
|
72
|
+
* @param highlighter - Optional highlighter instance to validate languages
|
|
73
|
+
* @returns Array of detected language identifiers
|
|
74
|
+
*
|
|
75
|
+
* @example
|
|
76
|
+
* ```ts
|
|
77
|
+
* // Detects 'javascript' from Vue SFC
|
|
78
|
+
* guessEmbeddedLanguages('<script lang="javascript">')
|
|
79
|
+
*
|
|
80
|
+
* // Detects 'python' from markdown code block
|
|
81
|
+
* guessEmbeddedLanguages('```python\nprint("hi")\n```')
|
|
82
|
+
* ```
|
|
83
|
+
*/
|
|
84
|
+
function guessEmbeddedLanguages(code, _lang, highlighter) {
|
|
85
|
+
const langs = /* @__PURE__ */ new Set();
|
|
86
|
+
for (const match of code.matchAll(RE_LANG_ATTR)) {
|
|
87
|
+
const lang = match[1].toLowerCase().trim();
|
|
88
|
+
if (lang) langs.add(lang);
|
|
89
|
+
}
|
|
90
|
+
for (const match of code.matchAll(RE_CODE_FENCE)) {
|
|
91
|
+
const lang = match[1].toLowerCase().trim();
|
|
92
|
+
if (lang) langs.add(lang);
|
|
93
|
+
}
|
|
94
|
+
for (const match of code.matchAll(RE_LATEX_BEGIN)) {
|
|
95
|
+
const lang = match[1].toLowerCase().trim();
|
|
96
|
+
if (lang) langs.add(lang);
|
|
97
|
+
}
|
|
98
|
+
for (const match of code.matchAll(RE_SCRIPT_LANG)) {
|
|
99
|
+
const fullType = match[1].toLowerCase().trim();
|
|
100
|
+
const lang = fullType.includes("/") ? fullType.split("/").pop() : fullType;
|
|
101
|
+
if (lang) langs.add(lang);
|
|
102
|
+
}
|
|
103
|
+
if (!highlighter) return [...langs];
|
|
104
|
+
const bundle = highlighter.getBundledLanguages();
|
|
105
|
+
return [...langs].filter((l) => l && bundle[l]);
|
|
106
|
+
}
|
|
107
|
+
const COLOR_KEYS = ["color", "background-color"];
|
|
108
|
+
//#endregion
|
|
109
|
+
//#region src/utils/tokens.ts
|
|
110
|
+
/**
|
|
111
|
+
* Split a token into multiple tokens by given offsets.
|
|
112
|
+
*
|
|
113
|
+
* The offsets are relative to the token, and should be sorted.
|
|
114
|
+
*/
|
|
115
|
+
function splitToken(token, offsets) {
|
|
116
|
+
let lastOffset = 0;
|
|
117
|
+
const tokens = [];
|
|
118
|
+
for (const offset of offsets) {
|
|
119
|
+
if (offset > lastOffset) tokens.push({
|
|
120
|
+
...token,
|
|
121
|
+
content: token.content.slice(lastOffset, offset),
|
|
122
|
+
offset: token.offset + lastOffset
|
|
123
|
+
});
|
|
124
|
+
lastOffset = offset;
|
|
125
|
+
}
|
|
126
|
+
if (lastOffset < token.content.length) tokens.push({
|
|
127
|
+
...token,
|
|
128
|
+
content: token.content.slice(lastOffset),
|
|
129
|
+
offset: token.offset + lastOffset
|
|
130
|
+
});
|
|
131
|
+
return tokens;
|
|
132
|
+
}
|
|
133
|
+
/**
|
|
134
|
+
* Split 2D tokens array by given breakpoints.
|
|
135
|
+
*/
|
|
136
|
+
function splitTokens(tokens, breakpoints) {
|
|
137
|
+
const sorted = [...breakpoints instanceof Set ? breakpoints : new Set(breakpoints)].sort((a, b) => a - b);
|
|
138
|
+
if (!sorted.length) return tokens;
|
|
139
|
+
return tokens.map((line) => {
|
|
140
|
+
return line.flatMap((token) => {
|
|
141
|
+
const breakpointsInToken = sorted.filter((i) => token.offset < i && i < token.offset + token.content.length).map((i) => i - token.offset).sort((a, b) => a - b);
|
|
142
|
+
if (!breakpointsInToken.length) return token;
|
|
143
|
+
return splitToken(token, breakpointsInToken);
|
|
144
|
+
});
|
|
145
|
+
});
|
|
146
|
+
}
|
|
147
|
+
function flatTokenVariants(merged, variantsOrder, cssVariablePrefix, defaultColor, colorsRendering = "css-vars") {
|
|
148
|
+
const token = {
|
|
149
|
+
content: merged.content,
|
|
150
|
+
explanation: merged.explanation,
|
|
151
|
+
offset: merged.offset
|
|
152
|
+
};
|
|
153
|
+
const styles = variantsOrder.map((t) => getTokenStyleObject(merged.variants[t]));
|
|
154
|
+
const styleKeys = new Set(styles.flatMap((t) => Object.keys(t)));
|
|
155
|
+
const mergedStyles = {};
|
|
156
|
+
const varKey = (idx, key) => {
|
|
157
|
+
const keyName = key === "color" ? "" : key === "background-color" ? "-bg" : `-${key}`;
|
|
158
|
+
return cssVariablePrefix + variantsOrder[idx] + (key === "color" ? "" : keyName);
|
|
159
|
+
};
|
|
160
|
+
styles.forEach((cur, idx) => {
|
|
161
|
+
for (const key of styleKeys) {
|
|
162
|
+
const value = cur[key] || "inherit";
|
|
163
|
+
if (idx === 0 && defaultColor && COLOR_KEYS.includes(key)) if (defaultColor === "light-dark()" && styles.length > 1) {
|
|
164
|
+
const lightIndex = variantsOrder.findIndex((t) => t === "light");
|
|
165
|
+
const darkIndex = variantsOrder.findIndex((t) => t === "dark");
|
|
166
|
+
if (lightIndex === -1 || darkIndex === -1) throw new ShikiError$1("When using `defaultColor: \"light-dark()\"`, you must provide both `light` and `dark` themes");
|
|
167
|
+
mergedStyles[key] = `light-dark(${styles[lightIndex][key] || "inherit"}, ${styles[darkIndex][key] || "inherit"})`;
|
|
168
|
+
if (colorsRendering === "css-vars") mergedStyles[varKey(idx, key)] = value;
|
|
169
|
+
} else mergedStyles[key] = value;
|
|
170
|
+
else if (colorsRendering === "css-vars") mergedStyles[varKey(idx, key)] = value;
|
|
171
|
+
}
|
|
172
|
+
});
|
|
173
|
+
token.htmlStyle = mergedStyles;
|
|
174
|
+
return token;
|
|
175
|
+
}
|
|
176
|
+
function getTokenStyleObject(token) {
|
|
177
|
+
const styles = {};
|
|
178
|
+
if (token.color) styles.color = token.color;
|
|
179
|
+
if (token.bgColor) styles["background-color"] = token.bgColor;
|
|
180
|
+
if (token.fontStyle) {
|
|
181
|
+
if (token.fontStyle & FontStyle.Italic) styles["font-style"] = "italic";
|
|
182
|
+
if (token.fontStyle & FontStyle.Bold) styles["font-weight"] = "bold";
|
|
183
|
+
const decorations = [];
|
|
184
|
+
if (token.fontStyle & FontStyle.Underline) decorations.push("underline");
|
|
185
|
+
if (token.fontStyle & FontStyle.Strikethrough) decorations.push("line-through");
|
|
186
|
+
if (decorations.length) styles["text-decoration"] = decorations.join(" ");
|
|
187
|
+
}
|
|
188
|
+
return styles;
|
|
189
|
+
}
|
|
190
|
+
function stringifyTokenStyle(token) {
|
|
191
|
+
if (typeof token === "string") return token;
|
|
192
|
+
return Object.entries(token).map(([key, value]) => `${key}:${value}`).join(";");
|
|
193
|
+
}
|
|
194
|
+
//#endregion
|
|
195
|
+
//#region src/transformer-decorations.ts
|
|
196
|
+
/**
|
|
197
|
+
* A built-in transformer to add decorations to the highlighted code.
|
|
198
|
+
*/
|
|
199
|
+
function transformerDecorations() {
|
|
200
|
+
const map = /* @__PURE__ */ new WeakMap();
|
|
201
|
+
function getContext(shiki) {
|
|
202
|
+
if (!map.has(shiki.meta)) {
|
|
203
|
+
const converter = createPositionConverter(shiki.source);
|
|
204
|
+
function normalizePosition(p) {
|
|
205
|
+
if (typeof p === "number") {
|
|
206
|
+
if (p < 0 || p > shiki.source.length) throw new ShikiError$1(`Invalid decoration offset: ${p}. Code length: ${shiki.source.length}`);
|
|
207
|
+
return {
|
|
208
|
+
...converter.indexToPos(p),
|
|
209
|
+
offset: p
|
|
210
|
+
};
|
|
211
|
+
} else {
|
|
212
|
+
const line = converter.lines[p.line];
|
|
213
|
+
if (line === void 0) throw new ShikiError$1(`Invalid decoration position ${JSON.stringify(p)}. Lines length: ${converter.lines.length}`);
|
|
214
|
+
let character = p.character;
|
|
215
|
+
if (character < 0) character = line.length + character;
|
|
216
|
+
if (character < 0 || character > line.length) throw new ShikiError$1(`Invalid decoration position ${JSON.stringify(p)}. Line ${p.line} length: ${line.length}`);
|
|
217
|
+
return {
|
|
218
|
+
...p,
|
|
219
|
+
character,
|
|
220
|
+
offset: converter.posToIndex(p.line, character)
|
|
221
|
+
};
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
const decorations = (shiki.options.decorations || []).map((d) => ({
|
|
225
|
+
...d,
|
|
226
|
+
start: normalizePosition(d.start),
|
|
227
|
+
end: normalizePosition(d.end)
|
|
228
|
+
}));
|
|
229
|
+
verifyIntersections(decorations);
|
|
230
|
+
map.set(shiki.meta, {
|
|
231
|
+
decorations,
|
|
232
|
+
converter,
|
|
233
|
+
source: shiki.source
|
|
234
|
+
});
|
|
235
|
+
}
|
|
236
|
+
return map.get(shiki.meta);
|
|
237
|
+
}
|
|
238
|
+
return {
|
|
239
|
+
name: "shiki:decorations",
|
|
240
|
+
tokens(tokens) {
|
|
241
|
+
if (!this.options.decorations?.length) return;
|
|
242
|
+
return splitTokens(tokens, getContext(this).decorations.flatMap((d) => [d.start.offset, d.end.offset]));
|
|
243
|
+
},
|
|
244
|
+
code(codeEl) {
|
|
245
|
+
if (!this.options.decorations?.length) return;
|
|
246
|
+
const ctx = getContext(this);
|
|
247
|
+
const lines = [...codeEl.children].filter((i) => i.type === "element" && i.tagName === "span");
|
|
248
|
+
if (lines.length !== ctx.converter.lines.length) throw new ShikiError$1(`Number of lines in code element (${lines.length}) does not match the number of lines in the source (${ctx.converter.lines.length}). Failed to apply decorations.`);
|
|
249
|
+
function applyLineSection(line, start, end, decoration) {
|
|
250
|
+
const lineEl = lines[line];
|
|
251
|
+
let text = "";
|
|
252
|
+
let startIndex = -1;
|
|
253
|
+
let endIndex = -1;
|
|
254
|
+
if (start === 0) startIndex = 0;
|
|
255
|
+
if (end === 0) endIndex = 0;
|
|
256
|
+
if (end === Number.POSITIVE_INFINITY) endIndex = lineEl.children.length;
|
|
257
|
+
if (startIndex === -1 || endIndex === -1) for (let i = 0; i < lineEl.children.length; i++) {
|
|
258
|
+
text += stringify(lineEl.children[i]);
|
|
259
|
+
if (startIndex === -1 && text.length === start) startIndex = i + 1;
|
|
260
|
+
if (endIndex === -1 && text.length === end) endIndex = i + 1;
|
|
261
|
+
}
|
|
262
|
+
if (startIndex === -1) throw new ShikiError$1(`Failed to find start index for decoration ${JSON.stringify(decoration.start)}`);
|
|
263
|
+
if (endIndex === -1) throw new ShikiError$1(`Failed to find end index for decoration ${JSON.stringify(decoration.end)}`);
|
|
264
|
+
const children = lineEl.children.slice(startIndex, endIndex);
|
|
265
|
+
if (!decoration.alwaysWrap && children.length === lineEl.children.length) applyDecoration(lineEl, decoration, "line");
|
|
266
|
+
else if (!decoration.alwaysWrap && children.length === 1 && children[0].type === "element") applyDecoration(children[0], decoration, "token");
|
|
267
|
+
else {
|
|
268
|
+
const wrapper = {
|
|
269
|
+
type: "element",
|
|
270
|
+
tagName: "span",
|
|
271
|
+
properties: {},
|
|
272
|
+
children
|
|
273
|
+
};
|
|
274
|
+
applyDecoration(wrapper, decoration, "wrapper");
|
|
275
|
+
lineEl.children.splice(startIndex, children.length, wrapper);
|
|
276
|
+
}
|
|
277
|
+
}
|
|
278
|
+
function applyLine(line, decoration) {
|
|
279
|
+
lines[line] = applyDecoration(lines[line], decoration, "line");
|
|
280
|
+
}
|
|
281
|
+
function applyDecoration(el, decoration, type) {
|
|
282
|
+
const properties = decoration.properties || {};
|
|
283
|
+
const transform = decoration.transform || ((i) => i);
|
|
284
|
+
el.tagName = decoration.tagName || "span";
|
|
285
|
+
el.properties = {
|
|
286
|
+
...el.properties,
|
|
287
|
+
...properties,
|
|
288
|
+
class: el.properties.class
|
|
289
|
+
};
|
|
290
|
+
if (decoration.properties?.class) addClassToHast(el, decoration.properties.class);
|
|
291
|
+
el = transform(el, type) || el;
|
|
292
|
+
return el;
|
|
293
|
+
}
|
|
294
|
+
const lineApplies = [];
|
|
295
|
+
const sorted = ctx.decorations.sort((a, b) => b.start.offset - a.start.offset || a.end.offset - b.end.offset);
|
|
296
|
+
for (const decoration of sorted) {
|
|
297
|
+
const { start, end } = decoration;
|
|
298
|
+
if (start.line === end.line) applyLineSection(start.line, start.character, end.character, decoration);
|
|
299
|
+
else if (start.line < end.line) {
|
|
300
|
+
applyLineSection(start.line, start.character, Number.POSITIVE_INFINITY, decoration);
|
|
301
|
+
for (let i = start.line + 1; i < end.line; i++) lineApplies.unshift(() => applyLine(i, decoration));
|
|
302
|
+
applyLineSection(end.line, 0, end.character, decoration);
|
|
303
|
+
}
|
|
304
|
+
}
|
|
305
|
+
lineApplies.forEach((i) => i());
|
|
306
|
+
}
|
|
307
|
+
};
|
|
308
|
+
}
|
|
309
|
+
function verifyIntersections(items) {
|
|
310
|
+
for (let i = 0; i < items.length; i++) {
|
|
311
|
+
const foo = items[i];
|
|
312
|
+
if (foo.start.offset > foo.end.offset) throw new ShikiError$1(`Invalid decoration range: ${JSON.stringify(foo.start)} - ${JSON.stringify(foo.end)}`);
|
|
313
|
+
for (let j = i + 1; j < items.length; j++) {
|
|
314
|
+
const bar = items[j];
|
|
315
|
+
const isFooHasBarStart = foo.start.offset <= bar.start.offset && bar.start.offset < foo.end.offset;
|
|
316
|
+
const isFooHasBarEnd = foo.start.offset < bar.end.offset && bar.end.offset <= foo.end.offset;
|
|
317
|
+
const isBarHasFooStart = bar.start.offset <= foo.start.offset && foo.start.offset < bar.end.offset;
|
|
318
|
+
const isBarHasFooEnd = bar.start.offset < foo.end.offset && foo.end.offset <= bar.end.offset;
|
|
319
|
+
if (isFooHasBarStart || isFooHasBarEnd || isBarHasFooStart || isBarHasFooEnd) {
|
|
320
|
+
if (isFooHasBarStart && isFooHasBarEnd) continue;
|
|
321
|
+
if (isBarHasFooStart && isBarHasFooEnd) continue;
|
|
322
|
+
if (isBarHasFooStart && foo.start.offset === foo.end.offset) continue;
|
|
323
|
+
if (isFooHasBarEnd && bar.start.offset === bar.end.offset) continue;
|
|
324
|
+
throw new ShikiError$1(`Decorations ${JSON.stringify(foo.start)} and ${JSON.stringify(bar.start)} intersect.`);
|
|
325
|
+
}
|
|
326
|
+
}
|
|
327
|
+
}
|
|
328
|
+
}
|
|
329
|
+
function stringify(el) {
|
|
330
|
+
if (el.type === "text") return el.value;
|
|
331
|
+
if (el.type === "element") return el.children.map(stringify).join("");
|
|
332
|
+
return "";
|
|
333
|
+
}
|
|
334
|
+
//#endregion
|
|
335
|
+
//#region src/highlight/_get-transformers.ts
|
|
336
|
+
const builtInTransformers = [/* @__PURE__ */ transformerDecorations()];
|
|
337
|
+
function getTransformers(options) {
|
|
338
|
+
const transformers = sortTransformersByEnforcement(options.transformers || []);
|
|
339
|
+
return [
|
|
340
|
+
...transformers.pre,
|
|
341
|
+
...transformers.normal,
|
|
342
|
+
...transformers.post,
|
|
343
|
+
...builtInTransformers
|
|
344
|
+
];
|
|
345
|
+
}
|
|
346
|
+
function sortTransformersByEnforcement(transformers) {
|
|
347
|
+
const pre = [];
|
|
348
|
+
const post = [];
|
|
349
|
+
const normal = [];
|
|
350
|
+
for (const transformer of transformers) switch (transformer.enforce) {
|
|
351
|
+
case "pre":
|
|
352
|
+
pre.push(transformer);
|
|
353
|
+
break;
|
|
354
|
+
case "post":
|
|
355
|
+
post.push(transformer);
|
|
356
|
+
break;
|
|
357
|
+
default: normal.push(transformer);
|
|
358
|
+
}
|
|
359
|
+
return {
|
|
360
|
+
pre,
|
|
361
|
+
post,
|
|
362
|
+
normal
|
|
363
|
+
};
|
|
364
|
+
}
|
|
365
|
+
//#endregion
|
|
366
|
+
//#region ../../node_modules/.pnpm/ansi-sequence-parser@1.1.3/node_modules/ansi-sequence-parser/dist/index.js
|
|
367
|
+
var namedColors = [
|
|
368
|
+
"black",
|
|
369
|
+
"red",
|
|
370
|
+
"green",
|
|
371
|
+
"yellow",
|
|
372
|
+
"blue",
|
|
373
|
+
"magenta",
|
|
374
|
+
"cyan",
|
|
375
|
+
"white",
|
|
376
|
+
"brightBlack",
|
|
377
|
+
"brightRed",
|
|
378
|
+
"brightGreen",
|
|
379
|
+
"brightYellow",
|
|
380
|
+
"brightBlue",
|
|
381
|
+
"brightMagenta",
|
|
382
|
+
"brightCyan",
|
|
383
|
+
"brightWhite"
|
|
384
|
+
];
|
|
385
|
+
var decorations = {
|
|
386
|
+
1: "bold",
|
|
387
|
+
2: "dim",
|
|
388
|
+
3: "italic",
|
|
389
|
+
4: "underline",
|
|
390
|
+
7: "reverse",
|
|
391
|
+
8: "hidden",
|
|
392
|
+
9: "strikethrough"
|
|
393
|
+
};
|
|
394
|
+
function findSequence(value, position) {
|
|
395
|
+
const nextEscape = value.indexOf("\x1B", position);
|
|
396
|
+
if (nextEscape !== -1) {
|
|
397
|
+
if (value[nextEscape + 1] === "[") {
|
|
398
|
+
const nextClose = value.indexOf("m", nextEscape);
|
|
399
|
+
if (nextClose !== -1) return {
|
|
400
|
+
sequence: value.substring(nextEscape + 2, nextClose).split(";"),
|
|
401
|
+
startPosition: nextEscape,
|
|
402
|
+
position: nextClose + 1
|
|
403
|
+
};
|
|
404
|
+
}
|
|
405
|
+
}
|
|
406
|
+
return { position: value.length };
|
|
407
|
+
}
|
|
408
|
+
function parseColor(sequence) {
|
|
409
|
+
const colorMode = sequence.shift();
|
|
410
|
+
if (colorMode === "2") {
|
|
411
|
+
const rgb = sequence.splice(0, 3).map((x) => Number.parseInt(x));
|
|
412
|
+
if (rgb.length !== 3 || rgb.some((x) => Number.isNaN(x))) return;
|
|
413
|
+
return {
|
|
414
|
+
type: "rgb",
|
|
415
|
+
rgb
|
|
416
|
+
};
|
|
417
|
+
} else if (colorMode === "5") {
|
|
418
|
+
const index = sequence.shift();
|
|
419
|
+
if (index) return {
|
|
420
|
+
type: "table",
|
|
421
|
+
index: Number(index)
|
|
422
|
+
};
|
|
423
|
+
}
|
|
424
|
+
}
|
|
425
|
+
function parseSequence(sequence) {
|
|
426
|
+
const commands = [];
|
|
427
|
+
while (sequence.length > 0) {
|
|
428
|
+
const code = sequence.shift();
|
|
429
|
+
if (!code) continue;
|
|
430
|
+
const codeInt = Number.parseInt(code);
|
|
431
|
+
if (Number.isNaN(codeInt)) continue;
|
|
432
|
+
if (codeInt === 0) commands.push({ type: "resetAll" });
|
|
433
|
+
else if (codeInt <= 9) {
|
|
434
|
+
if (decorations[codeInt]) commands.push({
|
|
435
|
+
type: "setDecoration",
|
|
436
|
+
value: decorations[codeInt]
|
|
437
|
+
});
|
|
438
|
+
} else if (codeInt <= 29) {
|
|
439
|
+
const decoration = decorations[codeInt - 20];
|
|
440
|
+
if (decoration) {
|
|
441
|
+
commands.push({
|
|
442
|
+
type: "resetDecoration",
|
|
443
|
+
value: decoration
|
|
444
|
+
});
|
|
445
|
+
if (decoration === "dim") commands.push({
|
|
446
|
+
type: "resetDecoration",
|
|
447
|
+
value: "bold"
|
|
448
|
+
});
|
|
449
|
+
}
|
|
450
|
+
} else if (codeInt <= 37) commands.push({
|
|
451
|
+
type: "setForegroundColor",
|
|
452
|
+
value: {
|
|
453
|
+
type: "named",
|
|
454
|
+
name: namedColors[codeInt - 30]
|
|
455
|
+
}
|
|
456
|
+
});
|
|
457
|
+
else if (codeInt === 38) {
|
|
458
|
+
const color = parseColor(sequence);
|
|
459
|
+
if (color) commands.push({
|
|
460
|
+
type: "setForegroundColor",
|
|
461
|
+
value: color
|
|
462
|
+
});
|
|
463
|
+
} else if (codeInt === 39) commands.push({ type: "resetForegroundColor" });
|
|
464
|
+
else if (codeInt <= 47) commands.push({
|
|
465
|
+
type: "setBackgroundColor",
|
|
466
|
+
value: {
|
|
467
|
+
type: "named",
|
|
468
|
+
name: namedColors[codeInt - 40]
|
|
469
|
+
}
|
|
470
|
+
});
|
|
471
|
+
else if (codeInt === 48) {
|
|
472
|
+
const color = parseColor(sequence);
|
|
473
|
+
if (color) commands.push({
|
|
474
|
+
type: "setBackgroundColor",
|
|
475
|
+
value: color
|
|
476
|
+
});
|
|
477
|
+
} else if (codeInt === 49) commands.push({ type: "resetBackgroundColor" });
|
|
478
|
+
else if (codeInt === 53) commands.push({
|
|
479
|
+
type: "setDecoration",
|
|
480
|
+
value: "overline"
|
|
481
|
+
});
|
|
482
|
+
else if (codeInt === 55) commands.push({
|
|
483
|
+
type: "resetDecoration",
|
|
484
|
+
value: "overline"
|
|
485
|
+
});
|
|
486
|
+
else if (codeInt >= 90 && codeInt <= 97) commands.push({
|
|
487
|
+
type: "setForegroundColor",
|
|
488
|
+
value: {
|
|
489
|
+
type: "named",
|
|
490
|
+
name: namedColors[codeInt - 90 + 8]
|
|
491
|
+
}
|
|
492
|
+
});
|
|
493
|
+
else if (codeInt >= 100 && codeInt <= 107) commands.push({
|
|
494
|
+
type: "setBackgroundColor",
|
|
495
|
+
value: {
|
|
496
|
+
type: "named",
|
|
497
|
+
name: namedColors[codeInt - 100 + 8]
|
|
498
|
+
}
|
|
499
|
+
});
|
|
500
|
+
}
|
|
501
|
+
return commands;
|
|
502
|
+
}
|
|
503
|
+
function createAnsiSequenceParser() {
|
|
504
|
+
let foreground = null;
|
|
505
|
+
let background = null;
|
|
506
|
+
let decorations2 = /* @__PURE__ */ new Set();
|
|
507
|
+
return { parse(value) {
|
|
508
|
+
const tokens = [];
|
|
509
|
+
let position = 0;
|
|
510
|
+
do {
|
|
511
|
+
const findResult = findSequence(value, position);
|
|
512
|
+
const text = findResult.sequence ? value.substring(position, findResult.startPosition) : value.substring(position);
|
|
513
|
+
if (text.length > 0) tokens.push({
|
|
514
|
+
value: text,
|
|
515
|
+
foreground,
|
|
516
|
+
background,
|
|
517
|
+
decorations: new Set(decorations2)
|
|
518
|
+
});
|
|
519
|
+
if (findResult.sequence) {
|
|
520
|
+
const commands = parseSequence(findResult.sequence);
|
|
521
|
+
for (const styleToken of commands) if (styleToken.type === "resetAll") {
|
|
522
|
+
foreground = null;
|
|
523
|
+
background = null;
|
|
524
|
+
decorations2.clear();
|
|
525
|
+
} else if (styleToken.type === "resetForegroundColor") foreground = null;
|
|
526
|
+
else if (styleToken.type === "resetBackgroundColor") background = null;
|
|
527
|
+
else if (styleToken.type === "resetDecoration") decorations2.delete(styleToken.value);
|
|
528
|
+
for (const styleToken of commands) if (styleToken.type === "setForegroundColor") foreground = styleToken.value;
|
|
529
|
+
else if (styleToken.type === "setBackgroundColor") background = styleToken.value;
|
|
530
|
+
else if (styleToken.type === "setDecoration") decorations2.add(styleToken.value);
|
|
531
|
+
}
|
|
532
|
+
position = findResult.position;
|
|
533
|
+
} while (position < value.length);
|
|
534
|
+
return tokens;
|
|
535
|
+
} };
|
|
536
|
+
}
|
|
537
|
+
var defaultNamedColorsMap = {
|
|
538
|
+
black: "#000000",
|
|
539
|
+
red: "#bb0000",
|
|
540
|
+
green: "#00bb00",
|
|
541
|
+
yellow: "#bbbb00",
|
|
542
|
+
blue: "#0000bb",
|
|
543
|
+
magenta: "#ff00ff",
|
|
544
|
+
cyan: "#00bbbb",
|
|
545
|
+
white: "#eeeeee",
|
|
546
|
+
brightBlack: "#555555",
|
|
547
|
+
brightRed: "#ff5555",
|
|
548
|
+
brightGreen: "#00ff00",
|
|
549
|
+
brightYellow: "#ffff55",
|
|
550
|
+
brightBlue: "#5555ff",
|
|
551
|
+
brightMagenta: "#ff55ff",
|
|
552
|
+
brightCyan: "#55ffff",
|
|
553
|
+
brightWhite: "#ffffff"
|
|
554
|
+
};
|
|
555
|
+
function createColorPalette(namedColorsMap = defaultNamedColorsMap) {
|
|
556
|
+
function namedColor(name) {
|
|
557
|
+
return namedColorsMap[name];
|
|
558
|
+
}
|
|
559
|
+
function rgbColor(rgb) {
|
|
560
|
+
return `#${rgb.map((x) => Math.max(0, Math.min(x, 255)).toString(16).padStart(2, "0")).join("")}`;
|
|
561
|
+
}
|
|
562
|
+
let colorTable;
|
|
563
|
+
function getColorTable() {
|
|
564
|
+
if (colorTable) return colorTable;
|
|
565
|
+
colorTable = [];
|
|
566
|
+
for (let i = 0; i < namedColors.length; i++) colorTable.push(namedColor(namedColors[i]));
|
|
567
|
+
let levels = [
|
|
568
|
+
0,
|
|
569
|
+
95,
|
|
570
|
+
135,
|
|
571
|
+
175,
|
|
572
|
+
215,
|
|
573
|
+
255
|
|
574
|
+
];
|
|
575
|
+
for (let r = 0; r < 6; r++) for (let g = 0; g < 6; g++) for (let b = 0; b < 6; b++) colorTable.push(rgbColor([
|
|
576
|
+
levels[r],
|
|
577
|
+
levels[g],
|
|
578
|
+
levels[b]
|
|
579
|
+
]));
|
|
580
|
+
let level = 8;
|
|
581
|
+
for (let i = 0; i < 24; i++, level += 10) colorTable.push(rgbColor([
|
|
582
|
+
level,
|
|
583
|
+
level,
|
|
584
|
+
level
|
|
585
|
+
]));
|
|
586
|
+
return colorTable;
|
|
587
|
+
}
|
|
588
|
+
function tableColor(index) {
|
|
589
|
+
return getColorTable()[index];
|
|
590
|
+
}
|
|
591
|
+
function value(color) {
|
|
592
|
+
switch (color.type) {
|
|
593
|
+
case "named": return namedColor(color.name);
|
|
594
|
+
case "rgb": return rgbColor(color.rgb);
|
|
595
|
+
case "table": return tableColor(color.index);
|
|
596
|
+
}
|
|
597
|
+
}
|
|
598
|
+
return { value };
|
|
599
|
+
}
|
|
600
|
+
//#endregion
|
|
601
|
+
//#region src/highlight/code-to-tokens-ansi.ts
|
|
602
|
+
const RE_HEX_COLOR = /#([0-9a-f]{3,8})/i;
|
|
603
|
+
const RE_CSS_VAR_ANSI = /var\((--[\w-]+-ansi-[\w-]+)\)/;
|
|
604
|
+
/**
|
|
605
|
+
* Default ANSI palette (VSCode compatible fallbacks)
|
|
606
|
+
* Used when the theme does not define terminal.ansi* colors.
|
|
607
|
+
*/
|
|
608
|
+
const defaultAnsiColors = {
|
|
609
|
+
black: "#000000",
|
|
610
|
+
red: "#cd3131",
|
|
611
|
+
green: "#0DBC79",
|
|
612
|
+
yellow: "#E5E510",
|
|
613
|
+
blue: "#2472C8",
|
|
614
|
+
magenta: "#BC3FBC",
|
|
615
|
+
cyan: "#11A8CD",
|
|
616
|
+
white: "#E5E5E5",
|
|
617
|
+
brightBlack: "#666666",
|
|
618
|
+
brightRed: "#F14C4C",
|
|
619
|
+
brightGreen: "#23D18B",
|
|
620
|
+
brightYellow: "#F5F543",
|
|
621
|
+
brightBlue: "#3B8EEA",
|
|
622
|
+
brightMagenta: "#D670D6",
|
|
623
|
+
brightCyan: "#29B8DB",
|
|
624
|
+
brightWhite: "#FFFFFF"
|
|
625
|
+
};
|
|
626
|
+
function tokenizeAnsiWithTheme(theme, fileContents, options) {
|
|
627
|
+
const colorReplacements = resolveColorReplacements(theme, options);
|
|
628
|
+
const lines = splitLines(fileContents);
|
|
629
|
+
const colorPalette = createColorPalette(Object.fromEntries(namedColors.map((name) => {
|
|
630
|
+
const key = `terminal.ansi${name[0].toUpperCase()}${name.substring(1)}`;
|
|
631
|
+
return [name, theme.colors?.[key] || defaultAnsiColors[name]];
|
|
632
|
+
})));
|
|
633
|
+
const parser = createAnsiSequenceParser();
|
|
634
|
+
return lines.map((line) => parser.parse(line[0]).map((token) => {
|
|
635
|
+
let color;
|
|
636
|
+
let bgColor;
|
|
637
|
+
if (token.decorations.has("reverse")) {
|
|
638
|
+
color = token.background ? colorPalette.value(token.background) : theme.bg;
|
|
639
|
+
bgColor = token.foreground ? colorPalette.value(token.foreground) : theme.fg;
|
|
640
|
+
} else {
|
|
641
|
+
color = token.foreground ? colorPalette.value(token.foreground) : theme.fg;
|
|
642
|
+
bgColor = token.background ? colorPalette.value(token.background) : void 0;
|
|
643
|
+
}
|
|
644
|
+
color = applyColorReplacements(color, colorReplacements);
|
|
645
|
+
bgColor = applyColorReplacements(bgColor, colorReplacements);
|
|
646
|
+
if (token.decorations.has("dim")) color = dimColor(color);
|
|
647
|
+
let fontStyle = FontStyle.None;
|
|
648
|
+
if (token.decorations.has("bold")) fontStyle |= FontStyle.Bold;
|
|
649
|
+
if (token.decorations.has("italic")) fontStyle |= FontStyle.Italic;
|
|
650
|
+
if (token.decorations.has("underline")) fontStyle |= FontStyle.Underline;
|
|
651
|
+
if (token.decorations.has("strikethrough")) fontStyle |= FontStyle.Strikethrough;
|
|
652
|
+
return {
|
|
653
|
+
content: token.value,
|
|
654
|
+
offset: line[1],
|
|
655
|
+
color,
|
|
656
|
+
bgColor,
|
|
657
|
+
fontStyle
|
|
658
|
+
};
|
|
659
|
+
}));
|
|
660
|
+
}
|
|
661
|
+
/**
|
|
662
|
+
* Adds 50% alpha to a hex color string or the "-dim" postfix to a CSS variable
|
|
663
|
+
*/
|
|
664
|
+
function dimColor(color) {
|
|
665
|
+
const hexMatch = color.match(RE_HEX_COLOR);
|
|
666
|
+
if (hexMatch) {
|
|
667
|
+
const hex = hexMatch[1];
|
|
668
|
+
if (hex.length === 8) {
|
|
669
|
+
const alpha = Math.round(Number.parseInt(hex.slice(6, 8), 16) / 2).toString(16).padStart(2, "0");
|
|
670
|
+
return `#${hex.slice(0, 6)}${alpha}`;
|
|
671
|
+
} else if (hex.length === 6) return `#${hex}80`;
|
|
672
|
+
else if (hex.length === 4) {
|
|
673
|
+
const r = hex[0];
|
|
674
|
+
const g = hex[1];
|
|
675
|
+
const b = hex[2];
|
|
676
|
+
const a = hex[3];
|
|
677
|
+
return `#${r}${r}${g}${g}${b}${b}${Math.round(Number.parseInt(`${a}${a}`, 16) / 2).toString(16).padStart(2, "0")}`;
|
|
678
|
+
} else if (hex.length === 3) {
|
|
679
|
+
const r = hex[0];
|
|
680
|
+
const g = hex[1];
|
|
681
|
+
const b = hex[2];
|
|
682
|
+
return `#${r}${r}${g}${g}${b}${b}80`;
|
|
683
|
+
}
|
|
684
|
+
}
|
|
685
|
+
const cssVarMatch = color.match(RE_CSS_VAR_ANSI);
|
|
686
|
+
if (cssVarMatch) return `var(${cssVarMatch[1]}-dim)`;
|
|
687
|
+
return color;
|
|
688
|
+
}
|
|
689
|
+
//#endregion
|
|
690
|
+
//#region src/highlight/code-to-tokens-base.ts
|
|
691
|
+
/**
|
|
692
|
+
* Code to tokens, with a simple theme.
|
|
693
|
+
* This wraps the tokenizer's implementation to add ANSI support.
|
|
694
|
+
*/
|
|
695
|
+
function codeToTokensBase(primitive, code, options = {}) {
|
|
696
|
+
const lang = primitive.resolveLangAlias(options.lang || "text");
|
|
697
|
+
const { theme: themeName = primitive.getLoadedThemes()[0] } = options;
|
|
698
|
+
if (!isPlainLang(lang) && !isNoneTheme(themeName) && lang === "ansi") {
|
|
699
|
+
const { theme } = primitive.setTheme(themeName);
|
|
700
|
+
return tokenizeAnsiWithTheme(theme, code, options);
|
|
701
|
+
}
|
|
702
|
+
return codeToTokensBase$1(primitive, code, options);
|
|
703
|
+
}
|
|
704
|
+
//#endregion
|
|
705
|
+
//#region src/highlight/code-to-tokens.ts
|
|
706
|
+
/**
|
|
707
|
+
* High-level code-to-tokens API.
|
|
708
|
+
*
|
|
709
|
+
* It will use `codeToTokensWithThemes` or `codeToTokensBase` based on the options.
|
|
710
|
+
*/
|
|
711
|
+
function codeToTokens(primitive, code, options) {
|
|
712
|
+
let bg;
|
|
713
|
+
let fg;
|
|
714
|
+
let tokens;
|
|
715
|
+
let themeName;
|
|
716
|
+
let rootStyle;
|
|
717
|
+
let grammarState;
|
|
718
|
+
if ("themes" in options) {
|
|
719
|
+
const { defaultColor = "light", cssVariablePrefix = "--shiki-", colorsRendering = "css-vars" } = options;
|
|
720
|
+
const themes = Object.entries(options.themes).filter((i) => i[1]).map((i) => ({
|
|
721
|
+
color: i[0],
|
|
722
|
+
theme: i[1]
|
|
723
|
+
})).sort((a, b) => a.color === defaultColor ? -1 : b.color === defaultColor ? 1 : 0);
|
|
724
|
+
if (themes.length === 0) throw new ShikiError$1("`themes` option must not be empty");
|
|
725
|
+
const themeTokens = codeToTokensWithThemes$1(primitive, code, options, codeToTokensBase);
|
|
726
|
+
grammarState = getLastGrammarStateFromMap(themeTokens);
|
|
727
|
+
if (defaultColor && "light-dark()" !== defaultColor && !themes.some((t) => t.color === defaultColor)) throw new ShikiError$1(`\`themes\` option must contain the defaultColor key \`${defaultColor}\``);
|
|
728
|
+
const themeRegs = themes.map((t) => primitive.getTheme(t.theme));
|
|
729
|
+
const themesOrder = themes.map((t) => t.color);
|
|
730
|
+
tokens = themeTokens.map((line) => line.map((token) => flatTokenVariants(token, themesOrder, cssVariablePrefix, defaultColor, colorsRendering)));
|
|
731
|
+
if (grammarState) setLastGrammarStateToMap(tokens, grammarState);
|
|
732
|
+
const themeColorReplacements = themes.map((t) => resolveColorReplacements(t.theme, options));
|
|
733
|
+
fg = mapThemeColors(themes, themeRegs, themeColorReplacements, cssVariablePrefix, defaultColor, "fg", colorsRendering);
|
|
734
|
+
bg = mapThemeColors(themes, themeRegs, themeColorReplacements, cssVariablePrefix, defaultColor, "bg", colorsRendering);
|
|
735
|
+
themeName = `shiki-themes ${themeRegs.map((t) => t.name).join(" ")}`;
|
|
736
|
+
rootStyle = defaultColor ? void 0 : [fg, bg].join(";");
|
|
737
|
+
} else if ("theme" in options) {
|
|
738
|
+
const colorReplacements = resolveColorReplacements(options.theme, options);
|
|
739
|
+
tokens = codeToTokensBase(primitive, code, options);
|
|
740
|
+
const _theme = primitive.getTheme(options.theme);
|
|
741
|
+
bg = applyColorReplacements(_theme.bg, colorReplacements);
|
|
742
|
+
fg = applyColorReplacements(_theme.fg, colorReplacements);
|
|
743
|
+
themeName = _theme.name;
|
|
744
|
+
grammarState = getLastGrammarStateFromMap(tokens);
|
|
745
|
+
} else throw new ShikiError$1("Invalid options, either `theme` or `themes` must be provided");
|
|
746
|
+
return {
|
|
747
|
+
tokens,
|
|
748
|
+
fg,
|
|
749
|
+
bg,
|
|
750
|
+
themeName,
|
|
751
|
+
rootStyle,
|
|
752
|
+
grammarState
|
|
753
|
+
};
|
|
754
|
+
}
|
|
755
|
+
function mapThemeColors(themes, themeRegs, themeColorReplacements, cssVariablePrefix, defaultColor, property, colorsRendering) {
|
|
756
|
+
return themes.map((t, idx) => {
|
|
757
|
+
const value = applyColorReplacements(themeRegs[idx][property], themeColorReplacements[idx]) || "inherit";
|
|
758
|
+
const cssVar = `${cssVariablePrefix + t.color}${property === "bg" ? "-bg" : ""}:${value}`;
|
|
759
|
+
if (idx === 0 && defaultColor) {
|
|
760
|
+
if (defaultColor === "light-dark()" && themes.length > 1) {
|
|
761
|
+
const lightIndex = themes.findIndex((t) => t.color === "light");
|
|
762
|
+
const darkIndex = themes.findIndex((t) => t.color === "dark");
|
|
763
|
+
if (lightIndex === -1 || darkIndex === -1) throw new ShikiError$1("When using `defaultColor: \"light-dark()\"`, you must provide both `light` and `dark` themes");
|
|
764
|
+
return `light-dark(${applyColorReplacements(themeRegs[lightIndex][property], themeColorReplacements[lightIndex]) || "inherit"}, ${applyColorReplacements(themeRegs[darkIndex][property], themeColorReplacements[darkIndex]) || "inherit"});${cssVar}`;
|
|
765
|
+
}
|
|
766
|
+
return value;
|
|
767
|
+
}
|
|
768
|
+
if (colorsRendering === "css-vars") return cssVar;
|
|
769
|
+
return null;
|
|
770
|
+
}).filter((i) => !!i).join(";");
|
|
771
|
+
}
|
|
772
|
+
//#endregion
|
|
773
|
+
//#region src/highlight/code-to-hast.ts
|
|
774
|
+
const RE_WHITESPACE_ONLY = /^\s+$/;
|
|
775
|
+
const RE_LEADING_TRAILING_WHITESPACE = /^(\s*)(.*?)(\s*)$/;
|
|
776
|
+
function codeToHast(primitive, code, options, transformerContext = {
|
|
777
|
+
meta: {},
|
|
778
|
+
options,
|
|
779
|
+
codeToHast: (_code, _options) => codeToHast(primitive, _code, _options),
|
|
780
|
+
codeToTokens: (_code, _options) => codeToTokens(primitive, _code, _options)
|
|
781
|
+
}) {
|
|
782
|
+
let input = code;
|
|
783
|
+
for (const transformer of getTransformers(options)) input = transformer.preprocess?.call(transformerContext, input, options) || input;
|
|
784
|
+
let { tokens, fg, bg, themeName, rootStyle, grammarState } = codeToTokens(primitive, input, options);
|
|
785
|
+
const { mergeWhitespaces = true, mergeSameStyleTokens = false } = options;
|
|
786
|
+
if (mergeWhitespaces === true) tokens = mergeWhitespaceTokens(tokens);
|
|
787
|
+
else if (mergeWhitespaces === "never") tokens = splitWhitespaceTokens(tokens);
|
|
788
|
+
if (mergeSameStyleTokens) tokens = mergeAdjacentStyledTokens(tokens);
|
|
789
|
+
const contextSource = {
|
|
790
|
+
...transformerContext,
|
|
791
|
+
get source() {
|
|
792
|
+
return input;
|
|
793
|
+
}
|
|
794
|
+
};
|
|
795
|
+
for (const transformer of getTransformers(options)) tokens = transformer.tokens?.call(contextSource, tokens) || tokens;
|
|
796
|
+
return tokensToHast(tokens, {
|
|
797
|
+
...options,
|
|
798
|
+
fg,
|
|
799
|
+
bg,
|
|
800
|
+
themeName,
|
|
801
|
+
rootStyle: options.rootStyle === false ? false : options.rootStyle ?? rootStyle
|
|
802
|
+
}, contextSource, grammarState);
|
|
803
|
+
}
|
|
804
|
+
function tokensToHast(tokens, options, transformerContext, grammarState = getLastGrammarStateFromMap(tokens)) {
|
|
805
|
+
const transformers = getTransformers(options);
|
|
806
|
+
const lines = [];
|
|
807
|
+
const root = {
|
|
808
|
+
type: "root",
|
|
809
|
+
children: []
|
|
810
|
+
};
|
|
811
|
+
const { structure = "classic", tabindex = "0" } = options;
|
|
812
|
+
const properties = { class: `shiki ${options.themeName || ""}` };
|
|
813
|
+
if (options.rootStyle !== false) if (options.rootStyle != null) properties.style = options.rootStyle;
|
|
814
|
+
else properties.style = `background-color:${options.bg};color:${options.fg}`;
|
|
815
|
+
if (tabindex !== false && tabindex != null) properties.tabindex = tabindex.toString();
|
|
816
|
+
for (const [key, value] of Object.entries(options.meta || {})) if (!key.startsWith("_")) properties[key] = value;
|
|
817
|
+
let preNode = {
|
|
818
|
+
type: "element",
|
|
819
|
+
tagName: "pre",
|
|
820
|
+
properties,
|
|
821
|
+
children: [],
|
|
822
|
+
data: options.data
|
|
823
|
+
};
|
|
824
|
+
let codeNode = {
|
|
825
|
+
type: "element",
|
|
826
|
+
tagName: "code",
|
|
827
|
+
properties: {},
|
|
828
|
+
children: lines
|
|
829
|
+
};
|
|
830
|
+
const lineNodes = [];
|
|
831
|
+
const context = {
|
|
832
|
+
...transformerContext,
|
|
833
|
+
structure,
|
|
834
|
+
addClassToHast,
|
|
835
|
+
get source() {
|
|
836
|
+
return transformerContext.source;
|
|
837
|
+
},
|
|
838
|
+
get tokens() {
|
|
839
|
+
return tokens;
|
|
840
|
+
},
|
|
841
|
+
get options() {
|
|
842
|
+
return options;
|
|
843
|
+
},
|
|
844
|
+
get root() {
|
|
845
|
+
return root;
|
|
846
|
+
},
|
|
847
|
+
get pre() {
|
|
848
|
+
return preNode;
|
|
849
|
+
},
|
|
850
|
+
get code() {
|
|
851
|
+
return codeNode;
|
|
852
|
+
},
|
|
853
|
+
get lines() {
|
|
854
|
+
return lineNodes;
|
|
855
|
+
}
|
|
856
|
+
};
|
|
857
|
+
tokens.forEach((line, idx) => {
|
|
858
|
+
if (idx) {
|
|
859
|
+
if (structure === "inline") root.children.push({
|
|
860
|
+
type: "element",
|
|
861
|
+
tagName: "br",
|
|
862
|
+
properties: {},
|
|
863
|
+
children: []
|
|
864
|
+
});
|
|
865
|
+
else if (structure === "classic") lines.push({
|
|
866
|
+
type: "text",
|
|
867
|
+
value: "\n"
|
|
868
|
+
});
|
|
869
|
+
}
|
|
870
|
+
let lineNode = {
|
|
871
|
+
type: "element",
|
|
872
|
+
tagName: "span",
|
|
873
|
+
properties: { class: "line" },
|
|
874
|
+
children: []
|
|
875
|
+
};
|
|
876
|
+
let col = 0;
|
|
877
|
+
for (const token of line) {
|
|
878
|
+
let tokenNode = {
|
|
879
|
+
type: "element",
|
|
880
|
+
tagName: "span",
|
|
881
|
+
properties: { ...token.htmlAttrs },
|
|
882
|
+
children: [{
|
|
883
|
+
type: "text",
|
|
884
|
+
value: token.content
|
|
885
|
+
}]
|
|
886
|
+
};
|
|
887
|
+
const style = stringifyTokenStyle(token.htmlStyle || getTokenStyleObject(token));
|
|
888
|
+
if (style) tokenNode.properties.style = style;
|
|
889
|
+
for (const transformer of transformers) tokenNode = transformer?.span?.call(context, tokenNode, idx + 1, col, lineNode, token) || tokenNode;
|
|
890
|
+
if (structure === "inline") root.children.push(tokenNode);
|
|
891
|
+
else if (structure === "classic") lineNode.children.push(tokenNode);
|
|
892
|
+
col += token.content.length;
|
|
893
|
+
}
|
|
894
|
+
if (structure === "classic") {
|
|
895
|
+
for (const transformer of transformers) lineNode = transformer?.line?.call(context, lineNode, idx + 1) || lineNode;
|
|
896
|
+
lineNodes.push(lineNode);
|
|
897
|
+
lines.push(lineNode);
|
|
898
|
+
} else if (structure === "inline") lineNodes.push(lineNode);
|
|
899
|
+
});
|
|
900
|
+
if (structure === "classic") {
|
|
901
|
+
for (const transformer of transformers) codeNode = transformer?.code?.call(context, codeNode) || codeNode;
|
|
902
|
+
preNode.children.push(codeNode);
|
|
903
|
+
for (const transformer of transformers) preNode = transformer?.pre?.call(context, preNode) || preNode;
|
|
904
|
+
root.children.push(preNode);
|
|
905
|
+
} else if (structure === "inline") {
|
|
906
|
+
const syntheticLines = [];
|
|
907
|
+
let currentLine = {
|
|
908
|
+
type: "element",
|
|
909
|
+
tagName: "span",
|
|
910
|
+
properties: { class: "line" },
|
|
911
|
+
children: []
|
|
912
|
+
};
|
|
913
|
+
for (const child of root.children) if (child.type === "element" && child.tagName === "br") {
|
|
914
|
+
syntheticLines.push(currentLine);
|
|
915
|
+
currentLine = {
|
|
916
|
+
type: "element",
|
|
917
|
+
tagName: "span",
|
|
918
|
+
properties: { class: "line" },
|
|
919
|
+
children: []
|
|
920
|
+
};
|
|
921
|
+
} else if (child.type === "element" || child.type === "text") currentLine.children.push(child);
|
|
922
|
+
syntheticLines.push(currentLine);
|
|
923
|
+
let transformedCode = {
|
|
924
|
+
type: "element",
|
|
925
|
+
tagName: "code",
|
|
926
|
+
properties: {},
|
|
927
|
+
children: syntheticLines
|
|
928
|
+
};
|
|
929
|
+
for (const transformer of transformers) transformedCode = transformer?.code?.call(context, transformedCode) || transformedCode;
|
|
930
|
+
root.children = [];
|
|
931
|
+
for (let i = 0; i < transformedCode.children.length; i++) {
|
|
932
|
+
if (i > 0) root.children.push({
|
|
933
|
+
type: "element",
|
|
934
|
+
tagName: "br",
|
|
935
|
+
properties: {},
|
|
936
|
+
children: []
|
|
937
|
+
});
|
|
938
|
+
const line = transformedCode.children[i];
|
|
939
|
+
if (line.type === "element") root.children.push(...line.children);
|
|
940
|
+
}
|
|
941
|
+
}
|
|
942
|
+
let result = root;
|
|
943
|
+
for (const transformer of transformers) result = transformer?.root?.call(context, result) || result;
|
|
944
|
+
if (grammarState) setLastGrammarStateToMap(result, grammarState);
|
|
945
|
+
return result;
|
|
946
|
+
}
|
|
947
|
+
function mergeWhitespaceTokens(tokens) {
|
|
948
|
+
return tokens.map((line) => {
|
|
949
|
+
const newLine = [];
|
|
950
|
+
let carryOnContent = "";
|
|
951
|
+
let firstOffset;
|
|
952
|
+
line.forEach((token, idx) => {
|
|
953
|
+
const couldMerge = !(token.fontStyle && (token.fontStyle & FontStyle.Underline || token.fontStyle & FontStyle.Strikethrough));
|
|
954
|
+
if (couldMerge && RE_WHITESPACE_ONLY.test(token.content) && line[idx + 1]) {
|
|
955
|
+
if (firstOffset === void 0) firstOffset = token.offset;
|
|
956
|
+
carryOnContent += token.content;
|
|
957
|
+
} else if (carryOnContent) {
|
|
958
|
+
if (couldMerge) newLine.push({
|
|
959
|
+
...token,
|
|
960
|
+
offset: firstOffset,
|
|
961
|
+
content: carryOnContent + token.content
|
|
962
|
+
});
|
|
963
|
+
else newLine.push({
|
|
964
|
+
content: carryOnContent,
|
|
965
|
+
offset: firstOffset
|
|
966
|
+
}, token);
|
|
967
|
+
firstOffset = void 0;
|
|
968
|
+
carryOnContent = "";
|
|
969
|
+
} else newLine.push(token);
|
|
970
|
+
});
|
|
971
|
+
return newLine;
|
|
972
|
+
});
|
|
973
|
+
}
|
|
974
|
+
function splitWhitespaceTokens(tokens) {
|
|
975
|
+
return tokens.map((line) => {
|
|
976
|
+
return line.flatMap((token) => {
|
|
977
|
+
if (RE_WHITESPACE_ONLY.test(token.content)) return token;
|
|
978
|
+
const match = token.content.match(RE_LEADING_TRAILING_WHITESPACE);
|
|
979
|
+
if (!match) return token;
|
|
980
|
+
const [, leading, content, trailing] = match;
|
|
981
|
+
if (!leading && !trailing) return token;
|
|
982
|
+
const expanded = [{
|
|
983
|
+
...token,
|
|
984
|
+
offset: token.offset + leading.length,
|
|
985
|
+
content
|
|
986
|
+
}];
|
|
987
|
+
if (leading) expanded.unshift({
|
|
988
|
+
content: leading,
|
|
989
|
+
offset: token.offset
|
|
990
|
+
});
|
|
991
|
+
if (trailing) expanded.push({
|
|
992
|
+
content: trailing,
|
|
993
|
+
offset: token.offset + leading.length + content.length
|
|
994
|
+
});
|
|
995
|
+
return expanded;
|
|
996
|
+
});
|
|
997
|
+
});
|
|
998
|
+
}
|
|
999
|
+
function mergeAdjacentStyledTokens(tokens) {
|
|
1000
|
+
return tokens.map((line) => {
|
|
1001
|
+
const newLine = [];
|
|
1002
|
+
for (const token of line) {
|
|
1003
|
+
if (newLine.length === 0) {
|
|
1004
|
+
newLine.push({ ...token });
|
|
1005
|
+
continue;
|
|
1006
|
+
}
|
|
1007
|
+
const prevToken = newLine.at(-1);
|
|
1008
|
+
const prevStyle = stringifyTokenStyle(prevToken.htmlStyle || getTokenStyleObject(prevToken));
|
|
1009
|
+
const currentStyle = stringifyTokenStyle(token.htmlStyle || getTokenStyleObject(token));
|
|
1010
|
+
const isPrevDecorated = prevToken.fontStyle && (prevToken.fontStyle & FontStyle.Underline || prevToken.fontStyle & FontStyle.Strikethrough);
|
|
1011
|
+
const isDecorated = token.fontStyle && (token.fontStyle & FontStyle.Underline || token.fontStyle & FontStyle.Strikethrough);
|
|
1012
|
+
if (!isPrevDecorated && !isDecorated && prevStyle === currentStyle) prevToken.content += token.content;
|
|
1013
|
+
else newLine.push({ ...token });
|
|
1014
|
+
}
|
|
1015
|
+
return newLine;
|
|
1016
|
+
});
|
|
1017
|
+
}
|
|
1018
|
+
//#endregion
|
|
1019
|
+
//#region src/highlight/code-to-html.ts
|
|
1020
|
+
const hastToHtml = toHtml;
|
|
1021
|
+
/**
|
|
1022
|
+
* Get highlighted code in HTML.
|
|
1023
|
+
*/
|
|
1024
|
+
function codeToHtml(primitive, code, options) {
|
|
1025
|
+
const context = {
|
|
1026
|
+
meta: {},
|
|
1027
|
+
options,
|
|
1028
|
+
codeToHast: (_code, _options) => codeToHast(primitive, _code, _options),
|
|
1029
|
+
codeToTokens: (_code, _options) => codeToTokens(primitive, _code, _options)
|
|
1030
|
+
};
|
|
1031
|
+
let result = hastToHtml(codeToHast(primitive, code, options, context));
|
|
1032
|
+
for (const transformer of getTransformers(options)) result = transformer.postprocess?.call(context, result, options) || result;
|
|
1033
|
+
return result;
|
|
1034
|
+
}
|
|
1035
|
+
//#endregion
|
|
1036
|
+
//#region src/constructors/highlighter.ts
|
|
1037
|
+
/**
|
|
1038
|
+
* Create a Shiki core highlighter instance, with no languages or themes bundled.
|
|
1039
|
+
* Wasm and each language and theme must be loaded manually.
|
|
1040
|
+
*
|
|
1041
|
+
* @see http://shiki.style/guide/bundles#fine-grained-bundle
|
|
1042
|
+
*/
|
|
1043
|
+
async function createHighlighterCore(options) {
|
|
1044
|
+
const primitive = await createShikiPrimitiveAsync$1(options);
|
|
1045
|
+
return {
|
|
1046
|
+
getLastGrammarState: (...args) => getLastGrammarState(primitive, ...args),
|
|
1047
|
+
codeToTokensBase: (code, options) => codeToTokensBase(primitive, code, options),
|
|
1048
|
+
codeToTokensWithThemes: (code, options) => codeToTokensWithThemes$1(primitive, code, options),
|
|
1049
|
+
codeToTokens: (code, options) => codeToTokens(primitive, code, options),
|
|
1050
|
+
codeToHast: (code, options) => codeToHast(primitive, code, options),
|
|
1051
|
+
codeToHtml: (code, options) => codeToHtml(primitive, code, options),
|
|
1052
|
+
getBundledLanguages: () => ({}),
|
|
1053
|
+
getBundledThemes: () => ({}),
|
|
1054
|
+
...primitive,
|
|
1055
|
+
getInternalContext: () => primitive
|
|
1056
|
+
};
|
|
1057
|
+
}
|
|
1058
|
+
/**
|
|
1059
|
+
* Create a Shiki core highlighter instance, with no languages or themes bundled.
|
|
1060
|
+
* Wasm and each language and theme must be loaded manually.
|
|
1061
|
+
*
|
|
1062
|
+
* Synchronous version of `createHighlighterCore`, which requires to provide the engine and all themes and languages upfront.
|
|
1063
|
+
*
|
|
1064
|
+
* @see http://shiki.style/guide/bundles#fine-grained-bundle
|
|
1065
|
+
*/
|
|
1066
|
+
function createHighlighterCoreSync(options) {
|
|
1067
|
+
const internal = createShikiPrimitive$1(options);
|
|
1068
|
+
return {
|
|
1069
|
+
getLastGrammarState: (...args) => getLastGrammarState(internal, ...args),
|
|
1070
|
+
codeToTokensBase: (code, options) => codeToTokensBase(internal, code, options),
|
|
1071
|
+
codeToTokensWithThemes: (code, options) => codeToTokensWithThemes$1(internal, code, options),
|
|
1072
|
+
codeToTokens: (code, options) => codeToTokens(internal, code, options),
|
|
1073
|
+
codeToHast: (code, options) => codeToHast(internal, code, options),
|
|
1074
|
+
codeToHtml: (code, options) => codeToHtml(internal, code, options),
|
|
1075
|
+
getBundledLanguages: () => ({}),
|
|
1076
|
+
getBundledThemes: () => ({}),
|
|
1077
|
+
...internal,
|
|
1078
|
+
getInternalContext: () => internal
|
|
1079
|
+
};
|
|
1080
|
+
}
|
|
1081
|
+
function makeSingletonHighlighterCore(createHighlighter) {
|
|
1082
|
+
let _shiki;
|
|
1083
|
+
async function getSingletonHighlighterCore(options) {
|
|
1084
|
+
if (!_shiki) {
|
|
1085
|
+
_shiki = createHighlighter({
|
|
1086
|
+
...options,
|
|
1087
|
+
themes: options.themes || [],
|
|
1088
|
+
langs: options.langs || []
|
|
1089
|
+
});
|
|
1090
|
+
return _shiki;
|
|
1091
|
+
} else {
|
|
1092
|
+
const s = await _shiki;
|
|
1093
|
+
await Promise.all([s.loadTheme(...options.themes || []), s.loadLanguage(...options.langs || [])]);
|
|
1094
|
+
return s;
|
|
1095
|
+
}
|
|
1096
|
+
}
|
|
1097
|
+
return getSingletonHighlighterCore;
|
|
1098
|
+
}
|
|
1099
|
+
const getSingletonHighlighterCore = /* @__PURE__ */ makeSingletonHighlighterCore(createHighlighterCore);
|
|
1100
|
+
//#endregion
|
|
1101
|
+
//#region src/constructors/bundle-factory.ts
|
|
1102
|
+
function createBundledHighlighter(options) {
|
|
1103
|
+
const bundledLanguages = options.langs;
|
|
1104
|
+
const bundledThemes = options.themes;
|
|
1105
|
+
const engine = options.engine;
|
|
1106
|
+
async function createHighlighter(options) {
|
|
1107
|
+
function resolveLang(lang) {
|
|
1108
|
+
if (typeof lang === "string") {
|
|
1109
|
+
lang = options.langAlias?.[lang] || lang;
|
|
1110
|
+
if (isSpecialLang(lang)) return [];
|
|
1111
|
+
const bundle = bundledLanguages[lang];
|
|
1112
|
+
if (!bundle) throw new ShikiError$1(`Language \`${lang}\` is not included in this bundle. You may want to load it from external source.`);
|
|
1113
|
+
return bundle;
|
|
1114
|
+
}
|
|
1115
|
+
return lang;
|
|
1116
|
+
}
|
|
1117
|
+
function resolveTheme(theme) {
|
|
1118
|
+
if (isSpecialTheme(theme)) return "none";
|
|
1119
|
+
if (typeof theme === "string") {
|
|
1120
|
+
const bundle = bundledThemes[theme];
|
|
1121
|
+
if (!bundle) throw new ShikiError$1(`Theme \`${theme}\` is not included in this bundle. You may want to load it from external source.`);
|
|
1122
|
+
return bundle;
|
|
1123
|
+
}
|
|
1124
|
+
return theme;
|
|
1125
|
+
}
|
|
1126
|
+
const _themes = (options.themes ?? []).map((i) => resolveTheme(i));
|
|
1127
|
+
const langs = (options.langs ?? []).map((i) => resolveLang(i));
|
|
1128
|
+
const core = await createHighlighterCore({
|
|
1129
|
+
engine: options.engine ?? engine(),
|
|
1130
|
+
...options,
|
|
1131
|
+
themes: _themes,
|
|
1132
|
+
langs
|
|
1133
|
+
});
|
|
1134
|
+
return {
|
|
1135
|
+
...core,
|
|
1136
|
+
loadLanguage(...langs) {
|
|
1137
|
+
return core.loadLanguage(...langs.map(resolveLang));
|
|
1138
|
+
},
|
|
1139
|
+
loadTheme(...themes) {
|
|
1140
|
+
return core.loadTheme(...themes.map(resolveTheme));
|
|
1141
|
+
},
|
|
1142
|
+
getBundledLanguages() {
|
|
1143
|
+
return bundledLanguages;
|
|
1144
|
+
},
|
|
1145
|
+
getBundledThemes() {
|
|
1146
|
+
return bundledThemes;
|
|
1147
|
+
}
|
|
1148
|
+
};
|
|
1149
|
+
}
|
|
1150
|
+
return createHighlighter;
|
|
1151
|
+
}
|
|
1152
|
+
function makeSingletonHighlighter(createHighlighter) {
|
|
1153
|
+
let _shiki;
|
|
1154
|
+
async function getSingletonHighlighter(options = {}) {
|
|
1155
|
+
if (!_shiki) {
|
|
1156
|
+
_shiki = createHighlighter({
|
|
1157
|
+
...options,
|
|
1158
|
+
themes: [],
|
|
1159
|
+
langs: []
|
|
1160
|
+
});
|
|
1161
|
+
const s = await _shiki;
|
|
1162
|
+
await Promise.all([s.loadTheme(...options.themes || []), s.loadLanguage(...options.langs || [])]);
|
|
1163
|
+
return s;
|
|
1164
|
+
} else {
|
|
1165
|
+
const s = await _shiki;
|
|
1166
|
+
await Promise.all([s.loadTheme(...options.themes || []), s.loadLanguage(...options.langs || [])]);
|
|
1167
|
+
return s;
|
|
1168
|
+
}
|
|
1169
|
+
}
|
|
1170
|
+
return getSingletonHighlighter;
|
|
1171
|
+
}
|
|
1172
|
+
function createSingletonShorthands(createHighlighter, config) {
|
|
1173
|
+
const getSingletonHighlighter = makeSingletonHighlighter(createHighlighter);
|
|
1174
|
+
async function get(code, options) {
|
|
1175
|
+
const shiki = await getSingletonHighlighter({
|
|
1176
|
+
langs: [options.lang],
|
|
1177
|
+
themes: "theme" in options ? [options.theme] : Object.values(options.themes)
|
|
1178
|
+
});
|
|
1179
|
+
const langs = await config?.guessEmbeddedLanguages?.(code, options.lang, shiki);
|
|
1180
|
+
if (langs) await shiki.loadLanguage(...langs);
|
|
1181
|
+
return shiki;
|
|
1182
|
+
}
|
|
1183
|
+
return {
|
|
1184
|
+
getSingletonHighlighter(options) {
|
|
1185
|
+
return getSingletonHighlighter(options);
|
|
1186
|
+
},
|
|
1187
|
+
async codeToHtml(code, options) {
|
|
1188
|
+
return (await get(code, options)).codeToHtml(code, options);
|
|
1189
|
+
},
|
|
1190
|
+
async codeToHast(code, options) {
|
|
1191
|
+
return (await get(code, options)).codeToHast(code, options);
|
|
1192
|
+
},
|
|
1193
|
+
async codeToTokens(code, options) {
|
|
1194
|
+
return (await get(code, options)).codeToTokens(code, options);
|
|
1195
|
+
},
|
|
1196
|
+
async codeToTokensBase(code, options) {
|
|
1197
|
+
return (await get(code, options)).codeToTokensBase(code, options);
|
|
1198
|
+
},
|
|
1199
|
+
async codeToTokensWithThemes(code, options) {
|
|
1200
|
+
return (await get(code, options)).codeToTokensWithThemes(code, options);
|
|
1201
|
+
},
|
|
1202
|
+
async getLastGrammarState(code, options) {
|
|
1203
|
+
return (await getSingletonHighlighter({
|
|
1204
|
+
langs: [options.lang],
|
|
1205
|
+
themes: [options.theme]
|
|
1206
|
+
})).getLastGrammarState(code, options);
|
|
1207
|
+
}
|
|
1208
|
+
};
|
|
1209
|
+
}
|
|
1210
|
+
//#endregion
|
|
1211
|
+
//#region src/theme-css-variables.ts
|
|
1212
|
+
/**
|
|
1213
|
+
* A factory function to create a css-variable-based theme
|
|
1214
|
+
*
|
|
1215
|
+
* @see https://shiki.style/guide/theme-colors#css-variables-theme
|
|
1216
|
+
*/
|
|
1217
|
+
function createCssVariablesTheme(options = {}) {
|
|
1218
|
+
const { name = "css-variables", variablePrefix = "--shiki-", fontStyle = true } = options;
|
|
1219
|
+
const variable = (name) => {
|
|
1220
|
+
if (options.variableDefaults?.[name]) return `var(${variablePrefix}${name}, ${options.variableDefaults[name]})`;
|
|
1221
|
+
return `var(${variablePrefix}${name})`;
|
|
1222
|
+
};
|
|
1223
|
+
const theme = {
|
|
1224
|
+
name,
|
|
1225
|
+
type: "dark",
|
|
1226
|
+
colors: {
|
|
1227
|
+
"editor.foreground": variable("foreground"),
|
|
1228
|
+
"editor.background": variable("background"),
|
|
1229
|
+
"terminal.ansiBlack": variable("ansi-black"),
|
|
1230
|
+
"terminal.ansiRed": variable("ansi-red"),
|
|
1231
|
+
"terminal.ansiGreen": variable("ansi-green"),
|
|
1232
|
+
"terminal.ansiYellow": variable("ansi-yellow"),
|
|
1233
|
+
"terminal.ansiBlue": variable("ansi-blue"),
|
|
1234
|
+
"terminal.ansiMagenta": variable("ansi-magenta"),
|
|
1235
|
+
"terminal.ansiCyan": variable("ansi-cyan"),
|
|
1236
|
+
"terminal.ansiWhite": variable("ansi-white"),
|
|
1237
|
+
"terminal.ansiBrightBlack": variable("ansi-bright-black"),
|
|
1238
|
+
"terminal.ansiBrightRed": variable("ansi-bright-red"),
|
|
1239
|
+
"terminal.ansiBrightGreen": variable("ansi-bright-green"),
|
|
1240
|
+
"terminal.ansiBrightYellow": variable("ansi-bright-yellow"),
|
|
1241
|
+
"terminal.ansiBrightBlue": variable("ansi-bright-blue"),
|
|
1242
|
+
"terminal.ansiBrightMagenta": variable("ansi-bright-magenta"),
|
|
1243
|
+
"terminal.ansiBrightCyan": variable("ansi-bright-cyan"),
|
|
1244
|
+
"terminal.ansiBrightWhite": variable("ansi-bright-white")
|
|
1245
|
+
},
|
|
1246
|
+
tokenColors: [
|
|
1247
|
+
{
|
|
1248
|
+
scope: [
|
|
1249
|
+
"keyword.operator.accessor",
|
|
1250
|
+
"meta.group.braces.round.function.arguments",
|
|
1251
|
+
"meta.template.expression",
|
|
1252
|
+
"markup.fenced_code meta.embedded.block"
|
|
1253
|
+
],
|
|
1254
|
+
settings: { foreground: variable("foreground") }
|
|
1255
|
+
},
|
|
1256
|
+
{
|
|
1257
|
+
scope: "emphasis",
|
|
1258
|
+
settings: { fontStyle: "italic" }
|
|
1259
|
+
},
|
|
1260
|
+
{
|
|
1261
|
+
scope: [
|
|
1262
|
+
"strong",
|
|
1263
|
+
"markup.heading.markdown",
|
|
1264
|
+
"markup.bold.markdown"
|
|
1265
|
+
],
|
|
1266
|
+
settings: { fontStyle: "bold" }
|
|
1267
|
+
},
|
|
1268
|
+
{
|
|
1269
|
+
scope: ["markup.italic.markdown"],
|
|
1270
|
+
settings: { fontStyle: "italic" }
|
|
1271
|
+
},
|
|
1272
|
+
{
|
|
1273
|
+
scope: "meta.link.inline.markdown",
|
|
1274
|
+
settings: {
|
|
1275
|
+
fontStyle: "underline",
|
|
1276
|
+
foreground: variable("token-link")
|
|
1277
|
+
}
|
|
1278
|
+
},
|
|
1279
|
+
{
|
|
1280
|
+
scope: [
|
|
1281
|
+
"string",
|
|
1282
|
+
"markup.fenced_code",
|
|
1283
|
+
"markup.inline"
|
|
1284
|
+
],
|
|
1285
|
+
settings: { foreground: variable("token-string") }
|
|
1286
|
+
},
|
|
1287
|
+
{
|
|
1288
|
+
scope: ["comment", "string.quoted.docstring.multi"],
|
|
1289
|
+
settings: { foreground: variable("token-comment") }
|
|
1290
|
+
},
|
|
1291
|
+
{
|
|
1292
|
+
scope: [
|
|
1293
|
+
"constant.numeric",
|
|
1294
|
+
"constant.language",
|
|
1295
|
+
"constant.other.placeholder",
|
|
1296
|
+
"constant.character.format.placeholder",
|
|
1297
|
+
"variable.language.this",
|
|
1298
|
+
"variable.other.object",
|
|
1299
|
+
"variable.other.class",
|
|
1300
|
+
"variable.other.constant",
|
|
1301
|
+
"meta.property-name",
|
|
1302
|
+
"meta.property-value",
|
|
1303
|
+
"support"
|
|
1304
|
+
],
|
|
1305
|
+
settings: { foreground: variable("token-constant") }
|
|
1306
|
+
},
|
|
1307
|
+
{
|
|
1308
|
+
scope: [
|
|
1309
|
+
"keyword",
|
|
1310
|
+
"storage.modifier",
|
|
1311
|
+
"storage.type",
|
|
1312
|
+
"storage.control.clojure",
|
|
1313
|
+
"entity.name.function.clojure",
|
|
1314
|
+
"entity.name.tag.yaml",
|
|
1315
|
+
"support.function.node",
|
|
1316
|
+
"support.type.property-name.json",
|
|
1317
|
+
"punctuation.separator.key-value",
|
|
1318
|
+
"punctuation.definition.template-expression"
|
|
1319
|
+
],
|
|
1320
|
+
settings: { foreground: variable("token-keyword") }
|
|
1321
|
+
},
|
|
1322
|
+
{
|
|
1323
|
+
scope: "variable.parameter.function",
|
|
1324
|
+
settings: { foreground: variable("token-parameter") }
|
|
1325
|
+
},
|
|
1326
|
+
{
|
|
1327
|
+
scope: [
|
|
1328
|
+
"support.function",
|
|
1329
|
+
"entity.name.type",
|
|
1330
|
+
"entity.other.inherited-class",
|
|
1331
|
+
"meta.function-call",
|
|
1332
|
+
"meta.instance.constructor",
|
|
1333
|
+
"entity.other.attribute-name",
|
|
1334
|
+
"entity.name.function",
|
|
1335
|
+
"constant.keyword.clojure"
|
|
1336
|
+
],
|
|
1337
|
+
settings: { foreground: variable("token-function") }
|
|
1338
|
+
},
|
|
1339
|
+
{
|
|
1340
|
+
scope: [
|
|
1341
|
+
"entity.name.tag",
|
|
1342
|
+
"string.quoted",
|
|
1343
|
+
"string.regexp",
|
|
1344
|
+
"string.interpolated",
|
|
1345
|
+
"string.template",
|
|
1346
|
+
"string.unquoted.plain.out.yaml",
|
|
1347
|
+
"keyword.other.template"
|
|
1348
|
+
],
|
|
1349
|
+
settings: { foreground: variable("token-string-expression") }
|
|
1350
|
+
},
|
|
1351
|
+
{
|
|
1352
|
+
scope: [
|
|
1353
|
+
"punctuation.definition.arguments",
|
|
1354
|
+
"punctuation.definition.dict",
|
|
1355
|
+
"punctuation.separator",
|
|
1356
|
+
"meta.function-call.arguments"
|
|
1357
|
+
],
|
|
1358
|
+
settings: { foreground: variable("token-punctuation") }
|
|
1359
|
+
},
|
|
1360
|
+
{
|
|
1361
|
+
scope: ["markup.underline.link", "punctuation.definition.metadata.markdown"],
|
|
1362
|
+
settings: { foreground: variable("token-link") }
|
|
1363
|
+
},
|
|
1364
|
+
{
|
|
1365
|
+
scope: ["beginning.punctuation.definition.list.markdown"],
|
|
1366
|
+
settings: { foreground: variable("token-string") }
|
|
1367
|
+
},
|
|
1368
|
+
{
|
|
1369
|
+
scope: [
|
|
1370
|
+
"punctuation.definition.string.begin.markdown",
|
|
1371
|
+
"punctuation.definition.string.end.markdown",
|
|
1372
|
+
"string.other.link.title.markdown",
|
|
1373
|
+
"string.other.link.description.markdown"
|
|
1374
|
+
],
|
|
1375
|
+
settings: { foreground: variable("token-keyword") }
|
|
1376
|
+
},
|
|
1377
|
+
{
|
|
1378
|
+
scope: [
|
|
1379
|
+
"markup.inserted",
|
|
1380
|
+
"meta.diff.header.to-file",
|
|
1381
|
+
"punctuation.definition.inserted"
|
|
1382
|
+
],
|
|
1383
|
+
settings: { foreground: variable("token-inserted") }
|
|
1384
|
+
},
|
|
1385
|
+
{
|
|
1386
|
+
scope: [
|
|
1387
|
+
"markup.deleted",
|
|
1388
|
+
"meta.diff.header.from-file",
|
|
1389
|
+
"punctuation.definition.deleted"
|
|
1390
|
+
],
|
|
1391
|
+
settings: { foreground: variable("token-deleted") }
|
|
1392
|
+
},
|
|
1393
|
+
{
|
|
1394
|
+
scope: ["markup.changed", "punctuation.definition.changed"],
|
|
1395
|
+
settings: { foreground: variable("token-changed") }
|
|
1396
|
+
}
|
|
1397
|
+
]
|
|
1398
|
+
};
|
|
1399
|
+
if (!fontStyle) theme.tokenColors = theme.tokenColors?.map((tokenColor) => {
|
|
1400
|
+
if (tokenColor.settings?.fontStyle) delete tokenColor.settings.fontStyle;
|
|
1401
|
+
return tokenColor;
|
|
1402
|
+
});
|
|
1403
|
+
return theme;
|
|
1404
|
+
}
|
|
1405
|
+
//#endregion
|
|
1406
|
+
export { ShikiError, addClassToHast, applyColorReplacements, codeToHast, codeToHtml, codeToTokens, codeToTokensBase, codeToTokensWithThemes, createBundledHighlighter, createCssVariablesTheme, createHighlighterCore, createHighlighterCoreSync, createPositionConverter, createShikiInternal, createShikiInternalSync, createShikiPrimitive, createShikiPrimitiveAsync, createSingletonShorthands, flatTokenVariants, getLastGrammarState, getSingletonHighlighterCore, getTokenStyleObject, guessEmbeddedLanguages, hastToHtml, isNoneTheme, isPlainLang, isSpecialLang, isSpecialTheme, makeSingletonHighlighter, makeSingletonHighlighterCore, normalizeGetter, normalizeTheme, resolveColorReplacements, splitLines, splitToken, splitTokens, stringifyTokenStyle, toArray, tokenizeAnsiWithTheme, tokenizeWithTheme, tokensToHast, transformerDecorations };
|