codelight.js 1.1.1 → 1.3.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/CHANGES.md +16 -0
- package/README.CDN.md +1 -1
- package/README.md +24 -14
- package/SUPPORTED_LANGUAGES.md +17 -2
- package/build/codelight.js +566 -74
- package/build/codelight.min.js +74 -17
- package/build/styles/dark.css +45 -1
- package/build/styles/dark.min.css +1 -1
- package/build/styles/default.css +62 -6
- package/build/styles/default.min.css +1 -1
- package/build/styles/light.css +46 -2
- package/build/styles/light.min.css +1 -1
- package/es/{chunk-ZYEPC5GO.js → chunk-F46VGBFI.js} +378 -68
- package/es/codelight.d.ts +72 -37
- package/es/codelight.js +193 -8
- package/es/lines-BCdhnSO4.d.ts +8 -0
- package/es/react.d.ts +7 -4
- package/es/react.js +22 -8
- package/lib/{chunk-KY23A6M5.cjs → chunk-HSSBKI63.cjs} +379 -69
- package/lib/codelight.cjs +205 -20
- package/lib/codelight.d.cts +72 -37
- package/lib/lines-BCdhnSO4.d.cts +8 -0
- package/lib/react.cjs +22 -8
- package/lib/react.d.cts +7 -4
- package/package.json +2 -2
package/build/codelight.min.js
CHANGED
|
@@ -1,23 +1,25 @@
|
|
|
1
|
-
/*! codelight.js 1.
|
|
2
|
-
"use strict";var codelight=(()=>{var z=Object.defineProperty;var ze=Object.getOwnPropertyDescriptor;var Re=Object.getOwnPropertyNames;var Me=Object.prototype.hasOwnProperty;var qe=(t,e,o)=>e in t?z(t,e,{enumerable:!0,configurable:!0,writable:!0,value:o}):t[e]=o;var De=(t,e)=>{for(var o in e)z(t,o,{get:e[o],enumerable:!0})},$e=(t,e,o,a)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of Re(e))!Me.call(t,r)&&r!==o&&z(t,r,{get:()=>e[r],enumerable:!(a=ze(e,r))||a.enumerable});return t};var Ue=t=>$e(z({},"__esModule",{value:!0}),t);var re=(t,e,o)=>qe(t,typeof e!="symbol"?e+"":e,o);var rt={};De(rt,{createMarkup:()=>T,createStream:()=>N,default:()=>nt,defineLanguage:()=>c,escapeHtml:()=>O,getLanguage:()=>A,highlight:()=>j,highlightAll:()=>K,highlightElement:()=>Z,injectTheme:()=>ee,listLanguages:()=>J,mount:()=>X,registerLanguage:()=>H,renderLine:()=>L,splitFences:()=>V,themeCss:()=>W,tokenize:()=>U});var _=class{constructor(){re(this,"tokens",[])}add(e,o){if(!o)return;let a=this.tokens[this.tokens.length-1];a&&a.type===e?a.text+=o:this.tokens.push(e?{type:e,text:o}:{text:o})}},C=(t,e)=>new Set((t??"").split(/\s+/).filter(Boolean).map(o=>e?o.toLowerCase():o)),ae=t=>new RegExp(t.source,t.flags.replace(/[gy]/g,"")+"y"),oe=/(?:0[xX][\da-fA-F_]+|0[bB][01_]+|0[oO][0-7_]+|(?:\d[\d_]*(?:\.\d[\d_]*)?|\.\d[\d_]*)(?:[eE][+-]?\d+)?)\w*/y,Ze=/[A-Za-z_$][\w$]*/,se=/\s+/y,ie=/[+\-*/%=<>!&|^~?:]+/y,ce=/\s*\(/y,We="()[]{},;.";function le(t,e,o,a){for(let r=e;r<t.length;r++){if(a&&t[r]==="\\"){r++;continue}if(t.startsWith(o,r))return r+o.length}return-1}function c(t){let e=t.caseInsensitive??!1,o=C(t.keywords,e),a=C(t.constants,e),r=C(t.types,e),n=C(t.variables,e),l=C(t.builtins,e),s=(t.rules??[]).map(i=>({match:ae(i.match),type:i.type})),m=[...t.strings??[]].sort((i,w)=>w.open.length-i.open.length),u=ae(t.identifier??Ze),x=t.calls??!0;function v(i,w,f){let d=e?i.toLowerCase():i;if(o.has(d))return"keyword";if(a.has(d))return"constant";if(r.has(d))return"type";if(n.has(d))return"variable";if(l.has(d)||x&&(ce.lastIndex=f,ce.test(w)))return"function";if(t.classNames&&/^[A-Z]/.test(i)&&/[a-z]/.test(i))return"type"}return{tokenizeLine(i,w){let f=new _,d=w,p=0;if(d){let g=le(i,0,d.close,d.escape);if(g<0)return f.add(d.type,i),{tokens:f.tokens,state:d};f.add(d.type,i.slice(0,g)),p=g,d=null}e:for(;p<i.length;){for(let y of s){y.match.lastIndex=p;let k=y.match.exec(i);if(k&&k[0]){f.add(y.type,k[0]),p+=k[0].length;continue e}}for(let[y,k]of t.blockComment??[]){if(!i.startsWith(y,p))continue;let S=i.indexOf(k,p+y.length);if(S<0){f.add("comment",i.slice(p)),d={close:k,type:"comment",escape:!1};break e}f.add("comment",i.slice(p,S+k.length)),p=S+k.length;continue e}for(let y of t.lineComment??[])if(i.startsWith(y,p)){f.add("comment",i.slice(p));break e}for(let y of m){if(!i.startsWith(y.open,p))continue;let k=y.type??"string",S=y.close??y.open,ne=y.escape??!0,I=le(i,p+y.open.length,S,ne);if(I<0){f.add(k,i.slice(p)),y.multiline&&(d={close:S,type:k,escape:ne});break e}f.add(k,i.slice(p,I)),p=I;continue e}let g;if(oe.lastIndex=p,g=oe.exec(i)){f.add("number",g[0]),p+=g[0].length;continue}if(u.lastIndex=p,(g=u.exec(i))&&g[0]){f.add(v(g[0],i,p+g[0].length),g[0]),p+=g[0].length;continue}if(se.lastIndex=p,g=se.exec(i)){f.add(void 0,g[0]),p+=g[0].length;continue}if(ie.lastIndex=p,g=ie.exec(i)){f.add("operator",g[0]),p+=g[0].length;continue}let te=i[p];f.add(We.includes(te)?"punctuation":void 0,te),p++}return{tokens:f.tokens,state:d}}}}var R={tokenizeLine:t=>({tokens:t?[{text:t}]:[],state:null})};var pe=c({strings:[{open:'"',multiline:!0},{open:"'",escape:!1,multiline:!0}],keywords:"if then else elif fi for while until do done case esac in function select return exit break continue local export readonly declare unset source alias time",builtins:"echo cd printf read set shift test eval exec trap pwd ls cat grep sed awk find mkdir rm cp mv chmod chown touch curl wget tar sudo git npm npx pnpm yarn bun node deno python python3 pip pip3 docker kubectl ssh make brew apt apt-get",rules:[{match:/(?<=^|\s)#.*/,type:"comment"},{match:/\$(?:\{[^}]*\}|[A-Za-z_]\w*|[\d@#?$!*-])/,type:"variable"},{match:/(?<=^\s*(?:(?:export|local|declare|readonly)\s+)?)[A-Za-z_]\w*(?==)/,type:"variable"},{match:/(?<=\s)--?[A-Za-z][\w-]*/,type:"attr"}],identifier:/[A-Za-z_][\w-]*/,calls:!1});var h={lineComment:["//"],blockComment:[["/*","*/"]]},b=[{open:'"'},{open:"'"}];var P="auto break case const continue default do else enum extern for goto if inline register restrict return sizeof static struct switch typedef union volatile while",F="char double float int long short signed unsigned void bool size_t ssize_t int8_t int16_t int32_t int64_t uint8_t uint16_t uint32_t uint64_t FILE",Q=[{match:/(?<=^\s*#\s*include\s*)<[^>]*>/,type:"string"},{match:/(?<=^\s*)#\s*[A-Za-z]+/,type:"meta"}],ue=c({...h,strings:b,keywords:P,types:F,constants:"NULL true false",rules:Q});var fe=c({...h,strings:b,keywords:P+" class namespace template typename public private protected virtual override final new delete this try catch throw using operator friend explicit constexpr consteval noexcept auto decltype static_cast dynamic_cast reinterpret_cast const_cast co_await co_return co_yield concept requires mutable",types:F+" string vector map unordered_map set array unique_ptr shared_ptr optional",constants:"nullptr NULL true false",rules:Q,classNames:!0});var me=c({...h,strings:[{open:'@"',close:'"',escape:!1,multiline:!0},{open:'$"',close:'"'},...b],keywords:"abstract as base break case catch checked class const continue default delegate do else enum event explicit extern finally fixed for foreach goto if implicit in interface internal is lock namespace new operator out override params private protected public readonly ref return sealed sizeof stackalloc static struct switch this throw try typeof unchecked unsafe using virtual volatile while async await var record get set init yield where when",types:"bool byte char decimal double float int long object sbyte short string uint ulong ushort void dynamic",constants:"true false null",classNames:!0});var M=c({blockComment:[["/*","*/"]],strings:b,rules:[{match:/@[\w-]+/,type:"keyword"},{match:/#[\da-fA-F]{3,8}(?![\w-])/,type:"number"},{match:/(?:--|-?[A-Za-z])[\w-]*(?=\s*:(?!:)[^{};]*(?:[;})]|$))/,type:"property"},{match:/[.#][A-Za-z_-][\w-]*/,type:"type"},{match:/::?[A-Za-z-]+/,type:"attr"},{match:/!\s*important/,type:"keyword"}],identifier:/-?[A-Za-z_][\w-]*/});var Ie={tokenizeLine(t){if(!t)return{tokens:[],state:null};let e=t.startsWith("+++")||t.startsWith("---")||t.startsWith("@@")||t.startsWith("diff ")||t.startsWith("index ")?"meta":t[0]==="+"?"inserted":t[0]==="-"?"deleted":void 0;return{tokens:[e?{type:e,text:t}:{text:t}],state:null}}},de=Ie;var ge=c({...h,strings:[{open:'"'},{open:"'"},{open:"`",escape:!1,multiline:!0}],keywords:"break case chan const continue default defer else fallthrough for func go goto if import interface map package range return select struct switch type var",constants:"true false nil iota",types:"string int int8 int16 int32 int64 uint uint8 uint16 uint32 uint64 uintptr float32 float64 complex64 complex128 bool byte rune error any",builtins:"append cap close copy delete len make new panic print println recover"});var he=c({...h,strings:[{open:'"""',multiline:!0},...b],keywords:"abstract assert break case catch class const continue default do else enum extends final finally for goto if implements import instanceof interface native new package private protected public return static strictfp super switch synchronized this throw throws transient try volatile while var record sealed permits yield",types:"boolean byte char double float int long short void",constants:"true false null",rules:[{match:/@[A-Za-z_]\w*/,type:"meta"}],classNames:!0});var Y="break case catch class const continue debugger default delete do else export extends finally for function if import in instanceof let new return super switch this throw try typeof var void while with yield async await of static get set from as",G="true false null undefined NaN Infinity",B={match:/(?<=(?:^|[(=?:,&|{}[>;]|\breturn)\s*)<\/?[A-Za-z][\w.:-]*(?=[\s/>]|$)/,type:"tag"},q={match:/@[A-Za-z_$][\w$.]*/,type:"meta"},D=c({...h,strings:[...b,{open:"`",multiline:!0}],keywords:Y,constants:G,rules:[B,q],classNames:!0});var ye=c({...h,strings:[{open:'"'}],constants:"true false null",rules:[{match:/"(?:[^"\\]|\\.)*"(?=\s*:)/,type:"property"}],calls:!1});var be=c({lineComment:["//","#"],blockComment:[["/*","*/"]],strings:[{open:'"',multiline:!0},{open:"'",multiline:!0}],keywords:"abstract and array as break callable case catch class clone const continue declare default do echo else elseif empty enddeclare endfor endforeach endif endswitch endwhile enum extends final finally fn for foreach function global goto if implements include include_once instanceof insteadof interface isset list match namespace new or print private protected public readonly require require_once return static switch throw trait try unset use var while xor yield",constants:"true false null TRUE FALSE NULL",types:"int float string bool void mixed never object iterable",rules:[{match:/<\?(?:php|=)?|\?>/,type:"meta"},{match:/\$[A-Za-z_]\w*/,type:"variable"}],classNames:!0});var xe=c({lineComment:["#"],strings:[{open:'"""',multiline:!0},{open:"'''",multiline:!0},...b],keywords:"and as assert async await break class continue def del elif else except finally for from global if import in is lambda nonlocal not or pass raise return try while with yield match case",constants:"True False None",variables:"self cls",types:"int float str bool list dict set tuple bytes object Exception",rules:[{match:/(?<=^\s*)@[\w.]+/,type:"meta"},{match:/[rRbBuUfF]{1,2}(?=["'])/,type:"string"}],classNames:!0});var we=c({lineComment:["#"],strings:[{open:'"',multiline:!0},{open:"'",multiline:!0}],keywords:"alias and begin break case class def defined? do else elsif end ensure for if in module next not or redo rescue retry return self super then undef unless until when while yield require require_relative include extend attr_accessor attr_reader attr_writer private protected public lambda proc",builtins:"puts print p raise",constants:"true false nil",rules:[{match:/@{1,2}[A-Za-z_]\w*|\$[A-Za-z_]\w*/,type:"variable"},{match:/(?<![:\w]):[A-Za-z_]\w*[?!]?/,type:"constant"}],identifier:/[A-Za-z_]\w*[?!]?/,classNames:!0});var ke=c({...h,strings:[{open:'"',multiline:!0},{open:"'"}],keywords:"as async await break const continue crate dyn else enum extern fn for if impl in let loop match mod move mut pub ref return self Self static struct super trait type unsafe use where while",constants:"true false None",types:"i8 i16 i32 i64 i128 isize u8 u16 u32 u64 u128 usize f32 f64 bool char str",rules:[{match:/#!?\[[^\]]*\]/,type:"meta"},{match:/'[A-Za-z_]\w*(?!')/,type:"keyword"},{match:/[A-Za-z_]\w*!(?=\s*[([{])/,type:"function"}],classNames:!0});var ve=c({lineComment:["--"],blockComment:[["/*","*/"]],strings:[{open:"'",escape:!1},{open:'"',escape:!1,type:"property"},{open:"`",escape:!1,type:"property"}],keywords:"select from where and or not insert into values update set delete create table alter drop index primary key foreign references join left right inner outer full cross on as group by order having limit offset union all distinct case when then else end is in like ilike between exists default constraint unique check view begin commit rollback transaction returning with recursive if desc asc add column grant revoke cascade truncate database schema explain using natural over partition window",constants:"null true false",types:"int integer bigint smallint serial bigserial varchar char text boolean bool date time timestamp timestamptz interval decimal numeric float real double precision uuid json jsonb blob bytea",caseInsensitive:!0});var Pe=" interface type enum implements namespace declare abstract readonly private protected public keyof infer is satisfies asserts module override unique",Le=t=>({...h,strings:[...b,{open:"`",multiline:!0}],keywords:Y+Pe,types:"string number boolean any unknown never void object symbol bigint",constants:G,rules:t?[B,q]:[q],classNames:!0}),Se=c(Le(!1)),Ee=c(Le(!0));var Fe=/<(\/?)([A-Za-z][\w:.-]*)/y,Qe=/&(?:#\d+|#[xX][\da-fA-F]+|\w+);/y,Ye=/[^<&]+/y,Ge=/[^\s=/>"']+/y,Be=/[^\s>"']+/y,He=/\s+/y,E=(t,e,o)=>(t.lastIndex=o,t.exec(e));function T(t={}){return{tokenizeLine(e,o){let a=new _,r=o,n=0,l;for(;n<e.length;){if(!r){if(e.startsWith("<!--",n)){let s=e.indexOf("-->",n+4);if(s<0){a.add("comment",e.slice(n)),r={m:"comment"};break}a.add("comment",e.slice(n,s+3)),n=s+3}else if(e.startsWith("<!",n)||e.startsWith("<?",n)){let s=e.indexOf(">",n);if(s<0){a.add("meta",e.slice(n)),r={m:"meta"};break}a.add("meta",e.slice(n,s+1)),n=s+1}else(l=E(Fe,e,n))?(a.add("punctuation",l[1]?"</":"<"),a.add("tag",l[2]),r={m:"tag",name:l[2].toLowerCase(),closing:!!l[1]},n+=l[0].length):(l=E(Qe,e,n))?(a.add("constant",l[0]),n+=l[0].length):(l=E(Ye,e,n))?(a.add(void 0,l[0]),n+=l[0].length):(a.add(void 0,e[n]),n++);continue}if(r.m==="comment"||r.m==="meta"){let s=r.m==="comment"?"-->":">",m=r.m==="comment"?"comment":"meta",u=e.indexOf(s,n);if(u<0){a.add(m,e.slice(n));break}a.add(m,e.slice(n,u+s.length)),n=u+s.length,r=null;continue}if(r.m==="embed"){let s=e.toLowerCase().indexOf(r.end,n),m=s<0?e.slice(n):e.slice(n,s),u=r.lang.tokenizeLine(m,r.inner);for(let x of u.tokens)a.add(x.type,x.text);if(s<0){r={...r,inner:u.state};break}r=null,n=s;continue}if(r.quote){let s=e.indexOf(r.quote,n);if(s<0){a.add("string",e.slice(n));break}a.add("string",e.slice(n,s+1)),n=s+1,r={...r,quote:void 0,eq:!1}}else if(l=E(He,e,n))a.add(void 0,l[0]),n+=l[0].length;else if(e.startsWith("/>",n)||e[n]===">"){let s=e[n]===">"?1:2;a.add("punctuation",e.slice(n,n+s)),n+=s;let m=s===1&&!r.closing?t[r.name]:void 0;r=m?{m:"embed",end:`</${r.name}`,lang:m,inner:null}:null}else if(e[n]==="=")a.add("operator","="),n++,r={...r,eq:!0};else if(e[n]==='"'||e[n]==="'"){let s=e[n],m=e.indexOf(s,n+1);if(m<0){a.add("string",e.slice(n)),r={...r,quote:s};break}a.add("string",e.slice(n,m+1)),n=m+1,r={...r,eq:!1}}else r.eq&&(l=E(Be,e,n))?(a.add("string",l[0]),n+=l[0].length,r={...r,eq:!1}):(l=E(Ge,e,n))?(a.add("attr",l[0]),n+=l[0].length):(a.add(void 0,e[n]),n++)}return{tokens:a.tokens,state:r}}}}var Ce=T({script:D,style:M});var _e=c({strings:[{open:'"'},{open:"'",escape:!1}],constants:"true false null yes no on off ~",caseInsensitive:!0,rules:[{match:/(?<=^|\s)#.*/,type:"comment"},{match:/^(?:---|\.\.\.)(?=\s*$)/,type:"meta"},{match:/[^\s#:'"[\]{},-][^#:]*?(?=:(?:\s|$))|(?<=^\s*-\s+)[^\s#:'"[\]{},][^#:]*?(?=:(?:\s|$))/,type:"property"},{match:/[&*][\w-]+/,type:"variable"},{match:/!!?[\w-]+/,type:"type"}],identifier:/[A-Za-z_][\w-]*/,calls:!1});var Te={javascript:D,typescript:Se,tsx:Ee,json:ye,python:xe,bash:pe,ruby:we,php:be,go:ge,rust:ke,java:he,c:ue,cpp:fe,csharp:me,sql:ve,css:M,yaml:_e,xml:Ce,diff:de,plaintext:R};var $=new Map(Object.entries(Te)),Ae=new Map(Object.entries({js:"javascript",jsx:"javascript",mjs:"javascript",cjs:"javascript",node:"javascript",ts:"typescript",mts:"typescript",cts:"typescript",jsonc:"json",json5:"json",py:"python",python3:"python",sh:"bash",shell:"bash",zsh:"bash",shellscript:"bash",console:"bash",terminal:"bash",rb:"ruby",golang:"go",rs:"rust",h:"c","c++":"cpp",cc:"cpp",cxx:"cpp",hpp:"cpp",cs:"csharp","c#":"csharp",postgres:"sql",postgresql:"sql",mysql:"sql",sqlite:"sql",plsql:"sql",scss:"css",less:"css",yml:"yaml",html:"xml",xhtml:"xml",svg:"xml",vue:"xml",svelte:"xml",patch:"diff",text:"plaintext",txt:"plaintext",plain:"plaintext","":"plaintext"}));function A(t){let e=(t??"").trim().toLowerCase();return $.get(e)??$.get(Ae.get(e)??"")}function H(t,e,o=[]){$.set(t.toLowerCase(),e);for(let a of o)Ae.set(a.toLowerCase(),t.toLowerCase())}function J(){return[...$.keys()]}var Oe=t=>typeof t=="object"?t:A(t)??R,Je={"&":"&","<":"<",">":">",'"':"""};function O(t){return t.replace(/[&<>"]/g,e=>Je[e])}function L(t){let e="";for(let o of t)e+=o.type?`<span class="cl-${o.type}">${O(o.text)}</span>`:O(o.text);return e}function U(t,e){let o=Oe(e),a=null;return t.split(`
|
|
3
|
-
`).map(
|
|
4
|
-
`)
|
|
5
|
-
`)
|
|
6
|
-
`)
|
|
7
|
-
`),
|
|
8
|
-
`)
|
|
9
|
-
`).
|
|
10
|
-
`)
|
|
1
|
+
/*! codelight.js 1.3.0 | MIT License | https://github.com/codelightjs/codelight.js */
|
|
2
|
+
"use strict";var codelight=(()=>{var $=Object.defineProperty;var rt=Object.getOwnPropertyDescriptor;var ot=Object.getOwnPropertyNames;var at=Object.prototype.hasOwnProperty;var st=(t,e,o)=>e in t?$(t,e,{enumerable:!0,configurable:!0,writable:!0,value:o}):t[e]=o;var it=(t,e)=>{for(var o in e)$(t,o,{get:e[o],enumerable:!0})},lt=(t,e,o,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let a of ot(e))!at.call(t,a)&&a!==o&&$(t,a,{get:()=>e[a],enumerable:!(r=rt(e,a))||r.enumerable});return t};var ct=t=>lt($({},"__esModule",{value:!0}),t);var ge=(t,e,o)=>st(t,typeof e!="symbol"?e+"":e,o);var Nt={};it(Nt,{addCopyButton:()=>A,createMarkup:()=>N,createStream:()=>M,default:()=>Ot,defineLanguage:()=>i,escapeHtml:()=>z,getLanguage:()=>R,highlight:()=>j,highlightAll:()=>ie,highlightElement:()=>H,injectTheme:()=>pe,listLanguages:()=>ae,mount:()=>le,registerLanguage:()=>oe,renderLine:()=>C,splitFences:()=>ce,themeCss:()=>B,tokenize:()=>W});async function pt(t,e=document){try{await e.defaultView.navigator.clipboard.writeText(t)}catch{let o=e.createElement("textarea");o.value=t,o.setAttribute("readonly",""),o.style.cssText="position:fixed;top:-1000px;opacity:0",e.body.append(o),o.select(),e.execCommand("copy"),o.remove()}}function A(t,e={}){let o=t.parentElement;if(!o||[...o.children].some(l=>l.classList.contains("cl-copy")))return null;let r=t.ownerDocument,a=e.label??"Copy",n=r.createElement("button");n.type="button",n.className="cl-copy",n.textContent=a,n.setAttribute("aria-label","Copy code");let c;return n.addEventListener("click",async()=>{await pt(t.textContent??"",r),n.textContent=e.copiedLabel??"Copied",clearTimeout(c),c=setTimeout(()=>n.textContent=a,1500)}),o.classList.add("cl-has-copy"),o.append(n),n}var O=class{constructor(){ge(this,"tokens",[])}add(e,o){if(!o)return;let r=this.tokens[this.tokens.length-1];r&&r.type===e?r.text+=o:this.tokens.push(e?{type:e,text:o}:{text:o})}},T=(t,e)=>new Set((t??"").split(/\s+/).filter(Boolean).map(o=>e?o.toLowerCase():o)),he=t=>new RegExp(t.source,t.flags.replace(/[gy]/g,"")+"y"),ye=/(?:0[xX][\da-fA-F_]+|0[bB][01_]+|0[oO][0-7_]+|(?:\d[\d_]*(?:\.\d[\d_]*)?|\.\d[\d_]*)(?:[eE][+-]?\d+)?)\w*/y,ut=/[A-Za-z_$][\w$]*/,be=/\s+/y,xe=/[+\-*/%=<>!&|^~?:]+/y,we=/\s*\(/y,ke=/<<(-?)\s*(['"]?)([A-Za-z_]\w*)\2/y,mt="()[]{},;.",dt={"}":"{",")":"(","]":"["};function i(t){let e=t.caseInsensitive??!1,o=T(t.keywords,e),r=T(t.constants,e),a=T(t.types,e),n=T(t.variables,e),c=T(t.builtins,e),l=(t.rules??[]).map(s=>({match:he(s.match),type:s.type})),f=[...t.strings??[]].sort((s,S)=>S.open.length-s.open.length).map(s=>({open:s.open,close:s.close??s.open,escape:s.escape??!0,multiline:s.multiline??!1,type:s.type??"string",interpolate:s.interpolate})),L=he(t.identifier??ut),E=t.calls??!0,v=t.numbers??!0,y=t.operators??!0;function w(s,S,d){let m=e?s.toLowerCase():s;if(o.has(m))return"keyword";if(r.has(m))return"constant";if(a.has(m))return"type";if(n.has(m))return"variable";if(c.has(m)||E&&(we.lastIndex=d,we.test(S)))return"function";if(t.classNames&&/^[A-Z]/.test(s)&&/[a-z]/.test(s))return"type"}return{tokenizeLine(s,S){let d=new O,m=S?[...S]:[],ue=()=>m[m.length-1],G,u=0,g,Q=ue();if(Q?.t==="heredoc")return(Q.dash?s.replace(/^\t+/,""):s)===Q.end?(d.add("meta",s),m.pop()):d.add("string",s),{tokens:d.tokens,state:m.length?m:null};e:for(;u<s.length;){let b=ue();if(b?.t==="comment"){let p=s.indexOf(b.close,u);if(p<0){d.add("comment",s.slice(u));break}d.add("comment",s.slice(u,p+b.close.length)),u=p+b.close.length,m.pop();continue}if(b?.t==="string"){let p=b.s;for(let x=u;x<s.length;x++){if(p.interpolate&&s.startsWith(p.interpolate[0],x)){if(p.interpolate[0]==="{"&&s[x+1]==="{"){x++;continue}d.add(p.type,s.slice(u,x)),d.add("punctuation",p.interpolate[0]),u=x+p.interpolate[0].length;let fe=p.interpolate[1];m.push({t:"code",close:fe,open:dt[fe]??"",depth:0});continue e}if(p.escape&&s[x]==="\\"){x++;continue}if(s.startsWith(p.close,x)){d.add(p.type,s.slice(u,x+p.close.length)),u=x+p.close.length,m.pop();continue e}}d.add(p.type,s.slice(u));break}if(b?.t==="code"){if(b.depth===0&&s.startsWith(b.close,u)){d.add("punctuation",b.close),u+=b.close.length,m.pop();continue}let p=s[u];if(p===b.open||b.depth>0&&p===b.close){m[m.length-1]={...b,depth:b.depth+(p===b.open?1:-1)},d.add("punctuation",p),u++;continue}}for(let p of l){p.match.lastIndex=u;let x=p.match.exec(s);if(x&&x[0]){d.add(p.type,x[0]),u+=x[0].length;continue e}}for(let[p,x]of t.blockComment??[])if(s.startsWith(p,u)){d.add("comment",p),u+=p.length,m.push({t:"comment",close:x});continue e}for(let p of t.lineComment??[])if(s.startsWith(p,u)){d.add("comment",s.slice(u));break e}for(let p of f)if(s.startsWith(p.open,u)){d.add(p.type,p.open),u+=p.open.length,m.push({t:"string",s:p});continue e}if(t.heredoc&&(g=(ke.lastIndex=u,ke.exec(s)))){d.add("operator",`<<${g[1]}`),d.add("meta",g[0].slice(2+g[1].length)),G={t:"heredoc",end:g[3],dash:!!g[1]},u+=g[0].length;continue}if(ye.lastIndex=u,v&&(g=ye.exec(s))){d.add("number",g[0]),u+=g[0].length;continue}if(L.lastIndex=u,(g=L.exec(s))&&g[0]){d.add(w(g[0],s,u+g[0].length),g[0]),u+=g[0].length;continue}if(be.lastIndex=u,g=be.exec(s)){d.add(void 0,g[0]),u+=g[0].length;continue}if(xe.lastIndex=u,g=xe.exec(s)){d.add(y?"operator":void 0,g[0]),u+=g[0].length;continue}let de=s[u];d.add(mt.includes(de)?"punctuation":void 0,de),u++}let me=m.findIndex(b=>b.t==="string"&&!b.s.multiline);return me>=0&&(m.length=me),G&&m.push(G),{tokens:d.tokens,state:m.length?m:null}}}}var D={tokenizeLine:t=>({tokens:t?[{text:t}]:[],state:null})};function Z(t){let e=new Set;if(t==null)return e;if(typeof t=="number")return e.add(t);if(Array.isArray(t))return new Set(t);for(let o of t.split(/[\s,]+/)){let r=/^(\d+)(?:-(\d+))?$/.exec(o);if(!r)continue;let a=Number(r[1]),n=Number(r[2]??r[1]);for(let c=Math.min(a,n);c<=Math.max(a,n)&&c-a<1e5;c++)e.add(c)}return e}var Le=t=>!!t&&(!!t.lineNumbers||t.highlightLines!=null);function Y(t,e,o){return"cl-line"+(e?" cl-ln":"")+(o.has(t)?" cl-mark":"")}function ve(t,e,o,r){return`<span class="${Y(e,o,r)}" data-line="${e}">${t}</span>`}var Se=i({strings:[{open:'"',multiline:!0},{open:"'",escape:!1,multiline:!0}],keywords:"if then else elif fi for while until do done case esac in function select return exit break continue local export readonly declare unset source alias time",builtins:"echo cd printf read set shift test eval exec trap pwd ls cat grep sed awk find mkdir rm cp mv chmod chown touch curl wget tar sudo git npm npx pnpm yarn bun node deno python python3 pip pip3 docker kubectl ssh make brew apt apt-get",rules:[{match:/(?<=^|\s)#.*/,type:"comment"},{match:/\$(?:\{[^}]*\}|[A-Za-z_]\w*|[\d@#?$!*-])/,type:"variable"},{match:/(?<=^\s*(?:(?:export|local|declare|readonly)\s+)?)[A-Za-z_]\w*(?==)/,type:"variable"},{match:/(?<=\s)--?[A-Za-z][\w-]*/,type:"attr"}],identifier:/[A-Za-z_][\w-]*/,calls:!1,heredoc:!0});var h={lineComment:["//"],blockComment:[["/*","*/"]]},k=[{open:'"'},{open:"'"}];var K="auto break case const continue default do else enum extern for goto if inline register restrict return sizeof static struct switch typedef union volatile while",V="char double float int long short signed unsigned void bool size_t ssize_t int8_t int16_t int32_t int64_t uint8_t uint16_t uint32_t uint64_t FILE",X=[{match:/(?<=^\s*#\s*include\s*)<[^>]*>/,type:"string"},{match:/(?<=^\s*)#\s*[A-Za-z]+/,type:"meta"}],Ee=i({...h,strings:k,keywords:K,types:V,constants:"NULL true false",rules:X});var Ce=i({...h,strings:k,keywords:K+" class namespace template typename public private protected virtual override final new delete this try catch throw using operator friend explicit constexpr consteval noexcept auto decltype static_cast dynamic_cast reinterpret_cast const_cast co_await co_return co_yield concept requires mutable",types:V+" string vector map unordered_map set array unique_ptr shared_ptr optional",constants:"nullptr NULL true false",rules:X,classNames:!0});var J=["{","}"],_e=i({...h,strings:[{open:'$@"',close:'"',escape:!1,multiline:!0,interpolate:J},{open:'@$"',close:'"',escape:!1,multiline:!0,interpolate:J},{open:'@"',close:'"',escape:!1,multiline:!0},{open:'$"',close:'"',interpolate:J},...k],keywords:"abstract as base break case catch checked class const continue default delegate do else enum event explicit extern finally fixed for foreach goto if implicit in interface internal is lock namespace new operator out override params private protected public readonly ref return sealed sizeof stackalloc static struct switch this throw try typeof unchecked unsafe using virtual volatile while async await var record get set init yield where when",types:"bool byte char decimal double float int long object sbyte short string uint ulong ushort void dynamic",constants:"true false null",rules:[{match:/(?<=^\s*)\[[A-Z]\w*(?:\([^)]*\))?\]/,type:"meta"}],classNames:!0});var I=i({blockComment:[["/*","*/"]],strings:k,rules:[{match:/@[\w-]+/,type:"keyword"},{match:/#[\da-fA-F]{3,8}(?![\w-])/,type:"number"},{match:/(?:--|-?[A-Za-z])[\w-]*(?=\s*:(?!:)[^{};]*(?:[;})]|$))/,type:"property"},{match:/[.#][A-Za-z_-][\w-]*/,type:"type"},{match:/::?[A-Za-z-]+/,type:"attr"},{match:/!\s*important/,type:"keyword"}],identifier:/-?[A-Za-z_][\w-]*/});var ft={tokenizeLine(t){if(!t)return{tokens:[],state:null};let e=t.startsWith("+++")||t.startsWith("---")||t.startsWith("@@")||t.startsWith("diff ")||t.startsWith("index ")?"meta":t[0]==="+"?"inserted":t[0]==="-"?"deleted":void 0;return{tokens:[e?{type:e,text:t}:{text:t}],state:null}}},Ae=ft;var gt="FROM|RUN|CMD|LABEL|EXPOSE|ENV|ADD|COPY|ENTRYPOINT|VOLUME|USER|WORKDIR|ARG|ONBUILD|STOPSIGNAL|HEALTHCHECK|SHELL|MAINTAINER",Te=i({strings:[{open:'"'},{open:"'",escape:!1}],rules:[{match:/(?<=^\s*)#.*/,type:"comment"},{match:new RegExp(`(?<=^\\s*)(?:${gt})\\b`,"i"),type:"keyword"},{match:/(?<=^\s*FROM\s.*\s)AS(?=\s)/i,type:"keyword"},{match:/\$(?:\{[^}]*\}|[A-Za-z_]\w*)/,type:"variable"},{match:/(?<=\s)--[A-Za-z][\w-]*/,type:"attr"}],identifier:/[A-Za-z_][\w.-]*/,calls:!1});var Oe=i({...h,strings:[{open:'"'},{open:"'"},{open:"`",escape:!1,multiline:!0}],keywords:"break case chan const continue default defer else fallthrough for func go goto if import interface map package range return select struct switch type var",constants:"true false nil iota",types:"string int int8 int16 int32 int64 uint uint8 uint16 uint32 uint64 uintptr float32 float64 complex64 complex128 bool byte rune error any",builtins:"append cap close copy delete len make new panic print println recover"});var Ne=i({lineComment:["#"],strings:[{open:'"""',multiline:!0},{open:'"'}],keywords:"query mutation subscription fragment on type interface union enum input scalar schema extend directive implements repeatable",constants:"true false null",types:"Int Float String Boolean ID",rules:[{match:/\$[A-Za-z_]\w*/,type:"variable"},{match:/@[A-Za-z_]\w*/,type:"meta"},{match:/\.\.\./,type:"operator"},{match:/[A-Za-z_]\w*(?=\s*:)/,type:"property"}],classNames:!0});var Re=i({lineComment:["#","//"],blockComment:[["/*","*/"]],strings:[{open:'"',interpolate:["${","}"]}],constants:"true false null",types:"string number bool list map set object tuple any",rules:[{match:/(?<=^\s*)(?:resource|data|variable|output|module|provider|locals|terraform|moved|import|check)\b/,type:"keyword"},{match:/\b(?:for|in|if|for_each|count|depends_on|lifecycle|dynamic|content)\b(?!\s*=)/,type:"keyword"},{match:/(?<=^\s*)[A-Za-z_][\w-]*(?=\s*=(?!=))/,type:"property"}],identifier:/[A-Za-z_][\w-]*/,heredoc:!0});var ze=i({...h,strings:[{open:'"""',multiline:!0},...k],keywords:"abstract assert break case catch class const continue default do else enum extends final finally for goto if implements import instanceof interface native new package private protected public return static strictfp super switch synchronized this throw throws transient try volatile while var record sealed permits yield",types:"boolean byte char double float int long short void",constants:"true false null",rules:[{match:/@[A-Za-z_]\w*/,type:"meta"}],classNames:!0});var ee="break case catch class const continue debugger default delete do else export extends finally for function if import in instanceof let new return super switch this throw try typeof var void while with yield async await of static get set from as",te="true false null undefined NaN Infinity",ne={open:"`",multiline:!0,interpolate:["${","}"]},re={match:/(?<=(?:^|[(=?:,&|{}[>;]|\breturn)\s*)<\/?[A-Za-z][\w.:-]*(?=[\s/>]|$)/,type:"tag"},q={match:/(?<=(?:^|[(,=:[!&|?{;]|\breturn|\btypeof|\bcase)\s*)\/(?![*/\s>])(?:\\.|\[(?:\\.|[^\]\\])*\]|[^\\/[])+\/[dgimsuvy]*/,type:"regex"},P={match:/@[A-Za-z_$][\w$.]*/,type:"meta"},U=i({...h,strings:[...k,ne],keywords:ee,constants:te,rules:[re,q,P],classNames:!0});var je=i({...h,strings:[{open:'"'}],constants:"true false null",rules:[{match:/"(?:[^"\\]|\\.)*"(?=\s*:)/,type:"property"}],calls:!1});var Me=["${","}"],$e=i({...h,strings:[{open:'"""',multiline:!0,escape:!1,interpolate:Me},{open:'"',interpolate:Me},{open:"'"}],keywords:"package import class interface object fun val var if else when for while do return break continue throw try catch finally is in as typealias this super data sealed enum open abstract override private protected public internal companion lateinit suspend inline reified by init get set where out vararg const operator infix annotation",constants:"true false null",types:"Int Long Short Byte Double Float Boolean Char String Unit Any Nothing List Map Set",rules:[{match:/@[A-Za-z_]\w*(?::\w+)?/,type:"meta"}],classNames:!0});var De=i({blockComment:[["<!--","-->"]],rules:[{match:/^#{1,6}\s.*/,type:"keyword"},{match:/^ {0,3}(?:`{3,}|~{3,}).*/,type:"meta"},{match:/^\s*>.*/,type:"comment"},{match:/^\s*(?:[-*+]|\d+[.)])(?=\s)/,type:"punctuation"},{match:/^\s*(?:-{3,}|\*{3,}|_{3,})\s*$/,type:"punctuation"},{match:/`[^`]+`/,type:"string"},{match:/!?\[[^\]]*\]\([^)\s]*(?:\s+"[^"]*")?\)/,type:"function"},{match:/\*\*[^*]+\*\*|__[^_]+__/,type:"type"},{match:/(?<![\w*])\*[^*\s][^*]*\*(?!\*)|(?<!\w)_[^_\s][^_]*_(?!\w)/,type:"attr"},{match:/<\/?[A-Za-z][^>]*>/,type:"tag"}],identifier:/[A-Za-z_][\w'-]*/,calls:!1,numbers:!1,operators:!1});var Ze=i({lineComment:["//","#"],blockComment:[["/*","*/"]],strings:[{open:'"',multiline:!0},{open:"'",multiline:!0}],keywords:"abstract and array as break callable case catch class clone const continue declare default do echo else elseif empty enddeclare endfor endforeach endif endswitch endwhile enum extends final finally fn for foreach function global goto if implements include include_once instanceof insteadof interface isset list match namespace new or print private protected public readonly require require_once return static switch throw trait try unset use var while xor yield",constants:"true false null TRUE FALSE NULL",types:"int float string bool void mixed never object iterable",rules:[{match:/<\?(?:php|=)?|\?>/,type:"meta"},{match:/\$[A-Za-z_]\w*/,type:"variable"}],classNames:!0});var Ie=i({lineComment:["#"],blockComment:[["<#","#>"]],strings:[{open:'@"',close:'"@',escape:!1,multiline:!0,interpolate:["$(",")"]},{open:"@'",close:"'@",escape:!1,multiline:!0},{open:'"',escape:!1,multiline:!0,interpolate:["$(",")"]},{open:"'",escape:!1,multiline:!0}],keywords:"if else elseif switch foreach for while do until break continue return function filter param begin process end try catch finally throw trap in exit class enum using",caseInsensitive:!0,rules:[{match:/\$(?:true|false|null)\b/i,type:"constant"},{match:/\$(?:\{[^}]+\}|[\w:]+)/,type:"variable"},{match:/-(?:eq|ne|gt|ge|lt|le|like|notlike|match|notmatch|contains|notcontains|in|notin|and|or|not|xor|replace|split|join|is|isnot|as)\b/i,type:"operator"},{match:/\[[A-Za-z][\w.]*(?:\[\])?\]/,type:"type"},{match:/\b[A-Z][a-z]+-[A-Z]\w+/,type:"function"},{match:/(?<=\s)-[A-Za-z]\w*/,type:"attr"}],identifier:/[A-Za-z_][\w-]*/});var ht=["f","F","rf","rF","Rf","RF","fr","fR","Fr","FR"].flatMap(t=>['"""',"'''",'"',"'"].map(e=>({open:t+e,close:e,escape:!/r/i.test(t),multiline:e.length===3,interpolate:["{","}"]}))),qe=i({lineComment:["#"],strings:[...ht,{open:'"""',multiline:!0},{open:"'''",multiline:!0},...k],keywords:"and as assert async await break class continue def del elif else except finally for from global if import in is lambda nonlocal not or pass raise return try while with yield match case",constants:"True False None",variables:"self cls",types:"int float str bool list dict set tuple bytes object Exception",rules:[{match:/(?<=^\s*)@[\w.]+/,type:"meta"},{match:/[rRbBuU]{1,2}(?=["'])/,type:"string"}],classNames:!0});var Pe=i({lineComment:["#"],strings:[{open:'"',multiline:!0},{open:"'",multiline:!0}],keywords:"alias and begin break case class def defined? do else elsif end ensure for if in module next not or redo rescue retry return self super then undef unless until when while yield require require_relative include extend attr_accessor attr_reader attr_writer private protected public lambda proc",builtins:"puts print p raise",constants:"true false nil",rules:[{match:/@{1,2}[A-Za-z_]\w*|\$[A-Za-z_]\w*/,type:"variable"},{match:/(?<![:\w]):[A-Za-z_]\w*[?!]?/,type:"constant"}],identifier:/[A-Za-z_]\w*[?!]?/,classNames:!0});var Ue=i({...h,strings:[{open:'"',multiline:!0},{open:"'"}],keywords:"as async await break const continue crate dyn else enum extern fn for if impl in let loop match mod move mut pub ref return self Self static struct super trait type unsafe use where while",constants:"true false None",types:"i8 i16 i32 i64 i128 isize u8 u16 u32 u64 u128 usize f32 f64 bool char str",rules:[{match:/#!?\[[^\]]*\]/,type:"meta"},{match:/'[A-Za-z_]\w*(?!')/,type:"keyword"},{match:/[A-Za-z_]\w*!(?=\s*[([{])/,type:"function"}],classNames:!0});var Fe=i({lineComment:["--"],blockComment:[["/*","*/"]],strings:[{open:"'",escape:!1},{open:'"',escape:!1,type:"property"},{open:"`",escape:!1,type:"property"}],keywords:"select from where and or not insert into values update set delete create table alter drop index primary key foreign references join left right inner outer full cross on as group by order having limit offset union all distinct case when then else end is in like ilike between exists default constraint unique check view begin commit rollback transaction returning with recursive if desc asc add column grant revoke cascade truncate database schema explain using natural over partition window",constants:"null true false",types:"int integer bigint smallint serial bigserial varchar char text boolean bool date time timestamp timestamptz interval decimal numeric float real double precision uuid json jsonb blob bytea",caseInsensitive:!0});var We=["\\(",")"],He=i({...h,strings:[{open:'"""',multiline:!0,interpolate:We},{open:'"',interpolate:We}],keywords:"import let var func class struct enum protocol extension if else guard switch case default for in while repeat return break continue fallthrough throw throws rethrows try catch do defer as is init deinit self Self super static private fileprivate internal public open final override mutating nonmutating weak unowned lazy inout where async await some any typealias associatedtype subscript convenience required",constants:"true false nil",types:"Int Double Float String Bool Character Array Dictionary Set Void Optional Result Error",rules:[{match:/@[A-Za-z_]\w*/,type:"meta"},{match:/#(?:available|if|else|elseif|endif|selector|keyPath|warning|error)\b/,type:"meta"}],classNames:!0});var Be=i({lineComment:["#"],strings:[{open:'"""',multiline:!0},{open:"'''",multiline:!0,escape:!1},{open:'"'},{open:"'",escape:!1}],constants:"true false inf nan",rules:[{match:/(?<=^\s*)\[\[?[^\]]*\]\]?/,type:"tag"},{match:/(?<=^\s*)[\w.\-"' ]+?(?=\s*=)/,type:"property"},{match:/\d{4}-\d{2}-\d{2}(?:[T ]\d{2}:\d{2}(?::\d{2}(?:\.\d+)?)?(?:Z|[+-]\d{2}:\d{2})?)?/,type:"number"}],identifier:/[A-Za-z_][\w-]*/,calls:!1});var yt=" interface type enum implements namespace declare abstract readonly private protected public keyof infer is satisfies asserts module override unique",Ge=t=>({...h,strings:[...k,ne],keywords:ee+yt,types:"string number boolean any unknown never void object symbol bigint",constants:te,rules:t?[re,q,P]:[q,P],classNames:!0}),Qe=i(Ge(!1)),Ye=i(Ge(!0));var bt=/<(\/?)([A-Za-z][\w:.-]*)/y,xt=/&(?:#\d+|#[xX][\da-fA-F]+|\w+);/y,wt=/[^<&]+/y,kt=/[^\s=/>"']+/y,Lt=/[^\s>"']+/y,vt=/\s+/y,_=(t,e,o)=>(t.lastIndex=o,t.exec(e));function N(t={}){return{tokenizeLine(e,o){let r=new O,a=o,n=0,c;for(;n<e.length;){if(!a){if(e.startsWith("<!--",n)){let l=e.indexOf("-->",n+4);if(l<0){r.add("comment",e.slice(n)),a={m:"comment"};break}r.add("comment",e.slice(n,l+3)),n=l+3}else if(e.startsWith("<!",n)||e.startsWith("<?",n)){let l=e.indexOf(">",n);if(l<0){r.add("meta",e.slice(n)),a={m:"meta"};break}r.add("meta",e.slice(n,l+1)),n=l+1}else(c=_(bt,e,n))?(r.add("punctuation",c[1]?"</":"<"),r.add("tag",c[2]),a={m:"tag",name:c[2].toLowerCase(),closing:!!c[1]},n+=c[0].length):(c=_(xt,e,n))?(r.add("constant",c[0]),n+=c[0].length):(c=_(wt,e,n))?(r.add(void 0,c[0]),n+=c[0].length):(r.add(void 0,e[n]),n++);continue}if(a.m==="comment"||a.m==="meta"){let l=a.m==="comment"?"-->":">",f=a.m==="comment"?"comment":"meta",L=e.indexOf(l,n);if(L<0){r.add(f,e.slice(n));break}r.add(f,e.slice(n,L+l.length)),n=L+l.length,a=null;continue}if(a.m==="embed"){let l=e.toLowerCase().indexOf(a.end,n),f=l<0?e.slice(n):e.slice(n,l),L=a.lang.tokenizeLine(f,a.inner);for(let E of L.tokens)r.add(E.type,E.text);if(l<0){a={...a,inner:L.state};break}a=null,n=l;continue}if(a.quote){let l=e.indexOf(a.quote,n);if(l<0){r.add("string",e.slice(n));break}r.add("string",e.slice(n,l+1)),n=l+1,a={...a,quote:void 0,eq:!1}}else if(c=_(vt,e,n))r.add(void 0,c[0]),n+=c[0].length;else if(e.startsWith("/>",n)||e[n]===">"){let l=e[n]===">"?1:2;r.add("punctuation",e.slice(n,n+l)),n+=l;let f=l===1&&!a.closing?t[a.name]:void 0;a=f?{m:"embed",end:`</${a.name}`,lang:f,inner:null}:null}else if(e[n]==="=")r.add("operator","="),n++,a={...a,eq:!0};else if(e[n]==='"'||e[n]==="'"){let l=e[n],f=e.indexOf(l,n+1);if(f<0){r.add("string",e.slice(n)),a={...a,quote:l};break}r.add("string",e.slice(n,f+1)),n=f+1,a={...a,eq:!1}}else a.eq&&(c=_(Lt,e,n))?(r.add("string",c[0]),n+=c[0].length,a={...a,eq:!1}):(c=_(kt,e,n))?(r.add("attr",c[0]),n+=c[0].length):(r.add(void 0,e[n]),n++)}return{tokens:r.tokens,state:a}}}}var Ke=N({script:U,style:I});var Ve=i({strings:[{open:'"'},{open:"'",escape:!1}],constants:"true false null yes no on off ~",caseInsensitive:!0,rules:[{match:/(?<=^|\s)#.*/,type:"comment"},{match:/^(?:---|\.\.\.)(?=\s*$)/,type:"meta"},{match:/[^\s#:'"[\]{},-][^#:]*?(?=:(?:\s|$))|(?<=^\s*-\s+)[^\s#:'"[\]{},][^#:]*?(?=:(?:\s|$))/,type:"property"},{match:/[&*][\w-]+/,type:"variable"},{match:/!!?[\w-]+/,type:"type"}],identifier:/[A-Za-z_][\w-]*/,calls:!1});var Xe={javascript:U,typescript:Qe,tsx:Ye,json:je,python:qe,bash:Se,ruby:Pe,php:Ze,go:Oe,rust:Ue,java:ze,c:Ee,cpp:Ce,csharp:_e,sql:Fe,css:I,yaml:Ve,xml:Ke,diff:Ae,kotlin:$e,swift:He,dockerfile:Te,toml:Be,markdown:De,graphql:Ne,powershell:Ie,hcl:Re,plaintext:D};var F=new Map(Object.entries(Xe)),Je=new Map(Object.entries({js:"javascript",jsx:"javascript",mjs:"javascript",cjs:"javascript",node:"javascript",ts:"typescript",mts:"typescript",cts:"typescript",jsonc:"json",json5:"json",py:"python",python3:"python",sh:"bash",shell:"bash",zsh:"bash",shellscript:"bash",console:"bash",terminal:"bash",rb:"ruby",golang:"go",rs:"rust",h:"c","c++":"cpp",cc:"cpp",cxx:"cpp",hpp:"cpp",cs:"csharp","c#":"csharp",postgres:"sql",postgresql:"sql",mysql:"sql",sqlite:"sql",plsql:"sql",scss:"css",less:"css",yml:"yaml",html:"xml",xhtml:"xml",svg:"xml",vue:"xml",svelte:"xml",patch:"diff",kt:"kotlin",kts:"kotlin",docker:"dockerfile",containerfile:"dockerfile",md:"markdown",mdx:"markdown",gql:"graphql",ps1:"powershell",pwsh:"powershell",ps:"powershell",terraform:"hcl",tf:"hcl",tfvars:"hcl",opentofu:"hcl",text:"plaintext",txt:"plaintext",plain:"plaintext","":"plaintext"}));function R(t){let e=(t??"").trim().toLowerCase();return F.get(e)??F.get(Je.get(e)??"")}function oe(t,e,o=[]){F.set(t.toLowerCase(),e);for(let r of o)Je.set(r.toLowerCase(),t.toLowerCase())}function ae(){return[...F.keys()]}var et=t=>typeof t=="object"?t:R(t)??D,St={"&":"&","<":"<",">":">",'"':"""};function z(t){return t.replace(/[&<>"]/g,e=>St[e])}function C(t){let e="";for(let o of t)e+=o.type?`<span class="cl-${o.type}">${z(o.text)}</span>`:z(o.text);return e}function W(t,e){let o=et(e),r=null;return t.split(`
|
|
3
|
+
`).map(a=>{let n=o.tokenizeLine(a.replace(/\r$/,""),r);return r=n.state,n.tokens})}function j(t,e,o){let r=W(t,e).map(C);if(!Le(o))return r.join(`
|
|
4
|
+
`);let a=Z(o.highlightLines);return r.map((n,c)=>ve(n,c+1,!!o.lineNumbers,a)).join(`
|
|
5
|
+
`)}function M(t){let e=et(t),o=null,r="",a="";return{get text(){return a},push(n){a+=n,r+=n;let c=[],l;for(;(l=r.indexOf(`
|
|
6
|
+
`))>=0;){let f=e.tokenizeLine(r.slice(0,l).replace(/\r$/,""),o);c.push(f.tokens),o=f.state,r=r.slice(l+1)}return{lines:c,tail:e.tokenizeLine(r.replace(/\r$/,""),o).tokens}}}}var Et=/(?:^|\s)language-(\S+)/,se=(t,e)=>t.getAttribute(e)??t.parentElement?.getAttribute(e)??null;function Ct(t){return se(t,"data-lang")??Et.exec(t.className)?.[1]??""}function H(t,e=Ct(t),o={}){let r=o.lineNumbers??se(t,"data-line-numbers")!=null,a=o.highlightLines??se(t,"data-highlight-lines")??void 0;t.innerHTML=j(t.textContent??"",e,{lineNumbers:r,highlightLines:a}),t.classList.add("cl"),t.setAttribute("data-cl",e),o.copyButton&&A(t)}function ie(t,e={}){let o=!!t&&typeof t.querySelectorAll=="function",r=o?t:void 0,a=o?e:{...t,...e};if(!r&&typeof document>"u")return;let n=()=>{for(let c of(r??document).querySelectorAll("pre > code:not([data-cl])"))H(c,void 0,a)};!r&&document.readyState==="loading"?document.addEventListener("DOMContentLoaded",n,{once:!0}):n()}function le(t,e={}){let o=t.ownerDocument,r=!!e.lineNumbers,a=Z(e.highlightLines),n=e.lang,c,l,f=0,L=(y,w)=>{y.className=Y(w,r,a),(r||a.size)&&y.setAttribute("data-line",String(w))},E=()=>{c=M(n),f=0,l=o.createElement("span"),L(l,1),t.replaceChildren(l)};t.classList.add("cl"),E();let v={get text(){return c.text},get lang(){return n},write(y){if(!y)return;let{lines:w,tail:s}=c.push(y);if(w.length){let S=o.createDocumentFragment();for(let d of w){let m=o.createElement("span");L(m,++f),m.innerHTML=C(d),S.append(m,`
|
|
7
|
+
`)}t.insertBefore(S,l),L(l,f+1)}l.innerHTML=C(s)},set(y){let w=c.text;if(y!==w){if(y.startsWith(w))return v.write(y.slice(w.length));E(),v.write(y)}},reset(y){y!==void 0&&(n=y),E()}};return v}var _t=/^ {0,3}(`{3,}|~{3,})(.*)$/,tt=/^ {0,3}(?:`{1,2}|~{1,2})$/;function ce(t){let e=t.split(`
|
|
8
|
+
`),o=[],r=[],a=()=>{r.length&&o.push({type:"text",text:r.join(`
|
|
9
|
+
`)}),r=[]},n=0;for(;n<e.length;){let c=e[n].replace(/\r$/,""),l=_t.exec(c);if(!l||l[1][0]==="`"&&l[2].includes("`")){r.push(c),n++;continue}a();let f=l[1],L=n<e.length-1,E=new RegExp(`^ {0,3}${f[0]==="`"?"`":"~"}{${f.length},}\\s*$`),v=[],y=!1,w=n+1;for(;w<e.length;w++){let S=e[w].replace(/\r$/,"");if(E.test(S)){y=!0;break}v.push(S)}let s;y?s=v.map(S=>S+`
|
|
10
|
+
`).join(""):(v.length&&tt.test(v[v.length-1])&&(v[v.length-1]=""),s=v.join(`
|
|
11
|
+
`)),o.push({type:"code",lang:L?l[2].trim().split(/\s+/)[0]??"":"",code:s,closed:y}),n=y?w+1:w}return r.length&&tt.test(r[r.length-1])&&r.pop(),a(),o}var nt=`/*!
|
|
11
12
|
codelight.js theme: default
|
|
12
13
|
Light or dark to match the system. To force one, put a cl-light or cl-dark class
|
|
13
14
|
(or light / dark, or data-theme="light" / "dark") on the code or any parent.
|
|
14
15
|
*/
|
|
15
|
-
.cl {
|
|
16
|
+
.cl, .cl-copy {
|
|
16
17
|
--cl-fg: #1e2430;
|
|
17
18
|
--cl-bg: #f7f7f9;
|
|
18
19
|
--cl-keyword: #b4235a;
|
|
19
20
|
--cl-string: #1d6b45;
|
|
20
|
-
--cl-
|
|
21
|
+
--cl-regex: #0b6477;
|
|
22
|
+
--cl-comment: #656c79;
|
|
21
23
|
--cl-number: #a35200;
|
|
22
24
|
--cl-function: #3a52c4;
|
|
23
25
|
--cl-type: #8a3ab9;
|
|
@@ -33,15 +35,21 @@
|
|
|
33
35
|
--cl-inserted-bg: #dcfce7;
|
|
34
36
|
--cl-deleted: #9f1239;
|
|
35
37
|
--cl-deleted-bg: #ffe4e6;
|
|
38
|
+
--cl-line-number: #656c79;
|
|
39
|
+
--cl-mark-bg: #fdf6e1;
|
|
40
|
+
--cl-border: #d5d9e0;
|
|
41
|
+
}
|
|
42
|
+
.cl {
|
|
36
43
|
color: var(--cl-fg);
|
|
37
44
|
background: var(--cl-bg);
|
|
38
45
|
}
|
|
39
46
|
@media (prefers-color-scheme: dark) {
|
|
40
|
-
.cl {
|
|
47
|
+
.cl, .cl-copy {
|
|
41
48
|
--cl-fg: #e4e7ee;
|
|
42
49
|
--cl-bg: #11141a;
|
|
43
50
|
--cl-keyword: #ff7aa8;
|
|
44
51
|
--cl-string: #8fdba8;
|
|
52
|
+
--cl-regex: #67e3f2;
|
|
45
53
|
--cl-comment: #8a93a3;
|
|
46
54
|
--cl-number: #ffb86b;
|
|
47
55
|
--cl-function: #8fb4ff;
|
|
@@ -58,13 +66,17 @@
|
|
|
58
66
|
--cl-inserted-bg: #0f3a24;
|
|
59
67
|
--cl-deleted: #fecdd3;
|
|
60
68
|
--cl-deleted-bg: #4c1020;
|
|
69
|
+
--cl-line-number: #8a93a3;
|
|
70
|
+
--cl-mark-bg: #262116;
|
|
71
|
+
--cl-border: #2e3440;
|
|
61
72
|
}
|
|
62
73
|
}
|
|
63
|
-
.cl-dark .cl, .cl.cl-dark, .dark .cl, [data-theme="dark"] .cl {
|
|
74
|
+
.cl-dark .cl, .cl.cl-dark, .dark .cl, [data-theme="dark"] .cl, .cl-dark .cl-copy, .dark .cl-copy, [data-theme="dark"] .cl-copy {
|
|
64
75
|
--cl-fg: #e4e7ee;
|
|
65
76
|
--cl-bg: #11141a;
|
|
66
77
|
--cl-keyword: #ff7aa8;
|
|
67
78
|
--cl-string: #8fdba8;
|
|
79
|
+
--cl-regex: #67e3f2;
|
|
68
80
|
--cl-comment: #8a93a3;
|
|
69
81
|
--cl-number: #ffb86b;
|
|
70
82
|
--cl-function: #8fb4ff;
|
|
@@ -81,13 +93,17 @@
|
|
|
81
93
|
--cl-inserted-bg: #0f3a24;
|
|
82
94
|
--cl-deleted: #fecdd3;
|
|
83
95
|
--cl-deleted-bg: #4c1020;
|
|
96
|
+
--cl-line-number: #8a93a3;
|
|
97
|
+
--cl-mark-bg: #262116;
|
|
98
|
+
--cl-border: #2e3440;
|
|
84
99
|
}
|
|
85
|
-
.cl-light .cl, .cl.cl-light, .light .cl, [data-theme="light"] .cl {
|
|
100
|
+
.cl-light .cl, .cl.cl-light, .light .cl, [data-theme="light"] .cl, .cl-light .cl-copy, .light .cl-copy, [data-theme="light"] .cl-copy {
|
|
86
101
|
--cl-fg: #1e2430;
|
|
87
102
|
--cl-bg: #f7f7f9;
|
|
88
103
|
--cl-keyword: #b4235a;
|
|
89
104
|
--cl-string: #1d6b45;
|
|
90
|
-
--cl-
|
|
105
|
+
--cl-regex: #0b6477;
|
|
106
|
+
--cl-comment: #656c79;
|
|
91
107
|
--cl-number: #a35200;
|
|
92
108
|
--cl-function: #3a52c4;
|
|
93
109
|
--cl-type: #8a3ab9;
|
|
@@ -103,6 +119,9 @@
|
|
|
103
119
|
--cl-inserted-bg: #dcfce7;
|
|
104
120
|
--cl-deleted: #9f1239;
|
|
105
121
|
--cl-deleted-bg: #ffe4e6;
|
|
122
|
+
--cl-line-number: #656c79;
|
|
123
|
+
--cl-mark-bg: #fdf6e1;
|
|
124
|
+
--cl-border: #d5d9e0;
|
|
106
125
|
}
|
|
107
126
|
pre > code.cl {
|
|
108
127
|
display: block;
|
|
@@ -111,6 +130,7 @@ pre > code.cl {
|
|
|
111
130
|
}
|
|
112
131
|
.cl-keyword { color: var(--cl-keyword); }
|
|
113
132
|
.cl-string { color: var(--cl-string); }
|
|
133
|
+
.cl-regex { color: var(--cl-regex); }
|
|
114
134
|
.cl-comment { color: var(--cl-comment); }
|
|
115
135
|
.cl-number { color: var(--cl-number); }
|
|
116
136
|
.cl-function { color: var(--cl-function); }
|
|
@@ -126,7 +146,44 @@ pre > code.cl {
|
|
|
126
146
|
.cl-comment { font-style: italic; }
|
|
127
147
|
.cl-inserted { color: var(--cl-inserted); background: var(--cl-inserted-bg); }
|
|
128
148
|
.cl-deleted { color: var(--cl-deleted); background: var(--cl-deleted-bg); }
|
|
129
|
-
|
|
149
|
+
|
|
150
|
+
/* Line numbers: from data-line, so they're never copied with the code. */
|
|
151
|
+
.cl-ln::before {
|
|
152
|
+
content: attr(data-line);
|
|
153
|
+
display: inline-block;
|
|
154
|
+
min-width: var(--cl-gutter, 2.5ch);
|
|
155
|
+
margin-right: 1.25em;
|
|
156
|
+
text-align: right;
|
|
157
|
+
color: var(--cl-line-number);
|
|
158
|
+
font-style: normal;
|
|
159
|
+
user-select: none;
|
|
160
|
+
-webkit-user-select: none;
|
|
161
|
+
}
|
|
162
|
+
/* Highlighted lines fill the width of the block. */
|
|
163
|
+
.cl-mark {
|
|
164
|
+
display: inline-block;
|
|
165
|
+
min-width: 100%;
|
|
166
|
+
min-height: 1lh;
|
|
167
|
+
background: var(--cl-mark-bg);
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
/* Copy button */
|
|
171
|
+
.cl-has-copy { position: relative; }
|
|
172
|
+
.cl-copy {
|
|
173
|
+
position: absolute;
|
|
174
|
+
top: 0.5rem;
|
|
175
|
+
right: 0.5rem;
|
|
176
|
+
padding: 0.2rem 0.65rem;
|
|
177
|
+
font: 500 12px/1.5 system-ui, -apple-system, "Segoe UI", sans-serif;
|
|
178
|
+
color: var(--cl-fg);
|
|
179
|
+
background: var(--cl-bg);
|
|
180
|
+
border: 1px solid var(--cl-border);
|
|
181
|
+
border-radius: 6px;
|
|
182
|
+
cursor: pointer;
|
|
183
|
+
opacity: 0.8;
|
|
184
|
+
}
|
|
185
|
+
.cl-copy:hover, .cl-copy:focus-visible { opacity: 1; }
|
|
186
|
+
`;var B=nt;function pe(t=document){if(t.getElementById("codelight-theme"))return;let e=t.createElement("style");e.id="codelight-theme",e.textContent=B,t.head.append(e)}var Tt={addCopyButton:A,createMarkup:N,createStream:M,defineLanguage:i,escapeHtml:z,getLanguage:R,highlight:j,highlightAll:ie,highlightElement:H,injectTheme:pe,listLanguages:ae,mount:le,registerLanguage:oe,renderLine:C,splitFences:ce,themeCss:B,tokenize:W},Ot=Tt;return ct(Nt);})();
|
|
130
187
|
/*!
|
|
131
188
|
codelight.js — syntax highlighting for code that streams in, like AI chat replies.
|
|
132
189
|
MIT License · https://github.com/codelightjs/codelight.js
|
package/build/styles/dark.css
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
/*! codelight.js theme: dark */
|
|
2
|
-
.cl {
|
|
2
|
+
.cl, .cl-copy {
|
|
3
3
|
--cl-fg: #e4e7ee;
|
|
4
4
|
--cl-bg: #11141a;
|
|
5
5
|
--cl-keyword: #ff7aa8;
|
|
6
6
|
--cl-string: #8fdba8;
|
|
7
|
+
--cl-regex: #67e3f2;
|
|
7
8
|
--cl-comment: #8a93a3;
|
|
8
9
|
--cl-number: #ffb86b;
|
|
9
10
|
--cl-function: #8fb4ff;
|
|
@@ -20,6 +21,11 @@
|
|
|
20
21
|
--cl-inserted-bg: #0f3a24;
|
|
21
22
|
--cl-deleted: #fecdd3;
|
|
22
23
|
--cl-deleted-bg: #4c1020;
|
|
24
|
+
--cl-line-number: #8a93a3;
|
|
25
|
+
--cl-mark-bg: #262116;
|
|
26
|
+
--cl-border: #2e3440;
|
|
27
|
+
}
|
|
28
|
+
.cl {
|
|
23
29
|
color: var(--cl-fg);
|
|
24
30
|
background: var(--cl-bg);
|
|
25
31
|
}
|
|
@@ -30,6 +36,7 @@ pre > code.cl {
|
|
|
30
36
|
}
|
|
31
37
|
.cl-keyword { color: var(--cl-keyword); }
|
|
32
38
|
.cl-string { color: var(--cl-string); }
|
|
39
|
+
.cl-regex { color: var(--cl-regex); }
|
|
33
40
|
.cl-comment { color: var(--cl-comment); }
|
|
34
41
|
.cl-number { color: var(--cl-number); }
|
|
35
42
|
.cl-function { color: var(--cl-function); }
|
|
@@ -45,3 +52,40 @@ pre > code.cl {
|
|
|
45
52
|
.cl-comment { font-style: italic; }
|
|
46
53
|
.cl-inserted { color: var(--cl-inserted); background: var(--cl-inserted-bg); }
|
|
47
54
|
.cl-deleted { color: var(--cl-deleted); background: var(--cl-deleted-bg); }
|
|
55
|
+
|
|
56
|
+
/* Line numbers: from data-line, so they're never copied with the code. */
|
|
57
|
+
.cl-ln::before {
|
|
58
|
+
content: attr(data-line);
|
|
59
|
+
display: inline-block;
|
|
60
|
+
min-width: var(--cl-gutter, 2.5ch);
|
|
61
|
+
margin-right: 1.25em;
|
|
62
|
+
text-align: right;
|
|
63
|
+
color: var(--cl-line-number);
|
|
64
|
+
font-style: normal;
|
|
65
|
+
user-select: none;
|
|
66
|
+
-webkit-user-select: none;
|
|
67
|
+
}
|
|
68
|
+
/* Highlighted lines fill the width of the block. */
|
|
69
|
+
.cl-mark {
|
|
70
|
+
display: inline-block;
|
|
71
|
+
min-width: 100%;
|
|
72
|
+
min-height: 1lh;
|
|
73
|
+
background: var(--cl-mark-bg);
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
/* Copy button */
|
|
77
|
+
.cl-has-copy { position: relative; }
|
|
78
|
+
.cl-copy {
|
|
79
|
+
position: absolute;
|
|
80
|
+
top: 0.5rem;
|
|
81
|
+
right: 0.5rem;
|
|
82
|
+
padding: 0.2rem 0.65rem;
|
|
83
|
+
font: 500 12px/1.5 system-ui, -apple-system, "Segoe UI", sans-serif;
|
|
84
|
+
color: var(--cl-fg);
|
|
85
|
+
background: var(--cl-bg);
|
|
86
|
+
border: 1px solid var(--cl-border);
|
|
87
|
+
border-radius: 6px;
|
|
88
|
+
cursor: pointer;
|
|
89
|
+
opacity: 0.8;
|
|
90
|
+
}
|
|
91
|
+
.cl-copy:hover, .cl-copy:focus-visible { opacity: 1; }
|
|
@@ -1 +1 @@
|
|
|
1
|
-
/*! codelight.js theme: dark */.cl{--cl-fg: #e4e7ee;--cl-bg: #11141a;--cl-keyword: #ff7aa8;--cl-string: #8fdba8;--cl-comment: #8a93a3;--cl-number: #ffb86b;--cl-function: #8fb4ff;--cl-type: #d0a3ff;--cl-constant: #ffb86b;--cl-variable: #ffa070;--cl-property: #7fd0f0;--cl-operator: #ff7aa8;--cl-punctuation: #aab1bd;--cl-tag: #8fb4ff;--cl-attr: #d0a3ff;--cl-meta: #b49cff;--cl-inserted: #a7f3c0;--cl-inserted-bg: #0f3a24;--cl-deleted: #fecdd3;--cl-deleted-bg: #4c1020
|
|
1
|
+
/*! codelight.js theme: dark */.cl,.cl-copy{--cl-fg: #e4e7ee;--cl-bg: #11141a;--cl-keyword: #ff7aa8;--cl-string: #8fdba8;--cl-regex: #67e3f2;--cl-comment: #8a93a3;--cl-number: #ffb86b;--cl-function: #8fb4ff;--cl-type: #d0a3ff;--cl-constant: #ffb86b;--cl-variable: #ffa070;--cl-property: #7fd0f0;--cl-operator: #ff7aa8;--cl-punctuation: #aab1bd;--cl-tag: #8fb4ff;--cl-attr: #d0a3ff;--cl-meta: #b49cff;--cl-inserted: #a7f3c0;--cl-inserted-bg: #0f3a24;--cl-deleted: #fecdd3;--cl-deleted-bg: #4c1020;--cl-line-number: #8a93a3;--cl-mark-bg: #262116;--cl-border: #2e3440}.cl{color:var(--cl-fg);background:var(--cl-bg)}pre>code.cl{display:block;padding:1rem 1.25rem;overflow:auto}.cl-keyword{color:var(--cl-keyword)}.cl-string{color:var(--cl-string)}.cl-regex{color:var(--cl-regex)}.cl-comment{color:var(--cl-comment)}.cl-number{color:var(--cl-number)}.cl-function{color:var(--cl-function)}.cl-type{color:var(--cl-type)}.cl-constant{color:var(--cl-constant)}.cl-variable{color:var(--cl-variable)}.cl-property{color:var(--cl-property)}.cl-operator{color:var(--cl-operator)}.cl-punctuation{color:var(--cl-punctuation)}.cl-tag{color:var(--cl-tag)}.cl-attr{color:var(--cl-attr)}.cl-meta{color:var(--cl-meta)}.cl-comment{font-style:italic}.cl-inserted{color:var(--cl-inserted);background:var(--cl-inserted-bg)}.cl-deleted{color:var(--cl-deleted);background:var(--cl-deleted-bg)}.cl-ln:before{content:attr(data-line);display:inline-block;min-width:var(--cl-gutter, 2.5ch);margin-right:1.25em;text-align:right;color:var(--cl-line-number);font-style:normal;user-select:none;-webkit-user-select:none}.cl-mark{display:inline-block;min-width:100%;min-height:1lh;background:var(--cl-mark-bg)}.cl-has-copy{position:relative}.cl-copy{position:absolute;top:.5rem;right:.5rem;padding:.2rem .65rem;font:500 12px/1.5 system-ui,-apple-system,Segoe UI,sans-serif;color:var(--cl-fg);background:var(--cl-bg);border:1px solid var(--cl-border);border-radius:6px;cursor:pointer;opacity:.8}.cl-copy:hover,.cl-copy:focus-visible{opacity:1}
|
package/build/styles/default.css
CHANGED
|
@@ -3,12 +3,13 @@
|
|
|
3
3
|
Light or dark to match the system. To force one, put a cl-light or cl-dark class
|
|
4
4
|
(or light / dark, or data-theme="light" / "dark") on the code or any parent.
|
|
5
5
|
*/
|
|
6
|
-
.cl {
|
|
6
|
+
.cl, .cl-copy {
|
|
7
7
|
--cl-fg: #1e2430;
|
|
8
8
|
--cl-bg: #f7f7f9;
|
|
9
9
|
--cl-keyword: #b4235a;
|
|
10
10
|
--cl-string: #1d6b45;
|
|
11
|
-
--cl-
|
|
11
|
+
--cl-regex: #0b6477;
|
|
12
|
+
--cl-comment: #656c79;
|
|
12
13
|
--cl-number: #a35200;
|
|
13
14
|
--cl-function: #3a52c4;
|
|
14
15
|
--cl-type: #8a3ab9;
|
|
@@ -24,15 +25,21 @@
|
|
|
24
25
|
--cl-inserted-bg: #dcfce7;
|
|
25
26
|
--cl-deleted: #9f1239;
|
|
26
27
|
--cl-deleted-bg: #ffe4e6;
|
|
28
|
+
--cl-line-number: #656c79;
|
|
29
|
+
--cl-mark-bg: #fdf6e1;
|
|
30
|
+
--cl-border: #d5d9e0;
|
|
31
|
+
}
|
|
32
|
+
.cl {
|
|
27
33
|
color: var(--cl-fg);
|
|
28
34
|
background: var(--cl-bg);
|
|
29
35
|
}
|
|
30
36
|
@media (prefers-color-scheme: dark) {
|
|
31
|
-
.cl {
|
|
37
|
+
.cl, .cl-copy {
|
|
32
38
|
--cl-fg: #e4e7ee;
|
|
33
39
|
--cl-bg: #11141a;
|
|
34
40
|
--cl-keyword: #ff7aa8;
|
|
35
41
|
--cl-string: #8fdba8;
|
|
42
|
+
--cl-regex: #67e3f2;
|
|
36
43
|
--cl-comment: #8a93a3;
|
|
37
44
|
--cl-number: #ffb86b;
|
|
38
45
|
--cl-function: #8fb4ff;
|
|
@@ -49,13 +56,17 @@
|
|
|
49
56
|
--cl-inserted-bg: #0f3a24;
|
|
50
57
|
--cl-deleted: #fecdd3;
|
|
51
58
|
--cl-deleted-bg: #4c1020;
|
|
59
|
+
--cl-line-number: #8a93a3;
|
|
60
|
+
--cl-mark-bg: #262116;
|
|
61
|
+
--cl-border: #2e3440;
|
|
52
62
|
}
|
|
53
63
|
}
|
|
54
|
-
.cl-dark .cl, .cl.cl-dark, .dark .cl, [data-theme="dark"] .cl {
|
|
64
|
+
.cl-dark .cl, .cl.cl-dark, .dark .cl, [data-theme="dark"] .cl, .cl-dark .cl-copy, .dark .cl-copy, [data-theme="dark"] .cl-copy {
|
|
55
65
|
--cl-fg: #e4e7ee;
|
|
56
66
|
--cl-bg: #11141a;
|
|
57
67
|
--cl-keyword: #ff7aa8;
|
|
58
68
|
--cl-string: #8fdba8;
|
|
69
|
+
--cl-regex: #67e3f2;
|
|
59
70
|
--cl-comment: #8a93a3;
|
|
60
71
|
--cl-number: #ffb86b;
|
|
61
72
|
--cl-function: #8fb4ff;
|
|
@@ -72,13 +83,17 @@
|
|
|
72
83
|
--cl-inserted-bg: #0f3a24;
|
|
73
84
|
--cl-deleted: #fecdd3;
|
|
74
85
|
--cl-deleted-bg: #4c1020;
|
|
86
|
+
--cl-line-number: #8a93a3;
|
|
87
|
+
--cl-mark-bg: #262116;
|
|
88
|
+
--cl-border: #2e3440;
|
|
75
89
|
}
|
|
76
|
-
.cl-light .cl, .cl.cl-light, .light .cl, [data-theme="light"] .cl {
|
|
90
|
+
.cl-light .cl, .cl.cl-light, .light .cl, [data-theme="light"] .cl, .cl-light .cl-copy, .light .cl-copy, [data-theme="light"] .cl-copy {
|
|
77
91
|
--cl-fg: #1e2430;
|
|
78
92
|
--cl-bg: #f7f7f9;
|
|
79
93
|
--cl-keyword: #b4235a;
|
|
80
94
|
--cl-string: #1d6b45;
|
|
81
|
-
--cl-
|
|
95
|
+
--cl-regex: #0b6477;
|
|
96
|
+
--cl-comment: #656c79;
|
|
82
97
|
--cl-number: #a35200;
|
|
83
98
|
--cl-function: #3a52c4;
|
|
84
99
|
--cl-type: #8a3ab9;
|
|
@@ -94,6 +109,9 @@
|
|
|
94
109
|
--cl-inserted-bg: #dcfce7;
|
|
95
110
|
--cl-deleted: #9f1239;
|
|
96
111
|
--cl-deleted-bg: #ffe4e6;
|
|
112
|
+
--cl-line-number: #656c79;
|
|
113
|
+
--cl-mark-bg: #fdf6e1;
|
|
114
|
+
--cl-border: #d5d9e0;
|
|
97
115
|
}
|
|
98
116
|
pre > code.cl {
|
|
99
117
|
display: block;
|
|
@@ -102,6 +120,7 @@ pre > code.cl {
|
|
|
102
120
|
}
|
|
103
121
|
.cl-keyword { color: var(--cl-keyword); }
|
|
104
122
|
.cl-string { color: var(--cl-string); }
|
|
123
|
+
.cl-regex { color: var(--cl-regex); }
|
|
105
124
|
.cl-comment { color: var(--cl-comment); }
|
|
106
125
|
.cl-number { color: var(--cl-number); }
|
|
107
126
|
.cl-function { color: var(--cl-function); }
|
|
@@ -117,3 +136,40 @@ pre > code.cl {
|
|
|
117
136
|
.cl-comment { font-style: italic; }
|
|
118
137
|
.cl-inserted { color: var(--cl-inserted); background: var(--cl-inserted-bg); }
|
|
119
138
|
.cl-deleted { color: var(--cl-deleted); background: var(--cl-deleted-bg); }
|
|
139
|
+
|
|
140
|
+
/* Line numbers: from data-line, so they're never copied with the code. */
|
|
141
|
+
.cl-ln::before {
|
|
142
|
+
content: attr(data-line);
|
|
143
|
+
display: inline-block;
|
|
144
|
+
min-width: var(--cl-gutter, 2.5ch);
|
|
145
|
+
margin-right: 1.25em;
|
|
146
|
+
text-align: right;
|
|
147
|
+
color: var(--cl-line-number);
|
|
148
|
+
font-style: normal;
|
|
149
|
+
user-select: none;
|
|
150
|
+
-webkit-user-select: none;
|
|
151
|
+
}
|
|
152
|
+
/* Highlighted lines fill the width of the block. */
|
|
153
|
+
.cl-mark {
|
|
154
|
+
display: inline-block;
|
|
155
|
+
min-width: 100%;
|
|
156
|
+
min-height: 1lh;
|
|
157
|
+
background: var(--cl-mark-bg);
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
/* Copy button */
|
|
161
|
+
.cl-has-copy { position: relative; }
|
|
162
|
+
.cl-copy {
|
|
163
|
+
position: absolute;
|
|
164
|
+
top: 0.5rem;
|
|
165
|
+
right: 0.5rem;
|
|
166
|
+
padding: 0.2rem 0.65rem;
|
|
167
|
+
font: 500 12px/1.5 system-ui, -apple-system, "Segoe UI", sans-serif;
|
|
168
|
+
color: var(--cl-fg);
|
|
169
|
+
background: var(--cl-bg);
|
|
170
|
+
border: 1px solid var(--cl-border);
|
|
171
|
+
border-radius: 6px;
|
|
172
|
+
cursor: pointer;
|
|
173
|
+
opacity: 0.8;
|
|
174
|
+
}
|
|
175
|
+
.cl-copy:hover, .cl-copy:focus-visible { opacity: 1; }
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
codelight.js theme: default
|
|
3
3
|
Light or dark to match the system. To force one, put a cl-light or cl-dark class
|
|
4
4
|
(or light / dark, or data-theme="light" / "dark") on the code or any parent.
|
|
5
|
-
*/.cl{--cl-fg: #1e2430;--cl-bg: #f7f7f9;--cl-keyword: #b4235a;--cl-string: #1d6b45;--cl-comment: #
|
|
5
|
+
*/.cl,.cl-copy{--cl-fg: #1e2430;--cl-bg: #f7f7f9;--cl-keyword: #b4235a;--cl-string: #1d6b45;--cl-regex: #0b6477;--cl-comment: #656c79;--cl-number: #a35200;--cl-function: #3a52c4;--cl-type: #8a3ab9;--cl-constant: #a35200;--cl-variable: #9a3f0c;--cl-property: #1f6f9a;--cl-operator: #b4235a;--cl-punctuation: #4b5563;--cl-tag: #2459a8;--cl-attr: #8a3ab9;--cl-meta: #6b4fbb;--cl-inserted: #166534;--cl-inserted-bg: #dcfce7;--cl-deleted: #9f1239;--cl-deleted-bg: #ffe4e6;--cl-line-number: #656c79;--cl-mark-bg: #fdf6e1;--cl-border: #d5d9e0}.cl{color:var(--cl-fg);background:var(--cl-bg)}@media(prefers-color-scheme:dark){.cl,.cl-copy{--cl-fg: #e4e7ee;--cl-bg: #11141a;--cl-keyword: #ff7aa8;--cl-string: #8fdba8;--cl-regex: #67e3f2;--cl-comment: #8a93a3;--cl-number: #ffb86b;--cl-function: #8fb4ff;--cl-type: #d0a3ff;--cl-constant: #ffb86b;--cl-variable: #ffa070;--cl-property: #7fd0f0;--cl-operator: #ff7aa8;--cl-punctuation: #aab1bd;--cl-tag: #8fb4ff;--cl-attr: #d0a3ff;--cl-meta: #b49cff;--cl-inserted: #a7f3c0;--cl-inserted-bg: #0f3a24;--cl-deleted: #fecdd3;--cl-deleted-bg: #4c1020;--cl-line-number: #8a93a3;--cl-mark-bg: #262116;--cl-border: #2e3440}}.cl-dark .cl,.cl.cl-dark,.dark .cl,[data-theme=dark] .cl,.cl-dark .cl-copy,.dark .cl-copy,[data-theme=dark] .cl-copy{--cl-fg: #e4e7ee;--cl-bg: #11141a;--cl-keyword: #ff7aa8;--cl-string: #8fdba8;--cl-regex: #67e3f2;--cl-comment: #8a93a3;--cl-number: #ffb86b;--cl-function: #8fb4ff;--cl-type: #d0a3ff;--cl-constant: #ffb86b;--cl-variable: #ffa070;--cl-property: #7fd0f0;--cl-operator: #ff7aa8;--cl-punctuation: #aab1bd;--cl-tag: #8fb4ff;--cl-attr: #d0a3ff;--cl-meta: #b49cff;--cl-inserted: #a7f3c0;--cl-inserted-bg: #0f3a24;--cl-deleted: #fecdd3;--cl-deleted-bg: #4c1020;--cl-line-number: #8a93a3;--cl-mark-bg: #262116;--cl-border: #2e3440}.cl-light .cl,.cl.cl-light,.light .cl,[data-theme=light] .cl,.cl-light .cl-copy,.light .cl-copy,[data-theme=light] .cl-copy{--cl-fg: #1e2430;--cl-bg: #f7f7f9;--cl-keyword: #b4235a;--cl-string: #1d6b45;--cl-regex: #0b6477;--cl-comment: #656c79;--cl-number: #a35200;--cl-function: #3a52c4;--cl-type: #8a3ab9;--cl-constant: #a35200;--cl-variable: #9a3f0c;--cl-property: #1f6f9a;--cl-operator: #b4235a;--cl-punctuation: #4b5563;--cl-tag: #2459a8;--cl-attr: #8a3ab9;--cl-meta: #6b4fbb;--cl-inserted: #166534;--cl-inserted-bg: #dcfce7;--cl-deleted: #9f1239;--cl-deleted-bg: #ffe4e6;--cl-line-number: #656c79;--cl-mark-bg: #fdf6e1;--cl-border: #d5d9e0}pre>code.cl{display:block;padding:1rem 1.25rem;overflow:auto}.cl-keyword{color:var(--cl-keyword)}.cl-string{color:var(--cl-string)}.cl-regex{color:var(--cl-regex)}.cl-comment{color:var(--cl-comment)}.cl-number{color:var(--cl-number)}.cl-function{color:var(--cl-function)}.cl-type{color:var(--cl-type)}.cl-constant{color:var(--cl-constant)}.cl-variable{color:var(--cl-variable)}.cl-property{color:var(--cl-property)}.cl-operator{color:var(--cl-operator)}.cl-punctuation{color:var(--cl-punctuation)}.cl-tag{color:var(--cl-tag)}.cl-attr{color:var(--cl-attr)}.cl-meta{color:var(--cl-meta)}.cl-comment{font-style:italic}.cl-inserted{color:var(--cl-inserted);background:var(--cl-inserted-bg)}.cl-deleted{color:var(--cl-deleted);background:var(--cl-deleted-bg)}.cl-ln:before{content:attr(data-line);display:inline-block;min-width:var(--cl-gutter, 2.5ch);margin-right:1.25em;text-align:right;color:var(--cl-line-number);font-style:normal;user-select:none;-webkit-user-select:none}.cl-mark{display:inline-block;min-width:100%;min-height:1lh;background:var(--cl-mark-bg)}.cl-has-copy{position:relative}.cl-copy{position:absolute;top:.5rem;right:.5rem;padding:.2rem .65rem;font:500 12px/1.5 system-ui,-apple-system,Segoe UI,sans-serif;color:var(--cl-fg);background:var(--cl-bg);border:1px solid var(--cl-border);border-radius:6px;cursor:pointer;opacity:.8}.cl-copy:hover,.cl-copy:focus-visible{opacity:1}
|
package/build/styles/light.css
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
/*! codelight.js theme: light */
|
|
2
|
-
.cl {
|
|
2
|
+
.cl, .cl-copy {
|
|
3
3
|
--cl-fg: #1e2430;
|
|
4
4
|
--cl-bg: #f7f7f9;
|
|
5
5
|
--cl-keyword: #b4235a;
|
|
6
6
|
--cl-string: #1d6b45;
|
|
7
|
-
--cl-
|
|
7
|
+
--cl-regex: #0b6477;
|
|
8
|
+
--cl-comment: #656c79;
|
|
8
9
|
--cl-number: #a35200;
|
|
9
10
|
--cl-function: #3a52c4;
|
|
10
11
|
--cl-type: #8a3ab9;
|
|
@@ -20,6 +21,11 @@
|
|
|
20
21
|
--cl-inserted-bg: #dcfce7;
|
|
21
22
|
--cl-deleted: #9f1239;
|
|
22
23
|
--cl-deleted-bg: #ffe4e6;
|
|
24
|
+
--cl-line-number: #656c79;
|
|
25
|
+
--cl-mark-bg: #fdf6e1;
|
|
26
|
+
--cl-border: #d5d9e0;
|
|
27
|
+
}
|
|
28
|
+
.cl {
|
|
23
29
|
color: var(--cl-fg);
|
|
24
30
|
background: var(--cl-bg);
|
|
25
31
|
}
|
|
@@ -30,6 +36,7 @@ pre > code.cl {
|
|
|
30
36
|
}
|
|
31
37
|
.cl-keyword { color: var(--cl-keyword); }
|
|
32
38
|
.cl-string { color: var(--cl-string); }
|
|
39
|
+
.cl-regex { color: var(--cl-regex); }
|
|
33
40
|
.cl-comment { color: var(--cl-comment); }
|
|
34
41
|
.cl-number { color: var(--cl-number); }
|
|
35
42
|
.cl-function { color: var(--cl-function); }
|
|
@@ -45,3 +52,40 @@ pre > code.cl {
|
|
|
45
52
|
.cl-comment { font-style: italic; }
|
|
46
53
|
.cl-inserted { color: var(--cl-inserted); background: var(--cl-inserted-bg); }
|
|
47
54
|
.cl-deleted { color: var(--cl-deleted); background: var(--cl-deleted-bg); }
|
|
55
|
+
|
|
56
|
+
/* Line numbers: from data-line, so they're never copied with the code. */
|
|
57
|
+
.cl-ln::before {
|
|
58
|
+
content: attr(data-line);
|
|
59
|
+
display: inline-block;
|
|
60
|
+
min-width: var(--cl-gutter, 2.5ch);
|
|
61
|
+
margin-right: 1.25em;
|
|
62
|
+
text-align: right;
|
|
63
|
+
color: var(--cl-line-number);
|
|
64
|
+
font-style: normal;
|
|
65
|
+
user-select: none;
|
|
66
|
+
-webkit-user-select: none;
|
|
67
|
+
}
|
|
68
|
+
/* Highlighted lines fill the width of the block. */
|
|
69
|
+
.cl-mark {
|
|
70
|
+
display: inline-block;
|
|
71
|
+
min-width: 100%;
|
|
72
|
+
min-height: 1lh;
|
|
73
|
+
background: var(--cl-mark-bg);
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
/* Copy button */
|
|
77
|
+
.cl-has-copy { position: relative; }
|
|
78
|
+
.cl-copy {
|
|
79
|
+
position: absolute;
|
|
80
|
+
top: 0.5rem;
|
|
81
|
+
right: 0.5rem;
|
|
82
|
+
padding: 0.2rem 0.65rem;
|
|
83
|
+
font: 500 12px/1.5 system-ui, -apple-system, "Segoe UI", sans-serif;
|
|
84
|
+
color: var(--cl-fg);
|
|
85
|
+
background: var(--cl-bg);
|
|
86
|
+
border: 1px solid var(--cl-border);
|
|
87
|
+
border-radius: 6px;
|
|
88
|
+
cursor: pointer;
|
|
89
|
+
opacity: 0.8;
|
|
90
|
+
}
|
|
91
|
+
.cl-copy:hover, .cl-copy:focus-visible { opacity: 1; }
|
|
@@ -1 +1 @@
|
|
|
1
|
-
/*! codelight.js theme: light */.cl{--cl-fg: #1e2430;--cl-bg: #f7f7f9;--cl-keyword: #b4235a;--cl-string: #1d6b45;--cl-comment: #
|
|
1
|
+
/*! codelight.js theme: light */.cl,.cl-copy{--cl-fg: #1e2430;--cl-bg: #f7f7f9;--cl-keyword: #b4235a;--cl-string: #1d6b45;--cl-regex: #0b6477;--cl-comment: #656c79;--cl-number: #a35200;--cl-function: #3a52c4;--cl-type: #8a3ab9;--cl-constant: #a35200;--cl-variable: #9a3f0c;--cl-property: #1f6f9a;--cl-operator: #b4235a;--cl-punctuation: #4b5563;--cl-tag: #2459a8;--cl-attr: #8a3ab9;--cl-meta: #6b4fbb;--cl-inserted: #166534;--cl-inserted-bg: #dcfce7;--cl-deleted: #9f1239;--cl-deleted-bg: #ffe4e6;--cl-line-number: #656c79;--cl-mark-bg: #fdf6e1;--cl-border: #d5d9e0}.cl{color:var(--cl-fg);background:var(--cl-bg)}pre>code.cl{display:block;padding:1rem 1.25rem;overflow:auto}.cl-keyword{color:var(--cl-keyword)}.cl-string{color:var(--cl-string)}.cl-regex{color:var(--cl-regex)}.cl-comment{color:var(--cl-comment)}.cl-number{color:var(--cl-number)}.cl-function{color:var(--cl-function)}.cl-type{color:var(--cl-type)}.cl-constant{color:var(--cl-constant)}.cl-variable{color:var(--cl-variable)}.cl-property{color:var(--cl-property)}.cl-operator{color:var(--cl-operator)}.cl-punctuation{color:var(--cl-punctuation)}.cl-tag{color:var(--cl-tag)}.cl-attr{color:var(--cl-attr)}.cl-meta{color:var(--cl-meta)}.cl-comment{font-style:italic}.cl-inserted{color:var(--cl-inserted);background:var(--cl-inserted-bg)}.cl-deleted{color:var(--cl-deleted);background:var(--cl-deleted-bg)}.cl-ln:before{content:attr(data-line);display:inline-block;min-width:var(--cl-gutter, 2.5ch);margin-right:1.25em;text-align:right;color:var(--cl-line-number);font-style:normal;user-select:none;-webkit-user-select:none}.cl-mark{display:inline-block;min-width:100%;min-height:1lh;background:var(--cl-mark-bg)}.cl-has-copy{position:relative}.cl-copy{position:absolute;top:.5rem;right:.5rem;padding:.2rem .65rem;font:500 12px/1.5 system-ui,-apple-system,Segoe UI,sans-serif;color:var(--cl-fg);background:var(--cl-bg);border:1px solid var(--cl-border);border-radius:6px;cursor:pointer;opacity:.8}.cl-copy:hover,.cl-copy:focus-visible{opacity:1}
|