svelte-highlight 7.15.0 → 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 (1069) hide show
  1. package/Highlight.svelte +14 -5
  2. package/Highlight.svelte.d.ts +15 -0
  3. package/HighlightAuto.svelte +29 -8
  4. package/HighlightAuto.svelte.d.ts +17 -0
  5. package/HighlightEditable.svelte +33 -9
  6. package/HighlightEditable.svelte.d.ts +6 -2
  7. package/HighlightStream.svelte +129 -14
  8. package/HighlightStyle.svelte +52 -15
  9. package/HighlightStyle.svelte.d.ts +25 -12
  10. package/HighlightSvelte.svelte +14 -5
  11. package/HighlightSvelte.svelte.d.ts +15 -0
  12. package/HighlightVirtual.svelte +229 -0
  13. package/HighlightVirtual.svelte.d.ts +36 -0
  14. package/LICENSE.highlight.txt +39 -0
  15. package/README.md +379 -34
  16. package/Typewriter.svelte +3 -3
  17. package/action.js +6 -6
  18. package/compat.d.ts +13 -0
  19. package/compat.js +42 -0
  20. package/convert-language.d.ts +13 -0
  21. package/convert-language.js +203 -0
  22. package/engine.d.ts +215 -0
  23. package/engine.js +1283 -0
  24. package/highlight-theme.d.ts +6 -0
  25. package/highlight-theme.js +77 -0
  26. package/incremental-tokenize.js +242 -0
  27. package/index.d.ts +2 -0
  28. package/index.js +1 -0
  29. package/languages/1c.js +1360 -3
  30. package/languages/abnf.js +89 -3
  31. package/languages/accesslog.js +88 -3
  32. package/languages/actionscript.js +221 -3
  33. package/languages/ada.js +235 -3
  34. package/languages/all.d.ts +4 -0
  35. package/languages/all.js +497 -0
  36. package/languages/angelscript.js +177 -3
  37. package/languages/apache.js +99 -3
  38. package/languages/applescript.js +291 -3
  39. package/languages/arcade.js +1040 -3
  40. package/languages/arduino.js +6201 -3
  41. package/languages/armasm.js +551 -3
  42. package/languages/asciidoc.js +237 -3
  43. package/languages/aspectj.js +770 -3
  44. package/languages/astro.js +70 -60
  45. package/languages/autohotkey.js +133 -3
  46. package/languages/autoit.js +598 -3
  47. package/languages/avrasm.js +372 -3
  48. package/languages/awk.js +115 -3
  49. package/languages/axapta.js +451 -3
  50. package/languages/bash.js +335 -3
  51. package/languages/basic.js +262 -3
  52. package/languages/bibtex.js +47 -45
  53. package/languages/bicep.js +141 -75
  54. package/languages/blade.js +96 -88
  55. package/languages/bnf.js +53 -3
  56. package/languages/brainfuck.js +69 -3
  57. package/languages/c.js +2283 -3
  58. package/languages/caddy.js +131 -56
  59. package/languages/cairo.js +165 -81
  60. package/languages/cal.js +197 -3
  61. package/languages/capnproto.js +105 -3
  62. package/languages/ceylon.js +188 -3
  63. package/languages/clarity.js +157 -52
  64. package/languages/clean.js +107 -3
  65. package/languages/clojure-repl.js +25 -3
  66. package/languages/clojure.js +553 -3
  67. package/languages/cmake.js +223 -3
  68. package/languages/coffeescript.js +827 -3
  69. package/languages/coq.js +447 -3
  70. package/languages/cos.js +183 -3
  71. package/languages/cpp.js +2288 -3
  72. package/languages/crmsh.js +201 -3
  73. package/languages/crystal.js +740 -3
  74. package/languages/csharp.js +1113 -3
  75. package/languages/csp.js +49 -3
  76. package/languages/css.js +216 -3
  77. package/languages/cue.js +137 -95
  78. package/languages/cypher.js +145 -67
  79. package/languages/d.js +244 -3
  80. package/languages/d2.js +118 -58
  81. package/languages/dart.js +309 -3
  82. package/languages/dax.js +270 -73
  83. package/languages/delphi.js +468 -3
  84. package/languages/dhall.js +160 -78
  85. package/languages/diff.js +37 -3
  86. package/languages/django.js +216 -3
  87. package/languages/dns.js +103 -3
  88. package/languages/dockerfile.js +82 -3
  89. package/languages/dos.js +173 -3
  90. package/languages/dotenv.js +71 -45
  91. package/languages/dsconfig.js +76 -3
  92. package/languages/dts.js +199 -3
  93. package/languages/dust.js +57 -3
  94. package/languages/ebnf.js +45 -3
  95. package/languages/elixir.js +517 -3
  96. package/languages/elm.js +172 -3
  97. package/languages/erb.js +39 -3
  98. package/languages/erlang-repl.js +108 -3
  99. package/languages/erlang.js +355 -3
  100. package/languages/excel.js +593 -3
  101. package/languages/fish.js +117 -73
  102. package/languages/fix.js +38 -3
  103. package/languages/flix.js +107 -3
  104. package/languages/fortran.js +630 -3
  105. package/languages/fsharp.js +850 -3
  106. package/languages/gams.js +705 -3
  107. package/languages/gauss.js +3845 -3
  108. package/languages/gcode.js +181 -3
  109. package/languages/gdscript.d.ts +2 -0
  110. package/languages/gdscript.js +158 -0
  111. package/languages/gherkin.js +68 -3
  112. package/languages/gleam.js +115 -68
  113. package/languages/glsl.js +638 -3
  114. package/languages/gml.js +3151 -3
  115. package/languages/go.js +253 -3
  116. package/languages/golo.js +97 -3
  117. package/languages/gradle.js +233 -3
  118. package/languages/graphql.js +101 -3
  119. package/languages/groovy.js +209 -3
  120. package/languages/groq.js +94 -86
  121. package/languages/haml.js +111 -3
  122. package/languages/handlebars.js +368 -3
  123. package/languages/haskell.js +272 -3
  124. package/languages/haxe.js +290 -3
  125. package/languages/hcl.js +143 -80
  126. package/languages/heex.d.ts +2 -0
  127. package/languages/heex.js +130 -0
  128. package/languages/hlsl.js +303 -89
  129. package/languages/hsp.js +490 -3
  130. package/languages/html.js +203 -158
  131. package/languages/http.js +84 -3
  132. package/languages/hy.js +423 -3
  133. package/languages/index.d.ts +11 -2
  134. package/languages/index.js +3 -0
  135. package/languages/inform7.js +63 -3
  136. package/languages/ini.js +89 -3
  137. package/languages/irpf90.js +612 -3
  138. package/languages/isbl.js +10135 -3
  139. package/languages/java.js +550 -3
  140. package/languages/javascript.js +1240 -3
  141. package/languages/jboss-cli.js +114 -3
  142. package/languages/jq.js +328 -117
  143. package/languages/json.js +96 -3
  144. package/languages/json5.js +107 -53
  145. package/languages/jsonc.js +75 -34
  146. package/languages/jsonnet.js +138 -68
  147. package/languages/julia-repl.js +33 -3
  148. package/languages/julia.js +621 -3
  149. package/languages/just.js +225 -116
  150. package/languages/kotlin.js +595 -3
  151. package/languages/kql.js +275 -113
  152. package/languages/lasso.js +568 -3
  153. package/languages/latex.js +670 -3
  154. package/languages/ldif.js +41 -3
  155. package/languages/leaf.js +60 -3
  156. package/languages/less.js +787 -3
  157. package/languages/liquid.js +113 -54
  158. package/languages/lisp.js +150 -3
  159. package/languages/livecodeserver.js +828 -3
  160. package/languages/livescript.js +1082 -3
  161. package/languages/llvm.js +369 -3
  162. package/languages/logql.js +119 -79
  163. package/languages/lsl.js +130 -3
  164. package/languages/lua.js +278 -3
  165. package/languages/makefile.js +124 -3
  166. package/languages/markdown.js +222 -3
  167. package/languages/marko.js +148 -165
  168. package/languages/mathematica.js +99 -3
  169. package/languages/matlab.js +335 -3
  170. package/languages/maxima.js +2495 -3
  171. package/languages/mdx.js +106 -74
  172. package/languages/mel.js +1309 -3
  173. package/languages/mercury.js +231 -3
  174. package/languages/mipsasm.js +289 -3
  175. package/languages/mizar.js +115 -3
  176. package/languages/mojolicious.js +32 -3
  177. package/languages/monkey.js +205 -3
  178. package/languages/moonscript.js +334 -3
  179. package/languages/move.js +149 -89
  180. package/languages/n1ql.js +375 -3
  181. package/languages/nestedtext.js +76 -3
  182. package/languages/nginx.js +201 -3
  183. package/languages/nickel.js +126 -77
  184. package/languages/nim.js +206 -3
  185. package/languages/nix.js +310 -3
  186. package/languages/node-repl.js +33 -3
  187. package/languages/nsis.js +441 -3
  188. package/languages/nushell.js +158 -97
  189. package/languages/objectivec.js +303 -3
  190. package/languages/ocaml.js +165 -3
  191. package/languages/odin.js +176 -75
  192. package/languages/openscad.js +185 -3
  193. package/languages/oxygene.js +459 -3
  194. package/languages/parser3.js +111 -3
  195. package/languages/perl.js +864 -3
  196. package/languages/pf.js +168 -3
  197. package/languages/pgsql.js +1253 -3
  198. package/languages/php-template.js +28 -3
  199. package/languages/php.js +1031 -3
  200. package/languages/pkl.js +190 -76
  201. package/languages/plaintext.js +17 -3
  202. package/languages/pony.js +132 -3
  203. package/languages/powershell.js +405 -3
  204. package/languages/prisma.js +95 -68
  205. package/languages/processing.js +445 -3
  206. package/languages/profile.js +66 -3
  207. package/languages/prolog.js +142 -3
  208. package/languages/promql.js +204 -91
  209. package/languages/properties.js +75 -3
  210. package/languages/protobuf.js +106 -3
  211. package/languages/pug.js +119 -67
  212. package/languages/puppet.js +415 -3
  213. package/languages/purebasic.js +187 -3
  214. package/languages/python-repl.js +35 -3
  215. package/languages/python.js +784 -3
  216. package/languages/q.js +215 -3
  217. package/languages/qml.js +401 -3
  218. package/languages/r.js +351 -3
  219. package/languages/razor.js +417 -126
  220. package/languages/reasonml.js +207 -3
  221. package/languages/rego.js +179 -91
  222. package/languages/rescript.js +202 -138
  223. package/languages/rib.js +148 -3
  224. package/languages/roboconf.js +128 -3
  225. package/languages/routeros.js +169 -3
  226. package/languages/rsl.js +175 -3
  227. package/languages/rst.js +111 -142
  228. package/languages/ruby.js +890 -3
  229. package/languages/ruleslanguage.js +377 -3
  230. package/languages/rust.js +392 -3
  231. package/languages/sas.js +211 -3
  232. package/languages/scala.js +332 -3
  233. package/languages/scheme.js +398 -3
  234. package/languages/scilab.js +190 -3
  235. package/languages/scss.js +236 -3
  236. package/languages/shell.js +32 -3
  237. package/languages/smali.js +91 -3
  238. package/languages/smalltalk.js +89 -3
  239. package/languages/sml.js +145 -3
  240. package/languages/solidity.js +400 -99
  241. package/languages/sparql.d.ts +2 -0
  242. package/languages/sparql.js +153 -0
  243. package/languages/sqf.js +2641 -3
  244. package/languages/sql.js +474 -3
  245. package/languages/stan.js +526 -3
  246. package/languages/starlark.js +122 -51
  247. package/languages/stata.js +1903 -3
  248. package/languages/step21.js +100 -3
  249. package/languages/stylus.js +261 -3
  250. package/languages/subunit.js +59 -3
  251. package/languages/svelte.js +148 -141
  252. package/languages/swift.js +2245 -3
  253. package/languages/taggerscript.js +51 -3
  254. package/languages/tap.js +48 -3
  255. package/languages/tcl.js +218 -3
  256. package/languages/templ.js +254 -250
  257. package/languages/thrift.js +129 -3
  258. package/languages/toml.js +107 -74
  259. package/languages/tp.js +209 -3
  260. package/languages/twig.js +204 -3
  261. package/languages/typescript.js +1410 -3
  262. package/languages/typst.js +340 -183
  263. package/languages/v.js +230 -101
  264. package/languages/vala.js +161 -3
  265. package/languages/vbnet.js +333 -3
  266. package/languages/vbscript-html.js +18 -3
  267. package/languages/vbscript.js +225 -3
  268. package/languages/verilog.js +576 -3
  269. package/languages/vhdl.js +229 -3
  270. package/languages/vim.js +1294 -3
  271. package/languages/vue.js +99 -98
  272. package/languages/vyper.js +144 -72
  273. package/languages/wasm.js +140 -3
  274. package/languages/wgsl.js +370 -93
  275. package/languages/wren.js +311 -3
  276. package/languages/x86asm.js +2330 -3
  277. package/languages/xl.js +474 -3
  278. package/languages/xml.js +198 -3
  279. package/languages/xquery.js +315 -3
  280. package/languages/yaml.js +267 -3
  281. package/languages/zephir.js +333 -3
  282. package/languages/zig.js +196 -100
  283. package/package.json +57 -2
  284. package/preprocessor.js +3 -5
  285. package/registry.d.ts +17 -0
  286. package/registry.js +17 -0
  287. package/textmate-theme.d.ts +41 -0
  288. package/textmate-theme.js +211 -0
  289. package/theme-style.js +94 -0
  290. package/theme-vars.js +205 -0
  291. package/theme.d.ts +104 -0
  292. package/theme.js +130 -0
  293. package/themes/1c-light.css +1 -0
  294. package/themes/1c-light.d.ts +1 -0
  295. package/themes/1c-light.js +53 -0
  296. package/themes/3024.css +1 -0
  297. package/themes/3024.d.ts +1 -0
  298. package/themes/3024.js +62 -0
  299. package/themes/_shl-fallbacks.d.ts +1 -0
  300. package/themes/_shl-fallbacks.js +27 -0
  301. package/themes/a11y-dark.css +29 -0
  302. package/themes/a11y-dark.d.ts +1 -0
  303. package/themes/a11y-dark.js +47 -0
  304. package/themes/a11y-light.css +29 -0
  305. package/themes/a11y-light.d.ts +1 -0
  306. package/themes/a11y-light.js +47 -0
  307. package/themes/agate.css +1 -0
  308. package/themes/agate.d.ts +1 -0
  309. package/themes/agate.js +58 -0
  310. package/themes/an-old-hope.css +1 -0
  311. package/themes/an-old-hope.d.ts +1 -0
  312. package/themes/an-old-hope.js +45 -0
  313. package/themes/androidstudio.css +1 -0
  314. package/themes/androidstudio.d.ts +1 -0
  315. package/themes/androidstudio.js +45 -0
  316. package/themes/apathy.css +1 -0
  317. package/themes/apathy.d.ts +1 -0
  318. package/themes/apathy.js +62 -0
  319. package/themes/apprentice.css +1 -0
  320. package/themes/apprentice.d.ts +1 -0
  321. package/themes/apprentice.js +62 -0
  322. package/themes/arduino-light.css +1 -0
  323. package/themes/arduino-light.d.ts +1 -0
  324. package/themes/arduino-light.js +52 -0
  325. package/themes/arta.css +1 -0
  326. package/themes/arta.d.ts +1 -0
  327. package/themes/arta.js +50 -0
  328. package/themes/ascetic.css +1 -0
  329. package/themes/ascetic.d.ts +1 -0
  330. package/themes/ascetic.js +45 -0
  331. package/themes/ashes.css +1 -0
  332. package/themes/ashes.d.ts +1 -0
  333. package/themes/ashes.js +62 -0
  334. package/themes/atelier-cave-light.css +1 -0
  335. package/themes/atelier-cave-light.d.ts +1 -0
  336. package/themes/atelier-cave-light.js +62 -0
  337. package/themes/atelier-cave.css +1 -0
  338. package/themes/atelier-cave.d.ts +1 -0
  339. package/themes/atelier-cave.js +62 -0
  340. package/themes/atelier-dune-light.css +1 -0
  341. package/themes/atelier-dune-light.d.ts +1 -0
  342. package/themes/atelier-dune-light.js +62 -0
  343. package/themes/atelier-dune.css +1 -0
  344. package/themes/atelier-dune.d.ts +1 -0
  345. package/themes/atelier-dune.js +62 -0
  346. package/themes/atelier-estuary-light.css +1 -0
  347. package/themes/atelier-estuary-light.d.ts +1 -0
  348. package/themes/atelier-estuary-light.js +62 -0
  349. package/themes/atelier-estuary.css +1 -0
  350. package/themes/atelier-estuary.d.ts +1 -0
  351. package/themes/atelier-estuary.js +62 -0
  352. package/themes/atelier-forest-light.css +1 -0
  353. package/themes/atelier-forest-light.d.ts +1 -0
  354. package/themes/atelier-forest-light.js +62 -0
  355. package/themes/atelier-forest.css +1 -0
  356. package/themes/atelier-forest.d.ts +1 -0
  357. package/themes/atelier-forest.js +62 -0
  358. package/themes/atelier-heath-light.css +1 -0
  359. package/themes/atelier-heath-light.d.ts +1 -0
  360. package/themes/atelier-heath-light.js +62 -0
  361. package/themes/atelier-heath.css +1 -0
  362. package/themes/atelier-heath.d.ts +1 -0
  363. package/themes/atelier-heath.js +62 -0
  364. package/themes/atelier-lakeside-light.css +1 -0
  365. package/themes/atelier-lakeside-light.d.ts +1 -0
  366. package/themes/atelier-lakeside-light.js +62 -0
  367. package/themes/atelier-lakeside.css +1 -0
  368. package/themes/atelier-lakeside.d.ts +1 -0
  369. package/themes/atelier-lakeside.js +62 -0
  370. package/themes/atelier-plateau-light.css +1 -0
  371. package/themes/atelier-plateau-light.d.ts +1 -0
  372. package/themes/atelier-plateau-light.js +62 -0
  373. package/themes/atelier-plateau.css +1 -0
  374. package/themes/atelier-plateau.d.ts +1 -0
  375. package/themes/atelier-plateau.js +62 -0
  376. package/themes/atelier-savanna-light.css +1 -0
  377. package/themes/atelier-savanna-light.d.ts +1 -0
  378. package/themes/atelier-savanna-light.js +62 -0
  379. package/themes/atelier-savanna.css +1 -0
  380. package/themes/atelier-savanna.d.ts +1 -0
  381. package/themes/atelier-savanna.js +62 -0
  382. package/themes/atelier-seaside-light.css +1 -0
  383. package/themes/atelier-seaside-light.d.ts +1 -0
  384. package/themes/atelier-seaside-light.js +62 -0
  385. package/themes/atelier-seaside.css +1 -0
  386. package/themes/atelier-seaside.d.ts +1 -0
  387. package/themes/atelier-seaside.js +62 -0
  388. package/themes/atelier-sulphurpool-light.css +1 -0
  389. package/themes/atelier-sulphurpool-light.d.ts +1 -0
  390. package/themes/atelier-sulphurpool-light.js +62 -0
  391. package/themes/atelier-sulphurpool.css +1 -0
  392. package/themes/atelier-sulphurpool.d.ts +1 -0
  393. package/themes/atelier-sulphurpool.js +62 -0
  394. package/themes/atlas.css +1 -0
  395. package/themes/atlas.d.ts +1 -0
  396. package/themes/atlas.js +62 -0
  397. package/themes/atom-one-dark-reasonable.css +1 -0
  398. package/themes/atom-one-dark-reasonable.d.ts +1 -0
  399. package/themes/atom-one-dark-reasonable.js +62 -0
  400. package/themes/atom-one-dark.css +1 -0
  401. package/themes/atom-one-dark.d.ts +1 -0
  402. package/themes/atom-one-dark.js +54 -0
  403. package/themes/atom-one-light.css +1 -0
  404. package/themes/atom-one-light.d.ts +1 -0
  405. package/themes/atom-one-light.js +54 -0
  406. package/themes/base.css +1 -0
  407. package/themes/base16-github.css +1 -0
  408. package/themes/base16-github.d.ts +1 -0
  409. package/themes/base16-github.js +62 -0
  410. package/themes/base16-ir-black.css +1 -0
  411. package/themes/base16-ir-black.d.ts +1 -0
  412. package/themes/base16-ir-black.js +62 -0
  413. package/themes/base16-monokai.css +1 -0
  414. package/themes/base16-monokai.d.ts +1 -0
  415. package/themes/base16-monokai.js +62 -0
  416. package/themes/base16-nord.css +1 -0
  417. package/themes/base16-nord.d.ts +1 -0
  418. package/themes/base16-nord.js +62 -0
  419. package/themes/bespin.css +1 -0
  420. package/themes/bespin.d.ts +1 -0
  421. package/themes/bespin.js +62 -0
  422. package/themes/black-metal-bathory.css +1 -0
  423. package/themes/black-metal-bathory.d.ts +1 -0
  424. package/themes/black-metal-bathory.js +62 -0
  425. package/themes/black-metal-burzum.css +1 -0
  426. package/themes/black-metal-burzum.d.ts +1 -0
  427. package/themes/black-metal-burzum.js +62 -0
  428. package/themes/black-metal-dark-funeral.css +1 -0
  429. package/themes/black-metal-dark-funeral.d.ts +1 -0
  430. package/themes/black-metal-dark-funeral.js +62 -0
  431. package/themes/black-metal-gorgoroth.css +1 -0
  432. package/themes/black-metal-gorgoroth.d.ts +1 -0
  433. package/themes/black-metal-gorgoroth.js +62 -0
  434. package/themes/black-metal-immortal.css +1 -0
  435. package/themes/black-metal-immortal.d.ts +1 -0
  436. package/themes/black-metal-immortal.js +62 -0
  437. package/themes/black-metal-khold.css +1 -0
  438. package/themes/black-metal-khold.d.ts +1 -0
  439. package/themes/black-metal-khold.js +62 -0
  440. package/themes/black-metal-marduk.css +1 -0
  441. package/themes/black-metal-marduk.d.ts +1 -0
  442. package/themes/black-metal-marduk.js +62 -0
  443. package/themes/black-metal-mayhem.css +1 -0
  444. package/themes/black-metal-mayhem.d.ts +1 -0
  445. package/themes/black-metal-mayhem.js +62 -0
  446. package/themes/black-metal-nile.css +1 -0
  447. package/themes/black-metal-nile.d.ts +1 -0
  448. package/themes/black-metal-nile.js +62 -0
  449. package/themes/black-metal-venom.css +1 -0
  450. package/themes/black-metal-venom.d.ts +1 -0
  451. package/themes/black-metal-venom.js +62 -0
  452. package/themes/black-metal.css +1 -0
  453. package/themes/black-metal.d.ts +1 -0
  454. package/themes/black-metal.js +62 -0
  455. package/themes/brewer.css +1 -0
  456. package/themes/brewer.d.ts +1 -0
  457. package/themes/brewer.js +62 -0
  458. package/themes/bright.css +1 -0
  459. package/themes/bright.d.ts +1 -0
  460. package/themes/bright.js +62 -0
  461. package/themes/brogrammer.css +1 -0
  462. package/themes/brogrammer.d.ts +1 -0
  463. package/themes/brogrammer.js +62 -0
  464. package/themes/brown-paper.css +1 -0
  465. package/themes/brown-paper.d.ts +1 -0
  466. package/themes/brown-paper.js +53 -0
  467. package/themes/brush-trees-dark.css +1 -0
  468. package/themes/brush-trees-dark.d.ts +1 -0
  469. package/themes/brush-trees-dark.js +62 -0
  470. package/themes/brush-trees.css +1 -0
  471. package/themes/brush-trees.d.ts +1 -0
  472. package/themes/brush-trees.js +62 -0
  473. package/themes/chalk.css +1 -0
  474. package/themes/chalk.d.ts +1 -0
  475. package/themes/chalk.js +62 -0
  476. package/themes/circus.css +1 -0
  477. package/themes/circus.d.ts +1 -0
  478. package/themes/circus.js +62 -0
  479. package/themes/classic-dark.css +1 -0
  480. package/themes/classic-dark.d.ts +1 -0
  481. package/themes/classic-dark.js +62 -0
  482. package/themes/classic-light.css +1 -0
  483. package/themes/classic-light.d.ts +1 -0
  484. package/themes/classic-light.js +62 -0
  485. package/themes/codepen-embed.css +1 -0
  486. package/themes/codepen-embed.d.ts +1 -0
  487. package/themes/codepen-embed.js +45 -0
  488. package/themes/codeschool.css +1 -0
  489. package/themes/codeschool.d.ts +1 -0
  490. package/themes/codeschool.js +62 -0
  491. package/themes/color-brewer.css +1 -0
  492. package/themes/color-brewer.d.ts +1 -0
  493. package/themes/color-brewer.js +45 -0
  494. package/themes/colors.css +1 -0
  495. package/themes/colors.d.ts +1 -0
  496. package/themes/colors.js +62 -0
  497. package/themes/cupcake.css +1 -0
  498. package/themes/cupcake.d.ts +1 -0
  499. package/themes/cupcake.js +62 -0
  500. package/themes/cupertino.css +1 -0
  501. package/themes/cupertino.d.ts +1 -0
  502. package/themes/cupertino.js +62 -0
  503. package/themes/cybertopia-cherry.css +1 -0
  504. package/themes/cybertopia-cherry.d.ts +1 -0
  505. package/themes/cybertopia-cherry.js +61 -0
  506. package/themes/cybertopia-dimmer.css +1 -0
  507. package/themes/cybertopia-dimmer.d.ts +1 -0
  508. package/themes/cybertopia-dimmer.js +61 -0
  509. package/themes/cybertopia-icecap.css +1 -0
  510. package/themes/cybertopia-icecap.d.ts +1 -0
  511. package/themes/cybertopia-icecap.js +61 -0
  512. package/themes/cybertopia-saturated.css +1 -0
  513. package/themes/cybertopia-saturated.d.ts +1 -0
  514. package/themes/cybertopia-saturated.js +61 -0
  515. package/themes/danqing.css +1 -0
  516. package/themes/danqing.d.ts +1 -0
  517. package/themes/danqing.js +62 -0
  518. package/themes/darcula.css +1 -0
  519. package/themes/darcula.d.ts +1 -0
  520. package/themes/darcula.js +62 -0
  521. package/themes/dark-violet.css +1 -0
  522. package/themes/dark-violet.d.ts +1 -0
  523. package/themes/dark-violet.js +62 -0
  524. package/themes/dark.css +1 -0
  525. package/themes/dark.d.ts +1 -0
  526. package/themes/dark.js +52 -0
  527. package/themes/darkmoss.css +1 -0
  528. package/themes/darkmoss.d.ts +1 -0
  529. package/themes/darkmoss.js +62 -0
  530. package/themes/darktooth.css +1 -0
  531. package/themes/darktooth.d.ts +1 -0
  532. package/themes/darktooth.js +62 -0
  533. package/themes/decaf.css +1 -0
  534. package/themes/decaf.d.ts +1 -0
  535. package/themes/decaf.js +62 -0
  536. package/themes/default-dark.css +1 -0
  537. package/themes/default-dark.d.ts +1 -0
  538. package/themes/default-dark.js +62 -0
  539. package/themes/default-light.css +1 -0
  540. package/themes/default-light.d.ts +1 -0
  541. package/themes/default-light.js +62 -0
  542. package/themes/default.css +1 -0
  543. package/themes/default.d.ts +1 -0
  544. package/themes/default.js +59 -0
  545. package/themes/devibeans.css +1 -0
  546. package/themes/devibeans.d.ts +1 -0
  547. package/themes/devibeans.js +52 -0
  548. package/themes/dirtysea.css +1 -0
  549. package/themes/dirtysea.d.ts +1 -0
  550. package/themes/dirtysea.js +62 -0
  551. package/themes/docco.css +1 -0
  552. package/themes/docco.d.ts +1 -0
  553. package/themes/docco.js +57 -0
  554. package/themes/dracula.css +1 -0
  555. package/themes/dracula.d.ts +1 -0
  556. package/themes/dracula.js +62 -0
  557. package/themes/edge-dark.css +1 -0
  558. package/themes/edge-dark.d.ts +1 -0
  559. package/themes/edge-dark.js +62 -0
  560. package/themes/edge-light.css +1 -0
  561. package/themes/edge-light.d.ts +1 -0
  562. package/themes/edge-light.js +62 -0
  563. package/themes/eighties.css +1 -0
  564. package/themes/eighties.d.ts +1 -0
  565. package/themes/eighties.js +62 -0
  566. package/themes/embers.css +1 -0
  567. package/themes/embers.d.ts +1 -0
  568. package/themes/embers.js +62 -0
  569. package/themes/equilibrium-dark.css +1 -0
  570. package/themes/equilibrium-dark.d.ts +1 -0
  571. package/themes/equilibrium-dark.js +62 -0
  572. package/themes/equilibrium-gray-dark.css +1 -0
  573. package/themes/equilibrium-gray-dark.d.ts +1 -0
  574. package/themes/equilibrium-gray-dark.js +62 -0
  575. package/themes/equilibrium-gray-light.css +1 -0
  576. package/themes/equilibrium-gray-light.d.ts +1 -0
  577. package/themes/equilibrium-gray-light.js +62 -0
  578. package/themes/equilibrium-light.css +1 -0
  579. package/themes/equilibrium-light.d.ts +1 -0
  580. package/themes/equilibrium-light.js +62 -0
  581. package/themes/espresso.css +1 -0
  582. package/themes/espresso.d.ts +1 -0
  583. package/themes/espresso.js +62 -0
  584. package/themes/eva-dim.css +1 -0
  585. package/themes/eva-dim.d.ts +1 -0
  586. package/themes/eva-dim.js +62 -0
  587. package/themes/eva.css +1 -0
  588. package/themes/eva.d.ts +1 -0
  589. package/themes/eva.js +62 -0
  590. package/themes/far.css +1 -0
  591. package/themes/far.d.ts +1 -0
  592. package/themes/far.js +50 -0
  593. package/themes/felipec.css +1 -0
  594. package/themes/felipec.d.ts +1 -0
  595. package/themes/felipec.js +54 -0
  596. package/themes/flat.css +1 -0
  597. package/themes/flat.d.ts +1 -0
  598. package/themes/flat.js +62 -0
  599. package/themes/foundation.css +1 -0
  600. package/themes/foundation.d.ts +1 -0
  601. package/themes/foundation.js +52 -0
  602. package/themes/framer.css +1 -0
  603. package/themes/framer.d.ts +1 -0
  604. package/themes/framer.js +62 -0
  605. package/themes/fruit-soda.css +1 -0
  606. package/themes/fruit-soda.d.ts +1 -0
  607. package/themes/fruit-soda.js +62 -0
  608. package/themes/gigavolt.css +1 -0
  609. package/themes/gigavolt.d.ts +1 -0
  610. package/themes/gigavolt.js +62 -0
  611. package/themes/github-dark-dimmed.css +1 -0
  612. package/themes/github-dark-dimmed.d.ts +1 -0
  613. package/themes/github-dark-dimmed.js +59 -0
  614. package/themes/github-dark.css +1 -0
  615. package/themes/github-dark.d.ts +1 -0
  616. package/themes/github-dark.js +59 -0
  617. package/themes/github.css +1 -0
  618. package/themes/github.d.ts +1 -0
  619. package/themes/github.js +59 -0
  620. package/themes/gml.css +1 -0
  621. package/themes/gml.d.ts +1 -0
  622. package/themes/gml.js +51 -0
  623. package/themes/google-dark.css +1 -0
  624. package/themes/google-dark.d.ts +1 -0
  625. package/themes/google-dark.js +62 -0
  626. package/themes/google-light.css +1 -0
  627. package/themes/google-light.d.ts +1 -0
  628. package/themes/google-light.js +62 -0
  629. package/themes/googlecode.css +1 -0
  630. package/themes/googlecode.d.ts +1 -0
  631. package/themes/googlecode.js +53 -0
  632. package/themes/gradient-dark.css +1 -0
  633. package/themes/gradient-dark.d.ts +1 -0
  634. package/themes/gradient-dark.js +60 -0
  635. package/themes/gradient-light.css +1 -0
  636. package/themes/gradient-light.d.ts +1 -0
  637. package/themes/gradient-light.js +60 -0
  638. package/themes/grayscale-dark.css +1 -0
  639. package/themes/grayscale-dark.d.ts +1 -0
  640. package/themes/grayscale-dark.js +62 -0
  641. package/themes/grayscale-light.css +1 -0
  642. package/themes/grayscale-light.d.ts +1 -0
  643. package/themes/grayscale-light.js +62 -0
  644. package/themes/grayscale.css +1 -0
  645. package/themes/grayscale.d.ts +1 -0
  646. package/themes/grayscale.js +66 -0
  647. package/themes/green-screen.css +1 -0
  648. package/themes/green-screen.d.ts +1 -0
  649. package/themes/green-screen.js +62 -0
  650. package/themes/gruvbox-dark-hard.css +1 -0
  651. package/themes/gruvbox-dark-hard.d.ts +1 -0
  652. package/themes/gruvbox-dark-hard.js +62 -0
  653. package/themes/gruvbox-dark-medium.css +1 -0
  654. package/themes/gruvbox-dark-medium.d.ts +1 -0
  655. package/themes/gruvbox-dark-medium.js +62 -0
  656. package/themes/gruvbox-dark-pale.css +1 -0
  657. package/themes/gruvbox-dark-pale.d.ts +1 -0
  658. package/themes/gruvbox-dark-pale.js +62 -0
  659. package/themes/gruvbox-dark-soft.css +1 -0
  660. package/themes/gruvbox-dark-soft.d.ts +1 -0
  661. package/themes/gruvbox-dark-soft.js +62 -0
  662. package/themes/gruvbox-light-hard.css +1 -0
  663. package/themes/gruvbox-light-hard.d.ts +1 -0
  664. package/themes/gruvbox-light-hard.js +62 -0
  665. package/themes/gruvbox-light-medium.css +1 -0
  666. package/themes/gruvbox-light-medium.d.ts +1 -0
  667. package/themes/gruvbox-light-medium.js +62 -0
  668. package/themes/gruvbox-light-soft.css +1 -0
  669. package/themes/gruvbox-light-soft.d.ts +1 -0
  670. package/themes/gruvbox-light-soft.js +62 -0
  671. package/themes/hardcore.css +1 -0
  672. package/themes/hardcore.d.ts +1 -0
  673. package/themes/hardcore.js +62 -0
  674. package/themes/harmonic16-dark.css +1 -0
  675. package/themes/harmonic16-dark.d.ts +1 -0
  676. package/themes/harmonic16-dark.js +62 -0
  677. package/themes/harmonic16-light.css +1 -0
  678. package/themes/harmonic16-light.d.ts +1 -0
  679. package/themes/harmonic16-light.js +62 -0
  680. package/themes/heetch-dark.css +1 -0
  681. package/themes/heetch-dark.d.ts +1 -0
  682. package/themes/heetch-dark.js +62 -0
  683. package/themes/heetch-light.css +1 -0
  684. package/themes/heetch-light.d.ts +1 -0
  685. package/themes/heetch-light.js +62 -0
  686. package/themes/helios.css +1 -0
  687. package/themes/helios.d.ts +1 -0
  688. package/themes/helios.js +62 -0
  689. package/themes/hopscotch.css +1 -0
  690. package/themes/hopscotch.d.ts +1 -0
  691. package/themes/hopscotch.js +62 -0
  692. package/themes/horizon-dark.css +1 -0
  693. package/themes/horizon-dark.d.ts +1 -0
  694. package/themes/horizon-dark.js +62 -0
  695. package/themes/horizon-light.css +1 -0
  696. package/themes/horizon-light.d.ts +1 -0
  697. package/themes/horizon-light.js +62 -0
  698. package/themes/humanoid-dark.css +1 -0
  699. package/themes/humanoid-dark.d.ts +1 -0
  700. package/themes/humanoid-dark.js +62 -0
  701. package/themes/humanoid-light.css +1 -0
  702. package/themes/humanoid-light.d.ts +1 -0
  703. package/themes/humanoid-light.js +62 -0
  704. package/themes/hybrid.css +1 -0
  705. package/themes/hybrid.d.ts +1 -0
  706. package/themes/hybrid.js +51 -0
  707. package/themes/ia-dark.css +1 -0
  708. package/themes/ia-dark.d.ts +1 -0
  709. package/themes/ia-dark.js +62 -0
  710. package/themes/ia-light.css +1 -0
  711. package/themes/ia-light.d.ts +1 -0
  712. package/themes/ia-light.js +62 -0
  713. package/themes/icy-dark.css +1 -0
  714. package/themes/icy-dark.d.ts +1 -0
  715. package/themes/icy-dark.js +62 -0
  716. package/themes/idea.css +1 -0
  717. package/themes/idea.d.ts +1 -0
  718. package/themes/idea.js +75 -0
  719. package/themes/index.d.ts +258 -0
  720. package/themes/index.js +256 -0
  721. package/themes/intellij-light.css +1 -0
  722. package/themes/intellij-light.d.ts +1 -0
  723. package/themes/intellij-light.js +63 -0
  724. package/themes/ir-black.css +1 -0
  725. package/themes/ir-black.d.ts +1 -0
  726. package/themes/ir-black.js +48 -0
  727. package/themes/isbl-editor-dark.css +1 -0
  728. package/themes/isbl-editor-dark.d.ts +1 -0
  729. package/themes/isbl-editor-dark.js +62 -0
  730. package/themes/isbl-editor-light.css +1 -0
  731. package/themes/isbl-editor-light.d.ts +1 -0
  732. package/themes/isbl-editor-light.js +62 -0
  733. package/themes/isotope.css +1 -0
  734. package/themes/isotope.d.ts +1 -0
  735. package/themes/isotope.js +62 -0
  736. package/themes/kimber.css +1 -0
  737. package/themes/kimber.d.ts +1 -0
  738. package/themes/kimber.js +62 -0
  739. package/themes/kimbie-dark.css +1 -0
  740. package/themes/kimbie-dark.d.ts +1 -0
  741. package/themes/kimbie-dark.js +47 -0
  742. package/themes/kimbie-light.css +1 -0
  743. package/themes/kimbie-light.d.ts +1 -0
  744. package/themes/kimbie-light.js +47 -0
  745. package/themes/lightfair.css +1 -0
  746. package/themes/lightfair.d.ts +1 -0
  747. package/themes/lightfair.js +54 -0
  748. package/themes/lioshi.css +1 -0
  749. package/themes/lioshi.d.ts +1 -0
  750. package/themes/lioshi.js +49 -0
  751. package/themes/london-tube.css +1 -0
  752. package/themes/london-tube.d.ts +1 -0
  753. package/themes/london-tube.js +62 -0
  754. package/themes/macintosh.css +1 -0
  755. package/themes/macintosh.d.ts +1 -0
  756. package/themes/macintosh.js +62 -0
  757. package/themes/magula.css +1 -0
  758. package/themes/magula.d.ts +1 -0
  759. package/themes/magula.js +56 -0
  760. package/themes/marrakesh.css +1 -0
  761. package/themes/marrakesh.d.ts +1 -0
  762. package/themes/marrakesh.js +62 -0
  763. package/themes/materia.css +1 -0
  764. package/themes/materia.d.ts +1 -0
  765. package/themes/materia.js +62 -0
  766. package/themes/material-darker.css +1 -0
  767. package/themes/material-darker.d.ts +1 -0
  768. package/themes/material-darker.js +62 -0
  769. package/themes/material-lighter.css +1 -0
  770. package/themes/material-lighter.d.ts +1 -0
  771. package/themes/material-lighter.js +62 -0
  772. package/themes/material-palenight.css +1 -0
  773. package/themes/material-palenight.d.ts +1 -0
  774. package/themes/material-palenight.js +62 -0
  775. package/themes/material-vivid.css +1 -0
  776. package/themes/material-vivid.d.ts +1 -0
  777. package/themes/material-vivid.js +62 -0
  778. package/themes/material.css +1 -0
  779. package/themes/material.d.ts +1 -0
  780. package/themes/material.js +62 -0
  781. package/themes/mellow-purple.css +1 -0
  782. package/themes/mellow-purple.d.ts +1 -0
  783. package/themes/mellow-purple.js +62 -0
  784. package/themes/mexico-light.css +1 -0
  785. package/themes/mexico-light.d.ts +1 -0
  786. package/themes/mexico-light.js +62 -0
  787. package/themes/mocha.css +1 -0
  788. package/themes/mocha.d.ts +1 -0
  789. package/themes/mocha.js +62 -0
  790. package/themes/mono-blue.css +1 -0
  791. package/themes/mono-blue.d.ts +1 -0
  792. package/themes/mono-blue.js +54 -0
  793. package/themes/monokai-sublime.css +1 -0
  794. package/themes/monokai-sublime.d.ts +1 -0
  795. package/themes/monokai-sublime.js +52 -0
  796. package/themes/monokai.css +1 -0
  797. package/themes/monokai.d.ts +1 -0
  798. package/themes/monokai.js +58 -0
  799. package/themes/nebula.css +1 -0
  800. package/themes/nebula.d.ts +1 -0
  801. package/themes/nebula.js +62 -0
  802. package/themes/night-owl.css +1 -0
  803. package/themes/night-owl.d.ts +1 -0
  804. package/themes/night-owl.js +64 -0
  805. package/themes/nnfx-dark.css +1 -0
  806. package/themes/nnfx-dark.d.ts +1 -0
  807. package/themes/nnfx-dark.js +74 -0
  808. package/themes/nnfx-light.css +1 -0
  809. package/themes/nnfx-light.d.ts +1 -0
  810. package/themes/nnfx-light.js +74 -0
  811. package/themes/nord.css +1 -0
  812. package/themes/nord.d.ts +1 -0
  813. package/themes/nord.js +59 -0
  814. package/themes/nova.css +1 -0
  815. package/themes/nova.d.ts +1 -0
  816. package/themes/nova.js +62 -0
  817. package/themes/obsidian.css +1 -0
  818. package/themes/obsidian.d.ts +1 -0
  819. package/themes/obsidian.js +58 -0
  820. package/themes/ocean.css +1 -0
  821. package/themes/ocean.d.ts +1 -0
  822. package/themes/ocean.js +62 -0
  823. package/themes/oceanicnext.css +1 -0
  824. package/themes/oceanicnext.d.ts +1 -0
  825. package/themes/oceanicnext.js +62 -0
  826. package/themes/one-light.css +1 -0
  827. package/themes/one-light.d.ts +1 -0
  828. package/themes/one-light.js +62 -0
  829. package/themes/onedark.css +1 -0
  830. package/themes/onedark.d.ts +1 -0
  831. package/themes/onedark.js +62 -0
  832. package/themes/outrun-dark.css +1 -0
  833. package/themes/outrun-dark.d.ts +1 -0
  834. package/themes/outrun-dark.js +62 -0
  835. package/themes/panda-syntax-dark.css +1 -0
  836. package/themes/panda-syntax-dark.d.ts +1 -0
  837. package/themes/panda-syntax-dark.js +59 -0
  838. package/themes/panda-syntax-light.css +1 -0
  839. package/themes/panda-syntax-light.d.ts +1 -0
  840. package/themes/panda-syntax-light.js +59 -0
  841. package/themes/papercolor-dark.css +1 -0
  842. package/themes/papercolor-dark.d.ts +1 -0
  843. package/themes/papercolor-dark.js +62 -0
  844. package/themes/papercolor-light.css +1 -0
  845. package/themes/papercolor-light.d.ts +1 -0
  846. package/themes/papercolor-light.js +62 -0
  847. package/themes/paraiso-dark.css +1 -0
  848. package/themes/paraiso-dark.d.ts +1 -0
  849. package/themes/paraiso-dark.js +45 -0
  850. package/themes/paraiso-light.css +1 -0
  851. package/themes/paraiso-light.d.ts +1 -0
  852. package/themes/paraiso-light.js +45 -0
  853. package/themes/paraiso.css +1 -0
  854. package/themes/paraiso.d.ts +1 -0
  855. package/themes/paraiso.js +62 -0
  856. package/themes/pasque.css +1 -0
  857. package/themes/pasque.d.ts +1 -0
  858. package/themes/pasque.js +62 -0
  859. package/themes/phd.css +1 -0
  860. package/themes/phd.d.ts +1 -0
  861. package/themes/phd.js +62 -0
  862. package/themes/pico.css +1 -0
  863. package/themes/pico.d.ts +1 -0
  864. package/themes/pico.js +62 -0
  865. package/themes/pojoaque.css +1 -0
  866. package/themes/pojoaque.d.ts +1 -0
  867. package/themes/pojoaque.js +54 -0
  868. package/themes/pop.css +1 -0
  869. package/themes/pop.d.ts +1 -0
  870. package/themes/pop.js +62 -0
  871. package/themes/porple.css +1 -0
  872. package/themes/porple.d.ts +1 -0
  873. package/themes/porple.js +62 -0
  874. package/themes/purebasic.css +1 -0
  875. package/themes/purebasic.d.ts +1 -0
  876. package/themes/purebasic.js +60 -0
  877. package/themes/qtcreator-dark.css +1 -0
  878. package/themes/qtcreator-dark.d.ts +1 -0
  879. package/themes/qtcreator-dark.js +55 -0
  880. package/themes/qtcreator-light.css +1 -0
  881. package/themes/qtcreator-light.d.ts +1 -0
  882. package/themes/qtcreator-light.js +55 -0
  883. package/themes/qualia.css +1 -0
  884. package/themes/qualia.d.ts +1 -0
  885. package/themes/qualia.js +62 -0
  886. package/themes/railscasts.css +1 -0
  887. package/themes/railscasts.d.ts +1 -0
  888. package/themes/railscasts.js +62 -0
  889. package/themes/rainbow.css +1 -0
  890. package/themes/rainbow.d.ts +1 -0
  891. package/themes/rainbow.js +55 -0
  892. package/themes/rebecca.css +1 -0
  893. package/themes/rebecca.d.ts +1 -0
  894. package/themes/rebecca.js +62 -0
  895. package/themes/ros-pine-dawn.css +1 -0
  896. package/themes/ros-pine-dawn.d.ts +1 -0
  897. package/themes/ros-pine-dawn.js +62 -0
  898. package/themes/ros-pine-moon.css +1 -0
  899. package/themes/ros-pine-moon.d.ts +1 -0
  900. package/themes/ros-pine-moon.js +62 -0
  901. package/themes/ros-pine.css +1 -0
  902. package/themes/ros-pine.d.ts +1 -0
  903. package/themes/ros-pine.js +62 -0
  904. package/themes/rose-pine-dawn.css +1 -0
  905. package/themes/rose-pine-dawn.d.ts +1 -0
  906. package/themes/rose-pine-dawn.js +54 -0
  907. package/themes/rose-pine-moon.css +1 -0
  908. package/themes/rose-pine-moon.d.ts +1 -0
  909. package/themes/rose-pine-moon.js +54 -0
  910. package/themes/rose-pine.css +1 -0
  911. package/themes/rose-pine.d.ts +1 -0
  912. package/themes/rose-pine.js +54 -0
  913. package/themes/routeros.css +1 -0
  914. package/themes/routeros.d.ts +1 -0
  915. package/themes/routeros.js +57 -0
  916. package/themes/sagelight.css +1 -0
  917. package/themes/sagelight.d.ts +1 -0
  918. package/themes/sagelight.js +62 -0
  919. package/themes/sandcastle.css +1 -0
  920. package/themes/sandcastle.d.ts +1 -0
  921. package/themes/sandcastle.js +62 -0
  922. package/themes/school-book.css +1 -0
  923. package/themes/school-book.d.ts +1 -0
  924. package/themes/school-book.js +56 -0
  925. package/themes/seti-ui.css +1 -0
  926. package/themes/seti-ui.d.ts +1 -0
  927. package/themes/seti-ui.js +62 -0
  928. package/themes/shades-of-purple.css +1 -0
  929. package/themes/shades-of-purple.d.ts +1 -0
  930. package/themes/shades-of-purple.js +56 -0
  931. package/themes/shapeshifter.css +1 -0
  932. package/themes/shapeshifter.d.ts +1 -0
  933. package/themes/shapeshifter.js +62 -0
  934. package/themes/silk-dark.css +1 -0
  935. package/themes/silk-dark.d.ts +1 -0
  936. package/themes/silk-dark.js +62 -0
  937. package/themes/silk-light.css +1 -0
  938. package/themes/silk-light.d.ts +1 -0
  939. package/themes/silk-light.js +62 -0
  940. package/themes/snazzy.css +1 -0
  941. package/themes/snazzy.d.ts +1 -0
  942. package/themes/snazzy.js +62 -0
  943. package/themes/solar-flare-light.css +1 -0
  944. package/themes/solar-flare-light.d.ts +1 -0
  945. package/themes/solar-flare-light.js +62 -0
  946. package/themes/solar-flare.css +1 -0
  947. package/themes/solar-flare.d.ts +1 -0
  948. package/themes/solar-flare.js +62 -0
  949. package/themes/solarized-dark.css +1 -0
  950. package/themes/solarized-dark.d.ts +1 -0
  951. package/themes/solarized-dark.js +62 -0
  952. package/themes/solarized-light.css +1 -0
  953. package/themes/solarized-light.d.ts +1 -0
  954. package/themes/solarized-light.js +62 -0
  955. package/themes/spacemacs.css +1 -0
  956. package/themes/spacemacs.d.ts +1 -0
  957. package/themes/spacemacs.js +62 -0
  958. package/themes/srcery.css +1 -0
  959. package/themes/srcery.d.ts +1 -0
  960. package/themes/srcery.js +51 -0
  961. package/themes/stackoverflow-dark.css +1 -0
  962. package/themes/stackoverflow-dark.d.ts +1 -0
  963. package/themes/stackoverflow-dark.js +50 -0
  964. package/themes/stackoverflow-light.css +1 -0
  965. package/themes/stackoverflow-light.d.ts +1 -0
  966. package/themes/stackoverflow-light.js +50 -0
  967. package/themes/summercamp.css +1 -0
  968. package/themes/summercamp.d.ts +1 -0
  969. package/themes/summercamp.js +62 -0
  970. package/themes/summerfruit-dark.css +1 -0
  971. package/themes/summerfruit-dark.d.ts +1 -0
  972. package/themes/summerfruit-dark.js +62 -0
  973. package/themes/summerfruit-light.css +1 -0
  974. package/themes/summerfruit-light.d.ts +1 -0
  975. package/themes/summerfruit-light.js +62 -0
  976. package/themes/sunburst.css +1 -0
  977. package/themes/sunburst.d.ts +1 -0
  978. package/themes/sunburst.js +57 -0
  979. package/themes/synth-midnight-terminal-dark.css +1 -0
  980. package/themes/synth-midnight-terminal-dark.d.ts +1 -0
  981. package/themes/synth-midnight-terminal-dark.js +62 -0
  982. package/themes/synth-midnight-terminal-light.css +1 -0
  983. package/themes/synth-midnight-terminal-light.d.ts +1 -0
  984. package/themes/synth-midnight-terminal-light.js +62 -0
  985. package/themes/tango.css +1 -0
  986. package/themes/tango.d.ts +1 -0
  987. package/themes/tango.js +62 -0
  988. package/themes/tender.css +1 -0
  989. package/themes/tender.d.ts +1 -0
  990. package/themes/tender.js +62 -0
  991. package/themes/tokyo-night-dark.css +1 -0
  992. package/themes/tokyo-night-dark.d.ts +1 -0
  993. package/themes/tokyo-night-dark.js +54 -0
  994. package/themes/tokyo-night-light.css +1 -0
  995. package/themes/tokyo-night-light.d.ts +1 -0
  996. package/themes/tokyo-night-light.js +54 -0
  997. package/themes/tomorrow-night-blue.css +1 -0
  998. package/themes/tomorrow-night-blue.d.ts +1 -0
  999. package/themes/tomorrow-night-blue.js +45 -0
  1000. package/themes/tomorrow-night-bright.css +1 -0
  1001. package/themes/tomorrow-night-bright.d.ts +1 -0
  1002. package/themes/tomorrow-night-bright.js +45 -0
  1003. package/themes/tomorrow-night.css +1 -0
  1004. package/themes/tomorrow-night.d.ts +1 -0
  1005. package/themes/tomorrow-night.js +62 -0
  1006. package/themes/tomorrow.css +1 -0
  1007. package/themes/tomorrow.d.ts +1 -0
  1008. package/themes/tomorrow.js +62 -0
  1009. package/themes/twilight.css +1 -0
  1010. package/themes/twilight.d.ts +1 -0
  1011. package/themes/twilight.js +62 -0
  1012. package/themes/unikitty-dark.css +1 -0
  1013. package/themes/unikitty-dark.d.ts +1 -0
  1014. package/themes/unikitty-dark.js +62 -0
  1015. package/themes/unikitty-light.css +1 -0
  1016. package/themes/unikitty-light.d.ts +1 -0
  1017. package/themes/unikitty-light.js +62 -0
  1018. package/themes/vs.css +1 -0
  1019. package/themes/vs.d.ts +1 -0
  1020. package/themes/vs.js +45 -0
  1021. package/themes/vs2015.css +1 -0
  1022. package/themes/vs2015.d.ts +1 -0
  1023. package/themes/vs2015.js +59 -0
  1024. package/themes/vulcan.css +1 -0
  1025. package/themes/vulcan.d.ts +1 -0
  1026. package/themes/vulcan.js +62 -0
  1027. package/themes/windows-10-light.css +1 -0
  1028. package/themes/windows-10-light.d.ts +1 -0
  1029. package/themes/windows-10-light.js +62 -0
  1030. package/themes/windows-10.css +1 -0
  1031. package/themes/windows-10.d.ts +1 -0
  1032. package/themes/windows-10.js +62 -0
  1033. package/themes/windows-95-light.css +1 -0
  1034. package/themes/windows-95-light.d.ts +1 -0
  1035. package/themes/windows-95-light.js +62 -0
  1036. package/themes/windows-95.css +1 -0
  1037. package/themes/windows-95.d.ts +1 -0
  1038. package/themes/windows-95.js +62 -0
  1039. package/themes/windows-high-contrast-light.css +1 -0
  1040. package/themes/windows-high-contrast-light.d.ts +1 -0
  1041. package/themes/windows-high-contrast-light.js +62 -0
  1042. package/themes/windows-high-contrast.css +1 -0
  1043. package/themes/windows-high-contrast.d.ts +1 -0
  1044. package/themes/windows-high-contrast.js +62 -0
  1045. package/themes/windows-nt-light.css +1 -0
  1046. package/themes/windows-nt-light.d.ts +1 -0
  1047. package/themes/windows-nt-light.js +62 -0
  1048. package/themes/windows-nt.css +1 -0
  1049. package/themes/windows-nt.d.ts +1 -0
  1050. package/themes/windows-nt.js +62 -0
  1051. package/themes/woodland.css +1 -0
  1052. package/themes/woodland.d.ts +1 -0
  1053. package/themes/woodland.js +62 -0
  1054. package/themes/xcode-dusk.css +1 -0
  1055. package/themes/xcode-dusk.d.ts +1 -0
  1056. package/themes/xcode-dusk.js +62 -0
  1057. package/themes/xcode.css +1 -0
  1058. package/themes/xcode.d.ts +1 -0
  1059. package/themes/xcode.js +57 -0
  1060. package/themes/xt256.css +1 -0
  1061. package/themes/xt256.d.ts +1 -0
  1062. package/themes/xt256.js +56 -0
  1063. package/themes/zenburn.css +1 -0
  1064. package/themes/zenburn.d.ts +1 -0
  1065. package/themes/zenburn.js +62 -0
  1066. package/tokenized-document.d.ts +29 -0
  1067. package/tokenized-document.js +263 -0
  1068. package/token-ranges.d.ts +0 -18
  1069. package/token-ranges.js +0 -112
