@qwik.dev/devtools 0.3.0-beta.3 → 2.0.0-beta.45

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.
Files changed (503) hide show
  1. package/dist/kit/index.d.mts +3 -3
  2. package/dist/kit/index.mjs +4 -7
  3. package/dist/plugin/codegen.mjs +1 -1
  4. package/dist/plugin/{create-hook-runtime-ChnIePeB.mjs → create-hook-runtime-CoRDu99E.mjs} +2 -4
  5. package/dist/plugin/index.mjs +4 -7
  6. package/dist/ui/_virtual/_@oxc-project_runtime@0.144.0/helpers/esm/defineProperty.qwik.mjs +10 -0
  7. package/dist/ui/_virtual/_@oxc-project_runtime@0.144.0/helpers/esm/toPrimitive.qwik.mjs +12 -0
  8. package/dist/ui/_virtual/_@oxc-project_runtime@0.144.0/helpers/esm/toPropertyKey.qwik.mjs +7 -0
  9. package/dist/ui/_virtual/_@oxc-project_runtime@0.144.0/helpers/esm/typeof.qwik.mjs +9 -0
  10. package/dist/ui/_virtual/_rolldown/runtime.qwik.mjs +31 -0
  11. package/dist/ui/bundle-graph-DNRrO_5W.json +1 -0
  12. package/dist/ui/entry.extension.qwik.mjs +14 -14
  13. package/dist/ui/index.qwik.mjs +2 -5
  14. package/dist/ui/lib-types/ui/src/features/RenderTree/types.d.ts +1 -1
  15. package/dist/ui/node_modules/.pnpm/@shikijs_core@4.0.2/node_modules/@shikijs/core/dist/index.qwik.mjs +1058 -1035
  16. package/dist/ui/node_modules/.pnpm/@shikijs_engine-oniguruma@4.0.2/node_modules/@shikijs/engine-oniguruma/dist/index.qwik.mjs +360 -408
  17. package/dist/ui/node_modules/.pnpm/@shikijs_engine-oniguruma@4.0.2/node_modules/@shikijs/engine-oniguruma/dist/wasm-inlined.qwik.mjs +4 -9
  18. package/dist/ui/node_modules/.pnpm/@shikijs_langs@4.0.2/node_modules/@shikijs/langs/dist/abap.qwik.mjs +2 -7
  19. package/dist/ui/node_modules/.pnpm/@shikijs_langs@4.0.2/node_modules/@shikijs/langs/dist/actionscript-3.qwik.mjs +2 -7
  20. package/dist/ui/node_modules/.pnpm/@shikijs_langs@4.0.2/node_modules/@shikijs/langs/dist/ada.qwik.mjs +2 -7
  21. package/dist/ui/node_modules/.pnpm/@shikijs_langs@4.0.2/node_modules/@shikijs/langs/dist/angular-expression.qwik.mjs +2 -7
  22. package/dist/ui/node_modules/.pnpm/@shikijs_langs@4.0.2/node_modules/@shikijs/langs/dist/angular-html.qwik.mjs +14 -16
  23. package/dist/ui/node_modules/.pnpm/@shikijs_langs@4.0.2/node_modules/@shikijs/langs/dist/angular-inline-style.qwik.mjs +4 -9
  24. package/dist/ui/node_modules/.pnpm/@shikijs_langs@4.0.2/node_modules/@shikijs/langs/dist/angular-inline-template.qwik.mjs +8 -10
  25. package/dist/ui/node_modules/.pnpm/@shikijs_langs@4.0.2/node_modules/@shikijs/langs/dist/angular-let-declaration.qwik.mjs +4 -9
  26. package/dist/ui/node_modules/.pnpm/@shikijs_langs@4.0.2/node_modules/@shikijs/langs/dist/angular-template-blocks.qwik.mjs +8 -10
  27. package/dist/ui/node_modules/.pnpm/@shikijs_langs@4.0.2/node_modules/@shikijs/langs/dist/angular-template.qwik.mjs +4 -9
  28. package/dist/ui/node_modules/.pnpm/@shikijs_langs@4.0.2/node_modules/@shikijs/langs/dist/angular-ts.qwik.mjs +16 -18
  29. package/dist/ui/node_modules/.pnpm/@shikijs_langs@4.0.2/node_modules/@shikijs/langs/dist/apache.qwik.mjs +2 -7
  30. package/dist/ui/node_modules/.pnpm/@shikijs_langs@4.0.2/node_modules/@shikijs/langs/dist/apex.qwik.mjs +2 -7
  31. package/dist/ui/node_modules/.pnpm/@shikijs_langs@4.0.2/node_modules/@shikijs/langs/dist/apl.qwik.mjs +14 -16
  32. package/dist/ui/node_modules/.pnpm/@shikijs_langs@4.0.2/node_modules/@shikijs/langs/dist/applescript.qwik.mjs +2 -7
  33. package/dist/ui/node_modules/.pnpm/@shikijs_langs@4.0.2/node_modules/@shikijs/langs/dist/ara.qwik.mjs +2 -7
  34. package/dist/ui/node_modules/.pnpm/@shikijs_langs@4.0.2/node_modules/@shikijs/langs/dist/asciidoc.qwik.mjs +2 -7
  35. package/dist/ui/node_modules/.pnpm/@shikijs_langs@4.0.2/node_modules/@shikijs/langs/dist/asm.qwik.mjs +2 -7
  36. package/dist/ui/node_modules/.pnpm/@shikijs_langs@4.0.2/node_modules/@shikijs/langs/dist/astro.qwik.mjs +16 -18
  37. package/dist/ui/node_modules/.pnpm/@shikijs_langs@4.0.2/node_modules/@shikijs/langs/dist/awk.qwik.mjs +2 -7
  38. package/dist/ui/node_modules/.pnpm/@shikijs_langs@4.0.2/node_modules/@shikijs/langs/dist/ballerina.qwik.mjs +2 -7
  39. package/dist/ui/node_modules/.pnpm/@shikijs_langs@4.0.2/node_modules/@shikijs/langs/dist/bat.qwik.mjs +2 -7
  40. package/dist/ui/node_modules/.pnpm/@shikijs_langs@4.0.2/node_modules/@shikijs/langs/dist/beancount.qwik.mjs +2 -7
  41. package/dist/ui/node_modules/.pnpm/@shikijs_langs@4.0.2/node_modules/@shikijs/langs/dist/berry.qwik.mjs +2 -7
  42. package/dist/ui/node_modules/.pnpm/@shikijs_langs@4.0.2/node_modules/@shikijs/langs/dist/bibtex.qwik.mjs +2 -7
  43. package/dist/ui/node_modules/.pnpm/@shikijs_langs@4.0.2/node_modules/@shikijs/langs/dist/bicep.qwik.mjs +2 -7
  44. package/dist/ui/node_modules/.pnpm/@shikijs_langs@4.0.2/node_modules/@shikijs/langs/dist/bird2.qwik.mjs +2 -7
  45. package/dist/ui/node_modules/.pnpm/@shikijs_langs@4.0.2/node_modules/@shikijs/langs/dist/blade.qwik.mjs +18 -20
  46. package/dist/ui/node_modules/.pnpm/@shikijs_langs@4.0.2/node_modules/@shikijs/langs/dist/bsl.qwik.mjs +4 -9
  47. package/dist/ui/node_modules/.pnpm/@shikijs_langs@4.0.2/node_modules/@shikijs/langs/dist/c.qwik.mjs +2 -7
  48. package/dist/ui/node_modules/.pnpm/@shikijs_langs@4.0.2/node_modules/@shikijs/langs/dist/c3.qwik.mjs +2 -7
  49. package/dist/ui/node_modules/.pnpm/@shikijs_langs@4.0.2/node_modules/@shikijs/langs/dist/cadence.qwik.mjs +2 -7
  50. package/dist/ui/node_modules/.pnpm/@shikijs_langs@4.0.2/node_modules/@shikijs/langs/dist/cairo.qwik.mjs +4 -9
  51. package/dist/ui/node_modules/.pnpm/@shikijs_langs@4.0.2/node_modules/@shikijs/langs/dist/clarity.qwik.mjs +2 -7
  52. package/dist/ui/node_modules/.pnpm/@shikijs_langs@4.0.2/node_modules/@shikijs/langs/dist/clojure.qwik.mjs +2 -7
  53. package/dist/ui/node_modules/.pnpm/@shikijs_langs@4.0.2/node_modules/@shikijs/langs/dist/cmake.qwik.mjs +2 -7
  54. package/dist/ui/node_modules/.pnpm/@shikijs_langs@4.0.2/node_modules/@shikijs/langs/dist/cobol.qwik.mjs +8 -10
  55. package/dist/ui/node_modules/.pnpm/@shikijs_langs@4.0.2/node_modules/@shikijs/langs/dist/codeowners.qwik.mjs +2 -7
  56. package/dist/ui/node_modules/.pnpm/@shikijs_langs@4.0.2/node_modules/@shikijs/langs/dist/codeql.qwik.mjs +2 -7
  57. package/dist/ui/node_modules/.pnpm/@shikijs_langs@4.0.2/node_modules/@shikijs/langs/dist/coffee.qwik.mjs +4 -9
  58. package/dist/ui/node_modules/.pnpm/@shikijs_langs@4.0.2/node_modules/@shikijs/langs/dist/common-lisp.qwik.mjs +2 -7
  59. package/dist/ui/node_modules/.pnpm/@shikijs_langs@4.0.2/node_modules/@shikijs/langs/dist/coq.qwik.mjs +2 -7
  60. package/dist/ui/node_modules/.pnpm/@shikijs_langs@4.0.2/node_modules/@shikijs/langs/dist/cpp-macro.qwik.mjs +10 -12
  61. package/dist/ui/node_modules/.pnpm/@shikijs_langs@4.0.2/node_modules/@shikijs/langs/dist/cpp.qwik.mjs +12 -14
  62. package/dist/ui/node_modules/.pnpm/@shikijs_langs@4.0.2/node_modules/@shikijs/langs/dist/crystal.qwik.mjs +16 -18
  63. package/dist/ui/node_modules/.pnpm/@shikijs_langs@4.0.2/node_modules/@shikijs/langs/dist/csharp.qwik.mjs +2 -7
  64. package/dist/ui/node_modules/.pnpm/@shikijs_langs@4.0.2/node_modules/@shikijs/langs/dist/css.qwik.mjs +2 -7
  65. package/dist/ui/node_modules/.pnpm/@shikijs_langs@4.0.2/node_modules/@shikijs/langs/dist/csv.qwik.mjs +2 -7
  66. package/dist/ui/node_modules/.pnpm/@shikijs_langs@4.0.2/node_modules/@shikijs/langs/dist/cue.qwik.mjs +2 -7
  67. package/dist/ui/node_modules/.pnpm/@shikijs_langs@4.0.2/node_modules/@shikijs/langs/dist/cypher.qwik.mjs +2 -7
  68. package/dist/ui/node_modules/.pnpm/@shikijs_langs@4.0.2/node_modules/@shikijs/langs/dist/d.qwik.mjs +2 -7
  69. package/dist/ui/node_modules/.pnpm/@shikijs_langs@4.0.2/node_modules/@shikijs/langs/dist/dart.qwik.mjs +2 -7
  70. package/dist/ui/node_modules/.pnpm/@shikijs_langs@4.0.2/node_modules/@shikijs/langs/dist/dax.qwik.mjs +2 -7
  71. package/dist/ui/node_modules/.pnpm/@shikijs_langs@4.0.2/node_modules/@shikijs/langs/dist/desktop.qwik.mjs +2 -7
  72. package/dist/ui/node_modules/.pnpm/@shikijs_langs@4.0.2/node_modules/@shikijs/langs/dist/diff.qwik.mjs +2 -7
  73. package/dist/ui/node_modules/.pnpm/@shikijs_langs@4.0.2/node_modules/@shikijs/langs/dist/docker.qwik.mjs +2 -7
  74. package/dist/ui/node_modules/.pnpm/@shikijs_langs@4.0.2/node_modules/@shikijs/langs/dist/dotenv.qwik.mjs +2 -7
  75. package/dist/ui/node_modules/.pnpm/@shikijs_langs@4.0.2/node_modules/@shikijs/langs/dist/dream-maker.qwik.mjs +2 -7
  76. package/dist/ui/node_modules/.pnpm/@shikijs_langs@4.0.2/node_modules/@shikijs/langs/dist/edge.qwik.mjs +10 -12
  77. package/dist/ui/node_modules/.pnpm/@shikijs_langs@4.0.2/node_modules/@shikijs/langs/dist/elixir.qwik.mjs +4 -9
  78. package/dist/ui/node_modules/.pnpm/@shikijs_langs@4.0.2/node_modules/@shikijs/langs/dist/elm.qwik.mjs +4 -9
  79. package/dist/ui/node_modules/.pnpm/@shikijs_langs@4.0.2/node_modules/@shikijs/langs/dist/emacs-lisp.qwik.mjs +2 -7
  80. package/dist/ui/node_modules/.pnpm/@shikijs_langs@4.0.2/node_modules/@shikijs/langs/dist/erb.qwik.mjs +8 -10
  81. package/dist/ui/node_modules/.pnpm/@shikijs_langs@4.0.2/node_modules/@shikijs/langs/dist/erlang.qwik.mjs +4 -9
  82. package/dist/ui/node_modules/.pnpm/@shikijs_langs@4.0.2/node_modules/@shikijs/langs/dist/es-tag-css.qwik.mjs +10 -12
  83. package/dist/ui/node_modules/.pnpm/@shikijs_langs@4.0.2/node_modules/@shikijs/langs/dist/es-tag-glsl.qwik.mjs +10 -12
  84. package/dist/ui/node_modules/.pnpm/@shikijs_langs@4.0.2/node_modules/@shikijs/langs/dist/es-tag-html.qwik.mjs +10 -12
  85. package/dist/ui/node_modules/.pnpm/@shikijs_langs@4.0.2/node_modules/@shikijs/langs/dist/es-tag-sql.qwik.mjs +8 -10
  86. package/dist/ui/node_modules/.pnpm/@shikijs_langs@4.0.2/node_modules/@shikijs/langs/dist/es-tag-xml.qwik.mjs +4 -9
  87. package/dist/ui/node_modules/.pnpm/@shikijs_langs@4.0.2/node_modules/@shikijs/langs/dist/fennel.qwik.mjs +2 -7
  88. package/dist/ui/node_modules/.pnpm/@shikijs_langs@4.0.2/node_modules/@shikijs/langs/dist/fish.qwik.mjs +2 -7
  89. package/dist/ui/node_modules/.pnpm/@shikijs_langs@4.0.2/node_modules/@shikijs/langs/dist/fluent.qwik.mjs +2 -7
  90. package/dist/ui/node_modules/.pnpm/@shikijs_langs@4.0.2/node_modules/@shikijs/langs/dist/fortran-fixed-form.qwik.mjs +4 -9
  91. package/dist/ui/node_modules/.pnpm/@shikijs_langs@4.0.2/node_modules/@shikijs/langs/dist/fortran-free-form.qwik.mjs +2 -7
  92. package/dist/ui/node_modules/.pnpm/@shikijs_langs@4.0.2/node_modules/@shikijs/langs/dist/fsharp.qwik.mjs +4 -9
  93. package/dist/ui/node_modules/.pnpm/@shikijs_langs@4.0.2/node_modules/@shikijs/langs/dist/gdresource.qwik.mjs +8 -10
  94. package/dist/ui/node_modules/.pnpm/@shikijs_langs@4.0.2/node_modules/@shikijs/langs/dist/gdscript.qwik.mjs +2 -7
  95. package/dist/ui/node_modules/.pnpm/@shikijs_langs@4.0.2/node_modules/@shikijs/langs/dist/gdshader.qwik.mjs +2 -7
  96. package/dist/ui/node_modules/.pnpm/@shikijs_langs@4.0.2/node_modules/@shikijs/langs/dist/genie.qwik.mjs +2 -7
  97. package/dist/ui/node_modules/.pnpm/@shikijs_langs@4.0.2/node_modules/@shikijs/langs/dist/gherkin.qwik.mjs +2 -7
  98. package/dist/ui/node_modules/.pnpm/@shikijs_langs@4.0.2/node_modules/@shikijs/langs/dist/git-commit.qwik.mjs +4 -9
  99. package/dist/ui/node_modules/.pnpm/@shikijs_langs@4.0.2/node_modules/@shikijs/langs/dist/git-rebase.qwik.mjs +4 -9
  100. package/dist/ui/node_modules/.pnpm/@shikijs_langs@4.0.2/node_modules/@shikijs/langs/dist/gleam.qwik.mjs +2 -7
  101. package/dist/ui/node_modules/.pnpm/@shikijs_langs@4.0.2/node_modules/@shikijs/langs/dist/glimmer-js.qwik.mjs +12 -14
  102. package/dist/ui/node_modules/.pnpm/@shikijs_langs@4.0.2/node_modules/@shikijs/langs/dist/glimmer-ts.qwik.mjs +12 -14
  103. package/dist/ui/node_modules/.pnpm/@shikijs_langs@4.0.2/node_modules/@shikijs/langs/dist/glsl.qwik.mjs +4 -9
  104. package/dist/ui/node_modules/.pnpm/@shikijs_langs@4.0.2/node_modules/@shikijs/langs/dist/gn.qwik.mjs +2 -7
  105. package/dist/ui/node_modules/.pnpm/@shikijs_langs@4.0.2/node_modules/@shikijs/langs/dist/gnuplot.qwik.mjs +2 -7
  106. package/dist/ui/node_modules/.pnpm/@shikijs_langs@4.0.2/node_modules/@shikijs/langs/dist/go.qwik.mjs +2 -7
  107. package/dist/ui/node_modules/.pnpm/@shikijs_langs@4.0.2/node_modules/@shikijs/langs/dist/graphql.qwik.mjs +12 -14
  108. package/dist/ui/node_modules/.pnpm/@shikijs_langs@4.0.2/node_modules/@shikijs/langs/dist/groovy.qwik.mjs +2 -7
  109. package/dist/ui/node_modules/.pnpm/@shikijs_langs@4.0.2/node_modules/@shikijs/langs/dist/hack.qwik.mjs +8 -10
  110. package/dist/ui/node_modules/.pnpm/@shikijs_langs@4.0.2/node_modules/@shikijs/langs/dist/haml.qwik.mjs +8 -10
  111. package/dist/ui/node_modules/.pnpm/@shikijs_langs@4.0.2/node_modules/@shikijs/langs/dist/handlebars.qwik.mjs +12 -14
  112. package/dist/ui/node_modules/.pnpm/@shikijs_langs@4.0.2/node_modules/@shikijs/langs/dist/haskell.qwik.mjs +2 -7
  113. package/dist/ui/node_modules/.pnpm/@shikijs_langs@4.0.2/node_modules/@shikijs/langs/dist/haxe.qwik.mjs +2 -7
  114. package/dist/ui/node_modules/.pnpm/@shikijs_langs@4.0.2/node_modules/@shikijs/langs/dist/hcl.qwik.mjs +2 -7
  115. package/dist/ui/node_modules/.pnpm/@shikijs_langs@4.0.2/node_modules/@shikijs/langs/dist/hjson.qwik.mjs +2 -7
  116. package/dist/ui/node_modules/.pnpm/@shikijs_langs@4.0.2/node_modules/@shikijs/langs/dist/hlsl.qwik.mjs +2 -7
  117. package/dist/ui/node_modules/.pnpm/@shikijs_langs@4.0.2/node_modules/@shikijs/langs/dist/html-derivative.qwik.mjs +4 -9
  118. package/dist/ui/node_modules/.pnpm/@shikijs_langs@4.0.2/node_modules/@shikijs/langs/dist/html.qwik.mjs +8 -10
  119. package/dist/ui/node_modules/.pnpm/@shikijs_langs@4.0.2/node_modules/@shikijs/langs/dist/http.qwik.mjs +12 -14
  120. package/dist/ui/node_modules/.pnpm/@shikijs_langs@4.0.2/node_modules/@shikijs/langs/dist/hurl.qwik.mjs +10 -12
  121. package/dist/ui/node_modules/.pnpm/@shikijs_langs@4.0.2/node_modules/@shikijs/langs/dist/hxml.qwik.mjs +4 -9
  122. package/dist/ui/node_modules/.pnpm/@shikijs_langs@4.0.2/node_modules/@shikijs/langs/dist/hy.qwik.mjs +2 -7
  123. package/dist/ui/node_modules/.pnpm/@shikijs_langs@4.0.2/node_modules/@shikijs/langs/dist/imba.qwik.mjs +2 -7
  124. package/dist/ui/node_modules/.pnpm/@shikijs_langs@4.0.2/node_modules/@shikijs/langs/dist/ini.qwik.mjs +2 -7
  125. package/dist/ui/node_modules/.pnpm/@shikijs_langs@4.0.2/node_modules/@shikijs/langs/dist/java.qwik.mjs +2 -7
  126. package/dist/ui/node_modules/.pnpm/@shikijs_langs@4.0.2/node_modules/@shikijs/langs/dist/javascript.qwik.mjs +2 -7
  127. package/dist/ui/node_modules/.pnpm/@shikijs_langs@4.0.2/node_modules/@shikijs/langs/dist/jinja-html.qwik.mjs +4 -9
  128. package/dist/ui/node_modules/.pnpm/@shikijs_langs@4.0.2/node_modules/@shikijs/langs/dist/jinja.qwik.mjs +4 -9
  129. package/dist/ui/node_modules/.pnpm/@shikijs_langs@4.0.2/node_modules/@shikijs/langs/dist/jison.qwik.mjs +4 -9
  130. package/dist/ui/node_modules/.pnpm/@shikijs_langs@4.0.2/node_modules/@shikijs/langs/dist/json.qwik.mjs +2 -7
  131. package/dist/ui/node_modules/.pnpm/@shikijs_langs@4.0.2/node_modules/@shikijs/langs/dist/json5.qwik.mjs +2 -7
  132. package/dist/ui/node_modules/.pnpm/@shikijs_langs@4.0.2/node_modules/@shikijs/langs/dist/jsonc.qwik.mjs +2 -7
  133. package/dist/ui/node_modules/.pnpm/@shikijs_langs@4.0.2/node_modules/@shikijs/langs/dist/jsonl.qwik.mjs +2 -7
  134. package/dist/ui/node_modules/.pnpm/@shikijs_langs@4.0.2/node_modules/@shikijs/langs/dist/jsonnet.qwik.mjs +2 -7
  135. package/dist/ui/node_modules/.pnpm/@shikijs_langs@4.0.2/node_modules/@shikijs/langs/dist/jssm.qwik.mjs +2 -7
  136. package/dist/ui/node_modules/.pnpm/@shikijs_langs@4.0.2/node_modules/@shikijs/langs/dist/jsx.qwik.mjs +2 -7
  137. package/dist/ui/node_modules/.pnpm/@shikijs_langs@4.0.2/node_modules/@shikijs/langs/dist/julia.qwik.mjs +14 -16
  138. package/dist/ui/node_modules/.pnpm/@shikijs_langs@4.0.2/node_modules/@shikijs/langs/dist/just.qwik.mjs +16 -18
  139. package/dist/ui/node_modules/.pnpm/@shikijs_langs@4.0.2/node_modules/@shikijs/langs/dist/kdl.qwik.mjs +2 -7
  140. package/dist/ui/node_modules/.pnpm/@shikijs_langs@4.0.2/node_modules/@shikijs/langs/dist/kotlin.qwik.mjs +2 -7
  141. package/dist/ui/node_modules/.pnpm/@shikijs_langs@4.0.2/node_modules/@shikijs/langs/dist/kusto.qwik.mjs +2 -7
  142. package/dist/ui/node_modules/.pnpm/@shikijs_langs@4.0.2/node_modules/@shikijs/langs/dist/latex.qwik.mjs +4 -9
  143. package/dist/ui/node_modules/.pnpm/@shikijs_langs@4.0.2/node_modules/@shikijs/langs/dist/lean.qwik.mjs +2 -7
  144. package/dist/ui/node_modules/.pnpm/@shikijs_langs@4.0.2/node_modules/@shikijs/langs/dist/less.qwik.mjs +2 -7
  145. package/dist/ui/node_modules/.pnpm/@shikijs_langs@4.0.2/node_modules/@shikijs/langs/dist/liquid.qwik.mjs +12 -14
  146. package/dist/ui/node_modules/.pnpm/@shikijs_langs@4.0.2/node_modules/@shikijs/langs/dist/llvm.qwik.mjs +2 -7
  147. package/dist/ui/node_modules/.pnpm/@shikijs_langs@4.0.2/node_modules/@shikijs/langs/dist/log.qwik.mjs +2 -7
  148. package/dist/ui/node_modules/.pnpm/@shikijs_langs@4.0.2/node_modules/@shikijs/langs/dist/logo.qwik.mjs +2 -7
  149. package/dist/ui/node_modules/.pnpm/@shikijs_langs@4.0.2/node_modules/@shikijs/langs/dist/lua.qwik.mjs +4 -9
  150. package/dist/ui/node_modules/.pnpm/@shikijs_langs@4.0.2/node_modules/@shikijs/langs/dist/luau.qwik.mjs +2 -7
  151. package/dist/ui/node_modules/.pnpm/@shikijs_langs@4.0.2/node_modules/@shikijs/langs/dist/make.qwik.mjs +2 -7
  152. package/dist/ui/node_modules/.pnpm/@shikijs_langs@4.0.2/node_modules/@shikijs/langs/dist/markdown-nix.qwik.mjs +2 -7
  153. package/dist/ui/node_modules/.pnpm/@shikijs_langs@4.0.2/node_modules/@shikijs/langs/dist/markdown-vue.qwik.mjs +2 -7
  154. package/dist/ui/node_modules/.pnpm/@shikijs_langs@4.0.2/node_modules/@shikijs/langs/dist/markdown.qwik.mjs +2 -7
  155. package/dist/ui/node_modules/.pnpm/@shikijs_langs@4.0.2/node_modules/@shikijs/langs/dist/marko.qwik.mjs +12 -14
  156. package/dist/ui/node_modules/.pnpm/@shikijs_langs@4.0.2/node_modules/@shikijs/langs/dist/matlab.qwik.mjs +2 -7
  157. package/dist/ui/node_modules/.pnpm/@shikijs_langs@4.0.2/node_modules/@shikijs/langs/dist/mdc.qwik.mjs +10 -12
  158. package/dist/ui/node_modules/.pnpm/@shikijs_langs@4.0.2/node_modules/@shikijs/langs/dist/mdx.qwik.mjs +2 -7
  159. package/dist/ui/node_modules/.pnpm/@shikijs_langs@4.0.2/node_modules/@shikijs/langs/dist/mermaid.qwik.mjs +2 -7
  160. package/dist/ui/node_modules/.pnpm/@shikijs_langs@4.0.2/node_modules/@shikijs/langs/dist/mipsasm.qwik.mjs +2 -7
  161. package/dist/ui/node_modules/.pnpm/@shikijs_langs@4.0.2/node_modules/@shikijs/langs/dist/mojo.qwik.mjs +2 -7
  162. package/dist/ui/node_modules/.pnpm/@shikijs_langs@4.0.2/node_modules/@shikijs/langs/dist/moonbit.qwik.mjs +2 -7
  163. package/dist/ui/node_modules/.pnpm/@shikijs_langs@4.0.2/node_modules/@shikijs/langs/dist/move.qwik.mjs +2 -7
  164. package/dist/ui/node_modules/.pnpm/@shikijs_langs@4.0.2/node_modules/@shikijs/langs/dist/narrat.qwik.mjs +2 -7
  165. package/dist/ui/node_modules/.pnpm/@shikijs_langs@4.0.2/node_modules/@shikijs/langs/dist/nextflow-groovy.qwik.mjs +2 -7
  166. package/dist/ui/node_modules/.pnpm/@shikijs_langs@4.0.2/node_modules/@shikijs/langs/dist/nextflow.qwik.mjs +4 -9
  167. package/dist/ui/node_modules/.pnpm/@shikijs_langs@4.0.2/node_modules/@shikijs/langs/dist/nginx.qwik.mjs +4 -9
  168. package/dist/ui/node_modules/.pnpm/@shikijs_langs@4.0.2/node_modules/@shikijs/langs/dist/nim.qwik.mjs +18 -20
  169. package/dist/ui/node_modules/.pnpm/@shikijs_langs@4.0.2/node_modules/@shikijs/langs/dist/nix.qwik.mjs +4 -9
  170. package/dist/ui/node_modules/.pnpm/@shikijs_langs@4.0.2/node_modules/@shikijs/langs/dist/nushell.qwik.mjs +2 -7
  171. package/dist/ui/node_modules/.pnpm/@shikijs_langs@4.0.2/node_modules/@shikijs/langs/dist/objective-c.qwik.mjs +2 -7
  172. package/dist/ui/node_modules/.pnpm/@shikijs_langs@4.0.2/node_modules/@shikijs/langs/dist/objective-cpp.qwik.mjs +2 -7
  173. package/dist/ui/node_modules/.pnpm/@shikijs_langs@4.0.2/node_modules/@shikijs/langs/dist/ocaml.qwik.mjs +2 -7
  174. package/dist/ui/node_modules/.pnpm/@shikijs_langs@4.0.2/node_modules/@shikijs/langs/dist/odin.qwik.mjs +2 -7
  175. package/dist/ui/node_modules/.pnpm/@shikijs_langs@4.0.2/node_modules/@shikijs/langs/dist/openscad.qwik.mjs +2 -7
  176. package/dist/ui/node_modules/.pnpm/@shikijs_langs@4.0.2/node_modules/@shikijs/langs/dist/pascal.qwik.mjs +2 -7
  177. package/dist/ui/node_modules/.pnpm/@shikijs_langs@4.0.2/node_modules/@shikijs/langs/dist/perl.qwik.mjs +14 -16
  178. package/dist/ui/node_modules/.pnpm/@shikijs_langs@4.0.2/node_modules/@shikijs/langs/dist/php.qwik.mjs +16 -18
  179. package/dist/ui/node_modules/.pnpm/@shikijs_langs@4.0.2/node_modules/@shikijs/langs/dist/pkl.qwik.mjs +2 -7
  180. package/dist/ui/node_modules/.pnpm/@shikijs_langs@4.0.2/node_modules/@shikijs/langs/dist/plsql.qwik.mjs +2 -7
  181. package/dist/ui/node_modules/.pnpm/@shikijs_langs@4.0.2/node_modules/@shikijs/langs/dist/po.qwik.mjs +2 -7
  182. package/dist/ui/node_modules/.pnpm/@shikijs_langs@4.0.2/node_modules/@shikijs/langs/dist/polar.qwik.mjs +2 -7
  183. package/dist/ui/node_modules/.pnpm/@shikijs_langs@4.0.2/node_modules/@shikijs/langs/dist/postcss.qwik.mjs +2 -7
  184. package/dist/ui/node_modules/.pnpm/@shikijs_langs@4.0.2/node_modules/@shikijs/langs/dist/powerquery.qwik.mjs +2 -7
  185. package/dist/ui/node_modules/.pnpm/@shikijs_langs@4.0.2/node_modules/@shikijs/langs/dist/powershell.qwik.mjs +2 -7
  186. package/dist/ui/node_modules/.pnpm/@shikijs_langs@4.0.2/node_modules/@shikijs/langs/dist/prisma.qwik.mjs +2 -7
  187. package/dist/ui/node_modules/.pnpm/@shikijs_langs@4.0.2/node_modules/@shikijs/langs/dist/prolog.qwik.mjs +2 -7
  188. package/dist/ui/node_modules/.pnpm/@shikijs_langs@4.0.2/node_modules/@shikijs/langs/dist/proto.qwik.mjs +2 -7
  189. package/dist/ui/node_modules/.pnpm/@shikijs_langs@4.0.2/node_modules/@shikijs/langs/dist/pug.qwik.mjs +10 -12
  190. package/dist/ui/node_modules/.pnpm/@shikijs_langs@4.0.2/node_modules/@shikijs/langs/dist/puppet.qwik.mjs +2 -7
  191. package/dist/ui/node_modules/.pnpm/@shikijs_langs@4.0.2/node_modules/@shikijs/langs/dist/purescript.qwik.mjs +2 -7
  192. package/dist/ui/node_modules/.pnpm/@shikijs_langs@4.0.2/node_modules/@shikijs/langs/dist/python.qwik.mjs +2 -7
  193. package/dist/ui/node_modules/.pnpm/@shikijs_langs@4.0.2/node_modules/@shikijs/langs/dist/qml.qwik.mjs +4 -9
  194. package/dist/ui/node_modules/.pnpm/@shikijs_langs@4.0.2/node_modules/@shikijs/langs/dist/qmldir.qwik.mjs +2 -7
  195. package/dist/ui/node_modules/.pnpm/@shikijs_langs@4.0.2/node_modules/@shikijs/langs/dist/qss.qwik.mjs +2 -7
  196. package/dist/ui/node_modules/.pnpm/@shikijs_langs@4.0.2/node_modules/@shikijs/langs/dist/r.qwik.mjs +2 -7
  197. package/dist/ui/node_modules/.pnpm/@shikijs_langs@4.0.2/node_modules/@shikijs/langs/dist/racket.qwik.mjs +2 -7
  198. package/dist/ui/node_modules/.pnpm/@shikijs_langs@4.0.2/node_modules/@shikijs/langs/dist/raku.qwik.mjs +2 -7
  199. package/dist/ui/node_modules/.pnpm/@shikijs_langs@4.0.2/node_modules/@shikijs/langs/dist/razor.qwik.mjs +8 -10
  200. package/dist/ui/node_modules/.pnpm/@shikijs_langs@4.0.2/node_modules/@shikijs/langs/dist/reg.qwik.mjs +2 -7
  201. package/dist/ui/node_modules/.pnpm/@shikijs_langs@4.0.2/node_modules/@shikijs/langs/dist/regexp.qwik.mjs +2 -7
  202. package/dist/ui/node_modules/.pnpm/@shikijs_langs@4.0.2/node_modules/@shikijs/langs/dist/rel.qwik.mjs +2 -7
  203. package/dist/ui/node_modules/.pnpm/@shikijs_langs@4.0.2/node_modules/@shikijs/langs/dist/riscv.qwik.mjs +2 -7
  204. package/dist/ui/node_modules/.pnpm/@shikijs_langs@4.0.2/node_modules/@shikijs/langs/dist/ron.qwik.mjs +2 -7
  205. package/dist/ui/node_modules/.pnpm/@shikijs_langs@4.0.2/node_modules/@shikijs/langs/dist/rosmsg.qwik.mjs +2 -7
  206. package/dist/ui/node_modules/.pnpm/@shikijs_langs@4.0.2/node_modules/@shikijs/langs/dist/rst.qwik.mjs +20 -22
  207. package/dist/ui/node_modules/.pnpm/@shikijs_langs@4.0.2/node_modules/@shikijs/langs/dist/ruby.qwik.mjs +28 -30
  208. package/dist/ui/node_modules/.pnpm/@shikijs_langs@4.0.2/node_modules/@shikijs/langs/dist/rust.qwik.mjs +2 -7
  209. package/dist/ui/node_modules/.pnpm/@shikijs_langs@4.0.2/node_modules/@shikijs/langs/dist/sas.qwik.mjs +4 -9
  210. package/dist/ui/node_modules/.pnpm/@shikijs_langs@4.0.2/node_modules/@shikijs/langs/dist/sass.qwik.mjs +2 -7
  211. package/dist/ui/node_modules/.pnpm/@shikijs_langs@4.0.2/node_modules/@shikijs/langs/dist/scala.qwik.mjs +2 -7
  212. package/dist/ui/node_modules/.pnpm/@shikijs_langs@4.0.2/node_modules/@shikijs/langs/dist/scheme.qwik.mjs +2 -7
  213. package/dist/ui/node_modules/.pnpm/@shikijs_langs@4.0.2/node_modules/@shikijs/langs/dist/scss.qwik.mjs +4 -9
  214. package/dist/ui/node_modules/.pnpm/@shikijs_langs@4.0.2/node_modules/@shikijs/langs/dist/sdbl.qwik.mjs +2 -7
  215. package/dist/ui/node_modules/.pnpm/@shikijs_langs@4.0.2/node_modules/@shikijs/langs/dist/shaderlab.qwik.mjs +4 -9
  216. package/dist/ui/node_modules/.pnpm/@shikijs_langs@4.0.2/node_modules/@shikijs/langs/dist/shellscript.qwik.mjs +2 -7
  217. package/dist/ui/node_modules/.pnpm/@shikijs_langs@4.0.2/node_modules/@shikijs/langs/dist/shellsession.qwik.mjs +4 -9
  218. package/dist/ui/node_modules/.pnpm/@shikijs_langs@4.0.2/node_modules/@shikijs/langs/dist/smalltalk.qwik.mjs +2 -7
  219. package/dist/ui/node_modules/.pnpm/@shikijs_langs@4.0.2/node_modules/@shikijs/langs/dist/solidity.qwik.mjs +2 -7
  220. package/dist/ui/node_modules/.pnpm/@shikijs_langs@4.0.2/node_modules/@shikijs/langs/dist/soy.qwik.mjs +4 -9
  221. package/dist/ui/node_modules/.pnpm/@shikijs_langs@4.0.2/node_modules/@shikijs/langs/dist/sparql.qwik.mjs +4 -9
  222. package/dist/ui/node_modules/.pnpm/@shikijs_langs@4.0.2/node_modules/@shikijs/langs/dist/splunk.qwik.mjs +2 -7
  223. package/dist/ui/node_modules/.pnpm/@shikijs_langs@4.0.2/node_modules/@shikijs/langs/dist/sql.qwik.mjs +2 -7
  224. package/dist/ui/node_modules/.pnpm/@shikijs_langs@4.0.2/node_modules/@shikijs/langs/dist/ssh-config.qwik.mjs +2 -7
  225. package/dist/ui/node_modules/.pnpm/@shikijs_langs@4.0.2/node_modules/@shikijs/langs/dist/stata.qwik.mjs +4 -9
  226. package/dist/ui/node_modules/.pnpm/@shikijs_langs@4.0.2/node_modules/@shikijs/langs/dist/stylus.qwik.mjs +2 -7
  227. package/dist/ui/node_modules/.pnpm/@shikijs_langs@4.0.2/node_modules/@shikijs/langs/dist/surrealql.qwik.mjs +4 -9
  228. package/dist/ui/node_modules/.pnpm/@shikijs_langs@4.0.2/node_modules/@shikijs/langs/dist/svelte.qwik.mjs +12 -14
  229. package/dist/ui/node_modules/.pnpm/@shikijs_langs@4.0.2/node_modules/@shikijs/langs/dist/swift.qwik.mjs +2 -7
  230. package/dist/ui/node_modules/.pnpm/@shikijs_langs@4.0.2/node_modules/@shikijs/langs/dist/system-verilog.qwik.mjs +2 -7
  231. package/dist/ui/node_modules/.pnpm/@shikijs_langs@4.0.2/node_modules/@shikijs/langs/dist/systemd.qwik.mjs +2 -7
  232. package/dist/ui/node_modules/.pnpm/@shikijs_langs@4.0.2/node_modules/@shikijs/langs/dist/talonscript.qwik.mjs +2 -7
  233. package/dist/ui/node_modules/.pnpm/@shikijs_langs@4.0.2/node_modules/@shikijs/langs/dist/tasl.qwik.mjs +2 -7
  234. package/dist/ui/node_modules/.pnpm/@shikijs_langs@4.0.2/node_modules/@shikijs/langs/dist/tcl.qwik.mjs +2 -7
  235. package/dist/ui/node_modules/.pnpm/@shikijs_langs@4.0.2/node_modules/@shikijs/langs/dist/templ.qwik.mjs +10 -12
  236. package/dist/ui/node_modules/.pnpm/@shikijs_langs@4.0.2/node_modules/@shikijs/langs/dist/terraform.qwik.mjs +2 -7
  237. package/dist/ui/node_modules/.pnpm/@shikijs_langs@4.0.2/node_modules/@shikijs/langs/dist/tex.qwik.mjs +4 -9
  238. package/dist/ui/node_modules/.pnpm/@shikijs_langs@4.0.2/node_modules/@shikijs/langs/dist/toml.qwik.mjs +2 -7
  239. package/dist/ui/node_modules/.pnpm/@shikijs_langs@4.0.2/node_modules/@shikijs/langs/dist/ts-tags.qwik.mjs +16 -18
  240. package/dist/ui/node_modules/.pnpm/@shikijs_langs@4.0.2/node_modules/@shikijs/langs/dist/tsv.qwik.mjs +2 -7
  241. package/dist/ui/node_modules/.pnpm/@shikijs_langs@4.0.2/node_modules/@shikijs/langs/dist/tsx.qwik.mjs +2 -7
  242. package/dist/ui/node_modules/.pnpm/@shikijs_langs@4.0.2/node_modules/@shikijs/langs/dist/turtle.qwik.mjs +2 -7
  243. package/dist/ui/node_modules/.pnpm/@shikijs_langs@4.0.2/node_modules/@shikijs/langs/dist/twig.qwik.mjs +16 -18
  244. package/dist/ui/node_modules/.pnpm/@shikijs_langs@4.0.2/node_modules/@shikijs/langs/dist/typescript.qwik.mjs +2 -7
  245. package/dist/ui/node_modules/.pnpm/@shikijs_langs@4.0.2/node_modules/@shikijs/langs/dist/typespec.qwik.mjs +2 -7
  246. package/dist/ui/node_modules/.pnpm/@shikijs_langs@4.0.2/node_modules/@shikijs/langs/dist/typst.qwik.mjs +2 -7
  247. package/dist/ui/node_modules/.pnpm/@shikijs_langs@4.0.2/node_modules/@shikijs/langs/dist/v.qwik.mjs +2 -7
  248. package/dist/ui/node_modules/.pnpm/@shikijs_langs@4.0.2/node_modules/@shikijs/langs/dist/vala.qwik.mjs +2 -7
  249. package/dist/ui/node_modules/.pnpm/@shikijs_langs@4.0.2/node_modules/@shikijs/langs/dist/vb.qwik.mjs +2 -7
  250. package/dist/ui/node_modules/.pnpm/@shikijs_langs@4.0.2/node_modules/@shikijs/langs/dist/verilog.qwik.mjs +2 -7
  251. package/dist/ui/node_modules/.pnpm/@shikijs_langs@4.0.2/node_modules/@shikijs/langs/dist/vhdl.qwik.mjs +2 -7
  252. package/dist/ui/node_modules/.pnpm/@shikijs_langs@4.0.2/node_modules/@shikijs/langs/dist/viml.qwik.mjs +2 -7
  253. package/dist/ui/node_modules/.pnpm/@shikijs_langs@4.0.2/node_modules/@shikijs/langs/dist/vue-directives.qwik.mjs +2 -7
  254. package/dist/ui/node_modules/.pnpm/@shikijs_langs@4.0.2/node_modules/@shikijs/langs/dist/vue-html.qwik.mjs +4 -9
  255. package/dist/ui/node_modules/.pnpm/@shikijs_langs@4.0.2/node_modules/@shikijs/langs/dist/vue-interpolations.qwik.mjs +2 -7
  256. package/dist/ui/node_modules/.pnpm/@shikijs_langs@4.0.2/node_modules/@shikijs/langs/dist/vue-sfc-style-variable-injection.qwik.mjs +4 -9
  257. package/dist/ui/node_modules/.pnpm/@shikijs_langs@4.0.2/node_modules/@shikijs/langs/dist/vue-vine.qwik.mjs +16 -18
  258. package/dist/ui/node_modules/.pnpm/@shikijs_langs@4.0.2/node_modules/@shikijs/langs/dist/vue.qwik.mjs +24 -26
  259. package/dist/ui/node_modules/.pnpm/@shikijs_langs@4.0.2/node_modules/@shikijs/langs/dist/vyper.qwik.mjs +2 -7
  260. package/dist/ui/node_modules/.pnpm/@shikijs_langs@4.0.2/node_modules/@shikijs/langs/dist/wasm.qwik.mjs +2 -7
  261. package/dist/ui/node_modules/.pnpm/@shikijs_langs@4.0.2/node_modules/@shikijs/langs/dist/wenyan.qwik.mjs +2 -7
  262. package/dist/ui/node_modules/.pnpm/@shikijs_langs@4.0.2/node_modules/@shikijs/langs/dist/wgsl.qwik.mjs +2 -7
  263. package/dist/ui/node_modules/.pnpm/@shikijs_langs@4.0.2/node_modules/@shikijs/langs/dist/wikitext.qwik.mjs +2 -7
  264. package/dist/ui/node_modules/.pnpm/@shikijs_langs@4.0.2/node_modules/@shikijs/langs/dist/wit.qwik.mjs +2 -7
  265. package/dist/ui/node_modules/.pnpm/@shikijs_langs@4.0.2/node_modules/@shikijs/langs/dist/wolfram.qwik.mjs +2 -7
  266. package/dist/ui/node_modules/.pnpm/@shikijs_langs@4.0.2/node_modules/@shikijs/langs/dist/xml.qwik.mjs +4 -9
  267. package/dist/ui/node_modules/.pnpm/@shikijs_langs@4.0.2/node_modules/@shikijs/langs/dist/xsl.qwik.mjs +4 -9
  268. package/dist/ui/node_modules/.pnpm/@shikijs_langs@4.0.2/node_modules/@shikijs/langs/dist/yaml.qwik.mjs +2 -7
  269. package/dist/ui/node_modules/.pnpm/@shikijs_langs@4.0.2/node_modules/@shikijs/langs/dist/zenscript.qwik.mjs +2 -7
  270. package/dist/ui/node_modules/.pnpm/@shikijs_langs@4.0.2/node_modules/@shikijs/langs/dist/zig.qwik.mjs +2 -7
  271. package/dist/ui/node_modules/.pnpm/@shikijs_primitive@4.0.2/node_modules/@shikijs/primitive/dist/index.qwik.mjs +728 -661
  272. package/dist/ui/node_modules/.pnpm/@shikijs_themes@4.0.2/node_modules/@shikijs/themes/dist/andromeeda.qwik.mjs +2 -4
  273. package/dist/ui/node_modules/.pnpm/@shikijs_themes@4.0.2/node_modules/@shikijs/themes/dist/aurora-x.qwik.mjs +2 -4
  274. package/dist/ui/node_modules/.pnpm/@shikijs_themes@4.0.2/node_modules/@shikijs/themes/dist/ayu-dark.qwik.mjs +2 -4
  275. package/dist/ui/node_modules/.pnpm/@shikijs_themes@4.0.2/node_modules/@shikijs/themes/dist/ayu-light.qwik.mjs +2 -4
  276. package/dist/ui/node_modules/.pnpm/@shikijs_themes@4.0.2/node_modules/@shikijs/themes/dist/ayu-mirage.qwik.mjs +2 -4
  277. package/dist/ui/node_modules/.pnpm/@shikijs_themes@4.0.2/node_modules/@shikijs/themes/dist/catppuccin-frappe.qwik.mjs +2 -4
  278. package/dist/ui/node_modules/.pnpm/@shikijs_themes@4.0.2/node_modules/@shikijs/themes/dist/catppuccin-latte.qwik.mjs +2 -4
  279. package/dist/ui/node_modules/.pnpm/@shikijs_themes@4.0.2/node_modules/@shikijs/themes/dist/catppuccin-macchiato.qwik.mjs +2 -4
  280. package/dist/ui/node_modules/.pnpm/@shikijs_themes@4.0.2/node_modules/@shikijs/themes/dist/catppuccin-mocha.qwik.mjs +2 -4
  281. package/dist/ui/node_modules/.pnpm/@shikijs_themes@4.0.2/node_modules/@shikijs/themes/dist/dark-plus.qwik.mjs +2 -4
  282. package/dist/ui/node_modules/.pnpm/@shikijs_themes@4.0.2/node_modules/@shikijs/themes/dist/dracula-soft.qwik.mjs +2 -4
  283. package/dist/ui/node_modules/.pnpm/@shikijs_themes@4.0.2/node_modules/@shikijs/themes/dist/dracula.qwik.mjs +2 -4
  284. package/dist/ui/node_modules/.pnpm/@shikijs_themes@4.0.2/node_modules/@shikijs/themes/dist/everforest-dark.qwik.mjs +2 -4
  285. package/dist/ui/node_modules/.pnpm/@shikijs_themes@4.0.2/node_modules/@shikijs/themes/dist/everforest-light.qwik.mjs +2 -4
  286. package/dist/ui/node_modules/.pnpm/@shikijs_themes@4.0.2/node_modules/@shikijs/themes/dist/github-dark-default.qwik.mjs +2 -4
  287. package/dist/ui/node_modules/.pnpm/@shikijs_themes@4.0.2/node_modules/@shikijs/themes/dist/github-dark-dimmed.qwik.mjs +2 -4
  288. package/dist/ui/node_modules/.pnpm/@shikijs_themes@4.0.2/node_modules/@shikijs/themes/dist/github-dark-high-contrast.qwik.mjs +2 -4
  289. package/dist/ui/node_modules/.pnpm/@shikijs_themes@4.0.2/node_modules/@shikijs/themes/dist/github-dark.qwik.mjs +2 -4
  290. package/dist/ui/node_modules/.pnpm/@shikijs_themes@4.0.2/node_modules/@shikijs/themes/dist/github-light-default.qwik.mjs +2 -4
  291. package/dist/ui/node_modules/.pnpm/@shikijs_themes@4.0.2/node_modules/@shikijs/themes/dist/github-light-high-contrast.qwik.mjs +2 -4
  292. package/dist/ui/node_modules/.pnpm/@shikijs_themes@4.0.2/node_modules/@shikijs/themes/dist/github-light.qwik.mjs +2 -4
  293. package/dist/ui/node_modules/.pnpm/@shikijs_themes@4.0.2/node_modules/@shikijs/themes/dist/gruvbox-dark-hard.qwik.mjs +2 -4
  294. package/dist/ui/node_modules/.pnpm/@shikijs_themes@4.0.2/node_modules/@shikijs/themes/dist/gruvbox-dark-medium.qwik.mjs +2 -4
  295. package/dist/ui/node_modules/.pnpm/@shikijs_themes@4.0.2/node_modules/@shikijs/themes/dist/gruvbox-dark-soft.qwik.mjs +2 -4
  296. package/dist/ui/node_modules/.pnpm/@shikijs_themes@4.0.2/node_modules/@shikijs/themes/dist/gruvbox-light-hard.qwik.mjs +2 -4
  297. package/dist/ui/node_modules/.pnpm/@shikijs_themes@4.0.2/node_modules/@shikijs/themes/dist/gruvbox-light-medium.qwik.mjs +2 -4
  298. package/dist/ui/node_modules/.pnpm/@shikijs_themes@4.0.2/node_modules/@shikijs/themes/dist/gruvbox-light-soft.qwik.mjs +2 -4
  299. package/dist/ui/node_modules/.pnpm/@shikijs_themes@4.0.2/node_modules/@shikijs/themes/dist/horizon-bright.qwik.mjs +2 -4
  300. package/dist/ui/node_modules/.pnpm/@shikijs_themes@4.0.2/node_modules/@shikijs/themes/dist/horizon.qwik.mjs +2 -4
  301. package/dist/ui/node_modules/.pnpm/@shikijs_themes@4.0.2/node_modules/@shikijs/themes/dist/houston.qwik.mjs +2 -4
  302. package/dist/ui/node_modules/.pnpm/@shikijs_themes@4.0.2/node_modules/@shikijs/themes/dist/kanagawa-dragon.qwik.mjs +2 -4
  303. package/dist/ui/node_modules/.pnpm/@shikijs_themes@4.0.2/node_modules/@shikijs/themes/dist/kanagawa-lotus.qwik.mjs +2 -4
  304. package/dist/ui/node_modules/.pnpm/@shikijs_themes@4.0.2/node_modules/@shikijs/themes/dist/kanagawa-wave.qwik.mjs +2 -4
  305. package/dist/ui/node_modules/.pnpm/@shikijs_themes@4.0.2/node_modules/@shikijs/themes/dist/laserwave.qwik.mjs +2 -4
  306. package/dist/ui/node_modules/.pnpm/@shikijs_themes@4.0.2/node_modules/@shikijs/themes/dist/light-plus.qwik.mjs +2 -4
  307. package/dist/ui/node_modules/.pnpm/@shikijs_themes@4.0.2/node_modules/@shikijs/themes/dist/material-theme-darker.qwik.mjs +2 -4
  308. package/dist/ui/node_modules/.pnpm/@shikijs_themes@4.0.2/node_modules/@shikijs/themes/dist/material-theme-lighter.qwik.mjs +2 -4
  309. package/dist/ui/node_modules/.pnpm/@shikijs_themes@4.0.2/node_modules/@shikijs/themes/dist/material-theme-ocean.qwik.mjs +2 -4
  310. package/dist/ui/node_modules/.pnpm/@shikijs_themes@4.0.2/node_modules/@shikijs/themes/dist/material-theme-palenight.qwik.mjs +2 -4
  311. package/dist/ui/node_modules/.pnpm/@shikijs_themes@4.0.2/node_modules/@shikijs/themes/dist/material-theme.qwik.mjs +2 -4
  312. package/dist/ui/node_modules/.pnpm/@shikijs_themes@4.0.2/node_modules/@shikijs/themes/dist/min-dark.qwik.mjs +2 -4
  313. package/dist/ui/node_modules/.pnpm/@shikijs_themes@4.0.2/node_modules/@shikijs/themes/dist/min-light.qwik.mjs +2 -4
  314. package/dist/ui/node_modules/.pnpm/@shikijs_themes@4.0.2/node_modules/@shikijs/themes/dist/monokai.qwik.mjs +2 -4
  315. package/dist/ui/node_modules/.pnpm/@shikijs_themes@4.0.2/node_modules/@shikijs/themes/dist/night-owl-light.qwik.mjs +2 -4
  316. package/dist/ui/node_modules/.pnpm/@shikijs_themes@4.0.2/node_modules/@shikijs/themes/dist/night-owl.qwik.mjs +2 -4
  317. package/dist/ui/node_modules/.pnpm/@shikijs_themes@4.0.2/node_modules/@shikijs/themes/dist/nord.qwik.mjs +2 -4
  318. package/dist/ui/node_modules/.pnpm/@shikijs_themes@4.0.2/node_modules/@shikijs/themes/dist/one-dark-pro.qwik.mjs +2 -4
  319. package/dist/ui/node_modules/.pnpm/@shikijs_themes@4.0.2/node_modules/@shikijs/themes/dist/one-light.qwik.mjs +2 -4
  320. package/dist/ui/node_modules/.pnpm/@shikijs_themes@4.0.2/node_modules/@shikijs/themes/dist/plastic.qwik.mjs +2 -4
  321. package/dist/ui/node_modules/.pnpm/@shikijs_themes@4.0.2/node_modules/@shikijs/themes/dist/poimandres.qwik.mjs +2 -4
  322. package/dist/ui/node_modules/.pnpm/@shikijs_themes@4.0.2/node_modules/@shikijs/themes/dist/red.qwik.mjs +2 -4
  323. package/dist/ui/node_modules/.pnpm/@shikijs_themes@4.0.2/node_modules/@shikijs/themes/dist/rose-pine-dawn.qwik.mjs +2 -4
  324. package/dist/ui/node_modules/.pnpm/@shikijs_themes@4.0.2/node_modules/@shikijs/themes/dist/rose-pine-moon.qwik.mjs +2 -4
  325. package/dist/ui/node_modules/.pnpm/@shikijs_themes@4.0.2/node_modules/@shikijs/themes/dist/rose-pine.qwik.mjs +2 -4
  326. package/dist/ui/node_modules/.pnpm/@shikijs_themes@4.0.2/node_modules/@shikijs/themes/dist/slack-dark.qwik.mjs +2 -4
  327. package/dist/ui/node_modules/.pnpm/@shikijs_themes@4.0.2/node_modules/@shikijs/themes/dist/slack-ochin.qwik.mjs +2 -4
  328. package/dist/ui/node_modules/.pnpm/@shikijs_themes@4.0.2/node_modules/@shikijs/themes/dist/snazzy-light.qwik.mjs +2 -4
  329. package/dist/ui/node_modules/.pnpm/@shikijs_themes@4.0.2/node_modules/@shikijs/themes/dist/solarized-dark.qwik.mjs +2 -4
  330. package/dist/ui/node_modules/.pnpm/@shikijs_themes@4.0.2/node_modules/@shikijs/themes/dist/solarized-light.qwik.mjs +2 -4
  331. package/dist/ui/node_modules/.pnpm/@shikijs_themes@4.0.2/node_modules/@shikijs/themes/dist/synthwave-84.qwik.mjs +2 -4
  332. package/dist/ui/node_modules/.pnpm/@shikijs_themes@4.0.2/node_modules/@shikijs/themes/dist/tokyo-night.qwik.mjs +2 -4
  333. package/dist/ui/node_modules/.pnpm/@shikijs_themes@4.0.2/node_modules/@shikijs/themes/dist/vesper.qwik.mjs +2 -4
  334. package/dist/ui/node_modules/.pnpm/@shikijs_themes@4.0.2/node_modules/@shikijs/themes/dist/vitesse-black.qwik.mjs +2 -4
  335. package/dist/ui/node_modules/.pnpm/@shikijs_themes@4.0.2/node_modules/@shikijs/themes/dist/vitesse-dark.qwik.mjs +2 -4
  336. package/dist/ui/node_modules/.pnpm/@shikijs_themes@4.0.2/node_modules/@shikijs/themes/dist/vitesse-light.qwik.mjs +2 -4
  337. package/dist/ui/node_modules/.pnpm/@shikijs_types@4.0.2/node_modules/@shikijs/types/dist/index.qwik.mjs +5 -7
  338. package/dist/ui/node_modules/.pnpm/@shikijs_vscode-textmate@10.0.2/node_modules/@shikijs/vscode-textmate/dist/index.qwik.mjs +2183 -2953
  339. package/dist/ui/node_modules/.pnpm/ccount@2.0.1/node_modules/ccount/index.qwik.mjs +20 -14
  340. package/dist/ui/node_modules/.pnpm/character-entities-html4@2.1.0/node_modules/character-entities-html4/index.qwik.mjs +259 -256
  341. package/dist/ui/node_modules/.pnpm/character-entities-legacy@3.0.0/node_modules/character-entities-legacy/index.qwik.mjs +113 -110
  342. package/dist/ui/node_modules/.pnpm/comma-separated-tokens@2.0.3/node_modules/comma-separated-tokens/index.qwik.mjs +13 -8
  343. package/dist/ui/node_modules/.pnpm/debug@4.4.3_supports-color@11.0.0/node_modules/debug/src/browser.qwik.mjs +198 -0
  344. package/dist/ui/node_modules/.pnpm/debug@4.4.3_supports-color@11.0.0/node_modules/debug/src/common.qwik.mjs +205 -0
  345. package/dist/ui/node_modules/.pnpm/hast-util-to-html@9.0.5/node_modules/hast-util-to-html/lib/handle/comment.qwik.mjs +29 -20
  346. package/dist/ui/node_modules/.pnpm/hast-util-to-html@9.0.5/node_modules/hast-util-to-html/lib/handle/doctype.qwik.mjs +20 -4
  347. package/dist/ui/node_modules/.pnpm/hast-util-to-html@9.0.5/node_modules/hast-util-to-html/lib/handle/element.qwik.mjs +112 -124
  348. package/dist/ui/node_modules/.pnpm/hast-util-to-html@9.0.5/node_modules/hast-util-to-html/lib/handle/index.qwik.mjs +38 -14
  349. package/dist/ui/node_modules/.pnpm/hast-util-to-html@9.0.5/node_modules/hast-util-to-html/lib/handle/raw.qwik.mjs +21 -4
  350. package/dist/ui/node_modules/.pnpm/hast-util-to-html@9.0.5/node_modules/hast-util-to-html/lib/handle/root.qwik.mjs +20 -4
  351. package/dist/ui/node_modules/.pnpm/hast-util-to-html@9.0.5/node_modules/hast-util-to-html/lib/handle/text.qwik.mjs +22 -10
  352. package/dist/ui/node_modules/.pnpm/hast-util-to-html@9.0.5/node_modules/hast-util-to-html/lib/index.qwik.mjs +229 -53
  353. package/dist/ui/node_modules/.pnpm/hast-util-to-html@9.0.5/node_modules/hast-util-to-html/lib/omission/closing.qwik.mjs +234 -58
  354. package/dist/ui/node_modules/.pnpm/hast-util-to-html@9.0.5/node_modules/hast-util-to-html/lib/omission/omission.qwik.mjs +36 -8
  355. package/dist/ui/node_modules/.pnpm/hast-util-to-html@9.0.5/node_modules/hast-util-to-html/lib/omission/opening.qwik.mjs +83 -36
  356. package/dist/ui/node_modules/.pnpm/hast-util-to-html@9.0.5/node_modules/hast-util-to-html/lib/omission/util/siblings.qwik.mjs +38 -20
  357. package/dist/ui/node_modules/.pnpm/hast-util-whitespace@3.0.0/node_modules/hast-util-whitespace/lib/index.qwik.mjs +22 -6
  358. package/dist/ui/node_modules/.pnpm/html-void-elements@3.0.0/node_modules/html-void-elements/index.qwik.mjs +27 -24
  359. package/dist/ui/node_modules/.pnpm/ms@2.1.3/node_modules/ms/index.qwik.mjs +119 -120
  360. package/dist/ui/node_modules/.pnpm/{property-information@7.1.0 → property-information@7.2.0}/node_modules/property-information/index.qwik.mjs +17 -6
  361. package/dist/ui/node_modules/.pnpm/property-information@7.2.0/node_modules/property-information/lib/aria.qwik.mjs +59 -0
  362. package/dist/ui/node_modules/.pnpm/property-information@7.2.0/node_modules/property-information/lib/find.qwik.mjs +79 -0
  363. package/dist/ui/node_modules/.pnpm/property-information@7.2.0/node_modules/property-information/lib/html.qwik.mjs +324 -0
  364. package/dist/ui/node_modules/.pnpm/property-information@7.2.0/node_modules/property-information/lib/normalize.qwik.mjs +13 -0
  365. package/dist/ui/node_modules/.pnpm/property-information@7.2.0/node_modules/property-information/lib/svg.qwik.mjs +562 -0
  366. package/dist/ui/node_modules/.pnpm/property-information@7.2.0/node_modules/property-information/lib/util/case-insensitive-transform.qwik.mjs +13 -0
  367. package/dist/ui/node_modules/.pnpm/property-information@7.2.0/node_modules/property-information/lib/util/case-sensitive-transform.qwik.mjs +12 -0
  368. package/dist/ui/node_modules/.pnpm/property-information@7.2.0/node_modules/property-information/lib/util/create.qwik.mjs +51 -0
  369. package/dist/ui/node_modules/.pnpm/property-information@7.2.0/node_modules/property-information/lib/util/defined-info.qwik.mjs +47 -0
  370. package/dist/ui/node_modules/.pnpm/{property-information@7.1.0 → property-information@7.2.0}/node_modules/property-information/lib/util/info.qwik.mjs +19 -17
  371. package/dist/ui/node_modules/.pnpm/property-information@7.2.0/node_modules/property-information/lib/util/merge.qwik.mjs +24 -0
  372. package/dist/ui/node_modules/.pnpm/property-information@7.2.0/node_modules/property-information/lib/util/schema.qwik.mjs +25 -0
  373. package/dist/ui/node_modules/.pnpm/property-information@7.2.0/node_modules/property-information/lib/util/types.qwik.mjs +22 -0
  374. package/dist/ui/node_modules/.pnpm/property-information@7.2.0/node_modules/property-information/lib/xlink.qwik.mjs +17 -0
  375. package/dist/ui/node_modules/.pnpm/property-information@7.2.0/node_modules/property-information/lib/xml.qwik.mjs +13 -0
  376. package/dist/ui/node_modules/.pnpm/property-information@7.2.0/node_modules/property-information/lib/xmlns.qwik.mjs +12 -0
  377. package/dist/ui/node_modules/.pnpm/shiki@4.0.2/node_modules/shiki/dist/bundle-full.qwik.mjs +21 -59
  378. package/dist/ui/node_modules/.pnpm/shiki@4.0.2/node_modules/shiki/dist/chunk-CtajNgzt.qwik.mjs +17 -28
  379. package/dist/ui/node_modules/.pnpm/shiki@4.0.2/node_modules/shiki/dist/engine-oniguruma.qwik.mjs +4 -11
  380. package/dist/ui/node_modules/.pnpm/shiki@4.0.2/node_modules/shiki/dist/langs-bundle-full-DfKZStlK.qwik.mjs +1279 -1284
  381. package/dist/ui/node_modules/.pnpm/shiki@4.0.2/node_modules/shiki/dist/themes.qwik.mjs +393 -396
  382. package/dist/ui/node_modules/.pnpm/shiki@4.0.2/node_modules/shiki/dist/wasm.qwik.mjs +2 -6
  383. package/dist/ui/node_modules/.pnpm/space-separated-tokens@2.0.2/node_modules/space-separated-tokens/index.qwik.mjs +10 -4
  384. package/dist/ui/node_modules/.pnpm/stringify-entities@4.0.4/node_modules/stringify-entities/lib/constant/dangerous.qwik.mjs +16 -12
  385. package/dist/ui/node_modules/.pnpm/stringify-entities@4.0.4/node_modules/stringify-entities/lib/core.qwik.mjs +70 -45
  386. package/dist/ui/node_modules/.pnpm/stringify-entities@4.0.4/node_modules/stringify-entities/lib/index.qwik.mjs +16 -4
  387. package/dist/ui/node_modules/.pnpm/stringify-entities@4.0.4/node_modules/stringify-entities/lib/util/format-smart.qwik.mjs +34 -20
  388. package/dist/ui/node_modules/.pnpm/stringify-entities@4.0.4/node_modules/stringify-entities/lib/util/to-decimal.qwik.mjs +12 -6
  389. package/dist/ui/node_modules/.pnpm/stringify-entities@4.0.4/node_modules/stringify-entities/lib/util/to-hexadecimal.qwik.mjs +12 -6
  390. package/dist/ui/node_modules/.pnpm/stringify-entities@4.0.4/node_modules/stringify-entities/lib/util/to-named.qwik.mjs +29 -22
  391. package/dist/ui/node_modules/.pnpm/vite-hot-client@2.2.0_vite@8.2.1_@types_node@25.6.0_esbuild@0.28.2_jiti@2.7.0_terser@5.46.0_tsx@4.21.0_yaml@2.9.0_/node_modules/vite-hot-client/dist/index.qwik.mjs +25 -0
  392. package/dist/ui/node_modules/.pnpm/zwitch@2.0.4/node_modules/zwitch/index.qwik.mjs +102 -20
  393. package/dist/ui/packages/devtools/kit/src/overlay-paths.qwik.mjs +12 -21
  394. package/dist/ui/packages/devtools/ui/src/components/DevtoolsButton/DevtoolsButton.qwik.mjs +120 -140
  395. package/dist/ui/packages/devtools/ui/src/components/DevtoolsContainer/DevtoolsContainer.qwik.mjs +7 -12
  396. package/dist/ui/packages/devtools/ui/src/components/DevtoolsPanel/DevtoolsPanel.qwik.mjs +373 -470
  397. package/dist/ui/packages/devtools/ui/src/components/IconButton/IconButton.qwik.mjs +14 -15
  398. package/dist/ui/packages/devtools/ui/src/components/Icons/Icons.qwik.mjs +595 -635
  399. package/dist/ui/packages/devtools/ui/src/components/InfoBanner/InfoBanner.qwik.mjs +10 -23
  400. package/dist/ui/packages/devtools/ui/src/components/Tab/Tab.qwik.mjs +12 -20
  401. package/dist/ui/packages/devtools/ui/src/components/TabContent/TabContent.qwik.mjs +7 -20
  402. package/dist/ui/packages/devtools/ui/src/components/TabTitle/TabTitle.qwik.mjs +4 -8
  403. package/dist/ui/packages/devtools/ui/src/components/ThemeToggle/QwikThemeToggle.qwik.mjs +31 -53
  404. package/dist/ui/packages/devtools/ui/src/components/ThemeToggle/theme-script.qwik.mjs +5 -9
  405. package/dist/ui/packages/devtools/ui/src/components/Tree/Tree.qwik.mjs +154 -227
  406. package/dist/ui/packages/devtools/ui/src/components/router-head/theme-script.qwik.mjs +2 -4
  407. package/dist/ui/packages/devtools/ui/src/devtools/CommandPalette.qwik.mjs +202 -278
  408. package/dist/ui/packages/devtools/ui/src/devtools/CustomizeTabsPanel.qwik.mjs +123 -199
  409. package/dist/ui/packages/devtools/ui/src/devtools/DevtoolsContent.qwik.mjs +85 -193
  410. package/dist/ui/packages/devtools/ui/src/devtools/DevtoolsSidebar.qwik.mjs +52 -102
  411. package/dist/ui/packages/devtools/ui/src/devtools/QwikDevtools.qwik.mjs +47 -94
  412. package/dist/ui/packages/devtools/ui/src/devtools/QwikDevtoolsExtension.qwik.mjs +27 -31
  413. package/dist/ui/packages/devtools/ui/src/devtools/command-palette.qwik.mjs +143 -162
  414. package/dist/ui/packages/devtools/ui/src/devtools/page-data-source.qwik.mjs +59 -58
  415. package/dist/ui/packages/devtools/ui/src/devtools/rpc.qwik.mjs +62 -80
  416. package/dist/ui/packages/devtools/ui/src/devtools/sidebar-tabs.qwik.mjs +63 -76
  417. package/dist/ui/packages/devtools/ui/src/devtools/state.qwik.mjs +25 -27
  418. package/dist/ui/packages/devtools/ui/src/devtools/tabs.qwik.mjs +58 -80
  419. package/dist/ui/packages/devtools/ui/src/features/Assets/Assets.qwik.mjs +15 -49
  420. package/dist/ui/packages/devtools/ui/src/features/BuildAnalysis/BuildAnalysis.qwik.mjs +120 -181
  421. package/dist/ui/packages/devtools/ui/src/features/CodeBreak/CodeBreak.qwik.mjs +24 -37
  422. package/dist/ui/packages/devtools/ui/src/features/CodeBreak/HtmlParser.qwik.mjs +84 -145
  423. package/dist/ui/packages/devtools/ui/src/features/CodeBreak/StateParser.qwik.mjs +110 -177
  424. package/dist/ui/packages/devtools/ui/src/features/HookTree/HookTree.qwik.mjs +528 -700
  425. package/dist/ui/packages/devtools/ui/src/features/HookTree/hookTreeHelpers.qwik.mjs +122 -164
  426. package/dist/ui/packages/devtools/ui/src/features/Inspect/Inspect.qwik.mjs +24 -27
  427. package/dist/ui/packages/devtools/ui/src/features/Inspect/constant.qwik.mjs +2 -4
  428. package/dist/ui/packages/devtools/ui/src/features/Inspect/iframe-theme.qwik.mjs +37 -46
  429. package/dist/ui/packages/devtools/ui/src/features/Overview/Overview.qwik.mjs +48 -197
  430. package/dist/ui/packages/devtools/ui/src/features/Packages/Packages.qwik.mjs +247 -289
  431. package/dist/ui/packages/devtools/ui/src/features/Packages/components/DependencyCard/DependencyCard.qwik.mjs +121 -215
  432. package/dist/ui/packages/devtools/ui/src/features/Packages/components/DependencyCard/index.qwik.mjs +2 -0
  433. package/dist/ui/packages/devtools/ui/src/features/Packages/components/DependencyOperationFeedback/DependencyOperationFeedback.qwik.mjs +14 -38
  434. package/dist/ui/packages/devtools/ui/src/features/Packages/components/DependencyOperationFeedback/index.qwik.mjs +2 -0
  435. package/dist/ui/packages/devtools/ui/src/features/Packages/components/DependencyToolbar/DependencyToolbar.qwik.mjs +42 -74
  436. package/dist/ui/packages/devtools/ui/src/features/Packages/components/DependencyToolbar/index.qwik.mjs +2 -0
  437. package/dist/ui/packages/devtools/ui/src/features/Packages/components/InstalledDependencyList/InstalledDependencyList.qwik.mjs +19 -56
  438. package/dist/ui/packages/devtools/ui/src/features/Packages/components/InstalledDependencyList/index.qwik.mjs +2 -0
  439. package/dist/ui/packages/devtools/ui/src/features/Packages/components/PackageIcon/PackageIcon.qwik.mjs +20 -28
  440. package/dist/ui/packages/devtools/ui/src/features/Packages/components/PackageIcon/index.qwik.mjs +2 -0
  441. package/dist/ui/packages/devtools/ui/src/features/Packages/components/PackageSearchResults/PackageSearchResults.qwik.mjs +23 -49
  442. package/dist/ui/packages/devtools/ui/src/features/Packages/components/PackageSearchResults/index.qwik.mjs +2 -0
  443. package/dist/ui/packages/devtools/ui/src/features/Packages/components/SearchResultCard/SearchResultCard.qwik.mjs +42 -96
  444. package/dist/ui/packages/devtools/ui/src/features/Packages/components/SearchResultCard/index.qwik.mjs +2 -0
  445. package/dist/ui/packages/devtools/ui/src/features/Packages/package-utils.qwik.mjs +41 -67
  446. package/dist/ui/packages/devtools/ui/src/features/Performance/Performance.qwik.mjs +110 -249
  447. package/dist/ui/packages/devtools/ui/src/features/Performance/components/ComponentCard.qwik.mjs +11 -47
  448. package/dist/ui/packages/devtools/ui/src/features/Performance/components/HookDetailsPanel.qwik.mjs +32 -92
  449. package/dist/ui/packages/devtools/ui/src/features/Performance/components/PerformanceOverview.qwik.mjs +15 -33
  450. package/dist/ui/packages/devtools/ui/src/features/Performance/components/StatCard.qwik.mjs +8 -20
  451. package/dist/ui/packages/devtools/ui/src/features/Performance/computePerfViewModel.qwik.mjs +96 -103
  452. package/dist/ui/packages/devtools/ui/src/features/Performance/transformPerformanceData.qwik.mjs +19 -32
  453. package/dist/ui/packages/devtools/ui/src/features/Performance/utils/formatMs.qwik.mjs +5 -13
  454. package/dist/ui/packages/devtools/ui/src/features/Preloads/Preloads.qwik.mjs +275 -471
  455. package/dist/ui/packages/devtools/ui/src/features/Preloads/computePreloadViewModel.qwik.mjs +120 -158
  456. package/dist/ui/packages/devtools/ui/src/features/RenderTree/RenderTree.qwik.mjs +192 -265
  457. package/dist/ui/packages/devtools/ui/src/features/RenderTree/components/HighlightedCodeList.qwik.mjs +6 -21
  458. package/dist/ui/packages/devtools/ui/src/features/RenderTree/components/HookFiltersCard.qwik.mjs +29 -77
  459. package/dist/ui/packages/devtools/ui/src/features/RenderTree/components/RenderTreeTabs.qwik.mjs +11 -24
  460. package/dist/ui/packages/devtools/ui/src/features/RenderTree/components/StateTreeNodeLabel.qwik.mjs +19 -30
  461. package/dist/ui/packages/devtools/ui/src/features/RenderTree/utils/getCodeLanguage.qwik.mjs +6 -16
  462. package/dist/ui/packages/devtools/ui/src/features/RenderTree/utils/getValueColorClass.qwik.mjs +10 -19
  463. package/dist/ui/packages/devtools/ui/src/features/Routes/Routes.qwik.mjs +31 -50
  464. package/dist/ui/packages/devtools/ui/src/runtime/preloads.qwik.mjs +596 -796
  465. package/dist/ui/packages/devtools/ui/src/utils/shiki.qwik.mjs +15 -22
  466. package/dist/ui/q-manifest.json +1105 -1128
  467. package/dist/ui/styles.css +1 -0
  468. package/package.json +12 -11
  469. package/dist/ui/_virtual/_commonjsHelpers.qwik.mjs +0 -6
  470. package/dist/ui/_virtual/browser.qwik.mjs +0 -7
  471. package/dist/ui/_virtual/browser.qwik2.mjs +0 -4
  472. package/dist/ui/bundle-graph-eeik1E53.json +0 -1
  473. package/dist/ui/node_modules/.pnpm/@shikijs_engine-javascript@4.0.2/node_modules/@shikijs/engine-javascript/dist/engine-compile.qwik.mjs +0 -36
  474. package/dist/ui/node_modules/.pnpm/@shikijs_engine-javascript@4.0.2/node_modules/@shikijs/engine-javascript/dist/scanner-BFcBmQR1.qwik.mjs +0 -78
  475. package/dist/ui/node_modules/.pnpm/debug@4.4.3_supports-color@10.2.2/node_modules/debug/src/browser.qwik.mjs +0 -177
  476. package/dist/ui/node_modules/.pnpm/debug@4.4.3_supports-color@10.2.2/node_modules/debug/src/common.qwik.mjs +0 -182
  477. package/dist/ui/node_modules/.pnpm/oniguruma-parser@0.12.1/node_modules/oniguruma-parser/dist/parser/node-utils.qwik.mjs +0 -14
  478. package/dist/ui/node_modules/.pnpm/oniguruma-parser@0.12.1/node_modules/oniguruma-parser/dist/parser/parse.qwik.mjs +0 -297
  479. package/dist/ui/node_modules/.pnpm/oniguruma-parser@0.12.1/node_modules/oniguruma-parser/dist/tokenizer/tokenize.qwik.mjs +0 -355
  480. package/dist/ui/node_modules/.pnpm/oniguruma-parser@0.12.1/node_modules/oniguruma-parser/dist/traverser/traverse.qwik.mjs +0 -79
  481. package/dist/ui/node_modules/.pnpm/oniguruma-parser@0.12.1/node_modules/oniguruma-parser/dist/utils.qwik.mjs +0 -19
  482. package/dist/ui/node_modules/.pnpm/oniguruma-to-es@4.3.5/node_modules/oniguruma-to-es/dist/esm/index.qwik.mjs +0 -1878
  483. package/dist/ui/node_modules/.pnpm/property-information@7.1.0/node_modules/property-information/lib/aria.qwik.mjs +0 -61
  484. package/dist/ui/node_modules/.pnpm/property-information@7.1.0/node_modules/property-information/lib/find.qwik.mjs +0 -40
  485. package/dist/ui/node_modules/.pnpm/property-information@7.1.0/node_modules/property-information/lib/html.qwik.mjs +0 -368
  486. package/dist/ui/node_modules/.pnpm/property-information@7.1.0/node_modules/property-information/lib/normalize.qwik.mjs +0 -6
  487. package/dist/ui/node_modules/.pnpm/property-information@7.1.0/node_modules/property-information/lib/svg.qwik.mjs +0 -566
  488. package/dist/ui/node_modules/.pnpm/property-information@7.1.0/node_modules/property-information/lib/util/case-insensitive-transform.qwik.mjs +0 -7
  489. package/dist/ui/node_modules/.pnpm/property-information@7.1.0/node_modules/property-information/lib/util/case-sensitive-transform.qwik.mjs +0 -6
  490. package/dist/ui/node_modules/.pnpm/property-information@7.1.0/node_modules/property-information/lib/util/create.qwik.mjs +0 -25
  491. package/dist/ui/node_modules/.pnpm/property-information@7.1.0/node_modules/property-information/lib/util/defined-info.qwik.mjs +0 -41
  492. package/dist/ui/node_modules/.pnpm/property-information@7.1.0/node_modules/property-information/lib/util/merge.qwik.mjs +0 -13
  493. package/dist/ui/node_modules/.pnpm/property-information@7.1.0/node_modules/property-information/lib/util/schema.qwik.mjs +0 -25
  494. package/dist/ui/node_modules/.pnpm/property-information@7.1.0/node_modules/property-information/lib/util/types.qwik.mjs +0 -20
  495. package/dist/ui/node_modules/.pnpm/property-information@7.1.0/node_modules/property-information/lib/xlink.qwik.mjs +0 -19
  496. package/dist/ui/node_modules/.pnpm/property-information@7.1.0/node_modules/property-information/lib/xml.qwik.mjs +0 -11
  497. package/dist/ui/node_modules/.pnpm/property-information@7.1.0/node_modules/property-information/lib/xmlns.qwik.mjs +0 -11
  498. package/dist/ui/node_modules/.pnpm/regex-recursion@6.0.2/node_modules/regex-recursion/src/index.qwik.mjs +0 -250
  499. package/dist/ui/node_modules/.pnpm/regex-utilities@2.3.0/node_modules/regex-utilities/src/index.qwik.mjs +0 -98
  500. package/dist/ui/node_modules/.pnpm/regex@6.1.0/node_modules/regex/src/atomic.qwik.mjs +0 -174
  501. package/dist/ui/node_modules/.pnpm/regex@6.1.0/node_modules/regex/src/utils-internals.qwik.mjs +0 -16
  502. package/dist/ui/node_modules/.pnpm/shiki@4.0.2/node_modules/shiki/dist/index.qwik.mjs +0 -47
  503. package/dist/ui/node_modules/.pnpm/vite-hot-client@2.1.0_vite@7.3.5_@types_node@24.10.0_jiti@2.6.1_lightningcss@1.33.0_terser@5.46.0_tsx@4.21.0_yaml@2.8.3_/node_modules/vite-hot-client/dist/index.qwik.mjs +0 -35
