@shell-shock/unified 0.2.8 → 0.2.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (42) hide show
  1. package/dist/html/index.cjs +1 -1
  2. package/dist/html/index.d.cts +1 -1
  3. package/dist/html/index.d.cts.map +1 -1
  4. package/dist/html/index.d.mts +1 -1
  5. package/dist/html/index.d.mts.map +1 -1
  6. package/dist/html/index.mjs +1 -1
  7. package/dist/{html-D9T_CMzR.cjs → html-CVnH92tJ.cjs} +3 -5
  8. package/dist/html-CVnH92tJ.cjs.map +1 -0
  9. package/dist/{html-C6megiVP.mjs → html-Do2f44ft.mjs} +2 -4
  10. package/dist/html-Do2f44ft.mjs.map +1 -0
  11. package/dist/index.cjs +1 -2
  12. package/dist/index.d.cts +2 -10
  13. package/dist/index.d.mts +2 -10
  14. package/dist/index.mjs +1 -2
  15. package/dist/markdown/index.cjs +1 -1
  16. package/dist/markdown/index.d.cts +1 -1
  17. package/dist/markdown/index.d.cts.map +1 -1
  18. package/dist/markdown/index.d.mts +1 -1
  19. package/dist/markdown/index.d.mts.map +1 -1
  20. package/dist/markdown/index.mjs +1 -1
  21. package/dist/{markdown-B1ZkR96l.mjs → markdown-CMEWV1ow.mjs} +2 -2
  22. package/dist/markdown-CMEWV1ow.mjs.map +1 -0
  23. package/dist/markdown-DzvIMrFk.cjs +2 -0
  24. package/dist/markdown-DzvIMrFk.cjs.map +1 -0
  25. package/dist/types-By1HgC_t.d.cts +50 -0
  26. package/dist/types-By1HgC_t.d.cts.map +1 -0
  27. package/dist/types-By1HgC_t.d.mts +50 -0
  28. package/dist/types-By1HgC_t.d.mts.map +1 -0
  29. package/package.json +18 -51
  30. package/dist/html-C6megiVP.mjs.map +0 -1
  31. package/dist/html-D9T_CMzR.cjs.map +0 -1
  32. package/dist/index.cjs.map +0 -1
  33. package/dist/index.d.cts.map +0 -1
  34. package/dist/index.d.mts.map +0 -1
  35. package/dist/index.mjs.map +0 -1
  36. package/dist/markdown-B1ZkR96l.mjs.map +0 -1
  37. package/dist/markdown-CmguN8DF.cjs +0 -2
  38. package/dist/markdown-CmguN8DF.cjs.map +0 -1
  39. package/dist/types-CCFWBb06.d.mts +0 -90
  40. package/dist/types-CCFWBb06.d.mts.map +0 -1
  41. package/dist/types-J2htKY4q.d.cts +0 -90
  42. package/dist/types-J2htKY4q.d.cts.map +0 -1
@@ -1 +1 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`../html-D9T_CMzR.cjs`);exports.renderHtml=e.t;
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../html-CVnH92tJ.cjs");exports.renderHtml=e.t;
@@ -1,4 +1,4 @@
1
- import { t as Options } from "../types-J2htKY4q.cjs";
1
+ import { r as Options } from "../types-By1HgC_t.cjs";
2
2
 
3
3
  //#region src/html/index.d.ts
4
4
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.cts","names":[],"sources":["../../src/html/index.ts"],"mappings":";;;;;AAiCA;;;;;iBAAgB,UAAA,CAAW,IAAA,UAAc,OAAA,GAAS,OAAA"}
1
+ {"version":3,"file":"index.d.cts","names":[],"sources":["../../src/html/index.ts"],"mappings":";;;;;AAiCA;;;;;iBAAgB,UAAA,CAAW,IAAA,UAAc,OAAA,GAAS,OAAY"}
@@ -1,4 +1,4 @@
1
- import { t as Options } from "../types-CCFWBb06.mjs";
1
+ import { r as Options } from "../types-By1HgC_t.mjs";
2
2
 
3
3
  //#region src/html/index.d.ts