package/Highlight.svelte CHANGED
@@ -8,27 +8,36 @@
8
8
  /** @type {boolean} */
9
9
  export let langtag = false;
10
10
 
11
- import hljs from "highlight.js/lib/core";
12
11
  import { afterUpdate, createEventDispatcher } from "svelte";
13
12
  import LangTag from "./LangTag.svelte";
13
+ import { ensureRegistered, registry } from "./registry.js";
14
14
 
15
+ /**
16
+ * @typedef {{ highlighted: string; events: import("./engine.d.ts").ScopeEvent[] }} HighlightEventDetail
17
+ * @type {import("svelte").EventDispatcher<{ highlight: HighlightEventDetail }>}
18
+ */
15
19
  const dispatch = createEventDispatcher();
16
20
 
17
21
  /** @type {string} */
18
22
  let highlighted = "";
19
23
 
24
+ /** @type {import("./engine.d.ts").ScopeEvent[]} */
25
+ let events = [];
26
+
20
27
  afterUpdate(() => {
21
- if (highlighted) dispatch("highlight", { highlighted });
28
+ if (highlighted) dispatch("highlight", { highlighted, events });
22
29
  });
23
30
 
24
31
  $: {
25
- hljs.registerLanguage(language.name, language.register);
32
+ ensureRegistered(language);
26
33
  const source = typeof code === "string" ? code : String(code ?? "");
27
- highlighted = hljs.highlight(source, { language: language.name }).value;
34
+ const result = registry.highlight(source, { language: language.name });
35
+ highlighted = result.value;
36
+ events = result.events;
28
37
  }
