svelte-highlight 7.14.1 → 7.16.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (1079) hide show
  1. package/AnsiOutput.svelte +22 -3
  2. package/CopyButton.svelte +10 -2
  3. package/CopyButton.svelte.d.ts +8 -1
  4. package/Highlight.svelte +15 -5
  5. package/Highlight.svelte.d.ts +15 -0
  6. package/HighlightAuto.svelte +29 -8
  7. package/HighlightAuto.svelte.d.ts +17 -0
  8. package/HighlightEditable.svelte +460 -45
  9. package/HighlightEditable.svelte.d.ts +35 -0
  10. package/HighlightStream.svelte +269 -0
  11. package/HighlightStream.svelte.d.ts +90 -0
  12. package/HighlightStyle.svelte +114 -12
  13. package/HighlightStyle.svelte.d.ts +25 -12
  14. package/HighlightSvelte.svelte +15 -5
  15. package/HighlightSvelte.svelte.d.ts +15 -0
  16. package/HighlightVirtual.svelte +229 -0
  17. package/HighlightVirtual.svelte.d.ts +36 -0
  18. package/LICENSE.highlight.txt +39 -0
  19. package/README.md +496 -35
  20. package/Typewriter.svelte +111 -58
  21. package/action.js +29 -6
  22. package/ansi.d.ts +9 -0
  23. package/ansi.js +112 -4
  24. package/compat.d.ts +13 -0
  25. package/compat.js +42 -0
  26. package/convert-language.d.ts +13 -0
  27. package/convert-language.js +203 -0
  28. package/copy-transforms.d.ts +13 -0
  29. package/copy-transforms.js +41 -0
  30. package/engine.d.ts +215 -0
  31. package/engine.js +1283 -0
  32. package/highlight-theme.d.ts +13 -0
  33. package/highlight-theme.js +253 -0
  34. package/incremental-tokenize.js +242 -0
  35. package/index.d.ts +4 -0
  36. package/index.js +3 -0
  37. package/languages/1c.js +1360 -3
  38. package/languages/abnf.js +89 -3
  39. package/languages/accesslog.js +88 -3
  40. package/languages/actionscript.js +221 -3
  41. package/languages/ada.js +235 -3
  42. package/languages/all.d.ts +4 -0
  43. package/languages/all.js +497 -0
  44. package/languages/angelscript.js +177 -3
  45. package/languages/apache.js +99 -3
  46. package/languages/applescript.js +291 -3
  47. package/languages/arcade.js +1040 -3
  48. package/languages/arduino.js +6201 -3
  49. package/languages/armasm.js +551 -3
  50. package/languages/asciidoc.js +237 -3
  51. package/languages/aspectj.js +770 -3
  52. package/languages/astro.js +70 -60
  53. package/languages/autohotkey.js +133 -3
  54. package/languages/autoit.js +598 -3
  55. package/languages/avrasm.js +372 -3
  56. package/languages/awk.js +115 -3
  57. package/languages/axapta.js +451 -3
  58. package/languages/bash.js +335 -3
  59. package/languages/basic.js +262 -3
  60. package/languages/bibtex.js +47 -45
  61. package/languages/bicep.js +141 -75
  62. package/languages/blade.js +96 -88
  63. package/languages/bnf.js +53 -3
  64. package/languages/brainfuck.js +69 -3
  65. package/languages/c.js +2283 -3
  66. package/languages/caddy.js +131 -56
  67. package/languages/cairo.js +165 -81
  68. package/languages/cal.js +197 -3
  69. package/languages/capnproto.js +105 -3
  70. package/languages/ceylon.js +188 -3
  71. package/languages/clarity.js +157 -52
  72. package/languages/clean.js +107 -3
  73. package/languages/clojure-repl.js +25 -3
  74. package/languages/clojure.js +553 -3
  75. package/languages/cmake.js +223 -3
  76. package/languages/coffeescript.js +827 -3
  77. package/languages/coq.js +447 -3
  78. package/languages/cos.js +183 -3
  79. package/languages/cpp.js +2288 -3
  80. package/languages/crmsh.js +201 -3
  81. package/languages/crystal.js +740 -3
  82. package/languages/csharp.js +1113 -3
  83. package/languages/csp.js +49 -3
  84. package/languages/css.js +216 -3
  85. package/languages/cue.js +137 -95
  86. package/languages/cypher.js +145 -67
  87. package/languages/d.js +244 -3
  88. package/languages/d2.js +118 -58
  89. package/languages/dart.js +309 -3
  90. package/languages/dax.js +270 -73
  91. package/languages/delphi.js +468 -3
  92. package/languages/dhall.js +160 -78
  93. package/languages/diff.js +37 -3
  94. package/languages/django.js +216 -3
  95. package/languages/dns.js +103 -3
  96. package/languages/dockerfile.js +82 -3
  97. package/languages/dos.js +173 -3
  98. package/languages/dotenv.js +71 -45
  99. package/languages/dsconfig.js +76 -3
  100. package/languages/dts.js +199 -3
  101. package/languages/dust.js +57 -3
  102. package/languages/ebnf.js +45 -3
  103. package/languages/elixir.js +517 -3
  104. package/languages/elm.js +172 -3
  105. package/languages/erb.js +39 -3
  106. package/languages/erlang-repl.js +108 -3
  107. package/languages/erlang.js +355 -3
  108. package/languages/excel.js +593 -3
  109. package/languages/fish.js +117 -73
  110. package/languages/fix.js +38 -3
  111. package/languages/flix.js +107 -3
  112. package/languages/fortran.js +630 -3
  113. package/languages/fsharp.js +850 -3
  114. package/languages/gams.js +705 -3
  115. package/languages/gauss.js +3845 -3
  116. package/languages/gcode.js +181 -3
  117. package/languages/gdscript.d.ts +2 -0
  118. package/languages/gdscript.js +158 -0
  119. package/languages/gherkin.js +68 -3
  120. package/languages/gleam.js +115 -68
  121. package/languages/glsl.js +638 -3
  122. package/languages/gml.js +3151 -3
  123. package/languages/go.js +253 -3
  124. package/languages/golo.js +97 -3
  125. package/languages/gradle.js +233 -3
  126. package/languages/graphql.js +101 -3
  127. package/languages/groovy.js +209 -3
  128. package/languages/groq.js +94 -86
  129. package/languages/haml.js +111 -3
  130. package/languages/handlebars.js +368 -3
  131. package/languages/haskell.js +272 -3
  132. package/languages/haxe.js +290 -3
  133. package/languages/hcl.js +143 -80
  134. package/languages/heex.d.ts +2 -0
  135. package/languages/heex.js +130 -0
  136. package/languages/hlsl.js +303 -89
  137. package/languages/hsp.js +490 -3
  138. package/languages/html.js +203 -158
  139. package/languages/http.js +84 -3
  140. package/languages/hy.js +423 -3
  141. package/languages/index.d.ts +11 -2
  142. package/languages/index.js +3 -0
  143. package/languages/inform7.js +63 -3
  144. package/languages/ini.js +89 -3
  145. package/languages/irpf90.js +612 -3
  146. package/languages/isbl.js +10135 -3
  147. package/languages/java.js +550 -3
  148. package/languages/javascript.js +1240 -3
  149. package/languages/jboss-cli.js +114 -3
  150. package/languages/jq.js +328 -117
  151. package/languages/json.js +96 -3
  152. package/languages/json5.js +107 -53
  153. package/languages/jsonc.js +75 -34
  154. package/languages/jsonnet.js +138 -68
  155. package/languages/julia-repl.js +33 -3
  156. package/languages/julia.js +621 -3
  157. package/languages/just.js +225 -116
  158. package/languages/kotlin.js +595 -3
  159. package/languages/kql.js +275 -113
  160. package/languages/lasso.js +568 -3
  161. package/languages/latex.js +670 -3
  162. package/languages/ldif.js +41 -3
  163. package/languages/leaf.js +60 -3
  164. package/languages/less.js +787 -3
  165. package/languages/liquid.js +113 -54
  166. package/languages/lisp.js +150 -3
  167. package/languages/livecodeserver.js +828 -3
  168. package/languages/livescript.js +1082 -3
  169. package/languages/llvm.js +369 -3
  170. package/languages/logql.js +119 -79
  171. package/languages/lsl.js +130 -3
  172. package/languages/lua.js +278 -3
  173. package/languages/makefile.js +124 -3
  174. package/languages/markdown.js +222 -3
  175. package/languages/marko.js +148 -165
  176. package/languages/mathematica.js +99 -3
  177. package/languages/matlab.js +335 -3
  178. package/languages/maxima.js +2495 -3
  179. package/languages/mdx.js +106 -74
  180. package/languages/mel.js +1309 -3
  181. package/languages/mercury.js +231 -3
  182. package/languages/mipsasm.js +289 -3
  183. package/languages/mizar.js +115 -3
  184. package/languages/mojolicious.js +32 -3
  185. package/languages/monkey.js +205 -3
  186. package/languages/moonscript.js +334 -3
  187. package/languages/move.js +149 -89
  188. package/languages/n1ql.js +375 -3
  189. package/languages/nestedtext.js +76 -3
  190. package/languages/nginx.js +201 -3
  191. package/languages/nickel.js +126 -77
  192. package/languages/nim.js +206 -3
  193. package/languages/nix.js +310 -3
  194. package/languages/node-repl.js +33 -3
  195. package/languages/nsis.js +441 -3
  196. package/languages/nushell.js +158 -97
  197. package/languages/objectivec.js +303 -3
  198. package/languages/ocaml.js +165 -3
  199. package/languages/odin.js +176 -75
  200. package/languages/openscad.js +185 -3
  201. package/languages/oxygene.js +459 -3
  202. package/languages/parser3.js +111 -3
  203. package/languages/perl.js +864 -3
  204. package/languages/pf.js +168 -3
  205. package/languages/pgsql.js +1253 -3
  206. package/languages/php-template.js +28 -3
  207. package/languages/php.js +1031 -3
  208. package/languages/pkl.js +190 -76
  209. package/languages/plaintext.js +17 -3
  210. package/languages/pony.js +132 -3
  211. package/languages/powershell.js +405 -3
  212. package/languages/prisma.js +95 -68
  213. package/languages/processing.js +445 -3
  214. package/languages/profile.js +66 -3
  215. package/languages/prolog.js +142 -3
  216. package/languages/promql.js +204 -91
  217. package/languages/properties.js +75 -3
  218. package/languages/protobuf.js +106 -3
  219. package/languages/pug.js +119 -67
  220. package/languages/puppet.js +415 -3
  221. package/languages/purebasic.js +187 -3
  222. package/languages/python-repl.js +35 -3
  223. package/languages/python.js +784 -3
  224. package/languages/q.js +215 -3
  225. package/languages/qml.js +401 -3
  226. package/languages/r.js +351 -3
  227. package/languages/razor.js +417 -126
  228. package/languages/reasonml.js +207 -3
  229. package/languages/rego.js +179 -91
  230. package/languages/rescript.js +202 -138
  231. package/languages/rib.js +148 -3
  232. package/languages/roboconf.js +128 -3
  233. package/languages/routeros.js +169 -3
  234. package/languages/rsl.js +175 -3
  235. package/languages/rst.js +111 -142
  236. package/languages/ruby.js +890 -3
  237. package/languages/ruleslanguage.js +377 -3
  238. package/languages/rust.js +392 -3
  239. package/languages/sas.js +211 -3
  240. package/languages/scala.js +332 -3
  241. package/languages/scheme.js +398 -3
  242. package/languages/scilab.js +190 -3
  243. package/languages/scss.js +236 -3
  244. package/languages/shell.js +32 -3
  245. package/languages/smali.js +91 -3
  246. package/languages/smalltalk.js +89 -3
  247. package/languages/sml.js +145 -3
  248. package/languages/solidity.js +400 -99
  249. package/languages/sparql.d.ts +2 -0
  250. package/languages/sparql.js +153 -0
  251. package/languages/sqf.js +2641 -3
  252. package/languages/sql.js +474 -3
  253. package/languages/stan.js +526 -3
  254. package/languages/starlark.js +122 -51
  255. package/languages/stata.js +1903 -3
  256. package/languages/step21.js +100 -3
  257. package/languages/stylus.js +261 -3
  258. package/languages/subunit.js +59 -3
  259. package/languages/svelte.js +148 -141
  260. package/languages/swift.js +2245 -3
  261. package/languages/taggerscript.js +51 -3
  262. package/languages/tap.js +48 -3
  263. package/languages/tcl.js +218 -3
  264. package/languages/templ.js +254 -250
  265. package/languages/thrift.js +129 -3
  266. package/languages/toml.js +107 -74
  267. package/languages/tp.js +209 -3
  268. package/languages/twig.js +204 -3
  269. package/languages/typescript.js +1410 -3
  270. package/languages/typst.js +340 -183
  271. package/languages/v.js +230 -101
  272. package/languages/vala.js +161 -3
  273. package/languages/vbnet.js +333 -3
  274. package/languages/vbscript-html.js +18 -3
  275. package/languages/vbscript.js +225 -3
  276. package/languages/verilog.js +576 -3
  277. package/languages/vhdl.js +229 -3
  278. package/languages/vim.js +1294 -3
  279. package/languages/vue.js +99 -98
  280. package/languages/vyper.js +144 -72
  281. package/languages/wasm.js +140 -3
  282. package/languages/wgsl.js +370 -67
  283. package/languages/wren.js +311 -3
  284. package/languages/x86asm.js +2330 -3
  285. package/languages/xl.js +474 -3
  286. package/languages/xml.js +198 -3
  287. package/languages/xquery.js +315 -3
  288. package/languages/yaml.js +267 -3
  289. package/languages/zephir.js +333 -3
  290. package/languages/zig.js +196 -100
  291. package/package.json +61 -2
  292. package/preprocessor.js +3 -5
  293. package/registry.d.ts +17 -0
  294. package/registry.js +17 -0
  295. package/text-diff.d.ts +8 -0
  296. package/text-diff.js +46 -0
  297. package/textmate-theme.d.ts +41 -0
  298. package/textmate-theme.js +211 -0
  299. package/theme-style.js +94 -0
  300. package/theme-vars.js +205 -0
  301. package/theme.d.ts +104 -0
  302. package/theme.js +130 -0
  303. package/themes/1c-light.css +1 -0
  304. package/themes/1c-light.d.ts +1 -0
  305. package/themes/1c-light.js +53 -0
  306. package/themes/3024.css +1 -0
  307. package/themes/3024.d.ts +1 -0
  308. package/themes/3024.js +62 -0
  309. package/themes/_shl-fallbacks.d.ts +1 -0
  310. package/themes/_shl-fallbacks.js +27 -0
  311. package/themes/a11y-dark.css +29 -0
  312. package/themes/a11y-dark.d.ts +1 -0
  313. package/themes/a11y-dark.js +47 -0
  314. package/themes/a11y-light.css +29 -0
  315. package/themes/a11y-light.d.ts +1 -0
  316. package/themes/a11y-light.js +47 -0
  317. package/themes/agate.css +1 -0
  318. package/themes/agate.d.ts +1 -0
  319. package/themes/agate.js +58 -0
  320. package/themes/an-old-hope.css +1 -0
  321. package/themes/an-old-hope.d.ts +1 -0
  322. package/themes/an-old-hope.js +45 -0
  323. package/themes/androidstudio.css +1 -0
  324. package/themes/androidstudio.d.ts +1 -0
  325. package/themes/androidstudio.js +45 -0
  326. package/themes/apathy.css +1 -0
  327. package/themes/apathy.d.ts +1 -0
  328. package/themes/apathy.js +62 -0
  329. package/themes/apprentice.css +1 -0
  330. package/themes/apprentice.d.ts +1 -0
  331. package/themes/apprentice.js +62 -0
  332. package/themes/arduino-light.css +1 -0
  333. package/themes/arduino-light.d.ts +1 -0
  334. package/themes/arduino-light.js +52 -0
  335. package/themes/arta.css +1 -0
  336. package/themes/arta.d.ts +1 -0
  337. package/themes/arta.js +50 -0
  338. package/themes/ascetic.css +1 -0
  339. package/themes/ascetic.d.ts +1 -0
  340. package/themes/ascetic.js +45 -0
  341. package/themes/ashes.css +1 -0
  342. package/themes/ashes.d.ts +1 -0
  343. package/themes/ashes.js +62 -0
  344. package/themes/atelier-cave-light.css +1 -0
  345. package/themes/atelier-cave-light.d.ts +1 -0
  346. package/themes/atelier-cave-light.js +62 -0
  347. package/themes/atelier-cave.css +1 -0
  348. package/themes/atelier-cave.d.ts +1 -0
  349. package/themes/atelier-cave.js +62 -0
  350. package/themes/atelier-dune-light.css +1 -0
  351. package/themes/atelier-dune-light.d.ts +1 -0
  352. package/themes/atelier-dune-light.js +62 -0
  353. package/themes/atelier-dune.css +1 -0
  354. package/themes/atelier-dune.d.ts +1 -0
  355. package/themes/atelier-dune.js +62 -0
  356. package/themes/atelier-estuary-light.css +1 -0
  357. package/themes/atelier-estuary-light.d.ts +1 -0
  358. package/themes/atelier-estuary-light.js +62 -0
  359. package/themes/atelier-estuary.css +1 -0
  360. package/themes/atelier-estuary.d.ts +1 -0
  361. package/themes/atelier-estuary.js +62 -0
  362. package/themes/atelier-forest-light.css +1 -0
  363. package/themes/atelier-forest-light.d.ts +1 -0
  364. package/themes/atelier-forest-light.js +62 -0
  365. package/themes/atelier-forest.css +1 -0
  366. package/themes/atelier-forest.d.ts +1 -0
  367. package/themes/atelier-forest.js +62 -0
  368. package/themes/atelier-heath-light.css +1 -0
  369. package/themes/atelier-heath-light.d.ts +1 -0
  370. package/themes/atelier-heath-light.js +62 -0
  371. package/themes/atelier-heath.css +1 -0
  372. package/themes/atelier-heath.d.ts +1 -0
  373. package/themes/atelier-heath.js +62 -0
  374. package/themes/atelier-lakeside-light.css +1 -0
  375. package/themes/atelier-lakeside-light.d.ts +1 -0
  376. package/themes/atelier-lakeside-light.js +62 -0
  377. package/themes/atelier-lakeside.css +1 -0
  378. package/themes/atelier-lakeside.d.ts +1 -0
  379. package/themes/atelier-lakeside.js +62 -0
  380. package/themes/atelier-plateau-light.css +1 -0
  381. package/themes/atelier-plateau-light.d.ts +1 -0
  382. package/themes/atelier-plateau-light.js +62 -0
  383. package/themes/atelier-plateau.css +1 -0
  384. package/themes/atelier-plateau.d.ts +1 -0
  385. package/themes/atelier-plateau.js +62 -0
  386. package/themes/atelier-savanna-light.css +1 -0
  387. package/themes/atelier-savanna-light.d.ts +1 -0
  388. package/themes/atelier-savanna-light.js +62 -0
  389. package/themes/atelier-savanna.css +1 -0
  390. package/themes/atelier-savanna.d.ts +1 -0
  391. package/themes/atelier-savanna.js +62 -0
  392. package/themes/atelier-seaside-light.css +1 -0
  393. package/themes/atelier-seaside-light.d.ts +1 -0
  394. package/themes/atelier-seaside-light.js +62 -0
  395. package/themes/atelier-seaside.css +1 -0
  396. package/themes/atelier-seaside.d.ts +1 -0
  397. package/themes/atelier-seaside.js +62 -0
  398. package/themes/atelier-sulphurpool-light.css +1 -0
  399. package/themes/atelier-sulphurpool-light.d.ts +1 -0
  400. package/themes/atelier-sulphurpool-light.js +62 -0
  401. package/themes/atelier-sulphurpool.css +1 -0
  402. package/themes/atelier-sulphurpool.d.ts +1 -0
  403. package/themes/atelier-sulphurpool.js +62 -0
  404. package/themes/atlas.css +1 -0
  405. package/themes/atlas.d.ts +1 -0
  406. package/themes/atlas.js +62 -0
  407. package/themes/atom-one-dark-reasonable.css +1 -0
  408. package/themes/atom-one-dark-reasonable.d.ts +1 -0
  409. package/themes/atom-one-dark-reasonable.js +62 -0
  410. package/themes/atom-one-dark.css +1 -0
  411. package/themes/atom-one-dark.d.ts +1 -0
  412. package/themes/atom-one-dark.js +54 -0
  413. package/themes/atom-one-light.css +1 -0
  414. package/themes/atom-one-light.d.ts +1 -0
  415. package/themes/atom-one-light.js +54 -0
  416. package/themes/base.css +1 -0
  417. package/themes/base16-github.css +1 -0
  418. package/themes/base16-github.d.ts +1 -0
  419. package/themes/base16-github.js +62 -0
  420. package/themes/base16-ir-black.css +1 -0
  421. package/themes/base16-ir-black.d.ts +1 -0
  422. package/themes/base16-ir-black.js +62 -0
  423. package/themes/base16-monokai.css +1 -0
  424. package/themes/base16-monokai.d.ts +1 -0
  425. package/themes/base16-monokai.js +62 -0
  426. package/themes/base16-nord.css +1 -0
  427. package/themes/base16-nord.d.ts +1 -0
  428. package/themes/base16-nord.js +62 -0
  429. package/themes/bespin.css +1 -0
  430. package/themes/bespin.d.ts +1 -0
  431. package/themes/bespin.js +62 -0
  432. package/themes/black-metal-bathory.css +1 -0
  433. package/themes/black-metal-bathory.d.ts +1 -0
  434. package/themes/black-metal-bathory.js +62 -0
  435. package/themes/black-metal-burzum.css +1 -0
  436. package/themes/black-metal-burzum.d.ts +1 -0
  437. package/themes/black-metal-burzum.js +62 -0
  438. package/themes/black-metal-dark-funeral.css +1 -0
  439. package/themes/black-metal-dark-funeral.d.ts +1 -0
  440. package/themes/black-metal-dark-funeral.js +62 -0
  441. package/themes/black-metal-gorgoroth.css +1 -0
  442. package/themes/black-metal-gorgoroth.d.ts +1 -0
  443. package/themes/black-metal-gorgoroth.js +62 -0
  444. package/themes/black-metal-immortal.css +1 -0
  445. package/themes/black-metal-immortal.d.ts +1 -0
  446. package/themes/black-metal-immortal.js +62 -0
  447. package/themes/black-metal-khold.css +1 -0
  448. package/themes/black-metal-khold.d.ts +1 -0
  449. package/themes/black-metal-khold.js +62 -0
  450. package/themes/black-metal-marduk.css +1 -0
  451. package/themes/black-metal-marduk.d.ts +1 -0
  452. package/themes/black-metal-marduk.js +62 -0
  453. package/themes/black-metal-mayhem.css +1 -0
  454. package/themes/black-metal-mayhem.d.ts +1 -0
  455. package/themes/black-metal-mayhem.js +62 -0
  456. package/themes/black-metal-nile.css +1 -0
  457. package/themes/black-metal-nile.d.ts +1 -0
  458. package/themes/black-metal-nile.js +62 -0
  459. package/themes/black-metal-venom.css +1 -0
  460. package/themes/black-metal-venom.d.ts +1 -0
  461. package/themes/black-metal-venom.js +62 -0
  462. package/themes/black-metal.css +1 -0
  463. package/themes/black-metal.d.ts +1 -0
  464. package/themes/black-metal.js +62 -0
  465. package/themes/brewer.css +1 -0
  466. package/themes/brewer.d.ts +1 -0
  467. package/themes/brewer.js +62 -0
  468. package/themes/bright.css +1 -0
  469. package/themes/bright.d.ts +1 -0
  470. package/themes/bright.js +62 -0
  471. package/themes/brogrammer.css +1 -0
  472. package/themes/brogrammer.d.ts +1 -0
  473. package/themes/brogrammer.js +62 -0
  474. package/themes/brown-paper.css +1 -0
  475. package/themes/brown-paper.d.ts +1 -0
  476. package/themes/brown-paper.js +53 -0
  477. package/themes/brush-trees-dark.css +1 -0
  478. package/themes/brush-trees-dark.d.ts +1 -0
  479. package/themes/brush-trees-dark.js +62 -0
  480. package/themes/brush-trees.css +1 -0
  481. package/themes/brush-trees.d.ts +1 -0
  482. package/themes/brush-trees.js +62 -0
  483. package/themes/chalk.css +1 -0
  484. package/themes/chalk.d.ts +1 -0
  485. package/themes/chalk.js +62 -0
  486. package/themes/circus.css +1 -0
  487. package/themes/circus.d.ts +1 -0
  488. package/themes/circus.js +62 -0
  489. package/themes/classic-dark.css +1 -0
  490. package/themes/classic-dark.d.ts +1 -0
  491. package/themes/classic-dark.js +62 -0
  492. package/themes/classic-light.css +1 -0
  493. package/themes/classic-light.d.ts +1 -0
  494. package/themes/classic-light.js +62 -0
  495. package/themes/codepen-embed.css +1 -0
  496. package/themes/codepen-embed.d.ts +1 -0
  497. package/themes/codepen-embed.js +45 -0
  498. package/themes/codeschool.css +1 -0
  499. package/themes/codeschool.d.ts +1 -0
  500. package/themes/codeschool.js +62 -0
  501. package/themes/color-brewer.css +1 -0
  502. package/themes/color-brewer.d.ts +1 -0
  503. package/themes/color-brewer.js +45 -0
  504. package/themes/colors.css +1 -0
  505. package/themes/colors.d.ts +1 -0
  506. package/themes/colors.js +62 -0
  507. package/themes/cupcake.css +1 -0
  508. package/themes/cupcake.d.ts +1 -0
  509. package/themes/cupcake.js +62 -0
  510. package/themes/cupertino.css +1 -0
  511. package/themes/cupertino.d.ts +1 -0
  512. package/themes/cupertino.js +62 -0
  513. package/themes/cybertopia-cherry.css +1 -0
  514. package/themes/cybertopia-cherry.d.ts +1 -0
  515. package/themes/cybertopia-cherry.js +61 -0
  516. package/themes/cybertopia-dimmer.css +1 -0
  517. package/themes/cybertopia-dimmer.d.ts +1 -0
  518. package/themes/cybertopia-dimmer.js +61 -0
  519. package/themes/cybertopia-icecap.css +1 -0
  520. package/themes/cybertopia-icecap.d.ts +1 -0
  521. package/themes/cybertopia-icecap.js +61 -0
  522. package/themes/cybertopia-saturated.css +1 -0
  523. package/themes/cybertopia-saturated.d.ts +1 -0
  524. package/themes/cybertopia-saturated.js +61 -0
  525. package/themes/danqing.css +1 -0
  526. package/themes/danqing.d.ts +1 -0
  527. package/themes/danqing.js +62 -0
  528. package/themes/darcula.css +1 -0
  529. package/themes/darcula.d.ts +1 -0
  530. package/themes/darcula.js +62 -0
  531. package/themes/dark-violet.css +1 -0
  532. package/themes/dark-violet.d.ts +1 -0
  533. package/themes/dark-violet.js +62 -0
  534. package/themes/dark.css +1 -0
  535. package/themes/dark.d.ts +1 -0
  536. package/themes/dark.js +52 -0
  537. package/themes/darkmoss.css +1 -0
  538. package/themes/darkmoss.d.ts +1 -0
  539. package/themes/darkmoss.js +62 -0
  540. package/themes/darktooth.css +1 -0
  541. package/themes/darktooth.d.ts +1 -0
  542. package/themes/darktooth.js +62 -0
  543. package/themes/decaf.css +1 -0
  544. package/themes/decaf.d.ts +1 -0
  545. package/themes/decaf.js +62 -0
  546. package/themes/default-dark.css +1 -0
  547. package/themes/default-dark.d.ts +1 -0
  548. package/themes/default-dark.js +62 -0
  549. package/themes/default-light.css +1 -0
  550. package/themes/default-light.d.ts +1 -0
  551. package/themes/default-light.js +62 -0
  552. package/themes/default.css +1 -0
  553. package/themes/default.d.ts +1 -0
  554. package/themes/default.js +59 -0
  555. package/themes/devibeans.css +1 -0
  556. package/themes/devibeans.d.ts +1 -0
  557. package/themes/devibeans.js +52 -0
  558. package/themes/dirtysea.css +1 -0
  559. package/themes/dirtysea.d.ts +1 -0
  560. package/themes/dirtysea.js +62 -0
  561. package/themes/docco.css +1 -0
  562. package/themes/docco.d.ts +1 -0
  563. package/themes/docco.js +57 -0
  564. package/themes/dracula.css +1 -0
  565. package/themes/dracula.d.ts +1 -0
  566. package/themes/dracula.js +62 -0
  567. package/themes/edge-dark.css +1 -0
  568. package/themes/edge-dark.d.ts +1 -0
  569. package/themes/edge-dark.js +62 -0
  570. package/themes/edge-light.css +1 -0
  571. package/themes/edge-light.d.ts +1 -0
  572. package/themes/edge-light.js +62 -0
  573. package/themes/eighties.css +1 -0
  574. package/themes/eighties.d.ts +1 -0
  575. package/themes/eighties.js +62 -0
  576. package/themes/embers.css +1 -0
  577. package/themes/embers.d.ts +1 -0
  578. package/themes/embers.js +62 -0
  579. package/themes/equilibrium-dark.css +1 -0
  580. package/themes/equilibrium-dark.d.ts +1 -0
  581. package/themes/equilibrium-dark.js +62 -0
  582. package/themes/equilibrium-gray-dark.css +1 -0
  583. package/themes/equilibrium-gray-dark.d.ts +1 -0
  584. package/themes/equilibrium-gray-dark.js +62 -0
  585. package/themes/equilibrium-gray-light.css +1 -0
  586. package/themes/equilibrium-gray-light.d.ts +1 -0
  587. package/themes/equilibrium-gray-light.js +62 -0
  588. package/themes/equilibrium-light.css +1 -0
  589. package/themes/equilibrium-light.d.ts +1 -0
  590. package/themes/equilibrium-light.js +62 -0
  591. package/themes/espresso.css +1 -0
  592. package/themes/espresso.d.ts +1 -0
  593. package/themes/espresso.js +62 -0
  594. package/themes/eva-dim.css +1 -0
  595. package/themes/eva-dim.d.ts +1 -0
  596. package/themes/eva-dim.js +62 -0
  597. package/themes/eva.css +1 -0
  598. package/themes/eva.d.ts +1 -0
  599. package/themes/eva.js +62 -0
  600. package/themes/far.css +1 -0
  601. package/themes/far.d.ts +1 -0
  602. package/themes/far.js +50 -0
  603. package/themes/felipec.css +1 -0
  604. package/themes/felipec.d.ts +1 -0
  605. package/themes/felipec.js +54 -0
  606. package/themes/flat.css +1 -0
  607. package/themes/flat.d.ts +1 -0
  608. package/themes/flat.js +62 -0
  609. package/themes/foundation.css +1 -0
  610. package/themes/foundation.d.ts +1 -0
  611. package/themes/foundation.js +52 -0
  612. package/themes/framer.css +1 -0
  613. package/themes/framer.d.ts +1 -0
  614. package/themes/framer.js +62 -0
  615. package/themes/fruit-soda.css +1 -0
  616. package/themes/fruit-soda.d.ts +1 -0
  617. package/themes/fruit-soda.js +62 -0
  618. package/themes/gigavolt.css +1 -0
  619. package/themes/gigavolt.d.ts +1 -0
  620. package/themes/gigavolt.js +62 -0
  621. package/themes/github-dark-dimmed.css +1 -0
  622. package/themes/github-dark-dimmed.d.ts +1 -0
  623. package/themes/github-dark-dimmed.js +59 -0
  624. package/themes/github-dark.css +1 -0
  625. package/themes/github-dark.d.ts +1 -0
  626. package/themes/github-dark.js +59 -0
  627. package/themes/github.css +1 -0
  628. package/themes/github.d.ts +1 -0
  629. package/themes/github.js +59 -0
  630. package/themes/gml.css +1 -0
  631. package/themes/gml.d.ts +1 -0
  632. package/themes/gml.js +51 -0
  633. package/themes/google-dark.css +1 -0
  634. package/themes/google-dark.d.ts +1 -0
  635. package/themes/google-dark.js +62 -0
  636. package/themes/google-light.css +1 -0
  637. package/themes/google-light.d.ts +1 -0
  638. package/themes/google-light.js +62 -0
  639. package/themes/googlecode.css +1 -0
  640. package/themes/googlecode.d.ts +1 -0
  641. package/themes/googlecode.js +53 -0
  642. package/themes/gradient-dark.css +1 -0
  643. package/themes/gradient-dark.d.ts +1 -0
  644. package/themes/gradient-dark.js +60 -0
  645. package/themes/gradient-light.css +1 -0
  646. package/themes/gradient-light.d.ts +1 -0
  647. package/themes/gradient-light.js +60 -0
  648. package/themes/grayscale-dark.css +1 -0
  649. package/themes/grayscale-dark.d.ts +1 -0
  650. package/themes/grayscale-dark.js +62 -0
  651. package/themes/grayscale-light.css +1 -0
  652. package/themes/grayscale-light.d.ts +1 -0
  653. package/themes/grayscale-light.js +62 -0
  654. package/themes/grayscale.css +1 -0
  655. package/themes/grayscale.d.ts +1 -0
  656. package/themes/grayscale.js +66 -0
  657. package/themes/green-screen.css +1 -0
  658. package/themes/green-screen.d.ts +1 -0
  659. package/themes/green-screen.js +62 -0
  660. package/themes/gruvbox-dark-hard.css +1 -0
  661. package/themes/gruvbox-dark-hard.d.ts +1 -0
  662. package/themes/gruvbox-dark-hard.js +62 -0
  663. package/themes/gruvbox-dark-medium.css +1 -0
  664. package/themes/gruvbox-dark-medium.d.ts +1 -0
  665. package/themes/gruvbox-dark-medium.js +62 -0
  666. package/themes/gruvbox-dark-pale.css +1 -0
  667. package/themes/gruvbox-dark-pale.d.ts +1 -0
  668. package/themes/gruvbox-dark-pale.js +62 -0
  669. package/themes/gruvbox-dark-soft.css +1 -0
  670. package/themes/gruvbox-dark-soft.d.ts +1 -0
  671. package/themes/gruvbox-dark-soft.js +62 -0
  672. package/themes/gruvbox-light-hard.css +1 -0
  673. package/themes/gruvbox-light-hard.d.ts +1 -0
  674. package/themes/gruvbox-light-hard.js +62 -0
  675. package/themes/gruvbox-light-medium.css +1 -0
  676. package/themes/gruvbox-light-medium.d.ts +1 -0
  677. package/themes/gruvbox-light-medium.js +62 -0
  678. package/themes/gruvbox-light-soft.css +1 -0
  679. package/themes/gruvbox-light-soft.d.ts +1 -0
  680. package/themes/gruvbox-light-soft.js +62 -0
  681. package/themes/hardcore.css +1 -0
  682. package/themes/hardcore.d.ts +1 -0
  683. package/themes/hardcore.js +62 -0
  684. package/themes/harmonic16-dark.css +1 -0
  685. package/themes/harmonic16-dark.d.ts +1 -0
  686. package/themes/harmonic16-dark.js +62 -0
  687. package/themes/harmonic16-light.css +1 -0
  688. package/themes/harmonic16-light.d.ts +1 -0
  689. package/themes/harmonic16-light.js +62 -0
  690. package/themes/heetch-dark.css +1 -0
  691. package/themes/heetch-dark.d.ts +1 -0
  692. package/themes/heetch-dark.js +62 -0
  693. package/themes/heetch-light.css +1 -0
  694. package/themes/heetch-light.d.ts +1 -0
  695. package/themes/heetch-light.js +62 -0
  696. package/themes/helios.css +1 -0
  697. package/themes/helios.d.ts +1 -0
  698. package/themes/helios.js +62 -0
  699. package/themes/hopscotch.css +1 -0
  700. package/themes/hopscotch.d.ts +1 -0
  701. package/themes/hopscotch.js +62 -0
  702. package/themes/horizon-dark.css +1 -0
  703. package/themes/horizon-dark.d.ts +1 -0
  704. package/themes/horizon-dark.js +62 -0
  705. package/themes/horizon-light.css +1 -0
  706. package/themes/horizon-light.d.ts +1 -0
  707. package/themes/horizon-light.js +62 -0
  708. package/themes/humanoid-dark.css +1 -0
  709. package/themes/humanoid-dark.d.ts +1 -0
  710. package/themes/humanoid-dark.js +62 -0
  711. package/themes/humanoid-light.css +1 -0
  712. package/themes/humanoid-light.d.ts +1 -0
  713. package/themes/humanoid-light.js +62 -0
  714. package/themes/hybrid.css +1 -0
  715. package/themes/hybrid.d.ts +1 -0
  716. package/themes/hybrid.js +51 -0
  717. package/themes/ia-dark.css +1 -0
  718. package/themes/ia-dark.d.ts +1 -0
  719. package/themes/ia-dark.js +62 -0
  720. package/themes/ia-light.css +1 -0
  721. package/themes/ia-light.d.ts +1 -0
  722. package/themes/ia-light.js +62 -0
  723. package/themes/icy-dark.css +1 -0
  724. package/themes/icy-dark.d.ts +1 -0
  725. package/themes/icy-dark.js +62 -0
  726. package/themes/idea.css +1 -0
  727. package/themes/idea.d.ts +1 -0
  728. package/themes/idea.js +75 -0
  729. package/themes/index.d.ts +258 -0
  730. package/themes/index.js +256 -0
  731. package/themes/intellij-light.css +1 -0
  732. package/themes/intellij-light.d.ts +1 -0
  733. package/themes/intellij-light.js +63 -0
  734. package/themes/ir-black.css +1 -0
  735. package/themes/ir-black.d.ts +1 -0
  736. package/themes/ir-black.js +48 -0
  737. package/themes/isbl-editor-dark.css +1 -0
  738. package/themes/isbl-editor-dark.d.ts +1 -0
  739. package/themes/isbl-editor-dark.js +62 -0
  740. package/themes/isbl-editor-light.css +1 -0
  741. package/themes/isbl-editor-light.d.ts +1 -0
  742. package/themes/isbl-editor-light.js +62 -0
  743. package/themes/isotope.css +1 -0
  744. package/themes/isotope.d.ts +1 -0
  745. package/themes/isotope.js +62 -0
  746. package/themes/kimber.css +1 -0
  747. package/themes/kimber.d.ts +1 -0
  748. package/themes/kimber.js +62 -0
  749. package/themes/kimbie-dark.css +1 -0
  750. package/themes/kimbie-dark.d.ts +1 -0
  751. package/themes/kimbie-dark.js +47 -0
  752. package/themes/kimbie-light.css +1 -0
  753. package/themes/kimbie-light.d.ts +1 -0
  754. package/themes/kimbie-light.js +47 -0
  755. package/themes/lightfair.css +1 -0
  756. package/themes/lightfair.d.ts +1 -0
  757. package/themes/lightfair.js +54 -0
  758. package/themes/lioshi.css +1 -0
  759. package/themes/lioshi.d.ts +1 -0
  760. package/themes/lioshi.js +49 -0
  761. package/themes/london-tube.css +1 -0
  762. package/themes/london-tube.d.ts +1 -0
  763. package/themes/london-tube.js +62 -0
  764. package/themes/macintosh.css +1 -0
  765. package/themes/macintosh.d.ts +1 -0
  766. package/themes/macintosh.js +62 -0
  767. package/themes/magula.css +1 -0
  768. package/themes/magula.d.ts +1 -0
  769. package/themes/magula.js +56 -0
  770. package/themes/marrakesh.css +1 -0
  771. package/themes/marrakesh.d.ts +1 -0
  772. package/themes/marrakesh.js +62 -0
  773. package/themes/materia.css +1 -0
  774. package/themes/materia.d.ts +1 -0
  775. package/themes/materia.js +62 -0
  776. package/themes/material-darker.css +1 -0
  777. package/themes/material-darker.d.ts +1 -0
  778. package/themes/material-darker.js +62 -0
  779. package/themes/material-lighter.css +1 -0
  780. package/themes/material-lighter.d.ts +1 -0
  781. package/themes/material-lighter.js +62 -0
  782. package/themes/material-palenight.css +1 -0
  783. package/themes/material-palenight.d.ts +1 -0
  784. package/themes/material-palenight.js +62 -0
  785. package/themes/material-vivid.css +1 -0
  786. package/themes/material-vivid.d.ts +1 -0
  787. package/themes/material-vivid.js +62 -0
  788. package/themes/material.css +1 -0
  789. package/themes/material.d.ts +1 -0
  790. package/themes/material.js +62 -0
  791. package/themes/mellow-purple.css +1 -0
  792. package/themes/mellow-purple.d.ts +1 -0
  793. package/themes/mellow-purple.js +62 -0
  794. package/themes/mexico-light.css +1 -0
  795. package/themes/mexico-light.d.ts +1 -0
  796. package/themes/mexico-light.js +62 -0
  797. package/themes/mocha.css +1 -0
  798. package/themes/mocha.d.ts +1 -0
  799. package/themes/mocha.js +62 -0
  800. package/themes/mono-blue.css +1 -0
  801. package/themes/mono-blue.d.ts +1 -0
  802. package/themes/mono-blue.js +54 -0
  803. package/themes/monokai-sublime.css +1 -0
  804. package/themes/monokai-sublime.d.ts +1 -0
  805. package/themes/monokai-sublime.js +52 -0
  806. package/themes/monokai.css +1 -0
  807. package/themes/monokai.d.ts +1 -0
  808. package/themes/monokai.js +58 -0
  809. package/themes/nebula.css +1 -0
  810. package/themes/nebula.d.ts +1 -0
  811. package/themes/nebula.js +62 -0
  812. package/themes/night-owl.css +1 -0
  813. package/themes/night-owl.d.ts +1 -0
  814. package/themes/night-owl.js +64 -0
  815. package/themes/nnfx-dark.css +1 -0
  816. package/themes/nnfx-dark.d.ts +1 -0
  817. package/themes/nnfx-dark.js +74 -0
  818. package/themes/nnfx-light.css +1 -0
  819. package/themes/nnfx-light.d.ts +1 -0
  820. package/themes/nnfx-light.js +74 -0
  821. package/themes/nord.css +1 -0
  822. package/themes/nord.d.ts +1 -0
  823. package/themes/nord.js +59 -0
  824. package/themes/nova.css +1 -0
  825. package/themes/nova.d.ts +1 -0
  826. package/themes/nova.js +62 -0
  827. package/themes/obsidian.css +1 -0
  828. package/themes/obsidian.d.ts +1 -0
  829. package/themes/obsidian.js +58 -0
  830. package/themes/ocean.css +1 -0
  831. package/themes/ocean.d.ts +1 -0
  832. package/themes/ocean.js +62 -0
  833. package/themes/oceanicnext.css +1 -0
  834. package/themes/oceanicnext.d.ts +1 -0
  835. package/themes/oceanicnext.js +62 -0
  836. package/themes/one-light.css +1 -0
  837. package/themes/one-light.d.ts +1 -0
  838. package/themes/one-light.js +62 -0
  839. package/themes/onedark.css +1 -0
  840. package/themes/onedark.d.ts +1 -0
  841. package/themes/onedark.js +62 -0
  842. package/themes/outrun-dark.css +1 -0
  843. package/themes/outrun-dark.d.ts +1 -0
  844. package/themes/outrun-dark.js +62 -0
  845. package/themes/panda-syntax-dark.css +1 -0
  846. package/themes/panda-syntax-dark.d.ts +1 -0
  847. package/themes/panda-syntax-dark.js +59 -0
  848. package/themes/panda-syntax-light.css +1 -0
  849. package/themes/panda-syntax-light.d.ts +1 -0
  850. package/themes/panda-syntax-light.js +59 -0
  851. package/themes/papercolor-dark.css +1 -0
  852. package/themes/papercolor-dark.d.ts +1 -0
  853. package/themes/papercolor-dark.js +62 -0
  854. package/themes/papercolor-light.css +1 -0
  855. package/themes/papercolor-light.d.ts +1 -0
  856. package/themes/papercolor-light.js +62 -0
  857. package/themes/paraiso-dark.css +1 -0
  858. package/themes/paraiso-dark.d.ts +1 -0
  859. package/themes/paraiso-dark.js +45 -0
  860. package/themes/paraiso-light.css +1 -0
  861. package/themes/paraiso-light.d.ts +1 -0
  862. package/themes/paraiso-light.js +45 -0
  863. package/themes/paraiso.css +1 -0
  864. package/themes/paraiso.d.ts +1 -0
  865. package/themes/paraiso.js +62 -0
  866. package/themes/pasque.css +1 -0
  867. package/themes/pasque.d.ts +1 -0
  868. package/themes/pasque.js +62 -0
  869. package/themes/phd.css +1 -0
  870. package/themes/phd.d.ts +1 -0
  871. package/themes/phd.js +62 -0
  872. package/themes/pico.css +1 -0
  873. package/themes/pico.d.ts +1 -0
  874. package/themes/pico.js +62 -0
  875. package/themes/pojoaque.css +1 -0
  876. package/themes/pojoaque.d.ts +1 -0
  877. package/themes/pojoaque.js +54 -0
  878. package/themes/pop.css +1 -0
  879. package/themes/pop.d.ts +1 -0
  880. package/themes/pop.js +62 -0
  881. package/themes/porple.css +1 -0
  882. package/themes/porple.d.ts +1 -0
  883. package/themes/porple.js +62 -0
  884. package/themes/purebasic.css +1 -0
  885. package/themes/purebasic.d.ts +1 -0
  886. package/themes/purebasic.js +60 -0
  887. package/themes/qtcreator-dark.css +1 -0
  888. package/themes/qtcreator-dark.d.ts +1 -0
  889. package/themes/qtcreator-dark.js +55 -0
  890. package/themes/qtcreator-light.css +1 -0
  891. package/themes/qtcreator-light.d.ts +1 -0
  892. package/themes/qtcreator-light.js +55 -0
  893. package/themes/qualia.css +1 -0
  894. package/themes/qualia.d.ts +1 -0
  895. package/themes/qualia.js +62 -0
  896. package/themes/railscasts.css +1 -0
  897. package/themes/railscasts.d.ts +1 -0
  898. package/themes/railscasts.js +62 -0
  899. package/themes/rainbow.css +1 -0
  900. package/themes/rainbow.d.ts +1 -0
  901. package/themes/rainbow.js +55 -0
  902. package/themes/rebecca.css +1 -0
  903. package/themes/rebecca.d.ts +1 -0
  904. package/themes/rebecca.js +62 -0
  905. package/themes/ros-pine-dawn.css +1 -0
  906. package/themes/ros-pine-dawn.d.ts +1 -0
  907. package/themes/ros-pine-dawn.js +62 -0
  908. package/themes/ros-pine-moon.css +1 -0
  909. package/themes/ros-pine-moon.d.ts +1 -0
  910. package/themes/ros-pine-moon.js +62 -0
  911. package/themes/ros-pine.css +1 -0
  912. package/themes/ros-pine.d.ts +1 -0
  913. package/themes/ros-pine.js +62 -0
  914. package/themes/rose-pine-dawn.css +1 -0
  915. package/themes/rose-pine-dawn.d.ts +1 -0
  916. package/themes/rose-pine-dawn.js +54 -0
  917. package/themes/rose-pine-moon.css +1 -0
  918. package/themes/rose-pine-moon.d.ts +1 -0
  919. package/themes/rose-pine-moon.js +54 -0
  920. package/themes/rose-pine.css +1 -0
  921. package/themes/rose-pine.d.ts +1 -0
  922. package/themes/rose-pine.js +54 -0
  923. package/themes/routeros.css +1 -0
  924. package/themes/routeros.d.ts +1 -0
  925. package/themes/routeros.js +57 -0
  926. package/themes/sagelight.css +1 -0
  927. package/themes/sagelight.d.ts +1 -0
  928. package/themes/sagelight.js +62 -0
  929. package/themes/sandcastle.css +1 -0
  930. package/themes/sandcastle.d.ts +1 -0
  931. package/themes/sandcastle.js +62 -0
  932. package/themes/school-book.css +1 -0
  933. package/themes/school-book.d.ts +1 -0
  934. package/themes/school-book.js +56 -0
  935. package/themes/seti-ui.css +1 -0
  936. package/themes/seti-ui.d.ts +1 -0
  937. package/themes/seti-ui.js +62 -0
  938. package/themes/shades-of-purple.css +1 -0
  939. package/themes/shades-of-purple.d.ts +1 -0
  940. package/themes/shades-of-purple.js +56 -0
  941. package/themes/shapeshifter.css +1 -0
  942. package/themes/shapeshifter.d.ts +1 -0
  943. package/themes/shapeshifter.js +62 -0
  944. package/themes/silk-dark.css +1 -0
  945. package/themes/silk-dark.d.ts +1 -0
  946. package/themes/silk-dark.js +62 -0
  947. package/themes/silk-light.css +1 -0
  948. package/themes/silk-light.d.ts +1 -0
  949. package/themes/silk-light.js +62 -0
  950. package/themes/snazzy.css +1 -0
  951. package/themes/snazzy.d.ts +1 -0
  952. package/themes/snazzy.js +62 -0
  953. package/themes/solar-flare-light.css +1 -0
  954. package/themes/solar-flare-light.d.ts +1 -0
  955. package/themes/solar-flare-light.js +62 -0
  956. package/themes/solar-flare.css +1 -0
  957. package/themes/solar-flare.d.ts +1 -0
  958. package/themes/solar-flare.js +62 -0
  959. package/themes/solarized-dark.css +1 -0
  960. package/themes/solarized-dark.d.ts +1 -0
  961. package/themes/solarized-dark.js +62 -0
  962. package/themes/solarized-light.css +1 -0
  963. package/themes/solarized-light.d.ts +1 -0
  964. package/themes/solarized-light.js +62 -0
  965. package/themes/spacemacs.css +1 -0
  966. package/themes/spacemacs.d.ts +1 -0
  967. package/themes/spacemacs.js +62 -0
  968. package/themes/srcery.css +1 -0
  969. package/themes/srcery.d.ts +1 -0
  970. package/themes/srcery.js +51 -0
  971. package/themes/stackoverflow-dark.css +1 -0
  972. package/themes/stackoverflow-dark.d.ts +1 -0
  973. package/themes/stackoverflow-dark.js +50 -0
  974. package/themes/stackoverflow-light.css +1 -0
  975. package/themes/stackoverflow-light.d.ts +1 -0
  976. package/themes/stackoverflow-light.js +50 -0
  977. package/themes/summercamp.css +1 -0
  978. package/themes/summercamp.d.ts +1 -0
  979. package/themes/summercamp.js +62 -0
  980. package/themes/summerfruit-dark.css +1 -0
  981. package/themes/summerfruit-dark.d.ts +1 -0
  982. package/themes/summerfruit-dark.js +62 -0
  983. package/themes/summerfruit-light.css +1 -0
  984. package/themes/summerfruit-light.d.ts +1 -0
  985. package/themes/summerfruit-light.js +62 -0
  986. package/themes/sunburst.css +1 -0
  987. package/themes/sunburst.d.ts +1 -0
  988. package/themes/sunburst.js +57 -0
  989. package/themes/synth-midnight-terminal-dark.css +1 -0
  990. package/themes/synth-midnight-terminal-dark.d.ts +1 -0
  991. package/themes/synth-midnight-terminal-dark.js +62 -0
  992. package/themes/synth-midnight-terminal-light.css +1 -0
  993. package/themes/synth-midnight-terminal-light.d.ts +1 -0
  994. package/themes/synth-midnight-terminal-light.js +62 -0
  995. package/themes/tango.css +1 -0
  996. package/themes/tango.d.ts +1 -0
  997. package/themes/tango.js +62 -0
  998. package/themes/tender.css +1 -0
  999. package/themes/tender.d.ts +1 -0
  1000. package/themes/tender.js +62 -0
  1001. package/themes/tokyo-night-dark.css +1 -0
  1002. package/themes/tokyo-night-dark.d.ts +1 -0
  1003. package/themes/tokyo-night-dark.js +54 -0
  1004. package/themes/tokyo-night-light.css +1 -0
  1005. package/themes/tokyo-night-light.d.ts +1 -0
  1006. package/themes/tokyo-night-light.js +54 -0
  1007. package/themes/tomorrow-night-blue.css +1 -0
  1008. package/themes/tomorrow-night-blue.d.ts +1 -0
  1009. package/themes/tomorrow-night-blue.js +45 -0
  1010. package/themes/tomorrow-night-bright.css +1 -0
  1011. package/themes/tomorrow-night-bright.d.ts +1 -0
  1012. package/themes/tomorrow-night-bright.js +45 -0
  1013. package/themes/tomorrow-night.css +1 -0
  1014. package/themes/tomorrow-night.d.ts +1 -0
  1015. package/themes/tomorrow-night.js +62 -0
  1016. package/themes/tomorrow.css +1 -0
  1017. package/themes/tomorrow.d.ts +1 -0
  1018. package/themes/tomorrow.js +62 -0
  1019. package/themes/twilight.css +1 -0
  1020. package/themes/twilight.d.ts +1 -0
  1021. package/themes/twilight.js +62 -0
  1022. package/themes/unikitty-dark.css +1 -0
  1023. package/themes/unikitty-dark.d.ts +1 -0
  1024. package/themes/unikitty-dark.js +62 -0
  1025. package/themes/unikitty-light.css +1 -0
  1026. package/themes/unikitty-light.d.ts +1 -0
  1027. package/themes/unikitty-light.js +62 -0
  1028. package/themes/vs.css +1 -0
  1029. package/themes/vs.d.ts +1 -0
  1030. package/themes/vs.js +45 -0
  1031. package/themes/vs2015.css +1 -0
  1032. package/themes/vs2015.d.ts +1 -0
  1033. package/themes/vs2015.js +59 -0
  1034. package/themes/vulcan.css +1 -0
  1035. package/themes/vulcan.d.ts +1 -0
  1036. package/themes/vulcan.js +62 -0
  1037. package/themes/windows-10-light.css +1 -0
  1038. package/themes/windows-10-light.d.ts +1 -0
  1039. package/themes/windows-10-light.js +62 -0
  1040. package/themes/windows-10.css +1 -0
  1041. package/themes/windows-10.d.ts +1 -0
  1042. package/themes/windows-10.js +62 -0
  1043. package/themes/windows-95-light.css +1 -0
  1044. package/themes/windows-95-light.d.ts +1 -0
  1045. package/themes/windows-95-light.js +62 -0
  1046. package/themes/windows-95.css +1 -0
  1047. package/themes/windows-95.d.ts +1 -0
  1048. package/themes/windows-95.js +62 -0
  1049. package/themes/windows-high-contrast-light.css +1 -0
  1050. package/themes/windows-high-contrast-light.d.ts +1 -0
  1051. package/themes/windows-high-contrast-light.js +62 -0
  1052. package/themes/windows-high-contrast.css +1 -0
  1053. package/themes/windows-high-contrast.d.ts +1 -0
  1054. package/themes/windows-high-contrast.js +62 -0
  1055. package/themes/windows-nt-light.css +1 -0
  1056. package/themes/windows-nt-light.d.ts +1 -0
  1057. package/themes/windows-nt-light.js +62 -0
  1058. package/themes/windows-nt.css +1 -0
  1059. package/themes/windows-nt.d.ts +1 -0
  1060. package/themes/windows-nt.js +62 -0
  1061. package/themes/woodland.css +1 -0
  1062. package/themes/woodland.d.ts +1 -0
  1063. package/themes/woodland.js +62 -0
  1064. package/themes/xcode-dusk.css +1 -0
  1065. package/themes/xcode-dusk.d.ts +1 -0
  1066. package/themes/xcode-dusk.js +62 -0
  1067. package/themes/xcode.css +1 -0
  1068. package/themes/xcode.d.ts +1 -0
  1069. package/themes/xcode.js +57 -0
  1070. package/themes/xt256.css +1 -0
  1071. package/themes/xt256.d.ts +1 -0
  1072. package/themes/xt256.js +56 -0
  1073. package/themes/zenburn.css +1 -0
  1074. package/themes/zenburn.d.ts +1 -0
  1075. package/themes/zenburn.js +62 -0
  1076. package/tokenized-document.d.ts +29 -0
  1077. package/tokenized-document.js +263 -0
  1078. package/typewriter-units.d.ts +13 -0
  1079. package/typewriter-units.js +73 -0
