@tehw0lf/git-portfolio 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,357 @@
1
+ import * as i0 from '@angular/core';
2
+ import { Injectable, Directive, Input, EventEmitter, Component, Output, NgModule } from '@angular/core';
3
+ import { BehaviorSubject, zip, of, Subject } from 'rxjs';
4
+ import { tap, map, takeUntil } from 'rxjs/operators';
5
+ import * as i1 from '@angular/common/http';
6
+ import { HttpClientModule } from '@angular/common/http';
7
+ import * as i2$1 from '@angular/material/progress-spinner';
8
+ import { MatProgressSpinnerModule } from '@angular/material/progress-spinner';
9
+ import * as i1$1 from '@angular/material/card';
10
+ import { MatCardModule } from '@angular/material/card';
11
+ import * as i2 from '@angular/material/button';
12
+ import { MatButtonModule } from '@angular/material/button';
13
+ import * as i4 from '@angular/common';
14
+ import { CommonModule } from '@angular/common';
15
+ import * as i4$1 from '@angular/flex-layout/extended';
16
+ import * as i5 from '@angular/flex-layout/flex';
17
+ import * as i7 from '@angular/cdk/clipboard';
18
+ import { ClipboardModule } from '@angular/cdk/clipboard';
19
+ import { FlexLayoutModule } from '@angular/flex-layout';
20
+ import { BrowserModule } from '@angular/platform-browser';
21
+ import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
22
+
23
+ /* eslint-disable @typescript-eslint/naming-convention */
24
+ class GitRepository {
25
+ }
26
+
27
+ class GitProviderService {
28
+ constructor(http) {
29
+ this.http = http;
30
+ this.loadingStateSubject = new BehaviorSubject(true);
31
+ this.repositorySubject = new BehaviorSubject({});
32
+ }
33
+ get loading() {
34
+ return this.loadingStateSubject.asObservable();
35
+ }
36
+ getRepositories(gitProviderUserNames) {
37
+ if (this.repositorySubject.value.github === undefined &&
38
+ this.repositorySubject.value.gitlab === undefined) {
39
+ this.fetchRepositories(gitProviderUserNames)
40
+ .pipe(tap((repositories) => {
41
+ this.repositorySubject.next(repositories);
42
+ this.loadingStateSubject.next(false);
43
+ }))
44
+ .subscribe();
45
+ }
46
+ return this.repositorySubject.asObservable();
47
+ }
48
+ fetchRepositories(gitProviderUserNames) {
49
+ var _a, _b;
50
+ return zip(this.fetchGithubRepositories((_a = gitProviderUserNames === null || gitProviderUserNames === void 0 ? void 0 : gitProviderUserNames.github) !== null && _a !== void 0 ? _a : ''), this.fetchGitlabRepositories((_b = gitProviderUserNames === null || gitProviderUserNames === void 0 ? void 0 : gitProviderUserNames.gitlab) !== null && _b !== void 0 ? _b : '')).pipe(map((gitRepositoryArray) => {
51
+ const repositories = {
52
+ github: this.filterAndSortGitRepositories(gitRepositoryArray[0]),
53
+ gitlab: this.filterAndSortGitRepositories(gitRepositoryArray[1])
54
+ };
55
+ return repositories;
56
+ }));
57
+ }
58
+ filterAndSortGitRepositories(gitRepositoryArray) {
59
+ return {
60
+ own: gitRepositoryArray
61
+ .filter((gitRepository) => !gitRepository.fork)
62
+ .sort((repoA, repoB) => { var _a, _b; return ((_a = repoB.stargazers_count) !== null && _a !== void 0 ? _a : 0) - ((_b = repoA.stargazers_count) !== null && _b !== void 0 ? _b : 0); }),
63
+ forked: gitRepositoryArray
64
+ .filter((gitRepository) => gitRepository.fork)
65
+ .sort((repoA, repoB) => { var _a, _b; return ((_a = repoB.stargazers_count) !== null && _a !== void 0 ? _a : 0) - ((_b = repoA.stargazers_count) !== null && _b !== void 0 ? _b : 0); })
66
+ };
67
+ }
68
+ fetchGithubRepositories(githubUser) {
69
+ if (githubUser !== '') {
70
+ return this.http.get(`https://api.github.com/users/${githubUser}/repos`);
71
+ }
72
+ return of([new GitRepository()]);
73
+ }
74
+ fetchGitlabRepositories(gitlabUser) {
75
+ if (gitlabUser !== '') {
76
+ return this.http.get(`https://gitlab.com/api/v4/users/${gitlabUser}/projects`);
77
+ }
78
+ return of([new GitRepository()]);
79
+ }
80
+ }
81
+ GitProviderService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.11", ngImport: i0, type: GitProviderService, deps: [{ token: i1.HttpClient }], target: i0.ɵɵFactoryTarget.Injectable });
82
+ GitProviderService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.11", ngImport: i0, type: GitProviderService, providedIn: 'root' });
83
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.11", ngImport: i0, type: GitProviderService, decorators: [{
84
+ type: Injectable,
85
+ args: [{
86
+ providedIn: 'root'
87
+ }]
88
+ }], ctorParameters: function () { return [{ type: i1.HttpClient }]; } });
89
+
90
+ /* eslint-disable no-shadow */
91
+ var GitProviders;
92
+ (function (GitProviders) {
93
+ GitProviders["github"] = "GitHub";
94
+ GitProviders["gitlab"] = "GitLab";
95
+ })(GitProviders || (GitProviders = {}));
96
+
97
+ // eslint-disable-next-line @typescript-eslint/no-var-requires
98
+ const octicons = require('@primer/octicons');
99
+ class OcticonDirective {
100
+ constructor(elementRef, renderer) {
101
+ this.elementRef = elementRef;
102
+ this.renderer = renderer;
103
+ }
104
+ ngOnInit() {
105
+ const el = this.elementRef.nativeElement;
106
+ if (this.octicon) {
107
+ if (octicons[this.octicon] !== undefined) {
108
+ el.innerHTML = octicons[this.octicon].toSVG();
109
+ const icon = el.firstChild;
110
+ if (this.color && icon) {
111
+ this.renderer.setStyle(icon, 'fill', this.color);
112
+ }
113
+ if (this.width && icon) {
114
+ this.renderer.setStyle(icon, 'width', this.width);
115
+ this.renderer.setStyle(icon, 'height', this.width);
116
+ }
117
+ }
118
+ else {
119
+ el.innerHTML = octicons['alert'].toSVG();
120
+ this.renderer.setStyle(el.firstChild, 'fill', 'red');
121
+ }
122
+ }
123
+ }
124
+ }
125
+ OcticonDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.11", ngImport: i0, type: OcticonDirective, deps: [{ token: i0.ElementRef }, { token: i0.Renderer2 }], target: i0.ɵɵFactoryTarget.Directive });
126
+ OcticonDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.11", type: OcticonDirective, selector: "[octicon]", inputs: { octicon: "octicon", color: "color", width: "width" }, ngImport: i0 });
127
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.11", ngImport: i0, type: OcticonDirective, decorators: [{
128
+ type: Directive,
129
+ args: [{
130
+ // eslint-disable-next-line @angular-eslint/directive-selector
131
+ selector: '[octicon]'
132
+ }]
133
+ }], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i0.Renderer2 }]; }, propDecorators: { octicon: [{
134
+ type: Input
135
+ }], color: [{
136
+ type: Input
137
+ }], width: [{
138
+ type: Input
139
+ }] } });
140
+
141
+ // eslint-disable-next-line @typescript-eslint/no-var-requires
142
+ const githubLanguageColors = require('github-language-colors/colors.json');
143
+ class RepoCardComponent {
144
+ constructor() {
145
+ this.isCopied = false;
146
+ this.copiedToClipboardEvent = new EventEmitter();
147
+ this.githubLanguageColors = githubLanguageColors;
148
+ //
149
+ }
150
+ copiedToClipboard() {
151
+ this.copiedToClipboardEvent.emit();
152
+ }
153
+ }
154
+ RepoCardComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.11", ngImport: i0, type: RepoCardComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
155
+ RepoCardComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.11", type: RepoCardComponent, selector: "repo-card", inputs: { backgroundColor: "backgroundColor", backdropFilter: "backdropFilter", buttonColor: "buttonColor", cardColor: "cardColor", gitRepo: "gitRepo", isCopied: "isCopied" }, outputs: { copiedToClipboardEvent: "copiedToClipboardEvent" }, ngImport: i0, template: "<mat-card\n [ngStyle]=\"{\n color: cardColor,\n 'background-color': backgroundColor,\n 'backdrop-filter': backdropFilter\n }\"\n>\n <mat-card-header>\n <div\n mat-card-avatar\n [ngStyle]=\"{\n 'background-image':\n 'url(' +\n (gitRepo.owner?.avatar_url || gitRepo.namespace?.avatar_url) +\n ')',\n 'background-size': 'cover',\n 'border-radius': 0\n }\"\n ></div>\n <mat-card-title\n ><a\n mat-button\n [ngStyle]=\"{ color: buttonColor }\"\n target=\"_blank\"\n href=\"{{ gitRepo.html_url || gitRepo.web_url }}\"\n >\n {{ gitRepo.name }}\n </a>\n </mat-card-title>\n <mat-card-subtitle fxLayout=\"row\" fxLayoutGap=\"12px\">\n <div class=\"info-item\" fxLayout=\"row\" fxLayoutGap=\"5px\">\n <div\n [ngStyle]=\"{\n 'background-color':\n gitRepo.language !== undefined\n ? githubLanguageColors[gitRepo.language]\n : 'transparent'\n }\"\n class=\"language-icon\"\n ></div>\n <div>{{ gitRepo.language }}</div>\n </div>\n <div class=\"info-item\" fxLayout=\"row\" fxLayoutGap=\"5px\">\n <div octicon=\"star\" color=\"gold\"></div>\n <div>{{ gitRepo.stargazers_count || gitRepo.star_count || 0 }}</div>\n </div>\n <div class=\"info-item\" fxLayout=\"row\" fxLayoutGap=\"5px\">\n <div octicon=\"repo-forked\" color=\"#437da8\"></div>\n <div>{{ gitRepo.forks_count }}</div>\n </div>\n <div\n *ngIf=\"gitRepo.open_issues_count\"\n class=\"info-item\"\n fxLayout=\"row\"\n fxLayoutGap=\"5px\"\n >\n <div octicon=\"issue-opened\" color=\"rgb(56, 224, 56)\"></div>\n <div>{{ gitRepo.open_issues_count }}</div>\n </div>\n </mat-card-subtitle>\n </mat-card-header>\n <mat-card-content>\n <p>{{ gitRepo.description }}</p>\n </mat-card-content>\n <mat-card-footer fxLayout=\"row\" fxLayoutGap=\"12px\">\n <span class=\"mat-footer-cell\" fxFlex>\n <span class=\"footer-span\" [ngStyle]=\"{ color: cardColor }\"\n >Created: {{ gitRepo.created_at | date }}</span\n >\n <span class=\"footer-span\" [ngStyle]=\"{ color: cardColor }\"\n >Updated:\n {{ gitRepo.pushed_at || gitRepo.last_activity_at | date }}</span\n >\n </span>\n <span class=\"mat-footer-cell\">\n <button\n [ngStyle]=\"{ color: buttonColor }\"\n mat-button\n [cdkCopyToClipboard]=\"\n gitRepo.clone_url || gitRepo.http_url_to_repo || ''\n \"\n (cdkCopyToClipboardCopied)=\"copiedToClipboard()\"\n class=\"clipboard-button\"\n >\n <span class=\"mat-button-wrapper\" fxLayout=\"row\" fxLayoutGap=\"5px\">\n <div\n *ngIf=\"isCopied\"\n octicon=\"check\"\n color=\"#38e038\"\n width=\"24\"\n ></div>\n <div octicon=\"paste\" color=\"#cc7832\" width=\"24px\"></div>\n <span>Copy URL</span>\n </span>\n </button>\n </span>\n </mat-card-footer>\n</mat-card>\n", styles: [".clipboard-button{line-height:24px!important;padding:0;margin-bottom:0}.clipboard-button span{font-size:20px}.mat-button{vertical-align:middle;line-height:36px;font-size:24px;margin:0 10px 0 0;text-align:center;text-decoration:none}.mat-card{display:flex;flex-direction:column;width:450px}.mat-card-avatar{height:53px;width:53px}.mat-card-subtitle{padding-left:16px}.mat-card-header{flex-shrink:0}.mat-card-content{flex-grow:1;overflow:auto}.mat-card-footer{padding:16px}.footer-span{display:block;font-size:12px}.language-icon{height:12px;width:12px;border-radius:50%;margin-top:2px}\n"], components: [{ type: i1$1.MatCard, selector: "mat-card", exportAs: ["matCard"] }, { type: i1$1.MatCardHeader, selector: "mat-card-header" }, { type: i2.MatAnchor, selector: "a[mat-button], a[mat-raised-button], a[mat-icon-button], a[mat-fab], a[mat-mini-fab], a[mat-stroked-button], a[mat-flat-button]", inputs: ["disabled", "disableRipple", "color", "tabIndex"], exportAs: ["matButton", "matAnchor"] }, { type: i2.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }], directives: [{ type: i4.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { type: i4$1.DefaultStyleDirective, selector: " [ngStyle], [ngStyle.xs], [ngStyle.sm], [ngStyle.md], [ngStyle.lg], [ngStyle.xl], [ngStyle.lt-sm], [ngStyle.lt-md], [ngStyle.lt-lg], [ngStyle.lt-xl], [ngStyle.gt-xs], [ngStyle.gt-sm], [ngStyle.gt-md], [ngStyle.gt-lg]", inputs: ["ngStyle", "ngStyle.xs", "ngStyle.sm", "ngStyle.md", "ngStyle.lg", "ngStyle.xl", "ngStyle.lt-sm", "ngStyle.lt-md", "ngStyle.lt-lg", "ngStyle.lt-xl", "ngStyle.gt-xs", "ngStyle.gt-sm", "ngStyle.gt-md", "ngStyle.gt-lg"] }, { type: i1$1.MatCardAvatar, selector: "[mat-card-avatar], [matCardAvatar]" }, { type: i1$1.MatCardTitle, selector: "mat-card-title, [mat-card-title], [matCardTitle]" }, { type: i1$1.MatCardSubtitle, selector: "mat-card-subtitle, [mat-card-subtitle], [matCardSubtitle]" }, { type: i5.DefaultLayoutDirective, selector: " [fxLayout], [fxLayout.xs], [fxLayout.sm], [fxLayout.md], [fxLayout.lg], [fxLayout.xl], [fxLayout.lt-sm], [fxLayout.lt-md], [fxLayout.lt-lg], [fxLayout.lt-xl], [fxLayout.gt-xs], [fxLayout.gt-sm], [fxLayout.gt-md], [fxLayout.gt-lg]", inputs: ["fxLayout", "fxLayout.xs", "fxLayout.sm", "fxLayout.md", "fxLayout.lg", "fxLayout.xl", "fxLayout.lt-sm", "fxLayout.lt-md", "fxLayout.lt-lg", "fxLayout.lt-xl", "fxLayout.gt-xs", "fxLayout.gt-sm", "fxLayout.gt-md", "fxLayout.gt-lg"] }, { type: i5.DefaultLayoutGapDirective, selector: " [fxLayoutGap], [fxLayoutGap.xs], [fxLayoutGap.sm], [fxLayoutGap.md], [fxLayoutGap.lg], [fxLayoutGap.xl], [fxLayoutGap.lt-sm], [fxLayoutGap.lt-md], [fxLayoutGap.lt-lg], [fxLayoutGap.lt-xl], [fxLayoutGap.gt-xs], [fxLayoutGap.gt-sm], [fxLayoutGap.gt-md], [fxLayoutGap.gt-lg]", inputs: ["fxLayoutGap", "fxLayoutGap.xs", "fxLayoutGap.sm", "fxLayoutGap.md", "fxLayoutGap.lg", "fxLayoutGap.xl", "fxLayoutGap.lt-sm", "fxLayoutGap.lt-md", "fxLayoutGap.lt-lg", "fxLayoutGap.lt-xl", "fxLayoutGap.gt-xs", "fxLayoutGap.gt-sm", "fxLayoutGap.gt-md", "fxLayoutGap.gt-lg"] }, { type: OcticonDirective, selector: "[octicon]", inputs: ["octicon", "color", "width"] }, { type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i1$1.MatCardContent, selector: "mat-card-content, [mat-card-content], [matCardContent]" }, { type: i1$1.MatCardFooter, selector: "mat-card-footer" }, { type: i5.DefaultFlexDirective, selector: " [fxFlex], [fxFlex.xs], [fxFlex.sm], [fxFlex.md], [fxFlex.lg], [fxFlex.xl], [fxFlex.lt-sm], [fxFlex.lt-md], [fxFlex.lt-lg], [fxFlex.lt-xl], [fxFlex.gt-xs], [fxFlex.gt-sm], [fxFlex.gt-md], [fxFlex.gt-lg]", inputs: ["fxFlex", "fxFlex.xs", "fxFlex.sm", "fxFlex.md", "fxFlex.lg", "fxFlex.xl", "fxFlex.lt-sm", "fxFlex.lt-md", "fxFlex.lt-lg", "fxFlex.lt-xl", "fxFlex.gt-xs", "fxFlex.gt-sm", "fxFlex.gt-md", "fxFlex.gt-lg"] }, { type: i7.CdkCopyToClipboard, selector: "[cdkCopyToClipboard]", inputs: ["cdkCopyToClipboard", "cdkCopyToClipboardAttempts"], outputs: ["cdkCopyToClipboardCopied"] }], pipes: { "date": i4.DatePipe } });
156
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.11", ngImport: i0, type: RepoCardComponent, decorators: [{
157
+ type: Component,
158
+ args: [{
159
+ // eslint-disable-next-line @angular-eslint/component-selector
160
+ selector: 'repo-card',
161
+ templateUrl: './repo-card.component.html',
162
+ styleUrls: ['./repo-card.component.scss']
163
+ }]
164
+ }], ctorParameters: function () { return []; }, propDecorators: { backgroundColor: [{
165
+ type: Input
166
+ }], backdropFilter: [{
167
+ type: Input
168
+ }], buttonColor: [{
169
+ type: Input
170
+ }], cardColor: [{
171
+ type: Input
172
+ }], gitRepo: [{
173
+ type: Input
174
+ }], isCopied: [{
175
+ type: Input
176
+ }], copiedToClipboardEvent: [{
177
+ type: Output
178
+ }] } });
179
+
180
+ class GitPortfolioComponent {
181
+ constructor(gitProviderService) {
182
+ this.gitProviderService = gitProviderService;
183
+ this.backgroundColor = 'rgba(34, 34, 34, 0.75)';
184
+ this.backdropFilter = 'blur(50px)';
185
+ this.buttonColor = '#cc7832';
186
+ this.cardColor = 'lightgray';
187
+ this.gitProviderConfig = { github: '', gitlab: '' };
188
+ this.showForked = true;
189
+ this.showOwn = true;
190
+ this.gitProviders = GitProviders;
191
+ this.unsubscribe$ = new Subject();
192
+ this.loading = this.gitProviderService.loading;
193
+ }
194
+ ngOnInit() {
195
+ this.getRepositories();
196
+ }
197
+ ngOnDestroy() {
198
+ this.unsubscribe$.next();
199
+ this.unsubscribe$.complete();
200
+ }
201
+ copyToClipboard(githubRepo) {
202
+ this.currentRepo = githubRepo;
203
+ }
204
+ isCopiedToClipboard(githubRepo) {
205
+ if (!this.currentRepo) {
206
+ return false;
207
+ }
208
+ return this.currentRepo.id === githubRepo.id ? true : false;
209
+ }
210
+ getRepositories() {
211
+ this.gitRepositories$ = this.gitProviderService
212
+ .getRepositories(this.gitProviderConfig)
213
+ .pipe(takeUntil(this.unsubscribe$));
214
+ }
215
+ getOwnGitRepositories(gitRepositories, gitProvider) {
216
+ if (gitRepositories) {
217
+ switch (gitProvider) {
218
+ case 'github':
219
+ if (gitRepositories.github) {
220
+ return gitRepositories.github.own;
221
+ }
222
+ else {
223
+ return [];
224
+ }
225
+ case 'gitlab':
226
+ if (gitRepositories.gitlab) {
227
+ return gitRepositories.gitlab.own;
228
+ }
229
+ else {
230
+ return [];
231
+ }
232
+ default:
233
+ return [];
234
+ }
235
+ }
236
+ else {
237
+ return [];
238
+ }
239
+ }
240
+ getForkedGitRepositories(gitRepositories, gitProvider) {
241
+ if (gitRepositories) {
242
+ switch (gitProvider) {
243
+ case 'github':
244
+ if (gitRepositories.github) {
245
+ return gitRepositories.github.forked;
246
+ }
247
+ else {
248
+ return [];
249
+ }
250
+ case 'gitlab':
251
+ if (gitRepositories.gitlab) {
252
+ return gitRepositories.gitlab.forked;
253
+ }
254
+ else {
255
+ return [];
256
+ }
257
+ default:
258
+ return [];
259
+ }
260
+ }
261
+ else {
262
+ return [];
263
+ }
264
+ }
265
+ hasRepositories(gitRepositories, gitProvider, type) {
266
+ if (gitRepositories) {
267
+ switch (gitProvider) {
268
+ case 'github':
269
+ if (gitRepositories.github) {
270
+ return gitRepositories.github[type].length > 0;
271
+ }
272
+ break;
273
+ case 'gitlab':
274
+ if (gitRepositories.gitlab) {
275
+ return gitRepositories.gitlab[type].length > 0;
276
+ }
277
+ break;
278
+ }
279
+ }
280
+ return false;
281
+ }
282
+ }
283
+ GitPortfolioComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.11", ngImport: i0, type: GitPortfolioComponent, deps: [{ token: GitProviderService }], target: i0.ɵɵFactoryTarget.Component });
284
+ GitPortfolioComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.11", type: GitPortfolioComponent, selector: "git-portfolio", inputs: { backgroundColor: "backgroundColor", backdropFilter: "backdropFilter", buttonColor: "buttonColor", cardColor: "cardColor", gitProviderConfig: "gitProviderConfig", showForked: "showForked", showOwn: "showOwn" }, ngImport: i0, template: "<div *ngIf=\"gitRepositories$ | async as gitRepositories\">\n <div *ngFor=\"let gitProvider of gitProviders | keyvalue\">\n <h1>{{ gitProvider.value }}</h1>\n <div *ngIf=\"showOwn\">\n <h2 class=\"mat-headline\">Own Repos</h2>\n <div\n fxLayout=\"row wrap\"\n fxLayout.lt-sm=\"column\"\n fxLayoutAlign=\"flex-start\"\n >\n <div *ngIf=\"(loading | async) === true\">\n <mat-spinner></mat-spinner>\n </div>\n <repo-card\n *ngFor=\"\n let gitRepo of getOwnGitRepositories(\n gitRepositories,\n gitProvider.key\n )\n \"\n [backgroundColor]=\"backgroundColor\"\n [backdropFilter]=\"backdropFilter\"\n [buttonColor]=\"buttonColor\"\n [cardColor]=\"cardColor\"\n [gitRepo]=\"gitRepo\"\n [isCopied]=\"isCopiedToClipboard(gitRepo)\"\n (copiedToClipboardEvent)=\"copyToClipboard(gitRepo)\"\n class=\"repository-card\"\n fxFlex=\"0 1 calc(33.3% - 32px)\"\n fxFlex.lt-md=\"0 1 calc(50% - 32px)\"\n fxFlex.lt-sm=\"100%\"\n fxLayoutAlign=\"stretch\"\n >\n </repo-card>\n <div\n *ngIf=\"\n (loading | async) === false &&\n !hasRepositories(gitRepositories, gitProvider.key, 'own')\n \"\n >\n This user has not created any repositories yet\n </div>\n </div>\n </div>\n <div *ngIf=\"showForked\">\n <h2 class=\"mat-headline\">Forked Repos</h2>\n <div\n fxLayout=\"row wrap\"\n fxLayout.lt-sm=\"column\"\n fxLayoutAlign=\"flex-start\"\n >\n <div *ngIf=\"(loading | async) === true\">\n <mat-spinner></mat-spinner>\n </div>\n <repo-card\n *ngFor=\"\n let gitRepo of getForkedGitRepositories(\n gitRepositories,\n gitProvider.key\n )\n \"\n [backgroundColor]=\"backgroundColor\"\n [backdropFilter]=\"backdropFilter\"\n [buttonColor]=\"buttonColor\"\n [cardColor]=\"cardColor\"\n [gitRepo]=\"gitRepo\"\n [isCopied]=\"isCopiedToClipboard(gitRepo)\"\n (copiedToClipboardEvent)=\"copyToClipboard(gitRepo)\"\n class=\"repository-card\"\n fxFlex=\"0 1 calc(33.3% - 32px)\"\n fxFlex.lt-md=\"0 1 calc(50% - 32px)\"\n fxFlex.lt-sm=\"100%\"\n fxLayoutAlign=\"stretch\"\n ></repo-card>\n <div\n *ngIf=\"\n (loading | async) === false &&\n !hasRepositories(gitRepositories, gitProvider.key, 'forked')\n \"\n >\n This user has not forked any repositories yet\n </div>\n </div>\n </div>\n </div>\n</div>\n", styles: [".repository-card{max-width:450px;margin:0 32px 32px 0}\n"], components: [{ type: i2$1.MatSpinner, selector: "mat-spinner", inputs: ["color"] }, { type: RepoCardComponent, selector: "repo-card", inputs: ["backgroundColor", "backdropFilter", "buttonColor", "cardColor", "gitRepo", "isCopied"], outputs: ["copiedToClipboardEvent"] }], directives: [{ type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i4.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i5.DefaultLayoutDirective, selector: " [fxLayout], [fxLayout.xs], [fxLayout.sm], [fxLayout.md], [fxLayout.lg], [fxLayout.xl], [fxLayout.lt-sm], [fxLayout.lt-md], [fxLayout.lt-lg], [fxLayout.lt-xl], [fxLayout.gt-xs], [fxLayout.gt-sm], [fxLayout.gt-md], [fxLayout.gt-lg]", inputs: ["fxLayout", "fxLayout.xs", "fxLayout.sm", "fxLayout.md", "fxLayout.lg", "fxLayout.xl", "fxLayout.lt-sm", "fxLayout.lt-md", "fxLayout.lt-lg", "fxLayout.lt-xl", "fxLayout.gt-xs", "fxLayout.gt-sm", "fxLayout.gt-md", "fxLayout.gt-lg"] }, { type: i5.DefaultLayoutAlignDirective, selector: " [fxLayoutAlign], [fxLayoutAlign.xs], [fxLayoutAlign.sm], [fxLayoutAlign.md], [fxLayoutAlign.lg], [fxLayoutAlign.xl], [fxLayoutAlign.lt-sm], [fxLayoutAlign.lt-md], [fxLayoutAlign.lt-lg], [fxLayoutAlign.lt-xl], [fxLayoutAlign.gt-xs], [fxLayoutAlign.gt-sm], [fxLayoutAlign.gt-md], [fxLayoutAlign.gt-lg]", inputs: ["fxLayoutAlign", "fxLayoutAlign.xs", "fxLayoutAlign.sm", "fxLayoutAlign.md", "fxLayoutAlign.lg", "fxLayoutAlign.xl", "fxLayoutAlign.lt-sm", "fxLayoutAlign.lt-md", "fxLayoutAlign.lt-lg", "fxLayoutAlign.lt-xl", "fxLayoutAlign.gt-xs", "fxLayoutAlign.gt-sm", "fxLayoutAlign.gt-md", "fxLayoutAlign.gt-lg"] }, { type: i5.DefaultFlexDirective, selector: " [fxFlex], [fxFlex.xs], [fxFlex.sm], [fxFlex.md], [fxFlex.lg], [fxFlex.xl], [fxFlex.lt-sm], [fxFlex.lt-md], [fxFlex.lt-lg], [fxFlex.lt-xl], [fxFlex.gt-xs], [fxFlex.gt-sm], [fxFlex.gt-md], [fxFlex.gt-lg]", inputs: ["fxFlex", "fxFlex.xs", "fxFlex.sm", "fxFlex.md", "fxFlex.lg", "fxFlex.xl", "fxFlex.lt-sm", "fxFlex.lt-md", "fxFlex.lt-lg", "fxFlex.lt-xl", "fxFlex.gt-xs", "fxFlex.gt-sm", "fxFlex.gt-md", "fxFlex.gt-lg"] }], pipes: { "async": i4.AsyncPipe, "keyvalue": i4.KeyValuePipe } });
285
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.11", ngImport: i0, type: GitPortfolioComponent, decorators: [{
286
+ type: Component,
287
+ args: [{
288
+ // eslint-disable-next-line @angular-eslint/component-selector
289
+ selector: 'git-portfolio',
290
+ templateUrl: './git-portfolio.component.html',
291
+ styleUrls: ['./git-portfolio.component.scss']
292
+ }]
293
+ }], ctorParameters: function () { return [{ type: GitProviderService }]; }, propDecorators: { backgroundColor: [{
294
+ type: Input
295
+ }], backdropFilter: [{
296
+ type: Input
297
+ }], buttonColor: [{
298
+ type: Input
299
+ }], cardColor: [{
300
+ type: Input
301
+ }], gitProviderConfig: [{
302
+ type: Input
303
+ }], showForked: [{
304
+ type: Input
305
+ }], showOwn: [{
306
+ type: Input
307
+ }] } });
308
+
309
+ class GitPortfolioModule {
310
+ }
311
+ GitPortfolioModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.11", ngImport: i0, type: GitPortfolioModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
312
+ GitPortfolioModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.11", ngImport: i0, type: GitPortfolioModule, declarations: [GitPortfolioComponent, RepoCardComponent, OcticonDirective], imports: [CommonModule,
313
+ BrowserModule,
314
+ BrowserAnimationsModule,
315
+ HttpClientModule,
316
+ MatCardModule,
317
+ MatButtonModule,
318
+ MatProgressSpinnerModule,
319
+ ClipboardModule,
320
+ FlexLayoutModule], exports: [GitPortfolioComponent, OcticonDirective] });
321
+ GitPortfolioModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.11", ngImport: i0, type: GitPortfolioModule, providers: [GitProviderService], imports: [[
322
+ CommonModule,
323
+ BrowserModule,
324
+ BrowserAnimationsModule,
325
+ HttpClientModule,
326
+ MatCardModule,
327
+ MatButtonModule,
328
+ MatProgressSpinnerModule,
329
+ ClipboardModule,
330
+ FlexLayoutModule
331
+ ]] });
332
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.11", ngImport: i0, type: GitPortfolioModule, decorators: [{
333
+ type: NgModule,
334
+ args: [{
335
+ declarations: [GitPortfolioComponent, RepoCardComponent, OcticonDirective],
336
+ imports: [
337
+ CommonModule,
338
+ BrowserModule,
339
+ BrowserAnimationsModule,
340
+ HttpClientModule,
341
+ MatCardModule,
342
+ MatButtonModule,
343
+ MatProgressSpinnerModule,
344
+ ClipboardModule,
345
+ FlexLayoutModule
346
+ ],
347
+ exports: [GitPortfolioComponent, OcticonDirective],
348
+ providers: [GitProviderService]
349
+ }]
350
+ }] });
351
+
352
+ /**
353
+ * Generated bundle index. Do not edit.
354
+ */
355
+
356
+ export { GitPortfolioComponent, GitPortfolioModule, OcticonDirective };
357
+ //# sourceMappingURL=tehw0lf-git-portfolio.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tehw0lf-git-portfolio.js","sources":["../../../../libs/git-portfolio/src/lib/types/git-repository-type.ts","../../../../libs/git-portfolio/src/lib/git-provider.service.ts","../../../../libs/git-portfolio/src/lib/types/git-providers-type.ts","../../../../libs/git-portfolio/src/lib/octicon.directive.ts","../../../../libs/git-portfolio/src/lib/repo-card/repo-card.component.ts","../../../../libs/git-portfolio/src/lib/repo-card/repo-card.component.html","../../../../libs/git-portfolio/src/lib/git-portfolio.component.ts","../../../../libs/git-portfolio/src/lib/git-portfolio.component.html","../../../../libs/git-portfolio/src/lib/git-portfolio.module.ts","../../../../libs/git-portfolio/src/tehw0lf-git-portfolio.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/naming-convention */\nexport class GitRepository {\n id: number | undefined;\n clone_url?: string;\n http_url_to_repo?: string;\n created_at: string | undefined;\n description: string | undefined;\n fork?: boolean;\n forks_count: number | undefined;\n html_url?: string;\n web_url?: string;\n language?: string;\n license?: {\n key: string;\n name: string;\n node_id: string;\n spdx_id: string;\n url: string;\n };\n name: string | undefined;\n open_issues_count?: number;\n owner?: {\n avatar_url: string;\n };\n namespace?: {\n avatar_url: string;\n };\n pushed_at?: string;\n last_activity_at?: string;\n stargazers_count?: number;\n star_count?: number;\n}\n","import { HttpClient } from '@angular/common/http';\nimport { Injectable } from '@angular/core';\nimport { BehaviorSubject, Observable, of, zip } from 'rxjs';\nimport { map, tap } from 'rxjs/operators';\n\nimport { GitProviderConfig } from './types/git-provider-config-type';\nimport { GitRepositories } from './types/git-repositories-type';\nimport { GitRepository } from './types/git-repository-type';\n\n@Injectable({\n providedIn: 'root'\n})\nexport class GitProviderService {\n private loadingStateSubject = new BehaviorSubject<boolean>(true);\n private repositorySubject = new BehaviorSubject<GitRepositories>({});\n\n constructor(private http: HttpClient) {}\n\n get loading(): Observable<boolean> {\n return this.loadingStateSubject.asObservable();\n }\n\n getRepositories(\n gitProviderUserNames?: GitProviderConfig\n ): Observable<GitRepositories> {\n if (\n this.repositorySubject.value.github === undefined &&\n this.repositorySubject.value.gitlab === undefined\n ) {\n this.fetchRepositories(gitProviderUserNames)\n .pipe(\n tap((repositories: GitRepositories) => {\n this.repositorySubject.next(repositories);\n this.loadingStateSubject.next(false);\n })\n )\n .subscribe();\n }\n return this.repositorySubject.asObservable();\n }\n\n fetchRepositories(\n gitProviderUserNames?: GitProviderConfig\n ): Observable<GitRepositories> {\n return zip(\n this.fetchGithubRepositories(gitProviderUserNames?.github ?? ''),\n this.fetchGitlabRepositories(gitProviderUserNames?.gitlab ?? '')\n ).pipe(\n map((gitRepositoryArray: [GitRepository[], GitRepository[]]) => {\n const repositories: GitRepositories = {\n github: this.filterAndSortGitRepositories(gitRepositoryArray[0]),\n gitlab: this.filterAndSortGitRepositories(gitRepositoryArray[1])\n };\n return repositories;\n })\n );\n }\n\n private filterAndSortGitRepositories(gitRepositoryArray: GitRepository[]): {\n own: GitRepository[];\n forked: GitRepository[];\n } {\n return {\n own: gitRepositoryArray\n .filter((gitRepository: GitRepository) => !gitRepository.fork)\n .sort(\n (repoA: GitRepository, repoB: GitRepository) =>\n (repoB.stargazers_count ?? 0) - (repoA.stargazers_count ?? 0)\n ),\n forked: gitRepositoryArray\n .filter((gitRepository: GitRepository) => gitRepository.fork)\n .sort(\n (repoA: GitRepository, repoB: GitRepository) =>\n (repoB.stargazers_count ?? 0) - (repoA.stargazers_count ?? 0)\n )\n };\n }\n\n private fetchGithubRepositories(\n githubUser: string\n ): Observable<GitRepository[]> {\n if (githubUser !== '') {\n return this.http.get<GitRepository[]>(\n `https://api.github.com/users/${githubUser}/repos`\n );\n }\n return of([new GitRepository()]);\n }\n private fetchGitlabRepositories(\n gitlabUser: string\n ): Observable<GitRepository[]> {\n if (gitlabUser !== '') {\n return this.http.get<GitRepository[]>(\n `https://gitlab.com/api/v4/users/${gitlabUser}/projects`\n );\n }\n return of([new GitRepository()]);\n }\n}\n","/* eslint-disable no-shadow */\nexport enum GitProviders {\n github = 'GitHub',\n gitlab = 'GitLab'\n}\n","import { Directive, ElementRef, Input, OnInit, Renderer2 } from '@angular/core';\n\n// eslint-disable-next-line @typescript-eslint/no-var-requires\nconst octicons = require('@primer/octicons');\n\n@Directive({\n // eslint-disable-next-line @angular-eslint/directive-selector\n selector: '[octicon]'\n})\nexport class OcticonDirective implements OnInit {\n @Input() octicon: string | undefined;\n @Input() color: string | undefined;\n @Input() width: string | undefined;\n\n constructor(private elementRef: ElementRef, private renderer: Renderer2) {}\n\n ngOnInit(): void {\n const el: HTMLElement = this.elementRef.nativeElement;\n if (this.octicon) {\n if (octicons[this.octicon] !== undefined) {\n el.innerHTML = octicons[this.octicon].toSVG();\n\n const icon: Node | null = el.firstChild;\n\n if (this.color && icon) {\n this.renderer.setStyle(icon, 'fill', this.color);\n }\n if (this.width && icon) {\n this.renderer.setStyle(icon, 'width', this.width);\n this.renderer.setStyle(icon, 'height', this.width);\n }\n } else {\n el.innerHTML = octicons['alert'].toSVG();\n this.renderer.setStyle(el.firstChild, 'fill', 'red');\n }\n }\n }\n}\n","import { Component, EventEmitter, Input, Output } from '@angular/core';\n\nimport { GitRepository } from '../types/git-repository-type';\n\n// eslint-disable-next-line @typescript-eslint/no-var-requires\nconst githubLanguageColors = require('github-language-colors/colors.json');\n\n@Component({\n // eslint-disable-next-line @angular-eslint/component-selector\n selector: 'repo-card',\n templateUrl: './repo-card.component.html',\n styleUrls: ['./repo-card.component.scss']\n})\nexport class RepoCardComponent {\n @Input() backgroundColor!: string;\n @Input() backdropFilter!: string;\n @Input() buttonColor!: string;\n @Input() cardColor!: string;\n\n @Input()\n gitRepo!: GitRepository;\n\n @Input()\n public isCopied = false;\n\n @Output()\n public copiedToClipboardEvent: EventEmitter<boolean> = new EventEmitter<boolean>();\n\n public githubLanguageColors = githubLanguageColors;\n\n constructor() {\n //\n }\n copiedToClipboard(): void {\n this.copiedToClipboardEvent.emit();\n }\n}\n","<mat-card\n [ngStyle]=\"{\n color: cardColor,\n 'background-color': backgroundColor,\n 'backdrop-filter': backdropFilter\n }\"\n>\n <mat-card-header>\n <div\n mat-card-avatar\n [ngStyle]=\"{\n 'background-image':\n 'url(' +\n (gitRepo.owner?.avatar_url || gitRepo.namespace?.avatar_url) +\n ')',\n 'background-size': 'cover',\n 'border-radius': 0\n }\"\n ></div>\n <mat-card-title\n ><a\n mat-button\n [ngStyle]=\"{ color: buttonColor }\"\n target=\"_blank\"\n href=\"{{ gitRepo.html_url || gitRepo.web_url }}\"\n >\n {{ gitRepo.name }}\n </a>\n </mat-card-title>\n <mat-card-subtitle fxLayout=\"row\" fxLayoutGap=\"12px\">\n <div class=\"info-item\" fxLayout=\"row\" fxLayoutGap=\"5px\">\n <div\n [ngStyle]=\"{\n 'background-color':\n gitRepo.language !== undefined\n ? githubLanguageColors[gitRepo.language]\n : 'transparent'\n }\"\n class=\"language-icon\"\n ></div>\n <div>{{ gitRepo.language }}</div>\n </div>\n <div class=\"info-item\" fxLayout=\"row\" fxLayoutGap=\"5px\">\n <div octicon=\"star\" color=\"gold\"></div>\n <div>{{ gitRepo.stargazers_count || gitRepo.star_count || 0 }}</div>\n </div>\n <div class=\"info-item\" fxLayout=\"row\" fxLayoutGap=\"5px\">\n <div octicon=\"repo-forked\" color=\"#437da8\"></div>\n <div>{{ gitRepo.forks_count }}</div>\n </div>\n <div\n *ngIf=\"gitRepo.open_issues_count\"\n class=\"info-item\"\n fxLayout=\"row\"\n fxLayoutGap=\"5px\"\n >\n <div octicon=\"issue-opened\" color=\"rgb(56, 224, 56)\"></div>\n <div>{{ gitRepo.open_issues_count }}</div>\n </div>\n </mat-card-subtitle>\n </mat-card-header>\n <mat-card-content>\n <p>{{ gitRepo.description }}</p>\n </mat-card-content>\n <mat-card-footer fxLayout=\"row\" fxLayoutGap=\"12px\">\n <span class=\"mat-footer-cell\" fxFlex>\n <span class=\"footer-span\" [ngStyle]=\"{ color: cardColor }\"\n >Created: {{ gitRepo.created_at | date }}</span\n >\n <span class=\"footer-span\" [ngStyle]=\"{ color: cardColor }\"\n >Updated:\n {{ gitRepo.pushed_at || gitRepo.last_activity_at | date }}</span\n >\n </span>\n <span class=\"mat-footer-cell\">\n <button\n [ngStyle]=\"{ color: buttonColor }\"\n mat-button\n [cdkCopyToClipboard]=\"\n gitRepo.clone_url || gitRepo.http_url_to_repo || ''\n \"\n (cdkCopyToClipboardCopied)=\"copiedToClipboard()\"\n class=\"clipboard-button\"\n >\n <span class=\"mat-button-wrapper\" fxLayout=\"row\" fxLayoutGap=\"5px\">\n <div\n *ngIf=\"isCopied\"\n octicon=\"check\"\n color=\"#38e038\"\n width=\"24\"\n ></div>\n <div octicon=\"paste\" color=\"#cc7832\" width=\"24px\"></div>\n <span>Copy URL</span>\n </span>\n </button>\n </span>\n </mat-card-footer>\n</mat-card>\n","import { Component, Input, OnDestroy, OnInit } from '@angular/core';\nimport { Observable, Subject } from 'rxjs';\nimport { takeUntil } from 'rxjs/operators';\n\nimport { GitProviderService } from './git-provider.service';\nimport { GitProviderConfig } from './types/git-provider-config-type';\nimport { GitProviders } from './types/git-providers-type';\nimport { GitRepositories } from './types/git-repositories-type';\nimport { GitRepository } from './types/git-repository-type';\n\n@Component({\n // eslint-disable-next-line @angular-eslint/component-selector\n selector: 'git-portfolio',\n templateUrl: './git-portfolio.component.html',\n styleUrls: ['./git-portfolio.component.scss']\n})\nexport class GitPortfolioComponent implements OnInit, OnDestroy {\n @Input()\n backgroundColor = 'rgba(34, 34, 34, 0.75)';\n\n @Input()\n backdropFilter = 'blur(50px)';\n\n @Input()\n buttonColor = '#cc7832';\n\n @Input()\n cardColor = 'lightgray';\n\n @Input()\n gitProviderConfig: GitProviderConfig = { github: '', gitlab: '' };\n\n @Input()\n showForked = true;\n\n @Input()\n showOwn = true;\n\n loading: Observable<boolean>;\n gitProviders = GitProviders;\n currentRepo: GitRepository | undefined;\n gitRepositories$: Observable<GitRepositories> | undefined;\n private unsubscribe$ = new Subject<void>();\n\n constructor(private gitProviderService: GitProviderService) {\n this.loading = this.gitProviderService.loading;\n }\n\n ngOnInit(): void {\n this.getRepositories();\n }\n\n ngOnDestroy(): void {\n this.unsubscribe$.next();\n this.unsubscribe$.complete();\n }\n\n copyToClipboard(githubRepo: GitRepository): void {\n this.currentRepo = githubRepo;\n }\n\n isCopiedToClipboard(githubRepo: GitRepository): boolean {\n if (!this.currentRepo) {\n return false;\n }\n return this.currentRepo.id === githubRepo.id ? true : false;\n }\n\n getRepositories(): void {\n this.gitRepositories$ = this.gitProviderService\n .getRepositories(this.gitProviderConfig)\n .pipe(takeUntil(this.unsubscribe$));\n }\n\n getOwnGitRepositories(\n gitRepositories: GitRepositories,\n gitProvider: string\n ): GitRepository[] {\n if (gitRepositories) {\n switch (gitProvider) {\n case 'github':\n if (gitRepositories.github) {\n return gitRepositories.github.own;\n } else {\n return [];\n }\n\n case 'gitlab':\n if (gitRepositories.gitlab) {\n return gitRepositories.gitlab.own;\n } else {\n return [];\n }\n\n default:\n return [];\n }\n } else {\n return [];\n }\n }\n\n getForkedGitRepositories(\n gitRepositories: GitRepositories,\n gitProvider: string\n ): GitRepository[] {\n if (gitRepositories) {\n switch (gitProvider) {\n case 'github':\n if (gitRepositories.github) {\n return gitRepositories.github.forked;\n } else {\n return [];\n }\n\n case 'gitlab':\n if (gitRepositories.gitlab) {\n return gitRepositories.gitlab.forked;\n } else {\n return [];\n }\n\n default:\n return [];\n }\n } else {\n return [];\n }\n }\n\n hasRepositories(\n gitRepositories: GitRepositories,\n gitProvider: string,\n type: 'own' | 'forked'\n ): boolean {\n if (gitRepositories) {\n switch (gitProvider) {\n case 'github':\n if (gitRepositories.github) {\n return gitRepositories.github[type].length > 0;\n }\n break;\n\n case 'gitlab':\n if (gitRepositories.gitlab) {\n return gitRepositories.gitlab[type].length > 0;\n }\n break;\n }\n }\n return false;\n }\n}\n","<div *ngIf=\"gitRepositories$ | async as gitRepositories\">\n <div *ngFor=\"let gitProvider of gitProviders | keyvalue\">\n <h1>{{ gitProvider.value }}</h1>\n <div *ngIf=\"showOwn\">\n <h2 class=\"mat-headline\">Own Repos</h2>\n <div\n fxLayout=\"row wrap\"\n fxLayout.lt-sm=\"column\"\n fxLayoutAlign=\"flex-start\"\n >\n <div *ngIf=\"(loading | async) === true\">\n <mat-spinner></mat-spinner>\n </div>\n <repo-card\n *ngFor=\"\n let gitRepo of getOwnGitRepositories(\n gitRepositories,\n gitProvider.key\n )\n \"\n [backgroundColor]=\"backgroundColor\"\n [backdropFilter]=\"backdropFilter\"\n [buttonColor]=\"buttonColor\"\n [cardColor]=\"cardColor\"\n [gitRepo]=\"gitRepo\"\n [isCopied]=\"isCopiedToClipboard(gitRepo)\"\n (copiedToClipboardEvent)=\"copyToClipboard(gitRepo)\"\n class=\"repository-card\"\n fxFlex=\"0 1 calc(33.3% - 32px)\"\n fxFlex.lt-md=\"0 1 calc(50% - 32px)\"\n fxFlex.lt-sm=\"100%\"\n fxLayoutAlign=\"stretch\"\n >\n </repo-card>\n <div\n *ngIf=\"\n (loading | async) === false &&\n !hasRepositories(gitRepositories, gitProvider.key, 'own')\n \"\n >\n This user has not created any repositories yet\n </div>\n </div>\n </div>\n <div *ngIf=\"showForked\">\n <h2 class=\"mat-headline\">Forked Repos</h2>\n <div\n fxLayout=\"row wrap\"\n fxLayout.lt-sm=\"column\"\n fxLayoutAlign=\"flex-start\"\n >\n <div *ngIf=\"(loading | async) === true\">\n <mat-spinner></mat-spinner>\n </div>\n <repo-card\n *ngFor=\"\n let gitRepo of getForkedGitRepositories(\n gitRepositories,\n gitProvider.key\n )\n \"\n [backgroundColor]=\"backgroundColor\"\n [backdropFilter]=\"backdropFilter\"\n [buttonColor]=\"buttonColor\"\n [cardColor]=\"cardColor\"\n [gitRepo]=\"gitRepo\"\n [isCopied]=\"isCopiedToClipboard(gitRepo)\"\n (copiedToClipboardEvent)=\"copyToClipboard(gitRepo)\"\n class=\"repository-card\"\n fxFlex=\"0 1 calc(33.3% - 32px)\"\n fxFlex.lt-md=\"0 1 calc(50% - 32px)\"\n fxFlex.lt-sm=\"100%\"\n fxLayoutAlign=\"stretch\"\n ></repo-card>\n <div\n *ngIf=\"\n (loading | async) === false &&\n !hasRepositories(gitRepositories, gitProvider.key, 'forked')\n \"\n >\n This user has not forked any repositories yet\n </div>\n </div>\n </div>\n </div>\n</div>\n","import { ClipboardModule } from '@angular/cdk/clipboard';\nimport { CommonModule } from '@angular/common';\nimport { HttpClientModule } from '@angular/common/http';\nimport { NgModule } from '@angular/core';\nimport { FlexLayoutModule } from '@angular/flex-layout';\nimport { MatButtonModule } from '@angular/material/button';\nimport { MatCardModule } from '@angular/material/card';\nimport { MatProgressSpinnerModule } from '@angular/material/progress-spinner';\nimport { BrowserModule } from '@angular/platform-browser';\nimport { BrowserAnimationsModule } from '@angular/platform-browser/animations';\n\nimport { GitPortfolioComponent } from './git-portfolio.component';\nimport { GitProviderService } from './git-provider.service';\nimport { OcticonDirective } from './octicon.directive';\nimport { RepoCardComponent } from './repo-card/repo-card.component';\n\n@NgModule({\n declarations: [GitPortfolioComponent, RepoCardComponent, OcticonDirective],\n imports: [\n CommonModule,\n BrowserModule,\n BrowserAnimationsModule,\n HttpClientModule,\n MatCardModule,\n MatButtonModule,\n MatProgressSpinnerModule,\n ClipboardModule,\n FlexLayoutModule\n ],\n exports: [GitPortfolioComponent, OcticonDirective],\n providers: [GitProviderService]\n})\nexport class GitPortfolioModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA;MACa,aAAa;;;MCWb,kBAAkB;IAI7B,YAAoB,IAAgB;QAAhB,SAAI,GAAJ,IAAI,CAAY;QAH5B,wBAAmB,GAAG,IAAI,eAAe,CAAU,IAAI,CAAC,CAAC;QACzD,sBAAiB,GAAG,IAAI,eAAe,CAAkB,EAAE,CAAC,CAAC;KAE7B;IAExC,IAAI,OAAO;QACT,OAAO,IAAI,CAAC,mBAAmB,CAAC,YAAY,EAAE,CAAC;KAChD;IAED,eAAe,CACb,oBAAwC;QAExC,IACE,IAAI,CAAC,iBAAiB,CAAC,KAAK,CAAC,MAAM,KAAK,SAAS;YACjD,IAAI,CAAC,iBAAiB,CAAC,KAAK,CAAC,MAAM,KAAK,SAAS,EACjD;YACA,IAAI,CAAC,i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SACjB;4FAIU,kBAAkB;kBAhB9B,QAAQ;mBAAC;oBACR,YAAY,EAAE,CAAC,qBAAqB,EAAE,iBAAiB,EAAE,gBAAgB,CAAC;oBAC1E,OAAO,EAAE;wBACP,YAAY;wBACZ,aAAa;wBACb,uBAAuB;wBACvB,gBAAgB;wBAChB,aAAa;wBACb,eAAe;wBACf,wBAAwB;wBACxB,eAAe;wBACf,gBAAgB;qBACjB;oBACD,OAAO,EAAE,CAAC,qBAAqB,EAAE,gBAAgB,CAAC;oBAClD,SAAS,EAAE,CAAC,kBAAkB,CAAC;iBAChC;;;AC/BD;;;;;;"}
package/index.d.ts ADDED
@@ -0,0 +1,3 @@
1
+ export * from './lib/git-portfolio.component';
2
+ export * from './lib/git-portfolio.module';
3
+ export * from './lib/octicon.directive';
@@ -0,0 +1,34 @@
1
+ import { OnDestroy, OnInit } from '@angular/core';
2
+ import { Observable } from 'rxjs';
3
+ import { GitProviderService } from './git-provider.service';
4
+ import { GitProviderConfig } from './types/git-provider-config-type';
5
+ import { GitProviders } from './types/git-providers-type';
6
+ import { GitRepositories } from './types/git-repositories-type';
7
+ import { GitRepository } from './types/git-repository-type';
8
+ import * as i0 from "@angular/core";
9
+ export declare class GitPortfolioComponent implements OnInit, OnDestroy {
10
+ private gitProviderService;
11
+ backgroundColor: string;
12
+ backdropFilter: string;
13
+ buttonColor: string;
14
+ cardColor: string;
15
+ gitProviderConfig: GitProviderConfig;
16
+ showForked: boolean;
17
+ showOwn: boolean;
18
+ loading: Observable<boolean>;
19
+ gitProviders: typeof GitProviders;
20
+ currentRepo: GitRepository | undefined;
21
+ gitRepositories$: Observable<GitRepositories> | undefined;
22
+ private unsubscribe$;
23
+ constructor(gitProviderService: GitProviderService);
24
+ ngOnInit(): void;
25
+ ngOnDestroy(): void;
26
+ copyToClipboard(githubRepo: GitRepository): void;
27
+ isCopiedToClipboard(githubRepo: GitRepository): boolean;
28
+ getRepositories(): void;
29
+ getOwnGitRepositories(gitRepositories: GitRepositories, gitProvider: string): GitRepository[];
30
+ getForkedGitRepositories(gitRepositories: GitRepositories, gitProvider: string): GitRepository[];
31
+ hasRepositories(gitRepositories: GitRepositories, gitProvider: string, type: 'own' | 'forked'): boolean;
32
+ static ɵfac: i0.ɵɵFactoryDeclaration<GitPortfolioComponent, never>;
33
+ static ɵcmp: i0.ɵɵComponentDeclaration<GitPortfolioComponent, "git-portfolio", never, { "backgroundColor": "backgroundColor"; "backdropFilter": "backdropFilter"; "buttonColor": "buttonColor"; "cardColor": "cardColor"; "gitProviderConfig": "gitProviderConfig"; "showForked": "showForked"; "showOwn": "showOwn"; }, {}, never, never>;
34
+ }
@@ -0,0 +1,18 @@
1
+ import * as i0 from "@angular/core";
2
+ import * as i1 from "./git-portfolio.component";
3
+ import * as i2 from "./repo-card/repo-card.component";
4
+ import * as i3 from "./octicon.directive";
5
+ import * as i4 from "@angular/common";
6
+ import * as i5 from "@angular/platform-browser";
7
+ import * as i6 from "@angular/platform-browser/animations";
8
+ import * as i7 from "@angular/common/http";
9
+ import * as i8 from "@angular/material/card";
10
+ import * as i9 from "@angular/material/button";
11
+ import * as i10 from "@angular/material/progress-spinner";
12
+ import * as i11 from "@angular/cdk/clipboard";
13
+ import * as i12 from "@angular/flex-layout";
14
+ export declare class GitPortfolioModule {
15
+ static ɵfac: i0.ɵɵFactoryDeclaration<GitPortfolioModule, never>;
16
+ static ɵmod: i0.ɵɵNgModuleDeclaration<GitPortfolioModule, [typeof i1.GitPortfolioComponent, typeof i2.RepoCardComponent, typeof i3.OcticonDirective], [typeof i4.CommonModule, typeof i5.BrowserModule, typeof i6.BrowserAnimationsModule, typeof i7.HttpClientModule, typeof i8.MatCardModule, typeof i9.MatButtonModule, typeof i10.MatProgressSpinnerModule, typeof i11.ClipboardModule, typeof i12.FlexLayoutModule], [typeof i1.GitPortfolioComponent, typeof i3.OcticonDirective]>;
17
+ static ɵinj: i0.ɵɵInjectorDeclaration<GitPortfolioModule>;
18
+ }
@@ -0,0 +1,19 @@
1
+ import { HttpClient } from '@angular/common/http';
2
+ import { Observable } from 'rxjs';
3
+ import { GitProviderConfig } from './types/git-provider-config-type';
4
+ import { GitRepositories } from './types/git-repositories-type';
5
+ import * as i0 from "@angular/core";
6
+ export declare class GitProviderService {
7
+ private http;
8
+ private loadingStateSubject;
9
+ private repositorySubject;
10
+ constructor(http: HttpClient);
11
+ get loading(): Observable<boolean>;
12
+ getRepositories(gitProviderUserNames?: GitProviderConfig): Observable<GitRepositories>;
13
+ fetchRepositories(gitProviderUserNames?: GitProviderConfig): Observable<GitRepositories>;
14
+ private filterAndSortGitRepositories;
15
+ private fetchGithubRepositories;
16
+ private fetchGitlabRepositories;
17
+ static ɵfac: i0.ɵɵFactoryDeclaration<GitProviderService, never>;
18
+ static ɵprov: i0.ɵɵInjectableDeclaration<GitProviderService>;
19
+ }
@@ -0,0 +1,13 @@
1
+ import { ElementRef, OnInit, Renderer2 } from '@angular/core';
2
+ import * as i0 from "@angular/core";
3
+ export declare class OcticonDirective implements OnInit {
4
+ private elementRef;
5
+ private renderer;
6
+ octicon: string | undefined;
7
+ color: string | undefined;
8
+ width: string | undefined;
9
+ constructor(elementRef: ElementRef, renderer: Renderer2);
10
+ ngOnInit(): void;
11
+ static ɵfac: i0.ɵɵFactoryDeclaration<OcticonDirective, never>;
12
+ static ɵdir: i0.ɵɵDirectiveDeclaration<OcticonDirective, "[octicon]", never, { "octicon": "octicon"; "color": "color"; "width": "width"; }, {}, never>;
13
+ }
@@ -0,0 +1,17 @@
1
+ import { EventEmitter } from '@angular/core';
2
+ import { GitRepository } from '../types/git-repository-type';
3
+ import * as i0 from "@angular/core";
4
+ export declare class RepoCardComponent {
5
+ backgroundColor: string;
6
+ backdropFilter: string;
7
+ buttonColor: string;
8
+ cardColor: string;
9
+ gitRepo: GitRepository;
10
+ isCopied: boolean;
11
+ copiedToClipboardEvent: EventEmitter<boolean>;
12
+ githubLanguageColors: any;
13
+ constructor();
14
+ copiedToClipboard(): void;
15
+ static ɵfac: i0.ɵɵFactoryDeclaration<RepoCardComponent, never>;
16
+ static ɵcmp: i0.ɵɵComponentDeclaration<RepoCardComponent, "repo-card", never, { "backgroundColor": "backgroundColor"; "backdropFilter": "backdropFilter"; "buttonColor": "buttonColor"; "cardColor": "cardColor"; "gitRepo": "gitRepo"; "isCopied": "isCopied"; }, { "copiedToClipboardEvent": "copiedToClipboardEvent"; }, never, never>;
17
+ }
@@ -0,0 +1,4 @@
1
+ export interface GitProviderConfig {
2
+ github?: string;
3
+ gitlab?: string;
4
+ }
@@ -0,0 +1,4 @@
1
+ export declare enum GitProviders {
2
+ github = "GitHub",
3
+ gitlab = "GitLab"
4
+ }
@@ -0,0 +1,11 @@
1
+ import { GitRepository } from './git-repository-type';
2
+ export interface GitRepositories {
3
+ github?: {
4
+ own: GitRepository[];
5
+ forked: GitRepository[];
6
+ };
7
+ gitlab?: {
8
+ own: GitRepository[];
9
+ forked: GitRepository[];
10
+ };
11
+ }
@@ -0,0 +1,31 @@
1
+ export declare class GitRepository {
2
+ id: number | undefined;
3
+ clone_url?: string;
4
+ http_url_to_repo?: string;
5
+ created_at: string | undefined;
6
+ description: string | undefined;
7
+ fork?: boolean;
8
+ forks_count: number | undefined;
9
+ html_url?: string;
10
+ web_url?: string;
11
+ language?: string;
12
+ license?: {
13
+ key: string;
14
+ name: string;
15
+ node_id: string;
16
+ spdx_id: string;
17
+ url: string;
18
+ };
19
+ name: string | undefined;
20
+ open_issues_count?: number;
21
+ owner?: {
22
+ avatar_url: string;
23
+ };
24
+ namespace?: {
25
+ avatar_url: string;
26
+ };
27
+ pushed_at?: string;
28
+ last_activity_at?: string;
29
+ stargazers_count?: number;
30
+ star_count?: number;
31
+ }