@pb33f/cowboy-components 0.5.4 → 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/model-renderer/schema.d.ts +4 -3
- package/dist/components/model-renderer/schema.js +54 -1
- package/dist/components/paginator/paginator.css.js +1 -1
- 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.css.js +5 -1
- package/dist/components/the-doctor/the-doctor.d.ts +6 -0
- package/dist/components/the-doctor/the-doctor.js +37 -11
- 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 +1859 -1249
- 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/model/schema.d.ts +1 -1
- 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,31 @@
|
|
|
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 listsCss from "../../css/lists.css";
|
|
10
|
+
import rodeoNavCss from "./rodeo-nav.css";
|
|
11
|
+
import linksCss from "../../css/links.css";
|
|
12
|
+
let RodeoNav = class RodeoNav extends LitElement {
|
|
13
|
+
constructor() {
|
|
14
|
+
super();
|
|
15
|
+
}
|
|
16
|
+
render() {
|
|
17
|
+
return html `
|
|
18
|
+
<nav>
|
|
19
|
+
<ul>
|
|
20
|
+
<li><a href="/">roundup</a></li>
|
|
21
|
+
<li><a href="users/">patrons</a></li>
|
|
22
|
+
</ul>
|
|
23
|
+
</nav>
|
|
24
|
+
`;
|
|
25
|
+
}
|
|
26
|
+
};
|
|
27
|
+
RodeoNav.styles = [listsCss, rodeoNavCss, linksCss];
|
|
28
|
+
RodeoNav = __decorate([
|
|
29
|
+
customElement('pb33f-rodeo-nav')
|
|
30
|
+
], RodeoNav);
|
|
31
|
+
export { RodeoNav };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { LitElement } from "lit";
|
|
2
|
+
import './rodeo-nav.js';
|
|
3
|
+
import './roundup.ts';
|
|
4
|
+
import './users.ts';
|
|
5
|
+
export declare class Rodeo extends LitElement {
|
|
6
|
+
static styles: import("lit").CSSResult[];
|
|
7
|
+
constructor();
|
|
8
|
+
firstUpdated(): void;
|
|
9
|
+
render(): import("lit-html").TemplateResult<1>;
|
|
10
|
+
}
|
|
@@ -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 };
|
|
@@ -53,7 +53,7 @@ export default css `
|
|
|
53
53
|
|
|
54
54
|
sl-split-panel {
|
|
55
55
|
width: 100%;
|
|
56
|
-
|
|
56
|
+
height: 100%;
|
|
57
57
|
--divider-width: 2px;
|
|
58
58
|
}
|
|
59
59
|
|
|
@@ -188,6 +188,10 @@ export default css `
|
|
|
188
188
|
width: 100%;
|
|
189
189
|
}
|
|
190
190
|
|
|
191
|
+
.tab-group {
|
|
192
|
+
height: 100%
|
|
193
|
+
}
|
|
194
|
+
|
|
191
195
|
sl-tab-panel.tab-panel::part(base) {
|
|
192
196
|
height: 100%;
|
|
193
197
|
padding-top: 5px;
|
|
@@ -74,9 +74,11 @@ export declare class TheDoctor extends LitElement {
|
|
|
74
74
|
splitPanelExplorer: SlSplitPanel;
|
|
75
75
|
splitPanelRolodex: SlSplitPanel;
|
|
76
76
|
splitPanelInspector: SlSplitPanel;
|
|
77
|
+
private randomTicker;
|
|
77
78
|
private rulesetPulse;
|
|
78
79
|
explorerVisible: boolean;
|
|
79
80
|
minimapVisible: boolean;
|
|
81
|
+
minimapIconVisible: boolean;
|
|
80
82
|
explorerBooted: boolean;
|
|
81
83
|
activeURL: string;
|
|
82
84
|
rolodexNeedsReset: boolean;
|
|
@@ -160,7 +162,9 @@ export declare class TheDoctor extends LitElement {
|
|
|
160
162
|
readonly nodeLimit: number;
|
|
161
163
|
private pendingLine;
|
|
162
164
|
private rolodexDividerPosition;
|
|
165
|
+
private authController;
|
|
163
166
|
constructor(doctorEndpoint?: string);
|
|
167
|
+
tickRandomly(): void;
|
|
164
168
|
nukeWorkspaceHandler(): void;
|
|
165
169
|
minimapToggled(): void;
|
|
166
170
|
firstUpdated(): void;
|
|
@@ -224,6 +228,8 @@ export declare class TheDoctor extends LitElement {
|
|
|
224
228
|
selectControlTab(event: CustomEvent): void;
|
|
225
229
|
toggleSidebar(): void;
|
|
226
230
|
toggleExplorer(): void;
|
|
231
|
+
hideMinimapIcon(): void;
|
|
232
|
+
showMinimapIcon(): void;
|
|
227
233
|
closeExplorer(): void;
|
|
228
234
|
render(): import("lit-html").TemplateResult<1>;
|
|
229
235
|
fetchUrl(event: CustomEvent<ArchiveURLRequestedEvent>): 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);
|
|
@@ -142,7 +144,9 @@ let TheDoctor = class TheDoctor extends LitElement {
|
|
|
142
144
|
this.renderedNode = new RenderedNodeComponent();
|
|
143
145
|
this.references = [];
|
|
144
146
|
this.minimapVisible = true;
|
|
147
|
+
this.minimapIconVisible = true;
|
|
145
148
|
this.nodeLimit = 150;
|
|
149
|
+
this.randomTicker = 0;
|
|
146
150
|
// extract the doctor endpoint from session storage.
|
|
147
151
|
const sessionEndpoint = sessionStorage.getItem(DoctorEndpoint);
|
|
148
152
|
if (sessionEndpoint) {
|
|
@@ -229,6 +233,9 @@ let TheDoctor = class TheDoctor extends LitElement {
|
|
|
229
233
|
}
|
|
230
234
|
});
|
|
231
235
|
}
|
|
236
|
+
tickRandomly() {
|
|
237
|
+
this.randomTicker = Math.floor(Math.random() * 9999999);
|
|
238
|
+
}
|
|
232
239
|
nukeWorkspaceHandler() {
|
|
233
240
|
this.bagManager.resetBags();
|
|
234
241
|
ModelService.resetWorkspace().then(() => {
|
|
@@ -1044,6 +1051,7 @@ let TheDoctor = class TheDoctor extends LitElement {
|
|
|
1044
1051
|
}
|
|
1045
1052
|
// determine if the score went up or down and toast it!
|
|
1046
1053
|
this.problemsOverview.statistics = result;
|
|
1054
|
+
this.tickRandomly(); // tick randomly to refresh docs iframe.
|
|
1047
1055
|
// TODO: re-evaluate these toasts, they get annoying, fucking fast.
|
|
1048
1056
|
// if (this.problemsOverview.statistics) {
|
|
1049
1057
|
// const newScore = result.statistics.overallScore;
|
|
@@ -1256,6 +1264,7 @@ let TheDoctor = class TheDoctor extends LitElement {
|
|
|
1256
1264
|
FeedbackService.doctorEndpoint = this.doctorEndpoint;
|
|
1257
1265
|
RulesetService.doctorEndpoint = this.doctorEndpoint;
|
|
1258
1266
|
ModelService.doctorEndpoint = this.doctorEndpoint;
|
|
1267
|
+
AuthService.doctorEndpoint = this.doctorEndpoint;
|
|
1259
1268
|
this.connectToBroker();
|
|
1260
1269
|
this.graphBag = this.bagManager.getBag(GraphBag);
|
|
1261
1270
|
this.docBag = this.bagManager.getBag(DoctorDocumentBag);
|
|
@@ -1991,6 +2000,7 @@ let TheDoctor = class TheDoctor extends LitElement {
|
|
|
1991
2000
|
if (this.explorerVisible && this.activeNode) {
|
|
1992
2001
|
this.explorer.moveToNode(this.activeNode);
|
|
1993
2002
|
}
|
|
2003
|
+
this.hideMinimapIcon();
|
|
1994
2004
|
this.explorerBooted = true;
|
|
1995
2005
|
// check if ths is safari and fire a warning toast!
|
|
1996
2006
|
const isSafari = /^((?!chrome|android).)*safari/i.test(navigator.userAgent);
|
|
@@ -2003,8 +2013,17 @@ let TheDoctor = class TheDoctor extends LitElement {
|
|
|
2003
2013
|
});
|
|
2004
2014
|
}
|
|
2005
2015
|
}
|
|
2016
|
+
hideMinimapIcon() {
|
|
2017
|
+
console.log('hiding minimap icon');
|
|
2018
|
+
this.minimapIconVisible = false;
|
|
2019
|
+
}
|
|
2020
|
+
showMinimapIcon() {
|
|
2021
|
+
console.log('showing minimap icon');
|
|
2022
|
+
this.minimapIconVisible = true;
|
|
2023
|
+
}
|
|
2006
2024
|
closeExplorer() {
|
|
2007
2025
|
this.explorerVisible = false;
|
|
2026
|
+
this.showMinimapIcon();
|
|
2008
2027
|
setTimeout(() => {
|
|
2009
2028
|
if (this.pendingLine > 0) {
|
|
2010
2029
|
this.editor.editor?.setPosition({ lineNumber: this.pendingLine, column: 1 });
|
|
@@ -2141,10 +2160,11 @@ let TheDoctor = class TheDoctor extends LitElement {
|
|
|
2141
2160
|
class="divider-vert"></sl-icon>
|
|
2142
2161
|
<div class="editor" slot="start">
|
|
2143
2162
|
|
|
2144
|
-
<sl-tooltip class="minimap-tip" content="Toggle source mini-map" hoist>
|
|
2163
|
+
<sl-tooltip class="minimap-tip" content="Toggle source mini-map" hoist style="${!this.minimapIconVisible ? 'display: none' : ''}">
|
|
2145
2164
|
<sl-icon-button @click="${this.minimapToggled}"
|
|
2146
2165
|
name="map"
|
|
2147
|
-
class="minimap-toggle ${this.minimapVisible ? 'active' : ''}"
|
|
2166
|
+
class="minimap-toggle ${this.minimapVisible ? 'active' : ''}"
|
|
2167
|
+
style="${!this.minimapIconVisible ? 'display: none' : ''}"></sl-icon-button>
|
|
2148
2168
|
</sl-tooltip>
|
|
2149
2169
|
|
|
2150
2170
|
${this.detailsDrawer}
|
|
@@ -2163,6 +2183,11 @@ let TheDoctor = class TheDoctor extends LitElement {
|
|
|
2163
2183
|
Ruleset ${rulesetPulsePill}
|
|
2164
2184
|
</sl-tab>
|
|
2165
2185
|
|
|
2186
|
+
<sl-tab slot="nav" panel="docs" class="tab" id="docs" @click="${this.hideMinimapIcon}">
|
|
2187
|
+
API Docs
|
|
2188
|
+
</sl-tab>
|
|
2189
|
+
|
|
2190
|
+
|
|
2166
2191
|
<sl-tab-panel name="spec" class="tab-panel">
|
|
2167
2192
|
<div class="main-view">
|
|
2168
2193
|
${this.statusBar}
|
|
@@ -2186,7 +2211,6 @@ let TheDoctor = class TheDoctor extends LitElement {
|
|
|
2186
2211
|
</div>
|
|
2187
2212
|
</div>
|
|
2188
2213
|
|
|
2189
|
-
|
|
2190
2214
|
<!-- EDITOR -->
|
|
2191
2215
|
<slot name="spec-editor"></slot>
|
|
2192
2216
|
<!-- EDITOR -->
|
|
@@ -2202,6 +2226,10 @@ let TheDoctor = class TheDoctor extends LitElement {
|
|
|
2202
2226
|
@mouseleave="${this.ungrabExplorer}">${this.explorer}
|
|
2203
2227
|
</sl-tab-panel>
|
|
2204
2228
|
|
|
2229
|
+
<sl-tab-panel name="docs" class="tab-panel" style="height: calc(100vh - 100px)">
|
|
2230
|
+
<iframe src="${this.doctorEndpoint}/model/scalar-template?z=${this.randomTicker}" width="100%" height="100%" style="border: none"></iframe>
|
|
2231
|
+
</sl-tab-panel>
|
|
2232
|
+
|
|
2205
2233
|
</sl-tab-group>
|
|
2206
2234
|
</div>
|
|
2207
2235
|
${mainPanelView}
|
|
@@ -2210,14 +2238,6 @@ let TheDoctor = class TheDoctor extends LitElement {
|
|
|
2210
2238
|
</sl-split-panel>
|
|
2211
2239
|
|
|
2212
2240
|
</div>`;
|
|
2213
|
-
//
|
|
2214
|
-
// docs <iframe src="/docs.html" width="100%" height="100%"
|
|
2215
|
-
// style="border: none"></iframe>
|
|
2216
|
-
// <sl-tab slot="nav" panel="docs" class="tab" id="docs">
|
|
2217
|
-
// Docs
|
|
2218
|
-
// </sl-tab>
|
|
2219
|
-
// <sl-tab-panel name="docs" class="tab-panel">
|
|
2220
|
-
// </sl-tab-panel>
|
|
2221
2241
|
}
|
|
2222
2242
|
fetchUrl(event) {
|
|
2223
2243
|
this.activeURL = event.detail.url;
|
|
@@ -2320,6 +2340,9 @@ __decorate([
|
|
|
2320
2340
|
__decorate([
|
|
2321
2341
|
query('#inspector-split-panel')
|
|
2322
2342
|
], TheDoctor.prototype, "splitPanelInspector", void 0);
|
|
2343
|
+
__decorate([
|
|
2344
|
+
state()
|
|
2345
|
+
], TheDoctor.prototype, "randomTicker", void 0);
|
|
2323
2346
|
__decorate([
|
|
2324
2347
|
state()
|
|
2325
2348
|
], TheDoctor.prototype, "rulesetPulse", void 0);
|
|
@@ -2329,6 +2352,9 @@ __decorate([
|
|
|
2329
2352
|
__decorate([
|
|
2330
2353
|
state()
|
|
2331
2354
|
], TheDoctor.prototype, "minimapVisible", void 0);
|
|
2355
|
+
__decorate([
|
|
2356
|
+
state()
|
|
2357
|
+
], TheDoctor.prototype, "minimapIconVisible", void 0);
|
|
2332
2358
|
__decorate([
|
|
2333
2359
|
state()
|
|
2334
2360
|
], TheDoctor.prototype, "activeURL", void 0);
|
|
@@ -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';
|