@speed-highlight/core 2.1.0 → 2.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -93,7 +93,7 @@ If you highlight at build time and bytes do not matter, use Shiki. speed-highlig
93
93
 
94
94
  ### In a component
95
95
 
96
- Frameworks own their DOM, so highlight the *string* and render it, as in the quick start (mutating a mounted node with `highlightElement` gets wiped on the next render). The output is HTML-escaped (`&`, `<`, `>`), safe to inject even for untrusted code; the `shj-lang-*` and `shj-block` classes hook it into the theme. The same pattern works in Vue, Svelte, and Angular; ready-made components are in [#85](https://github.com/speed-highlight/core/pull/85).
96
+ Frameworks own their DOM, so highlight the *string* and render it, as in the quick start (mutating a mounted node with `highlightElement` gets wiped on the next render). The output is HTML-escaped (`&`, `<`, `>`), safe to inject even for untrusted code; the `shj-lang-*` and `shj-block` classes hook it into the theme. The same pattern works in Vue, Svelte, and Angular; ready-made components are in [examples](examples).
97
97
 
98
98
  ### On a plain page
99
99
 
@@ -193,11 +193,11 @@ export default {
193
193
  };
194
194
  ```
195
195
 
196
- For Deno, use the [deno module](https://deno.land/x/speed_highlight_js):
196
+ For Deno, import the npm package with `npm:`, nothing to install:
197
197
 
198
198
  ```js
199
- import { highlightANSI } from 'https://deno.land/x/speed_highlight_js/dist/index.js';
200
- import theme from 'https://deno.land/x/speed_highlight_js/dist/themes/default.js';
199
+ import { highlightANSI } from 'npm:@speed-highlight/core';
200
+ import theme from 'npm:@speed-highlight/core/themes/default.js';
201
201
 
202
202
  console.log(await highlightANSI('console.log("hello")', 'js', theme));
203
203
  ```
@@ -225,7 +225,7 @@ The main entry covers most apps; reach for `/tokenize` when you want the raw tok
225
225
  ## Languages
226
226
 
227
227
  <!-- AUTOGENERATED:LANGUAGES:START (run `npm run build` to regenerate) -->
228
- | Name | [CSS Class](#web-usage) | Support | Detection | Size (gzip, 14.4 kB total) |
228
+ | Name | [CSS Class](#web-usage) | Support | Detection | Size (gzip, 14.5 kB total) |
229
229
  | --- | --- | --- | --- | --- |
230
230
  | Assembly | `shj-lang-asm` | | ✅ | [`194 B`](src/languages/asm.js) |
231
231
  | Bash | `shj-lang-bash` | | ✅ | [`430 B`](src/languages/bash.js) |
@@ -237,7 +237,7 @@ The main entry covers most apps; reach for `/tokenize` when you want the raw tok
237
237
  | Dockerfile | `shj-lang-docker` | | ✅ | [`566 B`](src/languages/docker.js) |
238
238
  | Git | `shj-lang-git` | comment, insert, deleted, string, ... | ❌ | [`222 B`](src/languages/git.js) |
239
239
  | Go | `shj-lang-go` | | ✅ | [`329 B`](src/languages/go.js) |
240
- | HTML | `shj-lang-html` | inline style and event handlers | ✅ | [`726 B`](src/languages/html.js) |
240
+ | HTML | `shj-lang-html` | inline style and event handlers | ✅ | [`769 B`](src/languages/html.js) |
241
241
  | HTTP | `shj-lang-http` | keywork, string, punctuation, variable, version | ✅ | [`986 B`](src/languages/http.js) |
242
242
  | INI | `shj-lang-ini` | | ❌ | [`158 B`](src/languages/ini.js) |
243
243
  | Java | `shj-lang-java` | | ✅ | [`457 B`](src/languages/java.js) |
@@ -259,7 +259,7 @@ The main entry covers most apps; reach for `/tokenize` when you want the raw tok
259
259
  | TOML | `shj-lang-toml` | comment, table, string, bool, variable | ❌ | [`236 B`](src/languages/toml.js) |
260
260
  | TypeScript | `shj-lang-ts` | js syntax, ts keyword, types | ✅ | [`911 B`](src/languages/ts.js) |
261
261
  | URI | `shj-lang-uri` | | ✅ | [`176 B`](src/languages/uri.js) |
262
- | XML | `shj-lang-xml` | | ✅ | [`511 B`](src/languages/xml.js) |
262
+ | XML | `shj-lang-xml` | | ✅ | [`530 B`](src/languages/xml.js) |
263
263
  | YAML | `shj-lang-yaml` | comment, numbers, variable, string, bool | ✅ | [`208 B`](src/languages/yaml.js) |
264
264
  <!-- AUTOGENERATED:LANGUAGES:END -->
265
265
 
@@ -270,7 +270,12 @@ The main entry covers most apps; reach for `/tokenize` when you want the raw tok
270
270
  | --- | --- | --- |
271
271
  | `default` | ✅ [`174 B`](src/themes/default.js) | ✅ [`603 B`](src/themes/default.css) |
272
272
  | `atom-dark` | ✅ [`174 B`](src/themes/atom-dark.js) | ✅ [`699 B`](src/themes/atom-dark.css) |
273
+ | `catppuccin-frappe` | ❌ | ✅ [`694 B`](src/themes/catppuccin-frappe.css) |
274
+ | `catppuccin-latte` | ❌ | ✅ [`695 B`](src/themes/catppuccin-latte.css) |
275
+ | `catppuccin-macchiato` | ❌ | ✅ [`694 B`](src/themes/catppuccin-macchiato.css) |
276
+ | `catppuccin-mocha` | ❌ | ✅ [`691 B`](src/themes/catppuccin-mocha.css) |
273
277
  | `dark` | ❌ | ✅ [`695 B`](src/themes/dark.css) |
278
+ | `dracula` | ❌ | ✅ [`690 B`](src/themes/dracula.css) |
274
279
  | `github-dark` | ❌ | ✅ [`691 B`](src/themes/github-dark.css) |
275
280
  | `github-dim` | ❌ | ✅ [`700 B`](src/themes/github-dim.css) |
276
281
  | `github-light` | ❌ | ✅ [`672 B`](src/themes/github-light.css) |
@@ -44,8 +44,8 @@ declare const _default: ({
44
44
  } | {
45
45
  match: RegExp;
46
46
  sub: ({
47
- sub: import("../tokenize.js").ShjRule[];
48
47
  match: RegExp;
48
+ sub: import("../index.js").ShjGrammar;
49
49
  } | {
50
50
  match: RegExp;
51
51
  sub: string;
@@ -1 +1 @@
1
- {"version":3,"file":"html.d.ts","sourceRoot":"","sources":["../../src/languages/html.js"],"names":[],"mappings":""}
1
+ {"version":3,"file":"html.d.ts","sourceRoot":"","sources":["../../src/languages/html.js"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;eAiCqB,MAAM;aAAO,OAAO,aAAa,EAAE,UAAU"}
@@ -1 +1 @@
1
- var a=":A-Z_a-z\xC0-\xD6\xD8-\xF6\xF8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD",r=a+"\\-\\.0-9\xB7\u0300-\u036F\u203F-\u2040",t=`[${a}][${r}]*`,e=`(\\s+${t}\\s*(=\\s*([^"'>\\s][^>\\s]*|("|')(\\\\[^]|(?!\\4)[^])*\\4?)?)?)*\\s*`,s={match:RegExp(`<[/!?]?${t}${e}[/!?]?>`,"g"),sub:[{type:"var",match:RegExp(`^<[/!?]?${t}`,"g"),sub:[{type:"oper",match:/^<[\/!?]?/g}]},{type:"str",match:/=\s*([^"'>\s][^>\s]*|("|')(\\[^]|(?!\2)[^])*\2?)/g,sub:[{type:"oper",match:/^=/g}]},{type:"oper",match:/[\/!?]?>/g},{type:"class",match:RegExp(t,"g")}]},m=[{match:/<!--[^]*?-->/g,type:"cmnt",sub:"todo"},{type:"class",match:/<!\[CDATA\[[\s\S]*?\]\]>/gi},s,{type:"str",match:RegExp(`<\\?${t}([^?]|\\?[^?>])*\\?+>`,"g"),sub:[{type:"var",match:RegExp(`^<\\?${t}`,"g"),sub:[{type:"oper",match:/^<\?/g}]},{type:"oper",match:/\?+>$/g}]},{type:"var",match:/&(#x?)?[\da-z]{1,8};/gi}];var c=(u,g)=>({type:"str",match:RegExp(`(?<=\\s${u}\\s*)=\\s*('[^']*'|"[^"]*")`,"gi"),sub:[{type:"oper",match:/^=/g},{match:/(?<=['"])[^]+(?=['"]$)/g,sub:g}]}),p={...s,sub:[c("style","css"),c("on\\w+","js"),...s.sub]},F=[{type:"class",match:/<!DOCTYPE("[^"]*"|'[^']*'|[^"'>])*>/gi,sub:[{type:"str",match:/"[^"]*"|'[^']*'/g},{type:"oper",match:/^<!|>$/g},{type:"var",match:/DOCTYPE/gi}]},{match:RegExp(`<style${e}>[^]*?</style\\s*>`,"g"),sub:[{match:RegExp(`^<style${e}>`,"g"),sub:p.sub},{match:/[^]*(?=<\/style\s*>$)/g,sub:"css"},p]},{match:RegExp(`<script${e}>[^]*?<\/script\\s*>`,"g"),sub:[{match:RegExp(`^<script${e}>`,"g"),sub:p.sub},{match:/[^]*(?=<\/script\s*>$)/g,sub:"js"},p]},...m.map(u=>u===s?p:u)];export{F as default};
1
+ var m=":A-Z_a-z\xC0-\xD6\xD8-\xF6\xF8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD",y=m+"\\-\\.0-9\xB7\u0300-\u036F\u203F-\u2040",t=`[${m}][${y}]*`,u=e=>`(\\s+${e}\\s*(=\\s*([^"'>\\s][^>\\s]*|("|')(\\\\[^]|(?!\\4)[^])*\\4?)?)?)*\\s*`,F=u(t),p={match:RegExp(`<[/!?]?${t}${F}[/!?]?>`,"g"),sub:[{type:"var",match:RegExp(`^<[/!?]?${t}`,"g"),sub:[{type:"oper",match:/^<[\/!?]?/g}]},{type:"str",match:/=\s*([^"'>\s][^>\s]*|("|')(\\[^]|(?!\2)[^])*\2?)/g,sub:[{type:"oper",match:/^=/g}]},{type:"oper",match:/[\/!?]?>/g},{type:"class",match:RegExp(t,"g")}]},c=[{match:/<!--[^]*?-->/g,type:"cmnt",sub:"todo"},{type:"class",match:/<!\[CDATA\[[\s\S]*?\]\]>/gi},p,{type:"str",match:RegExp(`<\\?${t}([^?]|\\?[^?>])*\\?+>`,"g"),sub:[{type:"var",match:RegExp(`^<\\?${t}`,"g"),sub:[{type:"oper",match:/^<\?/g}]},{type:"oper",match:/\?+>$/g}]},{type:"var",match:/&(#x?)?[\da-z]{1,8};/gi}];var r=`[^\\s"'>\\/=]+`,a=u(r),g=(e,h)=>({type:"str",match:RegExp(`(?<=\\s${e}\\s*)=\\s*('[^']*'|"[^"]*")`,"gi"),sub:[{type:"oper",match:/^=/g},{match:/(?<=['"])[^]+(?=['"]$)/g,sub:h}]}),s={match:RegExp(`<[/!?]?${t}${a}[/!?]?>`,"g"),sub:[g("style","css"),g("on\\w+","js"),...p.sub.slice(0,-1),{type:"class",match:RegExp(r,"g")}]},$=[{type:"class",match:/<!DOCTYPE("[^"]*"|'[^']*'|[^"'>])*>/gi,sub:[{type:"str",match:/"[^"]*"|'[^']*'/g},{type:"oper",match:/^<!|>$/g},{type:"var",match:/DOCTYPE/gi}]},{match:RegExp(`<style${a}>[^]*?</style\\s*>`,"g"),sub:[{match:RegExp(`^<style${a}>`,"g"),sub:s.sub},{match:/[^]*(?=<\/style\s*>$)/g,sub:"css"},s]},{match:RegExp(`<script${a}>[^]*?<\/script\\s*>`,"g"),sub:[{match:RegExp(`^<script${a}>`,"g"),sub:s.sub},{match:/[^]*(?=<\/script\s*>$)/g,sub:"js"},s]},...c.map(e=>e===p?s:e)];export{$ as default};
@@ -1,4 +1,9 @@
1
1
  export let name: string;
2
+ /**
3
+ * The attributes of a tag, given the regex source of an attribute name
4
+ * @type {(attribute: string) => string}
5
+ */
6
+ export let attributes: (attribute: string) => string;
2
7
  export let properties: string;
3
8
  /** @type {{ match: RegExp, sub: import('../index.js').ShjGrammar }} */
4
9
  export let xmlElement: {
@@ -1 +1 @@
1
- {"version":3,"file":"xml.d.ts","sourceRoot":"","sources":["../../src/languages/xml.js"],"names":[],"mappings":"AAQC,wBAAyC;AACzC,8BAAgG;AAChG,uEAAuE;AACvE,uBADW;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,OAAO,aAAa,EAAE,UAAU,CAAA;CAAE,CAiClE;;WAjCmB,MAAM;SAAO,OAAO,aAAa,EAAE,UAAU"}
1
+ {"version":3,"file":"xml.d.ts","sourceRoot":"","sources":["../../src/languages/xml.js"],"names":[],"mappings":"AAQC,wBAAyC;AACzC;;;GAGG;AACH,uBAFU,CAAC,SAAS,EAAE,MAAM,KAAK,MAAM,CAE2E;AAClH,8BAA6B;AAC7B,uEAAuE;AACvE,uBADW;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,OAAO,aAAa,EAAE,UAAU,CAAA;CAAE,CAiClE;;WAjCmB,MAAM;SAAO,OAAO,aAAa,EAAE,UAAU"}
@@ -1 +1 @@
1
- var e=":A-Z_a-z\xC0-\xD6\xD8-\xF6\xF8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD",u=e+"\\-\\.0-9\xB7\u0300-\u036F\u203F-\u2040",t=`[${e}][${u}]*`,a=`(\\s+${t}\\s*(=\\s*([^"'>\\s][^>\\s]*|("|')(\\\\[^]|(?!\\4)[^])*\\4?)?)?)*\\s*`,p={match:RegExp(`<[/!?]?${t}${a}[/!?]?>`,"g"),sub:[{type:"var",match:RegExp(`^<[/!?]?${t}`,"g"),sub:[{type:"oper",match:/^<[\/!?]?/g}]},{type:"str",match:/=\s*([^"'>\s][^>\s]*|("|')(\\[^]|(?!\2)[^])*\2?)/g,sub:[{type:"oper",match:/^=/g}]},{type:"oper",match:/[\/!?]?>/g},{type:"class",match:RegExp(t,"g")}]},s=[{match:/<!--[^]*?-->/g,type:"cmnt",sub:"todo"},{type:"class",match:/<!\[CDATA\[[\s\S]*?\]\]>/gi},p,{type:"str",match:RegExp(`<\\?${t}([^?]|\\?[^?>])*\\?+>`,"g"),sub:[{type:"var",match:RegExp(`^<\\?${t}`,"g"),sub:[{type:"oper",match:/^<\?/g}]},{type:"oper",match:/\?+>$/g}]},{type:"var",match:/&(#x?)?[\da-z]{1,8};/gi}];export{s as default,t as name,a as properties,p as xmlElement};
1
+ var e=":A-Z_a-z\xC0-\xD6\xD8-\xF6\xF8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD",a=e+"\\-\\.0-9\xB7\u0300-\u036F\u203F-\u2040",t=`[${e}][${a}]*`,p=u=>`(\\s+${u}\\s*(=\\s*([^"'>\\s][^>\\s]*|("|')(\\\\[^]|(?!\\4)[^])*\\4?)?)?)*\\s*`,s=p(t),F={match:RegExp(`<[/!?]?${t}${s}[/!?]?>`,"g"),sub:[{type:"var",match:RegExp(`^<[/!?]?${t}`,"g"),sub:[{type:"oper",match:/^<[\/!?]?/g}]},{type:"str",match:/=\s*([^"'>\s][^>\s]*|("|')(\\[^]|(?!\2)[^])*\2?)/g,sub:[{type:"oper",match:/^=/g}]},{type:"oper",match:/[\/!?]?>/g},{type:"class",match:RegExp(t,"g")}]},m=[{match:/<!--[^]*?-->/g,type:"cmnt",sub:"todo"},{type:"class",match:/<!\[CDATA\[[\s\S]*?\]\]>/gi},F,{type:"str",match:RegExp(`<\\?${t}([^?]|\\?[^?>])*\\?+>`,"g"),sub:[{type:"var",match:RegExp(`^<\\?${t}`,"g"),sub:[{type:"oper",match:/^<\?/g}]},{type:"oper",match:/\?+>$/g}]},{type:"var",match:/&(#x?)?[\da-z]{1,8};/gi}];export{p as attributes,m as default,t as name,s as properties,F as xmlElement};
@@ -44,8 +44,8 @@ declare const _default: ({
44
44
  } | {
45
45
  match: RegExp;
46
46
  sub: ({
47
- sub: import("../tokenize.js").ShjRule[];
48
47
  match: RegExp;
48
+ sub: import("../index.js").ShjGrammar;
49
49
  } | {
50
50
  match: RegExp;
51
51
  sub: string;
@@ -1 +1 @@
1
- {"version":3,"file":"html.d.ts","sourceRoot":"","sources":["../../../src/languages/html.js"],"names":[],"mappings":""}
1
+ {"version":3,"file":"html.d.ts","sourceRoot":"","sources":["../../../src/languages/html.js"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;eAiCqB,MAAM;aAAO,OAAO,aAAa,EAAE,UAAU"}
@@ -1 +1 @@
1
- var g=Object.defineProperty;var b=Object.getOwnPropertyDescriptor;var l=Object.getOwnPropertyNames;var $=Object.prototype.hasOwnProperty;var o=(t,e)=>{for(var c in e)g(t,c,{get:e[c],enumerable:!0})},x=(t,e,c,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let u of l(e))!$.call(t,u)&&u!==c&&g(t,u,{get:()=>e[u],enumerable:!(r=b(e,u))||r.enumerable});return t};var E=t=>x(g({},"__esModule",{value:!0}),t);var R={};o(R,{default:()=>D});module.exports=E(R);var h=":A-Z_a-z\xC0-\xD6\xD8-\xF6\xF8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD",i=h+"\\-\\.0-9\xB7\u0300-\u036F\u203F-\u2040",s=`[${h}][${i}]*`,p=`(\\s+${s}\\s*(=\\s*([^"'>\\s][^>\\s]*|("|')(\\\\[^]|(?!\\4)[^])*\\4?)?)?)*\\s*`,a={match:RegExp(`<[/!?]?${s}${p}[/!?]?>`,"g"),sub:[{type:"var",match:RegExp(`^<[/!?]?${s}`,"g"),sub:[{type:"oper",match:/^<[\/!?]?/g}]},{type:"str",match:/=\s*([^"'>\s][^>\s]*|("|')(\\[^]|(?!\2)[^])*\2?)/g,sub:[{type:"oper",match:/^=/g}]},{type:"oper",match:/[\/!?]?>/g},{type:"class",match:RegExp(s,"g")}]},y=[{match:/<!--[^]*?-->/g,type:"cmnt",sub:"todo"},{type:"class",match:/<!\[CDATA\[[\s\S]*?\]\]>/gi},a,{type:"str",match:RegExp(`<\\?${s}([^?]|\\?[^?>])*\\?+>`,"g"),sub:[{type:"var",match:RegExp(`^<\\?${s}`,"g"),sub:[{type:"oper",match:/^<\?/g}]},{type:"oper",match:/\?+>$/g}]},{type:"var",match:/&(#x?)?[\da-z]{1,8};/gi}];var F=(t,e)=>({type:"str",match:RegExp(`(?<=\\s${t}\\s*)=\\s*('[^']*'|"[^"]*")`,"gi"),sub:[{type:"oper",match:/^=/g},{match:/(?<=['"])[^]+(?=['"]$)/g,sub:e}]}),m={...a,sub:[F("style","css"),F("on\\w+","js"),...a.sub]},D=[{type:"class",match:/<!DOCTYPE("[^"]*"|'[^']*'|[^"'>])*>/gi,sub:[{type:"str",match:/"[^"]*"|'[^']*'/g},{type:"oper",match:/^<!|>$/g},{type:"var",match:/DOCTYPE/gi}]},{match:RegExp(`<style${p}>[^]*?</style\\s*>`,"g"),sub:[{match:RegExp(`^<style${p}>`,"g"),sub:m.sub},{match:/[^]*(?=<\/style\s*>$)/g,sub:"css"},m]},{match:RegExp(`<script${p}>[^]*?</script\\s*>`,"g"),sub:[{match:RegExp(`^<script${p}>`,"g"),sub:m.sub},{match:/[^]*(?=<\/script\s*>$)/g,sub:"js"},m]},...y.map(t=>t===a?m:t)];
1
+ var g=Object.defineProperty;var $=Object.getOwnPropertyDescriptor;var x=Object.getOwnPropertyNames;var E=Object.prototype.hasOwnProperty;var i=(t,e)=>{for(var m in e)g(t,m,{get:e[m],enumerable:!0})},o=(t,e,m,h)=>{if(e&&typeof e=="object"||typeof e=="function")for(let a of x(e))!E.call(t,a)&&a!==m&&g(t,a,{get:()=>e[a],enumerable:!(h=$(e,a))||h.enumerable});return t};var R=t=>o(g({},"__esModule",{value:!0}),t);var d={};i(d,{default:()=>C});module.exports=R(d);var y=":A-Z_a-z\xC0-\xD6\xD8-\xF6\xF8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD",D=y+"\\-\\.0-9\xB7\u0300-\u036F\u203F-\u2040",s=`[${y}][${D}]*`,r=t=>`(\\s+${t}\\s*(=\\s*([^"'>\\s][^>\\s]*|("|')(\\\\[^]|(?!\\4)[^])*\\4?)?)?)*\\s*`,n=r(s),c={match:RegExp(`<[/!?]?${s}${n}[/!?]?>`,"g"),sub:[{type:"var",match:RegExp(`^<[/!?]?${s}`,"g"),sub:[{type:"oper",match:/^<[\/!?]?/g}]},{type:"str",match:/=\s*([^"'>\s][^>\s]*|("|')(\\[^]|(?!\2)[^])*\2?)/g,sub:[{type:"oper",match:/^=/g}]},{type:"oper",match:/[\/!?]?>/g},{type:"class",match:RegExp(s,"g")}]},F=[{match:/<!--[^]*?-->/g,type:"cmnt",sub:"todo"},{type:"class",match:/<!\[CDATA\[[\s\S]*?\]\]>/gi},c,{type:"str",match:RegExp(`<\\?${s}([^?]|\\?[^?>])*\\?+>`,"g"),sub:[{type:"var",match:RegExp(`^<\\?${s}`,"g"),sub:[{type:"oper",match:/^<\?/g}]},{type:"oper",match:/\?+>$/g}]},{type:"var",match:/&(#x?)?[\da-z]{1,8};/gi}];var l=`[^\\s"'>\\/=]+`,u=r(l),b=(t,e)=>({type:"str",match:RegExp(`(?<=\\s${t}\\s*)=\\s*('[^']*'|"[^"]*")`,"gi"),sub:[{type:"oper",match:/^=/g},{match:/(?<=['"])[^]+(?=['"]$)/g,sub:e}]}),p={match:RegExp(`<[/!?]?${s}${u}[/!?]?>`,"g"),sub:[b("style","css"),b("on\\w+","js"),...c.sub.slice(0,-1),{type:"class",match:RegExp(l,"g")}]},C=[{type:"class",match:/<!DOCTYPE("[^"]*"|'[^']*'|[^"'>])*>/gi,sub:[{type:"str",match:/"[^"]*"|'[^']*'/g},{type:"oper",match:/^<!|>$/g},{type:"var",match:/DOCTYPE/gi}]},{match:RegExp(`<style${u}>[^]*?</style\\s*>`,"g"),sub:[{match:RegExp(`^<style${u}>`,"g"),sub:p.sub},{match:/[^]*(?=<\/style\s*>$)/g,sub:"css"},p]},{match:RegExp(`<script${u}>[^]*?</script\\s*>`,"g"),sub:[{match:RegExp(`^<script${u}>`,"g"),sub:p.sub},{match:/[^]*(?=<\/script\s*>$)/g,sub:"js"},p]},...F.map(t=>t===c?p:t)];
@@ -1,4 +1,9 @@
1
1
  export let name: string;
2
+ /**
3
+ * The attributes of a tag, given the regex source of an attribute name
4
+ * @type {(attribute: string) => string}
5
+ */
6
+ export let attributes: (attribute: string) => string;
2
7
  export let properties: string;
3
8
  /** @type {{ match: RegExp, sub: import('../index.js').ShjGrammar }} */
4
9
  export let xmlElement: {
@@ -1 +1 @@
1
- {"version":3,"file":"xml.d.ts","sourceRoot":"","sources":["../../../src/languages/xml.js"],"names":[],"mappings":"AAQC,wBAAyC;AACzC,8BAAgG;AAChG,uEAAuE;AACvE,uBADW;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,OAAO,aAAa,EAAE,UAAU,CAAA;CAAE,CAiClE;;WAjCmB,MAAM;SAAO,OAAO,aAAa,EAAE,UAAU"}
1
+ {"version":3,"file":"xml.d.ts","sourceRoot":"","sources":["../../../src/languages/xml.js"],"names":[],"mappings":"AAQC,wBAAyC;AACzC;;;GAGG;AACH,uBAFU,CAAC,SAAS,EAAE,MAAM,KAAK,MAAM,CAE2E;AAClH,8BAA6B;AAC7B,uEAAuE;AACvE,uBADW;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,OAAO,aAAa,EAAE,UAAU,CAAA;CAAE,CAiClE;;WAjCmB,MAAM;SAAO,OAAO,aAAa,EAAE,UAAU"}
@@ -1 +1 @@
1
- var s=Object.defineProperty;var r=Object.getOwnPropertyDescriptor;var h=Object.getOwnPropertyNames;var y=Object.prototype.hasOwnProperty;var o=(e,t)=>{for(var p in t)s(e,p,{get:t[p],enumerable:!0})},x=(e,t,p,F)=>{if(t&&typeof t=="object"||typeof t=="function")for(let a of h(t))!y.call(e,a)&&a!==p&&s(e,a,{get:()=>t[a],enumerable:!(F=r(t,a))||F.enumerable});return e};var D=e=>x(s({},"__esModule",{value:!0}),e);var C={};o(C,{default:()=>l,name:()=>u,properties:()=>g,xmlElement:()=>c});module.exports=D(C);var m=":A-Z_a-z\xC0-\xD6\xD8-\xF6\xF8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD",$=m+"\\-\\.0-9\xB7\u0300-\u036F\u203F-\u2040",u=`[${m}][${$}]*`,g=`(\\s+${u}\\s*(=\\s*([^"'>\\s][^>\\s]*|("|')(\\\\[^]|(?!\\4)[^])*\\4?)?)?)*\\s*`,c={match:RegExp(`<[/!?]?${u}${g}[/!?]?>`,"g"),sub:[{type:"var",match:RegExp(`^<[/!?]?${u}`,"g"),sub:[{type:"oper",match:/^<[\/!?]?/g}]},{type:"str",match:/=\s*([^"'>\s][^>\s]*|("|')(\\[^]|(?!\2)[^])*\2?)/g,sub:[{type:"oper",match:/^=/g}]},{type:"oper",match:/[\/!?]?>/g},{type:"class",match:RegExp(u,"g")}]},l=[{match:/<!--[^]*?-->/g,type:"cmnt",sub:"todo"},{type:"class",match:/<!\[CDATA\[[\s\S]*?\]\]>/gi},c,{type:"str",match:RegExp(`<\\?${u}([^?]|\\?[^?>])*\\?+>`,"g"),sub:[{type:"var",match:RegExp(`^<\\?${u}`,"g"),sub:[{type:"oper",match:/^<\?/g}]},{type:"oper",match:/\?+>$/g}]},{type:"var",match:/&(#x?)?[\da-z]{1,8};/gi}];0&&(module.exports={name,properties,xmlElement});
1
+ var s=Object.defineProperty;var h=Object.getOwnPropertyDescriptor;var y=Object.getOwnPropertyNames;var o=Object.prototype.hasOwnProperty;var x=(t,e)=>{for(var p in e)s(t,p,{get:e[p],enumerable:!0})},D=(t,e,p,F)=>{if(e&&typeof e=="object"||typeof e=="function")for(let a of y(e))!o.call(t,a)&&a!==p&&s(t,a,{get:()=>e[a],enumerable:!(F=h(e,a))||F.enumerable});return t};var $=t=>D(s({},"__esModule",{value:!0}),t);var C={};x(C,{attributes:()=>g,default:()=>l,name:()=>u,properties:()=>r,xmlElement:()=>c});module.exports=$(C);var m=":A-Z_a-z\xC0-\xD6\xD8-\xF6\xF8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD",b=m+"\\-\\.0-9\xB7\u0300-\u036F\u203F-\u2040",u=`[${m}][${b}]*`,g=t=>`(\\s+${t}\\s*(=\\s*([^"'>\\s][^>\\s]*|("|')(\\\\[^]|(?!\\4)[^])*\\4?)?)?)*\\s*`,r=g(u),c={match:RegExp(`<[/!?]?${u}${r}[/!?]?>`,"g"),sub:[{type:"var",match:RegExp(`^<[/!?]?${u}`,"g"),sub:[{type:"oper",match:/^<[\/!?]?/g}]},{type:"str",match:/=\s*([^"'>\s][^>\s]*|("|')(\\[^]|(?!\2)[^])*\2?)/g,sub:[{type:"oper",match:/^=/g}]},{type:"oper",match:/[\/!?]?>/g},{type:"class",match:RegExp(u,"g")}]},l=[{match:/<!--[^]*?-->/g,type:"cmnt",sub:"todo"},{type:"class",match:/<!\[CDATA\[[\s\S]*?\]\]>/gi},c,{type:"str",match:RegExp(`<\\?${u}([^?]|\\?[^?>])*\\?+>`,"g"),sub:[{type:"var",match:RegExp(`^<\\?${u}`,"g"),sub:[{type:"oper",match:/^<\?/g}]},{type:"oper",match:/\?+>$/g}]},{type:"var",match:/&(#x?)?[\da-z]{1,8};/gi}];0&&(module.exports={attributes,name,properties,xmlElement});
@@ -0,0 +1 @@
1
+ [class*=shj-lang-]{white-space:pre;color:#112;border:1px solid color-mix(in srgb, currentColor 15%, transparent);text-shadow:none;tab-size:4;box-sizing:border-box;background:#fff;border-radius:.75em;max-width:min(100%,100vw);margin:.625em 0;padding:1.375em;font:1rem/1.625 Consolas,Courier New,Monaco,Andale Mono,Ubuntu Mono,monospace}.shj-inline{border-radius:.3em;margin:0;padding:.1em .3em;font-size:1em;display:inline-block}[class*=shj-lang-]::selection{background:#bdf5}[class*=shj-lang-] ::selection{background:#bdf5}[class*=shj-lang-]>div{display:flex;overflow-x:auto}[class*=shj-lang-]>div :last-child{outline:none;flex:1}.shj-numbers{border-right:1px solid color-mix(in srgb, currentColor 20%, transparent);text-align:right;counter-reset:line;margin-right:.75em;padding-right:.75em}.shj-numbers:empty{display:none}.shj-numbers div:before{color:#999;content:counter(line);opacity:.5;counter-increment:line;min-width:1.5em;display:block}.shj-syn-cmnt{font-style:italic}.shj-syn-err,.shj-syn-kwd{color:#e16}.shj-syn-num,.shj-syn-class{color:#f60}.shj-numbers,.shj-syn-cmnt{color:#999}.shj-syn-bool{color:#3bf}.shj-syn-type,.shj-syn-oper{color:#5af}.shj-syn-section,.shj-syn-func{color:#84f}.shj-syn-deleted,.shj-syn-var{color:#f44}[class*=shj-lang-]{color:#c6d0f5;background:#303446}.shj-syn-deleted,.shj-syn-err{color:#e78284}.shj-syn-kwd{color:#ca9ee6}.shj-syn-type,.shj-syn-class{color:#e5c890}.shj-syn-cmnt{color:#949cbb}.shj-numbers{color:#838ba7}.shj-syn-insert,.shj-syn-str{color:#a6d189}.shj-syn-section,.shj-syn-num,.shj-syn-bool{color:#ef9f76}.shj-syn-oper{color:#99d1db}.shj-syn-var,.shj-syn-func{color:#8caaee}
@@ -0,0 +1 @@
1
+ [class*=shj-lang-]{white-space:pre;color:#112;border:1px solid color-mix(in srgb, currentColor 15%, transparent);text-shadow:none;tab-size:4;box-sizing:border-box;background:#fff;border-radius:.75em;max-width:min(100%,100vw);margin:.625em 0;padding:1.375em;font:1rem/1.625 Consolas,Courier New,Monaco,Andale Mono,Ubuntu Mono,monospace}.shj-inline{border-radius:.3em;margin:0;padding:.1em .3em;font-size:1em;display:inline-block}[class*=shj-lang-]::selection{background:#bdf5}[class*=shj-lang-] ::selection{background:#bdf5}[class*=shj-lang-]>div{display:flex;overflow-x:auto}[class*=shj-lang-]>div :last-child{outline:none;flex:1}.shj-numbers{border-right:1px solid color-mix(in srgb, currentColor 20%, transparent);text-align:right;counter-reset:line;margin-right:.75em;padding-right:.75em}.shj-numbers:empty{display:none}.shj-numbers div:before{color:#999;content:counter(line);opacity:.5;counter-increment:line;min-width:1.5em;display:block}.shj-syn-cmnt{font-style:italic}.shj-syn-err,.shj-syn-kwd{color:#e16}.shj-syn-num,.shj-syn-class{color:#f60}.shj-numbers,.shj-syn-cmnt{color:#999}.shj-syn-bool{color:#3bf}.shj-syn-type,.shj-syn-oper{color:#5af}.shj-syn-section,.shj-syn-func{color:#84f}.shj-syn-deleted,.shj-syn-var{color:#f44}[class*=shj-lang-]{color:#4c4f69;background:#eff1f5}.shj-syn-deleted,.shj-syn-err{color:#d20f39}.shj-syn-kwd{color:#8839ef}.shj-syn-type,.shj-syn-class{color:#df8e1d}.shj-syn-cmnt{color:#7c7f93}.shj-numbers{color:#8c8fa1}.shj-syn-insert,.shj-syn-str{color:#40a02b}.shj-syn-section,.shj-syn-num,.shj-syn-bool{color:#fe640b}.shj-syn-oper{color:#04a5e5}.shj-syn-var,.shj-syn-func{color:#1e66f5}
@@ -0,0 +1 @@
1
+ [class*=shj-lang-]{white-space:pre;color:#112;border:1px solid color-mix(in srgb, currentColor 15%, transparent);text-shadow:none;tab-size:4;box-sizing:border-box;background:#fff;border-radius:.75em;max-width:min(100%,100vw);margin:.625em 0;padding:1.375em;font:1rem/1.625 Consolas,Courier New,Monaco,Andale Mono,Ubuntu Mono,monospace}.shj-inline{border-radius:.3em;margin:0;padding:.1em .3em;font-size:1em;display:inline-block}[class*=shj-lang-]::selection{background:#bdf5}[class*=shj-lang-] ::selection{background:#bdf5}[class*=shj-lang-]>div{display:flex;overflow-x:auto}[class*=shj-lang-]>div :last-child{outline:none;flex:1}.shj-numbers{border-right:1px solid color-mix(in srgb, currentColor 20%, transparent);text-align:right;counter-reset:line;margin-right:.75em;padding-right:.75em}.shj-numbers:empty{display:none}.shj-numbers div:before{color:#999;content:counter(line);opacity:.5;counter-increment:line;min-width:1.5em;display:block}.shj-syn-cmnt{font-style:italic}.shj-syn-err,.shj-syn-kwd{color:#e16}.shj-syn-num,.shj-syn-class{color:#f60}.shj-numbers,.shj-syn-cmnt{color:#999}.shj-syn-bool{color:#3bf}.shj-syn-type,.shj-syn-oper{color:#5af}.shj-syn-section,.shj-syn-func{color:#84f}.shj-syn-deleted,.shj-syn-var{color:#f44}[class*=shj-lang-]{color:#cad3f5;background:#24273a}.shj-syn-deleted,.shj-syn-err{color:#ed8796}.shj-syn-kwd{color:#c6a0f6}.shj-syn-type,.shj-syn-class{color:#eed49f}.shj-syn-cmnt{color:#939ab7}.shj-numbers{color:#8087a2}.shj-syn-insert,.shj-syn-str{color:#a6da95}.shj-syn-section,.shj-syn-num,.shj-syn-bool{color:#f5a97f}.shj-syn-oper{color:#91d7e3}.shj-syn-var,.shj-syn-func{color:#8aadf4}
@@ -0,0 +1 @@
1
+ [class*=shj-lang-]{white-space:pre;color:#112;border:1px solid color-mix(in srgb, currentColor 15%, transparent);text-shadow:none;tab-size:4;box-sizing:border-box;background:#fff;border-radius:.75em;max-width:min(100%,100vw);margin:.625em 0;padding:1.375em;font:1rem/1.625 Consolas,Courier New,Monaco,Andale Mono,Ubuntu Mono,monospace}.shj-inline{border-radius:.3em;margin:0;padding:.1em .3em;font-size:1em;display:inline-block}[class*=shj-lang-]::selection{background:#bdf5}[class*=shj-lang-] ::selection{background:#bdf5}[class*=shj-lang-]>div{display:flex;overflow-x:auto}[class*=shj-lang-]>div :last-child{outline:none;flex:1}.shj-numbers{border-right:1px solid color-mix(in srgb, currentColor 20%, transparent);text-align:right;counter-reset:line;margin-right:.75em;padding-right:.75em}.shj-numbers:empty{display:none}.shj-numbers div:before{color:#999;content:counter(line);opacity:.5;counter-increment:line;min-width:1.5em;display:block}.shj-syn-cmnt{font-style:italic}.shj-syn-err,.shj-syn-kwd{color:#e16}.shj-syn-num,.shj-syn-class{color:#f60}.shj-numbers,.shj-syn-cmnt{color:#999}.shj-syn-bool{color:#3bf}.shj-syn-type,.shj-syn-oper{color:#5af}.shj-syn-section,.shj-syn-func{color:#84f}.shj-syn-deleted,.shj-syn-var{color:#f44}[class*=shj-lang-]{color:#cdd6f4;background:#1e1e2e}.shj-syn-deleted,.shj-syn-err{color:#f38ba8}.shj-syn-kwd{color:#cba6f7}.shj-syn-type,.shj-syn-class{color:#f9e2af}.shj-syn-cmnt{color:#9399b2}.shj-numbers{color:#7f849c}.shj-syn-insert,.shj-syn-str{color:#a6e3a1}.shj-syn-section,.shj-syn-num,.shj-syn-bool{color:#fab387}.shj-syn-oper{color:#89dceb}.shj-syn-var,.shj-syn-func{color:#89b4fa}
@@ -0,0 +1 @@
1
+ [class*=shj-lang-]{white-space:pre;color:#112;border:1px solid color-mix(in srgb, currentColor 15%, transparent);text-shadow:none;tab-size:4;box-sizing:border-box;background:#fff;border-radius:.75em;max-width:min(100%,100vw);margin:.625em 0;padding:1.375em;font:1rem/1.625 Consolas,Courier New,Monaco,Andale Mono,Ubuntu Mono,monospace}.shj-inline{border-radius:.3em;margin:0;padding:.1em .3em;font-size:1em;display:inline-block}[class*=shj-lang-]::selection{background:#bdf5}[class*=shj-lang-] ::selection{background:#bdf5}[class*=shj-lang-]>div{display:flex;overflow-x:auto}[class*=shj-lang-]>div :last-child{outline:none;flex:1}.shj-numbers{border-right:1px solid color-mix(in srgb, currentColor 20%, transparent);text-align:right;counter-reset:line;margin-right:.75em;padding-right:.75em}.shj-numbers:empty{display:none}.shj-numbers div:before{color:#999;content:counter(line);opacity:.5;counter-increment:line;min-width:1.5em;display:block}.shj-syn-cmnt{font-style:italic}.shj-syn-err,.shj-syn-kwd{color:#e16}.shj-syn-num,.shj-syn-class{color:#f60}.shj-syn-insert,.shj-syn-str{color:#7d8}.shj-syn-bool{color:#3bf}.shj-syn-type,.shj-syn-oper{color:#5af}.shj-syn-section,.shj-syn-func{color:#84f}.shj-syn-deleted,.shj-syn-var{color:#f44}[class*=shj-lang-]{color:#f8f8f2;background:#282a36}.shj-syn-deleted,.shj-syn-err{color:#f55}.shj-syn-oper,.shj-syn-kwd{color:#ff79c6}.shj-syn-section{color:#bd93f9}.shj-syn-var,.shj-syn-type,.shj-syn-class{color:#8be9fd}.shj-numbers,.shj-syn-cmnt{color:#6272a4}.shj-syn-insert,.shj-syn-func{color:#50fa7b}.shj-syn-num,.shj-syn-bool{color:#ffb86c}.shj-syn-str{color:#f1fa8c}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@speed-highlight/core",
3
- "version": "2.1.0",
3
+ "version": "2.2.0",
4
4
  "description": "A tiny, fast, simple syntax highlighter for the web and the terminal in JavaScript",
5
5
  "main": "./dist/index.js",
6
6
  "exports": {
@@ -3,16 +3,21 @@
3
3
  * @support inline style and event handlers
4
4
  */
5
5
 
6
- import xml, { properties, xmlElement } from './xml.js';
6
+ import xml, { attributes, name, xmlElement } from './xml.js';
7
7
 
8
8
  let
9
+ // html is looser than xml: an attribute name is anything but whitespace,
10
+ // quotes, `>`, `/` and `=`, which is how framework templates write
11
+ // `[prop]`, `(event)`, `@event`, `:prop` or `{prop}`
12
+ attribute = `[^\\s"'>\\/=]+`,
13
+ properties = attributes(attribute),
9
14
  /**
10
15
  * An attribute, given by a regex source, whose value is written in another language
11
16
  * @type {(name: string, sub: string) => import('../index.js').ShjRule}
12
17
  */
13
- attribute = (name, sub) => ({
18
+ attributeIn = (name, sub) => ({
14
19
  type: 'str',
15
- // the name is left to the attribute rule of xml, only its value differs
20
+ // the name is left to the attribute name rule below, only its value differs
16
21
  match: RegExp(`(?<=\\s${name}\\s*)=\\s*('[^']*'|"[^"]*")`, 'gi'),
17
22
  sub: [
18
23
  {
@@ -26,12 +31,18 @@ let
26
31
  }
27
32
  ]
28
33
  }),
34
+ /** @type {{ match: RegExp, sub: import('../index.js').ShjGrammar }} */
29
35
  htmlElement = {
30
- ...xmlElement,
36
+ match: RegExp(`<[\/!?]?${name}${properties}[\/!?]?>`, 'g'),
31
37
  sub: [
32
- attribute('style', 'css'),
33
- attribute('on\\w+', 'js'),
34
- ...xmlElement.sub
38
+ attributeIn('style', 'css'),
39
+ attributeIn('on\\w+', 'js'),
40
+ // the attribute names of xml are swapped for the looser ones
41
+ ...xmlElement.sub.slice(0, -1),
42
+ {
43
+ type: 'class',
44
+ match: RegExp(attribute, 'g')
45
+ }
35
46
  ]
36
47
  };
37
48
 
@@ -7,7 +7,12 @@ let
7
7
  nameChar = nameStartChar + "\\-\\.0-9\u{B7}\u{0300}-\u{036F}\u{203F}-\u{2040}";
8
8
  export let
9
9
  name = `[${nameStartChar}][${nameChar}]*`,
10
- properties = `(\\s+${name}\\s*(=\\s*([^"'>\\s][^>\\s]*|("|')(\\\\[^]|(?!\\4)[^])*\\4?)?)?)*\\s*`,
10
+ /**
11
+ * The attributes of a tag, given the regex source of an attribute name
12
+ * @type {(attribute: string) => string}
13
+ */
14
+ attributes = attribute => `(\\s+${attribute}\\s*(=\\s*([^"'>\\s][^>\\s]*|("|')(\\\\[^]|(?!\\4)[^])*\\4?)?)?)*\\s*`,
15
+ properties = attributes(name),
11
16
  /** @type {{ match: RegExp, sub: import('../index.js').ShjGrammar }} */
12
17
  xmlElement = {
13
18
  match: RegExp(`<[\/!?]?${name}${properties}[\/!?]?>`, 'g'),
@@ -0,0 +1,24 @@
1
+ @import 'default.css';
2
+
3
+ /* official Catppuccin Frappé palette, mapped by the code editor style guide
4
+ https://github.com/catppuccin/catppuccin/blob/main/docs/style-guide.md */
5
+ [class*="shj-lang-"] {
6
+ color: #c6d0f5;
7
+ background: #303446
8
+ }
9
+
10
+ .shj-syn-deleted,
11
+ .shj-syn-err {color: #e78284}
12
+ .shj-syn-kwd {color: #ca9ee6}
13
+ .shj-syn-type,
14
+ .shj-syn-class {color: #e5c890}
15
+ .shj-syn-cmnt {color: #949cbb}
16
+ .shj-numbers {color: #838ba7}
17
+ .shj-syn-insert,
18
+ .shj-syn-str {color: #a6d189}
19
+ .shj-syn-section,
20
+ .shj-syn-num,
21
+ .shj-syn-bool {color: #ef9f76}
22
+ .shj-syn-oper {color: #99d1db}
23
+ .shj-syn-var,
24
+ .shj-syn-func {color: #8caaee}
@@ -0,0 +1,24 @@
1
+ @import 'default.css';
2
+
3
+ /* official Catppuccin Latte palette, mapped by the code editor style guide
4
+ https://github.com/catppuccin/catppuccin/blob/main/docs/style-guide.md */
5
+ [class*="shj-lang-"] {
6
+ color: #4c4f69;
7
+ background: #eff1f5
8
+ }
9
+
10
+ .shj-syn-deleted,
11
+ .shj-syn-err {color: #d20f39}
12
+ .shj-syn-kwd {color: #8839ef}
13
+ .shj-syn-type,
14
+ .shj-syn-class {color: #df8e1d}
15
+ .shj-syn-cmnt {color: #7c7f93}
16
+ .shj-numbers {color: #8c8fa1}
17
+ .shj-syn-insert,
18
+ .shj-syn-str {color: #40a02b}
19
+ .shj-syn-section,
20
+ .shj-syn-num,
21
+ .shj-syn-bool {color: #fe640b}
22
+ .shj-syn-oper {color: #04a5e5}
23
+ .shj-syn-var,
24
+ .shj-syn-func {color: #1e66f5}
@@ -0,0 +1,24 @@
1
+ @import 'default.css';
2
+
3
+ /* official Catppuccin Macchiato palette, mapped by the code editor style guide
4
+ https://github.com/catppuccin/catppuccin/blob/main/docs/style-guide.md */
5
+ [class*="shj-lang-"] {
6
+ color: #cad3f5;
7
+ background: #24273a
8
+ }
9
+
10
+ .shj-syn-deleted,
11
+ .shj-syn-err {color: #ed8796}
12
+ .shj-syn-kwd {color: #c6a0f6}
13
+ .shj-syn-type,
14
+ .shj-syn-class {color: #eed49f}
15
+ .shj-syn-cmnt {color: #939ab7}
16
+ .shj-numbers {color: #8087a2}
17
+ .shj-syn-insert,
18
+ .shj-syn-str {color: #a6da95}
19
+ .shj-syn-section,
20
+ .shj-syn-num,
21
+ .shj-syn-bool {color: #f5a97f}
22
+ .shj-syn-oper {color: #91d7e3}
23
+ .shj-syn-var,
24
+ .shj-syn-func {color: #8aadf4}
@@ -0,0 +1,24 @@
1
+ @import 'default.css';
2
+
3
+ /* official Catppuccin Mocha palette, mapped by the code editor style guide
4
+ https://github.com/catppuccin/catppuccin/blob/main/docs/style-guide.md */
5
+ [class*="shj-lang-"] {
6
+ color: #cdd6f4;
7
+ background: #1e1e2e
8
+ }
9
+
10
+ .shj-syn-deleted,
11
+ .shj-syn-err {color: #f38ba8}
12
+ .shj-syn-kwd {color: #cba6f7}
13
+ .shj-syn-type,
14
+ .shj-syn-class {color: #f9e2af}
15
+ .shj-syn-cmnt {color: #9399b2}
16
+ .shj-numbers {color: #7f849c}
17
+ .shj-syn-insert,
18
+ .shj-syn-str {color: #a6e3a1}
19
+ .shj-syn-section,
20
+ .shj-syn-num,
21
+ .shj-syn-bool {color: #fab387}
22
+ .shj-syn-oper {color: #89dceb}
23
+ .shj-syn-var,
24
+ .shj-syn-func {color: #89b4fa}
@@ -0,0 +1,24 @@
1
+ @import 'default.css';
2
+
3
+ /* official Dracula palette, mapped by the specification
4
+ https://draculatheme.com/spec */
5
+ [class*="shj-lang-"] {
6
+ color: #f8f8f2;
7
+ background: #282a36
8
+ }
9
+
10
+ .shj-syn-deleted,
11
+ .shj-syn-err {color: #ff5555}
12
+ .shj-syn-oper,
13
+ .shj-syn-kwd {color: #ff79c6}
14
+ .shj-syn-section {color: #bd93f9}
15
+ .shj-syn-var,
16
+ .shj-syn-type,
17
+ .shj-syn-class {color: #8be9fd}
18
+ .shj-numbers,
19
+ .shj-syn-cmnt {color: #6272a4}
20
+ .shj-syn-insert,
21
+ .shj-syn-func {color: #50fa7b}
22
+ .shj-syn-num,
23
+ .shj-syn-bool {color: #ffb86c}
24
+ .shj-syn-str {color: #f1fa8c}