@@ -1,1112 +1,1135 @@
1
1
  import { ShikiError } from "../../../../../@shikijs_types@4.0.2/node_modules/@shikijs/types/dist/index.qwik.mjs";
2
- import { isSpecialTheme, isSpecialLang, createShikiPrimitiveAsync, codeToTokensWithThemes, getLastGrammarState, getLastGrammarStateFromMap, setLastGrammarStateToMap, resolveColorReplacements, applyColorReplacements, isPlainLang, isNoneTheme, codeToTokensBase as codeToTokensBase$1, splitLines } from "../../../../../@shikijs_primitive@4.0.2/node_modules/@shikijs/primitive/dist/index.qwik.mjs";
3
- import { createShikiPrimitive, normalizeGetter, normalizeTheme, toArray, tokenizeWithTheme } from "../../../../../@shikijs_primitive@4.0.2/node_modules/@shikijs/primitive/dist/index.qwik.mjs";
4
2
  import { FontStyle } from "../../../../../@shikijs_vscode-textmate@10.0.2/node_modules/@shikijs/vscode-textmate/dist/index.qwik.mjs";
3
+ import { applyColorReplacements, codeToTokensBase as codeToTokensBase$1, codeToTokensWithThemes, createShikiPrimitiveAsync, getLastGrammarState, getLastGrammarStateFromMap, isNoneTheme, isPlainLang, isSpecialLang, isSpecialTheme, resolveColorReplacements, setLastGrammarStateToMap, splitLines } from "../../../../../@shikijs_primitive@4.0.2/node_modules/@shikijs/primitive/dist/index.qwik.mjs";
5
4
  import { toHtml } from "../../../../../hast-util-to-html@9.0.5/node_modules/hast-util-to-html/lib/index.qwik.mjs";
