@clepit/core 0.3.0-beta.333 → 0.3.0-beta.339
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/dist/code.d.ts +12 -0
- package/dist/code.js +1 -0
- package/dist/code.mjs +1 -0
- package/dist/highlight-C4NcTcIm.mjs +2 -0
- package/dist/highlight-eQD0I7eW.js +2 -0
- package/dist/index.js +1 -1
- package/dist/index.mjs +1 -1
- package/dist/tools/block/checklist/css.d.ts +1 -1
- package/package.json +13 -6
package/dist/code.d.ts
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The colouring a code block does, without the block.
|
|
3
|
+
*
|
|
4
|
+
* A surface outside the editor that prints source (an SDK contract, a request
|
|
5
|
+
* body) reads the same as a snippet in a document because it is the same
|
|
6
|
+
* tokenizer, and no product carries a second grammar to keep in step with this
|
|
7
|
+
* one. Its own entry so that reuse costs a tokenizer rather than an editor.
|
|
8
|
+
*/
|
|
9
|
+
export { type CodeToken, tokenizeCode } from './tools/block/code/highlight';
|
|
10
|
+
export { CODE_THEME_TOKENS, CODE_TOKEN_GROUPS, type CodeThemeTokens, type CodeTokenGroup, type NamedCodeTheme } from './tools/block/code/theme-generator';
|
|
11
|
+
export type { CodeLanguage } from './types';
|
|
12
|
+
//# sourceMappingURL=code.d.ts.map
|
package/dist/code.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./highlight-eQD0I7eW.js");exports.CODE_THEME_TOKENS=e.CODE_THEME_TOKENS,exports.CODE_TOKEN_GROUPS=e.CODE_TOKEN_GROUPS,exports.tokenizeCode=e.tokenizeCode;
|
package/dist/code.mjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{i,r,t as s}from"./highlight-C4NcTcIm.mjs";export{r as CODE_THEME_TOKENS,i as CODE_TOKEN_GROUPS,s as tokenizeCode};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
var e=()=>({background:"var(--clepit-code-bg)",comment:"var(--clepit-code-comment)",function:"var(--clepit-code-function)",gutter:"var(--clepit-code-gutter)",keyword:"var(--clepit-code-keyword)",number:"var(--clepit-code-number)",punctuation:"var(--clepit-code-punctuation)",selection:"var(--clepit-code-selection-bg)",string:"var(--clepit-code-string)",text:"var(--clepit-code-text)",type:"var(--clepit-code-type)"}),t={dark:{background:"#1c2128",comment:"rgba(240, 246, 252, 0.42)",function:"#d2a8ff",gutter:"rgba(240, 246, 252, 0.42)",keyword:"#ff7b72",number:"#79c0ff",punctuation:"rgba(240, 246, 252, 0.62)",selection:"rgba(124, 124, 255, 0.24)",string:"#7ee787",text:"rgba(240, 246, 252, 0.92)",type:"#ffa657"},dracula:{background:"#282a36",comment:"#6272a4",function:"#50fa7b",gutter:"#6272a4",keyword:"#ff79c6",number:"#bd93f9",punctuation:"#f8f8f2",selection:"rgba(68, 71, 90, 0.8)",string:"#f1fa8c",text:"#f8f8f2",type:"#8be9fd"},github:{background:"#ffffff",comment:"#6e7781",function:"#8250df",gutter:"#8c959f",keyword:"#cf222e",number:"#0550ae",punctuation:"#24292f",selection:"rgba(84, 174, 255, 0.24)",string:"#0a3069",text:"#24292f",type:"#953800"},"github-dark":{background:"#0d1117",comment:"#8b949e",function:"#d2a8ff",gutter:"#6e7681",keyword:"#ff7b72",number:"#79c0ff",punctuation:"#c9d1d9",selection:"rgba(56, 139, 253, 0.24)",string:"#a5d6ff",text:"#c9d1d9",type:"#ffa657"},light:{background:"#fdfdfd",comment:"#868f9c",function:"#6f42c1",gutter:"#868f9c",keyword:"#cf222e",number:"#0550ae",punctuation:"#525866",selection:"rgba(91, 91, 255, 0.14)",string:"#0a7c3e",text:"#0a0a0a",type:"#953800"},monokai:{background:"#272822",comment:"#75715e",function:"#a6e22e",gutter:"#75715e",keyword:"#f92672",number:"#ae81ff",punctuation:"#f8f8f2",selection:"rgba(73, 72, 62, 0.9)",string:"#e6db74",text:"#f8f8f2",type:"#66d9ef"},solarized:{background:"#fdf6e3",comment:"#93a1a1",function:"#268bd2",gutter:"#93a1a1",keyword:"#859900",number:"#d33682",punctuation:"#657b83",selection:"rgba(238, 232, 213, 0.9)",string:"#2aa198",text:"#657b83",type:"#b58900"},"solarized-dark":{background:"#002b36",comment:"#586e75",function:"#268bd2",gutter:"#586e75",keyword:"#859900",number:"#d33682",punctuation:"#839496",selection:"rgba(7, 54, 66, 0.9)",string:"#2aa198",text:"#839496",type:"#b58900"},tomorrow:{background:"#fafafa",comment:"#8e908c",function:"#4271ae",gutter:"#8e908c",keyword:"#8959a8",number:"#f5871f",punctuation:"#4d4d4c",selection:"rgba(214, 214, 214, 0.9)",string:"#718c00",text:"#4d4d4c",type:"#c82829"}},n=["keyword","string","number","comment","function","type","punctuation","text"],i=Object.fromEntries(n.map(e=>[e,`clepit-code-${e}`])),s=e=>e>="0"&&e<="9",r=e=>" "===e||"\t"===e||"\n"===e||"\r"===e||"\f"===e||"\v"===e,o=e=>e>="a"&&e<="z"||e>="A"&&e<="Z"||"_"===e||e.charCodeAt(0)>127,a=e=>(e.lineComments?.length??0)>0||(e.blockComments?.length??0)>0||(e.strings?.length??0)>0||(e.keywords?.length??0)>0||(e.types?.length??0)>0||(e.constants?.length??0)>0||(e.builtins?.length??0)>0,l=(e,t)=>new Set((e??[]).map(e=>t?e.toLowerCase():e)),c=(e,t)=>{let n=t;for(;n<e.length&&(" "===e[n]||"\t"===e[n]);)n++;return e[n]??""},u=(e,t,n)=>{const i=n.close??n.open;let s=t+n.open.length;for(;s<e.length;)if(n.escape&&e[s]===n.escape)s+=2;else{if(!n.multiline&&"\n"===e[s])return s;if(e.startsWith(i,s))return s+i.length;s++}return e.length},f=(e,t)=>{let n=t;if("0"===e[n]&&/[xXbBoO]/.test(e[n+1]??"")){for(n+=2;n<e.length&&/[0-9a-fA-F_]/.test(e[n]);)n++;return n}for(;n<e.length&&/[0-9_]/.test(e[n]);)n++;if("."===e[n]&&s(e[n+1]??""))for(n++;n<e.length&&/[0-9_]/.test(e[n]);)n++;if(/[eE]/.test(e[n]??"")&&(s(e[n+1]??"")||/[+-]/.test(e[n+1]??"")&&s(e[n+2]??"")))for(n+=2;n<e.length&&s(e[n]);)n++;for(;n<e.length&&o(e[n])&&!s(e[n])&&/[a-zA-Z]/.test(e[n])&&n-t<32&&/[nlLfFdDuUmM]/.test(e[n]);)n++;return n},d=[{escape:"\\",open:'"'},{escape:"\\",open:"'"}],p={blockComments:[["/*","*/"]],lineComments:["//"]},m=e=>({...p,functionCalls:!0,strings:d,...e}),g=e=>({functionCalls:!0,lineComments:["#"],strings:d,...e}),y=["as","async","await","break","case","catch","class","const","continue","debugger","default","delete","do","else","export","extends","finally","for","from","function","get","if","import","in","instanceof","let","new","of","return","set","static","super","switch","this","throw","try","typeof","var","void","while","with","yield"],b=[...y,"abstract","declare","enum","implements","infer","interface","is","keyof","namespace","override","private","protected","public","readonly","satisfies","type"],h=m({constants:["false","null","true","undefined","NaN","Infinity"],identifierExtra:"$",keywords:y,strings:[...d,{escape:"\\",multiline:!0,open:"`"}],types:["Array","Boolean","Date","Error","Map","Number","Object","Promise","RegExp","Set","String","Symbol"]}),w={...h,keywords:b,types:[...h.types??[],"any","bigint","boolean","never","number","object","string","symbol","unknown","void"]},k=g({constants:["False","None","True"],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"],strings:[{escape:"\\",multiline:!0,open:'"""'},{escape:"\\",multiline:!0,open:"'''"},...d],types:["bool","bytes","dict","float","frozenset","int","list","set","str","tuple"]}),v={blockComments:[["\x3c!--","--\x3e"]],strings:d,types:[]},x={assembly:{constants:[],keywords:["add","call","cmp","jmp","jne","je","lea","mov","pop","push","ret","sub","xor"],lineComments:[";","#"],strings:d,types:["byte","dword","qword","word"]},bash:g({builtins:["cd","echo","exit","export","printf","read","source"],constants:["false","true"],identifierExtra:"$",keywords:["case","do","done","elif","else","esac","fi","for","function","if","in","local","return","select","then","until","while"],strings:[{escape:"\\",multiline:!0,open:'"'},{multiline:!0,open:"'"}]}),clojure:{constants:["false","nil","true"],identifierExtra:"-*?!<>=/",keywords:["def","defmacro","defn","do","fn","if","let","loop","ns","quote","recur","require","var","when"],lineComments:[";"],strings:[{escape:"\\",multiline:!0,open:'"'}]},cobol:{caseInsensitive:!0,keywords:["accept","add","call","compute","display","division","else","end","goback","identification","if","move","perform","procedure","program-id","section","stop","to","until","working-storage"],lineComments:["*"],strings:d,types:["pic","picture"]},cpp:m({constants:["false","nullptr","true"],keywords:["auto","break","case","catch","class","const","constexpr","continue","default","delete","do","else","enum","explicit","export","extern","for","friend","goto","if","inline","mutable","namespace","new","noexcept","operator","private","protected","public","return","sizeof","static","struct","switch","template","this","throw","try","typedef","typename","union","using","virtual","volatile","while"],types:["bool","char","double","float","int","long","short","signed","size_t","unsigned","void","wchar_t"]}),csharp:m({constants:["false","null","true"],keywords:["abstract","as","async","await","base","break","case","catch","class","const","continue","default","delegate","do","else","enum","event","explicit","extern","finally","fixed","for","foreach","get","goto","if","implicit","in","interface","internal","is","lock","namespace","new","operator","out","override","params","private","protected","public","readonly","record","ref","return","sealed","set","sizeof","stackalloc","static","struct","switch","this","throw","try","typeof","unsafe","using","var","virtual","void","while","yield"],types:["bool","byte","char","decimal","double","float","int","long","object","sbyte","short","string","uint","ulong","ushort"]}),css:{blockComments:[["/*","*/"]],functionCalls:!0,keywords:["and","from","important","not","only","to"],strings:d,types:["@container","@import","@keyframes","@layer","@media","@property","@supports"]},dart:m({constants:["false","null","true"],keywords:["abstract","as","assert","async","await","break","case","catch","class","const","continue","covariant","default","deferred","do","else","enum","export","extends","extension","external","factory","final","finally","for","get","if","implements","import","in","is","late","library","mixin","new","on","operator","part","required","rethrow","return","sealed","set","show","static","super","switch","sync","this","throw","try","typedef","var","while","with","yield"],types:["bool","double","dynamic","int","List","Map","num","Object","Set","String","void"]}),diff:{lineComments:["diff ","index ","--- ","+++ "],strings:[]},dockerfile:g({caseInsensitive:!0,keywords:["add","arg","cmd","copy","entrypoint","env","expose","from","healthcheck","label","run","shell","stopsignal","user","volume","workdir"]}),erlang:{constants:["false","true","undefined"],functionCalls:!0,keywords:["after","begin","case","catch","cond","end","fun","if","let","of","receive","try","when"],lineComments:["%"],strings:d},fortran:{caseInsensitive:!0,keywords:["allocate","call","contains","do","else","end","function","if","implicit","module","program","return","subroutine","then","use","while"],lineComments:["!"],strings:d,types:["character","complex","integer","logical","real"]},go:m({builtins:["append","cap","copy","delete","len","make","new","panic","recover"],constants:["false","iota","nil","true"],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"],strings:[...d,{multiline:!0,open:"`"}],types:["bool","byte","complex128","complex64","error","float32","float64","int","int16","int32","int64","int8","rune","string","uint","uint16","uint32","uint64","uint8","uintptr"]}),graphql:g({keywords:["directive","enum","extend","fragment","implements","input","interface","mutation","on","query","scalar","schema","subscription","type","union"],types:["Boolean","Float","ID","Int","String"]}),groovy:m({constants:["false","null","true"],keywords:["abstract","as","assert","break","case","catch","class","const","continue","def","default","do","else","enum","extends","final","finally","for","if","implements","import","in","instanceof","interface","new","package","private","protected","public","return","static","super","switch","this","throw","throws","trait","try","while"],types:["BigDecimal","Boolean","Integer","List","Map","String","boolean","double","int","long","void"]}),haskell:{blockComments:[["{-","-}"]],constants:["False","Nothing","True"],functionCalls:!0,keywords:["case","class","data","deriving","do","else","if","import","in","infixl","infixr","instance","let","module","newtype","of","then","type","where"],lineComments:["--"],strings:[{escape:"\\",open:'"'}],types:["Bool","Char","Double","Either","Int","Integer","IO","Maybe","String"]},html:v,java:m({constants:["false","null","true"],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","record","return","sealed","static","strictfp","super","switch","synchronized","this","throw","throws","transient","try","var","volatile","while","yield"],types:["Boolean","Double","Integer","List","Long","Map","Object","String","boolean","byte","char","double","float","int","long","short","void"]}),javascript:h,json:{constants:["false","null","true"],strings:[{escape:"\\",open:'"'}]},jsx:h,julia:g({blockComments:[["#=","=#"]],constants:["false","nothing","true"],keywords:["abstract","baremodule","begin","break","catch","const","continue","do","else","elseif","end","export","finally","for","function","global","if","import","let","local","macro","module","mutable","primitive","quote","return","struct","try","using","while"],types:["Array","Bool","Char","Dict","Float64","Int","Int64","String"]}),kotlin:m({constants:["false","null","true"],keywords:["as","break","by","class","companion","const","constructor","continue","crossinline","data","do","else","enum","external","final","finally","for","fun","get","if","import","in","infix","init","inline","interface","internal","is","lateinit","object","open","operator","out","override","package","private","protected","public","reified","return","sealed","set","super","suspend","this","throw","try","typealias","val","var","vararg","when","while"],strings:[{escape:"\\",multiline:!0,open:'"""'},...d],types:["Any","Array","Boolean","Char","Double","Float","Int","List","Long","Map","Nothing","Set","String","Unit"]}),lua:{blockComments:[["--[[","]]"]],constants:["false","nil","true"],functionCalls:!0,keywords:["and","break","do","else","elseif","end","for","function","goto","if","in","local","not","or","repeat","return","then","until","while"],lineComments:["--"],strings:[{close:"]]",multiline:!0,open:"[["},...d]},markdown:{lineComments:[],strings:[{open:"`"}]},nginx:g({keywords:["access_log","error_log","events","http","include","index","listen","location","proxy_pass","return","root","server","server_name","ssl_certificate","upstream"]}),objectivec:m({constants:["NO","YES","nil"],identifierExtra:"@",keywords:["@class","@end","@implementation","@interface","@property","@protocol","@selector","@synthesize","break","case","const","continue","default","do","else","enum","extern","for","if","return","sizeof","static","struct","switch","typedef","union","void","while"],types:["BOOL","CGFloat","NSArray","NSDictionary","NSInteger","NSObject","NSString","char","double","float","id","int","long","short"]}),pascal:{blockComments:[["{","}"],["(*","*)"]],caseInsensitive:!0,constants:["false","nil","true"],functionCalls:!0,keywords:["and","array","begin","case","const","div","do","downto","else","end","for","function","goto","if","implementation","interface","mod","not","of","or","procedure","program","record","repeat","then","to","type","unit","until","uses","var","while","with"],lineComments:["//"],strings:[{open:"'"}],types:["boolean","byte","char","integer","real","string"]},perl:g({constants:["undef"],identifierExtra:"$@%",keywords:["do","else","elsif","foreach","for","if","last","local","my","next","our","package","return","sub","unless","until","use","while"]}),php:m({constants:["false","null","true"],identifierExtra:"$",keywords:["abstract","as","break","case","catch","class","clone","const","continue","declare","default","do","echo","else","elseif","enum","extends","final","finally","fn","for","foreach","function","global","if","implements","include","instanceof","interface","match","namespace","new","print","private","protected","public","readonly","require","return","static","switch","throw","trait","try","use","var","while","yield"],lineComments:["//","#"],types:["array","bool","callable","float","int","iterable","mixed","object","string","void"]}),plaintext:{},powershell:g({blockComments:[["<#","#>"]],caseInsensitive:!0,constants:["$false","$null","$true"],identifierExtra:"$-",keywords:["begin","break","catch","continue","do","else","elseif","end","finally","for","foreach","function","if","in","param","process","return","switch","throw","try","until","while"]}),protobuf:m({constants:["false","true"],keywords:["enum","extend","import","map","message","oneof","option","optional","package","repeated","required","reserved","returns","rpc","service","syntax"],types:["bool","bytes","double","fixed32","fixed64","float","int32","int64","sint32","sint64","string","uint32","uint64"]}),python:k,r:g({constants:["FALSE","Inf","NA","NULL","NaN","TRUE"],identifierExtra:".",keywords:["break","else","for","function","if","in","next","repeat","return","while"],types:["character","data.frame","factor","integer","list","logical","matrix","numeric","vector"]}),ruby:g({blockComments:[["=begin","=end"]],constants:["false","nil","true"],identifierExtra:"?!@$",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"],types:["Array","Float","Hash","Integer","String","Symbol"]}),rust:m({constants:["false","None","Some","true"],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","static","struct","super","trait","type","unsafe","use","where","while"],types:["String","Vec","bool","char","f32","f64","i128","i16","i32","i64","i8","isize","str","u128","u16","u32","u64","u8","usize"]}),scala:m({constants:["false","null","true"],keywords:["abstract","case","catch","class","def","do","else","extends","final","finally","for","given","if","implicit","import","lazy","match","new","object","override","package","private","protected","return","sealed","super","this","throw","trait","try","type","val","var","while","with","yield"],types:["Any","Boolean","Double","Float","Int","List","Long","Map","Option","Seq","String","Unit"]}),scheme:{constants:["#f","#t"],identifierExtra:"-*?!<>=/",keywords:["begin","cond","define","do","else","if","lambda","let","let*","letrec","quote","set!"],lineComments:[";"],strings:[{escape:"\\",open:'"'}]},shell:g({builtins:["cd","echo","exit","export","printf","read","source"],identifierExtra:"$",keywords:["case","do","done","elif","else","esac","fi","for","function","if","in","return","then","until","while"],strings:[{escape:"\\",multiline:!0,open:'"'},{multiline:!0,open:"'"}]}),sql:{blockComments:[["/*","*/"]],caseInsensitive:!0,constants:["false","true"],functionCalls:!0,keywords:["add","all","alter","and","as","asc","begin","between","by","case","cast","column","commit","create","cross","delete","desc","distinct","drop","else","end","exists","from","full","group","having","in","index","inner","insert","into","is","join","left","like","limit","not","null","offset","on","or","order","outer","primary","references","returning","right","rollback","select","set","table","then","union","unique","update","values","view","when","where","with"],lineComments:["--"],strings:[{open:"'"},{open:'"'}],types:["bigint","boolean","bytea","date","decimal","integer","jsonb","numeric","serial","text","timestamp","uuid","varchar"]},swift:m({constants:["false","nil","true"],keywords:["actor","as","associatedtype","async","await","break","case","catch","class","continue","default","defer","deinit","do","else","enum","extension","fallthrough","fileprivate","final","for","func","guard","if","import","in","init","inout","internal","is","lazy","let","mutating","open","operator","private","protocol","public","repeat","return","self","static","struct","subscript","super","switch","throw","throws","try","typealias","var","where","while"],types:["Any","Array","Bool","Character","Dictionary","Double","Float","Int","Optional","Set","String","UInt","Void"]}),toml:g({constants:["false","true"],functionCalls:!1}),tsx:w,typescript:w,vb:{caseInsensitive:!0,constants:["False","Nothing","True"],functionCalls:!0,keywords:["as","byval","case","catch","class","dim","do","each","else","elseif","end","finally","for","function","if","imports","in","loop","module","namespace","new","next","private","public","return","select","set","sub","then","throw","try","while"],lineComments:["'"],strings:[{open:'"'}],types:["Boolean","Date","Double","Integer","Long","Object","String"]},verilog:m({keywords:["always","assign","begin","case","else","end","endcase","endmodule","for","if","initial","input","module","output","parameter","posedge","negedge"],types:["integer","logic","reg","wire"]}),vhdl:{caseInsensitive:!0,constants:["false","true"],functionCalls:!0,keywords:["architecture","begin","case","component","else","elsif","end","entity","for","function","if","is","library","loop","of","port","process","signal","then","use","when","while"],lineComments:["--"],strings:[{open:'"'}],types:["bit","boolean","integer","natural","std_logic","std_logic_vector"]},xml:v,yaml:g({constants:["false","no","null","true","yes"],functionCalls:!1})},C=(e,t)=>((e,t)=>{if(0===e.length)return[];if(!a(t))return[{classes:"",text:e}];const n=[],d=l(t.keywords,t.caseInsensitive),p=l(t.types,t.caseInsensitive),m=l(t.constants,t.caseInsensitive),g=l(t.builtins,t.caseInsensitive),y=e=>o(e)||s(e)||(t.identifierExtra?.includes(e)??!1);let b=0,h="";const w=()=>{0!==h.length&&(n.push({classes:"",text:h}),h="")},k=(e,t)=>{w(),n.push({classes:t,text:e})};for(;b<e.length;){const n=e.slice(b),a=e[b],l=(t.blockComments??[]).find(([e])=>n.startsWith(e));if(l){const[t,n]=l,s=e.indexOf(n,b+t.length),r=-1===s?e.length:s+n.length;k(e.slice(b,r),i.comment),b=r;continue}if(void 0!==(t.lineComments??[]).find(e=>n.startsWith(e))){const t=e.indexOf("\n",b),n=-1===t?e.length:t;k(e.slice(b,n),i.comment),b=n;continue}const w=(t.strings??[]).find(e=>n.startsWith(e.open));if(w){const t=u(e,b,w);k(e.slice(b,t),i.string),b=t;continue}if(s(a)&&!(b>0&&y(e[b-1]))){const t=f(e,b);k(e.slice(b,t),i.number),b=t;continue}if(o(a)||t.identifierExtra?.includes(a)){let n=b+1;for(;n<e.length&&y(e[n]);)n++;const s=e.slice(b,n),r=t.caseInsensitive?s.toLowerCase():s;d.has(r)?k(s,i.keyword):p.has(r)?k(s,i.type):m.has(r)?k(s,i.number):g.has(r)||t.functionCalls&&"("===c(e,n)?k(s,i.function):h+=s,b=n;continue}r(a)?(h+=a,b++):(k(a,i.punctuation),b++)}return w(),n})(e,x[t]??{});export{e as a,n as i,x as n,t as r,C as t};
|
|
2
|
+
//# sourceMappingURL=highlight-C4NcTcIm.mjs.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
var e=()=>({background:"var(--clepit-code-bg)",comment:"var(--clepit-code-comment)",function:"var(--clepit-code-function)",gutter:"var(--clepit-code-gutter)",keyword:"var(--clepit-code-keyword)",number:"var(--clepit-code-number)",punctuation:"var(--clepit-code-punctuation)",selection:"var(--clepit-code-selection-bg)",string:"var(--clepit-code-string)",text:"var(--clepit-code-text)",type:"var(--clepit-code-type)"}),t={dark:{background:"#1c2128",comment:"rgba(240, 246, 252, 0.42)",function:"#d2a8ff",gutter:"rgba(240, 246, 252, 0.42)",keyword:"#ff7b72",number:"#79c0ff",punctuation:"rgba(240, 246, 252, 0.62)",selection:"rgba(124, 124, 255, 0.24)",string:"#7ee787",text:"rgba(240, 246, 252, 0.92)",type:"#ffa657"},dracula:{background:"#282a36",comment:"#6272a4",function:"#50fa7b",gutter:"#6272a4",keyword:"#ff79c6",number:"#bd93f9",punctuation:"#f8f8f2",selection:"rgba(68, 71, 90, 0.8)",string:"#f1fa8c",text:"#f8f8f2",type:"#8be9fd"},github:{background:"#ffffff",comment:"#6e7781",function:"#8250df",gutter:"#8c959f",keyword:"#cf222e",number:"#0550ae",punctuation:"#24292f",selection:"rgba(84, 174, 255, 0.24)",string:"#0a3069",text:"#24292f",type:"#953800"},"github-dark":{background:"#0d1117",comment:"#8b949e",function:"#d2a8ff",gutter:"#6e7681",keyword:"#ff7b72",number:"#79c0ff",punctuation:"#c9d1d9",selection:"rgba(56, 139, 253, 0.24)",string:"#a5d6ff",text:"#c9d1d9",type:"#ffa657"},light:{background:"#fdfdfd",comment:"#868f9c",function:"#6f42c1",gutter:"#868f9c",keyword:"#cf222e",number:"#0550ae",punctuation:"#525866",selection:"rgba(91, 91, 255, 0.14)",string:"#0a7c3e",text:"#0a0a0a",type:"#953800"},monokai:{background:"#272822",comment:"#75715e",function:"#a6e22e",gutter:"#75715e",keyword:"#f92672",number:"#ae81ff",punctuation:"#f8f8f2",selection:"rgba(73, 72, 62, 0.9)",string:"#e6db74",text:"#f8f8f2",type:"#66d9ef"},solarized:{background:"#fdf6e3",comment:"#93a1a1",function:"#268bd2",gutter:"#93a1a1",keyword:"#859900",number:"#d33682",punctuation:"#657b83",selection:"rgba(238, 232, 213, 0.9)",string:"#2aa198",text:"#657b83",type:"#b58900"},"solarized-dark":{background:"#002b36",comment:"#586e75",function:"#268bd2",gutter:"#586e75",keyword:"#859900",number:"#d33682",punctuation:"#839496",selection:"rgba(7, 54, 66, 0.9)",string:"#2aa198",text:"#839496",type:"#b58900"},tomorrow:{background:"#fafafa",comment:"#8e908c",function:"#4271ae",gutter:"#8e908c",keyword:"#8959a8",number:"#f5871f",punctuation:"#4d4d4c",selection:"rgba(214, 214, 214, 0.9)",string:"#718c00",text:"#4d4d4c",type:"#c82829"}},n=["keyword","string","number","comment","function","type","punctuation","text"],i=Object.fromEntries(n.map(e=>[e,`clepit-code-${e}`])),r=e=>e>="0"&&e<="9",s=e=>" "===e||"\t"===e||"\n"===e||"\r"===e||"\f"===e||"\v"===e,o=e=>e>="a"&&e<="z"||e>="A"&&e<="Z"||"_"===e||e.charCodeAt(0)>127,a=e=>(e.lineComments?.length??0)>0||(e.blockComments?.length??0)>0||(e.strings?.length??0)>0||(e.keywords?.length??0)>0||(e.types?.length??0)>0||(e.constants?.length??0)>0||(e.builtins?.length??0)>0,l=(e,t)=>new Set((e??[]).map(e=>t?e.toLowerCase():e)),c=(e,t)=>{let n=t;for(;n<e.length&&(" "===e[n]||"\t"===e[n]);)n++;return e[n]??""},u=(e,t,n)=>{const i=n.close??n.open;let r=t+n.open.length;for(;r<e.length;)if(n.escape&&e[r]===n.escape)r+=2;else{if(!n.multiline&&"\n"===e[r])return r;if(e.startsWith(i,r))return r+i.length;r++}return e.length},f=(e,t)=>{let n=t;if("0"===e[n]&&/[xXbBoO]/.test(e[n+1]??"")){for(n+=2;n<e.length&&/[0-9a-fA-F_]/.test(e[n]);)n++;return n}for(;n<e.length&&/[0-9_]/.test(e[n]);)n++;if("."===e[n]&&r(e[n+1]??""))for(n++;n<e.length&&/[0-9_]/.test(e[n]);)n++;if(/[eE]/.test(e[n]??"")&&(r(e[n+1]??"")||/[+-]/.test(e[n+1]??"")&&r(e[n+2]??"")))for(n+=2;n<e.length&&r(e[n]);)n++;for(;n<e.length&&o(e[n])&&!r(e[n])&&/[a-zA-Z]/.test(e[n])&&n-t<32&&/[nlLfFdDuUmM]/.test(e[n]);)n++;return n},d=[{escape:"\\",open:'"'},{escape:"\\",open:"'"}],p={blockComments:[["/*","*/"]],lineComments:["//"]},m=e=>({...p,functionCalls:!0,strings:d,...e}),g=e=>({functionCalls:!0,lineComments:["#"],strings:d,...e}),y=["as","async","await","break","case","catch","class","const","continue","debugger","default","delete","do","else","export","extends","finally","for","from","function","get","if","import","in","instanceof","let","new","of","return","set","static","super","switch","this","throw","try","typeof","var","void","while","with","yield"],b=[...y,"abstract","declare","enum","implements","infer","interface","is","keyof","namespace","override","private","protected","public","readonly","satisfies","type"],h=m({constants:["false","null","true","undefined","NaN","Infinity"],identifierExtra:"$",keywords:y,strings:[...d,{escape:"\\",multiline:!0,open:"`"}],types:["Array","Boolean","Date","Error","Map","Number","Object","Promise","RegExp","Set","String","Symbol"]}),w={...h,keywords:b,types:[...h.types??[],"any","bigint","boolean","never","number","object","string","symbol","unknown","void"]},k=g({constants:["False","None","True"],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"],strings:[{escape:"\\",multiline:!0,open:'"""'},{escape:"\\",multiline:!0,open:"'''"},...d],types:["bool","bytes","dict","float","frozenset","int","list","set","str","tuple"]}),v={blockComments:[["\x3c!--","--\x3e"]],strings:d,types:[]},x={assembly:{constants:[],keywords:["add","call","cmp","jmp","jne","je","lea","mov","pop","push","ret","sub","xor"],lineComments:[";","#"],strings:d,types:["byte","dword","qword","word"]},bash:g({builtins:["cd","echo","exit","export","printf","read","source"],constants:["false","true"],identifierExtra:"$",keywords:["case","do","done","elif","else","esac","fi","for","function","if","in","local","return","select","then","until","while"],strings:[{escape:"\\",multiline:!0,open:'"'},{multiline:!0,open:"'"}]}),clojure:{constants:["false","nil","true"],identifierExtra:"-*?!<>=/",keywords:["def","defmacro","defn","do","fn","if","let","loop","ns","quote","recur","require","var","when"],lineComments:[";"],strings:[{escape:"\\",multiline:!0,open:'"'}]},cobol:{caseInsensitive:!0,keywords:["accept","add","call","compute","display","division","else","end","goback","identification","if","move","perform","procedure","program-id","section","stop","to","until","working-storage"],lineComments:["*"],strings:d,types:["pic","picture"]},cpp:m({constants:["false","nullptr","true"],keywords:["auto","break","case","catch","class","const","constexpr","continue","default","delete","do","else","enum","explicit","export","extern","for","friend","goto","if","inline","mutable","namespace","new","noexcept","operator","private","protected","public","return","sizeof","static","struct","switch","template","this","throw","try","typedef","typename","union","using","virtual","volatile","while"],types:["bool","char","double","float","int","long","short","signed","size_t","unsigned","void","wchar_t"]}),csharp:m({constants:["false","null","true"],keywords:["abstract","as","async","await","base","break","case","catch","class","const","continue","default","delegate","do","else","enum","event","explicit","extern","finally","fixed","for","foreach","get","goto","if","implicit","in","interface","internal","is","lock","namespace","new","operator","out","override","params","private","protected","public","readonly","record","ref","return","sealed","set","sizeof","stackalloc","static","struct","switch","this","throw","try","typeof","unsafe","using","var","virtual","void","while","yield"],types:["bool","byte","char","decimal","double","float","int","long","object","sbyte","short","string","uint","ulong","ushort"]}),css:{blockComments:[["/*","*/"]],functionCalls:!0,keywords:["and","from","important","not","only","to"],strings:d,types:["@container","@import","@keyframes","@layer","@media","@property","@supports"]},dart:m({constants:["false","null","true"],keywords:["abstract","as","assert","async","await","break","case","catch","class","const","continue","covariant","default","deferred","do","else","enum","export","extends","extension","external","factory","final","finally","for","get","if","implements","import","in","is","late","library","mixin","new","on","operator","part","required","rethrow","return","sealed","set","show","static","super","switch","sync","this","throw","try","typedef","var","while","with","yield"],types:["bool","double","dynamic","int","List","Map","num","Object","Set","String","void"]}),diff:{lineComments:["diff ","index ","--- ","+++ "],strings:[]},dockerfile:g({caseInsensitive:!0,keywords:["add","arg","cmd","copy","entrypoint","env","expose","from","healthcheck","label","run","shell","stopsignal","user","volume","workdir"]}),erlang:{constants:["false","true","undefined"],functionCalls:!0,keywords:["after","begin","case","catch","cond","end","fun","if","let","of","receive","try","when"],lineComments:["%"],strings:d},fortran:{caseInsensitive:!0,keywords:["allocate","call","contains","do","else","end","function","if","implicit","module","program","return","subroutine","then","use","while"],lineComments:["!"],strings:d,types:["character","complex","integer","logical","real"]},go:m({builtins:["append","cap","copy","delete","len","make","new","panic","recover"],constants:["false","iota","nil","true"],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"],strings:[...d,{multiline:!0,open:"`"}],types:["bool","byte","complex128","complex64","error","float32","float64","int","int16","int32","int64","int8","rune","string","uint","uint16","uint32","uint64","uint8","uintptr"]}),graphql:g({keywords:["directive","enum","extend","fragment","implements","input","interface","mutation","on","query","scalar","schema","subscription","type","union"],types:["Boolean","Float","ID","Int","String"]}),groovy:m({constants:["false","null","true"],keywords:["abstract","as","assert","break","case","catch","class","const","continue","def","default","do","else","enum","extends","final","finally","for","if","implements","import","in","instanceof","interface","new","package","private","protected","public","return","static","super","switch","this","throw","throws","trait","try","while"],types:["BigDecimal","Boolean","Integer","List","Map","String","boolean","double","int","long","void"]}),haskell:{blockComments:[["{-","-}"]],constants:["False","Nothing","True"],functionCalls:!0,keywords:["case","class","data","deriving","do","else","if","import","in","infixl","infixr","instance","let","module","newtype","of","then","type","where"],lineComments:["--"],strings:[{escape:"\\",open:'"'}],types:["Bool","Char","Double","Either","Int","Integer","IO","Maybe","String"]},html:v,java:m({constants:["false","null","true"],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","record","return","sealed","static","strictfp","super","switch","synchronized","this","throw","throws","transient","try","var","volatile","while","yield"],types:["Boolean","Double","Integer","List","Long","Map","Object","String","boolean","byte","char","double","float","int","long","short","void"]}),javascript:h,json:{constants:["false","null","true"],strings:[{escape:"\\",open:'"'}]},jsx:h,julia:g({blockComments:[["#=","=#"]],constants:["false","nothing","true"],keywords:["abstract","baremodule","begin","break","catch","const","continue","do","else","elseif","end","export","finally","for","function","global","if","import","let","local","macro","module","mutable","primitive","quote","return","struct","try","using","while"],types:["Array","Bool","Char","Dict","Float64","Int","Int64","String"]}),kotlin:m({constants:["false","null","true"],keywords:["as","break","by","class","companion","const","constructor","continue","crossinline","data","do","else","enum","external","final","finally","for","fun","get","if","import","in","infix","init","inline","interface","internal","is","lateinit","object","open","operator","out","override","package","private","protected","public","reified","return","sealed","set","super","suspend","this","throw","try","typealias","val","var","vararg","when","while"],strings:[{escape:"\\",multiline:!0,open:'"""'},...d],types:["Any","Array","Boolean","Char","Double","Float","Int","List","Long","Map","Nothing","Set","String","Unit"]}),lua:{blockComments:[["--[[","]]"]],constants:["false","nil","true"],functionCalls:!0,keywords:["and","break","do","else","elseif","end","for","function","goto","if","in","local","not","or","repeat","return","then","until","while"],lineComments:["--"],strings:[{close:"]]",multiline:!0,open:"[["},...d]},markdown:{lineComments:[],strings:[{open:"`"}]},nginx:g({keywords:["access_log","error_log","events","http","include","index","listen","location","proxy_pass","return","root","server","server_name","ssl_certificate","upstream"]}),objectivec:m({constants:["NO","YES","nil"],identifierExtra:"@",keywords:["@class","@end","@implementation","@interface","@property","@protocol","@selector","@synthesize","break","case","const","continue","default","do","else","enum","extern","for","if","return","sizeof","static","struct","switch","typedef","union","void","while"],types:["BOOL","CGFloat","NSArray","NSDictionary","NSInteger","NSObject","NSString","char","double","float","id","int","long","short"]}),pascal:{blockComments:[["{","}"],["(*","*)"]],caseInsensitive:!0,constants:["false","nil","true"],functionCalls:!0,keywords:["and","array","begin","case","const","div","do","downto","else","end","for","function","goto","if","implementation","interface","mod","not","of","or","procedure","program","record","repeat","then","to","type","unit","until","uses","var","while","with"],lineComments:["//"],strings:[{open:"'"}],types:["boolean","byte","char","integer","real","string"]},perl:g({constants:["undef"],identifierExtra:"$@%",keywords:["do","else","elsif","foreach","for","if","last","local","my","next","our","package","return","sub","unless","until","use","while"]}),php:m({constants:["false","null","true"],identifierExtra:"$",keywords:["abstract","as","break","case","catch","class","clone","const","continue","declare","default","do","echo","else","elseif","enum","extends","final","finally","fn","for","foreach","function","global","if","implements","include","instanceof","interface","match","namespace","new","print","private","protected","public","readonly","require","return","static","switch","throw","trait","try","use","var","while","yield"],lineComments:["//","#"],types:["array","bool","callable","float","int","iterable","mixed","object","string","void"]}),plaintext:{},powershell:g({blockComments:[["<#","#>"]],caseInsensitive:!0,constants:["$false","$null","$true"],identifierExtra:"$-",keywords:["begin","break","catch","continue","do","else","elseif","end","finally","for","foreach","function","if","in","param","process","return","switch","throw","try","until","while"]}),protobuf:m({constants:["false","true"],keywords:["enum","extend","import","map","message","oneof","option","optional","package","repeated","required","reserved","returns","rpc","service","syntax"],types:["bool","bytes","double","fixed32","fixed64","float","int32","int64","sint32","sint64","string","uint32","uint64"]}),python:k,r:g({constants:["FALSE","Inf","NA","NULL","NaN","TRUE"],identifierExtra:".",keywords:["break","else","for","function","if","in","next","repeat","return","while"],types:["character","data.frame","factor","integer","list","logical","matrix","numeric","vector"]}),ruby:g({blockComments:[["=begin","=end"]],constants:["false","nil","true"],identifierExtra:"?!@$",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"],types:["Array","Float","Hash","Integer","String","Symbol"]}),rust:m({constants:["false","None","Some","true"],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","static","struct","super","trait","type","unsafe","use","where","while"],types:["String","Vec","bool","char","f32","f64","i128","i16","i32","i64","i8","isize","str","u128","u16","u32","u64","u8","usize"]}),scala:m({constants:["false","null","true"],keywords:["abstract","case","catch","class","def","do","else","extends","final","finally","for","given","if","implicit","import","lazy","match","new","object","override","package","private","protected","return","sealed","super","this","throw","trait","try","type","val","var","while","with","yield"],types:["Any","Boolean","Double","Float","Int","List","Long","Map","Option","Seq","String","Unit"]}),scheme:{constants:["#f","#t"],identifierExtra:"-*?!<>=/",keywords:["begin","cond","define","do","else","if","lambda","let","let*","letrec","quote","set!"],lineComments:[";"],strings:[{escape:"\\",open:'"'}]},shell:g({builtins:["cd","echo","exit","export","printf","read","source"],identifierExtra:"$",keywords:["case","do","done","elif","else","esac","fi","for","function","if","in","return","then","until","while"],strings:[{escape:"\\",multiline:!0,open:'"'},{multiline:!0,open:"'"}]}),sql:{blockComments:[["/*","*/"]],caseInsensitive:!0,constants:["false","true"],functionCalls:!0,keywords:["add","all","alter","and","as","asc","begin","between","by","case","cast","column","commit","create","cross","delete","desc","distinct","drop","else","end","exists","from","full","group","having","in","index","inner","insert","into","is","join","left","like","limit","not","null","offset","on","or","order","outer","primary","references","returning","right","rollback","select","set","table","then","union","unique","update","values","view","when","where","with"],lineComments:["--"],strings:[{open:"'"},{open:'"'}],types:["bigint","boolean","bytea","date","decimal","integer","jsonb","numeric","serial","text","timestamp","uuid","varchar"]},swift:m({constants:["false","nil","true"],keywords:["actor","as","associatedtype","async","await","break","case","catch","class","continue","default","defer","deinit","do","else","enum","extension","fallthrough","fileprivate","final","for","func","guard","if","import","in","init","inout","internal","is","lazy","let","mutating","open","operator","private","protocol","public","repeat","return","self","static","struct","subscript","super","switch","throw","throws","try","typealias","var","where","while"],types:["Any","Array","Bool","Character","Dictionary","Double","Float","Int","Optional","Set","String","UInt","Void"]}),toml:g({constants:["false","true"],functionCalls:!1}),tsx:w,typescript:w,vb:{caseInsensitive:!0,constants:["False","Nothing","True"],functionCalls:!0,keywords:["as","byval","case","catch","class","dim","do","each","else","elseif","end","finally","for","function","if","imports","in","loop","module","namespace","new","next","private","public","return","select","set","sub","then","throw","try","while"],lineComments:["'"],strings:[{open:'"'}],types:["Boolean","Date","Double","Integer","Long","Object","String"]},verilog:m({keywords:["always","assign","begin","case","else","end","endcase","endmodule","for","if","initial","input","module","output","parameter","posedge","negedge"],types:["integer","logic","reg","wire"]}),vhdl:{caseInsensitive:!0,constants:["false","true"],functionCalls:!0,keywords:["architecture","begin","case","component","else","elsif","end","entity","for","function","if","is","library","loop","of","port","process","signal","then","use","when","while"],lineComments:["--"],strings:[{open:'"'}],types:["bit","boolean","integer","natural","std_logic","std_logic_vector"]},xml:v,yaml:g({constants:["false","no","null","true","yes"],functionCalls:!1})},C=(e,t)=>((e,t)=>{if(0===e.length)return[];if(!a(t))return[{classes:"",text:e}];const n=[],d=l(t.keywords,t.caseInsensitive),p=l(t.types,t.caseInsensitive),m=l(t.constants,t.caseInsensitive),g=l(t.builtins,t.caseInsensitive),y=e=>o(e)||r(e)||(t.identifierExtra?.includes(e)??!1);let b=0,h="";const w=()=>{0!==h.length&&(n.push({classes:"",text:h}),h="")},k=(e,t)=>{w(),n.push({classes:t,text:e})};for(;b<e.length;){const n=e.slice(b),a=e[b],l=(t.blockComments??[]).find(([e])=>n.startsWith(e));if(l){const[t,n]=l,r=e.indexOf(n,b+t.length),s=-1===r?e.length:r+n.length;k(e.slice(b,s),i.comment),b=s;continue}if(void 0!==(t.lineComments??[]).find(e=>n.startsWith(e))){const t=e.indexOf("\n",b),n=-1===t?e.length:t;k(e.slice(b,n),i.comment),b=n;continue}const w=(t.strings??[]).find(e=>n.startsWith(e.open));if(w){const t=u(e,b,w);k(e.slice(b,t),i.string),b=t;continue}if(r(a)&&!(b>0&&y(e[b-1]))){const t=f(e,b);k(e.slice(b,t),i.number),b=t;continue}if(o(a)||t.identifierExtra?.includes(a)){let n=b+1;for(;n<e.length&&y(e[n]);)n++;const r=e.slice(b,n),s=t.caseInsensitive?r.toLowerCase():r;d.has(s)?k(r,i.keyword):p.has(s)?k(r,i.type):m.has(s)?k(r,i.number):g.has(s)||t.functionCalls&&"("===c(e,n)?k(r,i.function):h+=r,b=n;continue}s(a)?(h+=a,b++):(k(a,i.punctuation),b++)}return w(),n})(e,x[t]??{});Object.defineProperty(exports,"CODE_THEME_TOKENS",{enumerable:!0,get:function(){return t}}),Object.defineProperty(exports,"CODE_TOKEN_GROUPS",{enumerable:!0,get:function(){return n}}),Object.defineProperty(exports,"GRAMMARS",{enumerable:!0,get:function(){return x}}),Object.defineProperty(exports,"resolveAutoTokens",{enumerable:!0,get:function(){return e}}),Object.defineProperty(exports,"tokenizeCode",{enumerable:!0,get:function(){return C}});
|
|
2
|
+
//# sourceMappingURL=highlight-eQD0I7eW.js.map
|