4
4
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.mts","names":[],"sources":["../../src/html/index.ts"],"mappings":";;;;;AAiCA;;;;;iBAAgB,UAAA,CAAW,IAAA,UAAc,OAAA,GAAS,OAAA"}
1
+ {"version":3,"file":"index.d.mts","names":[],"sources":["../../src/html/index.ts"],"mappings":""}
@@ -1 +1 @@
1
- import{t as e}from"../html-C6megiVP.mjs";export{e as renderHtml};
1
+ import{t as e}from"../html-Do2f44ft.mjs";export{e as renderHtml};
@@ -1,4 +1,4 @@
1
- var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},s=(n,r,a)=>(a=n==null?{}:e(i(n)),o(r||!n||!n.__esModule?t(a,`default`,{value:n,enumerable:!0}):a,n));let c=require(`@stryke/type-checks`),l=require(`@stryke/type-checks/is-set-object`),u=require(`@stryke/type-checks/is-set-string`),d=require(`parse5`),f=require(`he`);f=s(f,1);let p=require(`normalize-html-whitespace`);p=s(p,1);let m=require(`wrap-ansi`);m=s(m,1);let ee=require(`@stryke/type-checks/is-string`),te=require(`@shell-shock/plugin-theme/helpers/constants`);const ne=e=>({pre:!1,lineWidth:120,fontAttrs:!0,depth:0,asciiMode:!1,...e}),h=e=>{if(e==null)return 0;let t=Number(e);return Number.isFinite(t)?t:0},g=(e,t)=>{if(!e&&!t)return null;if(!e)return t;if(!t)return e;let n=h(e.marginTop),r=h(e.marginBottom),i=h(t.marginTop),a=h(t.marginBottom);if(!t.value)return{marginTop:n,value:e.value,marginBottom:Math.max(r,i,a)};if(!e.value)return{marginTop:Math.max(n,r,i),value:t.value,marginBottom:a};let o=Math.max(r,i);return{marginTop:n,value:`${e.value}${`
1
+ var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},s=(n,r,a)=>(a=n==null?{}:e(i(n)),o(r||!n||!n.__esModule?t(a,`default`,{value:n,enumerable:!0}):a,n));let c=require("@stryke/type-checks"),l=require("@stryke/type-checks/is-set-object"),u=require("@stryke/type-checks/is-set-string"),d=require("parse5"),f=require("he");f=s(f,1);let p=require("normalize-html-whitespace");p=s(p,1);let m=require("wrap-ansi");m=s(m,1);let ee=require("@stryke/type-checks/is-string"),te=require("@shell-shock/plugin-theme/helpers/constants");const ne=e=>({pre:!1,lineWidth:120,fontAttrs:!0,depth:0,asciiMode:!1,...e}),h=e=>{if(e==null)return 0;let t=Number(e);return Number.isFinite(t)?t:0},g=(e,t)=>{if(!e&&!t)return null;if(!e)return t;if(!t)return e;let n=h(e.marginTop),r=h(e.marginBottom),i=h(t.marginTop),a=h(t.marginBottom);if(!t.value)return{marginTop:n,value:e.value,marginBottom:Math.max(r,i,a)};if(!e.value)return{marginTop:Math.max(n,r,i),value:t.value,marginBottom:a};let o=Math.max(r,i);return{marginTop:n,value:`${e.value}${`
2
2
  `.repeat(o)}${t.value}`,marginBottom:a}},_=(e,t)=>e==null&&t==null?null:e==null?t:t==null?e:t.value==null?{pre:e.pre,value:e.value,post:e.post??t.pre??t.post??``,type:`inline`,nodeName:e.nodeName}:e.value==null?{pre:e.pre??e.post??t.pre??``,value:t.value,post:t.post,type:`inline`,nodeName:t.nodeName}:e.post==null?t.pre==null?{pre:e.pre,value:`${e.value}${t.value}`,post:t.post,type:`inline`,nodeName:t.nodeName}:{pre:e.pre,value:`${e.value}${t.pre}${t.value}`,post:t.post,type:`inline`,nodeName:t.nodeName}:{pre:e.pre,value:`${e.value}${e.post}${t.value}`,post:t.post,type:`inline`,nodeName:t.nodeName},v=new WeakMap,y=(e,t,n=null)=>{if(!e||typeof e!=`object`||!t||typeof t!=`string`)return n;let r=v.get(e);if(r){let e=r.get(t);if(e!==void 0)return e??n}if(!e.attrs||!Array.isArray(e.attrs)||e.attrs.length===0)return r||(r=new Map,v.set(e,r)),r.set(t,null),n;let i=e.attrs.find(e=>e&&typeof e==`object`&&e.name===t);if(r||(r=new Map,v.set(e,r)),!i||i.value===void 0)return r.set(t,null),n;let a=i.value;return r.set(t,a),a};function re(e){let t=y(e,`class`,null);return t?t.split(/\s+/).map(e=>e.trim()).filter(e=>e.length>0):[]}const b=(e,t)=>(0,m.default)(e,t.lineWidth??80,{trim:!t.pre}),ie=f.default.decode,ae=p.default,x=e=>e?{...e,marginTop:0,marginBottom:0,type:`block`,nodeName:`#blockTag`}:null,oe=(e,t)=>{let n=String(e.value??``);if(t.pre)return{pre:null,value:ie(n),post:null,type:`inline`,nodeName:`#text`};let r=[...(ae(n)||``).replaceAll(`
3
3
  `,` `)],i=[` `,`
4
4
  `].includes(r[0]??``)?r.shift()??null:null,a=[` `,`
@@ -10,7 +10,5 @@ var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=
10
10
  `)),i=n?`${r}\n${n}`.trim():r;return M(e.nodeName,`blockquote(${D(i)})`,1,1)}const R=e=>S(t=>`bold(textColors.heading.${e===1?`primary`:e===2?`secondary`:`tertiary`}(${D(t)}))`,{marginTop:1,marginBottom:1}),qe=R(1),Je=R(2),Ye=R(3),Xe=R(4),Ze=R(5),Qe=R(6);function $e(e,t){return M(e.nodeName,`divider({ border: "primary" })`,1,1)}function et(e,t){let n=y(e,`alt`,null),r=y(e,`src`,null),i=n||r?`[Image: ${n||r}]`:`[Image]`;return j(e.nodeName,E(i))}function tt(e,t){let n=(y(e,`type`,`text`)||`text`).toLowerCase(),r=y(e,`value`,``)||``,i=y(e,`placeholder`,``)||``,a=y(e,`checked`,null)!==null;if(n===`hidden`)return null;if(n===`checkbox`)return j(e.nodeName,E(a?`[x]`:`[ ]`));if(n===`radio`)return j(e.nodeName,E(a?`(o)`:`( )`));if([`submit`,`button`,`reset`].includes(n))return j(e.nodeName,`bold(${JSON.stringify(`[ ${r||n} ]`)})`);if(n===`range`){let t=Number.parseFloat(y(e,`max`,`100`)||`100`),n=Number.parseFloat(y(e,`value`,`0`)||`0`),r=N(n,t,10,`=`,`-`);return j(e.nodeName,E(`[${r}] ${Math.round(n)}/${Math.round(t)}`))}return j(e.nodeName,E(`[${r||i}]`))}const nt=C(e=>`bold(${JSON.stringify(`[ ${String(e??`button`)} ]`)})`),rt=C(e=>E(e)),it=S((e,t)=>{let n=Number.parseInt(y(t,`rows`,`0`)||`0`,10),r=k(t);return r&&(n>1||r.includes(`
11
11
  `))?ue(r):E(e)});function at(e){return(e.childNodes??[]).filter(e=>e.nodeName===`li`)}function z(e,t){let n=at(e).map((e,n)=>{let r=A(k(e));return`${t(n)} ${r}`.trimEnd()});return M(e.nodeName,E(n.join(`
12
12
  `)),1,1)}function B(e,t){let n=y(e,`type`,`disc`)||`disc`,r=n===`square`?`▪`:n===`circle`?`◦`:`•`;return z(e,()=>r)}function ot(e,t){let n=Number.parseInt(y(e,`start`,`1`)||`1`,10);return z(e,e=>`${n+e}.`)}function V(e,t){let n=A(k(e));return M(e.nodeName,E(n))}const st=C((e,t)=>{let n=re(t).find(e=>e.startsWith(`message-type-`))?.replace(`message-type-`,``);(!n||!te.THEME_MESSAGE_VARIANTS.includes(n))&&(n=`info`);let r=t.childNodes?.find(e=>e.type===`message-header`||e.type===`message-title`)?.value;return`${n}(${e?`\`${P(e)}\``:`''`}${r?`, \`${P(r)}\``:``})`});function ct(e,t){let n=Number.parseFloat(y(e,`min`,`0`)||`0`),r=Number.parseFloat(y(e,`max`,`1`)||`1`),i=Number.parseFloat(y(e,`value`,String(n))||String(n)),a=Math.max(0,i-n),o=Math.max(1,r-n),s=k(e).trim(),c=Math.round(a/o*100),l=N(a,o,10,`#`,`-`);return j(e.nodeName,E(`${s?`${s} `:``}[${l}] ${c}%`))}function lt(e,t){let n=Number.parseFloat(y(e,`max`,`1`)||`1`),r=Number.parseFloat(y(e,`value`,`0`)||`0`),i=k(e).trim(),a=Math.round(Math.max(0,r)/Math.max(1,n)*100),o=N(r,n,10,`=`,`-`);return j(e.nodeName,E(`${i?`${i} `:``}[${o}] ${a}%`))}const ut=C(e=>E(e)),dt=C(e=>`textColors.body.primary(${JSON.stringify(` (${String(e??``)})`)})`),ft=w,pt=C(e=>E(e)),mt=S(e=>`bold(${D(e)})`);function H(e,t=``){let n=[];for(let r of e.childNodes??[]){if(r.nodeName===`optgroup`){let e=y(r,`label`,``)||A(k(r));n.push(`${t}${e}:`),n.push(...H(r,`${t} `));continue}if(r.nodeName===`option`){let e=y(r,`selected`,null)!==null;n.push(`${t}${e?`*`:`-`} ${A(k(r))}`)}}return n}function ht(e,t){let n=H(e);return M(e.nodeName,E(n.join(`
