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

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.
@@ -12,7 +12,7 @@ export interface GitGraphSVGProps {
12
12
  colorPalette?: string[];
13
13
  laneWidth?: number;
14
14
  renderNode?: (commit: _CommitItem, index?: number) => React.ReactNode;
15
- renderEdge?: (from: _CommitItem, to: _CommitItem, index?: number) => React.ReactNode;
15
+ renderEdge?: (from: _CommitItem, to: _CommitItem, commits: _CommitItem[], index?: number) => React.ReactNode;
16
16
  }
17
17
  export interface _CommitItem extends CommitItem {
18
18
  color: string;
@@ -6,10 +6,10 @@ function ve() {
6
6
  Dr = 1;
7
7
  var P = Ir, j = /* @__PURE__ */ Symbol.for("react.element"), $ = /* @__PURE__ */ Symbol.for("react.fragment"), x = Object.prototype.hasOwnProperty, k = P.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, D = { key: !0, ref: !0, __self: !0, __source: !0 };
8
8
  function _(T, f, w) {
9
- var p, O = {}, m = null, I = null;
9
+ var v, O = {}, m = null, I = null;
10
10
  w !== void 0 && (m = "" + w), f.key !== void 0 && (m = "" + f.key), f.ref !== void 0 && (I = f.ref);
11
- for (p in f) x.call(f, p) && !D.hasOwnProperty(p) && (O[p] = f[p]);
12
- if (T && T.defaultProps) for (p in f = T.defaultProps, f) O[p] === void 0 && (O[p] = f[p]);
11
+ for (v in f) x.call(f, v) && !D.hasOwnProperty(v) && (O[v] = f[v]);
12
+ if (T && T.defaultProps) for (v in f = T.defaultProps, f) O[v] === void 0 && (O[v] = f[v]);
13
13
  return { $$typeof: j, type: T, key: m, ref: I, props: O, _owner: k.current };
14
14
  }
15
15
  return N.Fragment = $, N.jsx = _, N.jsxs = _, N;
@@ -18,7 +18,7 @@ var J = {};
18
18
  var Ar;
19
19
  function pe() {
20
20
  return Ar || (Ar = 1, process.env.NODE_ENV !== "production" && (function() {
21
- var P = Ir, j = /* @__PURE__ */ Symbol.for("react.element"), $ = /* @__PURE__ */ Symbol.for("react.portal"), x = /* @__PURE__ */ Symbol.for("react.fragment"), k = /* @__PURE__ */ Symbol.for("react.strict_mode"), D = /* @__PURE__ */ Symbol.for("react.profiler"), _ = /* @__PURE__ */ Symbol.for("react.provider"), T = /* @__PURE__ */ Symbol.for("react.context"), f = /* @__PURE__ */ Symbol.for("react.forward_ref"), w = /* @__PURE__ */ Symbol.for("react.suspense"), p = /* @__PURE__ */ Symbol.for("react.suspense_list"), O = /* @__PURE__ */ Symbol.for("react.memo"), m = /* @__PURE__ */ Symbol.for("react.lazy"), I = /* @__PURE__ */ Symbol.for("react.offscreen"), i = Symbol.iterator, c = "@@iterator";
21
+ var P = Ir, j = /* @__PURE__ */ Symbol.for("react.element"), $ = /* @__PURE__ */ Symbol.for("react.portal"), x = /* @__PURE__ */ Symbol.for("react.fragment"), k = /* @__PURE__ */ Symbol.for("react.strict_mode"), D = /* @__PURE__ */ Symbol.for("react.profiler"), _ = /* @__PURE__ */ Symbol.for("react.provider"), T = /* @__PURE__ */ Symbol.for("react.context"), f = /* @__PURE__ */ Symbol.for("react.forward_ref"), w = /* @__PURE__ */ Symbol.for("react.suspense"), v = /* @__PURE__ */ Symbol.for("react.suspense_list"), O = /* @__PURE__ */ Symbol.for("react.memo"), m = /* @__PURE__ */ Symbol.for("react.lazy"), I = /* @__PURE__ */ Symbol.for("react.offscreen"), i = Symbol.iterator, c = "@@iterator";
22
22
  function h(r) {
23
23
  if (r === null || typeof r != "object")
24
24
  return null;
@@ -46,7 +46,7 @@ function pe() {
46
46
  var Y = !1, y = !1, ir = !1, L = !1, Wr = !1, ur;
47
47
  ur = /* @__PURE__ */ Symbol.for("react.module.reference");
48
48
  function Mr(r) {
49
- return !!(typeof r == "string" || typeof r == "function" || r === x || r === D || Wr || r === k || r === w || r === p || L || r === I || Y || y || ir || typeof r == "object" && r !== null && (r.$$typeof === m || r.$$typeof === O || r.$$typeof === _ || r.$$typeof === T || r.$$typeof === f || // This needs to include all possible module reference object
49
+ return !!(typeof r == "string" || typeof r == "function" || r === x || r === D || Wr || r === k || r === w || r === v || L || r === I || Y || y || ir || typeof r == "object" && r !== null && (r.$$typeof === m || r.$$typeof === O || r.$$typeof === _ || r.$$typeof === T || r.$$typeof === f || // This needs to include all possible module reference object
50
50
  // types supported by any Flight configuration anywhere since
51
51
  // we don't know which Flight build this will end up being used
52
52
  // with.
@@ -80,7 +80,7 @@ function pe() {
80
80
  return "StrictMode";
81
81
  case w:
82
82
  return "Suspense";
83
- case p:
83
+ case v:
84
84
  return "SuspenseList";
85
85
  }
86
86
  if (typeof r == "object")
@@ -238,18 +238,18 @@ function pe() {
238
238
  if (g && t && typeof g.stack == "string") {
239
239
  for (var a = g.stack.split(`
240
240
  `), b = t.stack.split(`
241
- `), d = a.length - 1, v = b.length - 1; d >= 1 && v >= 0 && a[d] !== b[v]; )
242
- v--;
243
- for (; d >= 1 && v >= 0; d--, v--)
244
- if (a[d] !== b[v]) {
245
- if (d !== 1 || v !== 1)
241
+ `), d = a.length - 1, p = b.length - 1; d >= 1 && p >= 0 && a[d] !== b[p]; )
242
+ p--;
243
+ for (; d >= 1 && p >= 0; d--, p--)
244
+ if (a[d] !== b[p]) {
245
+ if (d !== 1 || p !== 1)
246
246
  do
247
- if (d--, v--, v < 0 || a[d] !== b[v]) {
247
+ if (d--, p--, p < 0 || a[d] !== b[p]) {
248
248
  var R = `
249
249
  ` + a[d].replace(" at new ", " at ");
250
250
  return r.displayName && R.includes("<anonymous>") && (R = R.replace("<anonymous>", r.displayName)), typeof r == "function" && B.set(r, R), R;
251
251
  }
252
- while (d >= 1 && v >= 0);
252
+ while (d >= 1 && p >= 0);
253
253
  break;
254
254
  }
255
255
  }
@@ -276,7 +276,7 @@ function pe() {
276
276
  switch (r) {
277
277
  case w:
278
278
  return q("Suspense");
279
- case p:
279
+ case v:
280
280
  return q("SuspenseList");
281
281
  }
282
282
  if (typeof r == "object")
@@ -434,8 +434,8 @@ function pe() {
434
434
  o[l] === void 0 && (o[l] = d[l]);
435
435
  }
436
436
  if (a || b) {
437
- var v = typeof r == "function" ? r.displayName || r.name || "Unknown" : r;
438
- a && Qr(o, v), b && re(o, v);
437
+ var p = typeof r == "function" ? r.displayName || r.name || "Unknown" : r;
438
+ a && Qr(o, p), b && re(o, p);
439
439
  }
440
440
  return ee(r, a, b, u, t, Tr.current, o);
441
441
  }
@@ -562,9 +562,9 @@ Check the top-level render call using <` + n + ">.");
562
562
  var d;
563
563
  r === null ? d = "null" : rr(r) ? d = "array" : r !== void 0 && r.$$typeof === j ? (d = "<" + (C(r.type) || "Unknown") + " />", a = " Did you accidentally export a JSX literal instead of a component?") : d = typeof r, 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);
564
564
  }
565
- var v = ne(r, e, n, u, l);
566
- if (v == null)
567
- return v;
565
+ var p = ne(r, e, n, u, l);
566
+ if (p == null)
567
+ return p;
568
568
  if (o) {
569
569
  var R = e.children;
570
570
  if (R !== void 0)
@@ -592,7 +592,7 @@ React keys must be passed directly to JSX without using spread:
592
592
  <%s key={someKey} {...props} />`, ar, F, ce, F), jr[F + ar] = !0;
593
593
  }
594
594
  }
595
- return r === x ? ie(v) : oe(v), v;
595
+ return r === x ? ie(p) : oe(p), p;
596
596
  }
597
597
  }
598
598
  function ue(r, e, n) {
@@ -639,7 +639,7 @@ const $r = 50, be = 5, ge = ["#3a86ff", "#8338ec", "#ff006e", "#fb5607", "#ffbe0
639
639
  };
640
640
  return f.push(c), c;
641
641
  }
642
- const p = z(() => {
642
+ const v = z(() => {
643
643
  var i = [];
644
644
  const c = /* @__PURE__ */ new Map();
645
645
  return P.forEach((h, E) => {
@@ -675,12 +675,12 @@ const $r = 50, be = 5, ge = ["#3a86ff", "#8338ec", "#ff006e", "#fb5607", "#ffbe0
675
675
  function O(i, c) {
676
676
  return `M ${i.cx} ${i.cy} L ${c.cx} ${c.cy}`;
677
677
  }
678
- const m = z(() => Math.max(...p.map((i) => i.lane), 0), [p]), I = z(() => m * _ + 100, [m, _]);
679
- return /* @__PURE__ */ or.jsxs("svg", { width: I, height: T * p.length, children: [
680
- p.flatMap(
678
+ const m = z(() => Math.max(...v.map((i) => i.lane), 0), [v]), I = z(() => m * _ + 100, [m, _]);
679
+ return /* @__PURE__ */ or.jsxs("svg", { width: I, height: T * v.length, children: [
680
+ v.flatMap(
681
681
  (i) => i.prev.map((c, h) => {
682
682
  if (D)
683
- return D(i, c, h);
683
+ return D(i, c, v, h);
684
684
  const E = O(i, c);
685
685
  return /* @__PURE__ */ or.jsx(
686
686
  "path",
@@ -694,7 +694,7 @@ const $r = 50, be = 5, ge = ["#3a86ff", "#8338ec", "#ff006e", "#fb5607", "#ffbe0
694
694
  );
695
695
  })
696
696
  ),
697
- p.map((i, c) => k ? k(i, c) : /* @__PURE__ */ or.jsx(
697
+ v.map((i, c) => k ? k(i, c) : /* @__PURE__ */ or.jsx(
698
698
  "circle",
699
699
  {
700
700
  cx: i.cx,
@@ -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 p,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(p in f)w.call(f,p)&&!F.hasOwnProperty(p)&&(m[p]=f[p]);if(T&&T.defaultProps)for(p in f=T.defaultProps,f)m[p]===void 0&&(m[p]=f[p]);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"),p=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===p||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 p: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`
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
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
3
  `),b=t.stack.split(`
4
- `),d=a.length-1,v=b.length-1;d>=1&&v>=0&&a[d]!==b[v];)v--;for(;d>=1&&v>=0;d--,v--)if(a[d]!==b[v]){if(d!==1||v!==1)do if(d--,v--,v<0||a[d]!==b[v]){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&&v>=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 p: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 v=typeof e=="function"?e.displayName||e.name||"Unknown":e;a&&or(o,v),b&&ir(o,v)}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`
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`
6
6
 
7
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=`
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 v=sr(e,r,n,u,l);if(v==null)return v;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 <`+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:
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(v):cr(v),v}}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 p=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(...p.map(i=>i.lane),0),[p]),Y=O.useMemo(()=>S*E+100,[S,E]);return Z.jsxs("svg",{width:Y,height:T*p.length,children:[p.flatMap(i=>i.prev.map((c,h)=>{if(F)return F(i,c,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}`)})),p.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} />`,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"})}));
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.7",
4
+ "version": "1.0.8",
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",