5
+ /**
6
+ * Utility to append class to a hast node
7
+ *
8
+ * If the `property.class` is a string, it will be splitted by space and converted to an array.
9
+ */
6
10
  function addClassToHast(node, className) {
7
- var _a;
8
- if (!className) return node;
9
- node.properties || (node.properties = {});
10
- (_a = node.properties).class || (_a.class = []);
11
- if (typeof node.properties.class === "string") node.properties.class = node.properties.class.split(/\s+/g);
12
- if (!Array.isArray(node.properties.class)) node.properties.class = [];
13
- const targets = Array.isArray(className) ? className : className.split(/\s+/g);
14
- for (const c of targets) if (c && !node.properties.class.includes(c)) node.properties.class.push(c);
15
- return node;
11
+ var _node$properties;
12
+ if (!className) return node;
13
+ node.properties || (node.properties = {});
14
+ (_node$properties = node.properties).class || (_node$properties.class = []);
15
+ if (typeof node.properties.class === "string") node.properties.class = node.properties.class.split(/\s+/g);
16
+ if (!Array.isArray(node.properties.class)) node.properties.class = [];
17
+ const targets = Array.isArray(className) ? className : className.split(/\s+/g);
18
+ for (const c of targets) if (c && !node.properties.class.includes(c)) node.properties.class.push(c);
19
+ return node;
16
20
  }