13
- `)),1,1)}const gt=C(e=>E(e));function U(e){if(!e?.childNodes)return[];let t=[];for(let n of e.childNodes){if(n.nodeName===`tr`){t.push(n);continue}[`thead`,`tbody`,`tfoot`].includes(n.nodeName??``)&&t.push(...U(n))}return t}function _t(e){return(e.childNodes??[]).filter(e=>[`td`,`th`].includes(e.nodeName??``)).map(e=>A(k(e)))}const vt=S(e=>`italic(${D(e)})`),yt=S(),bt=S(),xt=S(),St=S(),Ct=S(),wt=S(),Tt=S(e=>E(e)),Et=S(e=>`bold(${D(e)})`);function Dt(e,t){let n=U(e).map(_t).filter(e=>e.length>0);return M(e.nodeName,`table(${JSON.stringify(n)})`,1,1)}const W=C(e=>E(e)),G=C(e=>`bold(${D(e)})`),K=C(e=>`italic(${D(e)})`),q=C(e=>`underline(${D(e)})`),J=C(e=>`strikethrough(${D(e)})`),Y=C(e=>O(e));var X={"#document":Be,"#text":oe,a:se,abbr:T,acronym:ce,address:fe,applet:w,area:w,article:ye,aside:we,audio:w,b:G,base:w,basefont:w,bdi:W,bdo:W,bgsound:w,big:W,blink:pe,blockquote:ke,body:He,bold:G,br:Ae,button:nt,canvas:w,caption:vt,center:je,cite:K,code:Me,col:Ct,colgroup:wt,data:Pe,datalist:w,dd:Le,del:J,details:ze,dfn:le,dialog:Oe,div:_e,dl:Fe,dt:Ie,em:K,embed:w,fieldset:We,figcaption:Ge,figure:Ke,font:W,footer:be,form:Te,frame:w,frameset:w,h1:qe,h2:Je,h3:Ye,h4:Xe,h5:Ze,h6:Qe,head:w,header:ve,hgroup:De,hr:$e,html:Ve,i:K,iframe:w,img:et,input:tt,ins:q,italic:K,kbd:Y,keygen:w,label:ge,legend:Ue,li:V,link:w,main:Se,map:w,mark:C(e=>`underline(bold(${D(e)}))`),marquee:me,math:w,menu:B,menuitem:V,message:st,meta:w,meter:ct,nav:Ce,nobr:W,noframes:w,noscript:w,object:w,ol:ot,optgroup:mt,option:pt,output:rt,p:he,param:w,picture:Ee,plaintext:w,portal:w,pre:Ne,progress:lt,q:C(e=>E(`"${String(e??``)}"`)),rp:ft,rt:dt,ruby:ut,s:J,samp:Y,script:w,section:xe,select:ht,slot:w,small:W,source:w,span:gt,strike:J,strikethrough:J,strong:G,style:w,sub:W,summary:Re,sup:W,svg:w,table:Dt,tbody:xt,td:Tt,template:w,textarea:it,tfoot:St,th:Et,thead:bt,time:W,title:w,tr:yt,track:w,tt:Y,u:q,ul:B,underline:q,var:Y,video:w,wbr:w,xmp:w};const Z=process.env.CACHE_RENDER!==`false`,Q=new WeakMap,Ot=(e,t)=>{if(!Z||!e||typeof e!=`object`)return;let n=Q.get(e);if(n)return n.get(JSON.stringify({lineWidth:t.lineWidth,pre:t.pre,listDepth:t.listDepth,listType:t.listType,depth:t.depth}))},kt=(e,t,n)=>{if(!Z||!e||typeof e!=`object`)return;let r=Q.get(e);if(r||(r=new Map,Q.set(e,r)),r.set(JSON.stringify({lineWidth:t.lineWidth,pre:t.pre,listDepth:t.listDepth,listType:t.listType,depth:t.depth}),n),r.size>10){let e=r.keys().next().value;r.delete(e)}},$=(e,t,n=X.div)=>{if(!e)return null;let r=t.depth??0;if(r>=100)return null;let i={...t,depth:r+1},a=Ot(e,i);if(a!==void 0)return a;let o=null;try{o=(X[e.nodeName||`#text`]||n)(e,i),kt(e,i,o)}catch(t){console.error(`Error rendering ${e.nodeName||`text`} tag: `,t),o=null}return o};function At(e,t={}){let n=$((0,d.parse)(e,{sourceCodeLocationInfo:!0}),ne(t));return((0,l.isSetObject)(n)?(0,u.isSetString)(n.value)?n.value:(0,c.isSet)(n.value)?String(n.value):JSON.stringify(n):(0,u.isSetString)(n)?n:(0,c.isSet)(n)?String(n):``).split(`
14
- `).map(e=>`console.log(${e||`""`})`).join(`
15
- `)}Object.defineProperty(exports,`n`,{enumerable:!0,get:function(){return s}}),Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return At}});
16
- //# sourceMappingURL=html-D9T_CMzR.cjs.map
13
+ `)),1,1)}const gt=C(e=>E(e));function U(e){if(!e?.childNodes)return[];let t=[];for(let n of e.childNodes){if(n.nodeName===`tr`){t.push(n);continue}[`thead`,`tbody`,`tfoot`].includes(n.nodeName??``)&&t.push(...U(n))}return t}function _t(e){return(e.childNodes??[]).filter(e=>[`td`,`th`].includes(e.nodeName??``)).map(e=>A(k(e)))}const vt=S(e=>`italic(${D(e)})`),yt=S(),bt=S(),xt=S(),St=S(),Ct=S(),wt=S(),Tt=S(e=>E(e)),Et=S(e=>`bold(${D(e)})`);function Dt(e,t){let n=U(e).map(_t).filter(e=>e.length>0);return M(e.nodeName,`table(${JSON.stringify(n)})`,1,1)}const W=C(e=>E(e)),G=C(e=>`bold(${D(e)})`),K=C(e=>`italic(${D(e)})`),q=C(e=>`underline(${D(e)})`),J=C(e=>`strikethrough(${D(e)})`),Y=C(e=>O(e));var X={"#document":Be,"#text":oe,a:se,abbr:T,acronym:ce,address:fe,applet:w,area:w,article:ye,aside:we,audio:w,b:G,base:w,basefont:w,bdi:W,bdo:W,bgsound:w,big:W,blink:pe,blockquote:ke,body:He,bold:G,br:Ae,button:nt,canvas:w,caption:vt,center:je,cite:K,code:Me,col:Ct,colgroup:wt,data:Pe,datalist:w,dd:Le,del:J,details:ze,dfn:le,dialog:Oe,div:_e,dl:Fe,dt:Ie,em:K,embed:w,fieldset:We,figcaption:Ge,figure:Ke,font:W,footer:be,form:Te,frame:w,frameset:w,h1:qe,h2:Je,h3:Ye,h4:Xe,h5:Ze,h6:Qe,head:w,header:ve,hgroup:De,hr:$e,html:Ve,i:K,iframe:w,img:et,input:tt,ins:q,italic:K,kbd:Y,keygen:w,label:ge,legend:Ue,li:V,link:w,main:Se,map:w,mark:C(e=>`underline(bold(${D(e)}))`),marquee:me,math:w,menu:B,menuitem:V,message:st,meta:w,meter:ct,nav:Ce,nobr:W,noframes:w,noscript:w,object:w,ol:ot,optgroup:mt,option:pt,output:rt,p:he,param:w,picture:Ee,plaintext:w,portal:w,pre:Ne,progress:lt,q:C(e=>E(`"${String(e??``)}"`)),rp:ft,rt:dt,ruby:ut,s:J,samp:Y,script:w,section:xe,select:ht,slot:w,small:W,source:w,span:gt,strike:J,strikethrough:J,strong:G,style:w,sub:W,summary:Re,sup:W,svg:w,table:Dt,tbody:xt,td:Tt,template:w,textarea:it,tfoot:St,th:Et,thead:bt,time:W,title:w,tr:yt,track:w,tt:Y,u:q,ul:B,underline:q,var:Y,video:w,wbr:w,xmp:w};const Z=process.env.CACHE_RENDER!==`false`,Q=new WeakMap,Ot=(e,t)=>{if(!Z||!e||typeof e!=`object`)return;let n=Q.get(e);if(n)return n.get(JSON.stringify({lineWidth:t.lineWidth,pre:t.pre,listDepth:t.listDepth,listType:t.listType,depth:t.depth}))},kt=(e,t,n)=>{if(!Z||!e||typeof e!=`object`)return;let r=Q.get(e);if(r||(r=new Map,Q.set(e,r)),r.set(JSON.stringify({lineWidth:t.lineWidth,pre:t.pre,listDepth:t.listDepth,listType:t.listType,depth:t.depth}),n),r.size>10){let e=r.keys().next().value;r.delete(e)}},$=(e,t,n=X.div)=>{if(!e)return null;let r=t.depth??0;if(r>=100)return null;let i={...t,depth:r+1},a=Ot(e,i);if(a!==void 0)return a;let o=null;try{o=(X[e.nodeName||`#text`]||n)(e,i),kt(e,i,o)}catch(t){console.error(`Error rendering ${e.nodeName||`text`} tag: `,t),o=null}return o};function At(e,t={}){let n=$((0,d.parse)(e,{sourceCodeLocationInfo:!0}),ne(t));return(0,l.isSetObject)(n)?(0,u.isSetString)(n.value)?n.value:(0,c.isSet)(n.value)?String(n.value):JSON.stringify(n):(0,u.isSetString)(n)?n:(0,c.isSet)(n)?String(n):``}Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return s}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return At}});
14
+ //# sourceMappingURL=html-CVnH92tJ.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"html-CVnH92tJ.cjs","names":[],"sources":[],"mappings":""}
@@ -10,7 +10,5 @@ import{isSet as e}from"@stryke/type-checks";import{isSetObject as t}from"@stryke
10
10
  `)),i=n?`${r}\n${n}`.trim():r;return k(e.nodeName,`blockquote(${C(i)})`,1,1)}const L=e=>v(t=>`bold(textColors.heading.${e===1?`primary`:e===2?`secondary`:`tertiary`}(${C(t)}))`,{marginTop:1,marginBottom:1}),Be=L(1),Ve=L(2),He=L(3),Ue=L(4),We=L(5),Ge=L(6);function Ke(e,t){return k(e.nodeName,`divider({ border: "primary" })`,1,1)}function qe(e,t){let n=m(e,`alt`,null),r=m(e,`src`,null),i=n||r?`[Image: ${n||r}]`:`[Image]`;return O(e.nodeName,S(i))}function Je(e,t){let n=(m(e,`type`,`text`)||`text`).toLowerCase(),r=m(e,`value`,``)||``,i=m(e,`placeholder`,``)||``,a=m(e,`checked`,null)!==null;if(n===`hidden`)return null;if(n===`checkbox`)return O(e.nodeName,S(a?`[x]`:`[ ]`));if(n===`radio`)return O(e.nodeName,S(a?`(o)`:`( )`));if([`submit`,`button`,`reset`].includes(n))return O(e.nodeName,`bold(${JSON.stringify(`[ ${r||n} ]`)})`);if(n===`range`){let t=Number.parseFloat(m(e,`max`,`100`)||`100`),n=Number.parseFloat(m(e,`value`,`0`)||`0`),r=A(n,t,10,`=`,`-`);return O(e.nodeName,S(`[${r}] ${Math.round(n)}/${Math.round(t)}`))}return O(e.nodeName,S(`[${r||i}]`))}const Ye=y(e=>`bold(${JSON.stringify(`[ ${String(e??`button`)} ]`)})`),Xe=y(e=>S(e)),Ze=v((e,t)=>{let n=Number.parseInt(m(t,`rows`,`0`)||`0`,10),r=E(t);return r&&(n>1||r.includes(`