29
38
  </script>
30
39
 
31
- <slot {highlighted} {langtag} languageName={language.name}>
40
+ <slot {highlighted} {langtag} languageName={language.name} {events}>
32
41
  <LangTag
33
42
  {...$$restProps}
34
43
  languageName={language.name}
@@ -1,5 +1,6 @@
1
1
  import type { SvelteComponentTyped } from "svelte";
2
2
  import type { HTMLAttributes } from "svelte/elements";
3
+ import type { ScopeEvent } from "./engine.d.ts";
3
4
  import type { LanguageType } from "./languages";
4
5
 
5
6
  export type LangtagProps = {
@@ -78,6 +79,13 @@ export type HighlightEvents = {
78
79
  * @example "<span>...</span>"
79
80
  */
80
81
  highlighted: string;
82
+
83
+ /**
84
+ * The scope-event stream behind `highlighted` - the same array
85
+ * `registry.highlight(...).events` returns. See `svelte-highlight/engine`
86
+ * for headless consumption (`tokenLines`, `toRanges`, custom renderers).
87
+ */
88
+ events: ScopeEvent[];
81
89
  }>;
82
90
  };
83
91
 
@@ -88,6 +96,13 @@ export type HighlightSlots = {
88
96
  * @example "<span>...</span>"
89
97
  */
90
98
  highlighted: string;
99
+
100
+ /**
101
+ * The scope-event stream behind `highlighted` - the same array
102
+ * `registry.highlight(...).events` returns. See `svelte-highlight/engine`
103
+ * for headless consumption (`tokenLines`, `toRanges`, custom renderers).
104
+ */
105
+ events: ScopeEvent[];
91
106
  };
