@pb33f/cowboy-components 0.5.5 → 0.5.6
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/dist/assets/{css.worker-CTSQecos.js → css.worker-Byh--afc.js} +1 -1
- package/dist/assets/{html.worker-C1BIaUKh.js → html.worker-DArWg-Dy.js} +1 -1
- package/dist/assets/{json.worker-BCyBlh8h.js → json.worker-heCfXoJw.js} +1 -1
- package/dist/components/auth/login-button.css.d.ts +2 -0
- package/dist/components/auth/login-button.css.js +60 -0
- package/dist/components/auth/login-button.d.ts +16 -0
- package/dist/components/auth/login-button.js +87 -0
- package/dist/components/auth/login-panel.d.ts +10 -0
- package/dist/components/auth/login-panel.js +46 -0
- package/dist/components/auth/oauth-login.css.d.ts +2 -0
- package/dist/components/auth/oauth-login.css.js +107 -0
- package/dist/components/auth/oauth-login.d.ts +17 -0
- package/dist/components/auth/oauth-login.js +93 -0
- package/dist/components/electric-box/electric-box.css.d.ts +2 -0
- package/dist/components/electric-box/electric-box.css.js +23 -0
- package/dist/components/electric-box/electric-box.d.ts +37 -0
- package/dist/components/electric-box/electric-box.js +336 -0
- package/dist/components/logo-wall/logo-wall.css.d.ts +2 -0
- package/dist/components/logo-wall/logo-wall.css.js +57 -0
- package/dist/components/logo-wall/logowall.d.ts +26 -0
- package/dist/components/logo-wall/logowall.js +378 -0
- package/dist/components/model-renderer/example.js +1 -0
- package/dist/components/rodeo/rodeo-nav.css.d.ts +2 -0
- package/dist/components/rodeo/rodeo-nav.css.js +13 -0
- package/dist/components/rodeo/rodeo-nav.d.ts +6 -0
- package/dist/components/rodeo/rodeo-nav.js +31 -0
- package/dist/components/rodeo/rodeo.css.d.ts +2 -0
- package/dist/components/rodeo/rodeo.css.js +17 -0
- package/dist/components/rodeo/rodeo.d.ts +10 -0
- package/dist/components/rodeo/rodeo.js +41 -0
- package/dist/components/rodeo/roundup.d.ts +4 -0
- package/dist/components/rodeo/roundup.js +18 -0
- package/dist/components/rodeo/users.d.ts +4 -0
- package/dist/components/rodeo/users.js +17 -0
- package/dist/components/the-doctor/the-doctor.d.ts +1 -0
- package/dist/components/the-doctor/the-doctor.js +3 -0
- package/dist/controllers/auth.d.ts +14 -0
- package/dist/controllers/auth.js +46 -0
- package/dist/cowboy-components.d.ts +4 -0
- package/dist/cowboy-components.js +4 -0
- package/dist/cowboy-components.umd.cjs +1833 -1254
- package/dist/css/button.css.js +1 -2
- package/dist/events/doctor.d.ts +2 -0
- package/dist/events/doctor.js +2 -0
- package/dist/model/auth.d.ts +8 -0
- package/dist/model/auth.js +1 -0
- package/dist/rodeo.d.ts +5 -0
- package/dist/rodeo.js +9 -0
- package/dist/services/auth-service.d.ts +5 -0
- package/dist/services/auth-service.js +24 -0
- package/package.json +4 -1
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
import { html, LitElement } from "lit";
|
|
8
|
+
import { customElement } from "lit/decorators.js";
|
|
9
|
+
import rodeoCss from "./rodeo.css";
|
|
10
|
+
import listsCss from "../../css/lists.css";
|
|
11
|
+
import { Router } from '@vaadin/router';
|
|
12
|
+
import './rodeo-nav.js';
|
|
13
|
+
import './roundup.ts';
|
|
14
|
+
import './users.ts';
|
|
15
|
+
let Rodeo = class Rodeo extends LitElement {
|
|
16
|
+
constructor() {
|
|
17
|
+
super();
|
|
18
|
+
}
|
|
19
|
+
firstUpdated() {
|
|
20
|
+
const router = new Router(this.shadowRoot?.getElementById('outlet'));
|
|
21
|
+
console.log('router', router);
|
|
22
|
+
router?.setRoutes([
|
|
23
|
+
{ path: '/rodeo.html', component: 'pb33f-rodeo-home' },
|
|
24
|
+
{ path: '/', component: 'pb33f-rodeo-home' },
|
|
25
|
+
{ path: '/users', component: 'pb33f-rodeo-users' }
|
|
26
|
+
]);
|
|
27
|
+
}
|
|
28
|
+
render() {
|
|
29
|
+
return html `
|
|
30
|
+
<main>
|
|
31
|
+
<pb33f-rodeo-nav></pb33f-rodeo-nav>
|
|
32
|
+
<div id="outlet"></div>
|
|
33
|
+
</main>
|
|
34
|
+
`;
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
Rodeo.styles = [rodeoCss, listsCss];
|
|
38
|
+
Rodeo = __decorate([
|
|
39
|
+
customElement('pb33f-rodeo')
|
|
40
|
+
], Rodeo);
|
|
41
|
+
export { Rodeo };
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
import { html, LitElement } from "lit";
|
|
8
|
+
import { customElement } from "lit/decorators.js";
|
|
9
|
+
let RodeoHome = class RodeoHome extends LitElement {
|
|
10
|
+
render() {
|
|
11
|
+
return html `
|
|
12
|
+
`;
|
|
13
|
+
}
|
|
14
|
+
};
|
|
15
|
+
RodeoHome = __decorate([
|
|
16
|
+
customElement('pb33f-rodeo-home')
|
|
17
|
+
], RodeoHome);
|
|
18
|
+
export { RodeoHome };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
import { html, LitElement } from "lit";
|
|
8
|
+
import { customElement } from "lit/decorators.js";
|
|
9
|
+
let RodeoUsers = class RodeoUsers extends LitElement {
|
|
10
|
+
render() {
|
|
11
|
+
return html `USERS`;
|
|
12
|
+
}
|
|
13
|
+
};
|
|
14
|
+
RodeoUsers = __decorate([
|
|
15
|
+
customElement('pb33f-rodeo-users')
|
|
16
|
+
], RodeoUsers);
|
|
17
|
+
export { RodeoUsers };
|
|
@@ -162,6 +162,7 @@ export declare class TheDoctor extends LitElement {
|
|
|
162
162
|
readonly nodeLimit: number;
|
|
163
163
|
private pendingLine;
|
|
164
164
|
private rolodexDividerPosition;
|
|
165
|
+
private authController;
|
|
165
166
|
constructor(doctorEndpoint?: string);
|
|
166
167
|
tickRandomly(): void;
|
|
167
168
|
nukeWorkspaceHandler(): void;
|
|
@@ -54,6 +54,7 @@ import { NodeType } from "../../model/node_type";
|
|
|
54
54
|
import tooltipCss from "../../css/tooltip.css";
|
|
55
55
|
import { NukeWorkspaceComponent } from "./nuke-workspace";
|
|
56
56
|
import { CreditTicker } from "../credit-ticker/credit-ticker";
|
|
57
|
+
import { AuthService } from "../../services/auth-service";
|
|
57
58
|
export const GraphBag = "pb33f-doctor-graph";
|
|
58
59
|
export const PanelStateBag = "pb33f-doctor-panel-state";
|
|
59
60
|
export const RolodexResponseBag = "pb33f-doctor-rolodex-response";
|
|
@@ -87,6 +88,7 @@ let TheDoctor = class TheDoctor extends LitElement {
|
|
|
87
88
|
// rolodex divider state (because it may not exist)
|
|
88
89
|
this.rolodexDividerPosition = 40;
|
|
89
90
|
this._firstRun = true;
|
|
91
|
+
//this.authController = new AuthController(this)
|
|
90
92
|
// bus it up
|
|
91
93
|
this.bus = CreateBus();
|
|
92
94
|
this.doctorServiceChannel = this.bus.createChannel(DoctorServiceChannel);
|
|
@@ -1262,6 +1264,7 @@ let TheDoctor = class TheDoctor extends LitElement {
|
|
|
1262
1264
|
FeedbackService.doctorEndpoint = this.doctorEndpoint;
|
|
1263
1265
|
RulesetService.doctorEndpoint = this.doctorEndpoint;
|
|
1264
1266
|
ModelService.doctorEndpoint = this.doctorEndpoint;
|
|
1267
|
+
AuthService.doctorEndpoint = this.doctorEndpoint;
|
|
1265
1268
|
this.connectToBroker();
|
|
1266
1269
|
this.graphBag = this.bagManager.getBag(GraphBag);
|
|
1267
1270
|
this.docBag = this.bagManager.getBag(DoctorDocumentBag);
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { ReactiveControllerHost } from 'lit';
|
|
2
|
+
import { AuthenticationState } from "../model/auth";
|
|
3
|
+
export declare class AuthController {
|
|
4
|
+
host: ReactiveControllerHost;
|
|
5
|
+
doctorEndpoint: string;
|
|
6
|
+
state: AuthenticationState | null;
|
|
7
|
+
authenticated: boolean;
|
|
8
|
+
urlCapture: string | null;
|
|
9
|
+
constructor(host: ReactiveControllerHost);
|
|
10
|
+
hostConnected(): void;
|
|
11
|
+
authGithub(): void;
|
|
12
|
+
logout(): void;
|
|
13
|
+
checkState(): Promise<AuthenticationState>;
|
|
14
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { AuthenticationGithubRequested, LogoutRequested } from "../events/doctor";
|
|
2
|
+
import { AuthService } from "../services/auth-service";
|
|
3
|
+
const PreAuthURL = "pb33f-preauth-url";
|
|
4
|
+
export class AuthController {
|
|
5
|
+
constructor(host) {
|
|
6
|
+
this.host = host;
|
|
7
|
+
this.host.addController(this);
|
|
8
|
+
this.doctorEndpoint = 'https://doctor.pb33f.io';
|
|
9
|
+
const sessionEndpoint = sessionStorage.getItem("doctor-endpoint");
|
|
10
|
+
if (sessionEndpoint) {
|
|
11
|
+
this.doctorEndpoint = sessionEndpoint;
|
|
12
|
+
}
|
|
13
|
+
AuthService.doctorEndpoint = this.doctorEndpoint;
|
|
14
|
+
}
|
|
15
|
+
hostConnected() {
|
|
16
|
+
window.addEventListener(AuthenticationGithubRequested, this.authGithub.bind(this));
|
|
17
|
+
window.addEventListener(LogoutRequested, this.logout.bind(this));
|
|
18
|
+
// check for urlcapture
|
|
19
|
+
const urlState = sessionStorage.getItem(PreAuthURL);
|
|
20
|
+
debugger;
|
|
21
|
+
if (urlState) {
|
|
22
|
+
this.urlCapture = urlState;
|
|
23
|
+
sessionStorage.removeItem(PreAuthURL);
|
|
24
|
+
}
|
|
25
|
+
this.checkState().then((state) => {
|
|
26
|
+
this.authenticated = true;
|
|
27
|
+
this.state = state;
|
|
28
|
+
this.host.requestUpdate();
|
|
29
|
+
if (this.urlCapture) {
|
|
30
|
+
const c = this.urlCapture;
|
|
31
|
+
this.urlCapture = null;
|
|
32
|
+
window.location.href = c;
|
|
33
|
+
}
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
authGithub() {
|
|
37
|
+
sessionStorage.setItem(PreAuthURL, window.location.toString());
|
|
38
|
+
window.location.href = this.doctorEndpoint + '/auth/github/start';
|
|
39
|
+
}
|
|
40
|
+
logout() {
|
|
41
|
+
window.location.href = this.doctorEndpoint + '/auth/logout';
|
|
42
|
+
}
|
|
43
|
+
checkState() {
|
|
44
|
+
return AuthService.checkAuth();
|
|
45
|
+
}
|
|
46
|
+
}
|
|
@@ -15,6 +15,10 @@ import './components/attention-box/attention-box.js';
|
|
|
15
15
|
import './components/render-operation-path/render-operation-path.js';
|
|
16
16
|
import './components/render-json-path/render-json-path.js';
|
|
17
17
|
import './components/footer/footer.js';
|
|
18
|
+
import './components/electric-box/electric-box.js';
|
|
19
|
+
import './components/auth/oauth-login.js';
|
|
20
|
+
import './components/auth/login-button.js';
|
|
21
|
+
import './components/logo-wall/logowall.js';
|
|
18
22
|
import './components/problem-list/problem-list.js';
|
|
19
23
|
import './components/problem-list/problem-item.js';
|
|
20
24
|
import './components/the-doctor/the-doctor.js';
|
|
@@ -15,6 +15,10 @@ import './components/attention-box/attention-box.js';
|
|
|
15
15
|
import './components/render-operation-path/render-operation-path.js';
|
|
16
16
|
import './components/render-json-path/render-json-path.js';
|
|
17
17
|
import './components/footer/footer.js';
|
|
18
|
+
import './components/electric-box/electric-box.js';
|
|
19
|
+
import './components/auth/oauth-login.js';
|
|
20
|
+
import './components/auth/login-button.js';
|
|
21
|
+
import './components/logo-wall/logowall.js';
|
|
18
22
|
// problems
|
|
19
23
|
import './components/problem-list/problem-list.js';
|
|
20
24
|
import './components/problem-list/problem-item.js';
|