11
11
  `))?T(r):S(e)});function Qe(e){return(e.childNodes??[]).filter(e=>e.nodeName===`li`)}function R(e,t){let n=Qe(e).map((e,n)=>{let r=D(E(e));return`${t(n)} ${r}`.trimEnd()});return k(e.nodeName,S(n.join(`
12
12
  `)),1,1)}function z(e,t){let n=m(e,`type`,`disc`)||`disc`,r=n===`square`?`▪`:n===`circle`?`◦`:`•`;return R(e,()=>r)}function $e(e,t){let n=Number.parseInt(m(e,`start`,`1`)||`1`,10);return R(e,e=>`${n+e}.`)}function B(e,t){let n=D(E(e));return k(e.nodeName,S(n))}const et=y((e,t)=>{let n=ee(t).find(e=>e.startsWith(`message-type-`))?.replace(`message-type-`,``);(!n||!c.includes(n))&&(n=`info`);let r=t.childNodes?.find(e=>e.type===`message-header`||e.type===`message-title`)?.value;return`${n}(${e?`\`${j(e)}\``:`''`}${r?`, \`${j(r)}\``:``})`});function tt(e,t){let n=Number.parseFloat(m(e,`min`,`0`)||`0`),r=Number.parseFloat(m(e,`max`,`1`)||`1`),i=Number.parseFloat(m(e,`value`,String(n))||String(n)),a=Math.max(0,i-n),o=Math.max(1,r-n),s=E(e).trim(),c=Math.round(a/o*100),l=A(a,o,10,`#`,`-`);return O(e.nodeName,S(`${s?`${s} `:``}[${l}] ${c}%`))}function nt(e,t){let n=Number.parseFloat(m(e,`max`,`1`)||`1`),r=Number.parseFloat(m(e,`value`,`0`)||`0`),i=E(e).trim(),a=Math.round(Math.max(0,r)/Math.max(1,n)*100),o=A(r,n,10,`=`,`-`);return O(e.nodeName,S(`${i?`${i} `:``}[${o}] ${a}%`))}const rt=y(e=>S(e)),it=y(e=>`textColors.body.primary(${JSON.stringify(` (${String(e??``)})`)})`),at=b,ot=y(e=>S(e)),st=v(e=>`bold(${C(e)})`);function V(e,t=``){let n=[];for(let r of e.childNodes??[]){if(r.nodeName===`optgroup`){let e=m(r,`label`,``)||D(E(r));n.push(`${t}${e}:`),n.push(...V(r,`${t} `));continue}if(r.nodeName===`option`){let e=m(r,`selected`,null)!==null;n.push(`${t}${e?`*`:`-`} ${D(E(r))}`)}}return n}function ct(e,t){let n=V(e);return k(e.nodeName,S(n.join(`