21
+ /**
22
+ * Creates a converter between index and position in a code block.
23
+ *
24
+ * Overflow/underflow are unchecked.
25
+ */
17
26
  function createPositionConverter(code) {
18
- const lines = splitLines(code, true).map(([line]) => line);
19
- function indexToPos(index) {
20
- if (index === code.length) return {
21
- line: lines.length - 1,
22
- character: lines[lines.length - 1].length
23
- };
24
- let character = index;
25
- let line = 0;
26
- for (const lineText of lines) {
27
- if (character < lineText.length) break;
28
- character -= lineText.length;
29
- line++;
30
- }
31
- return {
32
- line,
33
- character
34
- };
35
- }
36
- function posToIndex(line, character) {
37
- let index = 0;
38
- for (let i = 0; i < line; i++) index += lines[i].length;
39
- index += character;
40
- return index;
41
- }
42
- return {
43
- lines,
44
- indexToPos,
45
- posToIndex
46
- };
27
+ const lines = splitLines(code, true).map(([line]) => line);
28
+ function indexToPos(index) {
29
+ if (index === code.length) return {
30
+ line: lines.length - 1,
31
+ character: lines[lines.length - 1].length
32
+ };
33
+ let character = index;
34
+ let line = 0;
35
+ for (const lineText of lines) {
36
+ if (character < lineText.length) break;
37
+ character -= lineText.length;
38
+ line++;
39
+ }
40
+ return {
41
+ line,
42
+ character
43
+ };
44
+ }
45
+ function posToIndex(line, character) {
46
+ let index = 0;
47
+ for (let i = 0; i < line; i++) index += lines[i].length;
48
+ index += character;
49
+ return index;
50
+ }
51
+ return {
52
+ lines,
53
+ indexToPos,
54
+ posToIndex
55
+ };
47
56
  }
57
+ /**
58
+ * Guess embedded languages from given code and highlighter.
59
+ *
60
+ * When highlighter is provided, only bundled languages will be included.
61
+ *
62
+ * @param code - The code string to analyze
63
+ * @param _lang - The primary language of the code (currently unused)
64
+ * @param highlighter - Optional highlighter instance to validate languages
65
+ * @returns Array of detected language identifiers
66
+ *
67
+ * @example
68
+ * ```ts
69
+ * // Detects 'javascript' from Vue SFC
70
+ * guessEmbeddedLanguages('<script lang="javascript">')
71
+ *
72
+ * // Detects 'python' from markdown code block
73
+ * guessEmbeddedLanguages('```python\nprint("hi")\n```')
74
+ * ```
75
+ */
48
76
  function guessEmbeddedLanguages(code, _lang, highlighter) {
49
- const langs = /* @__PURE__ */ new Set();
50
- for (const match of code.matchAll(/:?lang=["']([^"']+)["']/g)) {
51
- const lang = match[1].toLowerCase().trim();
52
- if (lang) langs.add(lang);
53
- }
54
- for (const match of code.matchAll(/(?:```|~~~)([\w-]+)/g)) {
55
- const lang = match[1].toLowerCase().trim();
56
- if (lang) langs.add(lang);
57
- }
58
- for (const match of code.matchAll(/\\begin\{([\w-]+)\}/g)) {
59
- const lang = match[1].toLowerCase().trim();
60
- if (lang) langs.add(lang);
61
- }
62
- for (const match of code.matchAll(/<script\s+(?:type|lang)=["']([^"']+)["']/gi)) {
63
- const fullType = match[1].toLowerCase().trim();
64
- const lang = fullType.includes("/") ? fullType.split("/").pop() : fullType;
65
- if (lang) langs.add(lang);
66
- }
67
- if (!highlighter) return Array.from(langs);
68
- const bundle = highlighter.getBundledLanguages();
69
- return Array.from(langs).filter((l) => l && bundle[l]);
77
+ const langs = /* @__PURE__ */ new Set();
78
+ for (const match of code.matchAll(/:?lang=["']([^"']+)["']/g)) {
79
+ const lang = match[1].toLowerCase().trim();
80
+ if (lang) langs.add(lang);
81
+ }
82
+ for (const match of code.matchAll(/(?:```|~~~)([\w-]+)/g)) {
83
+ const lang = match[1].toLowerCase().trim();
84
+ if (lang) langs.add(lang);
85
+ }
86
+ for (const match of code.matchAll(/\\begin\{([\w-]+)\}/g)) {
87
+ const lang = match[1].toLowerCase().trim();
88
+ if (lang) langs.add(lang);
89
+ }
90
+ for (const match of code.matchAll(/<script\s+(?:type|lang)=["']([^"']+)["']/gi)) {
91
+ const fullType = match[1].toLowerCase().trim();
92
+ const lang = fullType.includes("/") ? fullType.split("/").pop() : fullType;
93
+ if (lang) langs.add(lang);
94
+ }
95
+ if (!highlighter) return Array.from(langs);
96
+ const bundle = highlighter.getBundledLanguages();
97
+ return Array.from(langs).filter((l) => l && bundle[l]);
70
98
  }
