git-truck 1.2.0 → 1.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,27 +1,24 @@
1
- # Git Truck 🚛
1
+ # Git Truck 🚛 ·
2
+ [![GitHub license](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/git-truck/git-truck/blob/main/LICENSE)
3
+ [![Git Truck on NPM](https://img.shields.io/npm/v/git-truck)](https://www.npmjs.com/git-truck)
2
4
 
3
- Git-Truck provides you with a truckload of visualizations for your git repository, and find out if your project has a good [truck factor](https://www.agileadvice.com/2005/05/15/agilemanagement/truck-factor/):
5
+ ![Demo](demo.gif)
4
6
 
7
+ Git-Truck provides you with a truckload of visualizations for your git repository, and helps you find out if your project has a good [truck factor](https://www.agileadvice.com/2005/05/15/agilemanagement/truck-factor/):
5
8
 
6
- ### 1. The files in your system where you have a single contributor (i.e., truck-factor = 1)
9
+ | | |
10
+ |-|-|
11
+ | The files in your system where you have a single contributor (i.e., truck-factor = 1) | <img width="1912" alt="image" src="https://user-images.githubusercontent.com/464519/167393939-8d683732-4583-44fe-99a3-36c818761bcb.png"> |
12
+ | You can see how the various developers contribute to your codebase | <img width="1913" alt="image" src="https://user-images.githubusercontent.com/464519/167394548-ca66665a-a699-44d7-8a97-bc7309c72f8a.png"> |
13
+ | You can determine which parts of the system that are most often changed | <img width="1912" alt="image" src="https://user-images.githubusercontent.com/464519/167395118-6a4f50f4-5f37-4e0d-bcc8-144797b83e65.png"> |
7
14
 
8
- <img width="1912" alt="image" src="https://user-images.githubusercontent.com/464519/167393939-8d683732-4583-44fe-99a3-36c818761bcb.png">
9
15
 
16
+ ### What makes Git Truck different?
10
17
 
11
- ### 2. How the various developers contribute to your codebase
12
-
13
- <img width="1913" alt="image" src="https://user-images.githubusercontent.com/464519/167394548-ca66665a-a699-44d7-8a97-bc7309c72f8a.png">
14
-
15
-
16
-
17
- ### 3. The parts of the system that are most often changed
18
-
19
- <img width="1912" alt="image" src="https://user-images.githubusercontent.com/464519/167395118-6a4f50f4-5f37-4e0d-bcc8-144797b83e65.png">
20
-
21
-
22
- ### 4. You can also merge multiple developer accounts
23
-
24
- <img width="1907" alt="image" src="https://user-images.githubusercontent.com/464519/167394405-67bd5b5d-be50-444e-8a1f-68af083a6cba.png">
18
+ - Private by design
19
+ - Works offline
20
+ - Git provider agnostic - Works with any Git repository
21
+ - No tracking, no ads, no data mining, no analytics, no cloud, no servers
25
22
 
26
23
 
27
24
  ## [Prerequisites](#prerequisites)
package/build/index.js CHANGED
@@ -179707,7 +179707,7 @@ var Box = import_styled_components2.default.div`
179707
179707
  line-height: 100%;
179708
179708
  margin: 0px;
179709
179709
  `, LegendDot = import_styled_components2.default.div`
179710
- height: 100%;
179710
+ height: 1em;
179711
179711
  aspect-ratio: 1;
179712
179712
  width: 1em;
179713
179713
  border-radius: 50%;
@@ -179718,6 +179718,9 @@ var Box = import_styled_components2.default.div`
179718
179718
  margin: 0px;
179719
179719
  font-weight: bold;
179720
179720
  cursor: default;
179721
+ overflow: hidden;
179722
+ white-space: pre;
179723
+ text-overflow: ellipsis;
179721
179724
  `, LegendGradient = import_styled_components2.default.div`
179722
179725
  background-image: linear-gradient(to right, ${(props) => `${props.min},${props.max}`});
179723
179726
  width: 100%;
@@ -179727,10 +179730,11 @@ var Box = import_styled_components2.default.div`
179727
179730
  display: flex;
179728
179731
  flex-direction: row;
179729
179732
  justify-content: space-between;
179730
- `, DetailsKey = import_styled_components2.default.span`
179733
+ `, DetailsKey = import_styled_components2.default.div`
179734
+ display: flex;
179735
+ align-items: center;
179731
179736
  font-size: 0.9em;
179732
179737
  font-weight: 500;
179733
- opacity: 0.7;
179734
179738
  white-space: pre;
179735
179739
  overflow: hidden;
179736
179740
  text-overflow: ellipsis;
@@ -179968,7 +179972,7 @@ var import_perf_hooks = require("perf_hooks"), import_path2 = require("path");
179968
179972
  // package.json
179969
179973
  var package_default = {
179970
179974
  name: "git-truck",
179971
- version: "1.2.0",
179975
+ version: "1.2.2",
179972
179976
  private: !1,
179973
179977
  description: "Visualizing a Git repository",
179974
179978
  license: "MIT",
@@ -184413,149 +184417,22 @@ async function getTruckConfigWithArgs(repo) {
184413
184417
  }
184414
184418
 
184415
184419
  // src/components/Details.tsx
184416
- var import_react10 = __toESM(require_react()), import_react11 = __toESM(require_dist()), import_styled_components6 = __toESM(require_styled_components_cjs());
184420
+ var import_react11 = __toESM(require_react()), import_react12 = __toESM(require_dist()), import_styled_components6 = __toESM(require_styled_components_cjs());
184417
184421
 
184418
184422
  // src/components/AuthorDistFragment.tsx
184419
- var import_react4 = __toESM(require_react());
184420
- var import_jsx_runtime = __toESM(require_jsx_runtime());
184421
- function AuthorDistFragment(props) {
184422
- return props.show ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_jsx_runtime.Fragment, {
184423
- children: props.items.map((legendItem) => {
184424
- let [author, contrib] = legendItem, roundedContrib = Math.round(contrib * 100);
184425
- return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_react4.Fragment, {
184426
- children: [
184427
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(DetailsKey, {
184428
- title: author,
184429
- grow: !0,
184430
- children: author
184431
- }),
184432
- /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(DetailsValue, {
184433
- children: [
184434
- roundedContrib === 0 ? "<1" : roundedContrib,
184435
- "%"
184436
- ]
184437
- })
184438
- ]
184439
- }, author + contrib);
184440
- })
184441
- }) : null;
184442
- }
184443
-
184444
- // src/components/AuthorDistOther.tsx
184445
- var import_styled_components3 = __toESM(require_styled_components_cjs()), import_jsx_runtime = __toESM(require_jsx_runtime()), OtherText = import_styled_components3.default.span`
184446
- white-space: pre;
184447
- font-size: 0.7em;
184448
- font-weight: 500;
184449
- opacity: 0.7;
184450
- &:hover {
184451
- cursor: pointer;
184452
- }
184453
- `;
184454
- function AuthorDistOther(props) {
184455
- return props.show ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(OtherText, {
184456
- onClick: props.toggle,
184457
- children: [
184458
- "+ ",
184459
- props.items.length,
184460
- " more"
184461
- ]
184462
- }) : null;
184463
- }
184464
-
184465
- // src/components/Spacer.tsx
184466
- var import_jsx_runtime = __toESM(require_jsx_runtime());
184467
- var Spacer = (props) => {
184468
- let sizeProp = `calc(${props.size ?? props.xs ? 0.5 /* xs */ : props.sm ? 0.75 /* sm */ : props.md ? 1 /* md */ : props.lg ? 1.5 /* lg */ : props.xl ? 2 /* xl */ : props.xxl ? 3 /* xxl */ : 1 /* md */} * var(--unit))`, styles = {
184469
- height: props.horizontal ? "1px" : sizeProp,
184470
- width: props.horizontal ? sizeProp : "1px",
184471
- ...props.horizontal ? {
184472
- display: "inline-block"
184473
- } : {}
184474
- };
184475
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
184476
- "aria-hidden": !0,
184477
- style: styles
184478
- });
184479
- };
184480
- Spacer.defaultProps = {
184481
- size: null,
184482
- sm: !1,
184483
- md: !1,
184484
- lg: !1,
184485
- xl: !1,
184486
- horizontal: !1
184487
- };
184488
-
184489
- // src/components/Toggle.tsx
184490
- var import_styled_components4 = __toESM(require_styled_components_cjs()), import_material2 = __toESM(require_material()), import_jsx_runtime = __toESM(require_jsx_runtime());
184491
- function ExpandDown({ relative = !1, collapse, toggle }) {
184492
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ToggleButton, {
184493
- relative,
184494
- collapse,
184495
- onClick: toggle,
184496
- up: !1,
184497
- children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_material2.ExpandLess, {
184498
- display: "inline-block",
184499
- height: "1.5rem"
184500
- })
184501
- });
184502
- }
184503
- function ExpandUp({ relative = !1, collapse, toggle }) {
184504
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ToggleButton, {
184505
- relative,
184506
- collapse,
184507
- onClick: toggle,
184508
- up: !0,
184509
- children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_material2.ExpandLess, {
184510
- display: "inline-block",
184511
- height: "1.5rem"
184512
- })
184513
- });
184514
- }
184515
- var ToggleButton = import_styled_components4.default.button`
184516
- ${({ relative, up }) => relative ? "" : import_styled_components4.css`
184517
- position: absolute;
184518
- right: var(--unit);
184519
- ${up ? import_styled_components4.css`
184520
- bottom: var(--unit);
184521
- ` : import_styled_components4.css`
184522
- top: var(--unit);
184523
- `}
184524
- `}
184525
-
184526
- border: none;
184527
- background-color: rgba(0, 0, 0, 0);
184528
- transition-duration: 0.4s;
184529
- color: grey;
184530
- transform-origin: 50% 55%;
184531
- transform: ${(props) => props.collapse !== props.up ? "rotate(180deg)" : "none"};
184532
- font-size: large;
184533
- &:hover {
184534
- color: #606060;
184535
- cursor: pointer;
184536
- }
184537
- `;
184538
-
184539
- // src/contexts/ClickedContext.ts
184540
- var import_react5 = __toESM(require_react()), ClickedObjectContext = (0, import_react5.createContext)(null);
184541
- function useClickedObject() {
184542
- let context = (0, import_react5.useContext)(ClickedObjectContext);
184543
- if (!context)
184544
- throw new Error("useClickedObject must be used within a ClickedObjectProvider");
184545
- return context;
184546
- }
184423
+ var import_react7 = __toESM(require_react());
184547
184424
 
184548
- // src/contexts/DataContext.ts
184549
- var import_react6 = __toESM(require_react()), DataContext = (0, import_react6.createContext)(void 0);
184550
- function useData() {
184551
- let context = (0, import_react6.useContext)(DataContext);
184425
+ // src/contexts/MetricContext.ts
184426
+ var import_react4 = __toESM(require_react()), MetricsContext = (0, import_react4.createContext)(void 0);
184427
+ function useMetrics() {
184428
+ let context = (0, import_react4.useContext)(MetricsContext);
184552
184429
  if (!context)
184553
- throw new Error("useData must be used within a DataContext");
184430
+ throw new Error("useMetrics must be used within a MetricsContext");
184554
184431
  return context;
184555
184432
  }
184556
184433
 
184557
184434
  // src/contexts/OptionsContext.ts
184558
- var import_react8 = __toESM(require_react());
184435
+ var import_react6 = __toESM(require_react());
184559
184436
 
184560
184437
  // src/metrics/metrics.ts
184561
184438
  var import_distinct_colors = __toESM(require_lib6());
@@ -186922,8 +186799,84 @@ var SpectrumTranslater = class {
186922
186799
  };
186923
186800
 
186924
186801
  // src/components/legend/PointLegend.tsx
186925
- var import_react7 = __toESM(require_react());
186926
- var import_styled_components5 = __toESM(require_styled_components_cjs()), import_jsx_runtime = __toESM(require_jsx_runtime()), legendCutoff = 3, PointInfo = class {
186802
+ var import_react5 = __toESM(require_react());
186803
+
186804
+ // src/components/Toggle.tsx
186805
+ var import_styled_components3 = __toESM(require_styled_components_cjs()), import_material2 = __toESM(require_material()), import_jsx_runtime = __toESM(require_jsx_runtime());
186806
+ function ExpandDown({ relative = !1, collapse, toggle }) {
186807
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ToggleButton, {
186808
+ relative,
186809
+ collapse,
186810
+ onClick: toggle,
186811
+ up: !1,
186812
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_material2.ExpandLess, {
186813
+ display: "inline-block",
186814
+ height: "1.5rem"
186815
+ })
186816
+ });
186817
+ }
186818
+ function ExpandUp({ relative = !1, collapse, toggle }) {
186819
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ToggleButton, {
186820
+ relative,
186821
+ collapse,
186822
+ onClick: toggle,
186823
+ up: !0,
186824
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_material2.ExpandLess, {
186825
+ display: "inline-block",
186826
+ height: "1.5rem"
186827
+ })
186828
+ });
186829
+ }
186830
+ var ToggleButton = import_styled_components3.default.button`
186831
+ ${({ relative, up }) => relative ? "" : import_styled_components3.css`
186832
+ position: absolute;
186833
+ right: var(--unit);
186834
+ ${up ? import_styled_components3.css`
186835
+ bottom: var(--unit);
186836
+ ` : import_styled_components3.css`
186837
+ top: var(--unit);
186838
+ `}
186839
+ `}
186840
+
186841
+ border: none;
186842
+ background-color: rgba(0, 0, 0, 0);
186843
+ transition-duration: 0.4s;
186844
+ color: grey;
186845
+ transform-origin: 50% 55%;
186846
+ transform: ${(props) => props.collapse !== props.up ? "rotate(180deg)" : "none"};
186847
+ font-size: large;
186848
+ &:hover {
186849
+ color: #606060;
186850
+ cursor: pointer;
186851
+ }
186852
+ `;
186853
+
186854
+ // src/components/Spacer.tsx
186855
+ var import_jsx_runtime = __toESM(require_jsx_runtime());
186856
+ var Spacer = (props) => {
186857
+ let sizeProp = `calc(${props.size ?? props.xs ? 0.5 /* xs */ : props.sm ? 0.75 /* sm */ : props.md ? 1 /* md */ : props.lg ? 1.5 /* lg */ : props.xl ? 2 /* xl */ : props.xxl ? 3 /* xxl */ : 1 /* md */} * var(--unit))`, styles = {
186858
+ minHeight: props.horizontal ? "1px" : sizeProp,
186859
+ minWidth: props.horizontal ? sizeProp : "1px",
186860
+ ...props.horizontal ? {
186861
+ display: "inline-block"
186862
+ } : {}
186863
+ };
186864
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
186865
+ "aria-hidden": !0,
186866
+ style: styles
186867
+ });
186868
+ };
186869
+ Spacer.defaultProps = {
186870
+ size: null,
186871
+ sm: !1,
186872
+ md: !1,
186873
+ lg: !1,
186874
+ xl: !1,
186875
+ horizontal: !1
186876
+ };
186877
+
186878
+ // src/components/legend/PointLegend.tsx
186879
+ var import_styled_components4 = __toESM(require_styled_components_cjs()), import_jsx_runtime = __toESM(require_jsx_runtime()), legendCutoff = 3, PointInfo = class {
186927
186880
  constructor(color, weight) {
186928
186881
  this.color = color;
186929
186882
  this.weight = weight;
@@ -186933,7 +186886,7 @@ var import_styled_components5 = __toESM(require_styled_components_cjs()), import
186933
186886
  }
186934
186887
  };
186935
186888
  function PointLegend({ metricCache }) {
186936
- let [collapse, setCollapse] = (0, import_react7.useState)(!0), items = Array.from(metricCache.legend).sort(([, info1], [, info2]) => info1.weight < info2.weight ? 1 : info1.weight > info2.weight ? -1 : 0);
186889
+ let [collapse, setCollapse] = (0, import_react5.useState)(!0), items = Array.from(metricCache.legend).sort(([, info1], [, info2]) => info1.weight < info2.weight ? 1 : info1.weight > info2.weight ? -1 : 0);
186937
186890
  return items.length === 0 ? null : items.length <= legendCutoff + 1 ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(PointLegendFragment, {
186938
186891
  show: !0,
186939
186892
  items
@@ -186984,7 +186937,7 @@ function PointLegendFragment(props) {
186984
186937
  })
186985
186938
  }) : null;
186986
186939
  }
186987
- var LegendOtherDiv = import_styled_components5.default.div`
186940
+ var LegendOtherDiv = import_styled_components4.default.div`
186988
186941
  width: fit-content;
186989
186942
  &:hover {
186990
186943
  cursor: pointer;
@@ -187337,9 +187290,9 @@ function setupMetricsCacheRec(tree, metricCalcs, acc) {
187337
187290
  var Chart = {
187338
187291
  BUBBLE_CHART: "Bubble chart",
187339
187292
  TREE_MAP: "Tree map"
187340
- }, OptionsContext = (0, import_react8.createContext)(void 0);
187293
+ }, OptionsContext = (0, import_react6.createContext)(void 0);
187341
187294
  function useOptions() {
187342
- let context = (0, import_react8.useContext)(OptionsContext);
187295
+ let context = (0, import_react6.useContext)(OptionsContext);
187343
187296
  if (!context)
187344
187297
  throw new Error("useSearch must be used within a SearchProvider");
187345
187298
  return context;
@@ -187365,10 +187318,90 @@ function getDefaultOptions() {
187365
187318
  };
187366
187319
  }
187367
187320
 
187321
+ // src/components/AuthorDistFragment.tsx
187322
+ var import_jsx_runtime = __toESM(require_jsx_runtime());
187323
+ function AuthorDistFragment(props) {
187324
+ let [, authorColors] = useMetrics(), { metricType } = useOptions();
187325
+ return props.show ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_jsx_runtime.Fragment, {
187326
+ children: props.items.map((legendItem) => {
187327
+ let [author, contrib] = legendItem, roundedContrib = Math.round(contrib * 100);
187328
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_react7.Fragment, {
187329
+ children: [
187330
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(DetailsKey, {
187331
+ title: author,
187332
+ grow: !0,
187333
+ children: [
187334
+ metricType == "TOP_CONTRIBUTOR" ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, {
187335
+ children: [
187336
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(LegendDot, {
187337
+ dotColor: authorColors.get(author) ?? "white"
187338
+ }),
187339
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Spacer, {
187340
+ horizontal: !0
187341
+ })
187342
+ ]
187343
+ }) : null,
187344
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(LegendLabel, {
187345
+ style: { opacity: 0.7 },
187346
+ children: author
187347
+ })
187348
+ ]
187349
+ }),
187350
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(DetailsValue, {
187351
+ children: [
187352
+ roundedContrib === 0 ? "<1" : roundedContrib,
187353
+ "%"
187354
+ ]
187355
+ })
187356
+ ]
187357
+ }, author + contrib);
187358
+ })
187359
+ }) : null;
187360
+ }
187361
+
187362
+ // src/components/AuthorDistOther.tsx
187363
+ var import_styled_components5 = __toESM(require_styled_components_cjs()), import_jsx_runtime = __toESM(require_jsx_runtime()), OtherText = import_styled_components5.default.span`
187364
+ white-space: pre;
187365
+ font-size: 0.7em;
187366
+ font-weight: 500;
187367
+ opacity: 0.7;
187368
+ &:hover {
187369
+ cursor: pointer;
187370
+ }
187371
+ `;
187372
+ function AuthorDistOther(props) {
187373
+ return props.show ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(OtherText, {
187374
+ onClick: props.toggle,
187375
+ children: [
187376
+ "+ ",
187377
+ props.items.length,
187378
+ " more"
187379
+ ]
187380
+ }) : null;
187381
+ }
187382
+
187383
+ // src/contexts/ClickedContext.ts
187384
+ var import_react8 = __toESM(require_react()), ClickedObjectContext = (0, import_react8.createContext)(null);
187385
+ function useClickedObject() {
187386
+ let context = (0, import_react8.useContext)(ClickedObjectContext);
187387
+ if (!context)
187388
+ throw new Error("useClickedObject must be used within a ClickedObjectProvider");
187389
+ return context;
187390
+ }
187391
+
187392
+ // src/contexts/DataContext.ts
187393
+ var import_react9 = __toESM(require_react()), DataContext = (0, import_react9.createContext)(void 0);
187394
+ function useData() {
187395
+ let context = (0, import_react9.useContext)(DataContext);
187396
+ if (!context)
187397
+ throw new Error("useData must be used within a DataContext");
187398
+ return context;
187399
+ }
187400
+
187368
187401
  // src/contexts/PathContext.ts
187369
- var import_react9 = __toESM(require_react()), PathContext = (0, import_react9.createContext)(void 0);
187402
+ var import_react10 = __toESM(require_react()), PathContext = (0, import_react10.createContext)(void 0);
187370
187403
  function usePath() {
187371
- let context = (0, import_react9.useContext)(PathContext);
187404
+ let context = (0, import_react10.useContext)(PathContext);
187372
187405
  if (!context)
187373
187406
  throw new Error("useSearch must be used within a PathProvider");
187374
187407
  return context;
@@ -187465,10 +187498,10 @@ function OneFolderOut(path) {
187465
187498
  }
187466
187499
  function Details(props) {
187467
187500
  var _a;
187468
- let { setClickedObject, clickedObject } = useClickedObject(), location = (0, import_react11.useLocation)(), { authorshipType } = useOptions(), { state } = (0, import_react11.useTransition)(), { setPath, path } = usePath(), { analyzerData } = useData(), isProcessingHideRef = (0, import_react10.useRef)(!1);
187469
- if ((0, import_react10.useEffect)(() => {
187501
+ let { setClickedObject, clickedObject } = useClickedObject(), location = (0, import_react12.useLocation)(), { authorshipType } = useOptions(), { state } = (0, import_react12.useTransition)(), { setPath, path } = usePath(), { analyzerData } = useData(), isProcessingHideRef = (0, import_react11.useRef)(!1);
187502
+ if ((0, import_react11.useEffect)(() => {
187470
187503
  isProcessingHideRef.current && (setClickedObject(null), isProcessingHideRef.current = !1);
187471
- }, [clickedObject, setClickedObject, state]), (0, import_react10.useEffect)(() => {
187504
+ }, [clickedObject, setClickedObject, state]), (0, import_react11.useEffect)(() => {
187472
187505
  setClickedObject((clickedObject2) => findObjectInTree(analyzerData.commit.tree, clickedObject2));
187473
187506
  }, [analyzerData, setClickedObject]), !clickedObject)
187474
187507
  return null;
@@ -187530,7 +187563,7 @@ function Details(props) {
187530
187563
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Spacer, {}),
187531
187564
  isBlob2 ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, {
187532
187565
  children: [
187533
- /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_react11.Form, {
187566
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_react12.Form, {
187534
187567
  method: "post",
187535
187568
  action: location.pathname,
187536
187569
  children: [
@@ -187558,7 +187591,7 @@ function Details(props) {
187558
187591
  clickedObject.name.includes(".") ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, {
187559
187592
  children: [
187560
187593
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Spacer, {}),
187561
- /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_react11.Form, {
187594
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_react12.Form, {
187562
187595
  method: "post",
187563
187596
  action: location.pathname,
187564
187597
  children: [
@@ -187592,7 +187625,7 @@ function Details(props) {
187592
187625
  ]
187593
187626
  }) : null,
187594
187627
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Spacer, {}),
187595
- /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_react11.Form, {
187628
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_react12.Form, {
187596
187629
  method: "post",
187597
187630
  action: location.pathname,
187598
187631
  children: [
@@ -187614,7 +187647,7 @@ function Details(props) {
187614
187647
  ]
187615
187648
  })
187616
187649
  ]
187617
- }) : /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_react11.Form, {
187650
+ }) : /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_react12.Form, {
187618
187651
  method: "post",
187619
187652
  action: location.pathname,
187620
187653
  children: [
@@ -187756,7 +187789,7 @@ var AuthorDistHeader = import_styled_components6.default.div`
187756
187789
  justify-content: space-between;
187757
187790
  `, authorCutoff = 2;
187758
187791
  function AuthorDistribution(props) {
187759
- let [collapse, setCollapse] = (0, import_react10.useState)(!0), contribDist = Object.entries(makePercentResponsibilityDistribution(props.authors)).sort(
187792
+ let [collapse, setCollapse] = (0, import_react11.useState)(!0), contribDist = Object.entries(makePercentResponsibilityDistribution(props.authors)).sort(
187760
187793
  (a, b) => a[1] < b[1] ? 1 : -1
187761
187794
  );
187762
187795
  return contribDist.length <= authorCutoff + 1 ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, {
@@ -187866,8 +187899,8 @@ function calculateAuthorshipForSubTree(tree, authorshipType) {
187866
187899
  }
187867
187900
 
187868
187901
  // src/components/GlobalInfo.tsx
187869
- var import_react12 = __toESM(require_dist());
187870
- var import_styled_components7 = __toESM(require_styled_components_cjs()), import_react13 = __toESM(require_react());
187902
+ var import_react13 = __toESM(require_dist());
187903
+ var import_styled_components7 = __toESM(require_styled_components_cjs()), import_react14 = __toESM(require_react());
187871
187904
 
187872
187905
  // src/components/RevisionSelect.tsx
187873
187906
  var import_GitBranch = __toESM(require_GitBranch()), import_jsx_runtime = __toESM(require_jsx_runtime());
@@ -187913,14 +187946,14 @@ function RevisionSelect({
187913
187946
  // src/components/GlobalInfo.tsx
187914
187947
  var import_material4 = __toESM(require_material()), import_jsx_runtime = __toESM(require_jsx_runtime()), title = "Git Truck", analyzingTitle = "Analyzing | Git Truck";
187915
187948
  function GlobalInfo() {
187916
- let { analyzerData, repo } = useData(), transitionState = (0, import_react12.useTransition)(), location = (0, import_react12.useLocation)(), navigate = (0, import_react12.useNavigate)(), [isAnalyzing, setIsAnalyzing] = (0, import_react13.useState)(!1);
187917
- (0, import_react13.useEffect)(() => {
187949
+ let { analyzerData, repo } = useData(), transitionState = (0, import_react13.useTransition)(), location = (0, import_react13.useLocation)(), navigate = (0, import_react13.useNavigate)(), [isAnalyzing, setIsAnalyzing] = (0, import_react14.useState)(!1);
187950
+ (0, import_react14.useEffect)(() => {
187918
187951
  document.title = isAnalyzing ? analyzingTitle : title;
187919
187952
  }, [isAnalyzing]);
187920
187953
  let switchBranch = (branch) => {
187921
187954
  setIsAnalyzing(!0), navigate(["", repo.name, branch].join("/"));
187922
187955
  };
187923
- return (0, import_react13.useEffect)(() => {
187956
+ return (0, import_react14.useEffect)(() => {
187924
187957
  transitionState.state === "idle" && setIsAnalyzing(!1);
187925
187958
  }, [transitionState.state]), /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Box, {
187926
187959
  children: [
@@ -187976,7 +188009,7 @@ function GlobalInfo() {
187976
188009
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Spacer, {
187977
188010
  xl: !0
187978
188011
  }),
187979
- /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_react12.Form, {
188012
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_react13.Form, {
187980
188013
  method: "post",
187981
188014
  action: location.pathname,
187982
188015
  onSubmit: () => {
@@ -188005,7 +188038,7 @@ function GlobalInfo() {
188005
188038
  }
188006
188039
  var StyledP = import_styled_components7.default.p`
188007
188040
  margin-left: var(--unit);
188008
- `, StyledLink = (0, import_styled_components7.default)(import_react12.Link)`
188041
+ `, StyledLink = (0, import_styled_components7.default)(import_react13.Link)`
188009
188042
  display: inline-flex;
188010
188043
  margin-right: var(--unit);
188011
188044
  text-decoration: none;
@@ -188019,13 +188052,13 @@ var StyledP = import_styled_components7.default.p`
188019
188052
 
188020
188053
  // src/components/HiddenFiles.tsx
188021
188054
  var import_react_use = __toESM(require_lib4()), import_styled_components8 = __toESM(require_styled_components_cjs());
188022
- var import_react14 = __toESM(require_dist()), import_material5 = __toESM(require_material()), import_jsx_runtime = __toESM(require_jsx_runtime()), Line = import_styled_components8.default.div`
188055
+ var import_react15 = __toESM(require_dist()), import_material5 = __toESM(require_material()), import_jsx_runtime = __toESM(require_jsx_runtime()), Line = import_styled_components8.default.div`
188023
188056
  display: grid;
188024
188057
  grid-template-columns: auto 1fr;
188025
188058
  gap: var(--unit);
188026
188059
  margin-top: calc(var(--unit) * 0.5);
188027
188060
  align-items: center;
188028
- `, InlineForm = (0, import_styled_components8.default)(import_react14.Form)`
188061
+ `, InlineForm = (0, import_styled_components8.default)(import_react15.Form)`
188029
188062
  width: calc(2 * var(--unit));
188030
188063
  `, StyledIconButton = (0, import_styled_components8.default)(IconButton)`
188031
188064
  & > #eye {
@@ -188048,7 +188081,7 @@ function hiddenFileFormat(ignored) {
188048
188081
  return split[split.length - 1];
188049
188082
  }
188050
188083
  function HiddenFiles() {
188051
- let location = (0, import_react14.useLocation)(), [collapse, setCollapse] = (0, import_react_use.useBoolean)(!1), transitionState = (0, import_react14.useTransition)(), { analyzerData } = useData();
188084
+ let location = (0, import_react15.useLocation)(), [collapse, setCollapse] = (0, import_react_use.useBoolean)(!1), transitionState = (0, import_react15.useTransition)(), { analyzerData } = useData();
188052
188085
  return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Box, {
188053
188086
  children: [
188054
188087
  /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(BoxSubTitle, {
@@ -188106,17 +188139,6 @@ function HiddenFiles() {
188106
188139
 
188107
188140
  // src/components/legend/Legend.tsx
188108
188141
  var import_styled_components11 = __toESM(require_styled_components_cjs());
188109
-
188110
- // src/contexts/MetricContext.ts
188111
- var import_react15 = __toESM(require_react()), MetricsContext = (0, import_react15.createContext)(void 0);
188112
- function useMetrics() {
188113
- let context = (0, import_react15.useContext)(MetricsContext);
188114
- if (!context)
188115
- throw new Error("useMetrics must be used within a MetricsContext");
188116
- return context;
188117
- }
188118
-
188119
- // src/components/legend/Legend.tsx
188120
188142
  var import_material6 = __toESM(require_material());
188121
188143
 
188122
188144
  // src/components/legend/SegmentLegend.tsx
@@ -190219,7 +190241,7 @@ var Wrapper = import_styled_components22.default.div`
190219
190241
  `;
190220
190242
 
190221
190243
  // server-assets-manifest:@remix-run/dev/assets-manifest
190222
- var assets_manifest_default = { version: "c3317511", entry: { module: "/build/entry.client-YPWZXPQ4.js", imports: ["/build/_shared/chunk-XMAWJ27N.js", "/build/_shared/chunk-2BPXJFRU.js"] }, routes: { root: { id: "root", parentId: void 0, path: "", index: void 0, caseSensitive: void 0, module: "/build/root-JP3CV4WY.js", imports: ["/build/_shared/chunk-2EHCKJST.js", "/build/_shared/chunk-7N2WUEGE.js"], hasAction: !1, hasLoader: !1, hasCatchBoundary: !0, hasErrorBoundary: !0 }, "routes/$repo.$": { id: "routes/$repo.$", parentId: "root", path: ":repo/*", index: void 0, caseSensitive: void 0, module: "/build/routes/$repo.$-QBHUPVJP.js", imports: ["/build/_shared/chunk-YLJSRSGG.js"], hasAction: !0, hasLoader: !0, hasCatchBoundary: !1, hasErrorBoundary: !0 }, "routes/index": { id: "routes/index", parentId: "root", path: void 0, index: !0, caseSensitive: void 0, module: "/build/routes/index-UFMJKIDU.js", imports: ["/build/_shared/chunk-YLJSRSGG.js"], hasAction: !1, hasLoader: !0, hasCatchBoundary: !1, hasErrorBoundary: !1 } }, url: "/build/manifest-C3317511.js" };
190244
+ var assets_manifest_default = { version: "170b0f78", entry: { module: "/build/entry.client-YPWZXPQ4.js", imports: ["/build/_shared/chunk-XMAWJ27N.js", "/build/_shared/chunk-2BPXJFRU.js"] }, routes: { root: { id: "root", parentId: void 0, path: "", index: void 0, caseSensitive: void 0, module: "/build/root-4FO5NL4Q.js", imports: ["/build/_shared/chunk-2EHCKJST.js", "/build/_shared/chunk-Y7QOL3BF.js"], hasAction: !1, hasLoader: !1, hasCatchBoundary: !0, hasErrorBoundary: !0 }, "routes/$repo.$": { id: "routes/$repo.$", parentId: "root", path: ":repo/*", index: void 0, caseSensitive: void 0, module: "/build/routes/$repo.$-5L6E3AFW.js", imports: ["/build/_shared/chunk-CWCEXXYS.js"], hasAction: !0, hasLoader: !0, hasCatchBoundary: !1, hasErrorBoundary: !0 }, "routes/index": { id: "routes/index", parentId: "root", path: void 0, index: !0, caseSensitive: void 0, module: "/build/routes/index-YLUZZH4I.js", imports: ["/build/_shared/chunk-CWCEXXYS.js"], hasAction: !1, hasLoader: !0, hasCatchBoundary: !1, hasErrorBoundary: !1 } }, url: "/build/manifest-170B0F78.js" };
190223
190245
 
190224
190246
  // server-entry-module:@remix-run/dev/server-build
190225
190247
  var assetsBuildDirectory = "public/build", publicPath = "/build/", entry = { module: entry_server_exports }, routes = {
package/cli.js CHANGED
@@ -213723,7 +213723,7 @@ var import_path5 = __toESM(require("path"));
213723
213723
  // package.json
213724
213724
  var package_default = {
213725
213725
  name: "git-truck",
213726
- version: "1.2.0",
213726
+ version: "1.2.2",
213727
213727
  private: false,
213728
213728
  description: "Visualizing a Git repository",
213729
213729
  license: "MIT",
@@ -218838,7 +218838,7 @@ var LegendEntry = import_styled_components.default.div`
218838
218838
  margin: 0px;
218839
218839
  `;
218840
218840
  var LegendDot = import_styled_components.default.div`
218841
- height: 100%;
218841
+ height: 1em;
218842
218842
  aspect-ratio: 1;
218843
218843
  width: 1em;
218844
218844
  border-radius: 50%;
@@ -218850,6 +218850,9 @@ var LegendLabel = import_styled_components.default.p`
218850
218850
  margin: 0px;
218851
218851
  font-weight: bold;
218852
218852
  cursor: default;
218853
+ overflow: hidden;
218854
+ white-space: pre;
218855
+ text-overflow: ellipsis;
218853
218856
  `;
218854
218857
  var LegendGradient = import_styled_components.default.div`
218855
218858
  background-image: linear-gradient(to right, ${(props) => `${props.min},${props.max}`});
@@ -218862,10 +218865,11 @@ var GradientLegendDiv = import_styled_components.default.div`
218862
218865
  flex-direction: row;
218863
218866
  justify-content: space-between;
218864
218867
  `;
218865
- var DetailsKey = import_styled_components.default.span`
218868
+ var DetailsKey = import_styled_components.default.div`
218869
+ display: flex;
218870
+ align-items: center;
218866
218871
  font-size: 0.9em;
218867
218872
  font-weight: 500;
218868
- opacity: 0.7;
218869
218873
  white-space: pre;
218870
218874
  overflow: hidden;
218871
218875
  text-overflow: ellipsis;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "git-truck",
3
- "version": "1.2.0",
3
+ "version": "1.2.2",
4
4
  "private": false,
5
5
  "description": "Visualizing a Git repository",
6
6
  "license": "MIT",
@@ -0,0 +1 @@
1
+ import{M as b,N as v,O as y,P as S,d as x}from"/build/_shared/chunk-Y7QOL3BF.js";import{a as M,b as g,c as s,d as E,e as p,f as k,v as d}from"/build/_shared/chunk-2BPXJFRU.js";var B,H=M(()=>{B="ab".substr(-1)==="b"?function(e,t,r){return e.substr(t,r)}:function(e,t,r){return t<0&&(t=e.length+t),e.substr(t,r)}});var L=g((O,z)=>{z.exports={}});var T=g((D,A)=>{A.exports={}});var j=g(($,P)=>{P.exports={}});var W=s(d());var G=e=>{var n;let r=`calc(${((n=e.size)!=null?n:e.xs)?.5:e.sm?.75:e.md?1:e.lg?1.5:e.xl?2:e.xxl?3:1} * var(--unit))`,i={minHeight:e.horizontal?"1px":r,minWidth:e.horizontal?r:"1px",...e.horizontal?{display:"inline-block"}:{}};return(0,W.jsx)("div",{"aria-hidden":!0,style:i})};G.defaultProps={size:null,sm:!1,md:!1,lg:!1,xl:!1,horizontal:!1};function V(e){return e?new Date(e*1e3).toLocaleString("en-gb",{day:"2-digit",month:"short",year:"numeric"}):"Invalid date"}function N(e){return new Date(e).toLocaleString("da-dk",{day:"2-digit",month:"2-digit",year:"2-digit"})}function q(e){return new Date(e).toLocaleString("en-gb",{hour:"2-digit",minute:"2-digit",day:"2-digit",month:"short",year:"2-digit"})}function C(e){let t=Date.now(),r=60*60*1e3,i=24*r,n=t-e*1e3;if(n<0)return"Unknown time ago";if(n>i){let a=Math.floor(n/i);return`${a} day${a>1?"s":""} ago`}let l=Math.floor(n/r);return l>1?`${l} hours ago`:l===1?"1 hour ago":"<1 hour ago"}var U=e=>e[e.length-1],_=e=>e.length<=1?[]:e.slice(0,e.length-1);function J(e){return e.includes("\\")?"\\":"/"}var K=(e,t)=>[e,t].join("/");k();var u=s(E());var h=u.forwardRef(function(e,t){var r={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return u.createElement(x,p({iconAttrs:r,iconVerticalAlign:"middle",iconViewBox:"0 0 16 16"},e,{ref:t}),u.createElement("path",{fillRule:"evenodd",d:"M11.75 2.5a.75.75 0 1 0 0 1.5.75.75 0 0 0 0-1.5zm-2.25.75a2.25 2.25 0 1 1 3 2.122V6A2.5 2.5 0 0 1 10 8.5H6a1 1 0 0 0-1 1v1.128a2.251 2.251 0 1 1-1.5 0V5.372a2.25 2.25 0 1 1 1.5 0v1.836A2.492 2.492 0 0 1 6 7h4a1 1 0 0 0 1-1v-.628A2.25 2.25 0 0 1 9.5 3.25zM4.25 12a.75.75 0 1 0 0 1.5.75.75 0 0 0 0-1.5zM3.5 3.25a.75.75 0 1 1 1.5 0 .75.75 0 0 1-1.5 0z"}))});h.displayName="GitBranch";var o=s(d());function re({headGroups:e,analyzedHeads:t,iconColor:r,disabled:i,...n}){let l=Object.entries(e),a=l.reduce((c,f)=>c.concat(Object.keys(f)),[]);return(0,o.jsxs)(y,{children:[(0,o.jsx)(h,{display:"inline-block",height:"1em",color:r!=null?r:"#333"}),a.length===1?(0,o.jsx)(S,{children:a[0]}):(0,o.jsx)(b,{inline:!0,...n,children:l.map(([c,f])=>Object.entries(f).length>0?(0,o.jsx)("optgroup",{label:c,children:Object.entries(f).map(([m,w])=>{let R=t[w];return(0,o.jsx)(v,{value:m,disabled:i,title:R?"Analyzed":"Not analyzed",children:m},m)})},c):null)})]})}export{H as a,L as b,T as c,j as d,G as e,V as f,N as g,q as h,C as i,U as j,_ as k,J as l,K as m,re as n};