92
107
  };
93
108
 
@@ -10,32 +10,53 @@
10
10
  /** @type {boolean} */
11
11
  export let langtag = false;
12
12
 
13
- import hljs from "highlight.js";
14
13
  import { afterUpdate, createEventDispatcher } from "svelte";
14
+ import { registerAll } from "./engine.js";
15
+ // All shipped grammars so auto-detect sees customs too. Static import keeps
16
+ // detection synchronous (SSR-safe).
17
+ import allLanguages from "./languages/all.js";
18
+ import { registry } from "./registry.js";
15
19
 
16
20
  /**
17
- * @typedef {{ highlighted: string; language: string; }} HighlightEventDetail
21
+ * @typedef {{ highlighted: string; language: string; events: import("./engine.d.ts").ScopeEvent[] }} HighlightEventDetail
18
22
  * @type {import("svelte").EventDispatcher<{ highlight: HighlightEventDetail}>}
19
23
  */
20
24
  const dispatch = createEventDispatcher();
21
25
 
26
+ let allRegistered = false;
27
+ function ensureAllRegistered() {
28
+ if (allRegistered) return;
29
+ // registerAll, not registry.get(name), so alias collisions (e.g. ini
30
+ // aliasing toml) do not skip the real grammar. See registerAll in engine.js.
31
+ for (const language of allLanguages) registerAll(registry, language);
32
+ allRegistered = true;
33
+ }
34
+
22
35
  /** @type {string} */