package/README.md CHANGED
@@ -49,9 +49,198 @@ See [SUPPORTED_LANGUAGES.md](SUPPORTED_LANGUAGES.md) for a list of supported lan
49
49
  <Highlight language={typescript} {code} />
50
50
  ```
51
51
 
52
+ ## Theming
53
+
54
+ Every `highlight.js` theme is also compiled into a **`ThemePalette`**: a typed object of `--shl-*` CSS custom properties plus a shared structural stylesheet (`svelte-highlight/themes/base.css`) that maps `.hljs*` classes to those variables. This is the recommended way to theme new projects — themes are data, scoping is an inline `style` attribute (SSR-safe by construction), and any token is overridable with one CSS line or a Svelte style prop. See [SUPPORTED_THEMES.md](SUPPORTED_THEMES.md) for a list of compiled themes.
55
+
56
+ The legacy string-theme path (`svelte-highlight/styles`, below) keeps working unchanged and is unaffected by any of this.
57
+
58
+ **Global theme, CSS only (no JS in the bundle for theming):**
59
+
60
+ ```svelte
61
+ <script>
62
+ import "svelte-highlight/themes/base.css";
63
+ import "svelte-highlight/themes/atom-one-dark.css";
64
+ </script>
65
+ ```
66
+
67
+ **Scoped themes — multiple themes coexisting, zero runtime cost:**
68
+
69
+ ```svelte
70
+ <script>
71
+ import "svelte-highlight/themes/base.css";
72
+ import "svelte-highlight/themes/github.css";
73
+ import "svelte-highlight/themes/atom-one-dark.css";
74
+ </script>
75
+
76
+ <div data-shl-theme="github"><Highlight ... /></div>
77
+ <div data-shl-theme="atom-one-dark"><Highlight ... /></div>
78
+ ```
79
+
80
+ **Component-driven scoping via palette objects** (replaces the scoped-`<style>` machinery described under [Scoping styles](#scoping-styles) below — no injected `<style>` tag, no runtime CSS parsing):
81
+
82
+ ```svelte
83
+ <script>
84
+ import { Highlight, HighlightStyle } from "svelte-highlight";
85
+ import typescript from "svelte-highlight/languages/typescript";
86
+ import atomOneDark from "svelte-highlight/themes/atom-one-dark";
87
+ import "svelte-highlight/themes/base.css";
88
+
89
+ const code = "const add = (a: number, b: number) => a + b;";
90
+ </script>
91
+
92
+ <HighlightStyle theme={atomOneDark}>
93
+ <Highlight language={typescript} {code} />
94
+ </HighlightStyle>
95
+ ```
96
+
97
+ This renders SSR-identical output — no `<svelte:head>`, no `<style>` tag, just inline vars on the wrapper:
98
+
99
+ ```html
100
+ <div style="--shl-fg:#abb2bf;--shl-bg:#282c34;--shl-keyword:#c678dd;...">...</div>
101
+ ```
102
+
103
+ **Dual light/dark via [`light-dark()`](https://developer.mozilla.org/en-US/docs/Web/CSS/color_value/light-dark):**
104
+
105
+ ```svelte
106
+ <HighlightStyle light={atomOneLight} dark={atomOneDark} mode="auto">
107
+ <Highlight language={typescript} {code} />
108
+ </HighlightStyle>
109
+ ```
110
+
111
+ This renders `--shl-keyword: light-dark(#a626a4, #c678dd)` (etc.) plus `color-scheme: light dark`. `mode="light"` / `mode="dark"` force `color-scheme: light` / `dark`. Any other `mode` string (the legacy "CSS selector" mode) omits `color-scheme` inline — set it on your own selector for app-controlled switching, e.g. `[data-theme="dark"] { color-scheme: dark }`.
112
+
113
+ **One-line customization — any token, no theme forking:**
114
+
115
+ ```css
116
+ [data-shl-theme="atom-one-dark"] {
117
+ --shl-comment: #7f8c98;
118
+ }
119
+ ```
120
+
121
+ **Per-instance customization via Svelte style props** (works automatically since every themed value routes through a var):
122
+
123
+ ```svelte
124
+ <Highlight --shl-keyword="hotpink" --shl-bg="#111" language={typescript} {code} />
125
+ ```
126
+
127
+ **Themes are data** — derive a variant with a plain object spread:
128
+
129
+ ```js
130
+ const custom = {
131
+ ...atomOneDark,
132
+ vars: { ...atomOneDark.vars, "--shl-keyword": "#ff79c6" },
133
+ };
134
+ ```
135
+
136
+ **`HighlightEditable`'s `"css-highlights"` engine accepts palettes too:**
137
+
138
+ ```svelte
139
+ <HighlightEditable engine="css-highlights" theme={atomOneDark} language={typescript} bind:code />
140
+ ```
141
+
142
+ ### The `--shl-*` variable contract
143
+
144
+ Variable names are derived mechanically from the selectors found in `highlight.js` themes. `color` is unsuffixed (it dominates — ~90% of declarations); every other supported property gets a suffix.
145
+
146
+ | Theme selector | Custom property |
147
+ | --- | --- |
148
+ | `.hljs` color | `--shl-fg` |
149
+ | `.hljs` background / background-color | `--shl-bg` |
150
+ | `.hljs-keyword` color | `--shl-keyword` |
151
+ | `.hljs-keyword` background(-color) | `--shl-keyword-bg` |
152
+ | `.hljs-keyword` font-style | `--shl-keyword-font-style` |
153
+ | `.hljs-keyword` font-weight | `--shl-keyword-font-weight` |
154
+ | `.hljs-keyword` text-decoration | `--shl-keyword-text-decoration` |
155
+ | Compound `.hljs-title.class_` | `--shl-title-class_` (scope names joined with `-`; hljs's trailing underscores are kept) |
156
+ | Descendant `.hljs-meta .hljs-keyword` | `--shl-meta-keyword` |
157
+
158
+ `themes/base.css` wraps a multi-scope (compound/descendant) variable in a fallback to its subject scope's variable — e.g. `.hljs-meta .hljs-string { color: var(--shl-meta-string, var(--shl-string)); }` — so a theme that never styles that specific combination still falls through to the plain scope color instead of rendering unstyled. Declarations that don't fit the var contract (gradients, borders, `::selection`, etc.) ship as an opaque `extras` string on the palette, applied only via the `.css` artifact.
159
+
160
+ `base.css` assumes the default `hljs-` class prefix; projects using a custom `classPrefix` should stay on the legacy string path below.
161
+
162
+ ### Creating themes
163
+
164
+ `svelte-highlight/theme` exports a typed, programmatic way to build or derive `ThemePalette` objects, instead of hand-writing `--shl-*` vars against the full scope vocabulary.
165
+
166
+ **`defineTheme()`** builds a complete palette from a small typed definition: a ~14-key **semantic role** layer (pick a dozen colors, get a full theme) plus optional per-scope precision overrides.
167
+
168
+ ```js
169
+ import { defineTheme } from "svelte-highlight/theme";
170
+
171
+ const midnight = defineTheme({
172
+ name: "midnight",
173
+ roles: {
174
+ background: "#0b1021",
175
+ foreground: "#d6deeb",
176
+ comment: { color: "#637777", fontStyle: "italic" },
177
+ keyword: "#c792ea",
178
+ string: "#ecc48d",
179
+ literal: "#f78c6c",
180
+ function: "#82aaff",
181
+ type: "#ffcb8b",
182
+ variable: "#addb67",
183
+ tag: "#7fdbca",
184
+ },
185
+ scopes: {
186
+ "title.class_": "#ffd700", // per-scope precision on top of roles
187
+ "meta keyword": "#5f7e97",
188
+ },
189
+ });
190
+ ```
191
+
192
+ ```svelte
193
+ <HighlightStyle theme={midnight}>
194
+ <Highlight language={typescript} {code} />
195
+ </HighlightStyle>
196
+ ```
197
+
198
+ `roles` are `foreground`, `background`, `comment`, `keyword`, `string`, `literal`, `function`, `type`, `variable`, `property`, `tag`, `punctuation`, `meta`, `addition`, `deletion` — each expands to a documented set of `--shl-*` scope vars. A bare string is shorthand for `{ color: string }`; both roles and `scopes` also accept a `{ color, background, fontStyle, fontWeight, textDecoration }` object. Precedence is `extends` palette vars → `roles` → `scopes` (later layers win per-var, not per-role). `foreground`/`background` are required unless `extends` is given.
199
+
200
+ **`extendTheme()`** derives a new palette from any shipped or user palette with role- or scope-level overrides:
201
+
202
+ ```js
203
+ import atomOneDark from "svelte-highlight/themes/atom-one-dark";
204
+ import { extendTheme } from "svelte-highlight/theme";
205
+
206
+ const branded = extendTheme(atomOneDark, {
207
+ name: "atom-one-dark-branded",
208
+ roles: { keyword: "#ff79c6" },
209
+ });
210
+ ```
211
+
212
+ **`paletteToCss()`** emits any palette as a CSS string — for build-time/global CSS instead of the `HighlightStyle` component:
213
+
214
+ ```js
215
+ import { paletteToCss } from "svelte-highlight/theme";
216
+
217
+ writeFileSync("public/midnight.css", paletteToCss(midnight));
218
+ ```
219
+
220
+ `defineTheme` output is a plain `ThemePalette` — spreadable, serializable, diffable, and valid everywhere shipped palettes work, per [Themes are data](#theming) above.
221
+
222
+ ### Importing VS Code themes
223
+
224
+ `svelte-highlight/theme/textmate` imports VS Code / TextMate theme JSON (thousands of existing editor themes) into a `ThemePalette`:
225
+
226
+ ```js
227
+ import { fromTextMate } from "svelte-highlight/theme/textmate";
228
+ import nightOwl from "./night-owl-color-theme.json" with { type: "json" };
229
+
230
+ const palette = fromTextMate(nightOwl);
231
+ ```
232
+
233
+ `fromTextMate` accepts a **parsed object** only — VS Code themes are often JSONC, so parsing is the caller's job. The scope mapping is best-effort: TextMate scope selectors are matched against a starter table by segment-prefix (`"entity.name.function"` matches `"entity.name.function.method.ts"`), with the most specific (longest) match winning ties broken by the later `tokenColors` entry — the same specificity semantics VS Code itself uses. Entries that don't map to anything are never silently dropped; pass `onWarn` to observe them:
234
+
235
+ ```js
236
+ const palette = fromTextMate(nightOwl, {
237
+ onWarn: (message) => console.warn(message),
238
+ });
239
+ ```
240
+
52
241
  ## Styling
53
242
 
54
- Import styles from `svelte-highlight/styles`. See [SUPPORTED_STYLES.md](SUPPORTED_STYLES.md) for a list of supported styles.
243
+ Import styles from `svelte-highlight/styles`. See [SUPPORTED_STYLES.md](SUPPORTED_STYLES.md) for a list of supported styles. For new projects, prefer [Theming](#theming) above — this is the original, string-based theming path, kept fully supported for backward compatibility.
55
244
 
56
245
  There are two ways to apply `highlight.js` styles.
57
246
 
@@ -535,6 +724,22 @@ The component dispatches a `copy` event on success and an `error` event if the c
535
724
  />
536
725
  ```
537
726
 
727
+ ### Transforming copied text
728
+
729
+ Displayed code often carries decoration that shouldn't survive a copy -- shell prompts, REPL markers, diff signs. Pass a `transform` function to strip it before the `copy` function runs; `on:copy` reports the transformed string, not the original `code`.
730
+
731
+ `stripPrompts` and `stripDiffMarkers` cover the common cases and are exported for reuse (compose them for your own `transform` when a block needs both):
732
+
733
+ ```svelte
734
+ <script>
735
+ import { CopyButton, stripPrompts } from "svelte-highlight";
736
+
737
+ const code = "$ npm install\nadded 1 package";
738
+ </script>
739
+
740
+ <CopyButton {code} transform={stripPrompts} />
741
+ ```
742
+
538
743
  ### Custom Button Content
539
744
 
540
745
  Provide custom button content using the default slot to replace the default icons. The slot exposes a `copied` boolean and a `copying` boolean (`true` while an async `copy` is in flight), so you can render a pending state for slow copy functions.
@@ -649,7 +854,7 @@ Use `bind:this` to call methods on the instance.
649
854
  <button on:click={() => editor.clear()}>Clear</button>
650
855
  ```
651
856
 
652
- Available methods: `undo`, `redo`, `focus`, `selectAll`, `insert`, `indent`, `outdent`, `setCode`, `clear`, `getCode`, `canUndo`, and `canRedo`.
857
+ Available methods: `undo`, `redo`, `focus`, `selectAll`, `insert`, `indent`, `outdent`, `setCode`, `clear`, `getCode`, `canUndo`, `canRedo`, and `resolvedEngine`.
653
858
 
654
859
  ### Custom Styles
655
860
 
@@ -664,6 +869,30 @@ Customize the focus outline with the `--outline-color`, `--outline-width`, and `
664
869
  />
665
870
  ```
666
871
 
872
+ ### Experimental: CSS Custom Highlight engine
873
+
874
+ `engine="css-highlights"` paints tokens with the [CSS Custom Highlight API](https://developer.mozilla.org/en-US/docs/Web/API/CSS_Custom_Highlight_API) (`CSS.highlights`, `::highlight()`) instead of wrapping them in `<span>`s. The editable `<code>` stays plain text (one `<span>` per line, reused from the default engine's line structure, but with no per-token spans inside), so a repaint never replaces the DOM the caret is sitting in.
875
+
876
+ Requires Chrome 105+, Safari 17.2+, or Firefox 140+. Where `CSS.highlights` is unavailable, `HighlightEditable` falls back to `engine="dom"` silently; check what actually ran with `editor.resolvedEngine()`.
877
+
878
+ Pass `theme` (the same theme string you'd give `HighlightStyle`) to generate `::highlight()` rules from it. Only `color`/`background-color` convert — `::highlight()` doesn't support `font-style`/`font-weight`/`text-decoration` across browsers, so bold/italic scopes render in plain color.
879
+
880
+ `theme` only covers token colors — you still need `HighlightStyle` (or an injected stylesheet) for the base `.hljs` layout rules (padding, overflow, background), exactly as with the default engine.
881
+
882
+ ```svelte
883
+ <script>
884
+ import { HighlightEditable, HighlightStyle } from "svelte-highlight";
885
+ import typescript from "svelte-highlight/languages/typescript";
886
+ import github from "svelte-highlight/styles/github";
887
+
888
+ let code = "const add = (a: number, b: number) => a + b";
889
+ </script>
890
+
891
+ <HighlightStyle theme={github}>
892
+ <HighlightEditable language={typescript} bind:code engine="css-highlights" theme={github} />
893
+ </HighlightStyle>
894
+ ```
895
+
667
896
  ## Language Targeting
668
897
 
669
898
  All `Highlight` components apply a `data-language` attribute on the codeblock containing the language name.
@@ -716,61 +945,60 @@ See the [Languages page](SUPPORTED_LANGUAGES.md) for a list of supported languag
716
945
 
717
946
  ## Custom Language
718
947
 
719
- For custom language highlighting, pass a `name` and `register` function to the language prop.
948
+ A `language` is `{ name, register }`, where `register` is a plain-JSON grammar — the same format every `svelte-highlight/languages/*` module ships, produced by converting an [hljs-format grammar](https://highlightjs.readthedocs.io/en/latest/language-guide.html) at build time.
720
949
 
721
- Refer to the highlight.js [language definition guide](https://highlightjs.readthedocs.io/en/latest/language-guide.html) for guidance.
950
+ The easiest way to author one is with `svelte-highlight/compat`'s `fromHighlightJs`: write your grammar exactly as the hljs guide describes (a `register(hljs)` function returning a mode object), and convert it at runtime — no build step, no bundled hljs code.
722
951
 
723
952
  ```svelte
724
953
  <script>
725
954
  import { Highlight } from "svelte-highlight";
726
- import hljs from "highlight.js";
727
-
728
- const language = {
729
- name: "custom-language",
730
- register: (hljs) => {
731
- return {
732
- /** custom language rules */
733
- contains: [],
734
- };
735
- },
736
- };
955
+ import { fromHighlightJs } from "svelte-highlight/compat";
956
+
957
+ function defineCustomLanguage(hljs) {
958
+ return {
959
+ /** custom language rules */
960
+ contains: [],
961
+ };
962
+ }
963
+
964
+ const languagePromise = fromHighlightJs("custom-language", defineCustomLanguage);
737
965
  </script>
738
966
 
739
- <Highlight {language} code="..." />
967
+ {#await languagePromise then language}
968
+ <Highlight {language} code="..." />
969
+ {/await}
740
970
  ```
741
971
 
972
+ `fromHighlightJs` needs `highlight.js` itself, which svelte-highlight does not bundle — install it as your own dependency (`npm install highlight.js`). It's only imported the first time you call `fromHighlightJs`, so pages that never use it don't pay for it.
973
+
742
974
  If you're using TypeScript, use the `LanguageType` interface to type the language.
743
975
 
744
976
  ```ts
745
977
  import type { LanguageType } from "svelte-highlight";
978
+ import { fromHighlightJs } from "svelte-highlight/compat";
746
979
 
747
- const language: LanguageType<"custom-language"> = {
748
- name: "custom-language",
749
- register: (hljs) => {
750
- return {
751
- /** custom language rules */
752
- contains: [],
753
- };
754
- },
755
- };
980
+ const language: LanguageType<"custom-language"> = await fromHighlightJs(
981
+ "custom-language",
982
+ (hljs) => ({ contains: [] }),
983
+ );
756
984
  ```
757
985
 
986
+ Building a package for others to install? Ship the converted grammar directly instead of calling `fromHighlightJs` at runtime — see [`scripts/convert-grammars.ts`](scripts/convert-grammars.ts) for the converter this package's own bundled languages go through.
987
+
758
988
  ## Custom Plugin
759
989
 
760
- Additional plugin languages can be installed and used separately.
990
+ Third-party hljs language plugins work the same way: pass their `register(hljs)` export to `fromHighlightJs`.
761
991
 
762
992
  This example uses the [`cURL` language plugin](https://github.com/highlightjs/highlightjs-curl).
763
993
 
764
994
  ```svelte
765
995
  <script>
766
996
  import { Highlight } from "svelte-highlight";
997
+ import { fromHighlightJs } from "svelte-highlight/compat";
767
998
  import curl from "highlightjs-curl";
768
999
  import github from "svelte-highlight/styles/github";
769
1000
 
770
- const language = {
771
- name: "curl", // Language name displayed in the langtag
772
- register: curl,
773
- };
1001
+ const languagePromise = fromHighlightJs("curl", curl);
774
1002
 
775
1003
  const code = `curl -X POST "https://api.example.com/data" \\
776
1004
  -H "Content-Type: application/json" \\
@@ -781,7 +1009,9 @@ This example uses the [`cURL` language plugin](https://github.com/highlightjs/hi
781
1009
  {@html github}
782
1010
  </svelte:head>
783
1011
 
784
- <Highlight {language} {code} />
1012
+ {#await languagePromise then language}
1013
+ <Highlight {language} {code} />
1014
+ {/await}
785
1015
  ```
786
1016
 
787
1017
  ## Code-splitting
@@ -1105,9 +1335,90 @@ Set `speed` (milliseconds per character) and pause with `play`. Turn `play` back
1105
1335
 
1106
1336
  With `prefers-reduced-motion`, the full block shows immediately and `on:done` runs right away. Customize the caret with `--caret-width`, `--caret-height`, `--caret-gap`, `--caret-color`, and `--caret-blink`.
1107
1337
 
1338
+ Each tick reveals one already-rendered unit rather than re-rendering the block, so animating stays smooth up to tens of thousands of characters; past that it falls back to the coarser whole-block reveal.
1339
+
1340
+ ## Streaming
1341
+
1342
+ Rendering LLM chat output is the dominant new syntax-highlighting use case: code arrives in arbitrary-sized chunks, mid-token and mid-line, and you don't know the full content up front. `HighlightStream` is built for that -- unlike `Typewriter`, which animates a complete, already-highlighted string and restarts whenever it changes, `HighlightStream` accepts a growing `code` buffer and re-highlights it as chunks arrive.
1343
+
1344
+ Append to `code` as chunks come in; set `done` once the stream ends.
1345
+
1346
+ ```svelte
1347
+ <script>
1348
+ import { HighlightStream } from "svelte-highlight";
1349
+ import typescript from "svelte-highlight/languages/typescript";
1350
+ import github from "svelte-highlight/styles/github";
1351
+
1352
+ let code = "";
1353
+ let done = false;
1354
+
1355
+ // Wire this up to your streaming source (fetch, WebSocket, SSE, ...).
1356
+ async function stream() {
1357
+ for (const chunk of chunks) {
1358
+ code += chunk;
1359
+ await new Promise((r) => setTimeout(r, 30));
1360
+ }
1361
+ done = true;
1362
+ }
1363
+ </script>
1364
+
1365
+ <svelte:head>
1366
+ {@html github}
1367
+ </svelte:head>
1368
+
1369
+ <HighlightStream language={typescript} {code} {done} />
1370
+ ```
1371
+
1372
+ Multiple chunks appended within the same animation frame coalesce into a single highlight pass. Already-rendered lines are diffed and left untouched in the DOM; only lines whose content actually changed are repainted, so a fast-scrolling response only touches its changed suffix (typically the last line). A multi-line construct left open mid-stream -- an unterminated template literal or block comment -- re-tokenizes the lines it spans once the closing delimiter arrives, with no special-casing needed: it falls out of re-highlighting the full buffer on every update.
1373
+
1374
+ A blinking caret marks the end of output while `!done`; setting `done` hides it and performs one final full highlight, so the finished output matches what `Highlight` would render for the same code. `on:done` fires right after that final highlight. Customize the caret with the same `--caret-width`, `--caret-height`, `--caret-gap`, `--caret-color`, and `--caret-blink` variables as `Typewriter`.
1375
+
1376
+ Set `autoScroll` to keep the container pinned to the bottom as output grows -- it stops auto-scrolling as soon as you scroll up, and resumes once you scroll back to the bottom.
1377
+
1378
+ ```svelte
1379
+ <HighlightStream language={typescript} {code} {done} autoScroll style="max-height: 20em; overflow-y: auto;" />
1380
+ ```
1381
+
1382
+ Per-chunk work is O(tail), not O(stream length so far): finished output is sealed into immutable chunks the DOM never re-diffs, so a response that's ten times longer doesn't cost ten times more per repaint. DOM updates stay proportional to the changed lines -- fine for chat-sized output up to very long responses, not a substitute for `HighlightVirtual` below if you also need to *scroll* through a huge, already-complete document.
1383
+
1384
+ ## Large documents
1385
+
1386
+ `HighlightVirtual` renders only the visible lines of a huge document (plus a small overscan margin) inside its own scroll container -- a 100k-line file costs a couple dozen DOM line nodes, not one per line. It exploits the same engine checkpoint/resume primitive `HighlightStream` uses for streaming, but for *random-access* windows into a static document instead of a growing tail.
1387
+
1388
+ ```svelte
1389
+ <script>
1390
+ import { HighlightVirtual } from "svelte-highlight";
1391
+ import json from "svelte-highlight/languages/json";
1392
+ import atomOneDark from "svelte-highlight/styles/atom-one-dark";
1393
+ </script>
1394
+
1395
+ <svelte:head>
1396
+ {@html atomOneDark}
1397
+ </svelte:head>
1398
+
1399
+ <HighlightVirtual language={json} code={hugeLogDump} style="height: 480px" />
1400
+ ```
1401
+
1402
+ The rendered `<pre>` is the scroll container itself -- size it with `style`/`class`/`$$restProps`, same as `Highlight`. Content doesn't wrap (uniform line height is a v1 constraint, measured once from a rendered probe line). `overscan` (default `12`) controls how many extra lines render above/below the viewport; `checkpointInterval` (default `100`) controls how often the engine snapshots its parse state, trading a little memory for cheaper random access. Server-rendered output is the full document as plain escaped text (predictable cost for huge documents); the windowed, highlighted view takes over after hydration.
1403
+
1404
+ For custom virtualization, servers, or tests, `svelte-highlight/tokenized-document` exposes the same windowing primitive headlessly:
1405
+
1406
+ ```js
1407
+ import { createTokenizedDocument } from "svelte-highlight/tokenized-document";
1408
+ import typescript from "svelte-highlight/languages/typescript";
1409
+
1410
+ const doc = createTokenizedDocument({ language: typescript });
1411
+ doc.setCode(bigFile);
1412
+ doc.lineCount(); // cheap -- never triggers tokenization
1413
+ doc.lineRange(50_000, 50_040); // 40 highlighted lines in O(window + interval)
1414
+ doc.append(moreCode); // streaming growth, no re-tokenization
1415
+ ```
1416
+
1417
+ `lineRange` tokenizes lazily and caches the most recently resolved window, so scrolling through even a huge document only ever pays for the lines actually requested. Its output matches `HighlightStream`'s live (non-canonicalized) parse: constructs needing multi-line lookahead across a window's edge can render slightly differently than `registry.highlight()`'s canonical output, the same tradeoff streaming already makes. `TokenizedDocument` doesn't support mid-document edits -- `append` and full `setCode` resets only.
1418
+
1108
1419
  ## Terminal Output
1109
1420
 
1110
- Use `AnsiOutput` to render terminal output that still contains ANSI [SGR](https://en.wikipedia.org/wiki/ANSI_escape_code#SGR_(Select_Graphic_Rendition)_parameters) escape codes. Colors, bold, dim, italic, and underline become styled HTML. The parser is separate from highlight.js, so reach for it with build logs, CLI output, and test runners.
1421
+ Use `AnsiOutput` to render terminal output that still contains ANSI [SGR](https://en.wikipedia.org/wiki/ANSI_escape_code#SGR_(Select_Graphic_Rendition)_parameters) escape codes. Colors, bold, dim, italic, and underline become styled HTML, along with OSC 8 hyperlinks, carriage-return overwrites, and reverse/strikethrough. The parser is separate from highlight.js, so reach for it with build logs, CLI output, and test runners.
1111
1422
 
1112
1423
  ```svelte
1113
1424
  <script>
@@ -1217,7 +1528,7 @@ Arrow keys move between tabs; `Home` and `End` jump to the first and last. The m
1217
1528
  | Name | Type | Default value |
1218
1529
  | :------- | :--------------------------------------------- | :------------- |
1219
1530
  | code | `any` | N/A (required) |
1220
- | language | { name: `string`; register: hljs => `object` } | N/A (required) |
1531
+ | language | { name: `string`; register: `object` } | N/A (required) |
1221
1532
  | langtag | `boolean` | `false` |
1222
1533
 
1223
1534
  `$$restProps` are forwarded to the top-level `pre` element.
@@ -1236,6 +1547,13 @@ Arrow keys move between tabs; `Home` and `End` jump to the first and last. The m
1236
1547
  * @example "<span>...</span>"
1237
1548
  */
1238
1549
  console.log(e.detail.highlighted);
1550
+
1551
+ /**
1552
+ * The scope-event stream behind `highlighted`. See "Headless usage"
1553
+ * below for consuming it directly (tokenLines, toRanges, custom
1554
+ * renderers) instead of re-parsing the HTML.
1555
+ */
1556
+ console.log(e.detail.events);
1239
1557
  }}
1240
1558
  />
1241
1559
  ```
@@ -1264,6 +1582,7 @@ Arrow keys move between tabs; `Home` and `End` jump to the first and last. The m
1264
1582
  | :--------- | :----------------------------------------- | :------------------------------------------- |
1265
1583
  | code | `string` | N/A (required) |
1266
1584
  | copy | `(code: string) => void \| Promise<void>` | `(code) => navigator.clipboard.writeText(code)` |
1585
+ | transform | `(code: string) => string` | `(code) => code` |
1267
1586
  | timeout | `number` | `2000` |
1268
1587
  | text | `string` | `"Copy"` |
1269
1588
  | copiedText | `string` | `"Copied!"` |
@@ -1272,7 +1591,7 @@ Arrow keys move between tabs; `Home` and `End` jump to the first and last. The m
1272
1591
 
1273
1592
  #### Dispatched Events
1274
1593
 
1275
- - **on:copy**: fired after a successful copy, with `{ code }`
1594
+ - **on:copy**: fired after a successful copy, with `{ code }` -- the `transform`-applied string, not the original `code` prop
1276
1595
  - **on:error**: fired if the copy behavior throws, with `{ error }`
1277
1596
 
1278
1597
  ```svelte
@@ -1329,6 +1648,9 @@ Arrow keys move between tabs; `Home` and `End` jump to the first and last. The m
1329
1648
  * @example "<span>...</span>"
1330
1649
  */
1331
1650
  console.log(e.detail.highlighted);
1651
+
1652
+ /** The scope-event stream behind `highlighted`. See "Headless usage" below. */
1653
+ console.log(e.detail.events);
1332
1654
  }}
1333
1655
  />
1334
1656
  ```
@@ -1370,6 +1692,9 @@ import type { LanguageName } from "svelte-highlight";
1370
1692
  * @example "css"
1371
1693
  */
1372
1694
  console.log(e.detail.language);
1695
+
1696
+ /** The scope-event stream behind `highlighted`. See "Headless usage" below. */
1697
+ console.log(e.detail.events);
1373
1698
  }}
1374
1699
  />
1375
1700
  ```
@@ -1381,7 +1706,7 @@ import type { LanguageName } from "svelte-highlight";
1381
1706
  | Name | Type | Default value |
1382
1707
  | :----------- | :--------------------------------------------- | :------------- |
1383
1708
  | code | `string` | `""` |
1384
- | language | { name: `string`; register: hljs => `object` } | N/A (required) |
1709
+ | language | { name: `string`; register: `object` } | N/A (required) |
1385
1710
  | tabSize | `number` | `2` |
1386
1711
  | historyLimit | `number` | `200` |
1387
1712
 
@@ -1408,6 +1733,54 @@ Use `bind:this`, then call `undo()`, `redo()`, `focus()`, `selectAll()`, `insert
1408
1733
  />
1409
1734
  ```
1410
1735
 
1736
+ ### `HighlightStream`
1737
+
1738
+ #### Props
1739
+
1740
+ | Name | Type | Default value |
1741
+ | :--------- | :--------------------------------------------- | :------------- |
1742
+ | code | `string` | `""` |
1743
+ | language | { name: `string`; register: `object` } | N/A (required) |
1744
+ | done | `boolean` | `false` |
1745
+ | caret | `boolean` | `true` |
1746
+ | autoScroll | `boolean` | `false` |
1747
+
1748
+ `$$restProps` are forwarded to the top-level `pre` element.
1749
+
1750
+ #### Dispatched Events
1751
+
1752
+ - **on:highlight**: fired after each highlight pass, with `{ highlighted }`
1753
+ - **on:done**: fired after the final full highlight once `done` is set
1754
+
1755
+ ```svelte
1756
+ <HighlightStream
1757
+ language={typescript}
1758
+ {code}
1759
+ {done}
1760
+ on:highlight={(e) => console.log(e.detail.highlighted)}
1761
+ on:done={() => console.log("stream finished")}
1762
+ />
1763
+ ```
1764
+
1765
+ ### `HighlightVirtual`
1766
+
1767
+ #### Props
1768
+
1769
+ | Name | Type | Default value |
1770
+ | :---------------- | :--------------------------------------------- | :------------- |
1771
+ | code | `any` | N/A (required) |
1772
+ | language | { name: `string`; register: `object` } | N/A (required) |
1773
+ | overscan | `number` | `12` |
1774
+ | checkpointInterval | `number` | `100` |
1775
+
1776
+ `$$restProps` are forwarded to the top-level `pre` element (the scroll container -- size it with `style`/`class`).
1777
+
1778
+ ```svelte
1779
+ <HighlightVirtual language={json} code={hugeLogDump} style="height: 480px" />
1780
+ ```
1781
+
1782
+ See [Large documents](#large-documents) above.
1783
+
1411
1784
  ### `FileTabs`
1412
1785
 
1413
1786
  #### Props
@@ -1451,6 +1824,92 @@ Use `bind:this`, then call `undo()`, `redo()`, `focus()`, `selectAll()`, `insert
1451
1824
  </Highlight>
1452
1825
  ```
1453
1826
 
1827
+ ## Headless usage
1828
+
1829
+ The highlighting engine's output is a flat scope-event stream (`ScopeEvent[]`): a sequence of `TEXT`/`OPEN`/`CLOSE` events that `renderHtml`, `toRanges`, and `tokenLines` each render differently. Every `<Highlight>`-family component exposes this stream (as `events`, in the default slot and the `highlight` event detail — see [Component API](#component-api) above), and `svelte-highlight/engine` + `svelte-highlight/registry` expose it directly, so highlighting can be consumed headlessly: server routes, build pipelines, tests, or any non-component context. `svelte-highlight/engine` has zero Svelte dependency and works in any JS runtime.
1830
+
1831
+ ### Stability tiers
1832
+
1833
+ - **Stable, semver-governed:** `ScopeEvent`, `TEXT`/`OPEN`/`CLOSE`, `TokenRange`, `HighlightResult`, `LineToken`, `Renderer`, `renderHtml`, `toRanges`, `extendLines`, `tokenLines`, `escapeHtml`, `createHtmlRenderer`, `createRangeRenderer`, `createLineRenderer`, `Registry` and its methods, `createRegistry`, `registerAll`, `StreamSession`. `Snapshot` is a serializable format that round-trips within one library version, but is **not** guaranteed stable across versions — a snapshot from an older release may be rejected on resume.
1834
+ - **Generated data, versioned with the library:** `GrammarIR`/`GrammarState`. These come from the build pipeline and are consumed by `registerAll`; treat them as opaque payloads whose field-level structure may change in any minor release. Always load grammars from the same package version as the engine.
1835
+
1836
+ ### Headless highlighting, isolated registry
1837
+
1838
+ Use `createRegistry()` when you want an instance isolated from the components' shared registry (SSR request isolation, tests):
1839
+
1840
+ ```js
1841
+ import { createRegistry, registerAll, renderHtml, tokenLines } from "svelte-highlight/engine";
1842
+ import typescript from "svelte-highlight/languages/typescript";
1843
+
1844
+ const registry = createRegistry();
1845
+ registerAll(registry, typescript);
1846
+
1847
+ const { events, value } = registry.highlight(code, { language: "typescript" });
1848
+ // value: same HTML the <Highlight> component renders
1849
+ // events: the scope-event stream — one tokenization, any number of consumers
1850
+ const lines = tokenLines(events); // [[{ text: "const", scopes: ["keyword"] }, …], …]
1851
+ ```
1852
+
1853
+ ### Joining the components' shared registry
1854
+
1855
+ Use `svelte-highlight/registry` when a language registered here should also be visible to `<Highlight>` (and vice versa):
1856
+
1857
+ ```js
1858
+ import { registry, ensureRegistered } from "svelte-highlight/registry";
1859
+ import typescript from "svelte-highlight/languages/typescript";
1860
+
1861
+ ensureRegistered(typescript);
1862
+ const ranges = registry.tokenizeRanges(code, { language: "typescript" });
1863
+ ```
1864
+
1865
+ ### Streaming, headless
1866
+
1867
+ The same primitives `HighlightStream` uses:
1868
+
1869
+ ```js
1870
+ import { registry } from "svelte-highlight/registry";
1871
+
1872
+ const session = registry.createSession("typescript");
1873
+ session.append(chunk); // repeat as chunks arrive
1874
+ const snapshot = session.snapshot(); // JSON-serializable checkpoint
1875
+ const { value } = session.finish();
1876
+ ```
1877
+
1878
+ ### Reaching the stream from a component — no HTML re-parsing
1879
+
1880
+ ```svelte
1881
+ <Highlight language={typescript} {code} let:highlighted let:events>
1882
+ <pre><code>{@html highlighted}</code></pre>
1883
+ <TokenMinimap {events} />
1884
+ </Highlight>
1885
+
1886
+ <Highlight language={typescript} {code} on:highlight={(e) => analyze(e.detail.events)} />
1887
+ ```
1888
+
1889
+ ### A third-party render target
1890
+
1891
+ `Renderer<Out>` names the contract that `renderHtml`, `toRanges`, and `tokenLines` (via `createHtmlRenderer`, `createRangeRenderer`, `createLineRenderer`) all conform to — implement it to plug a custom render target into the same pipeline:
1892
+
1893
+ ```js
1894
+ import { TEXT, OPEN, CLOSE } from "svelte-highlight/engine";
1895
+
1896
+ /** @type {import("svelte-highlight/engine").Renderer<MyOutput>} */
1897
+ const myRenderer = {
1898
+ render(events) {
1899
+ for (const ev of events) {
1900
+ if (ev.t === TEXT) {
1901
+ /* ev.v */
1902
+ } else if (ev.t === OPEN) {
1903
+ /* ev.s */
1904
+ } else {
1905
+ /* CLOSE */
1906
+ }
1907
+ }
1908
+ return out;
1909
+ },
1910
+ };
1911
+ ```
1912
+
1454
1913
  ## [Supported Languages](SUPPORTED_LANGUAGES.md)
1455
1914
 
1456
1915
  ## [Supported Styles](SUPPORTED_STYLES.md)
@@ -1472,5 +1931,7 @@ By default, example set-ups use Svelte 5. The exception is `examples/vite@svelte
1472
1931
 
1473
1932
  [MIT](LICENSE)
1474
1933
 
1934
+ Grammars and themes are derived from [highlight.js](https://github.com/highlightjs/highlight.js), used under its [BSD-3-Clause license](LICENSE.highlight.txt). The highlighting engine itself is original code under this package's MIT license — no highlight.js source is included in it.
1935
+
1475
1936
  [npm]: https://img.shields.io/npm/v/svelte-highlight.svg?style=for-the-badge&color=%23ff3e00
1476
1937
  [npm-url]: https://npmjs.com/package/svelte-highlight