@kawaz/mdp 0.1.4 → 0.1.5

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 (2) hide show
  1. package/dist/mdp.js +4 -2
  2. package/package.json +1 -1
package/dist/mdp.js CHANGED
@@ -1,4 +1,4 @@
1
- import{createRequire as IJ}from"node:module";var VA=IJ(import.meta.url);function KA(z){this._0=z}KA.prototype.$tag=0;function EA(z,A){this._0=z,this._1=A}EA.prototype.$tag=1;class _B extends Error{}function $(){throw new _B}function t(z,A){if(A<0||A>=z.length)throw Error("Index out of bounds")}function RA(z,A){return(z>=A)-(z<=A)}function pz(z){this._0=z}pz.prototype.$tag=0;function eB(z){this._0=z}eB.prototype.$tag=1;var RJ={$tag:1},pA={$tag:0},OJ=(z,A)=>{return z.toString(A)};function FJ(z,A){return String.fromCodePoint(A).repeat(z)}function zG(z,A){let B=Array(z);return B.fill(A),B}var Kz=(z,A)=>{z.push(A)},TJ=(z)=>z.slice(0),jJ=(z)=>z.pop(),yJ=(z,A,B)=>z.splice(A,B),vJ={$tag:0};function AG(z){this._0=z}AG.prototype.$tag=1;function _(z,A){this._0=z,this._1=A}_.prototype.$tag=0;function OA(z){this._0=z}OA.prototype.$tag=1;function NA(z,A){this._0=z,this._1=A}NA.prototype.$tag=2;function FA(z,A,B){this._0=z,this._1=A,this._2=B}FA.prototype.$tag=3;function TA(z,A,B){this._0=z,this._1=A,this._2=B}TA.prototype.$tag=4;function BG(z,A){this._0=z,this._1=A}BG.prototype.$tag=5;function jA(z,A,B){this._0=z,this._1=A,this._2=B}jA.prototype.$tag=6;function GG(z,A,B,G){this._0=z,this._1=A,this._2=B,this._3=G}GG.prototype.$tag=7;function JG(z,A,B){this._0=z,this._1=A,this._2=B}JG.prototype.$tag=8;function KG(z,A,B){this._0=z,this._1=A,this._2=B}KG.prototype.$tag=9;function NG(z,A,B,G){this._0=z,this._1=A,this._2=B,this._3=G}NG.prototype.$tag=10;function QG(z,A,B){this._0=z,this._1=A,this._2=B}QG.prototype.$tag=11;function wJ(z,A){this._0=z,this._1=A}wJ.prototype.$tag=12;function SG(z,A){this._0=z,this._1=A}SG.prototype.$tag=13;function UG(z,A,B,G,K){this._0=z,this._1=A,this._2=B,this._3=G,this._4=K}UG.prototype.$tag=0;function yA(z,A,B,G,K,J,N){this._0=z,this._1=A,this._2=B,this._3=G,this._4=K,this._5=J,this._6=N}yA.prototype.$tag=1;function QA(z,A,B,G){this._0=z,this._1=A,this._2=B,this._3=G}QA.prototype.$tag=2;function VG(z,A,B,G,K,J,N,Q){this._0=z,this._1=A,this._2=B,this._3=G,this._4=K,this._5=J,this._6=N,this._7=Q}VG.prototype.$tag=3;function WG(z,A,B,G){this._0=z,this._1=A,this._2=B,this._3=G}WG.prototype.$tag=4;function XG(z,A,B,G){this._0=z,this._1=A,this._2=B,this._3=G}XG.prototype.$tag=5;function vA(z,A,B,G,K,J){this._0=z,this._1=A,this._2=B,this._3=G,this._4=K,this._5=J}vA.prototype.$tag=6;function YG(z,A,B,G,K,J,N){this._0=z,this._1=A,this._2=B,this._3=G,this._4=K,this._5=J,this._6=N}YG.prototype.$tag=7;function ZG(z,A,B,G){this._0=z,this._1=A,this._2=B,this._3=G}ZG.prototype.$tag=8;function EG(z,A,B,G,K,J){this._0=z,this._1=A,this._2=B,this._3=G,this._4=K,this._5=J}EG.prototype.$tag=9;function MG(z,A){this._0=z,this._1=A}MG.prototype.$tag=10;function DG(z,A,B,G,K){this._0=z,this._1=A,this._2=B,this._3=G,this._4=K}DG.prototype.$tag=11;var kJ=()=>process.argv.slice(2),LJ=()=>"0.1.4",gJ=(z)=>process.stdout.write(z),hJ=(z)=>{let A=VA("node:fs");try{return A.readFileSync(z,"utf-8")}catch(B){return process.stderr.write("Error: "+(B.message||String(B))+`
1
+ import{createRequire as IJ}from"node:module";var VA=IJ(import.meta.url);function KA(z){this._0=z}KA.prototype.$tag=0;function EA(z,A){this._0=z,this._1=A}EA.prototype.$tag=1;class _B extends Error{}function $(){throw new _B}function t(z,A){if(A<0||A>=z.length)throw Error("Index out of bounds")}function RA(z,A){return(z>=A)-(z<=A)}function pz(z){this._0=z}pz.prototype.$tag=0;function eB(z){this._0=z}eB.prototype.$tag=1;var RJ={$tag:1},pA={$tag:0},OJ=(z,A)=>{return z.toString(A)};function FJ(z,A){return String.fromCodePoint(A).repeat(z)}function zG(z,A){let B=Array(z);return B.fill(A),B}var Kz=(z,A)=>{z.push(A)},TJ=(z)=>z.slice(0),jJ=(z)=>z.pop(),yJ=(z,A,B)=>z.splice(A,B),vJ={$tag:0};function AG(z){this._0=z}AG.prototype.$tag=1;function _(z,A){this._0=z,this._1=A}_.prototype.$tag=0;function OA(z){this._0=z}OA.prototype.$tag=1;function NA(z,A){this._0=z,this._1=A}NA.prototype.$tag=2;function FA(z,A,B){this._0=z,this._1=A,this._2=B}FA.prototype.$tag=3;function TA(z,A,B){this._0=z,this._1=A,this._2=B}TA.prototype.$tag=4;function BG(z,A){this._0=z,this._1=A}BG.prototype.$tag=5;function jA(z,A,B){this._0=z,this._1=A,this._2=B}jA.prototype.$tag=6;function GG(z,A,B,G){this._0=z,this._1=A,this._2=B,this._3=G}GG.prototype.$tag=7;function JG(z,A,B){this._0=z,this._1=A,this._2=B}JG.prototype.$tag=8;function KG(z,A,B){this._0=z,this._1=A,this._2=B}KG.prototype.$tag=9;function NG(z,A,B,G){this._0=z,this._1=A,this._2=B,this._3=G}NG.prototype.$tag=10;function QG(z,A,B){this._0=z,this._1=A,this._2=B}QG.prototype.$tag=11;function wJ(z,A){this._0=z,this._1=A}wJ.prototype.$tag=12;function SG(z,A){this._0=z,this._1=A}SG.prototype.$tag=13;function UG(z,A,B,G,K){this._0=z,this._1=A,this._2=B,this._3=G,this._4=K}UG.prototype.$tag=0;function yA(z,A,B,G,K,J,N){this._0=z,this._1=A,this._2=B,this._3=G,this._4=K,this._5=J,this._6=N}yA.prototype.$tag=1;function QA(z,A,B,G){this._0=z,this._1=A,this._2=B,this._3=G}QA.prototype.$tag=2;function VG(z,A,B,G,K,J,N,Q){this._0=z,this._1=A,this._2=B,this._3=G,this._4=K,this._5=J,this._6=N,this._7=Q}VG.prototype.$tag=3;function WG(z,A,B,G){this._0=z,this._1=A,this._2=B,this._3=G}WG.prototype.$tag=4;function XG(z,A,B,G){this._0=z,this._1=A,this._2=B,this._3=G}XG.prototype.$tag=5;function vA(z,A,B,G,K,J){this._0=z,this._1=A,this._2=B,this._3=G,this._4=K,this._5=J}vA.prototype.$tag=6;function YG(z,A,B,G,K,J,N){this._0=z,this._1=A,this._2=B,this._3=G,this._4=K,this._5=J,this._6=N}YG.prototype.$tag=7;function ZG(z,A,B,G){this._0=z,this._1=A,this._2=B,this._3=G}ZG.prototype.$tag=8;function EG(z,A,B,G,K,J){this._0=z,this._1=A,this._2=B,this._3=G,this._4=K,this._5=J}EG.prototype.$tag=9;function MG(z,A){this._0=z,this._1=A}MG.prototype.$tag=10;function DG(z,A,B,G,K){this._0=z,this._1=A,this._2=B,this._3=G,this._4=K}DG.prototype.$tag=11;var kJ=()=>process.argv.slice(2),LJ=()=>"0.1.5",gJ=(z)=>process.stdout.write(z),hJ=(z)=>{let A=VA("node:fs");try{return A.readFileSync(z,"utf-8")}catch(B){return process.stderr.write("Error: "+(B.message||String(B))+`
2
2
  `),"\x00"}},xJ=()=>{let z=VA("node:fs"),A=[],B=Buffer.allocUnsafe(65536);for(;;)try{let G=z.readSync(0,B,0,B.length);if(G===0)break;A.push(Uint8Array.prototype.slice.call(B,0,G))}catch(G){if(G.code==="EAGAIN"){Atomics.wait(new Int32Array(new SharedArrayBuffer(4)),0,0,1);continue}if(G.code==="EOF")break;return""}return Buffer.concat(A).toString("utf-8")},uJ=()=>!VA("node:tty").isatty(0),PG={method_0:U,method_1:bG,method_2:cG,method_3:w},Yz=65535,cA="@",aA="http",iA=" ",rA=`
3
3
  \r`,nA=" \t",tA=" \t",lA=" \t",fA=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","svg","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],sA="/>",_A=`
4
4
  `,eA="[ ] ",zB="[x] ",AB="[X] ",BB=`
@@ -58,7 +58,9 @@ import{createRequire as IJ}from"node:module";var VA=IJ(import.meta.url);function
58
58
  `);return}}}function lB(z,A){if(z.$tag===2){let G=z._0;Qz(G,A);return}else{$A(z,A);return}}function GA(z,A,B){let G=z.checked;if(G===-1)U(A,$J),U(A," "),U(A,B),U(A," "),U(A,b);else if(G===!0)U(A,oJ),U(A," ☑ "),U(A,b);else U(A,i),U(A," ☐ "),U(A,b);let K=z.children,J=K.length,N=0;while(!0){let Q=N;if(Q<J){let S=K[Q];if(S.$tag===2){let W=S._0;oA(W,A)}else $A(S,A);N=Q+1|0;continue}else break}U(A,`
59
59
  `)}function _Z(z){return{code_highlighter:void 0,str_width:z}}function dz(z,A){if(z===void 0)return Mz(Sz(A));else return z(A)}function fB(z,A,B,G){let K=DA(sz(A,{str:gB,start:0,end:gB.length})),J=0,N=K.length,Q=0;while(!0){let X=Q;if(X<N){let E=K[X],Y;if(X<(K.length-1|0))Y=!0;else Y=c(E)!=="";if(Y){let Z=dz(G,c(E));if(Z>J)J=Z}Q=X+1|0;continue}else break}let S=z===""?0:dz(G,z)+4|0;if(S>J)J=S;if(J<20)J=20;if(U(B,i),z!==""){U(B,"┌─ "),U(B,z),U(B," ");let X=(J-dz(G,z)|0)-1|0;U(B,e("─",X)),U(B,"┐")}else U(B,"┌"),U(B,e("─",J+2|0)),U(B,"┐");U(B,b),U(B,`
60
60
  `);let V=K.length,W=0;while(!0){let X=W;if(X<V){let E=K[X],Y;if(X<(K.length-1|0))Y=!0;else Y=c(E)!=="";if(Y){U(B,i),U(B,"│"),U(B,b),U(B,rz),U(B," ");let Z=c(E);U(B,Z);let D=J-dz(G,Z)|0;U(B,e(" ",D)),U(B,b),U(B,i),U(B," │"),U(B,b),U(B,`
61
- `)}W=X+1|0;continue}else break}U(B,i),U(B,"└"),U(B,e("─",J+2|0)),U(B,"┘"),U(B,b)}function UJ(z,A,B){switch(z.$tag){case 3:{let G=z,K=G._2,J=G._3,N=B.code_highlighter;if(N===void 0){let Q=B.str_width;if(Q===void 0){fB(K,J,A,void 0);return}else{fB(K,J,A,Q);return}}else{let S=N,V=fZ(K),W=S(V,J);U(A,W),U(A,`
61
+ `)}W=X+1|0;continue}else break}U(B,i),U(B,"└"),U(B,e("─",J+2|0)),U(B,"┘"),U(B,b),U(B,`
62
+
63
+ `)}function UJ(z,A,B){switch(z.$tag){case 3:{let G=z,K=G._2,J=G._3,N=B.code_highlighter;if(N===void 0){let Q=B.str_width;if(Q===void 0){fB(K,J,A,void 0);return}else{fB(K,J,A,Q);return}}else{let S=N,V=fZ(K),W=S(V,J);U(A,W),U(A,`
62
64
 
63
65
  `);return}}case 9:{let G=z,K=G._0,J=G._2,N=B.str_width;if(N===void 0){HA(K,J,A,void 0);return}else{HA(K,J,A,N);return}}case 2:{let K=z._0;oA(K,A),U(A,`
64
66
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kawaz/mdp",
3
- "version": "0.1.4",
3
+ "version": "0.1.5",
4
4
  "description": "Terminal Markdown Preview CLI powered by MoonBit",
5
5
  "bin": {
6
6
  "mdp": "./bin/mdp.js"