23
36
  let highlighted = "";
24
37
 
25
38
  /** @type {string} */
26
39
  let language = "";
27
40
 
41
+ /** @type {import("./engine.d.ts").ScopeEvent[]} */
42
+ let events = [];
43
+
28
44
  afterUpdate(() => {
29
- if (highlighted) dispatch("highlight", { highlighted, language });
45
+ if (highlighted) dispatch("highlight", { highlighted, language, events });
30
46
  });
31
47
 
32
- $: ({ value: highlighted, language = "" } = hljs.highlightAuto(
33
- typeof code === "string" ? code : String(code ?? ""),
34
- languageNames,
35
- ));
48
+ $: {
49
+ ensureAllRegistered();
50
+ const source = typeof code === "string" ? code : String(code ?? "");
51
+ ({
52
+ value: highlighted,
53
+ language = "",
54
+ events,
55
+ } = registry.highlightAuto(source, languageNames));
56
+ }
36
57
  </script>
37
58
 
38
- <slot {highlighted} {langtag} languageName={language}>
59
+ <slot {highlighted} {langtag} languageName={language} {events}>
39
60
  <LangTag
40
61
  {...$$restProps}
41
62
  languageName={language}
@@ -1,5 +1,6 @@
1
1
  import type { SvelteComponentTyped } from "svelte";