13
- `)),1,1)}const lt=y(e=>S(e));function H(e){if(!e?.childNodes)return[];let t=[];for(let n of e.childNodes){if(n.nodeName===`tr`){t.push(n);continue}[`thead`,`tbody`,`tfoot`].includes(n.nodeName??``)&&t.push(...H(n))}return t}function ut(e){return(e.childNodes??[]).filter(e=>[`td`,`th`].includes(e.nodeName??``)).map(e=>D(E(e)))}const dt=v(e=>`italic(${C(e)})`),ft=v(),pt=v(),mt=v(),ht=v(),gt=v(),_t=v(),vt=v(e=>S(e)),U=v(e=>`bold(${C(e)})`);function yt(e,t){let n=H(e).map(ut).filter(e=>e.length>0);return k(e.nodeName,`table(${JSON.stringify(n)})`,1,1)}const W=y(e=>S(e)),G=y(e=>`bold(${C(e)})`),K=y(e=>`italic(${C(e)})`),q=y(e=>`underline(${C(e)})`),J=y(e=>`strikethrough(${C(e)})`),Y=y(e=>w(e));var X={"#document":Ne,"#text":ne,a:re,abbr:x,acronym:ie,address:se,applet:b,area:b,article:me,aside:P,audio:b,b:G,base:b,basefont:b,bdi:W,bdo:W,bgsound:b,big:W,blink:ce,blockquote:Se,body:Fe,bold:G,br:Ce,button:Ye,canvas:b,caption:dt,center:we,cite:K,code:Te,col:gt,colgroup:_t,data:De,datalist:b,dd:Ae,del:J,details:Me,dfn:ae,dialog:xe,div:fe,dl:Oe,dt:ke,em:K,embed:b,fieldset:Le,figcaption:Re,figure:ze,font:W,footer:he,form:F,frame:b,frameset:b,h1:Be,h2:Ve,h3:He,h4:Ue,h5:We,h6:Ge,head:b,header:pe,hgroup:be,hr:Ke,html:Pe,i:K,iframe:b,img:qe,input:Je,ins:q,italic:K,kbd:Y,keygen:b,label:de,legend:Ie,li:B,link:b,main:_e,map:b,mark:y(e=>`underline(bold(${C(e)}))`),marquee:le,math:b,menu:z,menuitem:B,message:et,meta:b,meter:tt,nav:ve,nobr:W,noframes:b,noscript:b,object:b,ol:$e,optgroup:st,option:ot,output:Xe,p:ue,param:b,picture:ye,plaintext:b,portal:b,pre:Ee,progress:nt,q:y(e=>S(`"${String(e??``)}"`)),rp:at,rt:it,ruby:rt,s:J,samp:Y,script:b,section:ge,select:ct,slot:b,small:W,source:b,span:lt,strike:J,strikethrough:J,strong:G,style:b,sub:W,summary:je,sup:W,svg:b,table:yt,tbody:mt,td:vt,template:b,textarea:Ze,tfoot:ht,th:U,thead:pt,time:W,title:b,tr:ft,track:b,tt:Y,u:q,ul:z,underline:q,var:Y,video:b,wbr:b,xmp:b};const Z=process.env.CACHE_RENDER!==`false`,Q=new WeakMap,bt=(e,t)=>{if(!Z||!e||typeof e!=`object`)return;let n=Q.get(e);if(n)return n.get(JSON.stringify({lineWidth:t.lineWidth,pre:t.pre,listDepth:t.listDepth,listType:t.listType,depth:t.depth}))},xt=(e,t,n)=>{if(!Z||!e||typeof e!=`object`)return;let r=Q.get(e);if(r||(r=new Map,Q.set(e,r)),r.set(JSON.stringify({lineWidth:t.lineWidth,pre:t.pre,listDepth:t.listDepth,listType:t.listType,depth:t.depth}),n),r.size>10){let e=r.keys().next().value;r.delete(e)}},$=(e,t,n=X.div)=>{if(!e)return null;let r=t.depth??0;if(r>=100)return null;let i={...t,depth:r+1},a=bt(e,i);if(a!==void 0)return a;let o=null;try{o=(X[e.nodeName||`#text`]||n)(e,i),xt(e,i,o)}catch(t){console.error(`Error rendering ${e.nodeName||`text`} tag: `,t),o=null}return o};function St(i,a={}){let o=$(r(i,{sourceCodeLocationInfo:!0}),l(a));return(t(o)?n(o.value)?o.value:e(o.value)?String(o.value):JSON.stringify(o):n(o)?o:e(o)?String(o):``).split(`
14
- `).map(e=>`console.log(${e||`""`})`).join(`
15
- `)}export{St as t};
16
- //# sourceMappingURL=html-C6megiVP.mjs.map
13
+ `)),1,1)}const lt=y(e=>S(e));function H(e){if(!e?.childNodes)return[];let t=[];for(let n of e.childNodes){if(n.nodeName===`tr`){t.push(n);continue}[`thead`,`tbody`,`tfoot`].includes(n.nodeName??``)&&t.push(...H(n))}return t}function ut(e){return(e.childNodes??[]).filter(e=>[`td`,`th`].includes(e.nodeName??``)).map(e=>D(E(e)))}const dt=v(e=>`italic(${C(e)})`),ft=v(),pt=v(),mt=v(),ht=v(),gt=v(),_t=v(),vt=v(e=>S(e)),U=v(e=>`bold(${C(e)})`);function yt(e,t){let n=H(e).map(ut).filter(e=>e.length>0);return k(e.nodeName,`table(${JSON.stringify(n)})`,1,1)}const W=y(e=>S(e)),G=y(e=>`bold(${C(e)})`),K=y(e=>`italic(${C(e)})`),q=y(e=>`underline(${C(e)})`),J=y(e=>`strikethrough(${C(e)})`),Y=y(e=>w(e));var X={"#document":Ne,"#text":ne,a:re,abbr:x,acronym:ie,address:se,applet:b,area:b,article:me,aside:P,audio:b,b:G,base:b,basefont:b,bdi:W,bdo:W,bgsound:b,big:W,blink:ce,blockquote:Se,body:Fe,bold:G,br:Ce,button:Ye,canvas:b,caption:dt,center:we,cite:K,code:Te,col:gt,colgroup:_t,data:De,datalist:b,dd:Ae,del:J,details:Me,dfn:ae,dialog:xe,div:fe,dl:Oe,dt:ke,em:K,embed:b,fieldset:Le,figcaption:Re,figure:ze,font:W,footer:he,form:F,frame:b,frameset:b,h1:Be,h2:Ve,h3:He,h4:Ue,h5:We,h6:Ge,head:b,header:pe,hgroup:be,hr:Ke,html:Pe,i:K,iframe:b,img:qe,input:Je,ins:q,italic:K,kbd:Y,keygen:b,label:de,legend:Ie,li:B,link:b,main:_e,map:b,mark:y(e=>`underline(bold(${C(e)}))`),marquee:le,math:b,menu:z,menuitem:B,message:et,meta:b,meter:tt,nav:ve,nobr:W,noframes:b,noscript:b,object:b,ol:$e,optgroup:st,option:ot,output:Xe,p:ue,param:b,picture:ye,plaintext:b,portal:b,pre:Ee,progress:nt,q:y(e=>S(`"${String(e??``)}"`)),rp:at,rt:it,ruby:rt,s:J,samp:Y,script:b,section:ge,select:ct,slot:b,small:W,source:b,span:lt,strike:J,strikethrough:J,strong:G,style:b,sub:W,summary:je,sup:W,svg:b,table:yt,tbody:mt,td:vt,template:b,textarea:Ze,tfoot:ht,th:U,thead:pt,time:W,title:b,tr:ft,track:b,tt:Y,u:q,ul:z,underline:q,var:Y,video:b,wbr:b,xmp:b};const Z=process.env.CACHE_RENDER!==`false`,Q=new WeakMap,bt=(e,t)=>{if(!Z||!e||typeof e!=`object`)return;let n=Q.get(e);if(n)return n.get(JSON.stringify({lineWidth:t.lineWidth,pre:t.pre,listDepth:t.listDepth,listType:t.listType,depth:t.depth}))},xt=(e,t,n)=>{if(!Z||!e||typeof e!=`object`)return;let r=Q.get(e);if(r||(r=new Map,Q.set(e,r)),r.set(JSON.stringify({lineWidth:t.lineWidth,pre:t.pre,listDepth:t.listDepth,listType:t.listType,depth:t.depth}),n),r.size>10){let e=r.keys().next().value;r.delete(e)}},$=(e,t,n=X.div)=>{if(!e)return null;let r=t.depth??0;if(r>=100)return null;let i={...t,depth:r+1},a=bt(e,i);if(a!==void 0)return a;let o=null;try{o=(X[e.nodeName||`#text`]||n)(e,i),xt(e,i,o)}catch(t){console.error(`Error rendering ${e.nodeName||`text`} tag: `,t),o=null}return o};function St(i,a={}){let o=$(r(i,{sourceCodeLocationInfo:!0}),l(a));return t(o)?n(o.value)?o.value:e(o.value)?String(o.value):JSON.stringify(o):n(o)?o:e(o)?String(o):``}export{St as t};
14
+ //# sourceMappingURL=html-Do2f44ft.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"html-Do2f44ft.mjs","names":[],"sources":[],"mappings":""}
package/dist/index.cjs CHANGED
@@ -1,2 +1 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`./html-D9T_CMzR.cjs`),t=require(`./markdown-CmguN8DF.cjs`),n={heading:(e,t=1)=>`bold(textColors.heading.${t===1?`primary`:t===2?`secondary`:`tertiary`}("${e}"))`,body:e=>`textColors.body.primary("${e}")`,bold:e=>`bold("${e}")`,italic:e=>`italic("${e}")`,strikethrough:e=>`strikethrough("${e}")`,underline:e=>`underline("${e}")`,blockquote:e=>`blockquote("${e}")`,link:(e,t)=>`link("${e}", { ${t?`text: "${t}"`:``} })`,table:e=>`table(${JSON.stringify(e)})`,code:(e,t)=>`code(${JSON.stringify(e)}${t?`, "${t}"`:``})`,inlineCode:e=>`inlineCode("${e}")`,break:()=>`writeLine("")`,divider:()=>`divider({ border: "primary" })`};exports.defaultRenderAdapter=n,exports.renderHtml=e.t,exports.renderMarkdown=t.t;
2
- //# sourceMappingURL=index.cjs.map
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./html-CVnH92tJ.cjs"),t=require("./markdown-DzvIMrFk.cjs");exports.renderHtml=e.t,exports.renderMarkdown=t.t;
package/dist/index.d.cts CHANGED
@@ -1,12 +1,4 @@
1
- import { n as RenderAdapter, r as ResolvedOptions, t as Options } from "./types-J2htKY4q.cjs";
1
+ import { i as ResolvedOptions, n as MarkdownToken, r as Options, t as MarkdownToHtmlOptions } from "./types-By1HgC_t.cjs";
2
2
  import { renderHtml } from "./html/index.cjs";
