@akshay-rajput/git-graph-svg 2.0.2 → 2.0.4
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.
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
(function(J,
|
|
2
|
-
`+
|
|
3
|
-
`)
|
|
4
|
-
`),
|
|
5
|
-
`+
|
|
1
|
+
(function(J,A){typeof exports=="object"&&typeof module<"u"?A(exports,require("react")):typeof define=="function"&&define.amd?define(["exports","react"],A):(J=typeof globalThis<"u"?globalThis:J||self,A(J.GitRepoGraph={},J.React))})(this,(function(J,A){"use strict";var fe={exports:{}},ne={};var Ce;function Ne(){if(Ce)return ne;Ce=1;var m=A,T=Symbol.for("react.element"),_=Symbol.for("react.fragment"),E=Object.prototype.hasOwnProperty,w=m.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,k={key:!0,ref:!0,__self:!0,__source:!0};function M(L,g,B){var x,P={},U=null,X=null;B!==void 0&&(U=""+B),g.key!==void 0&&(U=""+g.key),g.ref!==void 0&&(X=g.ref);for(x in g)E.call(g,x)&&!k.hasOwnProperty(x)&&(P[x]=g[x]);if(L&&L.defaultProps)for(x in g=L.defaultProps,g)P[x]===void 0&&(P[x]=g[x]);return{$$typeof:T,type:L,key:U,ref:X,props:P,_owner:w.current}}return ne.Fragment=_,ne.jsx=M,ne.jsxs=M,ne}var ae={};var we;function Ke(){return we||(we=1,process.env.NODE_ENV!=="production"&&(function(){var m=A,T=Symbol.for("react.element"),_=Symbol.for("react.portal"),E=Symbol.for("react.fragment"),w=Symbol.for("react.strict_mode"),k=Symbol.for("react.profiler"),M=Symbol.for("react.provider"),L=Symbol.for("react.context"),g=Symbol.for("react.forward_ref"),B=Symbol.for("react.suspense"),x=Symbol.for("react.suspense_list"),P=Symbol.for("react.memo"),U=Symbol.for("react.lazy"),X=Symbol.for("react.offscreen"),s=Symbol.iterator,y="@@iterator";function j(e){if(e===null||typeof e!="object")return null;var r=s&&e[s]||e[y];return typeof r=="function"?r:null}var D=m.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function h(e){{for(var r=arguments.length,t=new Array(r>1?r-1:0),a=1;a<r;a++)t[a-1]=arguments[a];G("error",e,t)}}function G(e,r,t){{var a=D.ReactDebugCurrentFrame,p=a.getStackAddendum();p!==""&&(r+="%s",t=t.concat([p]));var b=t.map(function(v){return String(v)});b.unshift("Warning: "+r),Function.prototype.apply.call(console[e],console,b)}}var z=!1,$=!1,oe=!1,d=!1,ie=!1,se;se=Symbol.for("react.module.reference");function be(e){return!!(typeof e=="string"||typeof e=="function"||e===E||e===k||ie||e===w||e===B||e===x||d||e===X||z||$||oe||typeof e=="object"&&e!==null&&(e.$$typeof===U||e.$$typeof===P||e.$$typeof===M||e.$$typeof===L||e.$$typeof===g||e.$$typeof===se||e.getModuleId!==void 0))}function de(e,r,t){var a=e.displayName;if(a)return a;var p=r.displayName||r.name||"";return p!==""?t+"("+p+")":t}function ve(e){return e.displayName||"Context"}function N(e){if(e==null)return null;if(typeof e.tag=="number"&&h("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 E:return"Fragment";case _:return"Portal";case k:return"Profiler";case w:return"StrictMode";case B:return"Suspense";case x:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case L:var r=e;return ve(r)+".Consumer";case M:var t=e;return ve(t._context)+".Provider";case g:return de(e,e.render,"ForwardRef");case P:var a=e.displayName||null;return a!==null?a:N(e.type)||"Memo";case U:{var p=e,b=p._payload,v=p._init;try{return N(v(b))}catch{return null}}}return null}var H=Object.assign,q=0,he,pe,n,i,l,o,u;function f(){}f.__reactDisabledLog=!0;function C(){{if(q===0){he=console.log,pe=console.info,n=console.warn,i=console.error,l=console.group,o=console.groupCollapsed,u=console.groupEnd;var e={configurable:!0,enumerable:!0,value:f,writable:!0};Object.defineProperties(console,{info:e,log:e,warn:e,error:e,group:e,groupCollapsed:e,groupEnd:e})}q++}}function R(){{if(q--,q===0){var e={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:H({},e,{value:he}),info:H({},e,{value:pe}),warn:H({},e,{value:n}),error:H({},e,{value:i}),group:H({},e,{value:l}),groupCollapsed:H({},e,{value:o}),groupEnd:H({},e,{value:u})})}q<0&&h("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var I=D.ReactCurrentDispatcher,Z;function le(e,r,t){{if(Z===void 0)try{throw Error()}catch(p){var a=p.stack.trim().match(/\n( *(at )?)/);Z=a&&a[1]||""}return`
|
|
2
|
+
`+Z+e}}var Q=!1,K;{var tr=typeof WeakMap=="function"?WeakMap:Map;K=new tr}function je(e,r){if(!e||Q)return"";{var t=K.get(e);if(t!==void 0)return t}var a;Q=!0;var p=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var b;b=I.current,I.current=null,C();try{if(r){var v=function(){throw Error()};if(Object.defineProperty(v.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(v,[])}catch(W){a=W}Reflect.construct(e,[],v)}else{try{v.call()}catch(W){a=W}e.call(v.prototype)}}else{try{throw Error()}catch(W){a=W}e()}}catch(W){if(W&&a&&typeof W.stack=="string"){for(var c=W.stack.split(`
|
|
3
|
+
`),F=a.stack.split(`
|
|
4
|
+
`),S=c.length-1,O=F.length-1;S>=1&&O>=0&&c[S]!==F[O];)O--;for(;S>=1&&O>=0;S--,O--)if(c[S]!==F[O]){if(S!==1||O!==1)do if(S--,O--,O<0||c[S]!==F[O]){var Y=`
|
|
5
|
+
`+c[S].replace(" at new "," at ");return e.displayName&&Y.includes("<anonymous>")&&(Y=Y.replace("<anonymous>",e.displayName)),typeof e=="function"&&K.set(e,Y),Y}while(S>=1&&O>=0);break}}}finally{Q=!1,I.current=b,R(),Error.prepareStackTrace=p}var te=e?e.displayName||e.name:"",ee=te?le(te):"";return typeof e=="function"&&K.set(e,ee),ee}function nr(e,r,t){return je(e,!1)}function ar(e){var r=e.prototype;return!!(r&&r.isReactComponent)}function ge(e,r,t){if(e==null)return"";if(typeof e=="function")return je(e,ar(e));if(typeof e=="string")return le(e);switch(e){case B:return le("Suspense");case x:return le("SuspenseList")}if(typeof e=="object")switch(e.$$typeof){case g:return nr(e.render);case P:return ge(e.type,r,t);case U:{var a=e,p=a._payload,b=a._init;try{return ge(b(p),r,t)}catch{}}}return""}var ue=Object.prototype.hasOwnProperty,Ie={},ke=D.ReactDebugCurrentFrame;function ye(e){if(e){var r=e._owner,t=ge(e.type,e._source,r?r.type:null);ke.setExtraStackFrame(t)}else ke.setExtraStackFrame(null)}function or(e,r,t,a,p){{var b=Function.call.bind(ue);for(var v in e)if(b(e,v)){var c=void 0;try{if(typeof e[v]!="function"){var F=Error((a||"React class")+": "+t+" type `"+v+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof e[v]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw F.name="Invariant Violation",F}c=e[v](r,v,a,t,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(S){c=S}c&&!(c instanceof Error)&&(ye(p),h("%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).",a||"React class",t,v,typeof c),ye(null)),c instanceof Error&&!(c.message in Ie)&&(Ie[c.message]=!0,ye(p),h("Failed %s type: %s",t,c.message),ye(null))}}}var ir=Array.isArray;function Ee(e){return ir(e)}function sr(e){{var r=typeof Symbol=="function"&&Symbol.toStringTag,t=r&&e[Symbol.toStringTag]||e.constructor.name||"Object";return t}}function lr(e){try{return De(e),!1}catch{return!0}}function De(e){return""+e}function $e(e){if(lr(e))return h("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",sr(e)),De(e)}var Fe=D.ReactCurrentOwner,ur={key:!0,ref:!0,__self:!0,__source:!0},Ae,Me;function fr(e){if(ue.call(e,"ref")){var r=Object.getOwnPropertyDescriptor(e,"ref").get;if(r&&r.isReactWarning)return!1}return e.ref!==void 0}function cr(e){if(ue.call(e,"key")){var r=Object.getOwnPropertyDescriptor(e,"key").get;if(r&&r.isReactWarning)return!1}return e.key!==void 0}function dr(e,r){typeof e.ref=="string"&&Fe.current}function vr(e,r){{var t=function(){Ae||(Ae=!0,h("%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))};t.isReactWarning=!0,Object.defineProperty(e,"key",{get:t,configurable:!0})}}function hr(e,r){{var t=function(){Me||(Me=!0,h("%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))};t.isReactWarning=!0,Object.defineProperty(e,"ref",{get:t,configurable:!0})}}var pr=function(e,r,t,a,p,b,v){var c={$$typeof:T,type:e,key:r,ref:t,props:v,_owner:b};return c._store={},Object.defineProperty(c._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(c,"_self",{configurable:!1,enumerable:!1,writable:!1,value:a}),Object.defineProperty(c,"_source",{configurable:!1,enumerable:!1,writable:!1,value:p}),Object.freeze&&(Object.freeze(c.props),Object.freeze(c)),c};function gr(e,r,t,a,p){{var b,v={},c=null,F=null;t!==void 0&&($e(t),c=""+t),cr(r)&&($e(r.key),c=""+r.key),fr(r)&&(F=r.ref,dr(r,p));for(b in r)ue.call(r,b)&&!ur.hasOwnProperty(b)&&(v[b]=r[b]);if(e&&e.defaultProps){var S=e.defaultProps;for(b in S)v[b]===void 0&&(v[b]=S[b])}if(c||F){var O=typeof e=="function"?e.displayName||e.name||"Unknown":e;c&&vr(v,O),F&&hr(v,O)}return pr(e,c,F,p,a,Fe.current,v)}}var _e=D.ReactCurrentOwner,Le=D.ReactDebugCurrentFrame;function re(e){if(e){var r=e._owner,t=ge(e.type,e._source,r?r.type:null);Le.setExtraStackFrame(t)}else Le.setExtraStackFrame(null)}var xe;xe=!1;function Re(e){return typeof e=="object"&&e!==null&&e.$$typeof===T}function We(){{if(_e.current){var e=N(_e.current.type);if(e)return`
|
|
6
6
|
|
|
7
|
-
Check the render method of \``+e+"`."}return""}}function yr(e){return""}var
|
|
7
|
+
Check the render method of \``+e+"`."}return""}}function yr(e){return""}var Be={};function br(e){{var r=We();if(!r){var t=typeof e=="string"?e:e.displayName||e.name;t&&(r=`
|
|
8
8
|
|
|
9
|
-
Check the top-level render call using <`+t+">.")}return r}}function
|
|
9
|
+
Check the top-level render call using <`+t+">.")}return r}}function Ue(e,r){{if(!e._store||e._store.validated||e.key!=null)return;e._store.validated=!0;var t=br(r);if(Be[t])return;Be[t]=!0;var a="";e&&e._owner&&e._owner!==_e.current&&(a=" It was passed a child from "+N(e._owner.type)+"."),re(e),h('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',t,a),re(null)}}function Ge(e,r){{if(typeof e!="object")return;if(Ee(e))for(var t=0;t<e.length;t++){var a=e[t];Re(a)&&Ue(a,r)}else if(Re(e))e._store&&(e._store.validated=!0);else if(e){var p=j(e);if(typeof p=="function"&&p!==e.entries)for(var b=p.call(e),v;!(v=b.next()).done;)Re(v.value)&&Ue(v.value,r)}}}function Er(e){{var r=e.type;if(r==null||typeof r=="string")return;var t;if(typeof r=="function")t=r.propTypes;else if(typeof r=="object"&&(r.$$typeof===g||r.$$typeof===P))t=r.propTypes;else return;if(t){var a=N(r);or(t,e.props,"prop",a,e)}else if(r.PropTypes!==void 0&&!xe){xe=!0;var p=N(r);h("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",p||"Unknown")}typeof r.getDefaultProps=="function"&&!r.getDefaultProps.isReactClassApproved&&h("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function _r(e){{for(var r=Object.keys(e.props),t=0;t<r.length;t++){var a=r[t];if(a!=="children"&&a!=="key"){re(e),h("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",a),re(null);break}}e.ref!==null&&(re(e),h("Invalid attribute `ref` supplied to `React.Fragment`."),re(null))}}var Ye={};function Ve(e,r,t,a,p,b){{var v=be(e);if(!v){var c="";(e===void 0||typeof e=="object"&&e!==null&&Object.keys(e).length===0)&&(c+=" 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 F=yr();F?c+=F:c+=We();var S;e===null?S="null":Ee(e)?S="array":e!==void 0&&e.$$typeof===T?(S="<"+(N(e.type)||"Unknown")+" />",c=" Did you accidentally export a JSX literal instead of a component?"):S=typeof e,h("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",S,c)}var O=gr(e,r,t,p,b);if(O==null)return O;if(v){var Y=r.children;if(Y!==void 0)if(a)if(Ee(Y)){for(var te=0;te<Y.length;te++)Ge(Y[te],e);Object.freeze&&Object.freeze(Y)}else h("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 Ge(Y,e)}if(ue.call(r,"key")){var ee=N(e),W=Object.keys(r).filter(function(Sr){return Sr!=="key"}),Te=W.length>0?"{key: someKey, "+W.join(": ..., ")+": ...}":"{key: someKey}";if(!Ye[ee+Te]){var wr=W.length>0?"{"+W.join(": ..., ")+": ...}":"{}";h(`A props object containing a "key" prop is being spread into JSX:
|
|
10
10
|
let props = %s;
|
|
11
11
|
<%s {...props} />
|
|
12
12
|
React keys must be passed directly to JSX without using spread:
|
|
13
13
|
let props = %s;
|
|
14
|
-
<%s key={someKey} {...props} />`,
|
|
14
|
+
<%s key={someKey} {...props} />`,Te,ee,wr,ee),Ye[ee+Te]=!0}}return e===E?_r(O):Er(O),O}}function xr(e,r,t){return Ve(e,r,t,!0)}function Rr(e,r,t){return Ve(e,r,t,!1)}var Tr=Rr,Cr=xr;ae.Fragment=E,ae.jsx=Tr,ae.jsxs=Cr})()),ae}var Se;function He(){return Se||(Se=1,process.env.NODE_ENV==="production"?fe.exports=Ne():fe.exports=Ke()),fe.exports}var V=He();const Oe=50,Je=5,Xe=["#3a86ff","#8338ec","#ff006e","#fb5607","#ffbe0b"],ze=({commits:m,rowHeight:T,colorPalette:_,laneWidth:E,renderNode:w,renderEdge:k})=>{const M=E||Oe,L=T||Oe,g=A.useMemo(()=>(_||Xe).map((s,y)=>({color:s,branch:null,lane:y+1,index:y})),[_,m]);function B(){var s=g.findIndex(j=>!j.branch);if(s>-1)return g[s];var y={color:"#"+Math.floor(Math.random()*16777215).toString(16),branch:null,lane:g.length+1,index:s};return g.push(y),y}const x=A.useMemo(()=>{var s=[];const y=new Map;return m.forEach((j,D)=>{var h={...j,color:"",lane:0,cx:0,cy:0,prev:[],index:D},G=g.find($=>$.branch==j.id);G?g.forEach($=>{$.branch===j.id&&$.index!==G?.index&&($.branch=null)}):G=B();for(const $ of j.parents)if(g.find(d=>d.branch===$))G.branch=$;else if(G.branch==j.id)G.branch=$;else{var z=g.find(d=>!d.branch);z||(z=B()),z.branch=$}h.color=G.color,h.lane=G.lane,h.cx=h.lane*M-M/2,h.cy=L*D+M/2,s.push(h),y.set(h.id,h)}),s.forEach(j=>{j.parents.forEach(D=>{const h=y.get(D);h&&h.prev.push(j)})}),s},[m,L,M]);function P(s,y){return`M ${s.cx} ${s.cy} L ${y.cx} ${y.cy}`}const U=A.useMemo(()=>Math.max(...x.map(s=>s.lane),0),[x]),X=A.useMemo(()=>U*M+100,[U,M]);return V.jsxs("svg",{width:X,height:L*x.length,children:[x.flatMap(s=>s.prev.map((y,j)=>{if(k)return k(s,y,x,j);const D=P(s,y);return V.jsx("path",{d:D,fill:"none",stroke:s.lane<=y.lane?y.color:s.color,strokeWidth:2},`${s.id}-${y.id}_${j}`)})),x.map((s,y)=>w?w(s,y):V.jsx("circle",{cx:s.cx,cy:s.cy,r:Je,fill:s.color},`${s.id}_${y}`))]})},ce={getCurveTop(m,T,_,E){const w=Math.min(15,Math.abs(E-T)/2);let k=` C ${m} ${T+w}, ${_} ${T+w}, ${_} ${T+w*2}`;return T+w*2<E&&(k+=` L ${_} ${E}`),k},getCurveBottom(m,T,_,E){const w=Math.min(15,Math.abs(E-T)/2);let k="";return E-w*2>T&&(k+=` L ${m} ${E-w*2}`),k+=` C ${m} ${E-w}, ${_} ${E-w}, ${_} ${E}`,k},drawFinalPath(m,T,_=2,E,w){return V.jsx("path",{d:m,stroke:T,strokeWidth:_,fill:"none"},`${E.id}-${w.id}`)},drawPoint(m,T,_,E){return V.jsx("circle",{cx:m,cy:T,r:5,fill:_,stroke:"none"},E.id)}},qe=["#3a86ff","#8338ec","#ff006e","#fb5607","#ffbe0b","#3affbd","#adec38","#ff009d","#fb7507","#0b38ff"],Ze=35,Qe=35,me=25,Pe=25,er=2,rr=A.forwardRef((m,T)=>{const{commits:_,colorPalette:E,rowHeight:w,laneWidth:k,style:M,renderNode:L,renderEdge:g,getMergeCurve:B,getBranchSplitCurve:x,padding:P}=m,[U,X]=A.useState(0);let s=0;const y=E||qe,j=w||Ze,D=k||Qe,h=typeof P=="number"?{left:P,right:P,bottom:P,top:P}:P||{left:me,right:me,bottom:Pe,top:Pe},{nodes:G,edges:z}=A.useMemo(()=>{const $=[],oe=[];let d={},ie=[],se=0;function be(n,i,l,o){return s=Math.max(s,l,n),B?B(n,i,l,o):ce.getCurveTop(n,i,l,o)}function de(n,i,l,o){return s=Math.max(s,l,n),x?x(n,i,l,o):ce.getCurveBottom(n,i,l,o)}function ve(n,i,l,o,u){if(g){let f=g(o,u,i,l);n.push(f)}else{let f=ce.drawFinalPath(i,l,er,o,u);n.push(f)}}function N(n,i,l,o,u){if(s=Math.max(s,i),L){let f=L(i,l,o,u);n.push(f)}else{let f=ce.drawPoint(i,l,o,u);n.push(f)}}function H(){const n=Object.values(d),i=new Set(n.map(o=>o.xIndex));let l=0;for(;i.has(l);)l++;return{color:y[se++%y.length],xIndex:l}}function q(){const n=Object.keys(d),i=new Set;n.filter(o=>o.startsWith("merge_")).forEach(o=>{i.add(d[o].xIndex)});const l=n.filter(o=>!o.startsWith("merge_")).map(o=>d[o]);l.sort((o,u)=>o.xIndex-u.xIndex);for(const o of l){let u=0;for(;i.has(u);)u++;u<o.xIndex&&(o.xIndex=u),i.add(o.xIndex)}}function he(n,i){let l=new Set,o=d[i];o&&(l.add(i),o.toBeClosed&&o.toBeClosed.forEach(u=>l.add(u))),Object.keys(d).forEach(u=>{if(l.has(u))return;const f=d[u],C=f.xIndex*D+h.left;f.lastxy.y!==n&&(f.lastxy.x!==C?f.pathStr+=be(f.lastxy.x,f.lastxy.y,C,n):f.pathStr+=` L ${C} ${n}`,f.lastxy={x:C,y:n})})}function pe(n){let i=d[n.id],l=0,o="";if(i)l=i.xIndex,o=i.color;else{let C=H();l=C.xIndex,o=C.color}const u=l*D+h.left,f=n.meta.yIndex*j+h.top;if(he(f,n.id),i&&((i.lastxy.y!==f||i.lastxy.x!==u)&&(i.pathStr+=de(i.lastxy.x,i.lastxy.y,u,f)),ie.push({d:i.pathStr,color:i.color,from:i.from,to:n}),i.toBeClosed&&i.toBeClosed.forEach(C=>{let R=d[C];R&&((R.lastxy.y!==f||R.lastxy.x!==u)&&(R.pathStr+=de(R.lastxy.x,R.lastxy.y,u,f)),ie.push({d:R.pathStr,color:R.color,from:R.from,to:n}),delete d[C])}),delete d[n.id]),N($,u,f,o,n),n.parents.length>0){let C=n.parents[0];if(!d[C])d[C]={color:o,xIndex:l,lastxy:{x:u,y:f},pathStr:`M ${u} ${f}`,from:n};else{let R=d[C];if(l<R.xIndex){let I=`merge_${n.id}_${C}_${R.xIndex}`;d[I]=R,d[C]={color:o,xIndex:l,lastxy:{x:u,y:f},pathStr:`M ${u} ${f}`,toBeClosed:R.toBeClosed?[...R.toBeClosed,I]:[I],from:n},delete R.toBeClosed}else{let I=`merge_${n.id}_${C}_${l}`;d[I]={color:o,xIndex:l,lastxy:{x:u,y:f},pathStr:`M ${u} ${f}`,from:n},d[C].toBeClosed||(d[C].toBeClosed=[]),d[C].toBeClosed.push(I)}}for(let R=1;R<n.parents.length;R++){let I=n.parents[R],Z=l+R;Object.values(d).forEach(K=>{K.xIndex>=Z&&K.xIndex++});let Q={color:y[se++%y.length],xIndex:Z,lastxy:{x:u,y:f},pathStr:`M ${u} ${f}`,from:n};if(!d[I])d[I]=Q;else{let K=`merge_${n.id}_${I}_${Z}`;Q.color=d[I].color,d[K]=Q,d[I].toBeClosed||(d[I].toBeClosed=[]),d[I].toBeClosed.push(K)}}}q()}return _.sort((n,i)=>new Date(i.date).getTime()-new Date(n.date).getTime()),_.forEach((n,i)=>{n.meta==null&&(n.meta={yIndex:i,prev:[]}),n.meta.yIndex=i,n.parents.forEach(l=>{var o=_.findIndex(f=>f.id===l);if(o>-1){var u=_[o];u.meta==null&&(u.meta={yIndex:o,prev:[]}),u.meta.prev.indexOf(n.id)<0&&u.meta.prev.push(n.id)}})}),_.forEach(n=>{pe(n)}),ie.forEach(n=>{ve(oe,n.d,n.color,n.from,n.to)}),{nodes:$,edges:oe}},[{...m}]);return A.useEffect(()=>{X(s+h.right)},[s]),V.jsx(V.Fragment,{children:V.jsxs("svg",{ref:T,height:j*_.length+h.bottom,width:U,style:M,children:[V.jsx("g",{id:"layer-lines",children:z}),V.jsx("g",{id:"layer-points",children:G})]})})});J.GitGraph=rr,J.GitGraphSVG=ze,Object.defineProperty(J,Symbol.toStringTag,{value:"Module"})}));
|