71
- const DEFAULT_COLOR_LIGHT_DARK = "light-dark()";
72
- const COLOR_KEYS = ["color", "background-color"];
99
+ var DEFAULT_COLOR_LIGHT_DARK = "light-dark()";
100
+ var COLOR_KEYS = ["color", "background-color"];
101
+ /**
102
+ * Split a token into multiple tokens by given offsets.
103
+ *
104
+ * The offsets are relative to the token, and should be sorted.
105
+ */
73
106
  function splitToken(token, offsets) {
74
- let lastOffset = 0;
75
- const tokens = [];
76
- for (const offset of offsets) {
77
- if (offset > lastOffset) tokens.push({
78
- ...token,
79
- content: token.content.slice(lastOffset, offset),
80
- offset: token.offset + lastOffset
81
- });
82
- lastOffset = offset;
83
- }
84
- if (lastOffset < token.content.length) tokens.push({
85
- ...token,
86
- content: token.content.slice(lastOffset),
87
- offset: token.offset + lastOffset
88
- });
89
- return tokens;
107
+ let lastOffset = 0;
108
+ const tokens = [];
109
+ for (const offset of offsets) {
110
+ if (offset > lastOffset) tokens.push({
111
+ ...token,
112
+ content: token.content.slice(lastOffset, offset),
113
+ offset: token.offset + lastOffset
114
+ });
115
+ lastOffset = offset;
116
+ }
117
+ if (lastOffset < token.content.length) tokens.push({
118
+ ...token,
119
+ content: token.content.slice(lastOffset),
120
+ offset: token.offset + lastOffset
121
+ });
122
+ return tokens;
90
123
  }
124
+ /**
125
+ * Split 2D tokens array by given breakpoints.
126
+ */
91
127
  function splitTokens(tokens, breakpoints) {
92
- const sorted = Array.from(breakpoints instanceof Set ? breakpoints : new Set(breakpoints)).sort((a, b) => a - b);
93
- if (!sorted.length) return tokens;
94
- return tokens.map((line) => {
95
- return line.flatMap((token) => {
96
- const breakpointsInToken = sorted.filter((i) => token.offset < i && i < token.offset + token.content.length).map((i) => i - token.offset).sort((a, b) => a - b);
97
- if (!breakpointsInToken.length) return token;
98
- return splitToken(token, breakpointsInToken);
99
- });
100
- });
128
+ const sorted = Array.from(breakpoints instanceof Set ? breakpoints : new Set(breakpoints)).sort((a, b) => a - b);
129
+ if (!sorted.length) return tokens;
130
+ return tokens.map((line) => {
131
+ return line.flatMap((token) => {
132
+ const breakpointsInToken = sorted.filter((i) => token.offset < i && i < token.offset + token.content.length).map((i) => i - token.offset).sort((a, b) => a - b);
133
+ if (!breakpointsInToken.length) return token;
134
+ return splitToken(token, breakpointsInToken);
135
+ });
136
+ });
101
137
  }
102
138
  function flatTokenVariants(merged, variantsOrder, cssVariablePrefix, defaultColor, colorsRendering = "css-vars") {
103
- const token = {
104
- content: merged.content,
105
- explanation: merged.explanation,
106
- offset: merged.offset
107
- };
108
- const styles = variantsOrder.map((t) => getTokenStyleObject(merged.variants[t]));
109
- const styleKeys = new Set(styles.flatMap((t) => Object.keys(t)));
110
- const mergedStyles = {};
111
- const varKey = (idx, key) => {
112
- const keyName = key === "color" ? "" : key === "background-color" ? "-bg" : `-${key}`;
113
- return cssVariablePrefix + variantsOrder[idx] + (key === "color" ? "" : keyName);
114
- };
115
- styles.forEach((cur, idx) => {
116
- for (const key of styleKeys) {
117
- const value = cur[key] || "inherit";
118
- if (idx === 0 && defaultColor && COLOR_KEYS.includes(key)) if (defaultColor === DEFAULT_COLOR_LIGHT_DARK && styles.length > 1) {
119
- const lightIndex = variantsOrder.findIndex((t) => t === "light");
120
- const darkIndex = variantsOrder.findIndex((t) => t === "dark");
121
- if (lightIndex === -1 || darkIndex === -1) throw new ShikiError('When using `defaultColor: "light-dark()"`, you must provide both `light` and `dark` themes');
122
- mergedStyles[key] = `light-dark(${styles[lightIndex][key] || "inherit"}, ${styles[darkIndex][key] || "inherit"})`;
123
- if (colorsRendering === "css-vars") mergedStyles[varKey(idx, key)] = value;
124
- } else mergedStyles[key] = value;
125
- else if (colorsRendering === "css-vars") mergedStyles[varKey(idx, key)] = value;
126
- }
127
- });
128
- token.htmlStyle = mergedStyles;
129
- return token;
139
+ const token = {
140
+ content: merged.content,
141
+ explanation: merged.explanation,
142
+ offset: merged.offset
143
+ };
144
+ const styles = variantsOrder.map((t) => getTokenStyleObject(merged.variants[t]));
145
+ const styleKeys = new Set(styles.flatMap((t) => Object.keys(t)));
146
+ const mergedStyles = {};
147
+ const varKey = (idx, key) => {
148
+ const keyName = key === "color" ? "" : key === "background-color" ? "-bg" : `-${key}`;
149
+ return cssVariablePrefix + variantsOrder[idx] + (key === "color" ? "" : keyName);
150
+ };
151
+ styles.forEach((cur, idx) => {
152
+ for (const key of styleKeys) {
153
+ const value = cur[key] || "inherit";
154
+ if (idx === 0 && defaultColor && COLOR_KEYS.includes(key)) if (defaultColor === DEFAULT_COLOR_LIGHT_DARK && styles.length > 1) {
155
+ const lightIndex = variantsOrder.findIndex((t) => t === "light");
156
+ const darkIndex = variantsOrder.findIndex((t) => t === "dark");
157
+ if (lightIndex === -1 || darkIndex === -1) throw new ShikiError("When using `defaultColor: \"light-dark()\"`, you must provide both `light` and `dark` themes");
158
+ mergedStyles[key] = `light-dark(${styles[lightIndex][key] || "inherit"}, ${styles[darkIndex][key] || "inherit"})`;
159
+ if (colorsRendering === "css-vars") mergedStyles[varKey(idx, key)] = value;
160
+ } else mergedStyles[key] = value;
161
+ else if (colorsRendering === "css-vars") mergedStyles[varKey(idx, key)] = value;
162
+ }
163
+ });
164
+ token.htmlStyle = mergedStyles;
165
+ return token;
130
166
  }
131
167
  function getTokenStyleObject(token) {
132
- const styles = {};
133
- if (token.color) styles.color = token.color;
134
- if (token.bgColor) styles["background-color"] = token.bgColor;
135
- if (token.fontStyle) {
136
- if (token.fontStyle & FontStyle.Italic) styles["font-style"] = "italic";
137
- if (token.fontStyle & FontStyle.Bold) styles["font-weight"] = "bold";
138
- const decorations2 = [];
139
- if (token.fontStyle & FontStyle.Underline) decorations2.push("underline");
140
- if (token.fontStyle & FontStyle.Strikethrough) decorations2.push("line-through");
141
- if (decorations2.length) styles["text-decoration"] = decorations2.join(" ");
142
- }
143
- return styles;
168
+ const styles = {};
169
+ if (token.color) styles.color = token.color;
170
+ if (token.bgColor) styles["background-color"] = token.bgColor;
171
+ if (token.fontStyle) {
172
+ if (token.fontStyle & FontStyle.Italic) styles["font-style"] = "italic";
173
+ if (token.fontStyle & FontStyle.Bold) styles["font-weight"] = "bold";
174
+ const decorations = [];
175
+ if (token.fontStyle & FontStyle.Underline) decorations.push("underline");
176
+ if (token.fontStyle & FontStyle.Strikethrough) decorations.push("line-through");
177
+ if (decorations.length) styles["text-decoration"] = decorations.join(" ");
178
+ }
179
+ return styles;
144
180
  }
145
181
  function stringifyTokenStyle(token) {
146
- if (typeof token === "string") return token;
147
- return Object.entries(token).map(([key, value]) => `${key}:${value}`).join(";");
182
+ if (typeof token === "string") return token;
183
+ return Object.entries(token).map(([key, value]) => `${key}:${value}`).join(";");
148
184
  }
185
+ /**
186
+ * A built-in transformer to add decorations to the highlighted code.
187
+ */
149
188
  function transformerDecorations() {
150
- const map = /* @__PURE__ */ new WeakMap();
151
- function getContext(shiki) {
152
- if (!map.has(shiki.meta)) {
153
- let normalizePosition = function(p) {
154
- if (typeof p === "number") {
155
- if (p < 0 || p > shiki.source.length) throw new ShikiError(`Invalid decoration offset: ${p}. Code length: ${shiki.source.length}`);
156
- return {
157
- ...converter.indexToPos(p),
158
- offset: p
159
- };
160
- } else {
161
- const line = converter.lines[p.line];
162
- if (line === void 0) throw new ShikiError(`Invalid decoration position ${JSON.stringify(p)}. Lines length: ${converter.lines.length}`);
163
- let character = p.character;
164
- if (character < 0) character = line.length + character;
165
- if (character < 0 || character > line.length) throw new ShikiError(`Invalid decoration position ${JSON.stringify(p)}. Line ${p.line} length: ${line.length}`);
166
- return {
167
- ...p,
168
- character,
169
- offset: converter.posToIndex(p.line, character)
170
- };
171
- }
172
- };
173
- const converter = createPositionConverter(shiki.source);
174
- const decorations2 = (shiki.options.decorations || []).map((d) => ({
175
- ...d,
176
- start: normalizePosition(d.start),
177
- end: normalizePosition(d.end)
178
- }));
179
- verifyIntersections(decorations2);
180
- map.set(shiki.meta, {
181
- decorations: decorations2,
182
- converter,
183
- source: shiki.source
184
- });
185
- }
186
- return map.get(shiki.meta);
187
- }
188
- return {
189
- name: "shiki:decorations",
190
- tokens(tokens) {
191
- if (!this.options.decorations?.length) return;
192
- return splitTokens(tokens, getContext(this).decorations.flatMap((d) => [d.start.offset, d.end.offset]));
193
- },
194
- code(codeEl) {
195
- if (!this.options.decorations?.length) return;
196
- const ctx = getContext(this);
197
- const lines = Array.from(codeEl.children).filter((i) => i.type === "element" && i.tagName === "span");
198
- if (lines.length !== ctx.converter.lines.length) throw new ShikiError(`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.`);
199
- function applyLineSection(line, start, end, decoration) {
200
- const lineEl = lines[line];
201
- let text = "";
202
- let startIndex = -1;
203
- let endIndex = -1;
204
- if (start === 0) startIndex = 0;
205
- if (end === 0) endIndex = 0;
206
- if (end === Number.POSITIVE_INFINITY) endIndex = lineEl.children.length;
207
- if (startIndex === -1 || endIndex === -1) for (let i = 0; i < lineEl.children.length; i++) {
208
- text += stringify(lineEl.children[i]);
209
- if (startIndex === -1 && text.length === start) startIndex = i + 1;
210
- if (endIndex === -1 && text.length === end) endIndex = i + 1;
211
- }
212
- if (startIndex === -1) throw new ShikiError(`Failed to find start index for decoration ${JSON.stringify(decoration.start)}`);
213
- if (endIndex === -1) throw new ShikiError(`Failed to find end index for decoration ${JSON.stringify(decoration.end)}`);
214
- const children = lineEl.children.slice(startIndex, endIndex);
215
- if (!decoration.alwaysWrap && children.length === lineEl.children.length) applyDecoration(lineEl, decoration, "line");
216
- else if (!decoration.alwaysWrap && children.length === 1 && children[0].type === "element") applyDecoration(children[0], decoration, "token");
217
- else {
218
- const wrapper = {
219
- type: "element",
220
- tagName: "span",
221
- properties: {},
222
- children
223
- };
224
- applyDecoration(wrapper, decoration, "wrapper");
225
- lineEl.children.splice(startIndex, children.length, wrapper);
226
- }
227
- }
228
- function applyLine(line, decoration) {
229
- lines[line] = applyDecoration(lines[line], decoration, "line");
230
- }
231
- function applyDecoration(el, decoration, type) {
232
- const properties = decoration.properties || {};
233
- const transform = decoration.transform || ((i) => i);
234
- el.tagName = decoration.tagName || "span";
235
- el.properties = {
236
- ...el.properties,
237
- ...properties,
238
- class: el.properties.class
239
- };
240
- if (decoration.properties?.class) addClassToHast(el, decoration.properties.class);
241
- el = transform(el, type) || el;
242
- return el;
243
- }
244
- const lineApplies = [];
245
- const sorted = ctx.decorations.sort((a, b) => b.start.offset - a.start.offset || a.end.offset - b.end.offset);
246
- for (const decoration of sorted) {
247
- const { start, end } = decoration;
248
- if (start.line === end.line) applyLineSection(start.line, start.character, end.character, decoration);
249
- else if (start.line < end.line) {
250
- applyLineSection(start.line, start.character, Number.POSITIVE_INFINITY, decoration);
251
- for (let i = start.line + 1; i < end.line; i++) lineApplies.unshift(() => applyLine(i, decoration));
252
- applyLineSection(end.line, 0, end.character, decoration);
253
- }
254
- }
255
- lineApplies.forEach((i) => i());
256
- }
257
- };
189
+ const map = /* @__PURE__ */ new WeakMap();
190
+ function getContext(shiki) {
191
+ if (!map.has(shiki.meta)) {
192
+ const converter = createPositionConverter(shiki.source);
193
+ function normalizePosition(p) {
194
+ if (typeof p === "number") {
195
+ if (p < 0 || p > shiki.source.length) throw new ShikiError(`Invalid decoration offset: ${p}. Code length: ${shiki.source.length}`);
196
+ return {
197
+ ...converter.indexToPos(p),
198
+ offset: p
199
+ };
200
+ } else {
201
+ const line = converter.lines[p.line];
202
+ if (line === void 0) throw new ShikiError(`Invalid decoration position ${JSON.stringify(p)}. Lines length: ${converter.lines.length}`);
203
+ let character = p.character;
204
+ if (character < 0) character = line.length + character;
205
+ if (character < 0 || character > line.length) throw new ShikiError(`Invalid decoration position ${JSON.stringify(p)}. Line ${p.line} length: ${line.length}`);
206
+ return {
207
+ ...p,
208
+ character,
209
+ offset: converter.posToIndex(p.line, character)
210
+ };
211
+ }
212
+ }
213
+ const decorations = (shiki.options.decorations || []).map((d) => ({
214
+ ...d,
215
+ start: normalizePosition(d.start),
216
+ end: normalizePosition(d.end)
217
+ }));
218
+ verifyIntersections(decorations);
219
+ map.set(shiki.meta, {
220
+ decorations,
221
+ converter,
222
+ source: shiki.source
223
+ });
224
+ }
225
+ return map.get(shiki.meta);
226
+ }
227
+ return {
228
+ name: "shiki:decorations",
229
+ tokens(tokens) {
230
+ if (!this.options.decorations?.length) return;
231
+ return splitTokens(tokens, getContext(this).decorations.flatMap((d) => [d.start.offset, d.end.offset]));
232
+ },
233
+ code(codeEl) {
234
+ if (!this.options.decorations?.length) return;
235
+ const ctx = getContext(this);
236
+ const lines = Array.from(codeEl.children).filter((i) => i.type === "element" && i.tagName === "span");
237
+ if (lines.length !== ctx.converter.lines.length) throw new ShikiError(`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.`);
238
+ function applyLineSection(line, start, end, decoration) {
239
+ const lineEl = lines[line];
240
+ let text = "";
241
+ let startIndex = -1;
242
+ let endIndex = -1;
243
+ if (start === 0) startIndex = 0;
244
+ if (end === 0) endIndex = 0;
245
+ if (end === Number.POSITIVE_INFINITY) endIndex = lineEl.children.length;
246
+ if (startIndex === -1 || endIndex === -1) for (let i = 0; i < lineEl.children.length; i++) {
247
+ text += stringify(lineEl.children[i]);
248
+ if (startIndex === -1 && text.length === start) startIndex = i + 1;
249
+ if (endIndex === -1 && text.length === end) endIndex = i + 1;
250
+ }
251
+ if (startIndex === -1) throw new ShikiError(`Failed to find start index for decoration ${JSON.stringify(decoration.start)}`);
252
+ if (endIndex === -1) throw new ShikiError(`Failed to find end index for decoration ${JSON.stringify(decoration.end)}`);
253
+ const children = lineEl.children.slice(startIndex, endIndex);
254
+ if (!decoration.alwaysWrap && children.length === lineEl.children.length) applyDecoration(lineEl, decoration, "line");
255
+ else if (!decoration.alwaysWrap && children.length === 1 && children[0].type === "element") applyDecoration(children[0], decoration, "token");
256
+ else {
257
+ const wrapper = {
258
+ type: "element",
259
+ tagName: "span",
260
+ properties: {},
261
+ children
262
+ };
263
+ applyDecoration(wrapper, decoration, "wrapper");
264
+ lineEl.children.splice(startIndex, children.length, wrapper);
265
+ }
266
+ }
267
+ function applyLine(line, decoration) {
268
+ lines[line] = applyDecoration(lines[line], decoration, "line");
269
+ }
270
+ function applyDecoration(el, decoration, type) {
271
+ const properties = decoration.properties || {};
272
+ const transform = decoration.transform || ((i) => i);
273
+ el.tagName = decoration.tagName || "span";
274
+ el.properties = {
275
+ ...el.properties,
276
+ ...properties,
277
+ class: el.properties.class
278
+ };
279
+ if (decoration.properties?.class) addClassToHast(el, decoration.properties.class);
280
+ el = transform(el, type) || el;
281
+ return el;
282
+ }
283
+ const lineApplies = [];
284
+ const sorted = ctx.decorations.sort((a, b) => b.start.offset - a.start.offset || a.end.offset - b.end.offset);
285
+ for (const decoration of sorted) {
286
+ const { start, end } = decoration;
287
+ if (start.line === end.line) applyLineSection(start.line, start.character, end.character, decoration);
288
+ else if (start.line < end.line) {
289
+ applyLineSection(start.line, start.character, Number.POSITIVE_INFINITY, decoration);
290
+ for (let i = start.line + 1; i < end.line; i++) lineApplies.unshift(() => applyLine(i, decoration));
291
+ applyLineSection(end.line, 0, end.character, decoration);
292
+ }
293
+ }
294
+ lineApplies.forEach((i) => i());
295
+ }
296
+ };
258
297
  }
259
298
  function verifyIntersections(items) {
260
- for (let i = 0; i < items.length; i++) {
261
- const foo = items[i];
262
- if (foo.start.offset > foo.end.offset) throw new ShikiError(`Invalid decoration range: ${JSON.stringify(foo.start)} - ${JSON.stringify(foo.end)}`);
263
- for (let j = i + 1; j < items.length; j++) {
264
- const bar = items[j];
265
- const isFooHasBarStart = foo.start.offset <= bar.start.offset && bar.start.offset < foo.end.offset;
266
- const isFooHasBarEnd = foo.start.offset < bar.end.offset && bar.end.offset <= foo.end.offset;
267
- const isBarHasFooStart = bar.start.offset <= foo.start.offset && foo.start.offset < bar.end.offset;
268
- const isBarHasFooEnd = bar.start.offset < foo.end.offset && foo.end.offset <= bar.end.offset;
269
- if (isFooHasBarStart || isFooHasBarEnd || isBarHasFooStart || isBarHasFooEnd) {
270
- if (isFooHasBarStart && isFooHasBarEnd) continue;
271
- if (isBarHasFooStart && isBarHasFooEnd) continue;
272
- if (isBarHasFooStart && foo.start.offset === foo.end.offset) continue;
273
- if (isFooHasBarEnd && bar.start.offset === bar.end.offset) continue;
274
- throw new ShikiError(`Decorations ${JSON.stringify(foo.start)} and ${JSON.stringify(bar.start)} intersect.`);
275
- }
276
- }
277
- }
299
+ for (let i = 0; i < items.length; i++) {
300
+ const foo = items[i];
301
+ if (foo.start.offset > foo.end.offset) throw new ShikiError(`Invalid decoration range: ${JSON.stringify(foo.start)} - ${JSON.stringify(foo.end)}`);
302
+ for (let j = i + 1; j < items.length; j++) {
303
+ const bar = items[j];
304
+ const isFooHasBarStart = foo.start.offset <= bar.start.offset && bar.start.offset < foo.end.offset;
305
+ const isFooHasBarEnd = foo.start.offset < bar.end.offset && bar.end.offset <= foo.end.offset;
306
+ const isBarHasFooStart = bar.start.offset <= foo.start.offset && foo.start.offset < bar.end.offset;
307
+ const isBarHasFooEnd = bar.start.offset < foo.end.offset && foo.end.offset <= bar.end.offset;
308
+ if (isFooHasBarStart || isFooHasBarEnd || isBarHasFooStart || isBarHasFooEnd) {
309
+ if (isFooHasBarStart && isFooHasBarEnd) continue;
310
+ if (isBarHasFooStart && isBarHasFooEnd) continue;
311
+ if (isBarHasFooStart && foo.start.offset === foo.end.offset) continue;
312
+ if (isFooHasBarEnd && bar.start.offset === bar.end.offset) continue;
313
+ throw new ShikiError(`Decorations ${JSON.stringify(foo.start)} and ${JSON.stringify(bar.start)} intersect.`);
314
+ }
315
+ }
316
+ }
278
317
  }