3
3
  import { renderMarkdown } from "./markdown/index.cjs";
4
-
5
- //#region src/adapter.d.ts
6
- /**
7
- * Default render adapter that converts markdown nodes into Shell Shock source code strings. This adapter can be customized by providing a different implementation of the `RenderAdapter` interface in the options when using the `outputPlugin`. Each method in the adapter corresponds to a specific markdown construct and defines how it should be rendered in the output string.
8
- */
9
- declare const defaultRenderAdapter: RenderAdapter;
10
- //#endregion
11
- export { Options, RenderAdapter, ResolvedOptions, defaultRenderAdapter, renderHtml, renderMarkdown };
12
- //# sourceMappingURL=index.d.cts.map
4
+ export { type MarkdownToHtmlOptions, type MarkdownToken, type Options, type ResolvedOptions, renderHtml, renderMarkdown };
package/dist/index.d.mts CHANGED
@@ -1,12 +1,4 @@
1
- import { n as RenderAdapter, r as ResolvedOptions, t as Options } from "./types-CCFWBb06.mjs";
1
+ import { i as ResolvedOptions, n as MarkdownToken, r as Options, t as MarkdownToHtmlOptions } from "./types-By1HgC_t.mjs";
2
2
  import { renderHtml } from "./html/index.mjs";
3
3
  import { renderMarkdown } from "./markdown/index.mjs";
4
-
5
- //#region src/adapter.d.ts
6
- /**
7
- * Default render adapter that converts markdown nodes into Shell Shock source code strings. This adapter can be customized by providing a different implementation of the `RenderAdapter` interface in the options when using the `outputPlugin`. Each method in the adapter corresponds to a specific markdown construct and defines how it should be rendered in the output string.
8
- */
9
- declare const defaultRenderAdapter: RenderAdapter;
10
- //#endregion
11
- export { Options, RenderAdapter, ResolvedOptions, defaultRenderAdapter, renderHtml, renderMarkdown };
12
- //# sourceMappingURL=index.d.mts.map
4
+ export { type MarkdownToHtmlOptions, type MarkdownToken, type Options, type ResolvedOptions, renderHtml, renderMarkdown };
package/dist/index.mjs CHANGED
@@ -1,2 +1 @@
1
- import{t as e}from"./html-C6megiVP.mjs";import{t}from"./markdown-B1ZkR96l.mjs";const n={heading:(e,t=1)=>`bold(textColors.heading.${t===1?`primary`:t===2?`secondary`:`tertiary`}("${e}"))`,body:e=>`textColors.body.primary("${e}")`,bold:e=>`bold("${e}")`,italic:e=>`italic("${e}")`,strikethrough:e=>`strikethrough("${e}")`,underline:e=>`underline("${e}")`,blockquote:e=>`blockquote("${e}")`,link:(e,t)=>`link("${e}", { ${t?`text: "${t}"`:``} })`,table:e=>`table(${JSON.stringify(e)})`,code:(e,t)=>`code(${JSON.stringify(e)}${t?`, "${t}"`:``})`,inlineCode:e=>`inlineCode("${e}")`,break:()=>`writeLine("")`,divider:()=>`divider({ border: "primary" })`};export{n as defaultRenderAdapter,e as renderHtml,t as renderMarkdown};
2
- //# sourceMappingURL=index.mjs.map
1
+ import{t as e}from"./html-Do2f44ft.mjs";import{t}from"./markdown-CMEWV1ow.mjs";export{e as renderHtml,t as renderMarkdown};
@@ -1 +1 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`../markdown-CmguN8DF.cjs`);exports.renderMarkdown=e.t;
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../markdown-DzvIMrFk.cjs");exports.renderMarkdown=e.t;
@@ -1,4 +1,4 @@
1
- import { t as Options } from "../types-J2htKY4q.cjs";
1
+ import { r as Options } from "../types-By1HgC_t.cjs";
2
2
 
3
3
  //#region src/markdown/index.d.ts
4
4
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.cts","names":[],"sources":["../../src/markdown/index.ts"],"mappings":";;;;;AA6BA;;;;;iBAAgB,cAAA,CACd,QAAA,UACA,OAAA,GAAS,OAAA"}
1
+ {"version":3,"file":"index.d.cts","names":[],"sources":["../../src/markdown/index.ts"],"mappings":";;;;;AA6BA;;;;;iBAAgB,cAAA,CACd,QAAA,UACA,OAAA,GAAS,OAAY"}
@@ -1,4 +1,4 @@
1
- import { t as Options } from "../types-CCFWBb06.mjs";
1
+ import { r as Options } from "../types-By1HgC_t.mjs";
2
2
 
3
3
  //#region src/markdown/index.d.ts
