ng-github-button
Advanced tools
| import * as _angular_core from '@angular/core'; | ||
| import { Observable } from 'rxjs'; | ||
| type GithubButtonType = 'stargazers' | 'subscribers' | 'forks'; | ||
| type GithubButtonSize = 'default' | 'large'; | ||
| declare class GithubButtonComponent { | ||
| private readonly srv; | ||
| readonly typeToLabel: { | ||
| stargazers: string; | ||
| subscribers: string; | ||
| forks: string; | ||
| }; | ||
| private readonly typeToPath; | ||
| readonly type: _angular_core.InputSignal<GithubButtonType>; | ||
| readonly size: _angular_core.InputSignal<GithubButtonSize>; | ||
| readonly namespace: _angular_core.InputSignal<string>; | ||
| readonly repo: _angular_core.InputSignal<string>; | ||
| readonly showZero: _angular_core.InputSignalWithTransform<boolean, unknown>; | ||
| protected repo_url: _angular_core.Signal<string>; | ||
| protected count_url: _angular_core.Signal<string>; | ||
| private _data; | ||
| protected count: _angular_core.Signal<any>; | ||
| constructor(); | ||
| static ɵfac: _angular_core.ɵɵFactoryDeclaration<GithubButtonComponent, never>; | ||
| static ɵcmp: _angular_core.ɵɵComponentDeclaration<GithubButtonComponent, "github-button", never, { "type": { "alias": "type"; "required": false; "isSignal": true; }; "size": { "alias": "size"; "required": false; "isSignal": true; }; "namespace": { "alias": "namespace"; "required": true; "isSignal": true; }; "repo": { "alias": "repo"; "required": true; "isSignal": true; }; "showZero": { "alias": "showZero"; "required": false; "isSignal": true; }; }, {}, never, ["*"], true, never>; | ||
| } | ||
| declare class GithubButtonService { | ||
| private http; | ||
| private cached; | ||
| private _notify; | ||
| get notify(): Observable<Record<string, any>>; | ||
| req(namespace: string, repo: string): void; | ||
| static ɵfac: _angular_core.ɵɵFactoryDeclaration<GithubButtonService, never>; | ||
| static ɵprov: _angular_core.ɵɵInjectableDeclaration<GithubButtonService>; | ||
| } | ||
| export { GithubButtonComponent, GithubButtonService }; | ||
| export type { GithubButtonSize, GithubButtonType }; |
| import * as i0 from '@angular/core'; | ||
| import { inject, Injectable, input, booleanAttribute, computed, signal, afterNextRender, effect, ChangeDetectionStrategy, ViewEncapsulation, Component, NgModule } from '@angular/core'; | ||
| import { BehaviorSubject } from 'rxjs'; | ||
| import { inject, Injectable, input, booleanAttribute, computed, signal, effect, ChangeDetectionStrategy, ViewEncapsulation, Component } from '@angular/core'; | ||
| import { Subject } from 'rxjs'; | ||
| import { HttpClient } from '@angular/common/http'; | ||
| import { toObservable, takeUntilDestroyed } from '@angular/core/rxjs-interop'; | ||
| class GithubButtonService { | ||
| constructor() { | ||
| this.http = inject(HttpClient); | ||
| this.cached = {}; | ||
| this._notify = new BehaviorSubject(null); | ||
| } | ||
| http = inject(HttpClient); | ||
| cached = {}; | ||
| _notify = new Subject(); | ||
| get notify() { | ||
@@ -27,6 +26,6 @@ return this._notify.asObservable(); | ||
| } | ||
| static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.2", ngImport: i0, type: GithubButtonService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); } | ||
| static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.0.2", ngImport: i0, type: GithubButtonService, providedIn: 'root' }); } | ||
| static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.1", ngImport: i0, type: GithubButtonService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); | ||
| static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.0.1", ngImport: i0, type: GithubButtonService, providedIn: 'root' }); | ||
| } | ||
| i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.2", ngImport: i0, type: GithubButtonService, decorators: [{ | ||
| i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.1", ngImport: i0, type: GithubButtonService, decorators: [{ | ||
| type: Injectable, | ||
@@ -38,28 +37,30 @@ args: [{ providedIn: 'root' }] | ||
| class GithubButtonComponent { | ||
| srv = inject(GithubButtonService); | ||
| typeToLabel = { | ||
| stargazers: 'Star', | ||
| subscribers: 'Watch', | ||
| forks: 'Fork', | ||
| }; | ||
| typeToPath = { | ||
| forks: 'network', | ||
| }; | ||
| type = input('stargazers', { ...(ngDevMode ? { debugName: "type" } : {}) }); | ||
| size = input('default', { ...(ngDevMode ? { debugName: "size" } : {}) }); | ||
| namespace = input.required({ ...(ngDevMode ? { debugName: "namespace" } : {}) }); | ||
| repo = input.required({ ...(ngDevMode ? { debugName: "repo" } : {}) }); | ||
| showZero = input(false, { ...(ngDevMode ? { debugName: "showZero" } : {}), transform: booleanAttribute }); | ||
| repo_url = computed(() => `//github.com/${this.namespace()}/${this.repo()}/`, { ...(ngDevMode ? { debugName: "repo_url" } : {}) }); | ||
| count_url = computed(() => { | ||
| const repo_url = this.repo_url(); | ||
| const type = this.type(); | ||
| return `${repo_url}${this.typeToPath[type] || type}/`; | ||
| }, { ...(ngDevMode ? { debugName: "count_url" } : {}) }); | ||
| _data = signal(null, { ...(ngDevMode ? { debugName: "_data" } : {}) }); | ||
| count = computed(() => this._data()?.[`${this.type()}_count`] ?? 0, { ...(ngDevMode ? { debugName: "count" } : {}) }); | ||
| constructor() { | ||
| this.srv = inject(GithubButtonService); | ||
| this.typeToLabel = { | ||
| stargazers: 'Star', | ||
| subscribers: 'Watch', | ||
| forks: 'Fork', | ||
| }; | ||
| this.typeToPath = { | ||
| forks: 'network', | ||
| }; | ||
| this.type = input('stargazers'); | ||
| this.size = input('default'); | ||
| this.namespace = input.required(); | ||
| this.repo = input.required(); | ||
| this.showZero = input(false, { transform: booleanAttribute }); | ||
| this.repo_url = computed(() => `//github.com/${this.namespace()}/${this.repo()}/`); | ||
| this.count_url = computed(() => { | ||
| const repo_url = this.repo_url(); | ||
| const type = this.type(); | ||
| return `${repo_url}${this.typeToPath[type] || type}/`; | ||
| toObservable(this.type).pipe(takeUntilDestroyed()).subscribe((res) => { | ||
| console.log('type changed:', res); | ||
| }); | ||
| this.count = signal(0); | ||
| afterNextRender(() => { | ||
| this.srv.notify.subscribe(res => { | ||
| this.count.set(res ? res[`${this.type()}_count`] : 0); | ||
| }); | ||
| this.srv.notify.pipe(takeUntilDestroyed()).subscribe(res => { | ||
| this._data.set(res); | ||
| }); | ||
@@ -69,3 +70,2 @@ effect(() => { | ||
| const repo = this.repo(); | ||
| this.type(); | ||
| if (isSSR) | ||
@@ -76,4 +76,4 @@ return; | ||
| } | ||
| static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.2", ngImport: i0, type: GithubButtonComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); } | ||
| static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "20.0.2", type: GithubButtonComponent, isStandalone: true, selector: "github-button", inputs: { type: { classPropertyName: "type", publicName: "type", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, namespace: { classPropertyName: "namespace", publicName: "namespace", isSignal: true, isRequired: true, transformFunction: null }, repo: { classPropertyName: "repo", publicName: "repo", isSignal: true, isRequired: true, transformFunction: null }, showZero: { classPropertyName: "showZero", publicName: "showZero", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class.github-btn-large": "size() === 'large'" } }, ngImport: i0, template: ` | ||
| static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.1", ngImport: i0, type: GithubButtonComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); | ||
| static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.0.1", type: GithubButtonComponent, isStandalone: true, selector: "github-button", inputs: { type: { classPropertyName: "type", publicName: "type", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, namespace: { classPropertyName: "namespace", publicName: "namespace", isSignal: true, isRequired: true, transformFunction: null }, repo: { classPropertyName: "repo", publicName: "repo", isSignal: true, isRequired: true, transformFunction: null }, showZero: { classPropertyName: "showZero", publicName: "showZero", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class.github-btn-large": "size() === 'large'" } }, ngImport: i0, template: ` | ||
| <a class="gh-btn" [attr.href]="repo_url()" target="_blank"> | ||
@@ -87,5 +87,5 @@ <span class="gh-ico" aria-hidden="true"></span> | ||
| <ng-content /> | ||
| `, isInline: true, styles: [":host{font:700 11px/14px Helvetica Neue,Helvetica,Arial,sans-serif;height:20px;overflow:hidden}:host:after,:host:before{content:\" \";display:table}:host:after{clear:both;visibility:hidden;font-size:0;height:0}:host ::ng-deep .gh-btn,:host ::ng-deep .gh-count,:host ::ng-deep .gh-ico{float:left}:host ::ng-deep .gh-btn,:host ::ng-deep .gh-count{padding:2px 5px 2px 4px;color:#333;text-decoration:none;white-space:nowrap;cursor:pointer;border-radius:3px}:host ::ng-deep .gh-btn{background-color:#eee;background-image:linear-gradient(to bottom,#fcfcfc 0,#eee);background-repeat:no-repeat;border:1px solid #d5d5d5}:host ::ng-deep .gh-btn:hover,:host ::ng-deep .gh-btn:focus{text-decoration:none;background-color:#ddd;background-image:linear-gradient(to bottom,#eee 0,#ddd);border-color:#ccc}:host ::ng-deep .gh-btn:active{background-image:none;background-color:#dcdcdc;border-color:#b5b5b5;box-shadow:inset 0 2px 4px #00000026}:host ::ng-deep .gh-ico{width:14px;height:14px;margin-right:4px;background-image:url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB2ZXJzaW9uPSIxLjEiIGlkPSJMYXllcl8xIiB4PSIwcHgiIHk9IjBweCIgd2lkdGg9IjQwcHgiIGhlaWdodD0iNDBweCIgdmlld0JveD0iMTIgMTIgNDAgNDAiIGVuYWJsZS1iYWNrZ3JvdW5kPSJuZXcgMTIgMTIgNDAgNDAiIHhtbDpzcGFjZT0icHJlc2VydmUiPjxwYXRoIGZpbGw9IiMzMzMzMzMiIGQ9Ik0zMiAxMy40Yy0xMC41IDAtMTkgOC41LTE5IDE5YzAgOC40IDUuNSAxNS41IDEzIDE4YzEgMC4yIDEuMy0wLjQgMS4zLTAuOWMwLTAuNSAwLTEuNyAwLTMuMiBjLTUuMyAxLjEtNi40LTIuNi02LjQtMi42QzIwIDQxLjYgMTguOCA0MSAxOC44IDQxYy0xLjctMS4yIDAuMS0xLjEgMC4xLTEuMWMxLjkgMC4xIDIuOSAyIDIuOSAyYzEuNyAyLjkgNC41IDIuMSA1LjUgMS42IGMwLjItMS4yIDAuNy0yLjEgMS4yLTIuNmMtNC4yLTAuNS04LjctMi4xLTguNy05LjRjMC0yLjEgMC43LTMuNyAyLTUuMWMtMC4yLTAuNS0wLjgtMi40IDAuMi01YzAgMCAxLjYtMC41IDUuMiAyIGMxLjUtMC40IDMuMS0wLjcgNC44LTAuN2MxLjYgMCAzLjMgMC4yIDQuNyAwLjdjMy42LTIuNCA1LjItMiA1LjItMmMxIDIuNiAwLjQgNC42IDAuMiA1YzEuMiAxLjMgMiAzIDIgNS4xYzAgNy4zLTQuNSA4LjktOC43IDkuNCBjMC43IDAuNiAxLjMgMS43IDEuMyAzLjVjMCAyLjYgMCA0LjYgMCA1LjJjMCAwLjUgMC40IDEuMSAxLjMgMC45YzcuNS0yLjYgMTMtOS43IDEzLTE4LjFDNTEgMjEuOSA0Mi41IDEzLjQgMzIgMTMuNHoiLz48L3N2Zz4=);background-size:100% 100%;background-repeat:no-repeat}:host ::ng-deep .gh-count{position:relative;display:none;margin-left:4px;background-color:#fafafa;border:1px solid #d4d4d4}:host ::ng-deep .gh-count:hover,:host ::ng-deep .gh-count:focus{color:#4183c4}:host ::ng-deep .gh-count:before,:host ::ng-deep .gh-count:after{content:\"\";position:absolute;display:inline-block;width:0;height:0;border-color:transparent;border-style:solid}:host ::ng-deep .gh-count:before{top:50%;left:-3px;margin-top:-4px;border-width:4px 4px 4px 0;border-right-color:#fafafa}:host ::ng-deep .gh-count:after{top:50%;left:-4px;z-index:-1;margin-top:-5px;border-width:5px 5px 5px 0;border-right-color:#d4d4d4}:host.github-btn-large{height:30px}:host.github-btn-large ::ng-deep .gh-btn,:host.github-btn-large ::ng-deep .gh-count{padding:3px 10px 3px 8px;font-size:16px;line-height:22px;border-radius:4px}:host.github-btn-large ::ng-deep .gh-ico{width:20px;height:20px}:host.github-btn-large ::ng-deep .gh-count{margin-left:6px}:host.github-btn-large ::ng-deep .gh-count:before{left:-5px;margin-top:-6px;border-width:6px 6px 6px 0}:host.github-btn-large ::ng-deep .gh-count:after{left:-6px;margin-top:-7px;border-width:7px 7px 7px 0}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush }); } | ||
| `, isInline: true, styles: [":host{font:700 11px/14px Helvetica Neue,Helvetica,Arial,sans-serif;height:20px;overflow:hidden}:host:after,:host:before{content:\" \";display:table}:host:after{clear:both;visibility:hidden;font-size:0;height:0}:host ::ng-deep .gh-btn,:host ::ng-deep .gh-count,:host ::ng-deep .gh-ico{float:left}:host ::ng-deep .gh-btn,:host ::ng-deep .gh-count{padding:2px 5px 2px 4px;color:#333;text-decoration:none;white-space:nowrap;cursor:pointer;border-radius:3px}:host ::ng-deep .gh-btn{background-color:#eee;background-image:linear-gradient(to bottom,#fcfcfc 0,#eee);background-repeat:no-repeat;border:1px solid #d5d5d5}:host ::ng-deep .gh-btn:hover,:host ::ng-deep .gh-btn:focus{text-decoration:none;background-color:#ddd;background-image:linear-gradient(to bottom,#eee 0,#ddd);border-color:#ccc}:host ::ng-deep .gh-btn:active{background-image:none;background-color:#dcdcdc;border-color:#b5b5b5;box-shadow:inset 0 2px 4px #00000026}:host ::ng-deep .gh-ico{width:14px;height:14px;margin-right:4px;background-image:url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB2ZXJzaW9uPSIxLjEiIGlkPSJMYXllcl8xIiB4PSIwcHgiIHk9IjBweCIgd2lkdGg9IjQwcHgiIGhlaWdodD0iNDBweCIgdmlld0JveD0iMTIgMTIgNDAgNDAiIGVuYWJsZS1iYWNrZ3JvdW5kPSJuZXcgMTIgMTIgNDAgNDAiIHhtbDpzcGFjZT0icHJlc2VydmUiPjxwYXRoIGZpbGw9IiMzMzMzMzMiIGQ9Ik0zMiAxMy40Yy0xMC41IDAtMTkgOC41LTE5IDE5YzAgOC40IDUuNSAxNS41IDEzIDE4YzEgMC4yIDEuMy0wLjQgMS4zLTAuOWMwLTAuNSAwLTEuNyAwLTMuMiBjLTUuMyAxLjEtNi40LTIuNi02LjQtMi42QzIwIDQxLjYgMTguOCA0MSAxOC44IDQxYy0xLjctMS4yIDAuMS0xLjEgMC4xLTEuMWMxLjkgMC4xIDIuOSAyIDIuOSAyYzEuNyAyLjkgNC41IDIuMSA1LjUgMS42IGMwLjItMS4yIDAuNy0yLjEgMS4yLTIuNmMtNC4yLTAuNS04LjctMi4xLTguNy05LjRjMC0yLjEgMC43LTMuNyAyLTUuMWMtMC4yLTAuNS0wLjgtMi40IDAuMi01YzAgMCAxLjYtMC41IDUuMiAyIGMxLjUtMC40IDMuMS0wLjcgNC44LTAuN2MxLjYgMCAzLjMgMC4yIDQuNyAwLjdjMy42LTIuNCA1LjItMiA1LjItMmMxIDIuNiAwLjQgNC42IDAuMiA1YzEuMiAxLjMgMiAzIDIgNS4xYzAgNy4zLTQuNSA4LjktOC43IDkuNCBjMC43IDAuNiAxLjMgMS43IDEuMyAzLjVjMCAyLjYgMCA0LjYgMCA1LjJjMCAwLjUgMC40IDEuMSAxLjMgMC45YzcuNS0yLjYgMTMtOS43IDEzLTE4LjFDNTEgMjEuOSA0Mi41IDEzLjQgMzIgMTMuNHoiLz48L3N2Zz4=);background-size:100% 100%;background-repeat:no-repeat}:host ::ng-deep .gh-count{position:relative;display:none;margin-left:4px;background-color:#fafafa;border:1px solid #d4d4d4}:host ::ng-deep .gh-count:hover,:host ::ng-deep .gh-count:focus{color:#4183c4}:host ::ng-deep .gh-count:before,:host ::ng-deep .gh-count:after{content:\"\";position:absolute;display:inline-block;width:0;height:0;border-color:transparent;border-style:solid}:host ::ng-deep .gh-count:before{top:50%;left:-3px;margin-top:-4px;border-width:4px 4px 4px 0;border-right-color:#fafafa}:host ::ng-deep .gh-count:after{top:50%;left:-4px;z-index:-1;margin-top:-5px;border-width:5px 5px 5px 0;border-right-color:#d4d4d4}:host.github-btn-large{height:30px}:host.github-btn-large ::ng-deep .gh-btn,:host.github-btn-large ::ng-deep .gh-count{padding:3px 10px 3px 8px;font-size:16px;line-height:22px;border-radius:4px}:host.github-btn-large ::ng-deep .gh-ico{width:20px;height:20px}:host.github-btn-large ::ng-deep .gh-count{margin-left:6px}:host.github-btn-large ::ng-deep .gh-count:before{left:-5px;margin-top:-6px;border-width:6px 6px 6px 0}:host.github-btn-large ::ng-deep .gh-count:after{left:-6px;margin-top:-7px;border-width:7px 7px 7px 0}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush }); | ||
| } | ||
| i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.2", ngImport: i0, type: GithubButtonComponent, decorators: [{ | ||
| i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.1", ngImport: i0, type: GithubButtonComponent, decorators: [{ | ||
| type: Component, | ||
@@ -104,17 +104,4 @@ args: [{ selector: 'github-button', template: ` | ||
| }, encapsulation: ViewEncapsulation.Emulated, preserveWhitespaces: false, changeDetection: ChangeDetectionStrategy.OnPush, styles: [":host{font:700 11px/14px Helvetica Neue,Helvetica,Arial,sans-serif;height:20px;overflow:hidden}:host:after,:host:before{content:\" \";display:table}:host:after{clear:both;visibility:hidden;font-size:0;height:0}:host ::ng-deep .gh-btn,:host ::ng-deep .gh-count,:host ::ng-deep .gh-ico{float:left}:host ::ng-deep .gh-btn,:host ::ng-deep .gh-count{padding:2px 5px 2px 4px;color:#333;text-decoration:none;white-space:nowrap;cursor:pointer;border-radius:3px}:host ::ng-deep .gh-btn{background-color:#eee;background-image:linear-gradient(to bottom,#fcfcfc 0,#eee);background-repeat:no-repeat;border:1px solid #d5d5d5}:host ::ng-deep .gh-btn:hover,:host ::ng-deep .gh-btn:focus{text-decoration:none;background-color:#ddd;background-image:linear-gradient(to bottom,#eee 0,#ddd);border-color:#ccc}:host ::ng-deep .gh-btn:active{background-image:none;background-color:#dcdcdc;border-color:#b5b5b5;box-shadow:inset 0 2px 4px #00000026}:host ::ng-deep .gh-ico{width:14px;height:14px;margin-right:4px;background-image:url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB2ZXJzaW9uPSIxLjEiIGlkPSJMYXllcl8xIiB4PSIwcHgiIHk9IjBweCIgd2lkdGg9IjQwcHgiIGhlaWdodD0iNDBweCIgdmlld0JveD0iMTIgMTIgNDAgNDAiIGVuYWJsZS1iYWNrZ3JvdW5kPSJuZXcgMTIgMTIgNDAgNDAiIHhtbDpzcGFjZT0icHJlc2VydmUiPjxwYXRoIGZpbGw9IiMzMzMzMzMiIGQ9Ik0zMiAxMy40Yy0xMC41IDAtMTkgOC41LTE5IDE5YzAgOC40IDUuNSAxNS41IDEzIDE4YzEgMC4yIDEuMy0wLjQgMS4zLTAuOWMwLTAuNSAwLTEuNyAwLTMuMiBjLTUuMyAxLjEtNi40LTIuNi02LjQtMi42QzIwIDQxLjYgMTguOCA0MSAxOC44IDQxYy0xLjctMS4yIDAuMS0xLjEgMC4xLTEuMWMxLjkgMC4xIDIuOSAyIDIuOSAyYzEuNyAyLjkgNC41IDIuMSA1LjUgMS42IGMwLjItMS4yIDAuNy0yLjEgMS4yLTIuNmMtNC4yLTAuNS04LjctMi4xLTguNy05LjRjMC0yLjEgMC43LTMuNyAyLTUuMWMtMC4yLTAuNS0wLjgtMi40IDAuMi01YzAgMCAxLjYtMC41IDUuMiAyIGMxLjUtMC40IDMuMS0wLjcgNC44LTAuN2MxLjYgMCAzLjMgMC4yIDQuNyAwLjdjMy42LTIuNCA1LjItMiA1LjItMmMxIDIuNiAwLjQgNC42IDAuMiA1YzEuMiAxLjMgMiAzIDIgNS4xYzAgNy4zLTQuNSA4LjktOC43IDkuNCBjMC43IDAuNiAxLjMgMS43IDEuMyAzLjVjMCAyLjYgMCA0LjYgMCA1LjJjMCAwLjUgMC40IDEuMSAxLjMgMC45YzcuNS0yLjYgMTMtOS43IDEzLTE4LjFDNTEgMjEuOSA0Mi41IDEzLjQgMzIgMTMuNHoiLz48L3N2Zz4=);background-size:100% 100%;background-repeat:no-repeat}:host ::ng-deep .gh-count{position:relative;display:none;margin-left:4px;background-color:#fafafa;border:1px solid #d4d4d4}:host ::ng-deep .gh-count:hover,:host ::ng-deep .gh-count:focus{color:#4183c4}:host ::ng-deep .gh-count:before,:host ::ng-deep .gh-count:after{content:\"\";position:absolute;display:inline-block;width:0;height:0;border-color:transparent;border-style:solid}:host ::ng-deep .gh-count:before{top:50%;left:-3px;margin-top:-4px;border-width:4px 4px 4px 0;border-right-color:#fafafa}:host ::ng-deep .gh-count:after{top:50%;left:-4px;z-index:-1;margin-top:-5px;border-width:5px 5px 5px 0;border-right-color:#d4d4d4}:host.github-btn-large{height:30px}:host.github-btn-large ::ng-deep .gh-btn,:host.github-btn-large ::ng-deep .gh-count{padding:3px 10px 3px 8px;font-size:16px;line-height:22px;border-radius:4px}:host.github-btn-large ::ng-deep .gh-ico{width:20px;height:20px}:host.github-btn-large ::ng-deep .gh-count{margin-left:6px}:host.github-btn-large ::ng-deep .gh-count:before{left:-5px;margin-top:-6px;border-width:6px 6px 6px 0}:host.github-btn-large ::ng-deep .gh-count:after{left:-6px;margin-top:-7px;border-width:7px 7px 7px 0}\n"] }] | ||
| }], ctorParameters: () => [] }); | ||
| }], ctorParameters: () => [], propDecorators: { type: [{ type: i0.Input, args: [{ isSignal: true, alias: "type", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], namespace: [{ type: i0.Input, args: [{ isSignal: true, alias: "namespace", required: true }] }], repo: [{ type: i0.Input, args: [{ isSignal: true, alias: "repo", required: true }] }], showZero: [{ type: i0.Input, args: [{ isSignal: true, alias: "showZero", required: false }] }] } }); | ||
| class GithubButtonModule { | ||
| static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.2", ngImport: i0, type: GithubButtonModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); } | ||
| static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.0.2", ngImport: i0, type: GithubButtonModule, imports: [GithubButtonComponent], exports: [GithubButtonComponent] }); } | ||
| static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.0.2", ngImport: i0, type: GithubButtonModule }); } | ||
| } | ||
| i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.2", ngImport: i0, type: GithubButtonModule, decorators: [{ | ||
| type: NgModule, | ||
| args: [{ | ||
| imports: [GithubButtonComponent], | ||
| exports: [GithubButtonComponent], | ||
| }] | ||
| }] }); | ||
| /** | ||
@@ -124,3 +111,3 @@ * Generated bundle index. Do not edit. | ||
| export { GithubButtonComponent, GithubButtonModule }; | ||
| export { GithubButtonComponent, GithubButtonService }; | ||
| //# sourceMappingURL=ng-github-button.mjs.map |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"ng-github-button.mjs","sources":["../../lib/src/service.ts","../../lib/src/component.ts","../../lib/src/module.ts","../../lib/ng-github-button.ts"],"sourcesContent":["import { inject, Injectable } from '@angular/core';\nimport { BehaviorSubject, Observable } from 'rxjs';\nimport { HttpClient } from '@angular/common/http';\n\n@Injectable({ providedIn: 'root' })\nexport class GithubButtonService {\n private http = inject(HttpClient);\n private cached: Record<string, any> = {};\n private _notify = new BehaviorSubject<Record<string, any> | null>(null);\n\n get notify(): Observable<Record<string, any> | null> {\n return this._notify.asObservable();\n }\n\n req(namespace: string, repo: string): void {\n const url = `https://api.github.com/repos/${namespace}/${repo}`;\n if (this.cached[url] != null) {\n this._notify.next(this.cached[url]);\n return;\n }\n this.cached[url] = {};\n this.http.get(url).subscribe((res) => {\n this.cached[url] = res;\n this._notify.next(this.cached[url]);\n });\n }\n}\n","import {\n Component,\n ChangeDetectionStrategy,\n ViewEncapsulation,\n inject,\n input,\n booleanAttribute,\n computed,\n effect,\n afterNextRender,\n signal,\n} from '@angular/core';\nimport { GithubButtonService } from './service';\n\nconst isSSR = !(typeof document === 'object' && !!document);\n\nexport type GithubButtonType = 'stargazers' | 'subscribers' | 'forks';\nexport type GithubButtonSize = 'default' | 'large';\n\n@Component({\n selector: 'github-button',\n template: `\n <a class=\"gh-btn\" [attr.href]=\"repo_url()\" target=\"_blank\">\n <span class=\"gh-ico\" aria-hidden=\"true\"></span>\n <span class=\"gh-text\">{{ typeToLabel[type()] }}</span>\n </a>\n <a class=\"gh-count\" target=\"_blank\" [attr.href]=\"count_url()\" [style.display]=\"showZero() || count() > 0 ? 'block' : 'none'\">\n {{ count() }}\n </a>\n <ng-content />\n `,\n styleUrls: ['./style.less'],\n host: {\n '[class.github-btn-large]': `size() === 'large'`,\n },\n encapsulation: ViewEncapsulation.Emulated,\n preserveWhitespaces: false,\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class GithubButtonComponent {\n private srv = inject(GithubButtonService);\n typeToLabel = {\n stargazers: 'Star',\n subscribers: 'Watch',\n forks: 'Fork',\n };\n private typeToPath: Record<string, string> = {\n forks: 'network',\n };\n\n type = input<GithubButtonType>('stargazers');\n size = input<GithubButtonSize>('default');\n namespace = input.required<string>();\n repo = input.required<string>();\n showZero = input(false, { transform: booleanAttribute });\n\n repo_url = computed(() => `//github.com/${this.namespace()}/${this.repo()}/`);\n count_url = computed(() => {\n const repo_url = this.repo_url();\n const type = this.type();\n return `${repo_url}${this.typeToPath[type] || type}/`;\n });\n count = signal(0);\n\n constructor() {\n afterNextRender(() => {\n this.srv.notify.subscribe(res => {\n this.count.set(res ? res[`${this.type()}_count`] : 0);\n });\n });\n effect(() => {\n const namespace = this.namespace();\n const repo = this.repo();\n this.type();\n if (isSSR) return;\n this.srv.req(namespace, repo);\n });\n }\n}\n","import { NgModule } from '@angular/core';\n\nimport { GithubButtonComponent } from './component';\n\n@NgModule({\n imports: [GithubButtonComponent],\n exports: [GithubButtonComponent],\n})\nexport class GithubButtonModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;MAKa,mBAAmB,CAAA;AADhC,IAAA,WAAA,GAAA;AAEU,QAAA,IAAA,CAAA,IAAI,GAAG,MAAM,CAAC,UAAU,CAAC;QACzB,IAAM,CAAA,MAAA,GAAwB,EAAE;AAChC,QAAA,IAAA,CAAA,OAAO,GAAG,IAAI,eAAe,CAA6B,IAAI,CAAC;AAkBxE;AAhBC,IAAA,IAAI,MAAM,GAAA;AACR,QAAA,OAAO,IAAI,CAAC,OAAO,CAAC,YAAY,EAAE;;IAGpC,GAAG,CAAC,SAAiB,EAAE,IAAY,EAAA;AACjC,QAAA,MAAM,GAAG,GAAG,CAAA,6BAAA,EAAgC,SAAS,CAAI,CAAA,EAAA,IAAI,EAAE;QAC/D,IAAI,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,IAAI,IAAI,EAAE;AAC5B,YAAA,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;YACnC;;AAEF,QAAA,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,GAAG,EAAE;AACrB,QAAA,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,SAAS,CAAC,CAAC,GAAG,KAAI;AACnC,YAAA,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,GAAG,GAAG;AACtB,YAAA,IAAI,CAAC,OAAO,CAAC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A,eAAe,EACf,QAAA,EAAA;;;;;;;;;GAST,EAEK,IAAA,EAAA;AACJ,wBAAA,0BAA0B,EAAE,CAAoB,kBAAA,CAAA;qBACjD,EACc,aAAA,EAAA,iBAAiB,CAAC,QAAQ,EAAA,mBAAA,EACpB,KAAK,EACT,eAAA,EAAA,uBAAuB,CAAC,MAAM,EAAA,MAAA,EAAA,CAAA,wxGAAA,CAAA,EAAA;;;MC7BpC,kBAAkB,CAAA;8GAAlB,kBAAkB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,QAAA,EAAA,CAAA,CAAA;+GAAlB,kBAAkB,EAAA,OAAA,EAAA,CAHnB,qBAAqB,CAAA,EAAA,OAAA,EAAA,CACrB,qBAAqB,CAAA,EAAA,CAAA,CAAA;+GAEpB,kBAAkB,EAAA,CAAA,CAAA;;2FAAlB,kBAAkB,EAAA,UAAA,EAAA,CAAA;kBAJ9B,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;oBACR,OAAO,EAAE,CAAC,qBAAqB,CAAC;oBAChC,OAAO,EAAE,CAAC,qBAAqB,CAAC;AACjC,iBAAA;;;ACPD;;AAEG;;;;"} | ||
| {"version":3,"file":"ng-github-button.mjs","sources":["../../lib/src/service.ts","../../lib/src/github-button.ts","../../lib/src/ng-github-button.ts"],"sourcesContent":["import { inject, Injectable } from '@angular/core';\nimport { Observable, Subject } from 'rxjs';\nimport { HttpClient } from '@angular/common/http';\n\n@Injectable({ providedIn: 'root' })\nexport class GithubButtonService {\n private http = inject(HttpClient);\n private cached: Record<string, any> = {};\n private _notify = new Subject<Record<string, any>>();\n\n get notify(): Observable<Record<string, any>> {\n return this._notify.asObservable();\n }\n\n req(namespace: string, repo: string): void {\n const url = `https://api.github.com/repos/${namespace}/${repo}`;\n if (this.cached[url] != null) {\n this._notify.next(this.cached[url]);\n return;\n }\n this.cached[url] = {};\n this.http.get(url).subscribe((res) => {\n this.cached[url] = res;\n this._notify.next(this.cached[url]);\n });\n }\n}\n","import {\n Component,\n ChangeDetectionStrategy,\n ViewEncapsulation,\n inject,\n input,\n booleanAttribute,\n computed,\n effect,\n signal,\n} from '@angular/core';\nimport { GithubButtonService } from './service';\nimport { takeUntilDestroyed, toObservable } from '@angular/core/rxjs-interop';\n\nconst isSSR = !(typeof document === 'object' && !!document);\n\nexport type GithubButtonType = 'stargazers' | 'subscribers' | 'forks';\nexport type GithubButtonSize = 'default' | 'large';\n\n@Component({\n selector: 'github-button',\n template: `\n <a class=\"gh-btn\" [attr.href]=\"repo_url()\" target=\"_blank\">\n <span class=\"gh-ico\" aria-hidden=\"true\"></span>\n <span class=\"gh-text\">{{ typeToLabel[type()] }}</span>\n </a>\n <a class=\"gh-count\" target=\"_blank\" [attr.href]=\"count_url()\" [style.display]=\"showZero() || count() > 0 ? 'block' : 'none'\">\n {{ count() }}\n </a>\n <ng-content />\n `,\n styleUrls: ['./style.less'],\n host: {\n '[class.github-btn-large]': `size() === 'large'`,\n },\n encapsulation: ViewEncapsulation.Emulated,\n preserveWhitespaces: false,\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class GithubButtonComponent {\n private readonly srv = inject(GithubButtonService);\n readonly typeToLabel = {\n stargazers: 'Star',\n subscribers: 'Watch',\n forks: 'Fork',\n };\n private readonly typeToPath: Record<string, string> = {\n forks: 'network',\n };\n\n readonly type = input<GithubButtonType>('stargazers');\n readonly size = input<GithubButtonSize>('default');\n readonly namespace = input.required<string>();\n readonly repo = input.required<string>();\n readonly showZero = input(false, { transform: booleanAttribute });\n\n protected repo_url = computed(() => `//github.com/${this.namespace()}/${this.repo()}/`);\n protected count_url = computed(() => {\n const repo_url = this.repo_url();\n const type = this.type();\n return `${repo_url}${this.typeToPath[type] || type}/`;\n });\n private _data = signal<Record<string, any> | null>(null);\n protected count = computed(() => this._data()?.[`${this.type()}_count`] ?? 0);\n\n constructor() {\n toObservable(this.type).pipe(takeUntilDestroyed()).subscribe((res) => {\n console.log('type changed:', res);\n });\n this.srv.notify.pipe(takeUntilDestroyed()).subscribe(res => {\n this._data.set(res);\n });\n effect(() => {\n const namespace = this.namespace();\n const repo = this.repo();\n if (isSSR) return;\n this.srv.req(namespace, repo);\n });\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;MAKa,mBAAmB,CAAA;AACtB,IAAA,IAAI,GAAG,MAAM,CAAC,UAAU,CAAC;IACzB,MAAM,GAAwB,EAAE;AAChC,IAAA,OAAO,GAAG,IAAI,OAAO,EAAuB;AAEpD,IAAA,IAAI,MAAM,GAAA;AACR,QAAA,OAAO,IAAI,CAAC,OAAO,CAAC,YAAY,EAAE;IACpC;IAEA,GAAG,CAAC,SAAiB,EAAE,IAAY,EAAA;AACjC,QAAA,MAAM,GAAG,GAAG,CAAA,6BAAA,EAAgC,SAAS,CAAA,CAAA,EAAI,IAAI,EAAE;QAC/D,IAAI,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,IAAI,IAAI,EAAE;AAC5B,YAAA,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;YACnC;QACF;AACA,QAAA,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,GAAG,EAAE;AACrB,QAAA,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,SAAS,CAAC,CAAC,GAAG,KAAI;AACnC,YAAA,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,GAAG,GAAG;AACtB,YAAA,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;AACrC,QAAA,CAAC,CAAC;IACJ;uGApBW,mBAAmB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA;AAAnB,IAAA,OAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EA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0BAA0B,EAAE,CAAA,kBAAA,CAAoB;qBACjD,EAAA,aAAA,EACc,iBAAiB,CAAC,QAAQ,EAAA,mBAAA,EACpB,KAAK,EAAA,eAAA,EACT,uBAAuB,CAAC,MAAM,EAAA,MAAA,EAAA,CAAA,wxGAAA,CAAA,EAAA;;;ACrCjD;;AAEG;;;;"} |
+3
-3
| { | ||
| "name": "ng-github-button", | ||
| "version": "20.0.0", | ||
| "version": "21.0.0", | ||
| "description": "Unofficial GitHub buttons in Angular.", | ||
@@ -28,3 +28,3 @@ "author": "cipchk <cipchk@qq.com>", | ||
| "module": "fesm2022/ng-github-button.mjs", | ||
| "typings": "index.d.ts", | ||
| "typings": "types/ng-github-button.d.ts", | ||
| "exports": { | ||
@@ -35,3 +35,3 @@ "./package.json": { | ||
| ".": { | ||
| "types": "./index.d.ts", | ||
| "types": "./types/ng-github-button.d.ts", | ||
| "default": "./fesm2022/ng-github-button.mjs" | ||
@@ -38,0 +38,0 @@ } |
-33
| import * as _angular_core from '@angular/core'; | ||
| type GithubButtonType = 'stargazers' | 'subscribers' | 'forks'; | ||
| type GithubButtonSize = 'default' | 'large'; | ||
| declare class GithubButtonComponent { | ||
| private srv; | ||
| typeToLabel: { | ||
| stargazers: string; | ||
| subscribers: string; | ||
| forks: string; | ||
| }; | ||
| private typeToPath; | ||
| type: _angular_core.InputSignal<GithubButtonType>; | ||
| size: _angular_core.InputSignal<GithubButtonSize>; | ||
| namespace: _angular_core.InputSignal<string>; | ||
| repo: _angular_core.InputSignal<string>; | ||
| showZero: _angular_core.InputSignalWithTransform<boolean, unknown>; | ||
| repo_url: _angular_core.Signal<string>; | ||
| count_url: _angular_core.Signal<string>; | ||
| count: _angular_core.WritableSignal<number>; | ||
| constructor(); | ||
| static ɵfac: _angular_core.ɵɵFactoryDeclaration<GithubButtonComponent, never>; | ||
| static ɵcmp: _angular_core.ɵɵComponentDeclaration<GithubButtonComponent, "github-button", never, { "type": { "alias": "type"; "required": false; "isSignal": true; }; "size": { "alias": "size"; "required": false; "isSignal": true; }; "namespace": { "alias": "namespace"; "required": true; "isSignal": true; }; "repo": { "alias": "repo"; "required": true; "isSignal": true; }; "showZero": { "alias": "showZero"; "required": false; "isSignal": true; }; }, {}, never, ["*"], true, never>; | ||
| } | ||
| declare class GithubButtonModule { | ||
| static ɵfac: _angular_core.ɵɵFactoryDeclaration<GithubButtonModule, never>; | ||
| static ɵmod: _angular_core.ɵɵNgModuleDeclaration<GithubButtonModule, never, [typeof GithubButtonComponent], [typeof GithubButtonComponent]>; | ||
| static ɵinj: _angular_core.ɵɵInjectorDeclaration<GithubButtonModule>; | ||
| } | ||
| export { GithubButtonComponent, GithubButtonModule }; | ||
| export type { GithubButtonSize, GithubButtonType }; |
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
25807
-0.28%169
-2.87%