react-code-compare
Version:
A simple and fast text diff viewer component
2 lines (1 loc) • 1.76 kB
JavaScript
var L=Object.create;var m=Object.defineProperty;var B=Object.getOwnPropertyDescriptor;var I=Object.getOwnPropertyNames;var P=Object.getPrototypeOf,y=Object.prototype.hasOwnProperty;var E=(o,t)=>{for(var r in t)m(o,r,{get:t[r],enumerable:!0})},p=(o,t,r,c)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of I(t))!y.call(o,n)&&n!==r&&m(o,n,{get:()=>t[n],enumerable:!(c=B(t,n))||c.enumerable});return o};var s=(o,t,r)=>(r=o!=null?L(P(o)):{},p(t||!o||!o.__esModule?m(r,"default",{value:o,enumerable:!0}):r,o)),T=o=>p(m({},"__esModule",{value:!0}),o);var g={};E(g,{SkippedLinesIndicator:()=>F});module.exports=T(g);var u=s(require("classnames"));var f=s(require("classnames")),b=require("react/jsx-runtime");function R({className:o,styles:t,children:r,index:c,rowRef:n}){return(0,b.jsx)("tr",{className:(0,f.default)(t.line,o),ref:n,"data-index":c,children:r})}var e=require("react/jsx-runtime");function F({splitView:o,xSpacer:t,onBlockClickProxy:r,codeFoldMessageRenderer:c,hideLineNumbers:n,styles:a,num:d,blockNumber:k,leftBlockLineNumber:C,rightBlockLineNumber:N,rowIndex:x,rowRef:w}){let S=c?c(d,C,N):(0,e.jsx)("pre",{className:a.codeFoldContent,children:`Expand ${d} lines ...`}),i=(0,e.jsx)("td",{children:(0,e.jsx)("a",{onClick:r(k),tabIndex:0,children:S})}),l=!o&&!n;return(0,e.jsxs)(R,{className:a.codeFold,styles:a,rowRef:w,index:x,children:[t&&(0,e.jsx)("td",{className:a.xSpacer}),!n&&(0,e.jsx)("td",{className:a.codeFoldGutter}),(0,e.jsx)("td",{className:(0,u.default)({[a.codeFoldGutter]:l})}),l?(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)("td",{}),i]}):(0,e.jsxs)(e.Fragment,{children:[i,(0,e.jsx)("td",{})]}),(0,e.jsx)("td",{}),(0,e.jsx)("td",{}),t&&(0,e.jsx)("td",{className:a.xSpacer})]})}0&&(module.exports={SkippedLinesIndicator});