4
4
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.mts","names":[],"sources":["../../src/markdown/index.ts"],"mappings":";;;;;AA6BA;;;;;iBAAgB,cAAA,CACd,QAAA,UACA,OAAA,GAAS,OAAA"}
1
+ {"version":3,"file":"index.d.mts","names":[],"sources":["../../src/markdown/index.ts"],"mappings":""}
@@ -1 +1 @@
1
- import{t as e}from"../markdown-B1ZkR96l.mjs";export{e as renderMarkdown};
1
+ import{t as e}from"../markdown-CMEWV1ow.mjs";export{e as renderMarkdown};
@@ -1,2 +1,2 @@
1
- import{t as e}from"./html-C6megiVP.mjs";import{THEME_MESSAGE_VARIANTS as t}from"@shell-shock/plugin-theme/helpers/constants";import{alert as n}from"@mdit/plugin-alert";import{titleCase as r}from"@stryke/string-format";import i from"markdown-it";import a from"markdown-it-abbr";import o from"markdown-it-container";import s from"markdown-it-deflist";import c from"markdown-it-footnote";import l from"markdown-it-ins";import u from"markdown-it-mark";import d from"markdown-it-sub";import f from"markdown-it-sup";import p from"markdown-it-task-lists";const m=()=>{let e=i({html:!0,langPrefix:`language-`,linkify:!0}).use(c).use(l).use(u).use(s).use(a).use(o).use(f).use(d).use(p).use(n,{deep:!1,openRender(e,n){let r=e[n],i=`info`;return t.includes(r?.markup)&&(i=r?.markup),`<message class="message-type-${i}">`},closeRender(){return`</message>`},titleRender(e,t){let n=e[t];return`<message-header>${r(n?.content||``)}</message-header>`}});return e.renderer.rules.footnote_anchor=()=>``,e},h=e=>m().render(e);function g(t,n={}){return e(h(t),n)}export{g as t};
2
- //# sourceMappingURL=markdown-B1ZkR96l.mjs.map
1
+ import{t as e}from"./html-Do2f44ft.mjs";import{THEME_MESSAGE_VARIANTS as t}from"@shell-shock/plugin-theme/helpers/constants";import{alert as n}from"@mdit/plugin-alert";import{titleCase as r}from"@stryke/string-format";import i from"markdown-it";import a from"markdown-it-abbr";import o from"markdown-it-container";import s from"markdown-it-deflist";import c from"markdown-it-footnote";import l from"markdown-it-ins";import u from"markdown-it-mark";import d from"markdown-it-sub";import f from"markdown-it-sup";import p from"markdown-it-task-lists";function m(){let e=i({html:!0,langPrefix:`language-`,linkify:!0}).use(c).use(l).use(u).use(s).use(a).use(o).use(f).use(d).use(p).use(n,{deep:!1,openRender(e,n){let r=e[n],i=`info`;return t.includes(r?.markup)&&(i=r?.markup),`<message class="message-type-${i}">`},closeRender(){return`</message>`},titleRender(e,t){let n=e[t];return`<message-header>${r(n?.content||``)}</message-header>`}});return e.renderer.rules.footnote_anchor=()=>``,e}function h(e,t){return t.parse(e,{})}function g(e,t){return e.map(e=>t.renderer.render([e],t.options,{})).join(``)}function _(e,t={}){let n=m(),r=h(e,n);return t.filter&&(r=t.filter(r)),g(r,n)}function v(t,n={}){return e(_(t,n),n)}export{v as t};
2
+ //# sourceMappingURL=markdown-CMEWV1ow.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"markdown-CMEWV1ow.mjs","names":[],"sources":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ const e=require("./html-CVnH92tJ.cjs");let t=require("@shell-shock/plugin-theme/helpers/constants"),n=require("@mdit/plugin-alert"),r=require("@stryke/string-format"),i=require("markdown-it");i=e.n(i,1);let a=require("markdown-it-abbr");a=e.n(a,1);let o=require("markdown-it-container");o=e.n(o,1);let s=require("markdown-it-deflist");s=e.n(s,1);let c=require("markdown-it-footnote");c=e.n(c,1);let l=require("markdown-it-ins");l=e.n(l,1);let u=require("markdown-it-mark");u=e.n(u,1);let d=require("markdown-it-sub");d=e.n(d,1);let f=require("markdown-it-sup");f=e.n(f,1);let p=require("markdown-it-task-lists");p=e.n(p,1);function m(){let e=(0,i.default)({html:!0,langPrefix:`language-`,linkify:!0}).use(c.default).use(l.default).use(u.default).use(s.default).use(a.default).use(o.default).use(f.default).use(d.default).use(p.default).use(n.alert,{deep:!1,openRender(e,n){let r=e[n],i=`info`;return t.THEME_MESSAGE_VARIANTS.includes(r?.markup)&&(i=r?.markup),`<message class="message-type-${i}">`},closeRender(){return`</message>`},titleRender(e,t){let n=e[t];return`<message-header>${(0,r.titleCase)(n?.content||``)}</message-header>`}});return e.renderer.rules.footnote_anchor=()=>``,e}function h(e,t){return t.parse(e,{})}function g(e,t){return e.map(e=>t.renderer.render([e],t.options,{})).join(``)}function _(e,t={}){let n=m(),r=h(e,n);return t.filter&&(r=t.filter(r)),g(r,n)}function v(t,n={}){return e.t(_(t,n),n)}Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return v}});
2
+ //# sourceMappingURL=markdown-DzvIMrFk.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"markdown-DzvIMrFk.cjs","names":[],"sources":[],"mappings":""}
@@ -0,0 +1,50 @@
1
+ import { PartialKeys } from "@stryke/types/base";
2
+ import { Token } from "markdown-it/dist/markdown-it.min.js";
3
+
4
+ //#region src/types.d.ts
5
+ /**
6
+ * A type representing a markdown token, which is a fundamental unit of parsed markdown content. This type is based on the Token type from the markdown-it library, and includes properties such as type, tag, content, and children that describe the structure and content of the markdown element represented by the token. Markdown tokens are used during the parsing and rendering process to convert markdown text into HTML or other formats.
7
+ */
8
+ type MarkdownToken = Token;
9
+ interface MarkdownToHtmlOptions {
10
+ /**
11
+ * A function that takes an array of markdown-it tokens and returns a modified array of tokens. This allows for custom processing or filtering of the tokens before they are rendered to HTML. For example, you could use this function to remove certain types of tokens, modify token content, or add new tokens based on specific criteria.
12
+ *
13
+ * @param tokens - An array of markdown-it tokens to be processed.
14
+ * @returns A modified array of markdown-it tokens.
15
+ */
16
+ filter?: (tokens: MarkdownToken[]) => MarkdownToken[];
17
+ }
18
+ /**
19
+ * Options for rendering HTML or Markdown content in the terminal. This interface extends the MarkdownToHtmlOptions, allowing for additional configuration options specific to rendering in the terminal, such as line wrapping, font attributes, and ASCII mode.
20
+ */
21
+ interface Options extends MarkdownToHtmlOptions {
22
+ /**
23
+ * Whether to wrap lines at a certain width.
24
+ */
25
+ pre?: boolean;
26
+ /**
27
+ * The maximum line width for wrapping text. Defaults to the terminal width minus 2, with a maximum of 120 characters.
28
+ */
29
+ lineWidth?: number;
30
+ /**
31
+ * Whether to include font attributes (e.g., bold, italic) in the output. If false, all text will be rendered without font attributes. Defaults to true.
32
+ */
33
+ fontAttrs?: boolean;
34
+ /**
35
+ * The depth of the current rendering context, used for managing nested elements and indentation levels. Defaults to 0.
36
+ */
37
+ depth?: number;
38
+ /**
39
+ * Whether to use ASCII characters for rendering elements such as borders and dividers, instead of Unicode characters. Defaults to false.
40
+ */
41
+ asciiMode?: boolean;
42
+ /**
43
+ * Post-process the generated output.
44
+ */
45
+ postProcess?: (output: string) => string;
46
+ }
47
+ type ResolvedOptions = PartialKeys<Required<Options>, "filter" | "postProcess">;
48
+ //#endregion
49
+ export { ResolvedOptions as i, MarkdownToken as n, Options as r, MarkdownToHtmlOptions as t };
50
+ //# sourceMappingURL=types-By1HgC_t.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types-By1HgC_t.d.cts","names":[],"sources":["../src/types.ts"],"mappings":";;;;;;AAwBA;KAAY,aAAA,GAAgB,KAAK;AAAA,UAEhB,qBAAA;EAFgB;AAAA;AAEjC;;;;EAOE,MAAA,IAAU,MAAA,EAAQ,aAAA,OAAoB,aAAa;AAAA;;;;UAMpC,OAAA,SAAgB,qBAAqB;EAArC;;;EAIf,GAAA;EAJ+B;;;EAS/B,SAAA;EAUA;;;EALA,SAAA;EAe6B;AAAA;AAG/B;EAbE,KAAA;;;;EAKA,SAAA;EAQuC;;;EAHvC,WAAA,IAAe,MAAA;AAAA;AAAA,KAGL,eAAA,GAAkB,WAAA,CAC5B,QAAA,CAAS,OAAA"}
@@ -0,0 +1,50 @@
1
+ import { PartialKeys } from "@stryke/types/base";
2
+ import { Token } from "markdown-it/dist/markdown-it.min.js";
3
+
4
+ //#region src/types.d.ts
5
+ /**
6
+ * A type representing a markdown token, which is a fundamental unit of parsed markdown content. This type is based on the Token type from the markdown-it library, and includes properties such as type, tag, content, and children that describe the structure and content of the markdown element represented by the token. Markdown tokens are used during the parsing and rendering process to convert markdown text into HTML or other formats.
7
+ */
8
+ type MarkdownToken = Token;
9
+ interface MarkdownToHtmlOptions {
10
+ /**
11
+ * A function that takes an array of markdown-it tokens and returns a modified array of tokens. This allows for custom processing or filtering of the tokens before they are rendered to HTML. For example, you could use this function to remove certain types of tokens, modify token content, or add new tokens based on specific criteria.
12
+ *
13
+ * @param tokens - An array of markdown-it tokens to be processed.
14
+ * @returns A modified array of markdown-it tokens.
15
+ */
16
+ filter?: (tokens: MarkdownToken[]) => MarkdownToken[];
17
+ }
18
+ /**
19
+ * Options for rendering HTML or Markdown content in the terminal. This interface extends the MarkdownToHtmlOptions, allowing for additional configuration options specific to rendering in the terminal, such as line wrapping, font attributes, and ASCII mode.
20
+ */
21
+ interface Options extends MarkdownToHtmlOptions {
22
+ /**
23
+ * Whether to wrap lines at a certain width.
24
+ */
25
+ pre?: boolean;
26
+ /**
27
+ * The maximum line width for wrapping text. Defaults to the terminal width minus 2, with a maximum of 120 characters.
28
+ */
29
+ lineWidth?: number;
30
+ /**
31
+ * Whether to include font attributes (e.g., bold, italic) in the output. If false, all text will be rendered without font attributes. Defaults to true.
32
+ */
33
+ fontAttrs?: boolean;
34
+ /**
35
+ * The depth of the current rendering context, used for managing nested elements and indentation levels. Defaults to 0.
36
+ */
37
+ depth?: number;
38
+ /**
39
+ * Whether to use ASCII characters for rendering elements such as borders and dividers, instead of Unicode characters. Defaults to false.
40
+ */
41
+ asciiMode?: boolean;
42
+ /**
43
+ * Post-process the generated output.
44
+ */
45
+ postProcess?: (output: string) => string;
46
+ }
47
+ type ResolvedOptions = PartialKeys<Required<Options>, "filter" | "postProcess">;
48
+ //#endregion
49
+ export { ResolvedOptions as i, MarkdownToken as n, Options as r, MarkdownToHtmlOptions as t };
50
+ //# sourceMappingURL=types-By1HgC_t.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types-By1HgC_t.d.mts","names":[],"sources":["../src/types.ts"],"mappings":""}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shell-shock/unified",
3
- "version": "0.2.8",
3
+ "version": "0.2.10",
4
4
  "private": false,