2
2
  import type { HTMLAttributes } from "svelte/elements";
3
+ import type { ScopeEvent } from "./engine.d.ts";
3
4
  import type { LangtagProps } from "./Highlight.svelte";
4
5
  import type { LanguageName } from "./languages";
5
6
 
@@ -31,6 +32,14 @@ export type HighlightAutoEvents = {
31
32
  * @example "css"
32
33
  */
33
34
  language: string;
35
+
36
+ /**
37
+ * The scope-event stream behind `highlighted` - the same array
38
+ * `registry.highlightAuto(...).events` returns. See
39
+ * `svelte-highlight/engine` for headless consumption (`tokenLines`,
40
+ * `toRanges`, custom renderers).
41
+ */
42
+ events: ScopeEvent[];
34
43
  }>;
35
44
  };
36
45
 
@@ -41,6 +50,14 @@ export type HighlightAutoSlots = {
41
50
  * @example "<span>...</span>"
42
51
  */
43
52
  highlighted: string;
53
+
54
+ /**
55
+ * The scope-event stream behind `highlighted` - the same array
56
+ * `registry.highlightAuto(...).events` returns. See
57
+ * `svelte-highlight/engine` for headless consumption (`tokenLines`,
58
+ * `toRanges`, custom renderers).
59
+ */
60
+ events: ScopeEvent[];
44
61
  };
45
62
  };
46
63
 
@@ -30,19 +30,27 @@
30
30
  export let engine = "dom";
31
31
 
32
32
  /**
33
- * Theme CSS from `svelte-highlight/styles/<theme>`, used only in
33
+ * Theme CSS from `svelte-highlight/styles/<theme>`, or a `ThemePalette`
34
+ * from `svelte-highlight/themes/<theme>` — used only in
34
35
  * `"css-highlights"` mode to generate `::highlight()` rules. Colors only
35
36
  * (`color`/`background-color`); other declarations are dropped.
36
- * @type {string | undefined}
37
+ * @type {string | import("./theme.d.ts").ThemePalette | undefined}
37
38
  */
38
39
  export let theme = undefined;
39
40
 
40
- import hljs from "highlight.js/lib/core";
41
41
  import { createEventDispatcher, onMount } from "svelte";
42
- import { highlightRules } from "./highlight-theme.js";
42
+ import { renderHtml, toRanges } from "./engine.js";
43
+ import {
44
+ highlightRules,
45
+ highlightRulesFromPalette,
46
+ } from "./highlight-theme.js";
47
+ import {
48
+ parseIncremental,
49
+ reparseIncremental,
50
+ } from "./incremental-tokenize.js";
51
+ import { ensureRegistered, registry } from "./registry.js";
43
52
  import { splitLines } from "./split-lines.js";