279
318
  function stringify(el) {
280
- if (el.type === "text") return el.value;
281
- if (el.type === "element") return el.children.map(stringify).join("");
282
- return "";
319
+ if (el.type === "text") return el.value;
320
+ if (el.type === "element") return el.children.map(stringify).join("");
321
+ return "";
283
322
  }
284
- const builtInTransformers = [/* @__PURE__ */ transformerDecorations()];
323
+ var builtInTransformers = [/* @__PURE__ */ transformerDecorations()];
285
324
  function getTransformers(options) {
286
- const transformers = sortTransformersByEnforcement(options.transformers || []);
287
- return [
288
- ...transformers.pre,
289
- ...transformers.normal,
290
- ...transformers.post,
291
- ...builtInTransformers
292
- ];
325
+ const transformers = sortTransformersByEnforcement(options.transformers || []);
326
+ return [
327
+ ...transformers.pre,
328
+ ...transformers.normal,
329
+ ...transformers.post,
330
+ ...builtInTransformers
331
+ ];
293
332
  }
294
333
  function sortTransformersByEnforcement(transformers) {
295
- const pre = [];
296
- const post = [];
297
- const normal = [];
298
- for (const transformer of transformers) switch (transformer.enforce) {
299
- case "pre":
300
- pre.push(transformer);
301
- break;
302
- case "post":
303
- post.push(transformer);
304
- break;
305
- default:
306
- normal.push(transformer);
307
- }
308
- return {
309
- pre,
310
- post,
311
- normal
312
- };
334
+ const pre = [];
335
+ const post = [];
336
+ const normal = [];
337
+ for (const transformer of transformers) switch (transformer.enforce) {
338
+ case "pre":
339
+ pre.push(transformer);
340
+ break;
341
+ case "post":
342
+ post.push(transformer);
343
+ break;
344
+ default: normal.push(transformer);
345
+ }
346
+ return {
347
+ pre,
348
+ post,
349
+ normal
350
+ };
313
351
  }
314
352
  var namedColors = [
315
- "black",
316
- "red",
317
- "green",
318
- "yellow",
319
- "blue",
320
- "magenta",
321
- "cyan",
322
- "white",
323
- "brightBlack",
324
- "brightRed",
325
- "brightGreen",
326
- "brightYellow",
327
- "brightBlue",
328
- "brightMagenta",
329
- "brightCyan",
330
- "brightWhite"
353
+ "black",
354
+ "red",
355
+ "green",
356
+ "yellow",
357
+ "blue",
358
+ "magenta",
359
+ "cyan",
360
+ "white",
361
+ "brightBlack",
362
+ "brightRed",
363
+ "brightGreen",
364
+ "brightYellow",
365
+ "brightBlue",
366
+ "brightMagenta",
367
+ "brightCyan",
368
+ "brightWhite"
331
369
  ];
332
370
  var decorations = {
333
- 1: "bold",
334
- 2: "dim",
335
- 3: "italic",
336
- 4: "underline",
337
- 7: "reverse",
338
- 8: "hidden",
339
- 9: "strikethrough"
371
+ 1: "bold",
372
+ 2: "dim",
373
+ 3: "italic",
374
+ 4: "underline",
375
+ 7: "reverse",
376
+ 8: "hidden",
377
+ 9: "strikethrough"
340
378
  };
341
379
  function findSequence(value, position) {
342
- const nextEscape = value.indexOf("\x1B", position);
343
- if (nextEscape !== -1) {
344
- if (value[nextEscape + 1] === "[") {
345
- const nextClose = value.indexOf("m", nextEscape);
346
- if (nextClose !== -1) return {
347
- sequence: value.substring(nextEscape + 2, nextClose).split(";"),
348
- startPosition: nextEscape,
349
- position: nextClose + 1
350
- };
351
- }
352
- }
353
- return { position: value.length };
380
+ const nextEscape = value.indexOf("\x1B", position);
381
+ if (nextEscape !== -1) {
382
+ if (value[nextEscape + 1] === "[") {
383
+ const nextClose = value.indexOf("m", nextEscape);
384
+ if (nextClose !== -1) return {
385
+ sequence: value.substring(nextEscape + 2, nextClose).split(";"),
386
+ startPosition: nextEscape,
387
+ position: nextClose + 1
388
+ };
389
+ }
390
+ }
391
+ return { position: value.length };
354
392
  }
355
393
  function parseColor(sequence) {
356
- const colorMode = sequence.shift();
357
- if (colorMode === "2") {
358
- const rgb = sequence.splice(0, 3).map((x) => Number.parseInt(x));
359
- if (rgb.length !== 3 || rgb.some((x) => Number.isNaN(x))) return;
360
- return {
361
- type: "rgb",
362
- rgb
363
- };
364
- } else if (colorMode === "5") {
365
- const index = sequence.shift();
366
- if (index) return {
367
- type: "table",
368
- index: Number(index)
369
- };
370
- }
394
+ const colorMode = sequence.shift();
395
+ if (colorMode === "2") {
396
+ const rgb = sequence.splice(0, 3).map((x) => Number.parseInt(x));
397
+ if (rgb.length !== 3 || rgb.some((x) => Number.isNaN(x))) return;
398
+ return {
399
+ type: "rgb",
400
+ rgb
401
+ };
402
+ } else if (colorMode === "5") {
403
+ const index = sequence.shift();
404
+ if (index) return {
405
+ type: "table",
406
+ index: Number(index)
407
+ };
408
+ }
371
409
  }
372
410
  function parseSequence(sequence) {
373
- const commands = [];
374
- while (sequence.length > 0) {
375
- const code = sequence.shift();
376
- if (!code) continue;
377
- const codeInt = Number.parseInt(code);
378
- if (Number.isNaN(codeInt)) continue;
379
- if (codeInt === 0) commands.push({ type: "resetAll" });
380
- else if (codeInt <= 9) {
381
- if (decorations[codeInt]) commands.push({
382
- type: "setDecoration",
383
- value: decorations[codeInt]
384
- });
385
- } else if (codeInt <= 29) {
386
- const decoration = decorations[codeInt - 20];
387
- if (decoration) {
388
- commands.push({
389
- type: "resetDecoration",
390
- value: decoration
391
- });
392
- if (decoration === "dim") commands.push({
393
- type: "resetDecoration",
394
- value: "bold"
395
- });
396
- }
397
- } else if (codeInt <= 37) commands.push({
398
- type: "setForegroundColor",
399
- value: {
400
- type: "named",
401
- name: namedColors[codeInt - 30]
402
- }
403
- });
404
- else if (codeInt === 38) {
405
- const color = parseColor(sequence);
406
- if (color) commands.push({
407
- type: "setForegroundColor",
408
- value: color
409
- });
410
- } else if (codeInt === 39) commands.push({ type: "resetForegroundColor" });
411
- else if (codeInt <= 47) commands.push({
412
- type: "setBackgroundColor",
413
- value: {
414
- type: "named",
415
- name: namedColors[codeInt - 40]
416
- }
417
- });
418
- else if (codeInt === 48) {
419
- const color = parseColor(sequence);
420
- if (color) commands.push({
421
- type: "setBackgroundColor",
422
- value: color
423
- });
424
- } else if (codeInt === 49) commands.push({ type: "resetBackgroundColor" });
425
- else if (codeInt === 53) commands.push({
426
- type: "setDecoration",
427
- value: "overline"
428
- });
429
- else if (codeInt === 55) commands.push({
430
- type: "resetDecoration",
431
- value: "overline"
432
- });
433
- else if (codeInt >= 90 && codeInt <= 97) commands.push({
434
- type: "setForegroundColor",
435
- value: {
436
- type: "named",
437
- name: namedColors[codeInt - 90 + 8]
438
- }
439
- });
440
- else if (codeInt >= 100 && codeInt <= 107) commands.push({
441
- type: "setBackgroundColor",
442
- value: {
443
- type: "named",
444
- name: namedColors[codeInt - 100 + 8]
445
- }
446
- });
447
- }
448
- return commands;
411
+ const commands = [];
412
+ while (sequence.length > 0) {
413
+ const code = sequence.shift();
414
+ if (!code) continue;
415
+ const codeInt = Number.parseInt(code);
416
+ if (Number.isNaN(codeInt)) continue;
417
+ if (codeInt === 0) commands.push({ type: "resetAll" });
418
+ else if (codeInt <= 9) {
419
+ if (decorations[codeInt]) commands.push({
420
+ type: "setDecoration",
421
+ value: decorations[codeInt]
422
+ });
423
+ } else if (codeInt <= 29) {
424
+ const decoration = decorations[codeInt - 20];
425
+ if (decoration) {
426
+ commands.push({
427
+ type: "resetDecoration",
428
+ value: decoration
429
+ });
430
+ if (decoration === "dim") commands.push({
431
+ type: "resetDecoration",
432
+ value: "bold"
433
+ });
434
+ }
435
+ } else if (codeInt <= 37) commands.push({
436
+ type: "setForegroundColor",
437
+ value: {
438
+ type: "named",
439
+ name: namedColors[codeInt - 30]
440
+ }
441
+ });
442
+ else if (codeInt === 38) {
443
+ const color = parseColor(sequence);
444
+ if (color) commands.push({
445
+ type: "setForegroundColor",
446
+ value: color
447
+ });
448
+ } else if (codeInt === 39) commands.push({ type: "resetForegroundColor" });
449
+ else if (codeInt <= 47) commands.push({
450
+ type: "setBackgroundColor",
451
+ value: {
452
+ type: "named",
453
+ name: namedColors[codeInt - 40]
454
+ }
455
+ });
456
+ else if (codeInt === 48) {
457
+ const color = parseColor(sequence);
458
+ if (color) commands.push({
459
+ type: "setBackgroundColor",
460
+ value: color
461
+ });
462
+ } else if (codeInt === 49) commands.push({ type: "resetBackgroundColor" });
463
+ else if (codeInt === 53) commands.push({
464
+ type: "setDecoration",
465
+ value: "overline"
466
+ });
467
+ else if (codeInt === 55) commands.push({
468
+ type: "resetDecoration",
469
+ value: "overline"
470
+ });
471
+ else if (codeInt >= 90 && codeInt <= 97) commands.push({
472
+ type: "setForegroundColor",
473
+ value: {
474
+ type: "named",
475
+ name: namedColors[codeInt - 90 + 8]
476
+ }
477
+ });
478
+ else if (codeInt >= 100 && codeInt <= 107) commands.push({
479
+ type: "setBackgroundColor",
480
+ value: {
481
+ type: "named",
482
+ name: namedColors[codeInt - 100 + 8]
483
+ }
484
+ });
485
+ }
486
+ return commands;
449
487
  }
450
488
  function createAnsiSequenceParser() {
451
- let foreground = null;
452
- let background = null;
453
- let decorations2 = /* @__PURE__ */ new Set();
454
- return { parse(value) {
455
- const tokens = [];
456
- let position = 0;
457
- do {
458
- const findResult = findSequence(value, position);
459
- const text = findResult.sequence ? value.substring(position, findResult.startPosition) : value.substring(position);
460
- if (text.length > 0) tokens.push({
461
- value: text,
462
- foreground,
463
- background,
464
- decorations: new Set(decorations2)
465
- });
466
- if (findResult.sequence) {
467
- const commands = parseSequence(findResult.sequence);
468
- for (const styleToken of commands) if (styleToken.type === "resetAll") {
469
- foreground = null;
470
- background = null;
471
- decorations2.clear();
472
- } else if (styleToken.type === "resetForegroundColor") foreground = null;
473
- else if (styleToken.type === "resetBackgroundColor") background = null;
474
- else if (styleToken.type === "resetDecoration") decorations2.delete(styleToken.value);
475
- for (const styleToken of commands) if (styleToken.type === "setForegroundColor") foreground = styleToken.value;
476
- else if (styleToken.type === "setBackgroundColor") background = styleToken.value;
477
- else if (styleToken.type === "setDecoration") decorations2.add(styleToken.value);
478
- }
479
- position = findResult.position;
480
- } while (position < value.length);
481
- return tokens;
482
- } };
489
+ let foreground = null;
490
+ let background = null;
491
+ let decorations2 = /* @__PURE__ */ new Set();
492
+ return { parse(value) {
493
+ const tokens = [];
494
+ let position = 0;
495
+ do {
496
+ const findResult = findSequence(value, position);
497
+ const text = findResult.sequence ? value.substring(position, findResult.startPosition) : value.substring(position);
498
+ if (text.length > 0) tokens.push({
499
+ value: text,
500
+ foreground,
501
+ background,
502
+ decorations: new Set(decorations2)
503
+ });
504
+ if (findResult.sequence) {
505
+ const commands = parseSequence(findResult.sequence);
506
+ for (const styleToken of commands) if (styleToken.type === "resetAll") {
507
+ foreground = null;
508
+ background = null;
509
+ decorations2.clear();
510
+ } else if (styleToken.type === "resetForegroundColor") foreground = null;
511
+ else if (styleToken.type === "resetBackgroundColor") background = null;
512
+ else if (styleToken.type === "resetDecoration") decorations2.delete(styleToken.value);
513
+ for (const styleToken of commands) if (styleToken.type === "setForegroundColor") foreground = styleToken.value;
514
+ else if (styleToken.type === "setBackgroundColor") background = styleToken.value;
515
+ else if (styleToken.type === "setDecoration") decorations2.add(styleToken.value);
516
+ }
517
+ position = findResult.position;
518
+ } while (position < value.length);
519
+ return tokens;
520
+ } };
483
521
  }
484
522
  var defaultNamedColorsMap = {
485
- black: "#000000",
486
- red: "#bb0000",
487
- green: "#00bb00",
488
- yellow: "#bbbb00",
489
- blue: "#0000bb",
490
- magenta: "#ff00ff",
491
- cyan: "#00bbbb",
492
- white: "#eeeeee",
493
- brightBlack: "#555555",
494
- brightRed: "#ff5555",
495
- brightGreen: "#00ff00",
496
- brightYellow: "#ffff55",
497
- brightBlue: "#5555ff",
498
- brightMagenta: "#ff55ff",
499
- brightCyan: "#55ffff",
500
- brightWhite: "#ffffff"
523
+ black: "#000000",
524
+ red: "#bb0000",
525
+ green: "#00bb00",
526
+ yellow: "#bbbb00",
527
+ blue: "#0000bb",
528
+ magenta: "#ff00ff",
529
+ cyan: "#00bbbb",
530
+ white: "#eeeeee",
531
+ brightBlack: "#555555",
532
+ brightRed: "#ff5555",
533
+ brightGreen: "#00ff00",
534
+ brightYellow: "#ffff55",
535
+ brightBlue: "#5555ff",
536
+ brightMagenta: "#ff55ff",
537
+ brightCyan: "#55ffff",
538
+ brightWhite: "#ffffff"
501
539
  };
502
540
  function createColorPalette(namedColorsMap = defaultNamedColorsMap) {
503
- function namedColor(name) {
504
- return namedColorsMap[name];
505
- }
506
- function rgbColor(rgb) {
507
- return `#${rgb.map((x) => Math.max(0, Math.min(x, 255)).toString(16).padStart(2, "0")).join("")}`;
508
- }
509
- let colorTable;
510
- function getColorTable() {
511
- if (colorTable) return colorTable;
512
- colorTable = [];
513
- for (let i = 0; i < namedColors.length; i++) colorTable.push(namedColor(namedColors[i]));
514
- let levels = [
515
- 0,
516
- 95,
517
- 135,
518
- 175,
519
- 215,
520
- 255
521
- ];
522
- for (let r = 0; r < 6; r++) for (let g = 0; g < 6; g++) for (let b = 0; b < 6; b++) colorTable.push(rgbColor([
523
- levels[r],
524
- levels[g],
525
- levels[b]
526
- ]));
527
- let level = 8;
528
- for (let i = 0; i < 24; i++, level += 10) colorTable.push(rgbColor([
529
- level,
530
- level,
531
- level
532
- ]));
533
- return colorTable;
534
- }
535
- function tableColor(index) {
536
- return getColorTable()[index];
537
- }
538
- function value(color) {
539
- switch (color.type) {
540
- case "named":
541
- return namedColor(color.name);
542
- case "rgb":
543
- return rgbColor(color.rgb);
544
- case "table":
545
- return tableColor(color.index);
546
- }
547
- }
548
- return { value };
541
+ function namedColor(name) {
542
+ return namedColorsMap[name];
543
+ }
544
+ function rgbColor(rgb) {
545
+ return `#${rgb.map((x) => Math.max(0, Math.min(x, 255)).toString(16).padStart(2, "0")).join("")}`;
546
+ }
547
+ let colorTable;
548
+ function getColorTable() {
549
+ if (colorTable) return colorTable;
550
+ colorTable = [];
551
+ for (let i = 0; i < namedColors.length; i++) colorTable.push(namedColor(namedColors[i]));
552
+ let levels = [
553
+ 0,
554
+ 95,
555
+ 135,
556
+ 175,
557
+ 215,
558
+ 255
559
+ ];
560
+ for (let r = 0; r < 6; r++) for (let g = 0; g < 6; g++) for (let b = 0; b < 6; b++) colorTable.push(rgbColor([
561
+ levels[r],
562
+ levels[g],
563
+ levels[b]
564
+ ]));
565
+ let level = 8;
566
+ for (let i = 0; i < 24; i++, level += 10) colorTable.push(rgbColor([
567
+ level,
568
+ level,
569
+ level
570
+ ]));
571
+ return colorTable;
572
+ }
573
+ function tableColor(index) {
574
+ return getColorTable()[index];
575
+ }
576
+ function value(color) {
577
+ switch (color.type) {
578
+ case "named": return namedColor(color.name);
579
+ case "rgb": return rgbColor(color.rgb);
580
+ case "table": return tableColor(color.index);
581
+ }
582
+ }
583
+ return { value };
549
584
  }