5
5
  "description": "A package containing a Shell Shock plugin to generate unified built-in modules that display information about the application.",
6
6
  "keywords": ["unified", "shell-shock", "powerlines", "storm-software"],
@@ -40,47 +40,14 @@
40
40
  ],
41
41
  "type": "module",
42
42
  "exports": {
43
- ".": {
44
- "require": {
45
- "types": "./dist/index.d.cts",
46
- "default": "./dist/index.cjs"
47
- },
48
- "import": {
49
- "types": "./dist/index.d.mts",
50
- "default": "./dist/index.mjs"
51
- },
52
- "default": {
53
- "types": "./dist/index.d.mts",
54
- "default": "./dist/index.mjs"
55
- }
56
- },
43
+ ".": { "import": "./dist/index.mjs", "require": "./dist/index.cjs" },
57
44
  "./html": {
58
- "require": {
59
- "types": "./dist/html/index.d.cts",
60
- "default": "./dist/html/index.cjs"
61
- },
62
- "import": {
63
- "types": "./dist/html/index.d.mts",
64
- "default": "./dist/html/index.mjs"
65
- },
66
- "default": {
67
- "types": "./dist/html/index.d.mts",
68
- "default": "./dist/html/index.mjs"
69
- }
45
+ "import": "./dist/html/index.mjs",
46
+ "require": "./dist/html/index.cjs"
70
47
  },
71
48
  "./markdown": {
72
- "require": {
73
- "types": "./dist/markdown/index.d.cts",
74
- "default": "./dist/markdown/index.cjs"
75
- },
76
- "import": {
77
- "types": "./dist/markdown/index.d.mts",
78
- "default": "./dist/markdown/index.mjs"
79
- },
80
- "default": {
81
- "types": "./dist/markdown/index.d.mts",
82
- "default": "./dist/markdown/index.mjs"
83
- }
49
+ "import": "./dist/markdown/index.mjs",
50
+ "require": "./dist/markdown/index.cjs"
84
51
  },
85
52
  "./package.json": "./package.json"
86
53
  },
@@ -91,19 +58,19 @@
91
58
  "files": ["dist/**/*"],
92
59
  "dependencies": {
93
60
  "@mdit/plugin-alert": "^0.23.2",
94
- "@shell-shock/core": "^0.17.10",
95
- "@shell-shock/plugin-theme": "^0.4.23",
96
- "@stryke/path": "^0.28.2",
97
- "@stryke/string-format": "^0.17.13",
98
- "@stryke/type-checks": "^0.6.5",
99
- "@stryke/types": "^0.12.0",
61
+ "@shell-shock/core": "0.17.12",
62
+ "@shell-shock/plugin-theme": "0.4.25",
63
+ "@stryke/path": "^0.29.11",
64
+ "@stryke/string-format": "^0.17.26",
65
+ "@stryke/type-checks": "^0.6.17",
66
+ "@stryke/types": "^0.12.12",
100
67
  "chalk-string": "^4.0.0",
101
68
  "defu": "^6.1.7",
102
69
  "he": "^1.2.0",
103
- "markdown-it": "^14.1.1",
70
+ "markdown-it": "^14.2.0",
104
71
  "markdown-it-abbr": "^2.0.0",
105
72
  "markdown-it-container": "^4.0.0",
106
- "markdown-it-deflist": "^3.0.0",
73
+ "markdown-it-deflist": "^3.0.1",
107
74
  "markdown-it-footnote": "^4.0.0",
108
75
  "markdown-it-ins": "^4.0.0",
109
76
  "markdown-it-mark": "^4.0.0",
@@ -112,14 +79,14 @@
112
79
  "markdown-it-task-lists": "^2.1.1",
113
80
  "normalize-html-whitespace": "^1.0.0",
114
81
  "parse5": "^8.0.1",
115
- "powerlines": "^0.47.4",
82
+ "powerlines": "^0.47.126",
116
83
  "terminal-size": "^4.0.1",
117
84
  "wrap-ansi": "^10.0.0"
118
85
  },
119
86
  "devDependencies": {
120
- "@powerlines/plugin-tsdown": "^0.1.406",
121
- "@types/node": "^25.6.0"
87
+ "@powerlines/plugin-tsdown": "^0.1.527",
88
+ "@types/node": "^25.9.1"
122
89
  },
123
90
  "publishConfig": { "access": "public" },
124
- "gitHead": "7b4030fd6be000c960e8cc4c4f7b4db205054e69"
91
+ "gitHead": "3c10901dd3fbbc3c9d6d1a3373f01cc5f56d3321"
125
92
  }