@git-stats-components/vue 1.0.2 → 1.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +40 -23
- package/dist/style.css +1 -1
- package/dist/vue.es.js +317 -297
- package/dist/vue.es.js.map +1 -1
- package/dist/vue.umd.js +1 -1
- package/dist/vue.umd.js.map +1 -1
- package/package.json +71 -71
package/dist/vue.es.js
CHANGED
|
@@ -1,86 +1,86 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
var
|
|
6
|
-
for (var
|
|
7
|
-
|
|
8
|
-
if (
|
|
9
|
-
for (var
|
|
10
|
-
|
|
1
|
+
var ot = Object.defineProperty, nt = Object.defineProperties;
|
|
2
|
+
var rt = Object.getOwnPropertyDescriptors;
|
|
3
|
+
var V = Object.getOwnPropertySymbols;
|
|
4
|
+
var it = Object.prototype.hasOwnProperty, lt = Object.prototype.propertyIsEnumerable;
|
|
5
|
+
var R = (e, t, s) => t in e ? ot(e, t, { enumerable: !0, configurable: !0, writable: !0, value: s }) : e[t] = s, Y = (e, t) => {
|
|
6
|
+
for (var s in t || (t = {}))
|
|
7
|
+
it.call(t, s) && R(e, s, t[s]);
|
|
8
|
+
if (V)
|
|
9
|
+
for (var s of V(t))
|
|
10
|
+
lt.call(t, s) && R(e, s, t[s]);
|
|
11
11
|
return e;
|
|
12
|
-
},
|
|
13
|
-
var
|
|
14
|
-
var
|
|
12
|
+
}, W = (e, t) => nt(e, rt(t));
|
|
13
|
+
var O = (e, t, s) => new Promise((i, l) => {
|
|
14
|
+
var m = (d) => {
|
|
15
15
|
try {
|
|
16
|
-
|
|
17
|
-
} catch (
|
|
18
|
-
l(
|
|
16
|
+
n(s.next(d));
|
|
17
|
+
} catch (p) {
|
|
18
|
+
l(p);
|
|
19
19
|
}
|
|
20
|
-
},
|
|
20
|
+
}, u = (d) => {
|
|
21
21
|
try {
|
|
22
|
-
|
|
23
|
-
} catch (
|
|
24
|
-
l(
|
|
22
|
+
n(s.throw(d));
|
|
23
|
+
} catch (p) {
|
|
24
|
+
l(p);
|
|
25
25
|
}
|
|
26
|
-
},
|
|
27
|
-
|
|
26
|
+
}, n = (d) => d.done ? i(d.value) : Promise.resolve(d.value).then(m, u);
|
|
27
|
+
n((s = s.apply(e, t)).next());
|
|
28
28
|
});
|
|
29
|
-
import { ref as S, computed as
|
|
30
|
-
function
|
|
31
|
-
return
|
|
29
|
+
import { ref as S, computed as E, defineComponent as J, watch as q, createElementBlock as y, openBlock as h, createElementVNode as a, createCommentVNode as U, toDisplayString as D, normalizeClass as T, unref as k, renderSlot as L, createTextVNode as C, Fragment as A, renderList as B, normalizeStyle as ct, createStaticVNode as ut } from "vue";
|
|
30
|
+
function me(e) {
|
|
31
|
+
return O(this, null, function* () {
|
|
32
32
|
const t = yield fetch(e);
|
|
33
33
|
if (!t.ok)
|
|
34
34
|
throw new Error(`Failed to fetch git stats: ${t.statusText}`);
|
|
35
35
|
return t.json();
|
|
36
36
|
});
|
|
37
37
|
}
|
|
38
|
-
function
|
|
39
|
-
const e = [], t = /* @__PURE__ */ new Date(),
|
|
40
|
-
|
|
41
|
-
const i = new Date(
|
|
38
|
+
function dt() {
|
|
39
|
+
const e = [], t = /* @__PURE__ */ new Date(), s = new Date(t);
|
|
40
|
+
s.setDate(s.getDate() - s.getDay());
|
|
41
|
+
const i = new Date(s);
|
|
42
42
|
i.setDate(i.getDate() - 52 * 7);
|
|
43
43
|
const l = new Date(i);
|
|
44
|
-
for (let
|
|
45
|
-
const
|
|
44
|
+
for (let m = 0; m < 53; m++) {
|
|
45
|
+
const u = {
|
|
46
46
|
weekStart: new Date(l).toISOString().split("T")[0],
|
|
47
47
|
contributionDays: []
|
|
48
48
|
};
|
|
49
|
-
for (let
|
|
50
|
-
const
|
|
51
|
-
let
|
|
52
|
-
|
|
49
|
+
for (let n = 0; n < 7; n++) {
|
|
50
|
+
const d = l > t, p = n === 0 || n === 6;
|
|
51
|
+
let f = 0;
|
|
52
|
+
d || (p ? f = Math.random() < 0.3 ? Math.floor(Math.random() * 5) : 0 : f = Math.floor(Math.random() * 15)), u.contributionDays.push({
|
|
53
53
|
date: new Date(l).toISOString().split("T")[0],
|
|
54
|
-
contributionCount:
|
|
55
|
-
weekday:
|
|
54
|
+
contributionCount: f,
|
|
55
|
+
weekday: n
|
|
56
56
|
}), l.setDate(l.getDate() + 1);
|
|
57
57
|
}
|
|
58
|
-
e.push(
|
|
58
|
+
e.push(u);
|
|
59
59
|
}
|
|
60
60
|
return e;
|
|
61
61
|
}
|
|
62
|
-
function
|
|
62
|
+
function P(e = {}) {
|
|
63
63
|
const {
|
|
64
64
|
username: t = "demo-user",
|
|
65
|
-
platform:
|
|
65
|
+
platform: s = "github",
|
|
66
66
|
projectCount: i = 30,
|
|
67
67
|
commitCount: l = 2500
|
|
68
|
-
} = e,
|
|
69
|
-
return
|
|
70
|
-
(
|
|
68
|
+
} = e, m = dt();
|
|
69
|
+
return m.reduce((u, n) => u + n.contributionDays.reduce(
|
|
70
|
+
(d, p) => d + p.contributionCount,
|
|
71
71
|
0
|
|
72
72
|
), 0), {
|
|
73
73
|
lastUpdated: (/* @__PURE__ */ new Date()).toISOString(),
|
|
74
74
|
profiles: [
|
|
75
75
|
{
|
|
76
76
|
username: t,
|
|
77
|
-
platform:
|
|
77
|
+
platform: s,
|
|
78
78
|
stats: {
|
|
79
79
|
projectCount: i,
|
|
80
80
|
commitCount: l,
|
|
81
|
-
contributions:
|
|
82
|
-
firstDay:
|
|
83
|
-
contributionDays:
|
|
81
|
+
contributions: m.map((u) => ({
|
|
82
|
+
firstDay: u.weekStart,
|
|
83
|
+
contributionDays: u.contributionDays
|
|
84
84
|
}))
|
|
85
85
|
}
|
|
86
86
|
}
|
|
@@ -96,13 +96,13 @@ function G(e = {}) {
|
|
|
96
96
|
}
|
|
97
97
|
};
|
|
98
98
|
}
|
|
99
|
-
function
|
|
100
|
-
const e =
|
|
99
|
+
function fe() {
|
|
100
|
+
const e = P({
|
|
101
101
|
username: "demo-github",
|
|
102
102
|
platform: "github",
|
|
103
103
|
projectCount: 45,
|
|
104
104
|
commitCount: 2847
|
|
105
|
-
}), t =
|
|
105
|
+
}), t = P({
|
|
106
106
|
username: "demo-gitlab",
|
|
107
107
|
platform: "gitlab",
|
|
108
108
|
projectCount: 7,
|
|
@@ -122,55 +122,55 @@ function ue() {
|
|
|
122
122
|
}
|
|
123
123
|
};
|
|
124
124
|
}
|
|
125
|
-
function
|
|
126
|
-
const t =
|
|
125
|
+
function ve(e = "dummy-git-stats.json") {
|
|
126
|
+
const t = P(), s = JSON.stringify(t, null, " ");
|
|
127
127
|
if (typeof window != "undefined") {
|
|
128
|
-
const i = new Blob([
|
|
129
|
-
|
|
128
|
+
const i = new Blob([s], { type: "application/json" }), l = URL.createObjectURL(i), m = document.createElement("a");
|
|
129
|
+
m.href = l, m.download = e, m.click(), URL.revokeObjectURL(l);
|
|
130
130
|
} else
|
|
131
131
|
try {
|
|
132
|
-
require("fs").writeFileSync(e,
|
|
132
|
+
require("fs").writeFileSync(e, s), console.log(`✓ Dummy data saved to ${e}`);
|
|
133
133
|
} catch (i) {
|
|
134
134
|
console.error("Failed to save dummy data:", i);
|
|
135
135
|
}
|
|
136
136
|
}
|
|
137
|
-
function
|
|
138
|
-
return
|
|
139
|
-
var
|
|
140
|
-
const { dataUrl: t, cacheKey:
|
|
137
|
+
function mt(e) {
|
|
138
|
+
return O(this, null, function* () {
|
|
139
|
+
var m, u;
|
|
140
|
+
const { dataUrl: t, cacheKey: s = "git_stats_cache", useStaleCache: i = !0 } = e;
|
|
141
141
|
try {
|
|
142
|
-
const
|
|
143
|
-
if (
|
|
144
|
-
const
|
|
142
|
+
const n = yield fetch(t);
|
|
143
|
+
if (n.ok) {
|
|
144
|
+
const d = yield n.json();
|
|
145
145
|
return typeof window != "undefined" && localStorage.setItem(
|
|
146
|
-
|
|
147
|
-
JSON.stringify(Y(
|
|
146
|
+
s,
|
|
147
|
+
JSON.stringify(W(Y({}, d), {
|
|
148
148
|
cachedAt: Date.now()
|
|
149
149
|
}))
|
|
150
150
|
), {
|
|
151
|
-
data:
|
|
151
|
+
data: d,
|
|
152
152
|
error: null,
|
|
153
153
|
source: "static",
|
|
154
|
-
isDummy: ((
|
|
154
|
+
isDummy: ((m = d.metadata) == null ? void 0 : m.isDummy) === !0
|
|
155
155
|
};
|
|
156
156
|
}
|
|
157
|
-
} catch (
|
|
158
|
-
console.warn("Failed to fetch from static file:",
|
|
157
|
+
} catch (n) {
|
|
158
|
+
console.warn("Failed to fetch from static file:", n);
|
|
159
159
|
}
|
|
160
160
|
if (i && typeof window != "undefined")
|
|
161
161
|
try {
|
|
162
|
-
const
|
|
163
|
-
if (
|
|
164
|
-
const
|
|
162
|
+
const n = localStorage.getItem(s);
|
|
163
|
+
if (n) {
|
|
164
|
+
const d = JSON.parse(n);
|
|
165
165
|
return {
|
|
166
|
-
data:
|
|
166
|
+
data: d,
|
|
167
167
|
error: null,
|
|
168
168
|
source: "cache",
|
|
169
|
-
isDummy: ((
|
|
169
|
+
isDummy: ((u = d.metadata) == null ? void 0 : u.isDummy) === !0
|
|
170
170
|
};
|
|
171
171
|
}
|
|
172
|
-
} catch (
|
|
173
|
-
console.warn("Failed to load from cache:",
|
|
172
|
+
} catch (n) {
|
|
173
|
+
console.warn("Failed to load from cache:", n);
|
|
174
174
|
}
|
|
175
175
|
return {
|
|
176
176
|
data: yt(),
|
|
@@ -180,28 +180,28 @@ function ft(e) {
|
|
|
180
180
|
};
|
|
181
181
|
});
|
|
182
182
|
}
|
|
183
|
-
function
|
|
184
|
-
const t = new Date(e),
|
|
183
|
+
function ft(e) {
|
|
184
|
+
const t = new Date(e), s = /* @__PURE__ */ new Date(), i = Math.floor((s.getTime() - t.getTime()) / (1e3 * 60 * 60));
|
|
185
185
|
if (i < 1) return "just now";
|
|
186
186
|
if (i < 24) return `${i} hours ago`;
|
|
187
187
|
const l = Math.floor(i / 24);
|
|
188
188
|
return l === 1 ? "yesterday" : l < 7 ? `${l} days ago` : t.toLocaleDateString("en-US", {
|
|
189
189
|
month: "short",
|
|
190
190
|
day: "numeric",
|
|
191
|
-
year: t.getFullYear() !==
|
|
191
|
+
year: t.getFullYear() !== s.getFullYear() ? "numeric" : void 0
|
|
192
192
|
});
|
|
193
193
|
}
|
|
194
|
-
function
|
|
194
|
+
function ye(e) {
|
|
195
195
|
return e === 0 ? 0 : e <= 3 ? 1 : e <= 6 ? 2 : e <= 9 ? 3 : 4;
|
|
196
196
|
}
|
|
197
197
|
function vt(e) {
|
|
198
198
|
if (e.length === 0) return 0;
|
|
199
199
|
const t = {};
|
|
200
|
-
return e.forEach((
|
|
201
|
-
var
|
|
202
|
-
const i =
|
|
203
|
-
(
|
|
204
|
-
t[
|
|
200
|
+
return e.forEach((s) => {
|
|
201
|
+
var u;
|
|
202
|
+
const i = s.endDate ? new Date(s.endDate) : /* @__PURE__ */ new Date(), l = new Date(s.startDate), m = (i.getTime() - l.getTime()) / (1e3 * 60 * 60 * 24 * 365.25);
|
|
203
|
+
(u = s.skills) == null || u.forEach((n) => {
|
|
204
|
+
t[n] || (t[n] = 0), t[n] += m;
|
|
205
205
|
});
|
|
206
206
|
}), Math.max(...Object.values(t), 0);
|
|
207
207
|
}
|
|
@@ -229,38 +229,38 @@ function yt() {
|
|
|
229
229
|
}
|
|
230
230
|
};
|
|
231
231
|
}
|
|
232
|
-
function
|
|
232
|
+
function z(e = {}) {
|
|
233
233
|
const {
|
|
234
234
|
dataUrl: t = "/data/git-stats.json",
|
|
235
|
-
cacheTTL:
|
|
235
|
+
cacheTTL: s = 24 * 60 * 60 * 1e3,
|
|
236
236
|
useStaleCache: i = !0,
|
|
237
237
|
cacheKey: l = "git_stats_cache"
|
|
238
|
-
} = e,
|
|
239
|
-
function
|
|
240
|
-
return
|
|
241
|
-
|
|
238
|
+
} = e, m = S(!1), u = S(null), n = S(null), d = S(null), p = S(!1);
|
|
239
|
+
function f() {
|
|
240
|
+
return O(this, null, function* () {
|
|
241
|
+
m.value = !0, u.value = null;
|
|
242
242
|
try {
|
|
243
|
-
const
|
|
243
|
+
const b = yield mt({
|
|
244
244
|
dataUrl: t,
|
|
245
|
-
cacheTTL:
|
|
245
|
+
cacheTTL: s,
|
|
246
246
|
cacheKey: l,
|
|
247
247
|
useStaleCache: i
|
|
248
248
|
});
|
|
249
|
-
return
|
|
250
|
-
} catch (
|
|
251
|
-
return
|
|
249
|
+
return n.value = b.data, u.value = b.error, d.value = b.source, p.value = b.isDummy, b.data;
|
|
250
|
+
} catch (b) {
|
|
251
|
+
return u.value = b instanceof Error ? b : new Error("Failed to load data"), null;
|
|
252
252
|
} finally {
|
|
253
|
-
|
|
253
|
+
m.value = !1;
|
|
254
254
|
}
|
|
255
255
|
});
|
|
256
256
|
}
|
|
257
|
-
const c =
|
|
258
|
-
var
|
|
259
|
-
return (
|
|
260
|
-
}), _ =
|
|
261
|
-
if (
|
|
257
|
+
const c = E(() => {
|
|
258
|
+
var b;
|
|
259
|
+
return (b = n.value) != null && b.lastUpdated ? ft(n.value.lastUpdated) : "";
|
|
260
|
+
}), _ = E(() => {
|
|
261
|
+
if (p.value)
|
|
262
262
|
return "⚠️ Using dummy data for testing";
|
|
263
|
-
switch (
|
|
263
|
+
switch (d.value) {
|
|
264
264
|
case "static":
|
|
265
265
|
return "Real-time data";
|
|
266
266
|
case "cache":
|
|
@@ -271,15 +271,15 @@ function K(e = {}) {
|
|
|
271
271
|
return "";
|
|
272
272
|
}
|
|
273
273
|
});
|
|
274
|
-
return
|
|
275
|
-
data:
|
|
276
|
-
loading:
|
|
277
|
-
error:
|
|
278
|
-
dataSource:
|
|
274
|
+
return f(), {
|
|
275
|
+
data: n,
|
|
276
|
+
loading: m,
|
|
277
|
+
error: u,
|
|
278
|
+
dataSource: d,
|
|
279
279
|
dataSourceText: _,
|
|
280
280
|
lastUpdatedText: c,
|
|
281
|
-
isDummy:
|
|
282
|
-
loadData:
|
|
281
|
+
isDummy: p,
|
|
282
|
+
loadData: f
|
|
283
283
|
};
|
|
284
284
|
}
|
|
285
285
|
const ht = { class: "git-contribution-graph" }, pt = { class: "graph-header" }, gt = { class: "header-info" }, bt = { class: "contribution-count" }, _t = {
|
|
@@ -297,7 +297,7 @@ const ht = { class: "git-contribution-graph" }, pt = { class: "graph-header" },
|
|
|
297
297
|
}, Ct = { class: "graph-content-wrapper" }, $t = { class: "months-row" }, Tt = { class: "months-container" }, jt = { class: "grid-container" }, Lt = { class: "contribution-grid" }, Ut = ["title", "onClick"], xt = { class: "graph-footer" }, Ft = {
|
|
298
298
|
key: 0,
|
|
299
299
|
class: "last-updated"
|
|
300
|
-
}, It = /* @__PURE__ */
|
|
300
|
+
}, It = { class: "legend" }, Et = { class: "legend-squares" }, Nt = /* @__PURE__ */ J({
|
|
301
301
|
__name: "ContributionGraph",
|
|
302
302
|
props: {
|
|
303
303
|
dataUrl: { default: "/data/git-stats.json" },
|
|
@@ -308,204 +308,224 @@ const ht = { class: "git-contribution-graph" }, pt = { class: "graph-header" },
|
|
|
308
308
|
},
|
|
309
309
|
emits: ["day-click", "color-scheme-change"],
|
|
310
310
|
setup(e, { emit: t }) {
|
|
311
|
-
const
|
|
311
|
+
const s = e, i = t, { data: l, loading: m, dataSourceText: u, lastUpdatedText: n, isDummy: d } = z(
|
|
312
312
|
{
|
|
313
|
-
dataUrl:
|
|
314
|
-
cacheTTL:
|
|
313
|
+
dataUrl: s.dataUrl,
|
|
314
|
+
cacheTTL: s.cacheTTL
|
|
315
315
|
}
|
|
316
|
-
),
|
|
317
|
-
|
|
316
|
+
), p = S(s.colorScheme), f = S(!1), c = ["green", "blue", "purple", "orange"], _ = S([]), b = S([]);
|
|
317
|
+
q(
|
|
318
318
|
l,
|
|
319
|
-
(
|
|
320
|
-
var
|
|
321
|
-
if ((
|
|
322
|
-
const w =
|
|
323
|
-
w && (_.value =
|
|
319
|
+
(o) => {
|
|
320
|
+
var r, v, g;
|
|
321
|
+
if ((g = (v = (r = o == null ? void 0 : o.profiles) == null ? void 0 : r[s.profileIndex]) == null ? void 0 : v.stats) != null && g.contributions) {
|
|
322
|
+
const w = o.profiles[s.profileIndex].stats.contributions;
|
|
323
|
+
w && (_.value = G(w), H());
|
|
324
324
|
} else
|
|
325
325
|
_.value = [];
|
|
326
326
|
},
|
|
327
327
|
{ immediate: !0 }
|
|
328
328
|
);
|
|
329
|
-
const
|
|
330
|
-
function
|
|
331
|
-
if (!
|
|
329
|
+
const j = E(() => !_.value || _.value.length === 0 ? 0 : _.value.reduce((o, r) => !r.days || !Array.isArray(r.days) ? o : o + r.days.reduce((v, g) => v + (g.count || 0), 0), 0));
|
|
330
|
+
function G(o) {
|
|
331
|
+
if (!o || !Array.isArray(o))
|
|
332
332
|
return $();
|
|
333
|
-
const
|
|
333
|
+
const r = o.map((v) => ({
|
|
334
334
|
weekStart: v.firstDay || "",
|
|
335
|
-
days: v.contributionDays.map((
|
|
335
|
+
days: v.contributionDays.map((g) => {
|
|
336
336
|
var w;
|
|
337
337
|
return {
|
|
338
|
-
date:
|
|
339
|
-
count: (w =
|
|
340
|
-
weekday:
|
|
338
|
+
date: g.date || "",
|
|
339
|
+
count: (w = g.contributionCount) != null ? w : 0,
|
|
340
|
+
weekday: g.weekday || 0
|
|
341
341
|
};
|
|
342
342
|
})
|
|
343
343
|
}));
|
|
344
|
-
for (;
|
|
345
|
-
|
|
346
|
-
return
|
|
344
|
+
for (; r.length < 53; )
|
|
345
|
+
r.push(x());
|
|
346
|
+
return r;
|
|
347
347
|
}
|
|
348
348
|
function $() {
|
|
349
|
-
const
|
|
350
|
-
for (let
|
|
351
|
-
|
|
352
|
-
return
|
|
349
|
+
const o = [];
|
|
350
|
+
for (let r = 0; r < 53; r++)
|
|
351
|
+
o.push(x());
|
|
352
|
+
return o;
|
|
353
353
|
}
|
|
354
|
-
function
|
|
355
|
-
const
|
|
356
|
-
for (let
|
|
357
|
-
|
|
358
|
-
return { weekStart: "", days:
|
|
354
|
+
function x() {
|
|
355
|
+
const o = [];
|
|
356
|
+
for (let r = 0; r < 7; r++)
|
|
357
|
+
o.push({ date: "", count: 0, weekday: r });
|
|
358
|
+
return { weekStart: "", days: o };
|
|
359
359
|
}
|
|
360
|
-
function
|
|
360
|
+
function H() {
|
|
361
361
|
if (!_.value || _.value.length === 0) {
|
|
362
|
-
|
|
362
|
+
b.value = [];
|
|
363
363
|
return;
|
|
364
364
|
}
|
|
365
|
-
const
|
|
366
|
-
let
|
|
367
|
-
_.value.forEach((
|
|
368
|
-
if (!
|
|
369
|
-
const
|
|
370
|
-
if (!
|
|
371
|
-
const
|
|
372
|
-
if (
|
|
373
|
-
const [
|
|
374
|
-
if (!(isNaN(
|
|
375
|
-
const
|
|
376
|
-
|
|
365
|
+
const o = [];
|
|
366
|
+
let r = -1, v = -1;
|
|
367
|
+
_.value.forEach((g, w) => {
|
|
368
|
+
if (!g.days || g.days.length === 0) return;
|
|
369
|
+
const N = g.days[0].date;
|
|
370
|
+
if (!N) return;
|
|
371
|
+
const M = N.split("-");
|
|
372
|
+
if (M.length !== 3) return;
|
|
373
|
+
const [F, I] = M.map(Number);
|
|
374
|
+
if (!(isNaN(F) || isNaN(I)) && (I !== r || F !== v)) {
|
|
375
|
+
const at = new Date(F, I - 1, 1);
|
|
376
|
+
o.push({
|
|
377
377
|
week: w,
|
|
378
|
-
month:
|
|
379
|
-
year:
|
|
380
|
-
label:
|
|
381
|
-
}),
|
|
378
|
+
month: I - 1,
|
|
379
|
+
year: F,
|
|
380
|
+
label: at.toLocaleDateString("en-US", { month: "short" })
|
|
381
|
+
}), r = I, v = F;
|
|
382
382
|
}
|
|
383
|
-
}),
|
|
383
|
+
}), b.value = o;
|
|
384
384
|
}
|
|
385
|
-
function
|
|
386
|
-
return `level-${
|
|
385
|
+
function Q(o) {
|
|
386
|
+
return `level-${X(o)} ${p.value}`;
|
|
387
387
|
}
|
|
388
|
-
function
|
|
389
|
-
return
|
|
388
|
+
function X(o) {
|
|
389
|
+
return o === 0 ? 0 : o <= 3 ? 1 : o <= 6 ? 2 : o <= 9 ? 3 : 4;
|
|
390
390
|
}
|
|
391
|
-
function
|
|
392
|
-
if (!
|
|
393
|
-
const [
|
|
391
|
+
function Z(o) {
|
|
392
|
+
if (!o.date) return "";
|
|
393
|
+
const [r, v, g] = o.date.split("-").map(Number), N = new Date(r, v - 1, g).toLocaleDateString("en-US", {
|
|
394
394
|
weekday: "short",
|
|
395
395
|
year: "numeric",
|
|
396
396
|
month: "short",
|
|
397
397
|
day: "numeric"
|
|
398
|
-
}),
|
|
399
|
-
return `${
|
|
398
|
+
}), M = o.count === 1 ? "contribution" : "contributions";
|
|
399
|
+
return `${o.count} ${M} on ${N}`;
|
|
400
400
|
}
|
|
401
|
-
function
|
|
402
|
-
i("day-click", { date:
|
|
401
|
+
function tt(o) {
|
|
402
|
+
i("day-click", { date: o.date, count: o.count });
|
|
403
403
|
}
|
|
404
|
-
function
|
|
405
|
-
|
|
404
|
+
function et() {
|
|
405
|
+
f.value = !f.value;
|
|
406
406
|
}
|
|
407
|
-
function st(
|
|
408
|
-
|
|
407
|
+
function st(o) {
|
|
408
|
+
p.value = o, f.value = !1, i("color-scheme-change", o);
|
|
409
409
|
}
|
|
410
|
-
return (
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
class:
|
|
416
|
-
}, D(k(
|
|
410
|
+
return (o, r) => (h(), y("div", ht, [
|
|
411
|
+
a("div", pt, [
|
|
412
|
+
a("div", gt, [
|
|
413
|
+
a("h5", bt, D(j.value.toLocaleString()) + " contributions in the last year ", 1),
|
|
414
|
+
a("small", {
|
|
415
|
+
class: T(["data-source-text", { "is-dummy": k(d) }])
|
|
416
|
+
}, D(k(u)), 3)
|
|
417
417
|
]),
|
|
418
418
|
e.showSettings ? (h(), y("div", _t, [
|
|
419
|
-
|
|
419
|
+
a("button", {
|
|
420
420
|
class: "settings-btn",
|
|
421
421
|
type: "button",
|
|
422
|
-
onClick:
|
|
422
|
+
onClick: et
|
|
423
423
|
}, [
|
|
424
|
-
|
|
425
|
-
|
|
424
|
+
L(o.$slots, "settings-icon", {}, () => [
|
|
425
|
+
r[0] || (r[0] = C("⚙️", -1))
|
|
426
426
|
], !0),
|
|
427
|
-
|
|
427
|
+
r[1] || (r[1] = C(" Settings ", -1))
|
|
428
428
|
]),
|
|
429
|
-
|
|
430
|
-
(h(), y(
|
|
429
|
+
f.value ? (h(), y("div", kt, [
|
|
430
|
+
(h(), y(A, null, B(c, (v) => a("button", {
|
|
431
431
|
key: v,
|
|
432
|
-
onClick: (
|
|
432
|
+
onClick: (g) => st(v),
|
|
433
433
|
class: "settings-item"
|
|
434
434
|
}, D(v) + " theme ", 9, Dt)), 64))
|
|
435
|
-
])) :
|
|
436
|
-
])) :
|
|
435
|
+
])) : U("", !0)
|
|
436
|
+
])) : U("", !0)
|
|
437
437
|
]),
|
|
438
|
-
k(
|
|
439
|
-
|
|
440
|
-
|
|
438
|
+
k(m) ? (h(), y("div", St, [...r[2] || (r[2] = [
|
|
439
|
+
a("div", { class: "spinner" }, null, -1),
|
|
440
|
+
a("span", null, "Loading contributions...", -1)
|
|
441
441
|
])])) : (h(), y("div", wt, [
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
(h(!0), y(
|
|
442
|
+
a("div", Ct, [
|
|
443
|
+
a("div", $t, [
|
|
444
|
+
r[3] || (r[3] = a("div", { class: "month-spacer" }, null, -1)),
|
|
445
|
+
a("div", Tt, [
|
|
446
|
+
(h(!0), y(A, null, B(b.value, (v) => (h(), y("div", {
|
|
447
447
|
key: `${v.year}-${v.month}`,
|
|
448
448
|
class: "month-label",
|
|
449
|
-
style:
|
|
449
|
+
style: ct({
|
|
450
450
|
gridColumn: `${v.week + 1} / span 1`
|
|
451
451
|
})
|
|
452
452
|
}, D(v.label), 5))), 128))
|
|
453
453
|
])
|
|
454
454
|
]),
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
(h(!0), y(
|
|
455
|
+
a("div", jt, [
|
|
456
|
+
r[4] || (r[4] = ut('<div class="day-labels" data-v-3d412399><div class="day-label" data-v-3d412399>Mon</div><div class="day-label" data-v-3d412399></div><div class="day-label" data-v-3d412399>Wed</div><div class="day-label" data-v-3d412399></div><div class="day-label" data-v-3d412399>Fri</div><div class="day-label" data-v-3d412399></div><div class="day-label" data-v-3d412399></div></div>', 1)),
|
|
457
|
+
a("div", Lt, [
|
|
458
|
+
(h(!0), y(A, null, B(_.value, (v) => (h(), y("div", {
|
|
459
459
|
key: v.weekStart,
|
|
460
460
|
class: "contribution-week"
|
|
461
461
|
}, [
|
|
462
|
-
(h(!0), y(
|
|
463
|
-
key:
|
|
464
|
-
class:
|
|
465
|
-
title:
|
|
466
|
-
onClick: (w) =>
|
|
462
|
+
(h(!0), y(A, null, B(v.days, (g) => (h(), y("div", {
|
|
463
|
+
key: g.date,
|
|
464
|
+
class: T(["contribution-day", Q(g.count)]),
|
|
465
|
+
title: Z(g),
|
|
466
|
+
onClick: (w) => tt(g)
|
|
467
467
|
}, null, 10, Ut))), 128))
|
|
468
468
|
]))), 128))
|
|
469
469
|
])
|
|
470
470
|
])
|
|
471
471
|
]),
|
|
472
|
-
|
|
473
|
-
k(
|
|
474
|
-
|
|
472
|
+
a("div", xt, [
|
|
473
|
+
k(n) ? (h(), y("small", Ft, " Last updated: " + D(k(n)), 1)) : U("", !0),
|
|
474
|
+
a("div", It, [
|
|
475
|
+
r[5] || (r[5] = a("small", { class: "legend-label" }, "Less", -1)),
|
|
476
|
+
a("div", Et, [
|
|
477
|
+
a("div", {
|
|
478
|
+
class: T(p.value + " contribution-day level-0")
|
|
479
|
+
}, null, 2),
|
|
480
|
+
a("div", {
|
|
481
|
+
class: T(p.value + " contribution-day level-1")
|
|
482
|
+
}, null, 2),
|
|
483
|
+
a("div", {
|
|
484
|
+
class: T(p.value + " contribution-day level-2")
|
|
485
|
+
}, null, 2),
|
|
486
|
+
a("div", {
|
|
487
|
+
class: T(p.value + " contribution-day level-3")
|
|
488
|
+
}, null, 2),
|
|
489
|
+
a("div", {
|
|
490
|
+
class: T(p.value + " contribution-day level-4")
|
|
491
|
+
}, null, 2)
|
|
492
|
+
]),
|
|
493
|
+
r[6] || (r[6] = a("small", { class: "legend-label" }, "More", -1))
|
|
494
|
+
])
|
|
475
495
|
])
|
|
476
496
|
]))
|
|
477
497
|
]));
|
|
478
498
|
}
|
|
479
|
-
}),
|
|
480
|
-
const
|
|
499
|
+
}), K = (e, t) => {
|
|
500
|
+
const s = e.__vccOpts || e;
|
|
481
501
|
for (const [i, l] of t)
|
|
482
|
-
|
|
483
|
-
return
|
|
484
|
-
},
|
|
502
|
+
s[i] = l;
|
|
503
|
+
return s;
|
|
504
|
+
}, Mt = /* @__PURE__ */ K(Nt, [["__scopeId", "data-v-3d412399"]]), Ot = { class: "git-stats-breakdown" }, At = { class: "stats-grid" }, Bt = { class: "stat-card" }, Gt = { class: "stat-icon" }, Pt = { class: "stat-content" }, Vt = { class: "stat-value" }, Rt = { class: "stat-card" }, Yt = { class: "stat-icon" }, Wt = { class: "stat-content" }, Jt = {
|
|
485
505
|
key: 0,
|
|
486
506
|
class: "stat-loading"
|
|
487
|
-
},
|
|
507
|
+
}, qt = {
|
|
488
508
|
key: 1,
|
|
489
509
|
class: "stat-value"
|
|
490
|
-
},
|
|
510
|
+
}, zt = { class: "stat-card" }, Kt = { class: "stat-icon" }, Ht = { class: "stat-content" }, Qt = {
|
|
491
511
|
key: 0,
|
|
492
512
|
class: "stat-loading"
|
|
493
|
-
},
|
|
513
|
+
}, Xt = {
|
|
494
514
|
key: 1,
|
|
495
515
|
class: "stat-value"
|
|
496
|
-
},
|
|
516
|
+
}, Zt = {
|
|
497
517
|
key: 0,
|
|
498
518
|
class: "stat-card"
|
|
499
|
-
},
|
|
519
|
+
}, te = { class: "stat-icon" }, ee = { class: "stat-content" }, se = {
|
|
500
520
|
key: 0,
|
|
501
521
|
class: "stat-loading"
|
|
502
|
-
},
|
|
522
|
+
}, ae = {
|
|
503
523
|
key: 1,
|
|
504
524
|
class: "stat-value"
|
|
505
|
-
},
|
|
525
|
+
}, oe = { class: "stat-label" }, ne = { class: "stats-footer" }, re = {
|
|
506
526
|
key: 0,
|
|
507
527
|
class: "data-source"
|
|
508
|
-
},
|
|
528
|
+
}, ie = { key: 0 }, le = /* @__PURE__ */ J({
|
|
509
529
|
__name: "StatsBreakdown",
|
|
510
530
|
props: {
|
|
511
531
|
dataUrl: { default: "/data/git-stats.json" },
|
|
@@ -516,121 +536,121 @@ const ht = { class: "git-contribution-graph" }, pt = { class: "graph-header" },
|
|
|
516
536
|
cacheTTL: { default: 24 * 60 * 60 * 1e3 }
|
|
517
537
|
},
|
|
518
538
|
setup(e) {
|
|
519
|
-
const t = e, { data:
|
|
539
|
+
const t = e, { data: s, loading: i, dataSourceText: l, lastUpdatedText: m } = z({
|
|
520
540
|
dataUrl: t.dataUrl,
|
|
521
541
|
cacheTTL: t.cacheTTL
|
|
522
|
-
}),
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
(
|
|
542
|
+
}), u = S(0), n = S(0);
|
|
543
|
+
q(
|
|
544
|
+
s,
|
|
545
|
+
(f) => {
|
|
526
546
|
var c, _;
|
|
527
|
-
if (
|
|
547
|
+
if (f)
|
|
528
548
|
if (t.profileIndexes.length > 0) {
|
|
529
|
-
let
|
|
530
|
-
t.profileIndexes.forEach((
|
|
531
|
-
var
|
|
532
|
-
const $ = (
|
|
533
|
-
$ != null && $.stats && (
|
|
534
|
-
}),
|
|
549
|
+
let b = 0, j = 0;
|
|
550
|
+
t.profileIndexes.forEach((G) => {
|
|
551
|
+
var x;
|
|
552
|
+
const $ = (x = f.profiles) == null ? void 0 : x[G];
|
|
553
|
+
$ != null && $.stats && (b += $.stats.projectCount || 0, j += $.stats.commitCount || 0);
|
|
554
|
+
}), u.value = b, n.value = j;
|
|
535
555
|
} else
|
|
536
|
-
|
|
556
|
+
u.value = ((c = f.totals) == null ? void 0 : c.projectCount) || 0, n.value = ((_ = f.totals) == null ? void 0 : _.commitCount) || 0;
|
|
537
557
|
},
|
|
538
558
|
{ immediate: !0 }
|
|
539
559
|
);
|
|
540
|
-
const
|
|
560
|
+
const d = E(() => vt(t.experienceData).toFixed(1)), p = E(() => {
|
|
541
561
|
if (t.customStatCalculator) {
|
|
542
|
-
const
|
|
543
|
-
projects:
|
|
544
|
-
commits:
|
|
545
|
-
years: parseFloat(
|
|
562
|
+
const j = {
|
|
563
|
+
projects: u.value,
|
|
564
|
+
commits: n.value,
|
|
565
|
+
years: parseFloat(d.value)
|
|
546
566
|
};
|
|
547
|
-
return t.customStatCalculator(
|
|
567
|
+
return t.customStatCalculator(j);
|
|
548
568
|
}
|
|
549
|
-
return (
|
|
569
|
+
return (u.value * 1.5 + n.value * 1.2 + parseFloat(d.value) * 1.5).toFixed(2);
|
|
550
570
|
});
|
|
551
|
-
return (
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
571
|
+
return (f, c) => (h(), y("div", Ot, [
|
|
572
|
+
a("div", At, [
|
|
573
|
+
a("div", Bt, [
|
|
574
|
+
a("div", Gt, [
|
|
575
|
+
L(f.$slots, "icon-experience", {}, () => [
|
|
556
576
|
c[0] || (c[0] = C("⏱️", -1))
|
|
557
577
|
], !0)
|
|
558
578
|
]),
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
c[1] || (c[1] =
|
|
579
|
+
a("div", Pt, [
|
|
580
|
+
a("div", Vt, D(d.value), 1),
|
|
581
|
+
c[1] || (c[1] = a("div", { class: "stat-label" }, "Years Experience", -1))
|
|
562
582
|
])
|
|
563
583
|
]),
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
584
|
+
a("div", Rt, [
|
|
585
|
+
a("div", Yt, [
|
|
586
|
+
L(f.$slots, "icon-projects", {}, () => [
|
|
567
587
|
c[2] || (c[2] = C("📦", -1))
|
|
568
588
|
], !0)
|
|
569
589
|
]),
|
|
570
|
-
|
|
571
|
-
k(i) ? (h(), y("div",
|
|
572
|
-
|
|
573
|
-
])])) : (h(), y("div",
|
|
574
|
-
c[4] || (c[4] =
|
|
590
|
+
a("div", Wt, [
|
|
591
|
+
k(i) ? (h(), y("div", Jt, [...c[3] || (c[3] = [
|
|
592
|
+
a("div", { class: "spinner" }, null, -1)
|
|
593
|
+
])])) : (h(), y("div", qt, D(u.value), 1)),
|
|
594
|
+
c[4] || (c[4] = a("div", { class: "stat-label" }, "Projects", -1))
|
|
575
595
|
])
|
|
576
596
|
]),
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
597
|
+
a("div", zt, [
|
|
598
|
+
a("div", Kt, [
|
|
599
|
+
L(f.$slots, "icon-commits", {}, () => [
|
|
580
600
|
c[5] || (c[5] = C("💻", -1))
|
|
581
601
|
], !0)
|
|
582
602
|
]),
|
|
583
|
-
|
|
584
|
-
k(i) ? (h(), y("div",
|
|
585
|
-
|
|
586
|
-
])])) : (h(), y("div",
|
|
587
|
-
c[7] || (c[7] =
|
|
603
|
+
a("div", Ht, [
|
|
604
|
+
k(i) ? (h(), y("div", Qt, [...c[6] || (c[6] = [
|
|
605
|
+
a("div", { class: "spinner" }, null, -1)
|
|
606
|
+
])])) : (h(), y("div", Xt, D(n.value), 1)),
|
|
607
|
+
c[7] || (c[7] = a("div", { class: "stat-label" }, "Commits", -1))
|
|
588
608
|
])
|
|
589
609
|
]),
|
|
590
|
-
e.showCustomStat ? (h(), y("div",
|
|
591
|
-
|
|
592
|
-
|
|
610
|
+
e.showCustomStat ? (h(), y("div", Zt, [
|
|
611
|
+
a("div", te, [
|
|
612
|
+
L(f.$slots, "icon-custom", {}, () => [
|
|
593
613
|
c[8] || (c[8] = C("☕", -1))
|
|
594
614
|
], !0)
|
|
595
615
|
]),
|
|
596
|
-
|
|
597
|
-
k(i) ? (h(), y("div",
|
|
598
|
-
|
|
599
|
-
])])) : (h(), y("div",
|
|
600
|
-
|
|
601
|
-
|
|
616
|
+
a("div", ee, [
|
|
617
|
+
k(i) ? (h(), y("div", se, [...c[9] || (c[9] = [
|
|
618
|
+
a("div", { class: "spinner" }, null, -1)
|
|
619
|
+
])])) : (h(), y("div", ae, D(p.value), 1)),
|
|
620
|
+
a("div", oe, [
|
|
621
|
+
L(f.$slots, "custom-stat-label", {}, () => [
|
|
602
622
|
c[10] || (c[10] = C("Coffee Consumed", -1))
|
|
603
623
|
], !0)
|
|
604
624
|
])
|
|
605
625
|
])
|
|
606
|
-
])) :
|
|
626
|
+
])) : U("", !0)
|
|
607
627
|
]),
|
|
608
|
-
|
|
609
|
-
k(l) ? (h(), y("small",
|
|
628
|
+
a("div", ne, [
|
|
629
|
+
k(l) ? (h(), y("small", re, [
|
|
610
630
|
C(D(k(l)) + " ", 1),
|
|
611
|
-
k(
|
|
612
|
-
])) :
|
|
631
|
+
k(m) ? (h(), y("span", ie, " · " + D(k(m)), 1)) : U("", !0)
|
|
632
|
+
])) : U("", !0)
|
|
613
633
|
])
|
|
614
634
|
]));
|
|
615
635
|
}
|
|
616
|
-
}),
|
|
636
|
+
}), ce = /* @__PURE__ */ K(le, [["__scopeId", "data-v-31f1bb7a"]]), he = {
|
|
617
637
|
install(e) {
|
|
618
|
-
e.component("ContributionGraph",
|
|
638
|
+
e.component("ContributionGraph", Mt), e.component("StatsBreakdown", ce);
|
|
619
639
|
}
|
|
620
640
|
};
|
|
621
641
|
export {
|
|
622
|
-
|
|
623
|
-
|
|
642
|
+
Mt as ContributionGraph,
|
|
643
|
+
ce as StatsBreakdown,
|
|
624
644
|
vt as calculateYearsExperience,
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
645
|
+
he as default,
|
|
646
|
+
mt as fetchGitStats,
|
|
647
|
+
me as fetchGitStatsAPI,
|
|
648
|
+
ft as formatLastUpdated,
|
|
649
|
+
dt as generateDummyContributions,
|
|
650
|
+
P as generateDummyStats,
|
|
651
|
+
fe as generateMultiProfileDummyStats,
|
|
652
|
+
ye as getContributionLevel,
|
|
653
|
+
ve as saveDummyDataToFile,
|
|
654
|
+
z as useGitStats
|
|
635
655
|
};
|
|
636
656
|
//# sourceMappingURL=vue.es.js.map
|