550
- const defaultAnsiColors = {
551
- black: "#000000",
552
- red: "#cd3131",
553
- green: "#0DBC79",
554
- yellow: "#E5E510",
555
- blue: "#2472C8",
556
- magenta: "#BC3FBC",
557
- cyan: "#11A8CD",
558
- white: "#E5E5E5",
559
- brightBlack: "#666666",
560
- brightRed: "#F14C4C",
561
- brightGreen: "#23D18B",
562
- brightYellow: "#F5F543",
563
- brightBlue: "#3B8EEA",
564
- brightMagenta: "#D670D6",
565
- brightCyan: "#29B8DB",
566
- brightWhite: "#FFFFFF"
585
+ /**
586
+ * Default ANSI palette (VSCode compatible fallbacks)
587
+ * Used when the theme does not define terminal.ansi* colors.
588
+ */
589
+ var defaultAnsiColors = {
590
+ black: "#000000",
591
+ red: "#cd3131",
592
+ green: "#0DBC79",
593
+ yellow: "#E5E510",
594
+ blue: "#2472C8",
595
+ magenta: "#BC3FBC",
596
+ cyan: "#11A8CD",
597
+ white: "#E5E5E5",
598
+ brightBlack: "#666666",
599
+ brightRed: "#F14C4C",
600
+ brightGreen: "#23D18B",
601
+ brightYellow: "#F5F543",
602
+ brightBlue: "#3B8EEA",
603
+ brightMagenta: "#D670D6",
604
+ brightCyan: "#29B8DB",
605
+ brightWhite: "#FFFFFF"
567
606
  };
568
607
  function tokenizeAnsiWithTheme(theme, fileContents, options) {
569
- const colorReplacements = resolveColorReplacements(theme, options);
570
- const lines = splitLines(fileContents);
571
- const colorPalette = createColorPalette(Object.fromEntries(namedColors.map((name) => {
572
- const key = `terminal.ansi${name[0].toUpperCase()}${name.substring(1)}`;
573
- return [name, theme.colors?.[key] || defaultAnsiColors[name]];
574
- })));
575
- const parser = createAnsiSequenceParser();
576
- return lines.map((line) => parser.parse(line[0]).map((token) => {
577
- let color;
578
- let bgColor;
579
- if (token.decorations.has("reverse")) {
580
- color = token.background ? colorPalette.value(token.background) : theme.bg;
581
- bgColor = token.foreground ? colorPalette.value(token.foreground) : theme.fg;
582
- } else {
583
- color = token.foreground ? colorPalette.value(token.foreground) : theme.fg;
584
- bgColor = token.background ? colorPalette.value(token.background) : void 0;
585
- }
586
- color = applyColorReplacements(color, colorReplacements);
587
- bgColor = applyColorReplacements(bgColor, colorReplacements);
588
- if (token.decorations.has("dim")) color = dimColor(color);
589
- let fontStyle = FontStyle.None;
590
- if (token.decorations.has("bold")) fontStyle |= FontStyle.Bold;
591
- if (token.decorations.has("italic")) fontStyle |= FontStyle.Italic;
592
- if (token.decorations.has("underline")) fontStyle |= FontStyle.Underline;
593
- if (token.decorations.has("strikethrough")) fontStyle |= FontStyle.Strikethrough;
594
- return {
595
- content: token.value,
596
- offset: line[1],
597
- color,
598
- bgColor,
599
- fontStyle
600
- };
601
- }));
608
+ const colorReplacements = resolveColorReplacements(theme, options);
609
+ const lines = splitLines(fileContents);
610
+ const colorPalette = createColorPalette(Object.fromEntries(namedColors.map((name) => {
611
+ const key = `terminal.ansi${name[0].toUpperCase()}${name.substring(1)}`;
612
+ return [name, theme.colors?.[key] || defaultAnsiColors[name]];
613
+ })));
614
+ const parser = createAnsiSequenceParser();
615
+ return lines.map((line) => parser.parse(line[0]).map((token) => {
616
+ let color;
617
+ let bgColor;
618
+ if (token.decorations.has("reverse")) {
619
+ color = token.background ? colorPalette.value(token.background) : theme.bg;
620
+ bgColor = token.foreground ? colorPalette.value(token.foreground) : theme.fg;
621
+ } else {
622
+ color = token.foreground ? colorPalette.value(token.foreground) : theme.fg;
623
+ bgColor = token.background ? colorPalette.value(token.background) : void 0;
624
+ }
625
+ color = applyColorReplacements(color, colorReplacements);
626
+ bgColor = applyColorReplacements(bgColor, colorReplacements);
627
+ if (token.decorations.has("dim")) color = dimColor(color);
628
+ let fontStyle = FontStyle.None;
629
+ if (token.decorations.has("bold")) fontStyle |= FontStyle.Bold;
630
+ if (token.decorations.has("italic")) fontStyle |= FontStyle.Italic;
631
+ if (token.decorations.has("underline")) fontStyle |= FontStyle.Underline;
632
+ if (token.decorations.has("strikethrough")) fontStyle |= FontStyle.Strikethrough;
633
+ return {
634
+ content: token.value,
635
+ offset: line[1],
636
+ color,
637
+ bgColor,
638
+ fontStyle
639
+ };
640
+ }));
602
641
  }
642
+ /**
643
+ * Adds 50% alpha to a hex color string or the "-dim" postfix to a CSS variable
644
+ */
603
645
  function dimColor(color) {
604
- const hexMatch = color.match(/#([0-9a-f]{3,8})/i);
605
- if (hexMatch) {
606
- const hex = hexMatch[1];
607
- if (hex.length === 8) {
608
- const alpha = Math.round(Number.parseInt(hex.slice(6, 8), 16) / 2).toString(16).padStart(2, "0");
609
- return `#${hex.slice(0, 6)}${alpha}`;
610
- } else if (hex.length === 6) return `#${hex}80`;
611
- else if (hex.length === 4) {
612
- const r = hex[0];
613
- const g = hex[1];
614
- const b = hex[2];
615
- const a = hex[3];
616
- return `#${r}${r}${g}${g}${b}${b}${Math.round(Number.parseInt(`${a}${a}`, 16) / 2).toString(16).padStart(2, "0")}`;
617
- } else if (hex.length === 3) {
618
- const r = hex[0];
619
- const g = hex[1];
620
- const b = hex[2];
621
- return `#${r}${r}${g}${g}${b}${b}80`;
622
- }
623
- }
624
- const cssVarMatch = color.match(/var\((--[\w-]+-ansi-[\w-]+)\)/);
625
- if (cssVarMatch) return `var(${cssVarMatch[1]}-dim)`;
626
- return color;
646
+ const hexMatch = color.match(/#([0-9a-f]{3,8})/i);
647
+ if (hexMatch) {
648
+ const hex = hexMatch[1];
649
+ if (hex.length === 8) {
650
+ const alpha = Math.round(Number.parseInt(hex.slice(6, 8), 16) / 2).toString(16).padStart(2, "0");
651
+ return `#${hex.slice(0, 6)}${alpha}`;
652
+ } else if (hex.length === 6) return `#${hex}80`;
653
+ else if (hex.length === 4) {
654
+ const r = hex[0];
655
+ const g = hex[1];
656
+ const b = hex[2];
657
+ const a = hex[3];
658
+ return `#${r}${r}${g}${g}${b}${b}${Math.round(Number.parseInt(`${a}${a}`, 16) / 2).toString(16).padStart(2, "0")}`;
659
+ } else if (hex.length === 3) {
660
+ const r = hex[0];
661
+ const g = hex[1];
662
+ const b = hex[2];
663
+ return `#${r}${r}${g}${g}${b}${b}80`;
664
+ }
665
+ }
666
+ const cssVarMatch = color.match(/var\((--[\w-]+-ansi-[\w-]+)\)/);
667
+ if (cssVarMatch) return `var(${cssVarMatch[1]}-dim)`;
668
+ return color;
627
669
  }
670
+ /**
671
+ * Code to tokens, with a simple theme.
672
+ * This wraps the tokenizer's implementation to add ANSI support.
673
+ */
628
674
  function codeToTokensBase(primitive, code, options = {}) {
629
- const lang = primitive.resolveLangAlias(options.lang || "text");
630
- const { theme: themeName = primitive.getLoadedThemes()[0] } = options;
631
- if (!isPlainLang(lang) && !isNoneTheme(themeName) && lang === "ansi") {
632
- const { theme } = primitive.setTheme(themeName);
633
- return tokenizeAnsiWithTheme(theme, code, options);
634
- }
635
- return codeToTokensBase$1(primitive, code, options);
675
+ const lang = primitive.resolveLangAlias(options.lang || "text");
676
+ const { theme: themeName = primitive.getLoadedThemes()[0] } = options;
677
+ if (!isPlainLang(lang) && !isNoneTheme(themeName) && lang === "ansi") {
678
+ const { theme } = primitive.setTheme(themeName);
679
+ return tokenizeAnsiWithTheme(theme, code, options);
680
+ }
681
+ return codeToTokensBase$1(primitive, code, options);
636
682
  }
683
+ /**
684
+ * High-level code-to-tokens API.
685
+ *
686
+ * It will use `codeToTokensWithThemes` or `codeToTokensBase` based on the options.
687
+ */
637
688
  function codeToTokens(primitive, code, options) {
638
- let bg;
639
- let fg;
640
- let tokens;
641
- let themeName;
642
- let rootStyle;
643
- let grammarState;
644
- if ("themes" in options) {
645
- const { defaultColor = "light", cssVariablePrefix = "--shiki-", colorsRendering = "css-vars" } = options;
646
- const themes = Object.entries(options.themes).filter((i) => i[1]).map((i) => ({
647
- color: i[0],
648
- theme: i[1]
649
- })).sort((a, b) => a.color === defaultColor ? -1 : b.color === defaultColor ? 1 : 0);
650
- if (themes.length === 0) throw new ShikiError("`themes` option must not be empty");
651
- const themeTokens = codeToTokensWithThemes(primitive, code, options, codeToTokensBase);
652
- grammarState = getLastGrammarStateFromMap(themeTokens);
653
- if (defaultColor && DEFAULT_COLOR_LIGHT_DARK !== defaultColor && !themes.find((t) => t.color === defaultColor)) throw new ShikiError(`\`themes\` option must contain the defaultColor key \`${defaultColor}\``);
654
- const themeRegs = themes.map((t) => primitive.getTheme(t.theme));
655
- const themesOrder = themes.map((t) => t.color);
656
- tokens = themeTokens.map((line) => line.map((token) => flatTokenVariants(token, themesOrder, cssVariablePrefix, defaultColor, colorsRendering)));
657
- if (grammarState) setLastGrammarStateToMap(tokens, grammarState);
658
- const themeColorReplacements = themes.map((t) => resolveColorReplacements(t.theme, options));
659
- fg = mapThemeColors(themes, themeRegs, themeColorReplacements, cssVariablePrefix, defaultColor, "fg", colorsRendering);
660
- bg = mapThemeColors(themes, themeRegs, themeColorReplacements, cssVariablePrefix, defaultColor, "bg", colorsRendering);
661
- themeName = `shiki-themes ${themeRegs.map((t) => t.name).join(" ")}`;
662
- rootStyle = defaultColor ? void 0 : [fg, bg].join(";");
663
- } else if ("theme" in options) {
664
- const colorReplacements = resolveColorReplacements(options.theme, options);
665
- tokens = codeToTokensBase(primitive, code, options);
666
- const _theme = primitive.getTheme(options.theme);
667
- bg = applyColorReplacements(_theme.bg, colorReplacements);
668
- fg = applyColorReplacements(_theme.fg, colorReplacements);
669
- themeName = _theme.name;
670
- grammarState = getLastGrammarStateFromMap(tokens);
671
- } else throw new ShikiError("Invalid options, either `theme` or `themes` must be provided");
672
- return {
673
- tokens,
674
- fg,
675
- bg,
676
- themeName,
677
- rootStyle,
678
- grammarState
679
- };
689
+ let bg;
690
+ let fg;
691
+ let tokens;
692
+ let themeName;
693
+ let rootStyle;
694
+ let grammarState;
695
+ if ("themes" in options) {
696
+ const { defaultColor = "light", cssVariablePrefix = "--shiki-", colorsRendering = "css-vars" } = options;
697
+ const themes = Object.entries(options.themes).filter((i) => i[1]).map((i) => ({
698
+ color: i[0],
699
+ theme: i[1]
700
+ })).sort((a, b) => a.color === defaultColor ? -1 : b.color === defaultColor ? 1 : 0);
701
+ if (themes.length === 0) throw new ShikiError("`themes` option must not be empty");
702
+ const themeTokens = codeToTokensWithThemes(primitive, code, options, codeToTokensBase);
703
+ grammarState = getLastGrammarStateFromMap(themeTokens);
704
+ if (defaultColor && DEFAULT_COLOR_LIGHT_DARK !== defaultColor && !themes.find((t) => t.color === defaultColor)) throw new ShikiError(`\`themes\` option must contain the defaultColor key \`${defaultColor}\``);
705
+ const themeRegs = themes.map((t) => primitive.getTheme(t.theme));
706
+ const themesOrder = themes.map((t) => t.color);
707
+ tokens = themeTokens.map((line) => line.map((token) => flatTokenVariants(token, themesOrder, cssVariablePrefix, defaultColor, colorsRendering)));
708
+ if (grammarState) setLastGrammarStateToMap(tokens, grammarState);
709
+ const themeColorReplacements = themes.map((t) => resolveColorReplacements(t.theme, options));
710
+ fg = mapThemeColors(themes, themeRegs, themeColorReplacements, cssVariablePrefix, defaultColor, "fg", colorsRendering);
711
+ bg = mapThemeColors(themes, themeRegs, themeColorReplacements, cssVariablePrefix, defaultColor, "bg", colorsRendering);
712
+ themeName = `shiki-themes ${themeRegs.map((t) => t.name).join(" ")}`;
713
+ rootStyle = defaultColor ? void 0 : [fg, bg].join(";");
714
+ } else if ("theme" in options) {
715
+ const colorReplacements = resolveColorReplacements(options.theme, options);
716
+ tokens = codeToTokensBase(primitive, code, options);
717
+ const _theme = primitive.getTheme(options.theme);
718
+ bg = applyColorReplacements(_theme.bg, colorReplacements);
719
+ fg = applyColorReplacements(_theme.fg, colorReplacements);
720
+ themeName = _theme.name;
721
+ grammarState = getLastGrammarStateFromMap(tokens);
722
+ } else throw new ShikiError("Invalid options, either `theme` or `themes` must be provided");
723
+ return {
724
+ tokens,
725
+ fg,
726
+ bg,
727
+ themeName,
728
+ rootStyle,
729
+ grammarState
730
+ };
680
731
  }
681
732
  function mapThemeColors(themes, themeRegs, themeColorReplacements, cssVariablePrefix, defaultColor, property, colorsRendering) {
682
- return themes.map((t, idx) => {
683
- const value = applyColorReplacements(themeRegs[idx][property], themeColorReplacements[idx]) || "inherit";
684
- const cssVar = `${cssVariablePrefix + t.color}${property === "bg" ? "-bg" : ""}:${value}`;
685
- if (idx === 0 && defaultColor) {
686
- if (defaultColor === DEFAULT_COLOR_LIGHT_DARK && themes.length > 1) {
687
- const lightIndex = themes.findIndex((t2) => t2.color === "light");
688
- const darkIndex = themes.findIndex((t2) => t2.color === "dark");
689
- if (lightIndex === -1 || darkIndex === -1) throw new ShikiError('When using `defaultColor: "light-dark()"`, you must provide both `light` and `dark` themes');
690
- return `light-dark(${applyColorReplacements(themeRegs[lightIndex][property], themeColorReplacements[lightIndex]) || "inherit"}, ${applyColorReplacements(themeRegs[darkIndex][property], themeColorReplacements[darkIndex]) || "inherit"});${cssVar}`;
691
- }
692
- return value;
693
- }
694
- if (colorsRendering === "css-vars") return cssVar;
695
- return null;
696
- }).filter((i) => !!i).join(";");
733
+ return themes.map((t, idx) => {
734
+ const value = applyColorReplacements(themeRegs[idx][property], themeColorReplacements[idx]) || "inherit";
735
+ const cssVar = `${cssVariablePrefix + t.color}${property === "bg" ? "-bg" : ""}:${value}`;
736
+ if (idx === 0 && defaultColor) {
737
+ if (defaultColor === DEFAULT_COLOR_LIGHT_DARK && themes.length > 1) {
738
+ const lightIndex = themes.findIndex((t) => t.color === "light");
739
+ const darkIndex = themes.findIndex((t) => t.color === "dark");
740
+ if (lightIndex === -1 || darkIndex === -1) throw new ShikiError("When using `defaultColor: \"light-dark()\"`, you must provide both `light` and `dark` themes");
741
+ return `light-dark(${applyColorReplacements(themeRegs[lightIndex][property], themeColorReplacements[lightIndex]) || "inherit"}, ${applyColorReplacements(themeRegs[darkIndex][property], themeColorReplacements[darkIndex]) || "inherit"});${cssVar}`;
742
+ }
743
+ return value;
744
+ }
745
+ if (colorsRendering === "css-vars") return cssVar;
746
+ return null;
747
+ }).filter((i) => !!i).join(";");
697
748
  }
698
749
  function codeToHast(primitive, code, options, transformerContext = {
699
- meta: {},
700
- options,
701
- codeToHast: (_code, _options) => codeToHast(primitive, _code, _options),
702
- codeToTokens: (_code, _options) => codeToTokens(primitive, _code, _options)
750
+ meta: {},
751
+ options,
752
+ codeToHast: (_code, _options) => codeToHast(primitive, _code, _options),
753
+ codeToTokens: (_code, _options) => codeToTokens(primitive, _code, _options)
703
754
  }) {
704
- let input = code;
705
- for (const transformer of getTransformers(options)) input = transformer.preprocess?.call(transformerContext, input, options) || input;
706
- let { tokens, fg, bg, themeName, rootStyle, grammarState } = codeToTokens(primitive, input, options);
707
- const { mergeWhitespaces = true, mergeSameStyleTokens = false } = options;
708
- if (mergeWhitespaces === true) tokens = mergeWhitespaceTokens(tokens);
709
- else if (mergeWhitespaces === "never") tokens = splitWhitespaceTokens(tokens);
710
- if (mergeSameStyleTokens) tokens = mergeAdjacentStyledTokens(tokens);
711
- const contextSource = {
712
- ...transformerContext,
713
- get source() {
714
- return input;
715
- }
716
- };
717
- for (const transformer of getTransformers(options)) tokens = transformer.tokens?.call(contextSource, tokens) || tokens;
718
- return tokensToHast(tokens, {
719
- ...options,
720
- fg,
721
- bg,
722
- themeName,
723
- rootStyle: options.rootStyle === false ? false : options.rootStyle ?? rootStyle
724
- }, contextSource, grammarState);
755
+ let input = code;
756
+ for (const transformer of getTransformers(options)) input = transformer.preprocess?.call(transformerContext, input, options) || input;
757
+ let { tokens, fg, bg, themeName, rootStyle, grammarState } = codeToTokens(primitive, input, options);
758
+ const { mergeWhitespaces = true, mergeSameStyleTokens = false } = options;
759
+ if (mergeWhitespaces === true) tokens = mergeWhitespaceTokens(tokens);
760
+ else if (mergeWhitespaces === "never") tokens = splitWhitespaceTokens(tokens);
761
+ if (mergeSameStyleTokens) tokens = mergeAdjacentStyledTokens(tokens);
762
+ const contextSource = {
763
+ ...transformerContext,
764
+ get source() {
765
+ return input;
766
+ }
767
+ };
768
+ for (const transformer of getTransformers(options)) tokens = transformer.tokens?.call(contextSource, tokens) || tokens;
769
+ return tokensToHast(tokens, {
770
+ ...options,
771
+ fg,
772
+ bg,
773
+ themeName,
774
+ rootStyle: options.rootStyle === false ? false : options.rootStyle ?? rootStyle
775
+ }, contextSource, grammarState);
725
776
  }
726
777
  function tokensToHast(tokens, options, transformerContext, grammarState = getLastGrammarStateFromMap(tokens)) {
727
- const transformers = getTransformers(options);
728
- const lines = [];
729
- const root = {
730
- type: "root",
731
- children: []
732
- };
733
- const { structure = "classic", tabindex = "0" } = options;
734
- const properties = { class: `shiki ${options.themeName || ""}` };
735
- if (options.rootStyle !== false) if (options.rootStyle != null) properties.style = options.rootStyle;
736
- else properties.style = `background-color:${options.bg};color:${options.fg}`;
737
- if (tabindex !== false && tabindex != null) properties.tabindex = tabindex.toString();
738
- for (const [key, value] of Object.entries(options.meta || {})) if (!key.startsWith("_")) properties[key] = value;
739
- let preNode = {
740
- type: "element",
741
- tagName: "pre",
742
- properties,
743
- children: [],
744
- data: options.data
745
- };
746
- let codeNode = {
747
- type: "element",
748
- tagName: "code",
749
- properties: {},
750
- children: lines
751
- };
752
- const lineNodes = [];
753
- const context = {
754
- ...transformerContext,
755
- structure,
756
- addClassToHast,
757
- get source() {
758
- return transformerContext.source;
759
- },
760
- get tokens() {
761
- return tokens;
762
- },
763
- get options() {
764
- return options;
765
- },
766
- get root() {
767
- return root;
768
- },
769
- get pre() {
770
- return preNode;
771
- },
772
- get code() {
773
- return codeNode;
774
- },
775
- get lines() {
776
- return lineNodes;
777
- }
778
- };
779
- tokens.forEach((line, idx) => {
780
- if (idx) {
781
- if (structure === "inline") root.children.push({
782
- type: "element",
783
- tagName: "br",
784
- properties: {},
785
- children: []
786
- });
787
- else if (structure === "classic") lines.push({
788
- type: "text",
789
- value: "\n"
790
- });
791
- }
792
- let lineNode = {
793
- type: "element",
794
- tagName: "span",
795
- properties: { class: "line" },
796
- children: []
797
- };
798
- let col = 0;
799
- for (const token of line) {
800
- let tokenNode = {
801
- type: "element",
802
- tagName: "span",
803
- properties: { ...token.htmlAttrs },
804
- children: [{
805
- type: "text",
806
- value: token.content
807
- }]
808
- };
809
- const style = stringifyTokenStyle(token.htmlStyle || getTokenStyleObject(token));
810
- if (style) tokenNode.properties.style = style;
811
- for (const transformer of transformers) tokenNode = transformer?.span?.call(context, tokenNode, idx + 1, col, lineNode, token) || tokenNode;
812
- if (structure === "inline") root.children.push(tokenNode);
813
- else if (structure === "classic") lineNode.children.push(tokenNode);
814
- col += token.content.length;
815
- }
816
- if (structure === "classic") {
817
- for (const transformer of transformers) lineNode = transformer?.line?.call(context, lineNode, idx + 1) || lineNode;
818
- lineNodes.push(lineNode);
819
- lines.push(lineNode);
820
- } else if (structure === "inline") lineNodes.push(lineNode);
821
- });
822
- if (structure === "classic") {
823
- for (const transformer of transformers) codeNode = transformer?.code?.call(context, codeNode) || codeNode;
824
- preNode.children.push(codeNode);
825
- for (const transformer of transformers) preNode = transformer?.pre?.call(context, preNode) || preNode;
826
- root.children.push(preNode);
827
- } else if (structure === "inline") {
828
- const syntheticLines = [];
829
- let currentLine = {
830
- type: "element",
831
- tagName: "span",
832
- properties: { class: "line" },
833
- children: []
834
- };
835
- for (const child of root.children) if (child.type === "element" && child.tagName === "br") {
836
- syntheticLines.push(currentLine);
837
- currentLine = {
838
- type: "element",
839
- tagName: "span",
840
- properties: { class: "line" },
841
- children: []
842
- };
843
- } else if (child.type === "element" || child.type === "text") currentLine.children.push(child);
844
- syntheticLines.push(currentLine);
845
- let transformedCode = {
846
- type: "element",
847
- tagName: "code",
848
- properties: {},
849
- children: syntheticLines
850
- };
851
- for (const transformer of transformers) transformedCode = transformer?.code?.call(context, transformedCode) || transformedCode;
852
- root.children = [];
853
- for (let i = 0; i < transformedCode.children.length; i++) {
854
- if (i > 0) root.children.push({
855
- type: "element",
856
- tagName: "br",
857
- properties: {},
858
- children: []
859
- });
860
- const line = transformedCode.children[i];
861
- if (line.type === "element") root.children.push(...line.children);
862
- }
863
- }
864
- let result = root;
865
- for (const transformer of transformers) result = transformer?.root?.call(context, result) || result;
866
- if (grammarState) setLastGrammarStateToMap(result, grammarState);
867
- return result;
778
+ const transformers = getTransformers(options);
779
+ const lines = [];
780
+ const root = {
781
+ type: "root",
782
+ children: []
783
+ };
784
+ const { structure = "classic", tabindex = "0" } = options;
785
+ const properties = { class: `shiki ${options.themeName || ""}` };
786
+ if (options.rootStyle !== false) if (options.rootStyle != null) properties.style = options.rootStyle;
787
+ else properties.style = `background-color:${options.bg};color:${options.fg}`;
788
+ if (tabindex !== false && tabindex != null) properties.tabindex = tabindex.toString();
789
+ for (const [key, value] of Object.entries(options.meta || {})) if (!key.startsWith("_")) properties[key] = value;
790
+ let preNode = {
791
+ type: "element",
792
+ tagName: "pre",
793
+ properties,
794
+ children: [],
795
+ data: options.data
796
+ };
797
+ let codeNode = {
798
+ type: "element",
799
+ tagName: "code",
800
+ properties: {},
801
+ children: lines
802
+ };
803
+ const lineNodes = [];
804
+ const context = {
805
+ ...transformerContext,
806
+ structure,
807
+ addClassToHast,
808
+ get source() {
809
+ return transformerContext.source;
810
+ },
811
+ get tokens() {
812
+ return tokens;
813
+ },
814
+ get options() {
815
+ return options;
816
+ },
817
+ get root() {
818
+ return root;
819
+ },
820
+ get pre() {
821
+ return preNode;
822
+ },
823
+ get code() {
824
+ return codeNode;
825
+ },
826
+ get lines() {
827
+ return lineNodes;
828
+ }
829
+ };
830
+ tokens.forEach((line, idx) => {
831
+ if (idx) {
832
+ if (structure === "inline") root.children.push({
833
+ type: "element",
834
+ tagName: "br",
835
+ properties: {},
836
+ children: []
837
+ });
838
+ else if (structure === "classic") lines.push({
839
+ type: "text",
840
+ value: "\n"
841
+ });
842
+ }
843
+ let lineNode = {
844
+ type: "element",
845
+ tagName: "span",
846
+ properties: { class: "line" },
847
+ children: []
848
+ };
849
+ let col = 0;
850
+ for (const token of line) {
851
+ let tokenNode = {
852
+ type: "element",
853
+ tagName: "span",
854
+ properties: { ...token.htmlAttrs },
855
+ children: [{
856
+ type: "text",
857
+ value: token.content
858
+ }]
859
+ };
860
+ const style = stringifyTokenStyle(token.htmlStyle || getTokenStyleObject(token));
861
+ if (style) tokenNode.properties.style = style;
862
+ for (const transformer of transformers) tokenNode = transformer?.span?.call(context, tokenNode, idx + 1, col, lineNode, token) || tokenNode;
863
+ if (structure === "inline") root.children.push(tokenNode);
864
+ else if (structure === "classic") lineNode.children.push(tokenNode);
865
+ col += token.content.length;
866
+ }
867
+ if (structure === "classic") {
868
+ for (const transformer of transformers) lineNode = transformer?.line?.call(context, lineNode, idx + 1) || lineNode;
869
+ lineNodes.push(lineNode);
870
+ lines.push(lineNode);
871
+ } else if (structure === "inline") lineNodes.push(lineNode);
872
+ });
873
+ if (structure === "classic") {
874
+ for (const transformer of transformers) codeNode = transformer?.code?.call(context, codeNode) || codeNode;
875
+ preNode.children.push(codeNode);
876
+ for (const transformer of transformers) preNode = transformer?.pre?.call(context, preNode) || preNode;
877
+ root.children.push(preNode);
878
+ } else if (structure === "inline") {
879
+ const syntheticLines = [];
880
+ let currentLine = {
881
+ type: "element",
882
+ tagName: "span",
883
+ properties: { class: "line" },
884
+ children: []
885
+ };
886
+ for (const child of root.children) if (child.type === "element" && child.tagName === "br") {
887
+ syntheticLines.push(currentLine);
888
+ currentLine = {
889
+ type: "element",
890
+ tagName: "span",
891
+ properties: { class: "line" },
892
+ children: []
893
+ };
894
+ } else if (child.type === "element" || child.type === "text") currentLine.children.push(child);
895
+ syntheticLines.push(currentLine);
896
+ let transformedCode = {
897
+ type: "element",
898
+ tagName: "code",
899
+ properties: {},
900
+ children: syntheticLines
901
+ };
902
+ for (const transformer of transformers) transformedCode = transformer?.code?.call(context, transformedCode) || transformedCode;
903
+ root.children = [];
904
+ for (let i = 0; i < transformedCode.children.length; i++) {
905
+ if (i > 0) root.children.push({
906
+ type: "element",
907
+ tagName: "br",
908
+ properties: {},
909
+ children: []
910
+ });
911
+ const line = transformedCode.children[i];
912
+ if (line.type === "element") root.children.push(...line.children);
913
+ }
914
+ }
915
+ let result = root;
916
+ for (const transformer of transformers) result = transformer?.root?.call(context, result) || result;
917
+ if (grammarState) setLastGrammarStateToMap(result, grammarState);
918
+ return result;
868
919
  }
869
920
  function mergeWhitespaceTokens(tokens) {
870
- return tokens.map((line) => {
871
- const newLine = [];
872
- let carryOnContent = "";
873
- let firstOffset;
874
- line.forEach((token, idx) => {
875
- const couldMerge = !(token.fontStyle && (token.fontStyle & FontStyle.Underline || token.fontStyle & FontStyle.Strikethrough));
876
- if (couldMerge && token.content.match(/^\s+$/) && line[idx + 1]) {
877
- if (firstOffset === void 0) firstOffset = token.offset;
878
- carryOnContent += token.content;
879
- } else if (carryOnContent) {
880
- if (couldMerge) newLine.push({
881
- ...token,
882
- offset: firstOffset,
883
- content: carryOnContent + token.content
884
- });
885
- else newLine.push({
886
- content: carryOnContent,
887
- offset: firstOffset
888
- }, token);
889
- firstOffset = void 0;
890
- carryOnContent = "";
891
- } else newLine.push(token);
892
- });
893
- return newLine;
894
- });
921
+ return tokens.map((line) => {
922
+ const newLine = [];
923
+ let carryOnContent = "";
924
+ let firstOffset;
925
+ line.forEach((token, idx) => {
926
+ const couldMerge = !(token.fontStyle && (token.fontStyle & FontStyle.Underline || token.fontStyle & FontStyle.Strikethrough));
927
+ if (couldMerge && token.content.match(/^\s+$/) && line[idx + 1]) {
928
+ if (firstOffset === void 0) firstOffset = token.offset;
929
+ carryOnContent += token.content;
930
+ } else if (carryOnContent) {
931
+ if (couldMerge) newLine.push({
932
+ ...token,
933
+ offset: firstOffset,
934
+ content: carryOnContent + token.content
935
+ });
936
+ else newLine.push({
937
+ content: carryOnContent,
938
+ offset: firstOffset
939
+ }, token);
940
+ firstOffset = void 0;
941
+ carryOnContent = "";
942
+ } else newLine.push(token);
943
+ });
944
+ return newLine;
945
+ });
895
946
  }
896
947
  function splitWhitespaceTokens(tokens) {
897
- return tokens.map((line) => {
898
- return line.flatMap((token) => {
899
- if (token.content.match(/^\s+$/)) return token;
900
- const match = token.content.match(/^(\s*)(.*?)(\s*)$/);
901
- if (!match) return token;
902
- const [, leading, content, trailing] = match;
903
- if (!leading && !trailing) return token;
904
- const expanded = [{
905
- ...token,
906
- offset: token.offset + leading.length,
907
- content
908
- }];
909
- if (leading) expanded.unshift({
910
- content: leading,
911
- offset: token.offset
912
- });
913
- if (trailing) expanded.push({
914
- content: trailing,
915
- offset: token.offset + leading.length + content.length
916
- });
917
- return expanded;
918
- });
919
- });
948
+ return tokens.map((line) => {
949
+ return line.flatMap((token) => {
950
+ if (token.content.match(/^\s+$/)) return token;
951
+ const match = token.content.match(/^(\s*)(.*?)(\s*)$/);
952
+ if (!match) return token;
953
+ const [, leading, content, trailing] = match;
954
+ if (!leading && !trailing) return token;
955
+ const expanded = [{
956
+ ...token,
957
+ offset: token.offset + leading.length,
958
+ content
959
+ }];
960
+ if (leading) expanded.unshift({
961
+ content: leading,
962
+ offset: token.offset
963
+ });
964
+ if (trailing) expanded.push({
965
+ content: trailing,
966
+ offset: token.offset + leading.length + content.length
967
+ });
968
+ return expanded;
969
+ });
970
+ });
920
971
  }
921
972
  function mergeAdjacentStyledTokens(tokens) {
922
- return tokens.map((line) => {
923
- const newLine = [];
924
- for (const token of line) {
925
- if (newLine.length === 0) {
926
- newLine.push({ ...token });
927
- continue;
928
- }
929
- const prevToken = newLine[newLine.length - 1];
930
- const prevStyle = stringifyTokenStyle(prevToken.htmlStyle || getTokenStyleObject(prevToken));
931
- const currentStyle = stringifyTokenStyle(token.htmlStyle || getTokenStyleObject(token));
932
- const isPrevDecorated = prevToken.fontStyle && (prevToken.fontStyle & FontStyle.Underline || prevToken.fontStyle & FontStyle.Strikethrough);
933
- const isDecorated = token.fontStyle && (token.fontStyle & FontStyle.Underline || token.fontStyle & FontStyle.Strikethrough);
934
- if (!isPrevDecorated && !isDecorated && prevStyle === currentStyle) prevToken.content += token.content;
935
- else newLine.push({ ...token });
936
- }
937
- return newLine;
938
- });
973
+ return tokens.map((line) => {
974
+ const newLine = [];
975
+ for (const token of line) {
976
+ if (newLine.length === 0) {
977
+ newLine.push({ ...token });
978
+ continue;
979
+ }
980
+ const prevToken = newLine[newLine.length - 1];
981
+ const prevStyle = stringifyTokenStyle(prevToken.htmlStyle || getTokenStyleObject(prevToken));
982
+ const currentStyle = stringifyTokenStyle(token.htmlStyle || getTokenStyleObject(token));
983
+ const isPrevDecorated = prevToken.fontStyle && (prevToken.fontStyle & FontStyle.Underline || prevToken.fontStyle & FontStyle.Strikethrough);
984
+ const isDecorated = token.fontStyle && (token.fontStyle & FontStyle.Underline || token.fontStyle & FontStyle.Strikethrough);
985
+ if (!isPrevDecorated && !isDecorated && prevStyle === currentStyle) prevToken.content += token.content;
986
+ else newLine.push({ ...token });
987
+ }
988
+ return newLine;
989
+ });
939
990
  }
940
- const hastToHtml = toHtml;
991
+ var hastToHtml = toHtml;
992
+ /**
993
+ * Get highlighted code in HTML.
994
+ */
941
995
  function codeToHtml(primitive, code, options) {
942
- const context = {
943
- meta: {},
944
- options,
945
- codeToHast: (_code, _options) => codeToHast(primitive, _code, _options),
946
- codeToTokens: (_code, _options) => codeToTokens(primitive, _code, _options)
947
- };
948
- let result = hastToHtml(codeToHast(primitive, code, options, context));
949
- for (const transformer of getTransformers(options)) result = transformer.postprocess?.call(context, result, options) || result;
950
- return result;
996
+ const context = {
997
+ meta: {},
998
+ options,
999
+ codeToHast: (_code, _options) => codeToHast(primitive, _code, _options),
1000
+ codeToTokens: (_code, _options) => codeToTokens(primitive, _code, _options)
1001
+ };
1002
+ let result = hastToHtml(codeToHast(primitive, code, options, context));
1003
+ for (const transformer of getTransformers(options)) result = transformer.postprocess?.call(context, result, options) || result;
1004
+ return result;
951
1005
  }
1006
+ /**
1007
+ * Create a Shiki core highlighter instance, with no languages or themes bundled.
1008
+ * Wasm and each language and theme must be loaded manually.
1009
+ *
1010
+ * @see http://shiki.style/guide/bundles#fine-grained-bundle
1011
+ */
952
1012
  async function createHighlighterCore(options) {
953
- const primitive = await createShikiPrimitiveAsync(options);
954
- return {
955
- getLastGrammarState: (...args) => getLastGrammarState(primitive, ...args),
956
- codeToTokensBase: (code, options2) => codeToTokensBase(primitive, code, options2),
957
- codeToTokensWithThemes: (code, options2) => codeToTokensWithThemes(primitive, code, options2),
958
- codeToTokens: (code, options2) => codeToTokens(primitive, code, options2),
959
- codeToHast: (code, options2) => codeToHast(primitive, code, options2),
960
- codeToHtml: (code, options2) => codeToHtml(primitive, code, options2),
961
- getBundledLanguages: () => ({}),
962
- getBundledThemes: () => ({}),
963
- ...primitive,
964
- getInternalContext: () => primitive
965
- };
1013
+ const primitive = await createShikiPrimitiveAsync(options);
1014
+ return {
1015
+ getLastGrammarState: (...args) => getLastGrammarState(primitive, ...args),
1016
+ codeToTokensBase: (code, options) => codeToTokensBase(primitive, code, options),
1017
+ codeToTokensWithThemes: (code, options) => codeToTokensWithThemes(primitive, code, options),
1018
+ codeToTokens: (code, options) => codeToTokens(primitive, code, options),
1019
+ codeToHast: (code, options) => codeToHast(primitive, code, options),
1020
+ codeToHtml: (code, options) => codeToHtml(primitive, code, options),
1021
+ getBundledLanguages: () => ({}),
1022
+ getBundledThemes: () => ({}),
1023
+ ...primitive,
1024
+ getInternalContext: () => primitive
1025
+ };
966
1026
  }
967
1027
  function createBundledHighlighter(options) {
968
- const bundledLanguages = options.langs;
969
- const bundledThemes = options.themes;
970
- const engine = options.engine;
971
- async function createHighlighter(options2) {
972
- function resolveLang(lang) {
973
- if (typeof lang === "string") {
974
- lang = options2.langAlias?.[lang] || lang;
975
- if (isSpecialLang(lang)) return [];
976
- const bundle = bundledLanguages[lang];
977
- if (!bundle) throw new ShikiError(`Language \`${lang}\` is not included in this bundle. You may want to load it from external source.`);
978
- return bundle;
979
- }
980
- return lang;
981
- }
982
- function resolveTheme(theme) {
983
- if (isSpecialTheme(theme)) return "none";
984
- if (typeof theme === "string") {
985
- const bundle = bundledThemes[theme];
986
- if (!bundle) throw new ShikiError(`Theme \`${theme}\` is not included in this bundle. You may want to load it from external source.`);
987
- return bundle;
988
- }
989
- return theme;
990
- }
991
- const _themes = (options2.themes ?? []).map((i) => resolveTheme(i));
992
- const langs = (options2.langs ?? []).map((i) => resolveLang(i));
993
- const core = await createHighlighterCore({
994
- engine: options2.engine ?? engine(),
995
- ...options2,
996
- themes: _themes,
997
- langs
998
- });
999
- return {
1000
- ...core,
1001
- loadLanguage(...langs2) {
1002
- return core.loadLanguage(...langs2.map(resolveLang));
1003
- },
1004
- loadTheme(...themes) {
1005
- return core.loadTheme(...themes.map(resolveTheme));
1006
- },
1007
- getBundledLanguages() {
1008
- return bundledLanguages;
1009
- },
1010
- getBundledThemes() {
1011
- return bundledThemes;
1012
- }
1013
- };
1014
- }
1015
- return createHighlighter;
1028
+ const bundledLanguages = options.langs;
1029
+ const bundledThemes = options.themes;
1030
+ const engine = options.engine;
1031
+ async function createHighlighter(options) {
1032
+ function resolveLang(lang) {
1033
+ if (typeof lang === "string") {
1034
+ lang = options.langAlias?.[lang] || lang;
1035
+ if (isSpecialLang(lang)) return [];
1036
+ const bundle = bundledLanguages[lang];
1037
+ if (!bundle) throw new ShikiError(`Language \`${lang}\` is not included in this bundle. You may want to load it from external source.`);
1038
+ return bundle;
1039
+ }
1040
+ return lang;
1041
+ }
1042
+ function resolveTheme(theme) {
1043
+ if (isSpecialTheme(theme)) return "none";
1044
+ if (typeof theme === "string") {
1045
+ const bundle = bundledThemes[theme];
1046
+ if (!bundle) throw new ShikiError(`Theme \`${theme}\` is not included in this bundle. You may want to load it from external source.`);
1047
+ return bundle;
1048
+ }
1049
+ return theme;
1050
+ }
1051
+ const _themes = (options.themes ?? []).map((i) => resolveTheme(i));
1052
+ const langs = (options.langs ?? []).map((i) => resolveLang(i));
1053
+ const core = await createHighlighterCore({
1054
+ engine: options.engine ?? engine(),
1055
+ ...options,
1056
+ themes: _themes,
1057
+ langs
1058
+ });
1059
+ return {
1060
+ ...core,
1061
+ loadLanguage(...langs) {
1062
+ return core.loadLanguage(...langs.map(resolveLang));
1063
+ },
1064
+ loadTheme(...themes) {
1065
+ return core.loadTheme(...themes.map(resolveTheme));
1066
+ },
1067
+ getBundledLanguages() {
1068
+ return bundledLanguages;
1069
+ },
1070
+ getBundledThemes() {
1071
+ return bundledThemes;
1072
+ }
1073
+ };
1074
+ }
1075
+ return createHighlighter;
1016
1076
  }
1017
1077
  function makeSingletonHighlighter(createHighlighter) {
1018
- let _shiki;
1019
- async function getSingletonHighlighter(options = {}) {
1020
- if (!_shiki) {
1021
- _shiki = createHighlighter({
1022
- ...options,
1023
- themes: [],
1024
- langs: []
1025
- });
1026
- const s = await _shiki;
1027
- await Promise.all([s.loadTheme(...options.themes || []), s.loadLanguage(...options.langs || [])]);
1028
- return s;
1029
- } else {
1030
- const s = await _shiki;
1031
- await Promise.all([s.loadTheme(...options.themes || []), s.loadLanguage(...options.langs || [])]);
1032
- return s;
1033
- }
1034
- }
1035
- return getSingletonHighlighter;
1078
+ let _shiki;
1079
+ async function getSingletonHighlighter(options = {}) {
1080
+ if (!_shiki) {
1081
+ _shiki = createHighlighter({
1082
+ ...options,
1083
+ themes: [],
1084
+ langs: []
1085
+ });
1086
+ const s = await _shiki;
1087
+ await Promise.all([s.loadTheme(...options.themes || []), s.loadLanguage(...options.langs || [])]);
1088
+ return s;
1089
+ } else {
1090
+ const s = await _shiki;
1091
+ await Promise.all([s.loadTheme(...options.themes || []), s.loadLanguage(...options.langs || [])]);
1092
+ return s;
1093
+ }
1094
+ }
1095
+ return getSingletonHighlighter;
1036
1096
  }
1037
1097
  function createSingletonShorthands(createHighlighter, config) {
1038
- const getSingletonHighlighter = makeSingletonHighlighter(createHighlighter);
1039
- async function get(code, options) {
1040
- const shiki = await getSingletonHighlighter({
1041
- langs: [options.lang],
1042
- themes: "theme" in options ? [options.theme] : Object.values(options.themes)
1043
- });
1044
- const langs = await config?.guessEmbeddedLanguages?.(code, options.lang, shiki);
1045
- if (langs) await shiki.loadLanguage(...langs);
1046
- return shiki;
1047
- }
1048
- return {
1049
- getSingletonHighlighter(options) {
1050
- return getSingletonHighlighter(options);
1051
- },
1052
- async codeToHtml(code, options) {
1053
- return (await get(code, options)).codeToHtml(code, options);
1054
- },
1055
- async codeToHast(code, options) {
1056
- return (await get(code, options)).codeToHast(code, options);
1057
- },
1058
- async codeToTokens(code, options) {
1059
- return (await get(code, options)).codeToTokens(code, options);
1060
- },
1061
- async codeToTokensBase(code, options) {
1062
- return (await get(code, options)).codeToTokensBase(code, options);
1063
- },
1064
- async codeToTokensWithThemes(code, options) {
1065
- return (await get(code, options)).codeToTokensWithThemes(code, options);
1066
- },
1067
- async getLastGrammarState(code, options) {
1068
- return (await getSingletonHighlighter({
1069
- langs: [options.lang],
1070
- themes: [options.theme]
1071
- })).getLastGrammarState(code, options);
1072
- }
1073
- };
1098
+ const getSingletonHighlighter = makeSingletonHighlighter(createHighlighter);
1099
+ async function get(code, options) {
1100
+ const shiki = await getSingletonHighlighter({
1101
+ langs: [options.lang],
1102
+ themes: "theme" in options ? [options.theme] : Object.values(options.themes)
1103
+ });
1104
+ const langs = await config?.guessEmbeddedLanguages?.(code, options.lang, shiki);
1105
+ if (langs) await shiki.loadLanguage(...langs);
1106
+ return shiki;
1107
+ }
1108
+ return {
1109
+ getSingletonHighlighter(options) {
1110
+ return getSingletonHighlighter(options);
1111
+ },
1112
+ async codeToHtml(code, options) {
1113
+ return (await get(code, options)).codeToHtml(code, options);
1114
+ },
1115
+ async codeToHast(code, options) {
1116
+ return (await get(code, options)).codeToHast(code, options);
1117
+ },
1118
+ async codeToTokens(code, options) {
1119
+ return (await get(code, options)).codeToTokens(code, options);
1120
+ },
1121
+ async codeToTokensBase(code, options) {
1122
+ return (await get(code, options)).codeToTokensBase(code, options);
1123
+ },
1124
+ async codeToTokensWithThemes(code, options) {
1125
+ return (await get(code, options)).codeToTokensWithThemes(code, options);
1126
+ },
1127
+ async getLastGrammarState(code, options) {
1128
+ return (await getSingletonHighlighter({
1129
+ langs: [options.lang],
1130
+ themes: [options.theme]
1131
+ })).getLastGrammarState(code, options);
1132
+ }
1133
+ };
1074
1134
  }
1075
- export {
1076
- ShikiError,
1077
- addClassToHast,
1078
- applyColorReplacements,
1079
- codeToHast,
1080
- codeToHtml,
1081
- codeToTokens,
1082
- codeToTokensBase,
1083
- codeToTokensWithThemes,
1084
- createBundledHighlighter,
1085
- createHighlighterCore,
1086
- createPositionConverter,
1087
- createShikiPrimitive,
1088
- createShikiPrimitiveAsync,
1089
- createSingletonShorthands,
1090
- flatTokenVariants,
1091
- getLastGrammarState,
1092
- getTokenStyleObject,
1093
- guessEmbeddedLanguages,
1094
- hastToHtml,
1095
- isNoneTheme,
1096
- isPlainLang,
1097
- isSpecialLang,
1098
- isSpecialTheme,
1099
- makeSingletonHighlighter,
1100
- normalizeGetter,
1101
- normalizeTheme,
1102
- resolveColorReplacements,
1103
- splitLines,
1104
- splitToken,
1105
- splitTokens,
1106
- stringifyTokenStyle,
1107
- toArray,
1108
- tokenizeAnsiWithTheme,
1109
- tokenizeWithTheme,
1110
- tokensToHast,
1111
- transformerDecorations
1112
- };
1135
+ export { addClassToHast, applyColorReplacements, codeToHast, codeToHtml, codeToTokens, codeToTokensBase, createBundledHighlighter, createHighlighterCore, createPositionConverter, createSingletonShorthands, flatTokenVariants, getLastGrammarState, getTokenStyleObject, guessEmbeddedLanguages, hastToHtml, isNoneTheme, isPlainLang, isSpecialLang, isSpecialTheme, makeSingletonHighlighter, resolveColorReplacements, splitLines, splitToken, splitTokens, stringifyTokenStyle, tokenizeAnsiWithTheme, tokensToHast, transformerDecorations };