44
53
  import { diffText } from "./text-diff.js";
45
- import { tokenize } from "./token-ranges.js";
46
54
 
47
55
  const dispatch = createEventDispatcher();
48
56
  const TRAILING_NEWLINE = /\n$/;
@@ -67,6 +75,18 @@
67
75
  // Tracks `code` so parent updates vs local edits can be distinguished.
68
76
  let internalCode = code;
69
77
 
78
+ // Incremental re-tokenize via incremental-tokenize.js; reuses tail on
79
+ // convergence. getEvents() full-parses on first call and language change.
80
+ /** @type {import("./incremental-tokenize.js").IncrementalParse | undefined} */
81
+ let incrementalParse;
82
+
83
+ function getEvents() {
84
+ incrementalParse = incrementalParse
85
+ ? reparseIncremental(registry, language.name, incrementalParse, code)
86
+ : parseIncremental(registry, language.name, code);
87
+ return incrementalParse.events;
88
+ }
89
+
70
90
  $: resolvedEngineValue =
71
91
  engine === "css-highlights" &&
72
92
  typeof CSS !== "undefined" &&
@@ -77,7 +97,7 @@
77
97
  let previousLanguageName;
78
98
  let previousEngine;
79
99
  $: {
80
- hljs.registerLanguage(language.name, language.register);
100
+ ensureRegistered(language);
81
101
  if (
82
102
  mounted &&
83
103
  (language.name !== previousLanguageName ||
@@ -93,7 +113,11 @@
93
113
  $: if (mounted && code !== internalCode) syncExternal();
94
114
  $: cssHighlightStyle =
95
115
  resolvedEngineValue === "css-highlights" && theme !== undefined
96
- ? `<style>${highlightRules(theme).replaceAll(
116
+ ? `<style>${(
117
+ typeof theme === "object"
118
+ ? highlightRulesFromPalette(theme)
119
+ : highlightRules(theme)
120
+ ).replaceAll(
97
121
  "::highlight(hljs-",
98
122
  `::highlight(hljs-${instanceId}-`,
99
123
  )}</style>`
@@ -282,7 +306,7 @@
282
306
 
283
307
  function paintCssHighlights() {
284
308
  const changedIndex = renderLines(code.split("\n"), setText);
285
- const tokenRanges = tokenize(code, language.name);
309
+ const tokenRanges = toRanges(getEvents());
286
310
 
287
311
  if (changedIndex == null) {
288
312
  for (let i = 0; i < lineEls.length; i++) {
@@ -296,7 +320,7 @@
296
320
 
297
321
  function paint() {
298
322
  if (resolvedEngineValue === "css-highlights") return paintCssHighlights();
299
- const html = hljs.highlight(code, { language: language.name }).value;
323
+ const html = renderHtml(getEvents());
300
324
  // Trailing empty line needs a phantom `\n` for caret placement.
301
325
  const paintHtml = code === "" || code.endsWith("\n") ? `${html}\n` : html;
302
326
  return renderLines(splitLines(paintHtml), setHtml);
@@ -1,6 +1,7 @@
1
1
  import type { SvelteComponentTyped } from "svelte";
2
2
  import type { HTMLAttributes } from "svelte/elements";
3
3
  import type { LanguageType } from "./languages";
4
+ import type { ThemePalette } from "./theme.d.ts";
4
5
 
5
6
  export type HighlightEditableProps = HTMLAttributes<HTMLPreElement> & {
6
7
  /**
@@ -46,13 +47,16 @@ export type HighlightEditableProps = HTMLAttributes<HTMLPreElement> & {
46
47
  engine?: "dom" | "css-highlights";
47
48
 
48
49
  /**
49
- * Theme CSS from `svelte-highlight/styles/<theme>`, used only in
50
+ * Theme CSS from `svelte-highlight/styles/<theme>`, or a `ThemePalette`
51
+ * from `svelte-highlight/themes/<theme>`, used only in
50
52
  * `"css-highlights"` mode to generate `::highlight()` rules. Colors only
51
53
  * (`color`/`background-color`); other declarations are dropped.
52
54
  * @example
53
55
  * import a11yDark from "svelte-highlight/styles/a11y-dark";
56
+ * @example
57
+ * import atomOneDark from "svelte-highlight/themes/atom-one-dark";
54
58
  */
55
- theme?: string;
59
+ theme?: string | ThemePalette;
56
60
 
57
61
  /**
58
62
  * Color of the focus outline.
@@ -28,9 +28,15 @@
28
28
  */
29
29
  export let autoScroll = false;
30
30
 
31
- import hljs from "highlight.js/lib/core";
32
31
  import { createEventDispatcher, onMount, tick } from "svelte";
33
- import { splitLines } from "./split-lines.js";
32
+ import { extendLines } from "./engine.js";
33
+ import { ensureRegistered, registry } from "./registry.js";
34
+
35
+ // Lines between sealed chunks. Once a chunk fills, its line spans are
36
+ // joined into one immutable HTML string and never touched again - keyed
37
+ // reconciliation for `{#each sealedChunks}` below only ever diffs the
38
+ // (constant-size) unsealed tail, not the whole stream.
39
+ const SEAL_CHUNK_LINES = 256;
34
40
 
35
41
  const dispatch = createEventDispatcher();
36
42
 
@@ -40,9 +46,6 @@
40
46
  /** @type {string} */
41
47
  let highlighted = "";
42
48
 
43
- /** @type {string[]} */
44
- let lines = [];
45
-
46
49
  /** @type {ReturnType<typeof requestAnimationFrame> | undefined} */
47
50
  let frame;
48
51
 
@@ -56,10 +59,125 @@
56
59
  // Stick to bottom until the user scrolls away from it.
57
60
  let stickToBottom = true;
58
61
 
62
+ /** @type {ReturnType<typeof registry.createSession> | undefined} */
63
+ let session;
64
+ let sessionLanguageName = "";
65
+ // Prefix of `code` already fed to `session`. If `code` stops starting with
66
+ // this, treat it as a restart (new stream or language change).
67
+ let fedCode = "";
68
+
69
+ // Incremental line rendering via extendLines.
70
+ let finalizedPendingHtml = "";
71
+ /** @type {string[]} */
72
+ let finalizedOpenScopes = [];
73
+ let renderedCommittedCount = 0;
74
+
75
+ // Sealed (finished, immutable) chunks of `SEAL_CHUNK_LINES` line spans
76
+ // each, pre-joined into one HTML string apiece - `sealedChunks` is never
77
+ // mutated in place, only appended to, and past entries are never rebuilt.
78
+ // `sealedHtml` mirrors the same sealed prefix as plain (wrapper-free) HTML,
79
+ // appended once per sealed chunk, so `highlighted` below is O(tail) per
80
+ // repaint instead of rejoining every line streamed so far.
81
+ /** @type {string[]} */
82
+ let sealedChunks = [];
83
+ let sealedHtml = "";
84
+ let sealedLineCount = 0;
85
+ // Completed lines not yet folded into a sealed chunk - bounded by
86
+ // `SEAL_CHUNK_LINES`, so touching it every repaint stays O(1).
87
+ /** @type {string[]} */
88
+ let unsealedLines = [];
89
+ // unsealedLines + the live preview line(s); rendered by the tail each-block.
90
+ /** @type {string[]} */
91
+ let tailLines = [];
92
+
93
+ function ensureSession() {
94
+ if (
95
+ session &&
96
+ sessionLanguageName === language.name &&
97
+ code.startsWith(fedCode)
98
+ ) {
99
+ return;
100
+ }
101
+ ensureRegistered(language);
102
+ session = registry.createSession(language.name);
103
+ sessionLanguageName = language.name;
104
+ fedCode = "";
105
+ finalizedPendingHtml = "";
106
+ finalizedOpenScopes = [];
107
+ renderedCommittedCount = 0;
108
+ sealedChunks = [];
109
+ sealedHtml = "";
110
+ sealedLineCount = 0;
111
+ unsealedLines = [];
112
+ tailLines = [];
113
+ }
114
+
115
+ // Folds the first SEAL_CHUNK_LINES entries of `unsealedLines` into one new
116
+ // sealed chunk. Called in a loop, so a single repaint that completes many
117
+ // lines at once (a burst of chunks coalesced into one frame) still seals
118
+ // as many full chunks as are ready.
119
+ function sealChunk() {
120
+ const chunkLines = unsealedLines.slice(0, SEAL_CHUNK_LINES);
121
+ let domHtml = "";
122
+ let plainHtml = "";
123
+ for (let li = 0; li < chunkLines.length; li++) {
124
+ const i = sealedLineCount + li;
125
+ const sep = i > 0 ? "\n" : "";
126
+ domHtml += `${sep}<span class="highlight-stream-line" data-line="${i}">${chunkLines[li]}</span>`;
127
+ plainHtml += sep + chunkLines[li];
128
+ }
129
+ sealedChunks = [...sealedChunks, domHtml];
130
+ sealedHtml += plainHtml;
131
+ sealedLineCount += chunkLines.length;
132
+ unsealedLines = unsealedLines.slice(SEAL_CHUNK_LINES);
133
+ }
134
+
59
135
  function repaint() {
60
- hljs.registerLanguage(language.name, language.register);
61
- highlighted = hljs.highlight(code, { language: language.name }).value;
62
- lines = splitLines(highlighted);
136
+ ensureSession();
137
+ if (code.length > fedCode.length) {
138
+ session.append(code.slice(fedCode.length));
139
+ fedCode = code;
140
+ }
141
+
142
+ if (done) {
143
+ // Full re-parse for multi-line lookahead (heredocs, etc.).
144
+ highlighted = session.finish({ canonicalize: true }).value;
145
+ } else {
146
+ // Newly committed events (append only tokenizes complete lines).
147
+ const committed = session.events();
148
+ if (committed.length > renderedCommittedCount) {
149
+ const result = extendLines(
150
+ committed.slice(renderedCommittedCount),
151
+ finalizedOpenScopes,
152
+ finalizedPendingHtml,
153
+ );
154
+ if (result.completedLines.length > 0) {
155
+ unsealedLines = unsealedLines.concat(result.completedLines);
156
+ while (unsealedLines.length >= SEAL_CHUNK_LINES) sealChunk();
157
+ }
158
+ finalizedPendingHtml = result.pendingHtml;
159
+ finalizedOpenScopes = result.openScopes;
160
+ renderedCommittedCount = committed.length;
161
+ }
162
+
163
+ // Staged tail: current line still streaming in, not newline-terminated.
164
+ const snapshot = session.snapshot();
165
+ let previewLines = [finalizedPendingHtml];
166
+ if (snapshot.pos < fedCode.length) {
167
+ const preview = registry.resume(fedCode, sessionLanguageName, snapshot);
168
+ const result = extendLines(
169
+ preview.events,
170
+ finalizedOpenScopes,
171
+ finalizedPendingHtml,
172
+ );
173
+ previewLines = [...result.completedLines, result.pendingHtml];
174
+ }
175
+
176
+ tailLines = [...unsealedLines, ...previewLines];
177
+ highlighted =
178
+ sealedHtml + (sealedLineCount > 0 ? "\n" : "") + tailLines.join("\n");
179
+ }
180
+
63
181
  dispatch("highlight", { highlighted });
64
182
 
65
183
  if (autoScroll) {
@@ -87,9 +205,7 @@
87
205
  }
88
206
  }
89
207
 
90
- // Coalesce a burst of chunks within one frame into a single highlight
91
- // pass; the tab going hidden just pauses the (already-scheduled) frame
92
- // rather than queuing more work.
208
+ // Coalesce chunk bursts into one highlight pass per frame.
93
209
  function scheduleRepaint() {
94
210
  if (frame != null) return;
95
211
  frame = requestAnimationFrame(() => {
@@ -105,8 +221,7 @@
105
221
  doneDispatched = false;
106
222
  scheduleRepaint();
107
223
  } else {
108
- // SSR / first paint before mount, and the final full highlight once
109
- // the stream finishes: both render synchronously, no rAF involved.
224
+ // SSR, pre-mount, and final done pass: synchronous, no rAF.
110
225
  cancelFrame();
111
226
  repaint();
112
227
  if (mounted && !doneDispatched) {
@@ -127,7 +242,7 @@
127
242
 
128
243
  <pre bind:this={container} on:scroll={onScroll} {...$$restProps}><code
129
244
  class:hljs={true}
130
- >{#if useSplitRendering}{#each lines as line, i (i)}{#if i > 0}{"\n"}{/if}<span class="highlight-stream-line" data-line={i}>{@html line}</span>{/each}{#if showCaret}<span class="highlight-stream-caret" aria-hidden="true"></span>{/if}{:else}{@html highlighted}{/if}</code></pre>
245
+ >{#if useSplitRendering}{#each sealedChunks as chunk, c (c)}{@html chunk}{/each}{#each tailLines as line, li (sealedLineCount + li)}{#if sealedLineCount + li > 0}{"\n"}{/if}<span class="highlight-stream-line" data-line={sealedLineCount + li}>{@html line}</span>{/each}{#if showCaret}<span class="highlight-stream-caret" aria-hidden="true"></span>{/if}{:else}{@html highlighted}{/if}</code></pre>
131
246
 
132
247
  <style>
133
248
  .highlight-stream-caret {
@@ -25,49 +25,86 @@
25
25
  <script>
26
26
  import { onDestroy } from "svelte";
27
27
  import { dualStyle, scopeClassFor, scopeStyle } from "./scoped.js";
28
+ import { dualPaletteStyle, paletteStyle } from "./theme-style.js";
28
29
 
29
30
  /**
30
- * Theme CSS from `svelte-highlight/styles/<theme>`.
31
+ * Theme CSS from `svelte-highlight/styles/<theme>`, or a `ThemePalette`
32
+ * from `svelte-highlight/themes/<theme>` — the latter is applied by
33
+ * inlining `--shl-*` vars on the wrapper element instead of injecting a
34
+ * scoped `<style>` tag.
31
35
  * @example
32
36
  * import a11yDark from "svelte-highlight/styles/a11y-dark";
33
- * @type {string}
37
+ * @example
38
+ * import atomOneDark from "svelte-highlight/themes/atom-one-dark";
39
+ * @type {string | import("./theme.d.ts").ThemePalette}
34
40
  */
35
41
  export let theme = undefined;
36
42
 
37
43
  /**
38
- * Light theme CSS. With `dark`, overrides `theme`.
39
- * @type {string | undefined}
44
+ * Light theme CSS/palette. With `dark`, overrides `theme`. Must be the
45
+ * same type (string or `ThemePalette`) as `dark`.
46
+ * @type {string | import("./theme.d.ts").ThemePalette | undefined}
40
47
  */
41
48
  export let light = undefined;
42
49
 
43
- /** Dark theme CSS; pair with `light`. */
50
+ /**
51
+ * Dark theme CSS/palette; pair with `light`.
52
+ * @type {string | import("./theme.d.ts").ThemePalette | undefined}
53
+ */
44
54
  export let dark = undefined;
45
55
 
46
56
  /**
47
57
  * Theme switch: `"auto"` | `"light"` | `"dark"` | CSS selector for dark.
58
+ * On the `ThemePalette` path this controls the inlined `color-scheme`
59
+ * (`"auto"` -> `light dark`); any other string is treated as the legacy
60
+ * app-controlled mode, and no `color-scheme` is inlined — set it on your
61
+ * own selector instead (e.g. `[data-theme="dark"] { color-scheme: dark }`).
48
62
  * @type {"auto" | "light" | "dark" | string}
49
63
  */
50
64
  export let mode = "auto";
51
65
 
52
- /** Scope class for prefixed selectors. */
66
+ /** Scope class for prefixed selectors. Inert on the `ThemePalette` path
67
+ * (kept for back-compat / slot access), since there's no scoped
68
+ * `<style>` tag to match against. */
53
69
  export let scopeClass = undefined;
54
70
 
55
71
  // Captured once: a consumer-supplied scopeClass is honored for the
56
72
  // lifetime of the instance instead of being overwritten by the hash below.
57
73
  const hasOwnScopeClass = scopeClass !== undefined;
58
74
 
59
- $: hasTheme =
60
- theme !== undefined || (light !== undefined && dark !== undefined);
75
+ $: usingPair = light !== undefined && dark !== undefined;
76
+ $: usingObjectPair =
77
+ usingPair && typeof light === "object" && typeof dark === "object";
78
+ $: usingObjectTheme =
79
+ !usingPair && theme !== undefined && typeof theme === "object";
80
+ $: usingObjectPalette = usingObjectPair || usingObjectTheme;
81
+
82
+ $: hasTheme = theme !== undefined || usingPair;
61
83
 
62
84
  $: if (!hasOwnScopeClass) {
63
- scopeClass = scopeClassFor(theme ?? `${light}${dark}`);
85
+ scopeClass = usingObjectPair
86
+ ? scopeClassFor(`${light.name}::${dark.name}`)
87
+ : usingObjectTheme
88
+ ? scopeClassFor(theme.name)
89
+ : scopeClassFor(theme ?? `${light}${dark}`);
64
90
  }
65
91
 
66
- $: style = hasTheme
67
- ? light !== undefined && dark !== undefined
68
- ? dualStyle(light, dark, scopeClass, mode)
69
- : scopeStyle(theme, scopeClass)
70
- : "";
92
+ // The scoped-<style> path's content; empty (nothing rendered) on the
93
+ // object path, which never touches <svelte:head> or the ownership store.
94
+ $: style =
95
+ hasTheme && !usingObjectPalette
96
+ ? usingPair
97
+ ? dualStyle(light, dark, scopeClass, mode)
98
+ : scopeStyle(theme, scopeClass)
99
+ : "";
100
+
101
+ // Inline vars applied to the wrapper element; undefined (no `style`
102
+ // attribute) on the legacy scoped-<style> path.
103
+ $: inlineStyle = usingObjectPair
104
+ ? dualPaletteStyle(light, dark, mode)
105
+ : usingObjectTheme
106
+ ? paletteStyle(theme)
107
+ : undefined;
71
108
 
72
109
  const token = Symbol();
73
110
  let registeredKey;
@@ -100,6 +137,6 @@
100
137
  {/if}</svelte:head
101
138
  >
102
139
 
103
- <div class={scopeClass} {...$$restProps}>
140
+ <div class={scopeClass} style={inlineStyle} {...$$restProps}>
104
141
  <slot {scopeClass} />
105
142
  </div>
@@ -1,37 +1,50 @@
1
1
  import type { SvelteComponentTyped } from "svelte";
2
2
  import type { HTMLAttributes } from "svelte/elements";
3
+ import type { ThemePalette } from "./theme.d.ts";
3
4
 
4
5
  export type HighlightStyleProps = HTMLAttributes<HTMLDivElement> & {
5
6
  /**
6
- * Theme CSS from `svelte-highlight/styles/<theme>`.
7
+ * Theme CSS from `svelte-highlight/styles/<theme>`, or a `ThemePalette`
8
+ * from `svelte-highlight/themes/<theme>` — the latter is applied by
9
+ * inlining `--shl-*` vars on the wrapper element instead of injecting a
10
+ * scoped `<style>` tag.
7
11
  * @example
8
12
  * import a11yDark from "svelte-highlight/styles/a11y-dark";
13
+ * @example
14
+ * import atomOneDark from "svelte-highlight/themes/atom-one-dark";
9
15
  */
10
- theme?: string;
16
+ theme?: string | ThemePalette;
11
17
 
12
18
  /**
13
- * Light theme CSS; pair with `dark` to emit both stylesheets and switch
19
+ * Light theme CSS/palette; pair with `dark` to emit both and switch
14
20
  * automatically. Takes precedence over `theme` when both `light` and `dark`
15
- * are provided.
21
+ * are provided. Must be the same type (string or `ThemePalette`) as `dark`.
16
22
  */
17
- light?: string;
23
+ light?: string | ThemePalette;
18
24
 
19
25
  /**
20
- * Dark theme CSS; pair with `light` to emit both stylesheets.
26
+ * Dark theme CSS/palette; pair with `light`.
21
27
  */
22
- dark?: string;
28
+ dark?: string | ThemePalette;
23
29
 
24
30
  /**
25
- * How to switch between `light` and `dark`:
26
- * `"auto"` uses `prefers-color-scheme` media queries, `"light"`/`"dark"`
27
- * force a single theme, and any other string is a CSS selector that gates
28
- * the dark block (e.g. `[data-theme="dark"]`).
31
+ * How to switch between `light` and `dark`.
32
+ *
33
+ * String path: `"auto"` uses `prefers-color-scheme` media queries,
34
+ * `"light"`/`"dark"` force a single theme, and any other string is a CSS
35
+ * selector that gates the dark block (e.g. `[data-theme="dark"]`).
36
+ *
37
+ * `ThemePalette` path: `"auto"` inlines `color-scheme: light dark` (vars
38
+ * resolve via `light-dark()`), `"light"`/`"dark"` force that
39
+ * `color-scheme`, and any other string omits `color-scheme` — set it on
40
+ * your own selector for app-controlled switching.
29
41
  * @default "auto"
30
42
  */
31
43
  mode?: "auto" | "light" | "dark" | (string & {});
32
44
 
33
45
  /**
34
- * Wrapper class the scoped selectors target.
46
+ * Wrapper class the scoped selectors target. Inert on the `ThemePalette`
47
+ * path (kept for back-compat / slot access).
35
48
  * @default hash of `theme`
36
49
  */
37
50
  scopeClass?: string;