@speed-highlight/core 2.0.1 → 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 +17 -12
- package/dist/languages/css.d.ts +2 -2
- package/dist/languages/css.js +1 -1
- package/dist/languages/html.d.ts.map +1 -1
- package/dist/languages/html.js +1 -1
- package/dist/languages/js.d.ts +5 -0
- package/dist/languages/js.js +1 -1
- package/dist/languages/jsdoc.d.ts +4 -1
- package/dist/languages/jsdoc.js +1 -1
- package/dist/languages/regex.js +1 -1
- package/dist/languages/ts.d.ts +5 -0
- package/dist/languages/ts.js +1 -1
- package/dist/languages/xml.d.ts +5 -0
- package/dist/languages/xml.d.ts.map +1 -1
- package/dist/languages/xml.js +1 -1
- package/dist/node/languages/css.d.ts +2 -2
- package/dist/node/languages/css.js +1 -1
- package/dist/node/languages/html.d.ts.map +1 -1
- package/dist/node/languages/html.js +1 -1
- package/dist/node/languages/js.d.ts +5 -0
- package/dist/node/languages/js.js +1 -1
- package/dist/node/languages/jsdoc.d.ts +4 -1
- package/dist/node/languages/jsdoc.js +1 -1
- package/dist/node/languages/regex.js +1 -1
- package/dist/node/languages/ts.d.ts +5 -0
- package/dist/node/languages/ts.js +1 -1
- package/dist/node/languages/xml.d.ts +5 -0
- package/dist/node/languages/xml.d.ts.map +1 -1
- package/dist/node/languages/xml.js +1 -1
- package/dist/themes/catppuccin-frappe.css +1 -0
- package/dist/themes/catppuccin-latte.css +1 -0
- package/dist/themes/catppuccin-macchiato.css +1 -0
- package/dist/themes/catppuccin-mocha.css +1 -0
- package/dist/themes/dracula.css +1 -0
- package/package.json +1 -1
- package/src/languages/css.js +15 -6
- package/src/languages/html.js +49 -6
- package/src/languages/js.js +10 -2
- package/src/languages/jsdoc.js +1 -1
- package/src/languages/regex.js +1 -1
- package/src/languages/xml.js +6 -1
- package/src/themes/catppuccin-frappe.css +24 -0
- package/src/themes/catppuccin-latte.css +24 -0
- package/src/themes/catppuccin-macchiato.css +24 -0
- package/src/themes/catppuccin-mocha.css +24 -0
- package/src/themes/dracula.css +24 -0
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 [
|
|
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,
|
|
196
|
+
For Deno, import the npm package with `npm:`, nothing to install:
|
|
197
197
|
|
|
198
198
|
```js
|
|
199
|
-
import { highlightANSI } from '
|
|
200
|
-
import theme from '
|
|
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,24 +225,24 @@ 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.
|
|
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) |
|
|
232
232
|
| Brainfuck | `shj-lang-bf` | increment, operator, print, comment | ❌ | [`137 B`](src/languages/bf.js) |
|
|
233
233
|
| C | `shj-lang-c` | | ✅ | [`429 B`](src/languages/c.js) |
|
|
234
|
-
| CSS | `shj-lang-css` | comment, str, selector, units, function, ... | ✅ | [`
|
|
234
|
+
| CSS | `shj-lang-css` | comment, str, selector, units, function, ... | ✅ | [`332 B`](src/languages/css.js) |
|
|
235
235
|
| CSV | `shj-lang-csv` | punctuation, ... | ❌ | [`96 B`](src/languages/csv.js) |
|
|
236
236
|
| Diff | `shj-lang-diff` | | ✅ | [`144 B`](src/languages/diff.js) |
|
|
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` |
|
|
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) |
|
|
244
|
-
| JavaScript | `shj-lang-js` | basic syntax, regex, jsdoc, json, template literals | ⛔ reported as TypeScript | [`
|
|
245
|
-
| JSDoc | `shj-lang-jsdoc` | | ❌ | [`
|
|
244
|
+
| JavaScript | `shj-lang-js` | basic syntax, regex, jsdoc, json, template literals | ⛔ reported as TypeScript | [`820 B`](src/languages/js.js) |
|
|
245
|
+
| JSDoc | `shj-lang-jsdoc` | | ❌ | [`251 B`](src/languages/jsdoc.js) |
|
|
246
246
|
| JSON | `shj-lang-json` | string, number, bool, ... | ❌ | [`172 B`](src/languages/json.js) |
|
|
247
247
|
| LeanPub Markdown | `shj-lang-leanpub-md` | | ❌ | [`1.2 kB`](src/languages/leanpub-md.js) |
|
|
248
248
|
| Log | `shj-lang-log` | number, string, comment, errors | ❌ | [`223 B`](src/languages/log.js) |
|
|
@@ -252,14 +252,14 @@ The main entry covers most apps; reach for `/tokenize` when you want the raw tok
|
|
|
252
252
|
| Perl | `shj-lang-pl` | | ✅ | [`329 B`](src/languages/pl.js) |
|
|
253
253
|
| Plain text | `shj-lang-plain` | | ❌ | [`71 B`](src/languages/plain.js) |
|
|
254
254
|
| Python | `shj-lang-py` | | ✅ | [`416 B`](src/languages/py.js) |
|
|
255
|
-
| Regex | `shj-lang-regex` | count, set, ... | ❌ | [`
|
|
255
|
+
| Regex | `shj-lang-regex` | count, set, ... | ❌ | [`176 B`](src/languages/regex.js) |
|
|
256
256
|
| Rust | `shj-lang-rs` | | ✅ | [`414 B`](src/languages/rs.js) |
|
|
257
257
|
| SQL | `shj-lang-sql` | number, string, function, ... | ✅ | [`1.7 kB`](src/languages/sql.js) |
|
|
258
258
|
| TODO | `shj-lang-todo` | | ❌ | [`185 B`](src/languages/todo.js) |
|
|
259
259
|
| TOML | `shj-lang-toml` | comment, table, string, bool, variable | ❌ | [`236 B`](src/languages/toml.js) |
|
|
260
|
-
| TypeScript | `shj-lang-ts` | js syntax, ts keyword, types | ✅ | [`
|
|
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` | | ✅ | [`
|
|
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) |
|
package/dist/languages/css.d.ts
CHANGED
|
@@ -9,12 +9,12 @@ declare const _default: ({
|
|
|
9
9
|
type?: undefined;
|
|
10
10
|
sub?: undefined;
|
|
11
11
|
} | {
|
|
12
|
-
type: "
|
|
12
|
+
type: "var";
|
|
13
13
|
match: RegExp;
|
|
14
14
|
sub?: undefined;
|
|
15
15
|
expand?: undefined;
|
|
16
16
|
} | {
|
|
17
|
-
type: "
|
|
17
|
+
type: "kwd";
|
|
18
18
|
match: RegExp;
|
|
19
19
|
sub?: undefined;
|
|
20
20
|
expand?: undefined;
|
package/dist/languages/css.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var t=[{match:/\/\*((?!\*\/)[^])*(\*\/)?/g,type:"cmnt",sub:"todo"},{expand:"str"},{type:"kwd",match
|
|
1
|
+
var t=[{match:/\/\*((?!\*\/)[^])*(\*\/)?/g,type:"cmnt",sub:"todo"},{expand:"str"},{type:"var",match:/--[\w-]+|\b[\w-]+(?=\s*:)/g},{type:"kwd",match:/@[\w-]+\b|!important\b|\b(and|not|only|or)\b|\b(?=([a-z-]+))\2(?=[^{}]*{)/g},{type:"var",match:/(::?|\.)(?!\d)[\w-]+(?=[^{}]*{)/g},{type:"func",match:/#[\w-]+(?=[^{}]*{)/g},{type:"num",match:/#[\da-f]{3,8}/gi},{type:"num",match:/-?\d*\.?\d+([a-z]+|%)?/gi,sub:[{type:"var",match:/[a-z]+|%/gi}]},{match:/url\([^)]*\)/g,sub:[{type:"func",match:/url(?=\()/g},{type:"str",match:/[^()]+/g}]},{type:"func",match:/\b[a-zA-Z][\w-]*(?=\s*\()/g},{type:"num",match:/\b[a-z-]+\b/g}];export{t as default};
|
|
@@ -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"}
|
package/dist/languages/html.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var
|
|
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};
|
package/dist/languages/js.d.ts
CHANGED
package/dist/languages/js.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var s=[{match:/(("|')((?!\2)[^\r\n\\]|\\[^])*\2|[a-zA-Z]\w*)(?=\s*:)/g},{match:/\/\*\*((?!\*\/)[^])*(\*\/)?/g,type:"cmnt",sub:"jsdoc"},{match:/\/\/.*\n?|\/\*((?!\*\/)[^])*(\*\/)?/g,type:"cmnt",sub:"todo"},{expand:"str"},{match:/`((?!`)[^]|\\[^])*`?/g,type:"str",sub:[{match:new class{exec(t){let e=this.lastIndex,a,n=c=>{for(;++e<t.length-2;)if(t[e]=="{")n();else if(t[e]=="}")return};for(;e<t.length;++e)if(t[e-1]!="\\"&&t[e]=="$"&&t[e+1]=="{")return a=e++,n(e),this.lastIndex=e+1,{index:a,0:t.slice(a,e+1)};return null}},sub:[{type:"kwd",match:/^\${|}$/g},{match:/(?!^\$|{)[^]+(?=}$)/g,sub:"js"}]}]},{type:"kwd",match
|
|
1
|
+
var s=[{match:/(("|')((?!\2)[^\r\n\\]|\\[^])*\2|[a-zA-Z]\w*)(?=\s*:)/g},{match:/\/\*\*((?!\*\/)[^])*(\*\/)?/g,type:"cmnt",sub:"jsdoc"},{match:/\/\/.*\n?|\/\*((?!\*\/)[^])*(\*\/)?/g,type:"cmnt",sub:"todo"},{expand:"str"},{match:/`((?!`)[^]|\\[^])*`?/g,type:"str",sub:[{match:new class{exec(t){let e=this.lastIndex,a,n=c=>{for(;++e<t.length-2;)if(t[e]=="{")n();else if(t[e]=="}")return};for(;e<t.length;++e)if(t[e-1]!="\\"&&t[e]=="$"&&t[e+1]=="{")return a=e++,n(e),this.lastIndex=e+1,{index:a,0:t.slice(a,e+1)};return null}},sub:[{type:"kwd",match:/^\${|}$/g},{match:/(?!^\$|{)[^]+(?=}$)/g,sub:"js"}]}]},{type:"kwd",match:/=>|(?<![^.]\.)\b(this|set|get|as|async|await|break|case|catch|class|const|constructor|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|if|implements|import|in|instanceof|interface|let|var|of|new|package|private|protected|public|return|static|super|switch|throw|throws|try|typeof|void|while|with|yield)\b/g},{match:/(?<=[^\w$)\]'"`\s]\s*|\b(case|do|else|in|instanceof|new|of|return|throw|typeof|void|yield|await)\s+|^\s*)\/((?!\/)[^\r\n\\]|\\.)+\/\w*/gm,type:"oper",sub:"regex"},{expand:"num"},{type:"num",match:/\b(NaN|null|undefined|[A-Z][A-Z_]*)\b/g},{type:"bool",match:/\b(true|false)\b/g},{type:"var",match:/#[\w$]+/g},{type:"oper",match:/[/*+:?&|%^~=!,<>.^-]+/g},{type:"class",match:/\b[A-Z][\w_]*\b/g},{type:"func",match:/[a-zA-Z$_][\w$_]*(?=\s*((\?\.)?\s*\(|=\s*(\(?[\w,{}\[\])]+\)? =>|function\b)))/g}];export{s as default};
|
|
@@ -3,6 +3,9 @@ declare namespace _default {
|
|
|
3
3
|
let sub: ({
|
|
4
4
|
type: "err";
|
|
5
5
|
match: RegExp;
|
|
6
|
+
} | {
|
|
7
|
+
type: "class";
|
|
8
|
+
match: RegExp;
|
|
6
9
|
} | {
|
|
7
10
|
type: "insert";
|
|
8
11
|
match: RegExp;
|
|
@@ -13,7 +16,7 @@ declare namespace _default {
|
|
|
13
16
|
type: "kwd";
|
|
14
17
|
match: RegExp;
|
|
15
18
|
} | {
|
|
16
|
-
type: "
|
|
19
|
+
type: "type";
|
|
17
20
|
match: RegExp;
|
|
18
21
|
} | {
|
|
19
22
|
type: "var";
|
package/dist/languages/jsdoc.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var t={type:"cmnt",sub:[{type:"err",match:/\b(TODO|FIXME|DEBUG|OPTIMIZE|WARNING|XXX|BUG)\b/g},{type:"class",match:/\bIDEA\b/g},{type:"insert",match:/\b(CHANGED|FIX|CHANGE)\b/g},{type:"oper",match:/\bQUESTION\b/g}]};var a={type:"cmnt",sub:[{type:"kwd",match:/@\w+/g},{type:"
|
|
1
|
+
var t={type:"cmnt",sub:[{type:"err",match:/\b(TODO|FIXME|DEBUG|OPTIMIZE|WARNING|XXX|BUG)\b/g},{type:"class",match:/\bIDEA\b/g},{type:"insert",match:/\b(CHANGED|FIX|CHANGE)\b/g},{type:"oper",match:/\bQUESTION\b/g}]};var a={type:"cmnt",sub:[{type:"kwd",match:/@\w+/g},{type:"type",match:/{[\w\s|<>,.@\[\]]+}/g},{type:"var",match:/\[[\w\s="']+\]/g},...t.sub]};export{a as default};
|
package/dist/languages/regex.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var t={type:"oper",sub:[{match:/^(?!\/).*/gm,type:"cmnt",sub:"todo"},{type:"num",match:/\[((?!\])[^\\]|\\.)*\]/g},{type:"kwd",match:/\||\^|\$|\\.|\w+($|\r|\n)/g},{type:"var",match
|
|
1
|
+
var t={type:"oper",sub:[{match:/^(?!\/).*/gm,type:"cmnt",sub:"todo"},{type:"num",match:/\[((?!\])[^\\]|\\.)*\]/g},{type:"kwd",match:/\||\^|\$|\\.|\w+($|\r|\n)/g},{type:"var",match:/[*+?.]|\{\d+(,\d*)?\}/g}]};export{t as default};
|
package/dist/languages/ts.d.ts
CHANGED
package/dist/languages/ts.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var c=[{match:/(("|')((?!\2)[^\r\n\\]|\\[^])*\2|[a-zA-Z]\w*)(?=\s*:)/g},{match:/\/\*\*((?!\*\/)[^])*(\*\/)?/g,type:"cmnt",sub:"jsdoc"},{match:/\/\/.*\n?|\/\*((?!\*\/)[^])*(\*\/)?/g,type:"cmnt",sub:"todo"},{expand:"str"},{match:/`((?!`)[^]|\\[^])*`?/g,type:"str",sub:[{match:new class{exec(t){let e=this.lastIndex,a,n=s=>{for(;++e<t.length-2;)if(t[e]=="{")n();else if(t[e]=="}")return};for(;e<t.length;++e)if(t[e-1]!="\\"&&t[e]=="$"&&t[e+1]=="{")return a=e++,n(e),this.lastIndex=e+1,{index:a,0:t.slice(a,e+1)};return null}},sub:[{type:"kwd",match:/^\${|}$/g},{match:/(?!^\$|{)[^]+(?=}$)/g,sub:"js"}]}]},{type:"kwd",match
|
|
1
|
+
var c=[{match:/(("|')((?!\2)[^\r\n\\]|\\[^])*\2|[a-zA-Z]\w*)(?=\s*:)/g},{match:/\/\*\*((?!\*\/)[^])*(\*\/)?/g,type:"cmnt",sub:"jsdoc"},{match:/\/\/.*\n?|\/\*((?!\*\/)[^])*(\*\/)?/g,type:"cmnt",sub:"todo"},{expand:"str"},{match:/`((?!`)[^]|\\[^])*`?/g,type:"str",sub:[{match:new class{exec(t){let e=this.lastIndex,a,n=s=>{for(;++e<t.length-2;)if(t[e]=="{")n();else if(t[e]=="}")return};for(;e<t.length;++e)if(t[e-1]!="\\"&&t[e]=="$"&&t[e+1]=="{")return a=e++,n(e),this.lastIndex=e+1,{index:a,0:t.slice(a,e+1)};return null}},sub:[{type:"kwd",match:/^\${|}$/g},{match:/(?!^\$|{)[^]+(?=}$)/g,sub:"js"}]}]},{type:"kwd",match:/=>|(?<![^.]\.)\b(this|set|get|as|async|await|break|case|catch|class|const|constructor|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|if|implements|import|in|instanceof|interface|let|var|of|new|package|private|protected|public|return|static|super|switch|throw|throws|try|typeof|void|while|with|yield)\b/g},{match:/(?<=[^\w$)\]'"`\s]\s*|\b(case|do|else|in|instanceof|new|of|return|throw|typeof|void|yield|await)\s+|^\s*)\/((?!\/)[^\r\n\\]|\\.)+\/\w*/gm,type:"oper",sub:"regex"},{expand:"num"},{type:"num",match:/\b(NaN|null|undefined|[A-Z][A-Z_]*)\b/g},{type:"bool",match:/\b(true|false)\b/g},{type:"var",match:/#[\w$]+/g},{type:"oper",match:/[/*+:?&|%^~=!,<>.^-]+/g},{type:"class",match:/\b[A-Z][\w_]*\b/g},{type:"func",match:/[a-zA-Z$_][\w$_]*(?=\s*((\?\.)?\s*\(|=\s*(\(?[\w,{}\[\])]+\)? =>|function\b)))/g}];var p=[{type:"type",match:/:\s*(any|void|number|boolean|string|object|never|enum)\b/g},{type:"kwd",match:/\b(type|namespace|typedef|interface|public|private|protected|implements|declare|abstract|readonly)\b/g},...c];export{p as default};
|
package/dist/languages/xml.d.ts
CHANGED
|
@@ -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,
|
|
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"}
|
package/dist/languages/xml.js
CHANGED
|
@@ -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",
|
|
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};
|
|
@@ -9,12 +9,12 @@ declare const _default: ({
|
|
|
9
9
|
type?: undefined;
|
|
10
10
|
sub?: undefined;
|
|
11
11
|
} | {
|
|
12
|
-
type: "
|
|
12
|
+
type: "var";
|
|
13
13
|
match: RegExp;
|
|
14
14
|
sub?: undefined;
|
|
15
15
|
expand?: undefined;
|
|
16
16
|
} | {
|
|
17
|
-
type: "
|
|
17
|
+
type: "kwd";
|
|
18
18
|
match: RegExp;
|
|
19
19
|
sub?: undefined;
|
|
20
20
|
expand?: undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var e=Object.defineProperty;var
|
|
1
|
+
var e=Object.defineProperty;var g=Object.getOwnPropertyDescriptor;var h=Object.getOwnPropertyNames;var y=Object.prototype.hasOwnProperty;var b=(a,t)=>{for(var c in t)e(a,c,{get:t[c],enumerable:!0})},n=(a,t,c,p)=>{if(t&&typeof t=="object"||typeof t=="function")for(let m of h(t))!y.call(a,m)&&m!==c&&e(a,m,{get:()=>t[m],enumerable:!(p=g(t,m))||p.enumerable});return a};var u=a=>n(e({},"__esModule",{value:!0}),a);var d={};b(d,{default:()=>r});module.exports=u(d);var r=[{match:/\/\*((?!\*\/)[^])*(\*\/)?/g,type:"cmnt",sub:"todo"},{expand:"str"},{type:"var",match:/--[\w-]+|\b[\w-]+(?=\s*:)/g},{type:"kwd",match:/@[\w-]+\b|!important\b|\b(and|not|only|or)\b|\b(?=([a-z-]+))\2(?=[^{}]*{)/g},{type:"var",match:/(::?|\.)(?!\d)[\w-]+(?=[^{}]*{)/g},{type:"func",match:/#[\w-]+(?=[^{}]*{)/g},{type:"num",match:/#[\da-f]{3,8}/gi},{type:"num",match:/-?\d*\.?\d+([a-z]+|%)?/gi,sub:[{type:"var",match:/[a-z]+|%/gi}]},{match:/url\([^)]*\)/g,sub:[{type:"func",match:/url(?=\()/g},{type:"str",match:/[^()]+/g}]},{type:"func",match:/\b[a-zA-Z][\w-]*(?=\s*\()/g},{type:"num",match:/\b[a-z-]+\b/g}];
|
|
@@ -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
|
|
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 +1 @@
|
|
|
1
|
-
var s=Object.defineProperty;var i=Object.getOwnPropertyDescriptor;var
|
|
1
|
+
var s=Object.defineProperty;var i=Object.getOwnPropertyDescriptor;var o=Object.getOwnPropertyNames;var r=Object.prototype.hasOwnProperty;var l=(t,e)=>{for(var a in e)s(t,a,{get:e[a],enumerable:!0})},h=(t,e,a,c)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of o(e))!r.call(t,n)&&n!==a&&s(t,n,{get:()=>e[n],enumerable:!(c=i(e,n))||c.enumerable});return t};var u=t=>h(s({},"__esModule",{value:!0}),t);var m={};l(m,{default:()=>p});module.exports=u(m);var p=[{match:/(("|')((?!\2)[^\r\n\\]|\\[^])*\2|[a-zA-Z]\w*)(?=\s*:)/g},{match:/\/\*\*((?!\*\/)[^])*(\*\/)?/g,type:"cmnt",sub:"jsdoc"},{match:/\/\/.*\n?|\/\*((?!\*\/)[^])*(\*\/)?/g,type:"cmnt",sub:"todo"},{expand:"str"},{match:/`((?!`)[^]|\\[^])*`?/g,type:"str",sub:[{match:new class{exec(t){let e=this.lastIndex,a,c=n=>{for(;++e<t.length-2;)if(t[e]=="{")c();else if(t[e]=="}")return};for(;e<t.length;++e)if(t[e-1]!="\\"&&t[e]=="$"&&t[e+1]=="{")return a=e++,c(e),this.lastIndex=e+1,{index:a,0:t.slice(a,e+1)};return null}},sub:[{type:"kwd",match:/^\${|}$/g},{match:/(?!^\$|{)[^]+(?=}$)/g,sub:"js"}]}]},{type:"kwd",match:/=>|(?<![^.]\.)\b(this|set|get|as|async|await|break|case|catch|class|const|constructor|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|if|implements|import|in|instanceof|interface|let|var|of|new|package|private|protected|public|return|static|super|switch|throw|throws|try|typeof|void|while|with|yield)\b/g},{match:/(?<=[^\w$)\]'"`\s]\s*|\b(case|do|else|in|instanceof|new|of|return|throw|typeof|void|yield|await)\s+|^\s*)\/((?!\/)[^\r\n\\]|\\.)+\/\w*/gm,type:"oper",sub:"regex"},{expand:"num"},{type:"num",match:/\b(NaN|null|undefined|[A-Z][A-Z_]*)\b/g},{type:"bool",match:/\b(true|false)\b/g},{type:"var",match:/#[\w$]+/g},{type:"oper",match:/[/*+:?&|%^~=!,<>.^-]+/g},{type:"class",match:/\b[A-Z][\w_]*\b/g},{type:"func",match:/[a-zA-Z$_][\w$_]*(?=\s*((\?\.)?\s*\(|=\s*(\(?[\w,{}\[\])]+\)? =>|function\b)))/g}];
|
|
@@ -3,6 +3,9 @@ declare namespace _default {
|
|
|
3
3
|
let sub: ({
|
|
4
4
|
type: "err";
|
|
5
5
|
match: RegExp;
|
|
6
|
+
} | {
|
|
7
|
+
type: "class";
|
|
8
|
+
match: RegExp;
|
|
6
9
|
} | {
|
|
7
10
|
type: "insert";
|
|
8
11
|
match: RegExp;
|
|
@@ -13,7 +16,7 @@ declare namespace _default {
|
|
|
13
16
|
type: "kwd";
|
|
14
17
|
match: RegExp;
|
|
15
18
|
} | {
|
|
16
|
-
type: "
|
|
19
|
+
type: "type";
|
|
17
20
|
match: RegExp;
|
|
18
21
|
} | {
|
|
19
22
|
type: "var";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var b=Object.defineProperty;var
|
|
1
|
+
var b=Object.defineProperty;var y=Object.getOwnPropertyDescriptor;var r=Object.getOwnPropertyNames;var s=Object.prototype.hasOwnProperty;var g=(e,t)=>{for(var a in t)b(e,a,{get:t[a],enumerable:!0})},h=(e,t,a,m)=>{if(t&&typeof t=="object"||typeof t=="function")for(let p of r(t))!s.call(e,p)&&p!==a&&b(e,p,{get:()=>t[p],enumerable:!(m=y(t,p))||m.enumerable});return e};var o=e=>h(b({},"__esModule",{value:!0}),e);var I={};g(I,{default:()=>E});module.exports=o(I);var c={type:"cmnt",sub:[{type:"err",match:/\b(TODO|FIXME|DEBUG|OPTIMIZE|WARNING|XXX|BUG)\b/g},{type:"class",match:/\bIDEA\b/g},{type:"insert",match:/\b(CHANGED|FIX|CHANGE)\b/g},{type:"oper",match:/\bQUESTION\b/g}]};var E={type:"cmnt",sub:[{type:"kwd",match:/@\w+/g},{type:"type",match:/{[\w\s|<>,.@\[\]]+}/g},{type:"var",match:/\[[\w\s="']+\]/g},...c.sub]};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var a=Object.defineProperty;var d=Object.getOwnPropertyDescriptor;var y=Object.getOwnPropertyNames;var g=Object.prototype.hasOwnProperty;var h=(e,t)=>{for(var p in t)a(e,p,{get:t[p],enumerable:!0})},o=(e,t,p,c)=>{if(t&&typeof t=="object"||typeof t=="function")for(let m of y(t))!g.call(e,m)&&m!==p&&a(e,m,{get:()=>t[m],enumerable:!(c=d(t,m))||c.enumerable});return e};var r=e=>o(a({},"__esModule",{value:!0}),e);var n={};h(n,{default:()=>u});module.exports=r(n);var u={type:"oper",sub:[{match:/^(?!\/).*/gm,type:"cmnt",sub:"todo"},{type:"num",match:/\[((?!\])[^\\]|\\.)*\]/g},{type:"kwd",match:/\||\^|\$|\\.|\w+($|\r|\n)/g},{type:"var",match
|
|
1
|
+
var a=Object.defineProperty;var d=Object.getOwnPropertyDescriptor;var y=Object.getOwnPropertyNames;var g=Object.prototype.hasOwnProperty;var h=(e,t)=>{for(var p in t)a(e,p,{get:t[p],enumerable:!0})},o=(e,t,p,c)=>{if(t&&typeof t=="object"||typeof t=="function")for(let m of y(t))!g.call(e,m)&&m!==p&&a(e,m,{get:()=>t[m],enumerable:!(c=d(t,m))||c.enumerable});return e};var r=e=>o(a({},"__esModule",{value:!0}),e);var n={};h(n,{default:()=>u});module.exports=r(n);var u={type:"oper",sub:[{match:/^(?!\/).*/gm,type:"cmnt",sub:"todo"},{type:"num",match:/\[((?!\])[^\\]|\\.)*\]/g},{type:"kwd",match:/\||\^|\$|\\.|\w+($|\r|\n)/g},{type:"var",match:/[*+?.]|\{\d+(,\d*)?\}/g}]};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var s=Object.defineProperty;var i=Object.getOwnPropertyDescriptor;var
|
|
1
|
+
var s=Object.defineProperty;var i=Object.getOwnPropertyDescriptor;var o=Object.getOwnPropertyNames;var p=Object.prototype.hasOwnProperty;var l=(t,e)=>{for(var a in e)s(t,a,{get:e[a],enumerable:!0})},m=(t,e,a,c)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of o(e))!p.call(t,n)&&n!==a&&s(t,n,{get:()=>e[n],enumerable:!(c=i(e,n))||c.enumerable});return t};var u=t=>m(s({},"__esModule",{value:!0}),t);var h={};l(h,{default:()=>d});module.exports=u(h);var r=[{match:/(("|')((?!\2)[^\r\n\\]|\\[^])*\2|[a-zA-Z]\w*)(?=\s*:)/g},{match:/\/\*\*((?!\*\/)[^])*(\*\/)?/g,type:"cmnt",sub:"jsdoc"},{match:/\/\/.*\n?|\/\*((?!\*\/)[^])*(\*\/)?/g,type:"cmnt",sub:"todo"},{expand:"str"},{match:/`((?!`)[^]|\\[^])*`?/g,type:"str",sub:[{match:new class{exec(t){let e=this.lastIndex,a,c=n=>{for(;++e<t.length-2;)if(t[e]=="{")c();else if(t[e]=="}")return};for(;e<t.length;++e)if(t[e-1]!="\\"&&t[e]=="$"&&t[e+1]=="{")return a=e++,c(e),this.lastIndex=e+1,{index:a,0:t.slice(a,e+1)};return null}},sub:[{type:"kwd",match:/^\${|}$/g},{match:/(?!^\$|{)[^]+(?=}$)/g,sub:"js"}]}]},{type:"kwd",match:/=>|(?<![^.]\.)\b(this|set|get|as|async|await|break|case|catch|class|const|constructor|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|if|implements|import|in|instanceof|interface|let|var|of|new|package|private|protected|public|return|static|super|switch|throw|throws|try|typeof|void|while|with|yield)\b/g},{match:/(?<=[^\w$)\]'"`\s]\s*|\b(case|do|else|in|instanceof|new|of|return|throw|typeof|void|yield|await)\s+|^\s*)\/((?!\/)[^\r\n\\]|\\.)+\/\w*/gm,type:"oper",sub:"regex"},{expand:"num"},{type:"num",match:/\b(NaN|null|undefined|[A-Z][A-Z_]*)\b/g},{type:"bool",match:/\b(true|false)\b/g},{type:"var",match:/#[\w$]+/g},{type:"oper",match:/[/*+:?&|%^~=!,<>.^-]+/g},{type:"class",match:/\b[A-Z][\w_]*\b/g},{type:"func",match:/[a-zA-Z$_][\w$_]*(?=\s*((\?\.)?\s*\(|=\s*(\(?[\w,{}\[\])]+\)? =>|function\b)))/g}];var d=[{type:"type",match:/:\s*(any|void|number|boolean|string|object|never|enum)\b/g},{type:"kwd",match:/\b(type|namespace|typedef|interface|public|private|protected|implements|declare|abstract|readonly)\b/g},...r];
|
|
@@ -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,
|
|
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
|
|
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
package/src/languages/css.js
CHANGED
|
@@ -11,15 +11,23 @@ export default /** @satisfies {import('../index.js').ShjGrammar} */ ([
|
|
|
11
11
|
{
|
|
12
12
|
expand: 'str'
|
|
13
13
|
},
|
|
14
|
+
{
|
|
15
|
+
type: 'var',
|
|
16
|
+
// a name before a colon is a property, and a custom property is one
|
|
17
|
+
// anywhere, so both win over the selector guessed below, which a
|
|
18
|
+
// nested block would otherwise take them for
|
|
19
|
+
match: /--[\w-]+|\b[\w-]+(?=\s*:)/g
|
|
20
|
+
},
|
|
14
21
|
{
|
|
15
22
|
type: 'kwd',
|
|
16
23
|
// (?=([a-z-]+))\2 fakes an atomic group (JS has none), avoiding
|
|
17
24
|
// catastrophic backtracking a plain [a-z-]+ would have here
|
|
18
|
-
match:
|
|
25
|
+
match: /@[\w-]+\b|!important\b|\b(and|not|only|or)\b|\b(?=([a-z-]+))\2(?=[^{}]*{)/g
|
|
19
26
|
},
|
|
20
27
|
{
|
|
21
28
|
type: 'var',
|
|
22
|
-
|
|
29
|
+
// (?!\d) keeps a number that opens a value (.3s) out of the class selectors
|
|
30
|
+
match: /(::?|\.)(?!\d)[\w-]+(?=[^{}]*{)/g
|
|
23
31
|
},
|
|
24
32
|
{
|
|
25
33
|
type: 'func',
|
|
@@ -27,15 +35,16 @@ export default /** @satisfies {import('../index.js').ShjGrammar} */ ([
|
|
|
27
35
|
},
|
|
28
36
|
{
|
|
29
37
|
type: 'num',
|
|
30
|
-
match: /#[\da-f]{3,8}/
|
|
38
|
+
match: /#[\da-f]{3,8}/gi
|
|
31
39
|
},
|
|
32
40
|
{
|
|
33
41
|
type: 'num',
|
|
34
|
-
|
|
42
|
+
// any unit rather than a list of them, so the next one css gains needs no edit
|
|
43
|
+
match: /-?\d*\.?\d+([a-z]+|%)?/gi,
|
|
35
44
|
sub: [
|
|
36
45
|
{
|
|
37
46
|
type: 'var',
|
|
38
|
-
match: /[a-z]+|%/
|
|
47
|
+
match: /[a-z]+|%/gi
|
|
39
48
|
}
|
|
40
49
|
]
|
|
41
50
|
},
|
|
@@ -54,7 +63,7 @@ export default /** @satisfies {import('../index.js').ShjGrammar} */ ([
|
|
|
54
63
|
},
|
|
55
64
|
{
|
|
56
65
|
type: 'func',
|
|
57
|
-
match: /\b[a-zA-Z]\w*(?=\s*\()/g
|
|
66
|
+
match: /\b[a-zA-Z][\w-]*(?=\s*\()/g
|
|
58
67
|
},
|
|
59
68
|
{
|
|
60
69
|
type: 'num',
|
package/src/languages/html.js
CHANGED
|
@@ -1,8 +1,50 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @name HTML
|
|
3
|
+
* @support inline style and event handlers
|
|
3
4
|
*/
|
|
4
5
|
|
|
5
|
-
import xml, {
|
|
6
|
+
import xml, { attributes, name, xmlElement } from './xml.js';
|
|
7
|
+
|
|
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),
|
|
14
|
+
/**
|
|
15
|
+
* An attribute, given by a regex source, whose value is written in another language
|
|
16
|
+
* @type {(name: string, sub: string) => import('../index.js').ShjRule}
|
|
17
|
+
*/
|
|
18
|
+
attributeIn = (name, sub) => ({
|
|
19
|
+
type: 'str',
|
|
20
|
+
// the name is left to the attribute name rule below, only its value differs
|
|
21
|
+
match: RegExp(`(?<=\\s${name}\\s*)=\\s*('[^']*'|"[^"]*")`, 'gi'),
|
|
22
|
+
sub: [
|
|
23
|
+
{
|
|
24
|
+
type: 'oper',
|
|
25
|
+
match: /^=/g
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
// the quotes are left to the rule's own type
|
|
29
|
+
match: /(?<=['"])[^]+(?=['"]$)/g,
|
|
30
|
+
sub
|
|
31
|
+
}
|
|
32
|
+
]
|
|
33
|
+
}),
|
|
34
|
+
/** @type {{ match: RegExp, sub: import('../index.js').ShjGrammar }} */
|
|
35
|
+
htmlElement = {
|
|
36
|
+
match: RegExp(`<[\/!?]?${name}${properties}[\/!?]?>`, 'g'),
|
|
37
|
+
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
|
+
}
|
|
46
|
+
]
|
|
47
|
+
};
|
|
6
48
|
|
|
7
49
|
export default /** @satisfies {import('../index.js').ShjGrammar} */ ([
|
|
8
50
|
{
|
|
@@ -28,13 +70,13 @@ export default /** @satisfies {import('../index.js').ShjGrammar} */ ([
|
|
|
28
70
|
sub: [
|
|
29
71
|
{
|
|
30
72
|
match: RegExp(`^<style${properties}>`, 'g'),
|
|
31
|
-
sub:
|
|
73
|
+
sub: htmlElement.sub
|
|
32
74
|
},
|
|
33
75
|
{
|
|
34
76
|
match: /[^]*(?=<\/style\s*>$)/g,
|
|
35
77
|
sub: 'css'
|
|
36
78
|
},
|
|
37
|
-
|
|
79
|
+
htmlElement
|
|
38
80
|
]
|
|
39
81
|
},
|
|
40
82
|
{
|
|
@@ -42,14 +84,15 @@ export default /** @satisfies {import('../index.js').ShjGrammar} */ ([
|
|
|
42
84
|
sub: [
|
|
43
85
|
{
|
|
44
86
|
match: RegExp(`^<script${properties}>`, 'g'),
|
|
45
|
-
sub:
|
|
87
|
+
sub: htmlElement.sub
|
|
46
88
|
},
|
|
47
89
|
{
|
|
48
90
|
match: /[^]*(?=<\/script\s*>$)/g,
|
|
49
91
|
sub: 'js'
|
|
50
92
|
},
|
|
51
|
-
|
|
93
|
+
htmlElement
|
|
52
94
|
]
|
|
53
95
|
},
|
|
54
|
-
|
|
96
|
+
// the element rule is the only one html extends, the rest of xml is reused as is
|
|
97
|
+
...xml.map(rule => rule === xmlElement ? htmlElement : rule)
|
|
55
98
|
]);
|
package/src/languages/js.js
CHANGED
|
@@ -59,10 +59,14 @@ export default /** @satisfies {import('../index.js').ShjGrammar} */ ([
|
|
|
59
59
|
},
|
|
60
60
|
{
|
|
61
61
|
type: 'kwd',
|
|
62
|
-
|
|
62
|
+
// (?<![^.]\.) is "not after a lone dot", so a property named after a
|
|
63
|
+
// keyword (obj.default) is not one, while a spread (...this) still is
|
|
64
|
+
match: /=>|(?<![^.]\.)\b(this|set|get|as|async|await|break|case|catch|class|const|constructor|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|if|implements|import|in|instanceof|interface|let|var|of|new|package|private|protected|public|return|static|super|switch|throw|throws|try|typeof|void|while|with|yield)\b/g
|
|
63
65
|
},
|
|
64
66
|
{
|
|
65
|
-
|
|
67
|
+
// a division can only follow a value, so a slash anywhere else opens a
|
|
68
|
+
// regex, the keywords being spelled out as they too end in a word char
|
|
69
|
+
match: /(?<=[^\w$)\]'"`\s]\s*|\b(case|do|else|in|instanceof|new|of|return|throw|typeof|void|yield|await)\s+|^\s*)\/((?!\/)[^\r\n\\]|\\.)+\/\w*/gm,
|
|
66
70
|
type: 'oper',
|
|
67
71
|
sub: 'regex'
|
|
68
72
|
},
|
|
@@ -77,6 +81,10 @@ export default /** @satisfies {import('../index.js').ShjGrammar} */ ([
|
|
|
77
81
|
type: 'bool',
|
|
78
82
|
match: /\b(true|false)\b/g
|
|
79
83
|
},
|
|
84
|
+
{
|
|
85
|
+
type: 'var',
|
|
86
|
+
match: /#[\w$]+/g
|
|
87
|
+
},
|
|
80
88
|
{
|
|
81
89
|
type: 'oper',
|
|
82
90
|
match: /[/*+:?&|%^~=!,<>.^-]+/g
|
package/src/languages/jsdoc.js
CHANGED
package/src/languages/regex.js
CHANGED
package/src/languages/xml.js
CHANGED
|
@@ -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
|
-
|
|
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}
|