react-markdown-table-ts 1.4.12 → 1.4.13
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/MarkdownTable.d.ts.map +1 -1
- package/dist/index.cjs +37 -37
- package/dist/index.mjs +247 -247
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MarkdownTable.d.ts","sourceRoot":"","sources":["../src/MarkdownTable.tsx"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,KAAK,EAAa,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAyJ7D,wBAAgB,aAAa,CAAC,EAC5B,SAAgB,EAChB,SAAgB,EAChB,gBAAqB,EACrB,SAAiB,EACjB,OAAe,EACf,UAAiB,EACjB,iBAAyB,EACzB,SAAS,EACT,UAAU,EACV,KAAe,EACf,QAAQ,EACR,UAAe,EACf,QAAQ,EACR,eAAsB,GACvB,EAAE,kBAAkB,
|
|
1
|
+
{"version":3,"file":"MarkdownTable.d.ts","sourceRoot":"","sources":["../src/MarkdownTable.tsx"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,KAAK,EAAa,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAyJ7D,wBAAgB,aAAa,CAAC,EAC5B,SAAgB,EAChB,SAAgB,EAChB,gBAAqB,EACrB,SAAiB,EACjB,OAAe,EACf,UAAiB,EACjB,iBAAyB,EACzB,SAAS,EACT,UAAU,EACV,KAAe,EACf,QAAQ,EACR,UAAe,EACf,QAAQ,EACR,eAAsB,GACvB,EAAE,kBAAkB,2CAyCpB"}
|
package/dist/index.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const V=require("react");var q={exports:{}},B={};/**
|
|
2
2
|
* @license React
|
|
3
3
|
* react-jsx-runtime.production.min.js
|
|
4
4
|
*
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
*
|
|
7
7
|
* This source code is licensed under the MIT license found in the
|
|
8
8
|
* LICENSE file in the root directory of this source tree.
|
|
9
|
-
*/var Se;function gr(){if(Se)return
|
|
9
|
+
*/var Se;function gr(){if(Se)return B;Se=1;var a=V,t=Symbol.for("react.element"),i=Symbol.for("react.fragment"),g=Object.prototype.hasOwnProperty,c=a.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,d={key:!0,ref:!0,__self:!0,__source:!0};function h(m,p,R){var y,E={},C=null,$=null;R!==void 0&&(C=""+R),p.key!==void 0&&(C=""+p.key),p.ref!==void 0&&($=p.ref);for(y in p)g.call(p,y)&&!d.hasOwnProperty(y)&&(E[y]=p[y]);if(m&&m.defaultProps)for(y in p=m.defaultProps,p)E[y]===void 0&&(E[y]=p[y]);return{$$typeof:t,type:m,key:C,ref:$,props:E,_owner:c.current}}return B.Fragment=i,B.jsx=h,B.jsxs=h,B}var z={};/**
|
|
10
10
|
* @license React
|
|
11
11
|
* react-jsx-runtime.development.js
|
|
12
12
|
*
|
|
@@ -14,24 +14,24 @@
|
|
|
14
14
|
*
|
|
15
15
|
* This source code is licensed under the MIT license found in the
|
|
16
16
|
* LICENSE file in the root directory of this source tree.
|
|
17
|
-
*/var ke;function
|
|
18
|
-
`+
|
|
17
|
+
*/var ke;function mr(){return ke||(ke=1,process.env.NODE_ENV!=="production"&&(function(){var a=V,t=Symbol.for("react.element"),i=Symbol.for("react.portal"),g=Symbol.for("react.fragment"),c=Symbol.for("react.strict_mode"),d=Symbol.for("react.profiler"),h=Symbol.for("react.provider"),m=Symbol.for("react.context"),p=Symbol.for("react.forward_ref"),R=Symbol.for("react.suspense"),y=Symbol.for("react.suspense_list"),E=Symbol.for("react.memo"),C=Symbol.for("react.lazy"),$=Symbol.for("react.offscreen"),S=Symbol.iterator,J="@@iterator";function M(e){if(e===null||typeof e!="object")return null;var r=S&&e[S]||e[J];return typeof r=="function"?r:null}var A=a.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function w(e){{for(var r=arguments.length,n=new Array(r>1?r-1:0),o=1;o<r;o++)n[o-1]=arguments[o];Pe("error",e,n)}}function Pe(e,r,n){{var o=A.ReactDebugCurrentFrame,u=o.getStackAddendum();u!==""&&(r+="%s",n=n.concat([u]));var f=n.map(function(l){return String(l)});f.unshift("Warning: "+r),Function.prototype.apply.call(console[e],console,f)}}var Ae=!1,Fe=!1,De=!1,We=!1,Me=!1,ne;ne=Symbol.for("react.module.reference");function Ye(e){return!!(typeof e=="string"||typeof e=="function"||e===g||e===d||Me||e===c||e===R||e===y||We||e===$||Ae||Fe||De||typeof e=="object"&&e!==null&&(e.$$typeof===C||e.$$typeof===E||e.$$typeof===h||e.$$typeof===m||e.$$typeof===p||e.$$typeof===ne||e.getModuleId!==void 0))}function Ne(e,r,n){var o=e.displayName;if(o)return o;var u=r.displayName||r.name||"";return u!==""?n+"("+u+")":n}function ae(e){return e.displayName||"Context"}function k(e){if(e==null)return null;if(typeof e.tag=="number"&&w("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case g:return"Fragment";case i:return"Portal";case d:return"Profiler";case c:return"StrictMode";case R:return"Suspense";case y:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case m:var r=e;return ae(r)+".Consumer";case h:var n=e;return ae(n._context)+".Provider";case p:return Ne(e,e.render,"ForwardRef");case E:var o=e.displayName||null;return o!==null?o:k(e.type)||"Memo";case C:{var u=e,f=u._payload,l=u._init;try{return k(l(f))}catch{return null}}}return null}var j=Object.assign,Y=0,oe,ie,se,le,ue,ce,fe;function de(){}de.__reactDisabledLog=!0;function Be(){{if(Y===0){oe=console.log,ie=console.info,se=console.warn,le=console.error,ue=console.group,ce=console.groupCollapsed,fe=console.groupEnd;var e={configurable:!0,enumerable:!0,value:de,writable:!0};Object.defineProperties(console,{info:e,log:e,warn:e,error:e,group:e,groupCollapsed:e,groupEnd:e})}Y++}}function ze(){{if(Y--,Y===0){var e={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:j({},e,{value:oe}),info:j({},e,{value:ie}),warn:j({},e,{value:se}),error:j({},e,{value:le}),group:j({},e,{value:ue}),groupCollapsed:j({},e,{value:ce}),groupEnd:j({},e,{value:fe})})}Y<0&&w("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var K=A.ReactCurrentDispatcher,X;function U(e,r,n){{if(X===void 0)try{throw Error()}catch(u){var o=u.stack.trim().match(/\n( *(at )?)/);X=o&&o[1]||""}return`
|
|
18
|
+
`+X+e}}var G=!1,L;{var Ve=typeof WeakMap=="function"?WeakMap:Map;L=new Ve}function ge(e,r){if(!e||G)return"";{var n=L.get(e);if(n!==void 0)return n}var o;G=!0;var u=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var f;f=K.current,K.current=null,Be();try{if(r){var l=function(){throw Error()};if(Object.defineProperty(l.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(l,[])}catch(T){o=T}Reflect.construct(e,[],l)}else{try{l.call()}catch(T){o=T}e.call(l.prototype)}}else{try{throw Error()}catch(T){o=T}e()}}catch(T){if(T&&o&&typeof T.stack=="string"){for(var s=T.stack.split(`
|
|
19
19
|
`),_=o.stack.split(`
|
|
20
20
|
`),v=s.length-1,b=_.length-1;v>=1&&b>=0&&s[v]!==_[b];)b--;for(;v>=1&&b>=0;v--,b--)if(s[v]!==_[b]){if(v!==1||b!==1)do if(v--,b--,b<0||s[v]!==_[b]){var x=`
|
|
21
|
-
`+s[v].replace(" at new "," at ");return e.displayName&&x.includes("<anonymous>")&&(x=x.replace("<anonymous>",e.displayName)),typeof e=="function"&&
|
|
21
|
+
`+s[v].replace(" at new "," at ");return e.displayName&&x.includes("<anonymous>")&&(x=x.replace("<anonymous>",e.displayName)),typeof e=="function"&&L.set(e,x),x}while(v>=1&&b>=0);break}}}finally{G=!1,K.current=f,ze(),Error.prepareStackTrace=u}var D=e?e.displayName||e.name:"",O=D?U(D):"";return typeof e=="function"&&L.set(e,O),O}function Ue(e,r,n){return ge(e,!1)}function Le(e){var r=e.prototype;return!!(r&&r.isReactComponent)}function I(e,r,n){if(e==null)return"";if(typeof e=="function")return ge(e,Le(e));if(typeof e=="string")return U(e);switch(e){case R:return U("Suspense");case y:return U("SuspenseList")}if(typeof e=="object")switch(e.$$typeof){case p:return Ue(e.render);case E:return I(e.type,r,n);case C:{var o=e,u=o._payload,f=o._init;try{return I(f(u),r,n)}catch{}}}return""}var N=Object.prototype.hasOwnProperty,me={},pe=A.ReactDebugCurrentFrame;function H(e){if(e){var r=e._owner,n=I(e.type,e._source,r?r.type:null);pe.setExtraStackFrame(n)}else pe.setExtraStackFrame(null)}function Ie(e,r,n,o,u){{var f=Function.call.bind(N);for(var l in e)if(f(e,l)){var s=void 0;try{if(typeof e[l]!="function"){var _=Error((o||"React class")+": "+n+" type `"+l+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof e[l]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw _.name="Invariant Violation",_}s=e[l](r,l,o,n,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(v){s=v}s&&!(s instanceof Error)&&(H(u),w("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",o||"React class",n,l,typeof s),H(null)),s instanceof Error&&!(s.message in me)&&(me[s.message]=!0,H(u),w("Failed %s type: %s",n,s.message),H(null))}}}var He=Array.isArray;function Z(e){return He(e)}function qe(e){{var r=typeof Symbol=="function"&&Symbol.toStringTag,n=r&&e[Symbol.toStringTag]||e.constructor.name||"Object";return n}}function Je(e){try{return he(e),!1}catch{return!0}}function he(e){return""+e}function ve(e){if(Je(e))return w("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",qe(e)),he(e)}var be=A.ReactCurrentOwner,Ke={key:!0,ref:!0,__self:!0,__source:!0},ye,Re;function Xe(e){if(N.call(e,"ref")){var r=Object.getOwnPropertyDescriptor(e,"ref").get;if(r&&r.isReactWarning)return!1}return e.ref!==void 0}function Ge(e){if(N.call(e,"key")){var r=Object.getOwnPropertyDescriptor(e,"key").get;if(r&&r.isReactWarning)return!1}return e.key!==void 0}function Ze(e,r){typeof e.ref=="string"&&be.current}function Qe(e,r){{var n=function(){ye||(ye=!0,w("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",r))};n.isReactWarning=!0,Object.defineProperty(e,"key",{get:n,configurable:!0})}}function er(e,r){{var n=function(){Re||(Re=!0,w("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",r))};n.isReactWarning=!0,Object.defineProperty(e,"ref",{get:n,configurable:!0})}}var rr=function(e,r,n,o,u,f,l){var s={$$typeof:t,type:e,key:r,ref:n,props:l,_owner:f};return s._store={},Object.defineProperty(s._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(s,"_self",{configurable:!1,enumerable:!1,writable:!1,value:o}),Object.defineProperty(s,"_source",{configurable:!1,enumerable:!1,writable:!1,value:u}),Object.freeze&&(Object.freeze(s.props),Object.freeze(s)),s};function tr(e,r,n,o,u){{var f,l={},s=null,_=null;n!==void 0&&(ve(n),s=""+n),Ge(r)&&(ve(r.key),s=""+r.key),Xe(r)&&(_=r.ref,Ze(r,u));for(f in r)N.call(r,f)&&!Ke.hasOwnProperty(f)&&(l[f]=r[f]);if(e&&e.defaultProps){var v=e.defaultProps;for(f in v)l[f]===void 0&&(l[f]=v[f])}if(s||_){var b=typeof e=="function"?e.displayName||e.name||"Unknown":e;s&&Qe(l,b),_&&er(l,b)}return rr(e,s,_,u,o,be.current,l)}}var Q=A.ReactCurrentOwner,Ee=A.ReactDebugCurrentFrame;function F(e){if(e){var r=e._owner,n=I(e.type,e._source,r?r.type:null);Ee.setExtraStackFrame(n)}else Ee.setExtraStackFrame(null)}var ee;ee=!1;function re(e){return typeof e=="object"&&e!==null&&e.$$typeof===t}function we(){{if(Q.current){var e=k(Q.current.type);if(e)return`
|
|
22
22
|
|
|
23
|
-
Check the render method of \``+e+"`."}return""}}function nr(e){return""}var
|
|
23
|
+
Check the render method of \``+e+"`."}return""}}function nr(e){return""}var _e={};function ar(e){{var r=we();if(!r){var n=typeof e=="string"?e:e.displayName||e.name;n&&(r=`
|
|
24
24
|
|
|
25
|
-
Check the top-level render call using <`+n+">.")}return r}}function
|
|
25
|
+
Check the top-level render call using <`+n+">.")}return r}}function Ce(e,r){{if(!e._store||e._store.validated||e.key!=null)return;e._store.validated=!0;var n=ar(r);if(_e[n])return;_e[n]=!0;var o="";e&&e._owner&&e._owner!==Q.current&&(o=" It was passed a child from "+k(e._owner.type)+"."),F(e),w('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',n,o),F(null)}}function Te(e,r){{if(typeof e!="object")return;if(Z(e))for(var n=0;n<e.length;n++){var o=e[n];re(o)&&Ce(o,r)}else if(re(e))e._store&&(e._store.validated=!0);else if(e){var u=M(e);if(typeof u=="function"&&u!==e.entries)for(var f=u.call(e),l;!(l=f.next()).done;)re(l.value)&&Ce(l.value,r)}}}function or(e){{var r=e.type;if(r==null||typeof r=="string")return;var n;if(typeof r=="function")n=r.propTypes;else if(typeof r=="object"&&(r.$$typeof===p||r.$$typeof===E))n=r.propTypes;else return;if(n){var o=k(r);Ie(n,e.props,"prop",o,e)}else if(r.PropTypes!==void 0&&!ee){ee=!0;var u=k(r);w("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",u||"Unknown")}typeof r.getDefaultProps=="function"&&!r.getDefaultProps.isReactClassApproved&&w("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function ir(e){{for(var r=Object.keys(e.props),n=0;n<r.length;n++){var o=r[n];if(o!=="children"&&o!=="key"){F(e),w("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",o),F(null);break}}e.ref!==null&&(F(e),w("Invalid attribute `ref` supplied to `React.Fragment`."),F(null))}}var xe={};function $e(e,r,n,o,u,f){{var l=Ye(e);if(!l){var s="";(e===void 0||typeof e=="object"&&e!==null&&Object.keys(e).length===0)&&(s+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var _=nr();_?s+=_:s+=we();var v;e===null?v="null":Z(e)?v="array":e!==void 0&&e.$$typeof===t?(v="<"+(k(e.type)||"Unknown")+" />",s=" Did you accidentally export a JSX literal instead of a component?"):v=typeof e,w("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",v,s)}var b=tr(e,r,n,u,f);if(b==null)return b;if(l){var x=r.children;if(x!==void 0)if(o)if(Z(x)){for(var D=0;D<x.length;D++)Te(x[D],e);Object.freeze&&Object.freeze(x)}else w("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else Te(x,e)}if(N.call(r,"key")){var O=k(e),T=Object.keys(r).filter(function(dr){return dr!=="key"}),te=T.length>0?"{key: someKey, "+T.join(": ..., ")+": ...}":"{key: someKey}";if(!xe[O+te]){var fr=T.length>0?"{"+T.join(": ..., ")+": ...}":"{}";w(`A props object containing a "key" prop is being spread into JSX:
|
|
26
26
|
let props = %s;
|
|
27
27
|
<%s {...props} />
|
|
28
28
|
React keys must be passed directly to JSX without using spread:
|
|
29
29
|
let props = %s;
|
|
30
|
-
<%s key={someKey} {...props} />`,
|
|
31
|
-
`).map((S
|
|
30
|
+
<%s key={someKey} {...props} />`,te,O,fr,O),xe[O+te]=!0}}return e===g?ir(b):or(b),b}}function sr(e,r,n){return $e(e,r,n,!0)}function lr(e,r,n){return $e(e,r,n,!1)}var ur=lr,cr=sr;z.Fragment=g,z.jsx=ur,z.jsxs=cr})()),z}var je;function pr(){return je||(je=1,process.env.NODE_ENV==="production"?q.exports=gr():q.exports=mr()),q.exports}var P=pr();function hr({children:a,showLineNumbers:t=!1,startLine:i=1,className:g="",style:c={},topPadding:d=16,codeStyle:h={}}){const R=(typeof a=="string"?a:"").split(`
|
|
31
|
+
`).map(($,S)=>i+S),y={position:"relative",counterReset:`linenumber ${i-1}`,paddingTop:0,...t?{paddingLeft:"1em"}:{},...c},E={display:"block",paddingTop:`${d}px`,paddingLeft:t?"3em":"0.3em",...h},C={position:"absolute",pointerEvents:"none",top:`${d}px`,fontSize:"100%",left:"0em",width:"2.5em",letterSpacing:"-1px",borderRight:"1px solid #999",userSelect:"none",lineHeight:"1.5"};return P.jsxs("pre",{className:`language-markdown ${t?"line-numbers":""} ${g}`.trim(),"data-start":i,style:y,children:[P.jsx("code",{className:"language-markdown",style:E,children:a}),t&&P.jsx("span",{className:"line-numbers-rows","aria-hidden":"true",style:C,children:R.map(($,S)=>P.jsx("span",{style:{display:"block",textAlign:"right",paddingRight:"0.8em",color:"#999",lineHeight:"1.5"},children:$},S))})]})}function Oe(a){let t;return a.useTabs?t=" ":a.hasPadding?t=" ":t="",t}class vr{padding;constructor(t){this.padding=Oe(t)}formatCell(t,i,g){const c=g;switch(i){case"right":return`${this.padding}${t.padStart(c)}${this.padding}`;case"center":{const d=c-t.length,h=Math.floor(d/2),m=d-h;return`${this.padding}${" ".repeat(h)}${t}${" ".repeat(m)}${this.padding}`}default:return`${this.padding}${t.padEnd(c)}${this.padding}`}}}class br{static indicators={left:t=>`:${"-".repeat(t-1)}`,right:t=>`${"-".repeat(t-1)}:`,center:t=>`:${"-".repeat(t-2)}:`,none:t=>"-".repeat(t)};static formatIndicator(t,i){return this.indicators[t](i)}}class yr{config;cellFormatter;adjustedAlignments;constructor(t){this.config=t,this.cellFormatter=new vr(t),this.adjustedAlignments=this.getAdjustedAlignments()}getAdjustedAlignments(){return this.config.columnAlignments.length<this.config.columnCount?[...Array.from(this.config.columnAlignments),...Array(this.config.columnCount-this.config.columnAlignments.length).fill("none")]:Array.from(this.config.columnAlignments)}formatRow(t){return`|${Array.from({length:this.config.columnCount},(g,c)=>{let d=t[c]??"";this.config.replaceNewlines&&(d=d.replace(/\n/g,"<br>"));const h=this.adjustedAlignments[c],m=this.config.columnWidths?this.config.columnWidths[c]:d.length;return this.cellFormatter.formatCell(d,h,m)}).join("|")}|`}formatAlignmentRow(){const t=Oe(this.config);return`|${Array.from({length:this.config.columnCount},(g,c)=>{const d=this.adjustedAlignments[c],h=this.config.columnWidths?this.config.columnWidths[c]:3,m=br.formatIndicator(d,h);return`${t}${m}${t}`}).join("|")}|`}}function Rr(a,t){const i=new Array(t).fill(3);return a.forEach(g=>{for(let c=0;c<t;c++){const d=g[c]??"";i[c]=Math.max(i[c],d.length)}}),i}function Er(a){const t=a.inputDataHeader.length,i=a.inputDataBody.map(g=>g.length);return Math.max(t,...i)}function wr(a,t,i){return i?Rr([a.inputDataHeader,...a.inputDataBody],t):void 0}function _r(a,t,i=!0,g=!1,c=!1,d=!0){const h=Er(a),m=wr(a,h,i),p={columnCount:h,columnAlignments:t,columnWidths:m,useTabs:g,replaceNewlines:c,hasPadding:d},R=new yr(p),y=R.formatRow(a.inputDataHeader),E=R.formatAlignmentRow(),C=a.inputDataBody.map($=>R.formatRow($)).join(`
|
|
32
32
|
`);return`${y}
|
|
33
33
|
${E}
|
|
34
|
-
${C}`.trimEnd()}function Cr(a){let t="",i=a;for(;i>=0;)t=String.fromCharCode(i%26+65)+t,i=Math.floor(i/26)-1;return t}function Tr(a){return Array.from({length:a},(t,i)=>Cr(i))}class
|
|
34
|
+
${C}`.trimEnd()}function Cr(a){let t="",i=a;for(;i>=0;)t=String.fromCharCode(i%26+65)+t,i=Math.floor(i/26)-1;return t}function Tr(a){return Array.from({length:a},(t,i)=>Cr(i))}class W extends Error{constructor(t,i){super(t,i),this.name="MarkdownTableError",Object.setPrototypeOf(this,W.prototype)}}function xr(a){if(a===null||!Array.isArray(a))throw new W("The 'data' prop must be a two-dimensional array.");if(a.length===0)throw new W("The 'data' array must contain at least one row.")}function $r(a){return a==="light"?{textColor:"#000",textShadow:"0 1px #fff",background:"#f5f2f0",selectionBackground:"#b3d4fc"}:{textColor:"#f8f8f2",textShadow:"0 1px rgba(0,0,0,.3)",background:"#282a36",selectionBackground:"#b3d4fc",borderRadius:".3em"}}function Sr(a,t){const i=$r(a),g=`
|
|
35
35
|
font-family: Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace;
|
|
36
36
|
font-size: 1em;
|
|
37
37
|
text-align: left;
|
|
@@ -48,55 +48,55 @@ ${C}`.trimEnd()}function Cr(a){let t="",i=a;for(;i>=0;)t=String.fromCharCode(i%2
|
|
|
48
48
|
-ms-hyphens: none;
|
|
49
49
|
hyphens: none;
|
|
50
50
|
`.replace(/\s{2,}/g,"");return`
|
|
51
|
-
code[class*=language-], pre[class*=language-] {
|
|
52
|
-
color: ${
|
|
51
|
+
#${t} code[class*=language-], #${t} pre[class*=language-] {
|
|
52
|
+
color: ${i.textColor};
|
|
53
53
|
background: 0 0;
|
|
54
|
-
text-shadow: ${
|
|
55
|
-
${
|
|
54
|
+
text-shadow: ${i.textShadow};
|
|
55
|
+
${g}
|
|
56
56
|
}
|
|
57
|
-
code[class*=language-] ::-moz-selection,
|
|
58
|
-
code[class*=language-]::-moz-selection,
|
|
59
|
-
pre[class*=language-] ::-moz-selection,
|
|
60
|
-
pre[class*=language-]::-moz-selection {
|
|
57
|
+
#${t} code[class*=language-] ::-moz-selection,
|
|
58
|
+
#${t} code[class*=language-]::-moz-selection,
|
|
59
|
+
#${t} pre[class*=language-] ::-moz-selection,
|
|
60
|
+
#${t} pre[class*=language-]::-moz-selection {
|
|
61
61
|
text-shadow: none;
|
|
62
|
-
background: ${
|
|
62
|
+
background: ${i.selectionBackground};
|
|
63
63
|
}
|
|
64
|
-
code[class*=language-] ::selection,
|
|
65
|
-
code[class*=language-]::selection,
|
|
66
|
-
pre[class*=language-] ::selection,
|
|
67
|
-
pre[class*=language-]::selection {
|
|
64
|
+
#${t} code[class*=language-] ::selection,
|
|
65
|
+
#${t} code[class*=language-]::selection,
|
|
66
|
+
#${t} pre[class*=language-] ::selection,
|
|
67
|
+
#${t} pre[class*=language-]::selection {
|
|
68
68
|
text-shadow: none;
|
|
69
|
-
background: ${
|
|
69
|
+
background: ${i.selectionBackground};
|
|
70
70
|
}
|
|
71
71
|
@media print {
|
|
72
|
-
code[class*=language-], pre[class*=language-] {
|
|
72
|
+
#${t} code[class*=language-], #${t} pre[class*=language-] {
|
|
73
73
|
text-shadow: none;
|
|
74
74
|
}
|
|
75
75
|
}
|
|
76
|
-
pre[class*=language-] {
|
|
76
|
+
#${t} pre[class*=language-] {
|
|
77
77
|
padding: 1em;
|
|
78
78
|
margin: .5em 0;
|
|
79
|
-
overflow: visible${
|
|
80
|
-
border-radius: ${
|
|
79
|
+
overflow: visible${i.borderRadius?`;
|
|
80
|
+
border-radius: ${i.borderRadius}`:""};
|
|
81
81
|
}
|
|
82
|
-
:not(pre) > code[class*=language-],
|
|
83
|
-
pre[class*=language-] {
|
|
84
|
-
background: ${
|
|
82
|
+
#${t} :not(pre) > code[class*=language-],
|
|
83
|
+
#${t} pre[class*=language-] {
|
|
84
|
+
background: ${i.background};
|
|
85
85
|
}
|
|
86
|
-
:not(pre) > code[class*=language-] {
|
|
86
|
+
#${t} :not(pre) > code[class*=language-] {
|
|
87
87
|
padding: .1em;
|
|
88
88
|
border-radius: .3em;
|
|
89
89
|
white-space: normal;
|
|
90
90
|
}
|
|
91
|
-
pre[class*=language-].line-numbers {
|
|
91
|
+
#${t} pre[class*=language-].line-numbers {
|
|
92
92
|
position: relative;
|
|
93
93
|
padding-left: 3.8em;
|
|
94
94
|
}
|
|
95
|
-
pre[class*=language-].line-numbers > code {
|
|
95
|
+
#${t} pre[class*=language-].line-numbers > code {
|
|
96
96
|
position: relative;
|
|
97
97
|
white-space: inherit;
|
|
98
98
|
}
|
|
99
|
-
.line-numbers .line-numbers-rows {
|
|
99
|
+
#${t} .line-numbers .line-numbers-rows {
|
|
100
100
|
position: absolute;
|
|
101
101
|
pointer-events: none;
|
|
102
102
|
top: 0;
|
|
@@ -110,7 +110,7 @@ pre[class*=language-].line-numbers > code {
|
|
|
110
110
|
-ms-user-select: none;
|
|
111
111
|
user-select: none;
|
|
112
112
|
}
|
|
113
|
-
.line-numbers-rows > span {
|
|
113
|
+
#${t} .line-numbers-rows > span {
|
|
114
114
|
display: block;
|
|
115
115
|
}
|
|
116
|
-
`.trim()}function
|
|
116
|
+
`.trim()}function kr(a,t){return t?{inputDataHeader:a[0],inputDataBody:a.slice(1)}:{inputDataHeader:Tr(a[0].length),inputDataBody:a}}function jr(a,t,i,g,c,d,h){try{xr(a);const{inputDataHeader:m,inputDataBody:p}=kr(a,t);return _r({inputDataHeader:m,inputDataBody:p},i,g,c,d,h)}catch(m){if(m instanceof W)return`Error: ${m.message}`;throw m}}function Or({inputData:a=null,hasHeader:t=!0,columnAlignments:i=[],isCompact:g=!1,hasTabs:c=!1,hasPadding:d=!0,convertLineBreaks:h=!1,className:m,onGenerate:p,theme:R="light",preStyle:y,topPadding:E=16,minWidth:C,showLineNumbers:$=!0}){const S=V.useId().replace(/:/g,"_"),J=V.useDeferredValue(a),M=jr(J,t,i,!g,c,h,d);return V.useEffect(()=>{p&&p(M)},[M,p]),P.jsxs("div",{id:S,children:[P.jsx("style",{children:Sr(R,S)}),P.jsx(hr,{showLineNumbers:$,className:`${R==="dark"?"dark-theme":""} ${m||""}`.trim(),topPadding:E,style:{position:"relative",isolation:"isolate",display:"inline-block",width:"fit-content",minWidth:C?`${C}px`:"min-content",margin:0,...y},children:M})]})}exports.MarkdownTable=Or;exports.MarkdownTableError=W;
|
package/dist/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import je, {
|
|
2
|
-
var H = { exports: {} },
|
|
1
|
+
import je, { useId as gr, useDeferredValue as mr, useEffect as pr } from "react";
|
|
2
|
+
var H = { exports: {} }, N = {};
|
|
3
3
|
/**
|
|
4
4
|
* @license React
|
|
5
5
|
* react-jsx-runtime.production.min.js
|
|
@@ -9,21 +9,21 @@ var H = { exports: {} }, Y = {};
|
|
|
9
9
|
* This source code is licensed under the MIT license found in the
|
|
10
10
|
* LICENSE file in the root directory of this source tree.
|
|
11
11
|
*/
|
|
12
|
-
var
|
|
13
|
-
function
|
|
14
|
-
if (
|
|
15
|
-
|
|
16
|
-
var a = je, t = Symbol.for("react.element"), i = Symbol.for("react.fragment"),
|
|
17
|
-
function h(
|
|
18
|
-
var y, E = {}, C = null,
|
|
19
|
-
R !== void 0 && (C = "" + R), p.key !== void 0 && (C = "" + p.key), p.ref !== void 0 && (
|
|
20
|
-
for (y in p)
|
|
21
|
-
if (
|
|
22
|
-
return { $$typeof: t, type:
|
|
12
|
+
var $e;
|
|
13
|
+
function hr() {
|
|
14
|
+
if ($e) return N;
|
|
15
|
+
$e = 1;
|
|
16
|
+
var a = je, t = Symbol.for("react.element"), i = Symbol.for("react.fragment"), g = Object.prototype.hasOwnProperty, c = a.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, d = { key: !0, ref: !0, __self: !0, __source: !0 };
|
|
17
|
+
function h(m, p, R) {
|
|
18
|
+
var y, E = {}, C = null, $ = null;
|
|
19
|
+
R !== void 0 && (C = "" + R), p.key !== void 0 && (C = "" + p.key), p.ref !== void 0 && ($ = p.ref);
|
|
20
|
+
for (y in p) g.call(p, y) && !d.hasOwnProperty(y) && (E[y] = p[y]);
|
|
21
|
+
if (m && m.defaultProps) for (y in p = m.defaultProps, p) E[y] === void 0 && (E[y] = p[y]);
|
|
22
|
+
return { $$typeof: t, type: m, key: C, ref: $, props: E, _owner: c.current };
|
|
23
23
|
}
|
|
24
|
-
return
|
|
24
|
+
return N.Fragment = i, N.jsx = h, N.jsxs = h, N;
|
|
25
25
|
}
|
|
26
|
-
var
|
|
26
|
+
var B = {};
|
|
27
27
|
/**
|
|
28
28
|
* @license React
|
|
29
29
|
* react-jsx-runtime.development.js
|
|
@@ -34,13 +34,13 @@ var N = {};
|
|
|
34
34
|
* LICENSE file in the root directory of this source tree.
|
|
35
35
|
*/
|
|
36
36
|
var Se;
|
|
37
|
-
function
|
|
37
|
+
function vr() {
|
|
38
38
|
return Se || (Se = 1, process.env.NODE_ENV !== "production" && (function() {
|
|
39
|
-
var a = je, t = Symbol.for("react.element"), i = Symbol.for("react.portal"),
|
|
40
|
-
function
|
|
39
|
+
var a = je, t = Symbol.for("react.element"), i = Symbol.for("react.portal"), g = Symbol.for("react.fragment"), c = Symbol.for("react.strict_mode"), d = Symbol.for("react.profiler"), h = Symbol.for("react.provider"), m = Symbol.for("react.context"), p = Symbol.for("react.forward_ref"), R = Symbol.for("react.suspense"), y = Symbol.for("react.suspense_list"), E = Symbol.for("react.memo"), C = Symbol.for("react.lazy"), $ = Symbol.for("react.offscreen"), S = Symbol.iterator, J = "@@iterator";
|
|
40
|
+
function W(e) {
|
|
41
41
|
if (e === null || typeof e != "object")
|
|
42
42
|
return null;
|
|
43
|
-
var r =
|
|
43
|
+
var r = S && e[S] || e[J];
|
|
44
44
|
return typeof r == "function" ? r : null;
|
|
45
45
|
}
|
|
46
46
|
var A = a.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
|
@@ -48,10 +48,10 @@ function hr() {
|
|
|
48
48
|
{
|
|
49
49
|
for (var r = arguments.length, n = new Array(r > 1 ? r - 1 : 0), o = 1; o < r; o++)
|
|
50
50
|
n[o - 1] = arguments[o];
|
|
51
|
-
|
|
51
|
+
Pe("error", e, n);
|
|
52
52
|
}
|
|
53
53
|
}
|
|
54
|
-
function
|
|
54
|
+
function Pe(e, r, n) {
|
|
55
55
|
{
|
|
56
56
|
var o = A.ReactDebugCurrentFrame, u = o.getStackAddendum();
|
|
57
57
|
u !== "" && (r += "%s", n = n.concat([u]));
|
|
@@ -61,26 +61,26 @@ function hr() {
|
|
|
61
61
|
f.unshift("Warning: " + r), Function.prototype.apply.call(console[e], console, f);
|
|
62
62
|
}
|
|
63
63
|
}
|
|
64
|
-
var Ae = !1, Fe = !1, De = !1,
|
|
65
|
-
|
|
66
|
-
function
|
|
67
|
-
return !!(typeof e == "string" || typeof e == "function" || e ===
|
|
64
|
+
var Ae = !1, Fe = !1, De = !1, We = !1, Me = !1, te;
|
|
65
|
+
te = Symbol.for("react.module.reference");
|
|
66
|
+
function Ye(e) {
|
|
67
|
+
return !!(typeof e == "string" || typeof e == "function" || e === g || e === d || Me || e === c || e === R || e === y || We || e === $ || Ae || Fe || De || typeof e == "object" && e !== null && (e.$$typeof === C || e.$$typeof === E || e.$$typeof === h || e.$$typeof === m || e.$$typeof === p || // This needs to include all possible module reference object
|
|
68
68
|
// types supported by any Flight configuration anywhere since
|
|
69
69
|
// we don't know which Flight build this will end up being used
|
|
70
70
|
// with.
|
|
71
|
-
e.$$typeof ===
|
|
71
|
+
e.$$typeof === te || e.getModuleId !== void 0));
|
|
72
72
|
}
|
|
73
|
-
function
|
|
73
|
+
function Ne(e, r, n) {
|
|
74
74
|
var o = e.displayName;
|
|
75
75
|
if (o)
|
|
76
76
|
return o;
|
|
77
77
|
var u = r.displayName || r.name || "";
|
|
78
78
|
return u !== "" ? n + "(" + u + ")" : n;
|
|
79
79
|
}
|
|
80
|
-
function
|
|
80
|
+
function ne(e) {
|
|
81
81
|
return e.displayName || "Context";
|
|
82
82
|
}
|
|
83
|
-
function
|
|
83
|
+
function k(e) {
|
|
84
84
|
if (e == null)
|
|
85
85
|
return null;
|
|
86
86
|
if (typeof e.tag == "number" && w("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), typeof e == "function")
|
|
@@ -88,7 +88,7 @@ function hr() {
|
|
|
88
88
|
if (typeof e == "string")
|
|
89
89
|
return e;
|
|
90
90
|
switch (e) {
|
|
91
|
-
case
|
|
91
|
+
case g:
|
|
92
92
|
return "Fragment";
|
|
93
93
|
case i:
|
|
94
94
|
return "Portal";
|
|
@@ -103,21 +103,21 @@ function hr() {
|
|
|
103
103
|
}
|
|
104
104
|
if (typeof e == "object")
|
|
105
105
|
switch (e.$$typeof) {
|
|
106
|
-
case
|
|
106
|
+
case m:
|
|
107
107
|
var r = e;
|
|
108
|
-
return
|
|
108
|
+
return ne(r) + ".Consumer";
|
|
109
109
|
case h:
|
|
110
110
|
var n = e;
|
|
111
|
-
return
|
|
111
|
+
return ne(n._context) + ".Provider";
|
|
112
112
|
case p:
|
|
113
|
-
return
|
|
113
|
+
return Ne(e, e.render, "ForwardRef");
|
|
114
114
|
case E:
|
|
115
115
|
var o = e.displayName || null;
|
|
116
|
-
return o !== null ? o :
|
|
116
|
+
return o !== null ? o : k(e.type) || "Memo";
|
|
117
117
|
case C: {
|
|
118
118
|
var u = e, f = u._payload, l = u._init;
|
|
119
119
|
try {
|
|
120
|
-
return
|
|
120
|
+
return k(l(f));
|
|
121
121
|
} catch {
|
|
122
122
|
return null;
|
|
123
123
|
}
|
|
@@ -125,18 +125,18 @@ function hr() {
|
|
|
125
125
|
}
|
|
126
126
|
return null;
|
|
127
127
|
}
|
|
128
|
-
var
|
|
129
|
-
function
|
|
128
|
+
var j = Object.assign, M = 0, ae, oe, ie, se, le, ue, ce;
|
|
129
|
+
function fe() {
|
|
130
130
|
}
|
|
131
|
-
|
|
132
|
-
function
|
|
131
|
+
fe.__reactDisabledLog = !0;
|
|
132
|
+
function Be() {
|
|
133
133
|
{
|
|
134
|
-
if (
|
|
135
|
-
|
|
134
|
+
if (M === 0) {
|
|
135
|
+
ae = console.log, oe = console.info, ie = console.warn, se = console.error, le = console.group, ue = console.groupCollapsed, ce = console.groupEnd;
|
|
136
136
|
var e = {
|
|
137
137
|
configurable: !0,
|
|
138
138
|
enumerable: !0,
|
|
139
|
-
value:
|
|
139
|
+
value: fe,
|
|
140
140
|
writable: !0
|
|
141
141
|
};
|
|
142
142
|
Object.defineProperties(console, {
|
|
@@ -149,77 +149,77 @@ function hr() {
|
|
|
149
149
|
groupEnd: e
|
|
150
150
|
});
|
|
151
151
|
}
|
|
152
|
-
|
|
152
|
+
M++;
|
|
153
153
|
}
|
|
154
154
|
}
|
|
155
|
-
function
|
|
155
|
+
function ze() {
|
|
156
156
|
{
|
|
157
|
-
if (
|
|
157
|
+
if (M--, M === 0) {
|
|
158
158
|
var e = {
|
|
159
159
|
configurable: !0,
|
|
160
160
|
enumerable: !0,
|
|
161
161
|
writable: !0
|
|
162
162
|
};
|
|
163
163
|
Object.defineProperties(console, {
|
|
164
|
-
log:
|
|
165
|
-
value: ne
|
|
166
|
-
}),
|
|
167
|
-
info: P({}, e, {
|
|
164
|
+
log: j({}, e, {
|
|
168
165
|
value: ae
|
|
169
166
|
}),
|
|
170
|
-
|
|
167
|
+
info: j({}, e, {
|
|
171
168
|
value: oe
|
|
172
169
|
}),
|
|
173
|
-
|
|
170
|
+
warn: j({}, e, {
|
|
174
171
|
value: ie
|
|
175
172
|
}),
|
|
176
|
-
|
|
173
|
+
error: j({}, e, {
|
|
177
174
|
value: se
|
|
178
175
|
}),
|
|
179
|
-
|
|
176
|
+
group: j({}, e, {
|
|
180
177
|
value: le
|
|
181
178
|
}),
|
|
182
|
-
|
|
179
|
+
groupCollapsed: j({}, e, {
|
|
183
180
|
value: ue
|
|
181
|
+
}),
|
|
182
|
+
groupEnd: j({}, e, {
|
|
183
|
+
value: ce
|
|
184
184
|
})
|
|
185
185
|
});
|
|
186
186
|
}
|
|
187
|
-
|
|
187
|
+
M < 0 && w("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
|
|
188
188
|
}
|
|
189
189
|
}
|
|
190
|
-
var
|
|
191
|
-
function
|
|
190
|
+
var q = A.ReactCurrentDispatcher, K;
|
|
191
|
+
function V(e, r, n) {
|
|
192
192
|
{
|
|
193
|
-
if (
|
|
193
|
+
if (K === void 0)
|
|
194
194
|
try {
|
|
195
195
|
throw Error();
|
|
196
196
|
} catch (u) {
|
|
197
197
|
var o = u.stack.trim().match(/\n( *(at )?)/);
|
|
198
|
-
|
|
198
|
+
K = o && o[1] || "";
|
|
199
199
|
}
|
|
200
200
|
return `
|
|
201
|
-
` +
|
|
201
|
+
` + K + e;
|
|
202
202
|
}
|
|
203
203
|
}
|
|
204
|
-
var
|
|
204
|
+
var X = !1, U;
|
|
205
205
|
{
|
|
206
|
-
var
|
|
207
|
-
|
|
206
|
+
var Ve = typeof WeakMap == "function" ? WeakMap : Map;
|
|
207
|
+
U = new Ve();
|
|
208
208
|
}
|
|
209
|
-
function
|
|
210
|
-
if (!e ||
|
|
209
|
+
function de(e, r) {
|
|
210
|
+
if (!e || X)
|
|
211
211
|
return "";
|
|
212
212
|
{
|
|
213
|
-
var n =
|
|
213
|
+
var n = U.get(e);
|
|
214
214
|
if (n !== void 0)
|
|
215
215
|
return n;
|
|
216
216
|
}
|
|
217
217
|
var o;
|
|
218
|
-
|
|
218
|
+
X = !0;
|
|
219
219
|
var u = Error.prepareStackTrace;
|
|
220
220
|
Error.prepareStackTrace = void 0;
|
|
221
221
|
var f;
|
|
222
|
-
f =
|
|
222
|
+
f = q.current, q.current = null, Be();
|
|
223
223
|
try {
|
|
224
224
|
if (r) {
|
|
225
225
|
var l = function() {
|
|
@@ -265,65 +265,65 @@ function hr() {
|
|
|
265
265
|
if (v--, b--, b < 0 || s[v] !== _[b]) {
|
|
266
266
|
var T = `
|
|
267
267
|
` + s[v].replace(" at new ", " at ");
|
|
268
|
-
return e.displayName && T.includes("<anonymous>") && (T = T.replace("<anonymous>", e.displayName)), typeof e == "function" &&
|
|
268
|
+
return e.displayName && T.includes("<anonymous>") && (T = T.replace("<anonymous>", e.displayName)), typeof e == "function" && U.set(e, T), T;
|
|
269
269
|
}
|
|
270
270
|
while (v >= 1 && b >= 0);
|
|
271
271
|
break;
|
|
272
272
|
}
|
|
273
273
|
}
|
|
274
274
|
} finally {
|
|
275
|
-
|
|
275
|
+
X = !1, q.current = f, ze(), Error.prepareStackTrace = u;
|
|
276
276
|
}
|
|
277
|
-
var D = e ? e.displayName || e.name : "",
|
|
278
|
-
return typeof e == "function" &&
|
|
277
|
+
var D = e ? e.displayName || e.name : "", O = D ? V(D) : "";
|
|
278
|
+
return typeof e == "function" && U.set(e, O), O;
|
|
279
279
|
}
|
|
280
|
-
function
|
|
281
|
-
return
|
|
280
|
+
function Ue(e, r, n) {
|
|
281
|
+
return de(e, !1);
|
|
282
282
|
}
|
|
283
|
-
function
|
|
283
|
+
function Le(e) {
|
|
284
284
|
var r = e.prototype;
|
|
285
285
|
return !!(r && r.isReactComponent);
|
|
286
286
|
}
|
|
287
|
-
function
|
|
287
|
+
function L(e, r, n) {
|
|
288
288
|
if (e == null)
|
|
289
289
|
return "";
|
|
290
290
|
if (typeof e == "function")
|
|
291
|
-
return
|
|
291
|
+
return de(e, Le(e));
|
|
292
292
|
if (typeof e == "string")
|
|
293
|
-
return
|
|
293
|
+
return V(e);
|
|
294
294
|
switch (e) {
|
|
295
295
|
case R:
|
|
296
|
-
return
|
|
296
|
+
return V("Suspense");
|
|
297
297
|
case y:
|
|
298
|
-
return
|
|
298
|
+
return V("SuspenseList");
|
|
299
299
|
}
|
|
300
300
|
if (typeof e == "object")
|
|
301
301
|
switch (e.$$typeof) {
|
|
302
302
|
case p:
|
|
303
|
-
return
|
|
303
|
+
return Ue(e.render);
|
|
304
304
|
case E:
|
|
305
|
-
return
|
|
305
|
+
return L(e.type, r, n);
|
|
306
306
|
case C: {
|
|
307
307
|
var o = e, u = o._payload, f = o._init;
|
|
308
308
|
try {
|
|
309
|
-
return
|
|
309
|
+
return L(f(u), r, n);
|
|
310
310
|
} catch {
|
|
311
311
|
}
|
|
312
312
|
}
|
|
313
313
|
}
|
|
314
314
|
return "";
|
|
315
315
|
}
|
|
316
|
-
var
|
|
317
|
-
function
|
|
316
|
+
var Y = Object.prototype.hasOwnProperty, ge = {}, me = A.ReactDebugCurrentFrame;
|
|
317
|
+
function I(e) {
|
|
318
318
|
if (e) {
|
|
319
|
-
var r = e._owner, n =
|
|
320
|
-
|
|
319
|
+
var r = e._owner, n = L(e.type, e._source, r ? r.type : null);
|
|
320
|
+
me.setExtraStackFrame(n);
|
|
321
321
|
} else
|
|
322
|
-
|
|
322
|
+
me.setExtraStackFrame(null);
|
|
323
323
|
}
|
|
324
|
-
function
|
|
324
|
+
function Ie(e, r, n, o, u) {
|
|
325
325
|
{
|
|
326
|
-
var f = Function.call.bind(
|
|
326
|
+
var f = Function.call.bind(Y);
|
|
327
327
|
for (var l in e)
|
|
328
328
|
if (f(e, l)) {
|
|
329
329
|
var s = void 0;
|
|
@@ -336,12 +336,12 @@ function hr() {
|
|
|
336
336
|
} catch (v) {
|
|
337
337
|
s = v;
|
|
338
338
|
}
|
|
339
|
-
s && !(s instanceof Error) && (
|
|
339
|
+
s && !(s instanceof Error) && (I(u), w("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", o || "React class", n, l, typeof s), I(null)), s instanceof Error && !(s.message in ge) && (ge[s.message] = !0, I(u), w("Failed %s type: %s", n, s.message), I(null));
|
|
340
340
|
}
|
|
341
341
|
}
|
|
342
342
|
}
|
|
343
343
|
var He = Array.isArray;
|
|
344
|
-
function
|
|
344
|
+
function G(e) {
|
|
345
345
|
return He(e);
|
|
346
346
|
}
|
|
347
347
|
function Je(e) {
|
|
@@ -360,18 +360,18 @@ function hr() {
|
|
|
360
360
|
function pe(e) {
|
|
361
361
|
return "" + e;
|
|
362
362
|
}
|
|
363
|
-
function
|
|
363
|
+
function he(e) {
|
|
364
364
|
if (qe(e))
|
|
365
365
|
return w("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", Je(e)), pe(e);
|
|
366
366
|
}
|
|
367
|
-
var
|
|
367
|
+
var ve = A.ReactCurrentOwner, Ke = {
|
|
368
368
|
key: !0,
|
|
369
369
|
ref: !0,
|
|
370
370
|
__self: !0,
|
|
371
371
|
__source: !0
|
|
372
|
-
},
|
|
372
|
+
}, be, ye;
|
|
373
373
|
function Xe(e) {
|
|
374
|
-
if (
|
|
374
|
+
if (Y.call(e, "ref")) {
|
|
375
375
|
var r = Object.getOwnPropertyDescriptor(e, "ref").get;
|
|
376
376
|
if (r && r.isReactWarning)
|
|
377
377
|
return !1;
|
|
@@ -379,7 +379,7 @@ function hr() {
|
|
|
379
379
|
return e.ref !== void 0;
|
|
380
380
|
}
|
|
381
381
|
function Ge(e) {
|
|
382
|
-
if (
|
|
382
|
+
if (Y.call(e, "key")) {
|
|
383
383
|
var r = Object.getOwnPropertyDescriptor(e, "key").get;
|
|
384
384
|
if (r && r.isReactWarning)
|
|
385
385
|
return !1;
|
|
@@ -387,12 +387,12 @@ function hr() {
|
|
|
387
387
|
return e.key !== void 0;
|
|
388
388
|
}
|
|
389
389
|
function Ze(e, r) {
|
|
390
|
-
typeof e.ref == "string" &&
|
|
390
|
+
typeof e.ref == "string" && ve.current;
|
|
391
391
|
}
|
|
392
392
|
function Qe(e, r) {
|
|
393
393
|
{
|
|
394
394
|
var n = function() {
|
|
395
|
-
|
|
395
|
+
be || (be = !0, w("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", r));
|
|
396
396
|
};
|
|
397
397
|
n.isReactWarning = !0, Object.defineProperty(e, "key", {
|
|
398
398
|
get: n,
|
|
@@ -403,7 +403,7 @@ function hr() {
|
|
|
403
403
|
function er(e, r) {
|
|
404
404
|
{
|
|
405
405
|
var n = function() {
|
|
406
|
-
|
|
406
|
+
ye || (ye = !0, w("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", r));
|
|
407
407
|
};
|
|
408
408
|
n.isReactWarning = !0, Object.defineProperty(e, "ref", {
|
|
409
409
|
get: n,
|
|
@@ -443,9 +443,9 @@ function hr() {
|
|
|
443
443
|
function tr(e, r, n, o, u) {
|
|
444
444
|
{
|
|
445
445
|
var f, l = {}, s = null, _ = null;
|
|
446
|
-
n !== void 0 && (
|
|
446
|
+
n !== void 0 && (he(n), s = "" + n), Ge(r) && (he(r.key), s = "" + r.key), Xe(r) && (_ = r.ref, Ze(r, u));
|
|
447
447
|
for (f in r)
|
|
448
|
-
|
|
448
|
+
Y.call(r, f) && !Ke.hasOwnProperty(f) && (l[f] = r[f]);
|
|
449
449
|
if (e && e.defaultProps) {
|
|
450
450
|
var v = e.defaultProps;
|
|
451
451
|
for (f in v)
|
|
@@ -455,26 +455,26 @@ function hr() {
|
|
|
455
455
|
var b = typeof e == "function" ? e.displayName || e.name || "Unknown" : e;
|
|
456
456
|
s && Qe(l, b), _ && er(l, b);
|
|
457
457
|
}
|
|
458
|
-
return rr(e, s, _, u, o,
|
|
458
|
+
return rr(e, s, _, u, o, ve.current, l);
|
|
459
459
|
}
|
|
460
460
|
}
|
|
461
|
-
var
|
|
461
|
+
var Z = A.ReactCurrentOwner, Re = A.ReactDebugCurrentFrame;
|
|
462
462
|
function F(e) {
|
|
463
463
|
if (e) {
|
|
464
|
-
var r = e._owner, n =
|
|
465
|
-
|
|
464
|
+
var r = e._owner, n = L(e.type, e._source, r ? r.type : null);
|
|
465
|
+
Re.setExtraStackFrame(n);
|
|
466
466
|
} else
|
|
467
|
-
|
|
467
|
+
Re.setExtraStackFrame(null);
|
|
468
468
|
}
|
|
469
|
-
var
|
|
470
|
-
|
|
471
|
-
function
|
|
469
|
+
var Q;
|
|
470
|
+
Q = !1;
|
|
471
|
+
function ee(e) {
|
|
472
472
|
return typeof e == "object" && e !== null && e.$$typeof === t;
|
|
473
473
|
}
|
|
474
|
-
function
|
|
474
|
+
function Ee() {
|
|
475
475
|
{
|
|
476
|
-
if (
|
|
477
|
-
var e =
|
|
476
|
+
if (Z.current) {
|
|
477
|
+
var e = k(Z.current.type);
|
|
478
478
|
if (e)
|
|
479
479
|
return `
|
|
480
480
|
|
|
@@ -486,10 +486,10 @@ Check the render method of \`` + e + "`.";
|
|
|
486
486
|
function nr(e) {
|
|
487
487
|
return "";
|
|
488
488
|
}
|
|
489
|
-
var
|
|
489
|
+
var we = {};
|
|
490
490
|
function ar(e) {
|
|
491
491
|
{
|
|
492
|
-
var r =
|
|
492
|
+
var r = Ee();
|
|
493
493
|
if (!r) {
|
|
494
494
|
var n = typeof e == "string" ? e : e.displayName || e.name;
|
|
495
495
|
n && (r = `
|
|
@@ -499,35 +499,35 @@ Check the top-level render call using <` + n + ">.");
|
|
|
499
499
|
return r;
|
|
500
500
|
}
|
|
501
501
|
}
|
|
502
|
-
function
|
|
502
|
+
function _e(e, r) {
|
|
503
503
|
{
|
|
504
504
|
if (!e._store || e._store.validated || e.key != null)
|
|
505
505
|
return;
|
|
506
506
|
e._store.validated = !0;
|
|
507
507
|
var n = ar(r);
|
|
508
|
-
if (
|
|
508
|
+
if (we[n])
|
|
509
509
|
return;
|
|
510
|
-
|
|
510
|
+
we[n] = !0;
|
|
511
511
|
var o = "";
|
|
512
|
-
e && e._owner && e._owner !==
|
|
512
|
+
e && e._owner && e._owner !== Z.current && (o = " It was passed a child from " + k(e._owner.type) + "."), F(e), w('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', n, o), F(null);
|
|
513
513
|
}
|
|
514
514
|
}
|
|
515
|
-
function
|
|
515
|
+
function Ce(e, r) {
|
|
516
516
|
{
|
|
517
517
|
if (typeof e != "object")
|
|
518
518
|
return;
|
|
519
|
-
if (
|
|
519
|
+
if (G(e))
|
|
520
520
|
for (var n = 0; n < e.length; n++) {
|
|
521
521
|
var o = e[n];
|
|
522
|
-
|
|
522
|
+
ee(o) && _e(o, r);
|
|
523
523
|
}
|
|
524
|
-
else if (
|
|
524
|
+
else if (ee(e))
|
|
525
525
|
e._store && (e._store.validated = !0);
|
|
526
526
|
else if (e) {
|
|
527
|
-
var u =
|
|
527
|
+
var u = W(e);
|
|
528
528
|
if (typeof u == "function" && u !== e.entries)
|
|
529
529
|
for (var f = u.call(e), l; !(l = f.next()).done; )
|
|
530
|
-
|
|
530
|
+
ee(l.value) && _e(l.value, r);
|
|
531
531
|
}
|
|
532
532
|
}
|
|
533
533
|
}
|
|
@@ -546,11 +546,11 @@ Check the top-level render call using <` + n + ">.");
|
|
|
546
546
|
else
|
|
547
547
|
return;
|
|
548
548
|
if (n) {
|
|
549
|
-
var o =
|
|
550
|
-
|
|
551
|
-
} else if (r.PropTypes !== void 0 && !
|
|
552
|
-
|
|
553
|
-
var u =
|
|
549
|
+
var o = k(r);
|
|
550
|
+
Ie(n, e.props, "prop", o, e);
|
|
551
|
+
} else if (r.PropTypes !== void 0 && !Q) {
|
|
552
|
+
Q = !0;
|
|
553
|
+
var u = k(r);
|
|
554
554
|
w("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", u || "Unknown");
|
|
555
555
|
}
|
|
556
556
|
typeof r.getDefaultProps == "function" && !r.getDefaultProps.isReactClassApproved && w("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
|
|
@@ -568,17 +568,17 @@ Check the top-level render call using <` + n + ">.");
|
|
|
568
568
|
e.ref !== null && (F(e), w("Invalid attribute `ref` supplied to `React.Fragment`."), F(null));
|
|
569
569
|
}
|
|
570
570
|
}
|
|
571
|
-
var
|
|
572
|
-
function
|
|
571
|
+
var xe = {};
|
|
572
|
+
function Te(e, r, n, o, u, f) {
|
|
573
573
|
{
|
|
574
|
-
var l =
|
|
574
|
+
var l = Ye(e);
|
|
575
575
|
if (!l) {
|
|
576
576
|
var s = "";
|
|
577
577
|
(e === void 0 || typeof e == "object" && e !== null && Object.keys(e).length === 0) && (s += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");
|
|
578
578
|
var _ = nr();
|
|
579
|
-
_ ? s += _ : s +=
|
|
579
|
+
_ ? s += _ : s += Ee();
|
|
580
580
|
var v;
|
|
581
|
-
e === null ? v = "null" :
|
|
581
|
+
e === null ? v = "null" : G(e) ? v = "array" : e !== void 0 && e.$$typeof === t ? (v = "<" + (k(e.type) || "Unknown") + " />", s = " Did you accidentally export a JSX literal instead of a component?") : v = typeof e, w("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", v, s);
|
|
582
582
|
}
|
|
583
583
|
var b = tr(e, r, n, u, f);
|
|
584
584
|
if (b == null)
|
|
@@ -587,58 +587,58 @@ Check the top-level render call using <` + n + ">.");
|
|
|
587
587
|
var T = r.children;
|
|
588
588
|
if (T !== void 0)
|
|
589
589
|
if (o)
|
|
590
|
-
if (
|
|
590
|
+
if (G(T)) {
|
|
591
591
|
for (var D = 0; D < T.length; D++)
|
|
592
|
-
|
|
592
|
+
Ce(T[D], e);
|
|
593
593
|
Object.freeze && Object.freeze(T);
|
|
594
594
|
} else
|
|
595
595
|
w("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
|
|
596
596
|
else
|
|
597
|
-
|
|
597
|
+
Ce(T, e);
|
|
598
598
|
}
|
|
599
|
-
if (
|
|
600
|
-
var
|
|
599
|
+
if (Y.call(r, "key")) {
|
|
600
|
+
var O = k(e), x = Object.keys(r).filter(function(dr) {
|
|
601
601
|
return dr !== "key";
|
|
602
|
-
}),
|
|
603
|
-
if (!
|
|
602
|
+
}), re = x.length > 0 ? "{key: someKey, " + x.join(": ..., ") + ": ...}" : "{key: someKey}";
|
|
603
|
+
if (!xe[O + re]) {
|
|
604
604
|
var fr = x.length > 0 ? "{" + x.join(": ..., ") + ": ...}" : "{}";
|
|
605
605
|
w(`A props object containing a "key" prop is being spread into JSX:
|
|
606
606
|
let props = %s;
|
|
607
607
|
<%s {...props} />
|
|
608
608
|
React keys must be passed directly to JSX without using spread:
|
|
609
609
|
let props = %s;
|
|
610
|
-
<%s key={someKey} {...props} />`,
|
|
610
|
+
<%s key={someKey} {...props} />`, re, O, fr, O), xe[O + re] = !0;
|
|
611
611
|
}
|
|
612
612
|
}
|
|
613
|
-
return e ===
|
|
613
|
+
return e === g ? ir(b) : or(b), b;
|
|
614
614
|
}
|
|
615
615
|
}
|
|
616
616
|
function sr(e, r, n) {
|
|
617
|
-
return
|
|
617
|
+
return Te(e, r, n, !0);
|
|
618
618
|
}
|
|
619
619
|
function lr(e, r, n) {
|
|
620
|
-
return
|
|
620
|
+
return Te(e, r, n, !1);
|
|
621
621
|
}
|
|
622
622
|
var ur = lr, cr = sr;
|
|
623
|
-
|
|
624
|
-
})()),
|
|
623
|
+
B.Fragment = g, B.jsx = ur, B.jsxs = cr;
|
|
624
|
+
})()), B;
|
|
625
625
|
}
|
|
626
626
|
var ke;
|
|
627
|
-
function
|
|
628
|
-
return ke || (ke = 1, process.env.NODE_ENV === "production" ? H.exports =
|
|
627
|
+
function br() {
|
|
628
|
+
return ke || (ke = 1, process.env.NODE_ENV === "production" ? H.exports = hr() : H.exports = vr()), H.exports;
|
|
629
629
|
}
|
|
630
|
-
var
|
|
631
|
-
function
|
|
630
|
+
var P = br();
|
|
631
|
+
function yr({
|
|
632
632
|
children: a,
|
|
633
633
|
showLineNumbers: t = !1,
|
|
634
634
|
startLine: i = 1,
|
|
635
|
-
className:
|
|
635
|
+
className: g = "",
|
|
636
636
|
style: c = {},
|
|
637
637
|
topPadding: d = 16,
|
|
638
638
|
codeStyle: h = {}
|
|
639
639
|
}) {
|
|
640
640
|
const R = (typeof a == "string" ? a : "").split(`
|
|
641
|
-
`).map((S
|
|
641
|
+
`).map(($, S) => i + S), y = {
|
|
642
642
|
position: "relative",
|
|
643
643
|
counterReset: `linenumber ${i - 1}`,
|
|
644
644
|
paddingTop: 0,
|
|
@@ -661,15 +661,15 @@ function br({
|
|
|
661
661
|
userSelect: "none",
|
|
662
662
|
lineHeight: "1.5"
|
|
663
663
|
};
|
|
664
|
-
return /* @__PURE__ */
|
|
664
|
+
return /* @__PURE__ */ P.jsxs(
|
|
665
665
|
"pre",
|
|
666
666
|
{
|
|
667
|
-
className: `language-markdown ${t ? "line-numbers" : ""} ${
|
|
667
|
+
className: `language-markdown ${t ? "line-numbers" : ""} ${g}`.trim(),
|
|
668
668
|
"data-start": i,
|
|
669
669
|
style: y,
|
|
670
670
|
children: [
|
|
671
|
-
/* @__PURE__ */
|
|
672
|
-
t && /* @__PURE__ */
|
|
671
|
+
/* @__PURE__ */ P.jsx("code", { className: "language-markdown", style: E, children: a }),
|
|
672
|
+
t && /* @__PURE__ */ P.jsx("span", { className: "line-numbers-rows", "aria-hidden": "true", style: C, children: R.map(($, S) => /* @__PURE__ */ P.jsx(
|
|
673
673
|
"span",
|
|
674
674
|
{
|
|
675
675
|
style: {
|
|
@@ -679,9 +679,9 @@ function br({
|
|
|
679
679
|
color: "#999",
|
|
680
680
|
lineHeight: "1.5"
|
|
681
681
|
},
|
|
682
|
-
children:
|
|
682
|
+
children: $
|
|
683
683
|
},
|
|
684
|
-
|
|
684
|
+
S
|
|
685
685
|
)) })
|
|
686
686
|
]
|
|
687
687
|
}
|
|
@@ -691,26 +691,26 @@ function Oe(a) {
|
|
|
691
691
|
let t;
|
|
692
692
|
return a.useTabs ? t = " " : a.hasPadding ? t = " " : t = "", t;
|
|
693
693
|
}
|
|
694
|
-
class
|
|
694
|
+
class Rr {
|
|
695
695
|
padding;
|
|
696
696
|
constructor(t) {
|
|
697
697
|
this.padding = Oe(t);
|
|
698
698
|
}
|
|
699
|
-
formatCell(t, i,
|
|
700
|
-
const c =
|
|
699
|
+
formatCell(t, i, g) {
|
|
700
|
+
const c = g;
|
|
701
701
|
switch (i) {
|
|
702
702
|
case "right":
|
|
703
703
|
return `${this.padding}${t.padStart(c)}${this.padding}`;
|
|
704
704
|
case "center": {
|
|
705
|
-
const d = c - t.length, h = Math.floor(d / 2),
|
|
706
|
-
return `${this.padding}${" ".repeat(h)}${t}${" ".repeat(
|
|
705
|
+
const d = c - t.length, h = Math.floor(d / 2), m = d - h;
|
|
706
|
+
return `${this.padding}${" ".repeat(h)}${t}${" ".repeat(m)}${this.padding}`;
|
|
707
707
|
}
|
|
708
708
|
default:
|
|
709
709
|
return `${this.padding}${t.padEnd(c)}${this.padding}`;
|
|
710
710
|
}
|
|
711
711
|
}
|
|
712
712
|
}
|
|
713
|
-
class
|
|
713
|
+
class Er {
|
|
714
714
|
static indicators = {
|
|
715
715
|
left: (t) => `:${"-".repeat(t - 1)}`,
|
|
716
716
|
right: (t) => `${"-".repeat(t - 1)}:`,
|
|
@@ -721,12 +721,12 @@ class Rr {
|
|
|
721
721
|
return this.indicators[t](i);
|
|
722
722
|
}
|
|
723
723
|
}
|
|
724
|
-
class
|
|
724
|
+
class wr {
|
|
725
725
|
config;
|
|
726
726
|
cellFormatter;
|
|
727
727
|
adjustedAlignments;
|
|
728
728
|
constructor(t) {
|
|
729
|
-
this.config = t, this.cellFormatter = new
|
|
729
|
+
this.config = t, this.cellFormatter = new Rr(t), this.adjustedAlignments = this.getAdjustedAlignments();
|
|
730
730
|
}
|
|
731
731
|
getAdjustedAlignments() {
|
|
732
732
|
return this.config.columnAlignments.length < this.config.columnCount ? [
|
|
@@ -735,73 +735,73 @@ class Er {
|
|
|
735
735
|
] : Array.from(this.config.columnAlignments);
|
|
736
736
|
}
|
|
737
737
|
formatRow(t) {
|
|
738
|
-
return `|${Array.from({ length: this.config.columnCount }, (
|
|
738
|
+
return `|${Array.from({ length: this.config.columnCount }, (g, c) => {
|
|
739
739
|
let d = t[c] ?? "";
|
|
740
740
|
this.config.replaceNewlines && (d = d.replace(/\n/g, "<br>"));
|
|
741
|
-
const h = this.adjustedAlignments[c],
|
|
742
|
-
return this.cellFormatter.formatCell(d, h,
|
|
741
|
+
const h = this.adjustedAlignments[c], m = this.config.columnWidths ? this.config.columnWidths[c] : d.length;
|
|
742
|
+
return this.cellFormatter.formatCell(d, h, m);
|
|
743
743
|
}).join("|")}|`;
|
|
744
744
|
}
|
|
745
745
|
formatAlignmentRow() {
|
|
746
746
|
const t = Oe(this.config);
|
|
747
|
-
return `|${Array.from({ length: this.config.columnCount }, (
|
|
748
|
-
const d = this.adjustedAlignments[c], h = this.config.columnWidths ? this.config.columnWidths[c] : 3,
|
|
749
|
-
return `${t}${
|
|
747
|
+
return `|${Array.from({ length: this.config.columnCount }, (g, c) => {
|
|
748
|
+
const d = this.adjustedAlignments[c], h = this.config.columnWidths ? this.config.columnWidths[c] : 3, m = Er.formatIndicator(d, h);
|
|
749
|
+
return `${t}${m}${t}`;
|
|
750
750
|
}).join("|")}|`;
|
|
751
751
|
}
|
|
752
752
|
}
|
|
753
|
-
function
|
|
753
|
+
function _r(a, t) {
|
|
754
754
|
const i = new Array(t).fill(3);
|
|
755
|
-
return a.forEach((
|
|
755
|
+
return a.forEach((g) => {
|
|
756
756
|
for (let c = 0; c < t; c++) {
|
|
757
|
-
const d =
|
|
757
|
+
const d = g[c] ?? "";
|
|
758
758
|
i[c] = Math.max(i[c], d.length);
|
|
759
759
|
}
|
|
760
760
|
}), i;
|
|
761
761
|
}
|
|
762
|
-
function
|
|
763
|
-
const t = a.inputDataHeader.length, i = a.inputDataBody.map((
|
|
762
|
+
function Cr(a) {
|
|
763
|
+
const t = a.inputDataHeader.length, i = a.inputDataBody.map((g) => g.length);
|
|
764
764
|
return Math.max(t, ...i);
|
|
765
765
|
}
|
|
766
|
-
function
|
|
767
|
-
return i ?
|
|
766
|
+
function xr(a, t, i) {
|
|
767
|
+
return i ? _r(
|
|
768
768
|
[a.inputDataHeader, ...a.inputDataBody],
|
|
769
769
|
t
|
|
770
770
|
) : void 0;
|
|
771
771
|
}
|
|
772
|
-
function
|
|
773
|
-
const h =
|
|
772
|
+
function Tr(a, t, i = !0, g = !1, c = !1, d = !0) {
|
|
773
|
+
const h = Cr(a), m = xr(a, h, i), p = {
|
|
774
774
|
columnCount: h,
|
|
775
775
|
columnAlignments: t,
|
|
776
|
-
columnWidths:
|
|
777
|
-
useTabs:
|
|
776
|
+
columnWidths: m,
|
|
777
|
+
useTabs: g,
|
|
778
778
|
replaceNewlines: c,
|
|
779
779
|
hasPadding: d
|
|
780
|
-
}, R = new
|
|
780
|
+
}, R = new wr(p), y = R.formatRow(a.inputDataHeader), E = R.formatAlignmentRow(), C = a.inputDataBody.map(($) => R.formatRow($)).join(`
|
|
781
781
|
`);
|
|
782
782
|
return `${y}
|
|
783
783
|
${E}
|
|
784
784
|
${C}`.trimEnd();
|
|
785
785
|
}
|
|
786
|
-
function
|
|
786
|
+
function $r(a) {
|
|
787
787
|
let t = "", i = a;
|
|
788
788
|
for (; i >= 0; )
|
|
789
789
|
t = String.fromCharCode(i % 26 + 65) + t, i = Math.floor(i / 26) - 1;
|
|
790
790
|
return t;
|
|
791
791
|
}
|
|
792
792
|
function Sr(a) {
|
|
793
|
-
return Array.from({ length: a }, (t, i) =>
|
|
793
|
+
return Array.from({ length: a }, (t, i) => $r(i));
|
|
794
794
|
}
|
|
795
|
-
class
|
|
795
|
+
class z extends Error {
|
|
796
796
|
constructor(t, i) {
|
|
797
|
-
super(t, i), this.name = "MarkdownTableError", Object.setPrototypeOf(this,
|
|
797
|
+
super(t, i), this.name = "MarkdownTableError", Object.setPrototypeOf(this, z.prototype);
|
|
798
798
|
}
|
|
799
799
|
}
|
|
800
800
|
function kr(a) {
|
|
801
801
|
if (a === null || !Array.isArray(a))
|
|
802
|
-
throw new
|
|
802
|
+
throw new z("The 'data' prop must be a two-dimensional array.");
|
|
803
803
|
if (a.length === 0)
|
|
804
|
-
throw new
|
|
804
|
+
throw new z("The 'data' array must contain at least one row.");
|
|
805
805
|
}
|
|
806
806
|
function jr(a) {
|
|
807
807
|
return a === "light" ? {
|
|
@@ -817,8 +817,8 @@ function jr(a) {
|
|
|
817
817
|
borderRadius: ".3em"
|
|
818
818
|
};
|
|
819
819
|
}
|
|
820
|
-
function Or(a) {
|
|
821
|
-
const
|
|
820
|
+
function Or(a, t) {
|
|
821
|
+
const i = jr(a), g = `
|
|
822
822
|
font-family: Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace;
|
|
823
823
|
font-size: 1em;
|
|
824
824
|
text-align: left;
|
|
@@ -836,55 +836,55 @@ function Or(a) {
|
|
|
836
836
|
hyphens: none;
|
|
837
837
|
`.replace(/\s{2,}/g, "");
|
|
838
838
|
return `
|
|
839
|
-
code[class*=language-], pre[class*=language-] {
|
|
840
|
-
color: ${
|
|
839
|
+
#${t} code[class*=language-], #${t} pre[class*=language-] {
|
|
840
|
+
color: ${i.textColor};
|
|
841
841
|
background: 0 0;
|
|
842
|
-
text-shadow: ${
|
|
843
|
-
${
|
|
842
|
+
text-shadow: ${i.textShadow};
|
|
843
|
+
${g}
|
|
844
844
|
}
|
|
845
|
-
code[class*=language-] ::-moz-selection,
|
|
846
|
-
code[class*=language-]::-moz-selection,
|
|
847
|
-
pre[class*=language-] ::-moz-selection,
|
|
848
|
-
pre[class*=language-]::-moz-selection {
|
|
845
|
+
#${t} code[class*=language-] ::-moz-selection,
|
|
846
|
+
#${t} code[class*=language-]::-moz-selection,
|
|
847
|
+
#${t} pre[class*=language-] ::-moz-selection,
|
|
848
|
+
#${t} pre[class*=language-]::-moz-selection {
|
|
849
849
|
text-shadow: none;
|
|
850
|
-
background: ${
|
|
850
|
+
background: ${i.selectionBackground};
|
|
851
851
|
}
|
|
852
|
-
code[class*=language-] ::selection,
|
|
853
|
-
code[class*=language-]::selection,
|
|
854
|
-
pre[class*=language-] ::selection,
|
|
855
|
-
pre[class*=language-]::selection {
|
|
852
|
+
#${t} code[class*=language-] ::selection,
|
|
853
|
+
#${t} code[class*=language-]::selection,
|
|
854
|
+
#${t} pre[class*=language-] ::selection,
|
|
855
|
+
#${t} pre[class*=language-]::selection {
|
|
856
856
|
text-shadow: none;
|
|
857
|
-
background: ${
|
|
857
|
+
background: ${i.selectionBackground};
|
|
858
858
|
}
|
|
859
859
|
@media print {
|
|
860
|
-
code[class*=language-], pre[class*=language-] {
|
|
860
|
+
#${t} code[class*=language-], #${t} pre[class*=language-] {
|
|
861
861
|
text-shadow: none;
|
|
862
862
|
}
|
|
863
863
|
}
|
|
864
|
-
pre[class*=language-] {
|
|
864
|
+
#${t} pre[class*=language-] {
|
|
865
865
|
padding: 1em;
|
|
866
866
|
margin: .5em 0;
|
|
867
|
-
overflow: visible${
|
|
868
|
-
border-radius: ${
|
|
867
|
+
overflow: visible${i.borderRadius ? `;
|
|
868
|
+
border-radius: ${i.borderRadius}` : ""};
|
|
869
869
|
}
|
|
870
|
-
:not(pre) > code[class*=language-],
|
|
871
|
-
pre[class*=language-] {
|
|
872
|
-
background: ${
|
|
870
|
+
#${t} :not(pre) > code[class*=language-],
|
|
871
|
+
#${t} pre[class*=language-] {
|
|
872
|
+
background: ${i.background};
|
|
873
873
|
}
|
|
874
|
-
:not(pre) > code[class*=language-] {
|
|
874
|
+
#${t} :not(pre) > code[class*=language-] {
|
|
875
875
|
padding: .1em;
|
|
876
876
|
border-radius: .3em;
|
|
877
877
|
white-space: normal;
|
|
878
878
|
}
|
|
879
|
-
pre[class*=language-].line-numbers {
|
|
879
|
+
#${t} pre[class*=language-].line-numbers {
|
|
880
880
|
position: relative;
|
|
881
881
|
padding-left: 3.8em;
|
|
882
882
|
}
|
|
883
|
-
pre[class*=language-].line-numbers > code {
|
|
883
|
+
#${t} pre[class*=language-].line-numbers > code {
|
|
884
884
|
position: relative;
|
|
885
885
|
white-space: inherit;
|
|
886
886
|
}
|
|
887
|
-
.line-numbers .line-numbers-rows {
|
|
887
|
+
#${t} .line-numbers .line-numbers-rows {
|
|
888
888
|
position: absolute;
|
|
889
889
|
pointer-events: none;
|
|
890
890
|
top: 0;
|
|
@@ -898,7 +898,7 @@ pre[class*=language-].line-numbers > code {
|
|
|
898
898
|
-ms-user-select: none;
|
|
899
899
|
user-select: none;
|
|
900
900
|
}
|
|
901
|
-
.line-numbers-rows > span {
|
|
901
|
+
#${t} .line-numbers-rows > span {
|
|
902
902
|
display: block;
|
|
903
903
|
}
|
|
904
904
|
`.trim();
|
|
@@ -906,58 +906,58 @@ pre[class*=language-].line-numbers > code {
|
|
|
906
906
|
function Pr(a, t) {
|
|
907
907
|
return t ? { inputDataHeader: a[0], inputDataBody: a.slice(1) } : { inputDataHeader: Sr(a[0].length), inputDataBody: a };
|
|
908
908
|
}
|
|
909
|
-
function
|
|
909
|
+
function Ar(a, t, i, g, c, d, h) {
|
|
910
910
|
try {
|
|
911
911
|
kr(a);
|
|
912
|
-
const { inputDataHeader:
|
|
913
|
-
return
|
|
914
|
-
{ inputDataHeader:
|
|
912
|
+
const { inputDataHeader: m, inputDataBody: p } = Pr(a, t);
|
|
913
|
+
return Tr(
|
|
914
|
+
{ inputDataHeader: m, inputDataBody: p },
|
|
915
915
|
i,
|
|
916
|
-
|
|
916
|
+
g,
|
|
917
917
|
c,
|
|
918
918
|
d,
|
|
919
919
|
h
|
|
920
920
|
);
|
|
921
|
-
} catch (
|
|
922
|
-
if (
|
|
923
|
-
return `Error: ${
|
|
924
|
-
throw
|
|
921
|
+
} catch (m) {
|
|
922
|
+
if (m instanceof z)
|
|
923
|
+
return `Error: ${m.message}`;
|
|
924
|
+
throw m;
|
|
925
925
|
}
|
|
926
926
|
}
|
|
927
|
-
function
|
|
927
|
+
function Dr({
|
|
928
928
|
inputData: a = null,
|
|
929
929
|
hasHeader: t = !0,
|
|
930
930
|
columnAlignments: i = [],
|
|
931
|
-
isCompact:
|
|
931
|
+
isCompact: g = !1,
|
|
932
932
|
hasTabs: c = !1,
|
|
933
933
|
hasPadding: d = !0,
|
|
934
934
|
convertLineBreaks: h = !1,
|
|
935
|
-
className:
|
|
935
|
+
className: m,
|
|
936
936
|
onGenerate: p,
|
|
937
937
|
theme: R = "light",
|
|
938
938
|
preStyle: y,
|
|
939
939
|
topPadding: E = 16,
|
|
940
940
|
minWidth: C,
|
|
941
|
-
showLineNumbers:
|
|
941
|
+
showLineNumbers: $ = !0
|
|
942
942
|
}) {
|
|
943
|
-
const
|
|
944
|
-
|
|
943
|
+
const S = gr().replace(/:/g, "_"), J = mr(a), W = Ar(
|
|
944
|
+
J,
|
|
945
945
|
t,
|
|
946
946
|
i,
|
|
947
|
-
!
|
|
947
|
+
!g,
|
|
948
948
|
c,
|
|
949
949
|
h,
|
|
950
950
|
d
|
|
951
951
|
);
|
|
952
952
|
return pr(() => {
|
|
953
|
-
p && p(
|
|
954
|
-
}, [
|
|
955
|
-
/* @__PURE__ */
|
|
956
|
-
/* @__PURE__ */
|
|
957
|
-
|
|
953
|
+
p && p(W);
|
|
954
|
+
}, [W, p]), /* @__PURE__ */ P.jsxs("div", { id: S, children: [
|
|
955
|
+
/* @__PURE__ */ P.jsx("style", { children: Or(R, S) }),
|
|
956
|
+
/* @__PURE__ */ P.jsx(
|
|
957
|
+
yr,
|
|
958
958
|
{
|
|
959
|
-
showLineNumbers:
|
|
960
|
-
className: `${R === "dark" ? "dark-theme" : ""} ${
|
|
959
|
+
showLineNumbers: $,
|
|
960
|
+
className: `${R === "dark" ? "dark-theme" : ""} ${m || ""}`.trim(),
|
|
961
961
|
topPadding: E,
|
|
962
962
|
style: {
|
|
963
963
|
position: "relative",
|
|
@@ -968,12 +968,12 @@ function Fr({
|
|
|
968
968
|
margin: 0,
|
|
969
969
|
...y
|
|
970
970
|
},
|
|
971
|
-
children:
|
|
971
|
+
children: W
|
|
972
972
|
}
|
|
973
973
|
)
|
|
974
974
|
] });
|
|
975
975
|
}
|
|
976
976
|
export {
|
|
977
|
-
|
|
978
|
-
|
|
977
|
+
Dr as MarkdownTable,
|
|
978
|
+
z as MarkdownTableError
|
|
979
979
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-markdown-table-ts",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.13",
|
|
4
4
|
"description": "A React component that converts structured data into formatted Markdown table syntax and displays it in a styled code block with optional line numbers.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"markdown",
|