react-markdown-table-ts 1.4.7 → 1.4.9
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/LineNumbers.d.ts +2 -1
- package/dist/LineNumbers.d.ts.map +1 -1
- package/dist/index.cjs +5 -5
- package/dist/index.mjs +55 -54
- package/package.json +1 -1
package/dist/LineNumbers.d.ts
CHANGED
|
@@ -9,6 +9,7 @@ import React from 'react';
|
|
|
9
9
|
export interface LineNumbersComponentProps {
|
|
10
10
|
children: React.ReactNode;
|
|
11
11
|
showLineNumbers?: boolean;
|
|
12
|
+
startLine?: number;
|
|
12
13
|
className?: string;
|
|
13
14
|
style?: React.CSSProperties;
|
|
14
15
|
topPadding?: number;
|
|
@@ -132,7 +133,7 @@ export declare function LineNumbers(props: LineNumbersComponentProps): React.Det
|
|
|
132
133
|
content?: import("csstype").Property.Content | undefined;
|
|
133
134
|
contentVisibility?: import("csstype").Property.ContentVisibility | undefined;
|
|
134
135
|
counterIncrement?: import("csstype").Property.CounterIncrement | undefined;
|
|
135
|
-
counterReset: import("csstype").Property.CounterReset
|
|
136
|
+
counterReset: import("csstype").Property.CounterReset;
|
|
136
137
|
counterSet?: import("csstype").Property.CounterSet | undefined;
|
|
137
138
|
cursor?: import("csstype").Property.Cursor | undefined;
|
|
138
139
|
direction?: import("csstype").Property.Direction | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LineNumbers.d.ts","sourceRoot":"","sources":["../src/LineNumbers.tsx"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B;;GAEG;AACH,MAAM,WAAW,yBAAyB;IACxC,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IAC5B,UAAU,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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;gBAyD3D"}
|
package/dist/index.cjs
CHANGED
|
@@ -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 ke;function gr(){if(ke)return N;ke=1;var a=S,t=Symbol.for("react.element"),i=Symbol.for("react.fragment"),
|
|
9
|
+
*/var ke;function gr(){if(ke)return N;ke=1;var a=S,t=Symbol.for("react.element"),i=Symbol.for("react.fragment"),d=Object.prototype.hasOwnProperty,u=a.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,g={key:!0,ref:!0,__self:!0,__source:!0};function h(p,m,E){var b,R={},T=null,k=null;E!==void 0&&(T=""+E),m.key!==void 0&&(T=""+m.key),m.ref!==void 0&&(k=m.ref);for(b in m)d.call(m,b)&&!g.hasOwnProperty(b)&&(R[b]=m[b]);if(p&&p.defaultProps)for(b in m=p.defaultProps,m)R[b]===void 0&&(R[b]=m[b]);return{$$typeof:t,type:p,key:T,ref:k,props:R,_owner:u.current}}return N.Fragment=i,N.jsx=h,N.jsxs=h,N}var Y={};/**
|
|
10
10
|
* @license React
|
|
11
11
|
* react-jsx-runtime.development.js
|
|
12
12
|
*
|
|
@@ -14,7 +14,7 @@
|
|
|
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 Oe;function pr(){return Oe||(Oe=1,process.env.NODE_ENV!=="production"&&(function(){var a=S,t=Symbol.for("react.element"),i=Symbol.for("react.portal"),
|
|
17
|
+
*/var Oe;function pr(){return Oe||(Oe=1,process.env.NODE_ENV!=="production"&&(function(){var a=S,t=Symbol.for("react.element"),i=Symbol.for("react.portal"),d=Symbol.for("react.fragment"),u=Symbol.for("react.strict_mode"),g=Symbol.for("react.profiler"),h=Symbol.for("react.provider"),p=Symbol.for("react.context"),m=Symbol.for("react.forward_ref"),E=Symbol.for("react.suspense"),b=Symbol.for("react.suspense_list"),R=Symbol.for("react.memo"),T=Symbol.for("react.lazy"),k=Symbol.for("react.offscreen"),B=Symbol.iterator,z="@@iterator";function I(e){if(e===null||typeof e!="object")return null;var r=B&&e[B]||e[z];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];Ae("error",e,n)}}function Ae(e,r,n){{var o=A.ReactDebugCurrentFrame,c=o.getStackAddendum();c!==""&&(r+="%s",n=n.concat([c]));var f=n.map(function(l){return String(l)});f.unshift("Warning: "+r),Function.prototype.apply.call(console[e],console,f)}}var $e=!1,Fe=!1,De=!1,Ie=!1,Me=!1,ne;ne=Symbol.for("react.module.reference");function We(e){return!!(typeof e=="string"||typeof e=="function"||e===d||e===g||Me||e===u||e===E||e===b||Ie||e===k||$e||Fe||De||typeof e=="object"&&e!==null&&(e.$$typeof===T||e.$$typeof===R||e.$$typeof===h||e.$$typeof===p||e.$$typeof===m||e.$$typeof===ne||e.getModuleId!==void 0))}function Ne(e,r,n){var o=e.displayName;if(o)return o;var c=r.displayName||r.name||"";return c!==""?n+"("+c+")":n}function ae(e){return e.displayName||"Context"}function O(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 d:return"Fragment";case i:return"Portal";case g:return"Profiler";case u:return"StrictMode";case E:return"Suspense";case b:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case p:var r=e;return ae(r)+".Consumer";case h:var n=e;return ae(n._context)+".Provider";case m:return Ne(e,e.render,"ForwardRef");case R:var o=e.displayName||null;return o!==null?o:O(e.type)||"Memo";case T:{var c=e,f=c._payload,l=c._init;try{return O(l(f))}catch{return null}}}return null}var j=Object.assign,M=0,oe,ie,se,le,ue,ce,fe;function de(){}de.__reactDisabledLog=!0;function Ye(){{if(M===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})}M++}}function Le(){{if(M--,M===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})})}M<0&&w("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var K=A.ReactCurrentDispatcher,X;function V(e,r,n){{if(X===void 0)try{throw Error()}catch(c){var o=c.stack.trim().match(/\n( *(at )?)/);X=o&&o[1]||""}return`
|
|
18
18
|
`+X+e}}var G=!1,U;{var Be=typeof WeakMap=="function"?WeakMap:Map;U=new Be}function ge(e,r){if(!e||G)return"";{var n=U.get(e);if(n!==void 0)return n}var o;G=!0;var c=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var f;f=K.current,K.current=null,Ye();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(C){o=C}Reflect.construct(e,[],l)}else{try{l.call()}catch(C){o=C}e.call(l.prototype)}}else{try{throw Error()}catch(C){o=C}e()}}catch(C){if(C&&o&&typeof C.stack=="string"){for(var s=C.stack.split(`
|
|
19
19
|
`),_=o.stack.split(`
|
|
20
20
|
`),v=s.length-1,y=_.length-1;v>=1&&y>=0&&s[v]!==_[y];)y--;for(;v>=1&&y>=0;v--,y--)if(s[v]!==_[y]){if(v!==1||y!==1)do if(v--,y--,y<0||s[v]!==_[y]){var x=`
|
|
@@ -27,13 +27,13 @@ Check the top-level render call using <`+n+">.")}return r}}function Ce(e,r){{if(
|
|
|
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} />`,te,P,fr,P),xe[P+te]=!0}}return e===
|
|
31
|
-
`).map((b,R)=>
|
|
30
|
+
<%s key={someKey} {...props} />`,te,P,fr,P),xe[P+te]=!0}}return e===d?ir(y):or(y),y}}function sr(e,r,n){return Se(e,r,n,!0)}function lr(e,r,n){return Se(e,r,n,!1)}var ur=lr,cr=sr;Y.Fragment=d,Y.jsx=ur,Y.jsxs=cr})()),Y}var je;function mr(){return je||(je=1,process.env.NODE_ENV==="production"?q.exports=gr():q.exports=pr()),q.exports}var L=mr();function hr(a){const{children:t,showLineNumbers:i=!1,startLine:d=1,className:u="",style:g={},topPadding:h=16}=a,E=(typeof t=="string"?t:"").split(`
|
|
31
|
+
`).map((b,R)=>d+R);return S.createElement("pre",{className:`language-markdown ${i?"line-numbers":""} ${u}`.trim(),"data-start":d,style:{position:"relative",counterReset:`linenumber ${d-1}`,...i?{paddingLeft:"1.2em"}:{},...g}},[S.createElement("code",{key:"code",className:"language-markdown"},t),i&&S.createElement("span",{key:"line-numbers",className:"line-numbers-rows","aria-hidden":"true",style:{position:"absolute",pointerEvents:"none",top:`${1+h/16}em`,fontSize:"100%",left:"0em",width:"2.5em",letterSpacing:"-1px",borderRight:"1px solid #999",userSelect:"none",lineHeight:"1.5"}},E.map((b,R)=>S.createElement("span",{key:R,style:{display:"block",textAlign:"right",paddingRight:"0.8em",color:"#999",lineHeight:"1.5"}},b)))].filter(Boolean))}function Pe(a){let t;return a.useTabs?t=" ":a.hasPadding?t=" ":t="",t}class vr{padding;constructor(t){this.padding=Pe(t)}formatCell(t,i,d){const u=d;switch(i){case"right":return`${this.padding}${t.padStart(u)}${this.padding}`;case"center":{const g=u-t.length,h=Math.floor(g/2),p=g-h;return`${this.padding}${" ".repeat(h)}${t}${" ".repeat(p)}${this.padding}`}default:return`${this.padding}${t.padEnd(u)}${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},(d,u)=>{let g=t[u]??"";this.config.replaceNewlines&&(g=g.replace(/\n/g,"<br>"));const h=this.adjustedAlignments[u],p=this.config.columnWidths?this.config.columnWidths[u]:g.length;return this.cellFormatter.formatCell(g,h,p)}).join("|")}|`}formatAlignmentRow(){const t=Pe(this.config);return`|${Array.from({length:this.config.columnCount},(d,u)=>{const g=this.adjustedAlignments[u],h=this.config.columnWidths?this.config.columnWidths[u]:3,p=br.formatIndicator(g,h);return`${t}${p}${t}`}).join("|")}|`}}function Rr(a,t){const i=new Array(t).fill(3);return a.forEach(d=>{for(let u=0;u<t;u++){const g=d[u]??"";i[u]=Math.max(i[u],g.length)}}),i}function Er(a){const t=a.inputDataHeader.length,i=a.inputDataBody.map(d=>d.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,d=!1,u=!1,g=!0){const h=Er(a),p=wr(a,h,i),m={columnCount:h,columnAlignments:t,columnWidths:p,useTabs:d,replaceNewlines:u,hasPadding:g},E=new yr(m),b=E.formatRow(a.inputDataHeader),R=E.formatAlignmentRow(),T=a.inputDataBody.map(k=>E.formatRow(k)).join(`
|
|
32
32
|
`);return`${b}
|
|
33
33
|
${R}
|
|
34
34
|
${T}`.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 D extends Error{constructor(t,i){super(t,i),this.name="MarkdownTableError",Object.setPrototypeOf(this,D.prototype)}}function xr(a){if(a===null||!Array.isArray(a))throw new D("The 'data' prop must be a two-dimensional array.");if(a.length===0)throw new D("The 'data' array must contain at least one row.")}function Sr(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 kr(a){const t=Sr(a);return`
|
|
35
35
|
code[class*=language-],pre[class*=language-]{color:${t.textColor};background:0 0;text-shadow:${t.textShadow};font-family:Consolas,Monaco,'Andale Mono','Ubuntu Mono',monospace;font-size:1em;text-align:left;white-space:pre;word-spacing:normal;word-break:normal;word-wrap:normal;line-height:1.5;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-hyphens:none;-moz-hyphens:none;-ms-hyphens:none;hyphens:none}code[class*=language-] ::-moz-selection,code[class*=language-]::-moz-selection,pre[class*=language-] ::-moz-selection,pre[class*=language-]::-moz-selection{text-shadow:none;background:${t.selectionBackground}}code[class*=language-] ::selection,code[class*=language-]::selection,pre[class*=language-] ::selection,pre[class*=language-]::selection{text-shadow:none;background:${t.selectionBackground}}@media print{code[class*=language-],pre[class*=language-]{text-shadow:none}}pre[class*=language-]{padding:1em;margin:.5em 0;overflow:visible${t.borderRadius?`;border-radius:${t.borderRadius}`:""}}:not(pre)>code[class*=language-],pre[class*=language-]{background:${t.background}}:not(pre)>code[class*=language-]{padding:.1em;border-radius:.3em;white-space:normal}pre[class*=language-].line-numbers{position:relative;padding-left:3.8em}pre[class*=language-].line-numbers>code{position:relative;white-space:inherit}.line-numbers .line-numbers-rows{position:absolute;pointer-events:none;top:0;font-size:100%;left:-3.8em;width:3em;letter-spacing:-1px;border-right:1px solid #999;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.line-numbers-rows>span{display:block}
|
|
36
|
-
`}function Or(a,t){return t?{inputDataHeader:a[0],inputDataBody:a.slice(1)}:{inputDataHeader:Tr(a[0].length),inputDataBody:a}}function jr(a,t,i,
|
|
36
|
+
`}function Or(a,t){return t?{inputDataHeader:a[0],inputDataBody:a.slice(1)}:{inputDataHeader:Tr(a[0].length),inputDataBody:a}}function jr(a,t,i,d,u,g,h){try{xr(a);const{inputDataHeader:p,inputDataBody:m}=Or(a,t);return _r({inputDataHeader:p,inputDataBody:m},i,d,u,g,h)}catch(p){if(p instanceof D)return`Error: ${p.message}`;throw p}}function Pr({inputData:a=null,hasHeader:t=!0,columnAlignments:i=[],isCompact:d=!1,hasTabs:u=!1,hasPadding:g=!0,convertLineBreaks:h=!1,className:p,onGenerate:m,theme:E="light",preStyle:b,topPadding:R=16,minWidth:T,showLineNumbers:k=!0}){const B=S.useId(),z=S.useDeferredValue(a),I=S.useMemo(()=>jr(z,t,i,!d,u,h,g),[z,t,i,d,u,h,g]);return S.useEffect(()=>{m&&m(I)},[I,m]),L.jsxs(L.Fragment,{children:[L.jsxs("style",{children:[kr(E),`
|
|
37
37
|
/* Add top spacing for the table content */
|
|
38
38
|
pre > code {
|
|
39
39
|
display: block;
|
package/dist/index.mjs
CHANGED
|
@@ -13,15 +13,15 @@ var ke;
|
|
|
13
13
|
function vr() {
|
|
14
14
|
if (ke) return M;
|
|
15
15
|
ke = 1;
|
|
16
|
-
var a = F, t = Symbol.for("react.element"), i = Symbol.for("react.fragment"),
|
|
17
|
-
function
|
|
16
|
+
var a = F, t = Symbol.for("react.element"), i = Symbol.for("react.fragment"), d = Object.prototype.hasOwnProperty, u = a.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, g = { key: !0, ref: !0, __self: !0, __source: !0 };
|
|
17
|
+
function h(p, m, E) {
|
|
18
18
|
var b, R = {}, x = null, S = null;
|
|
19
19
|
E !== void 0 && (x = "" + E), m.key !== void 0 && (x = "" + m.key), m.ref !== void 0 && (S = m.ref);
|
|
20
|
-
for (b in m)
|
|
20
|
+
for (b in m) d.call(m, b) && !g.hasOwnProperty(b) && (R[b] = m[b]);
|
|
21
21
|
if (p && p.defaultProps) for (b in m = p.defaultProps, m) R[b] === void 0 && (R[b] = m[b]);
|
|
22
22
|
return { $$typeof: t, type: p, key: x, ref: S, props: R, _owner: u.current };
|
|
23
23
|
}
|
|
24
|
-
return M.Fragment = i, M.jsx =
|
|
24
|
+
return M.Fragment = i, M.jsx = h, M.jsxs = h, M;
|
|
25
25
|
}
|
|
26
26
|
var N = {};
|
|
27
27
|
/**
|
|
@@ -36,7 +36,7 @@ var N = {};
|
|
|
36
36
|
var Oe;
|
|
37
37
|
function br() {
|
|
38
38
|
return Oe || (Oe = 1, process.env.NODE_ENV !== "production" && (function() {
|
|
39
|
-
var a = F, t = Symbol.for("react.element"), i = Symbol.for("react.portal"),
|
|
39
|
+
var a = F, t = Symbol.for("react.element"), i = Symbol.for("react.portal"), d = Symbol.for("react.fragment"), u = Symbol.for("react.strict_mode"), g = Symbol.for("react.profiler"), h = Symbol.for("react.provider"), p = Symbol.for("react.context"), m = Symbol.for("react.forward_ref"), E = Symbol.for("react.suspense"), b = Symbol.for("react.suspense_list"), R = Symbol.for("react.memo"), x = Symbol.for("react.lazy"), S = Symbol.for("react.offscreen"), B = Symbol.iterator, z = "@@iterator";
|
|
40
40
|
function D(e) {
|
|
41
41
|
if (e === null || typeof e != "object")
|
|
42
42
|
return null;
|
|
@@ -64,7 +64,7 @@ function br() {
|
|
|
64
64
|
var $e = !1, Fe = !1, De = !1, Ie = !1, We = !1, ne;
|
|
65
65
|
ne = Symbol.for("react.module.reference");
|
|
66
66
|
function Me(e) {
|
|
67
|
-
return !!(typeof e == "string" || typeof e == "function" || e ===
|
|
67
|
+
return !!(typeof e == "string" || typeof e == "function" || e === d || e === g || We || e === u || e === E || e === b || Ie || e === S || $e || Fe || De || typeof e == "object" && e !== null && (e.$$typeof === x || e.$$typeof === R || e.$$typeof === h || e.$$typeof === p || e.$$typeof === m || // 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.
|
|
@@ -88,11 +88,11 @@ function br() {
|
|
|
88
88
|
if (typeof e == "string")
|
|
89
89
|
return e;
|
|
90
90
|
switch (e) {
|
|
91
|
-
case
|
|
91
|
+
case d:
|
|
92
92
|
return "Fragment";
|
|
93
93
|
case i:
|
|
94
94
|
return "Portal";
|
|
95
|
-
case
|
|
95
|
+
case g:
|
|
96
96
|
return "Profiler";
|
|
97
97
|
case u:
|
|
98
98
|
return "StrictMode";
|
|
@@ -106,7 +106,7 @@ function br() {
|
|
|
106
106
|
case p:
|
|
107
107
|
var r = e;
|
|
108
108
|
return ae(r) + ".Consumer";
|
|
109
|
-
case
|
|
109
|
+
case h:
|
|
110
110
|
var n = e;
|
|
111
111
|
return ae(n._context) + ".Provider";
|
|
112
112
|
case m:
|
|
@@ -610,7 +610,7 @@ React keys must be passed directly to JSX without using spread:
|
|
|
610
610
|
<%s key={someKey} {...props} />`, te, j, fr, j), Te[j + te] = !0;
|
|
611
611
|
}
|
|
612
612
|
}
|
|
613
|
-
return e ===
|
|
613
|
+
return e === d ? ir(y) : or(y), y;
|
|
614
614
|
}
|
|
615
615
|
}
|
|
616
616
|
function sr(e, r, n) {
|
|
@@ -620,7 +620,7 @@ React keys must be passed directly to JSX without using spread:
|
|
|
620
620
|
return Se(e, r, n, !1);
|
|
621
621
|
}
|
|
622
622
|
var ur = lr, cr = sr;
|
|
623
|
-
N.Fragment =
|
|
623
|
+
N.Fragment = d, N.jsx = ur, N.jsxs = cr;
|
|
624
624
|
})()), N;
|
|
625
625
|
}
|
|
626
626
|
var je;
|
|
@@ -632,19 +632,20 @@ function Rr(a) {
|
|
|
632
632
|
const {
|
|
633
633
|
children: t,
|
|
634
634
|
showLineNumbers: i = !1,
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
635
|
+
startLine: d = 1,
|
|
636
|
+
className: u = "",
|
|
637
|
+
style: g = {},
|
|
638
|
+
topPadding: h = 16
|
|
639
|
+
} = a, E = (typeof t == "string" ? t : "").split(`
|
|
640
|
+
`).map((b, R) => d + R);
|
|
640
641
|
return F.createElement("pre", {
|
|
641
|
-
className: `language-markdown ${i ? "line-numbers" : ""} ${
|
|
642
|
-
"data-start":
|
|
642
|
+
className: `language-markdown ${i ? "line-numbers" : ""} ${u}`.trim(),
|
|
643
|
+
"data-start": d,
|
|
643
644
|
style: {
|
|
644
645
|
position: "relative",
|
|
645
|
-
counterReset: `linenumber ${
|
|
646
|
+
counterReset: `linenumber ${d - 1}`,
|
|
646
647
|
...i ? { paddingLeft: "1.2em" } : {},
|
|
647
|
-
...
|
|
648
|
+
...g
|
|
648
649
|
}
|
|
649
650
|
}, [
|
|
650
651
|
F.createElement("code", {
|
|
@@ -658,7 +659,7 @@ function Rr(a) {
|
|
|
658
659
|
style: {
|
|
659
660
|
position: "absolute",
|
|
660
661
|
pointerEvents: "none",
|
|
661
|
-
top: `${1 +
|
|
662
|
+
top: `${1 + h / 16}em`,
|
|
662
663
|
fontSize: "100%",
|
|
663
664
|
left: "0em",
|
|
664
665
|
width: "2.5em",
|
|
@@ -690,14 +691,14 @@ class Er {
|
|
|
690
691
|
constructor(t) {
|
|
691
692
|
this.padding = Pe(t);
|
|
692
693
|
}
|
|
693
|
-
formatCell(t, i,
|
|
694
|
-
const u =
|
|
694
|
+
formatCell(t, i, d) {
|
|
695
|
+
const u = d;
|
|
695
696
|
switch (i) {
|
|
696
697
|
case "right":
|
|
697
698
|
return `${this.padding}${t.padStart(u)}${this.padding}`;
|
|
698
699
|
case "center": {
|
|
699
|
-
const
|
|
700
|
-
return `${this.padding}${" ".repeat(
|
|
700
|
+
const g = u - t.length, h = Math.floor(g / 2), p = g - h;
|
|
701
|
+
return `${this.padding}${" ".repeat(h)}${t}${" ".repeat(p)}${this.padding}`;
|
|
701
702
|
}
|
|
702
703
|
default:
|
|
703
704
|
return `${this.padding}${t.padEnd(u)}${this.padding}`;
|
|
@@ -729,32 +730,32 @@ class _r {
|
|
|
729
730
|
] : Array.from(this.config.columnAlignments);
|
|
730
731
|
}
|
|
731
732
|
formatRow(t) {
|
|
732
|
-
return `|${Array.from({ length: this.config.columnCount }, (
|
|
733
|
-
let
|
|
734
|
-
this.config.replaceNewlines && (
|
|
735
|
-
const
|
|
736
|
-
return this.cellFormatter.formatCell(
|
|
733
|
+
return `|${Array.from({ length: this.config.columnCount }, (d, u) => {
|
|
734
|
+
let g = t[u] ?? "";
|
|
735
|
+
this.config.replaceNewlines && (g = g.replace(/\n/g, "<br>"));
|
|
736
|
+
const h = this.adjustedAlignments[u], p = this.config.columnWidths ? this.config.columnWidths[u] : g.length;
|
|
737
|
+
return this.cellFormatter.formatCell(g, h, p);
|
|
737
738
|
}).join("|")}|`;
|
|
738
739
|
}
|
|
739
740
|
formatAlignmentRow() {
|
|
740
741
|
const t = Pe(this.config);
|
|
741
|
-
return `|${Array.from({ length: this.config.columnCount }, (
|
|
742
|
-
const
|
|
742
|
+
return `|${Array.from({ length: this.config.columnCount }, (d, u) => {
|
|
743
|
+
const g = this.adjustedAlignments[u], h = this.config.columnWidths ? this.config.columnWidths[u] : 3, p = wr.formatIndicator(g, h);
|
|
743
744
|
return `${t}${p}${t}`;
|
|
744
745
|
}).join("|")}|`;
|
|
745
746
|
}
|
|
746
747
|
}
|
|
747
748
|
function Cr(a, t) {
|
|
748
749
|
const i = new Array(t).fill(3);
|
|
749
|
-
return a.forEach((
|
|
750
|
+
return a.forEach((d) => {
|
|
750
751
|
for (let u = 0; u < t; u++) {
|
|
751
|
-
const
|
|
752
|
-
i[u] = Math.max(i[u],
|
|
752
|
+
const g = d[u] ?? "";
|
|
753
|
+
i[u] = Math.max(i[u], g.length);
|
|
753
754
|
}
|
|
754
755
|
}), i;
|
|
755
756
|
}
|
|
756
757
|
function xr(a) {
|
|
757
|
-
const t = a.inputDataHeader.length, i = a.inputDataBody.map((
|
|
758
|
+
const t = a.inputDataHeader.length, i = a.inputDataBody.map((d) => d.length);
|
|
758
759
|
return Math.max(t, ...i);
|
|
759
760
|
}
|
|
760
761
|
function Tr(a, t, i) {
|
|
@@ -763,14 +764,14 @@ function Tr(a, t, i) {
|
|
|
763
764
|
t
|
|
764
765
|
) : void 0;
|
|
765
766
|
}
|
|
766
|
-
function Sr(a, t, i = !0,
|
|
767
|
-
const
|
|
768
|
-
columnCount:
|
|
767
|
+
function Sr(a, t, i = !0, d = !1, u = !1, g = !0) {
|
|
768
|
+
const h = xr(a), p = Tr(a, h, i), m = {
|
|
769
|
+
columnCount: h,
|
|
769
770
|
columnAlignments: t,
|
|
770
771
|
columnWidths: p,
|
|
771
|
-
useTabs:
|
|
772
|
+
useTabs: d,
|
|
772
773
|
replaceNewlines: u,
|
|
773
|
-
hasPadding:
|
|
774
|
+
hasPadding: g
|
|
774
775
|
}, E = new _r(m), b = E.formatRow(a.inputDataHeader), R = E.formatAlignmentRow(), x = a.inputDataBody.map((S) => E.formatRow(S)).join(`
|
|
775
776
|
`);
|
|
776
777
|
return `${b}
|
|
@@ -820,17 +821,17 @@ code[class*=language-],pre[class*=language-]{color:${t.textColor};background:0 0
|
|
|
820
821
|
function $r(a, t) {
|
|
821
822
|
return t ? { inputDataHeader: a[0], inputDataBody: a.slice(1) } : { inputDataHeader: Or(a[0].length), inputDataBody: a };
|
|
822
823
|
}
|
|
823
|
-
function Fr(a, t, i,
|
|
824
|
+
function Fr(a, t, i, d, u, g, h) {
|
|
824
825
|
try {
|
|
825
826
|
jr(a);
|
|
826
827
|
const { inputDataHeader: p, inputDataBody: m } = $r(a, t);
|
|
827
828
|
return Sr(
|
|
828
829
|
{ inputDataHeader: p, inputDataBody: m },
|
|
829
830
|
i,
|
|
830
|
-
h,
|
|
831
|
-
u,
|
|
832
831
|
d,
|
|
833
|
-
|
|
832
|
+
u,
|
|
833
|
+
g,
|
|
834
|
+
h
|
|
834
835
|
);
|
|
835
836
|
} catch (p) {
|
|
836
837
|
if (p instanceof L)
|
|
@@ -842,10 +843,10 @@ function Ir({
|
|
|
842
843
|
inputData: a = null,
|
|
843
844
|
hasHeader: t = !0,
|
|
844
845
|
columnAlignments: i = [],
|
|
845
|
-
isCompact:
|
|
846
|
+
isCompact: d = !1,
|
|
846
847
|
hasTabs: u = !1,
|
|
847
|
-
hasPadding:
|
|
848
|
-
convertLineBreaks:
|
|
848
|
+
hasPadding: g = !0,
|
|
849
|
+
convertLineBreaks: h = !1,
|
|
849
850
|
className: p,
|
|
850
851
|
onGenerate: m,
|
|
851
852
|
theme: E = "light",
|
|
@@ -858,18 +859,18 @@ function Ir({
|
|
|
858
859
|
z,
|
|
859
860
|
t,
|
|
860
861
|
i,
|
|
861
|
-
!
|
|
862
|
+
!d,
|
|
862
863
|
u,
|
|
863
|
-
|
|
864
|
-
|
|
864
|
+
h,
|
|
865
|
+
g
|
|
865
866
|
), [
|
|
866
867
|
z,
|
|
867
868
|
t,
|
|
868
869
|
i,
|
|
869
|
-
|
|
870
|
+
d,
|
|
870
871
|
u,
|
|
871
|
-
|
|
872
|
-
|
|
872
|
+
h,
|
|
873
|
+
g
|
|
873
874
|
]);
|
|
874
875
|
return hr(() => {
|
|
875
876
|
m && m(D);
|
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.9",
|
|
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",
|