@akshay-rajput/git-graph-svg 1.0.8 → 2.0.1

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