@pb33f/cowboy-components 0.1.8 → 0.1.10
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/components/attention-box/attention-box.d.ts +5 -0
- package/dist/components/attention-box/attention-box.js +28 -5
- package/dist/components/footer/footer.css.d.ts +2 -0
- package/dist/components/footer/footer.css.js +21 -0
- package/dist/components/footer/footer.d.ts +8 -0
- package/dist/components/footer/footer.js +36 -0
- package/dist/components/header/header.css.js +98 -89
- package/dist/components/header/header.d.ts +1 -0
- package/dist/components/header/header.js +6 -2
- package/dist/components/the-doctor/activity-spinner.d.ts +8 -0
- package/dist/components/the-doctor/activity-spinner.js +43 -0
- package/dist/components/the-doctor/feedback.css.d.ts +2 -0
- package/dist/components/the-doctor/feedback.css.js +30 -0
- package/dist/components/the-doctor/feedback.d.ts +14 -0
- package/dist/components/the-doctor/feedback.js +83 -0
- package/dist/components/the-doctor/status-bar.js +2 -1
- package/dist/components/the-doctor/the-doctor.css.js +7 -3
- package/dist/components/the-doctor/the-doctor.d.ts +7 -1
- package/dist/components/the-doctor/the-doctor.js +58 -7
- package/dist/cowboy-components.d.ts +1 -0
- package/dist/cowboy-components.js +1 -0
- package/dist/cowboy-components.umd.cjs +480 -368
- package/dist/css/cowboy-components.css +0 -17
- package/dist/model/feedback.d.ts +4 -0
- package/dist/model/feedback.js +2 -0
- package/dist/services/feedback-service.d.ts +5 -0
- package/dist/services/feedback-service.js +30 -0
- package/dist/services/linting-service.d.ts +1 -0
- package/dist/services/linting-service.js +15 -0
- package/dist/style.css +1 -1
- package/package.json +1 -1
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { LitElement } from 'lit';
|
|
2
|
+
import { SlAlert } from "@shoelace-style/shoelace";
|
|
2
3
|
export declare enum AttentionType {
|
|
3
4
|
Context = "context",
|
|
4
5
|
Info = "info",
|
|
@@ -12,7 +13,11 @@ export declare class AttentionBox extends LitElement {
|
|
|
12
13
|
static styles: import("lit").CSSResult[];
|
|
13
14
|
type: AttentionType;
|
|
14
15
|
headerText: string;
|
|
16
|
+
closeable: boolean;
|
|
17
|
+
alert: SlAlert;
|
|
15
18
|
constructor();
|
|
19
|
+
hide(): void;
|
|
20
|
+
show(): void;
|
|
16
21
|
getIcon(): "braces-asterisk" | "info-square" | "exclamation-triangle" | "exclamation-square" | "check-square" | "question-square";
|
|
17
22
|
render(): import("lit-html").TemplateResult<1>;
|
|
18
23
|
}
|
|
@@ -5,7 +5,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
5
5
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
6
|
};
|
|
7
7
|
import { LitElement, html } from 'lit';
|
|
8
|
-
import { customElement, property } from 'lit/decorators.js';
|
|
8
|
+
import { customElement, property, query } from 'lit/decorators.js';
|
|
9
9
|
import attentionBoxCss from "./attention-box.css.js";
|
|
10
10
|
import alertsCss from "../../css/alerts.css.js";
|
|
11
11
|
export var AttentionType;
|
|
@@ -23,6 +23,13 @@ let AttentionBox = class AttentionBox extends LitElement {
|
|
|
23
23
|
super();
|
|
24
24
|
this.type = AttentionType.Context;
|
|
25
25
|
//this.headerText = 'information'
|
|
26
|
+
this.closeable = false;
|
|
27
|
+
}
|
|
28
|
+
hide() {
|
|
29
|
+
this.alert.hide();
|
|
30
|
+
}
|
|
31
|
+
show() {
|
|
32
|
+
this.alert.show();
|
|
26
33
|
}
|
|
27
34
|
getIcon() {
|
|
28
35
|
switch (this.type) {
|
|
@@ -53,13 +60,23 @@ let AttentionBox = class AttentionBox extends LitElement {
|
|
|
53
60
|
if (this.headerText?.length > 0) {
|
|
54
61
|
header = html `<strong>${this.headerText}</strong>`;
|
|
55
62
|
}
|
|
56
|
-
|
|
57
|
-
<
|
|
58
|
-
|
|
63
|
+
let alert = html `
|
|
64
|
+
<sl-alert class="${this.type}" open>
|
|
65
|
+
<sl-icon slot="icon" name="${this.getIcon()}" class="${this.headerText ? '' : 'noheader'}"></sl-icon>
|
|
66
|
+
${header}
|
|
67
|
+
<slot></slot>
|
|
68
|
+
</sl-alert>`;
|
|
69
|
+
if (this.closeable) {
|
|
70
|
+
alert = html `
|
|
71
|
+
<sl-alert class="${this.type}" open closable>
|
|
59
72
|
<sl-icon slot="icon" name="${this.getIcon()}" class="${this.headerText ? '' : 'noheader'}"></sl-icon>
|
|
60
73
|
${header}
|
|
61
74
|
<slot></slot>
|
|
62
|
-
</sl-alert
|
|
75
|
+
</sl-alert>`;
|
|
76
|
+
}
|
|
77
|
+
return html `
|
|
78
|
+
<div class='attention ${this.type}'>
|
|
79
|
+
${alert}
|
|
63
80
|
</div>
|
|
64
81
|
`;
|
|
65
82
|
}
|
|
@@ -71,6 +88,12 @@ __decorate([
|
|
|
71
88
|
__decorate([
|
|
72
89
|
property()
|
|
73
90
|
], AttentionBox.prototype, "headerText", void 0);
|
|
91
|
+
__decorate([
|
|
92
|
+
property({ type: Boolean })
|
|
93
|
+
], AttentionBox.prototype, "closeable", void 0);
|
|
94
|
+
__decorate([
|
|
95
|
+
query('sl-alert')
|
|
96
|
+
], AttentionBox.prototype, "alert", void 0);
|
|
74
97
|
AttentionBox = __decorate([
|
|
75
98
|
customElement('pb33f-attention-box')
|
|
76
99
|
], AttentionBox);
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { css } from "lit";
|
|
2
|
+
export default css `
|
|
3
|
+
footer {
|
|
4
|
+
padding: var(--footer-padding);
|
|
5
|
+
width: 100vw;
|
|
6
|
+
font-size: var(--footer-font-size);
|
|
7
|
+
height: var(--footer-height);
|
|
8
|
+
position: fixed;
|
|
9
|
+
bottom: 0;
|
|
10
|
+
background-color: var(--background-color);
|
|
11
|
+
z-index: 10;
|
|
12
|
+
border-top: 1px dashed var(--secondary-color);
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
footer > .generated-timestamp {
|
|
16
|
+
float: right;
|
|
17
|
+
margin-right: 15px;
|
|
18
|
+
font-weight: normal;
|
|
19
|
+
color: var(--font-color-sub2);
|
|
20
|
+
}
|
|
21
|
+
`;
|
|
@@ -0,0 +1,36 @@
|
|
|
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 { customElement, property } from "lit/decorators.js";
|
|
8
|
+
import { html, LitElement } from "lit";
|
|
9
|
+
import footerCss from "./footer.css.js";
|
|
10
|
+
import linksCss from "../../css/links.css";
|
|
11
|
+
let FooterComponent = class FooterComponent extends LitElement {
|
|
12
|
+
constructor() {
|
|
13
|
+
super();
|
|
14
|
+
this.url = 'https://pb33f.io';
|
|
15
|
+
this.build = '';
|
|
16
|
+
}
|
|
17
|
+
render() {
|
|
18
|
+
const date = new Date().getFullYear();
|
|
19
|
+
return html `
|
|
20
|
+
<footer>
|
|
21
|
+
©${date} <a href="${this.url}">princess b33f heavy industries</a>
|
|
22
|
+
<span class="generated-timestamp">${this.build}</span>
|
|
23
|
+
</footer>`;
|
|
24
|
+
}
|
|
25
|
+
};
|
|
26
|
+
FooterComponent.styles = [footerCss, linksCss];
|
|
27
|
+
__decorate([
|
|
28
|
+
property()
|
|
29
|
+
], FooterComponent.prototype, "build", void 0);
|
|
30
|
+
__decorate([
|
|
31
|
+
property()
|
|
32
|
+
], FooterComponent.prototype, "url", void 0);
|
|
33
|
+
FooterComponent = __decorate([
|
|
34
|
+
customElement('pb33f-footer')
|
|
35
|
+
], FooterComponent);
|
|
36
|
+
export { FooterComponent };
|
|
@@ -1,102 +1,111 @@
|
|
|
1
1
|
import { css } from "lit";
|
|
2
2
|
export default css `
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
a:hover {
|
|
9
|
-
color: var(--primary-color);
|
|
10
|
-
text-decoration: underline;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
header.pb33f-header {
|
|
14
|
-
display: flex;
|
|
15
|
-
height: 57px;
|
|
16
|
-
flex-direction: row;
|
|
17
|
-
z-index: 1;
|
|
18
|
-
background-color: var(--background-color);
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
header.pb33f-header > .logo {
|
|
22
|
-
width: 170px;
|
|
23
|
-
min-width: 170px;
|
|
24
|
-
padding: 9px 0 10px 10px;
|
|
25
|
-
border-bottom: 1px dashed var(--secondary-color);
|
|
26
|
-
height: 36px;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
header.pb33f-header > .logo .caret {
|
|
30
|
-
font-size: 1.6em;
|
|
31
|
-
color: var(--secondary-color)
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
header.pb33f-header > .logo .name {
|
|
35
|
-
font-size: 1.7em;
|
|
36
|
-
font-family: var(--font-stack-bold),sans-serif;
|
|
37
|
-
color: var(--primary-color);
|
|
38
|
-
text-shadow: 0 0 10px var(--primary-color-text-shadow), 0 0 10px var(--primary-color-text-shadow);
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
header.pb33f-header > .logo .name > a {
|
|
42
|
-
text-decoration: none;
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
header.pb33f-header > .logo .name > a:hover {
|
|
46
|
-
text-decoration: underline;
|
|
47
|
-
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
header.pb33f-header > .logo .name > a:active {
|
|
51
|
-
text-decoration: underline;
|
|
52
|
-
color: var(--secondary-color);
|
|
53
|
-
text-shadow: 0 0 5px var(--secondary-color-text-shadow), 0 0 10px var(--secondary-color-text-shadow-outer);
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
header.pb33f-header > .logo .name::after {
|
|
57
|
-
content: "";
|
|
58
|
-
-webkit-animation: cursor .8s infinite;
|
|
59
|
-
animation: cursor .8s infinite;
|
|
60
|
-
background: var(--primary-color);
|
|
61
|
-
border-radius: 0;
|
|
62
|
-
display: inline-block;
|
|
63
|
-
height: 0.9em;
|
|
64
|
-
margin-left: 0.2em;
|
|
65
|
-
width: 3px;
|
|
66
|
-
bottom: -2px;
|
|
67
|
-
position: relative;
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
header .header-space {
|
|
71
|
-
height: 55px;
|
|
72
|
-
flex-grow: 2;
|
|
73
|
-
border-bottom: 1px dashed var(--secondary-color);
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
@-webkit-keyframes cursor {
|
|
77
|
-
0% {
|
|
78
|
-
opacity: 0;
|
|
3
|
+
a, a:visited, a:active {
|
|
4
|
+
text-decoration: none;
|
|
5
|
+
color: var(--primary-color);
|
|
79
6
|
}
|
|
80
7
|
|
|
81
|
-
|
|
82
|
-
|
|
8
|
+
a:hover {
|
|
9
|
+
color: var(--primary-color);
|
|
10
|
+
text-decoration: underline;
|
|
83
11
|
}
|
|
84
12
|
|
|
85
|
-
|
|
86
|
-
|
|
13
|
+
header.pb33f-header {
|
|
14
|
+
display: flex;
|
|
15
|
+
height: 57px;
|
|
16
|
+
flex-direction: row;
|
|
17
|
+
z-index: 1;
|
|
18
|
+
background-color: var(--background-color);
|
|
87
19
|
}
|
|
88
|
-
}
|
|
89
20
|
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
21
|
+
header.pb33f-header > .logo {
|
|
22
|
+
width: 170px;
|
|
23
|
+
min-width: 170px;
|
|
24
|
+
padding: 9px 0 10px 10px;
|
|
25
|
+
border-bottom: 1px dashed var(--secondary-color);
|
|
26
|
+
height: 36px;
|
|
93
27
|
}
|
|
94
28
|
|
|
95
|
-
|
|
96
|
-
|
|
29
|
+
header.pb33f-header > .logo.wide {
|
|
30
|
+
width: 300px;
|
|
97
31
|
}
|
|
98
32
|
|
|
99
|
-
|
|
100
|
-
|
|
33
|
+
header.pb33f-header > .logo .caret {
|
|
34
|
+
font-size: 1.6em;
|
|
35
|
+
color: var(--secondary-color)
|
|
101
36
|
}
|
|
102
|
-
|
|
37
|
+
|
|
38
|
+
header.pb33f-header > .logo .name {
|
|
39
|
+
font-size: 1.7em;
|
|
40
|
+
font-family: var(--font-stack-bold), sans-serif;
|
|
41
|
+
color: var(--primary-color);
|
|
42
|
+
text-shadow: 0 0 10px var(--primary-color-text-shadow), 0 0 10px var(--primary-color-text-shadow);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
header.pb33f-header > .logo .name > sl-icon {
|
|
46
|
+
vertical-align: middle;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
header.pb33f-header > .logo .name > a {
|
|
51
|
+
text-decoration: none;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
header.pb33f-header > .logo .name > a:hover {
|
|
55
|
+
text-decoration: underline;
|
|
56
|
+
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
header.pb33f-header > .logo .name > a:active {
|
|
60
|
+
text-decoration: underline;
|
|
61
|
+
color: var(--secondary-color);
|
|
62
|
+
text-shadow: 0 0 5px var(--secondary-color-text-shadow), 0 0 10px var(--secondary-color-text-shadow-outer);
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
header.pb33f-header > .logo .name::after {
|
|
66
|
+
content: "";
|
|
67
|
+
-webkit-animation: cursor .8s infinite;
|
|
68
|
+
animation: cursor .8s infinite;
|
|
69
|
+
background: var(--primary-color);
|
|
70
|
+
border-radius: 0;
|
|
71
|
+
display: inline-block;
|
|
72
|
+
height: 0.9em;
|
|
73
|
+
margin-left: 0.2em;
|
|
74
|
+
width: 3px;
|
|
75
|
+
bottom: -2px;
|
|
76
|
+
position: relative;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
header .header-space {
|
|
80
|
+
height: 55px;
|
|
81
|
+
flex-grow: 2;
|
|
82
|
+
border-bottom: 1px dashed var(--secondary-color);
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
@-webkit-keyframes cursor {
|
|
86
|
+
0% {
|
|
87
|
+
opacity: 0;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
50% {
|
|
91
|
+
opacity: 1;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
to {
|
|
95
|
+
opacity: 0;
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
@keyframes cursor {
|
|
100
|
+
0% {
|
|
101
|
+
opacity: 0;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
50% {
|
|
105
|
+
opacity: 1;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
to {
|
|
109
|
+
opacity: 0;
|
|
110
|
+
}
|
|
111
|
+
}`;
|
|
@@ -12,11 +12,12 @@ let HeaderComponent = class HeaderComponent extends LitElement {
|
|
|
12
12
|
super();
|
|
13
13
|
this.name = 'pb33f';
|
|
14
14
|
this.url = 'https://pb33f.io';
|
|
15
|
+
this.wide = false;
|
|
15
16
|
}
|
|
16
17
|
render() {
|
|
17
|
-
return html `
|
|
18
|
+
return html `
|
|
18
19
|
<header class="pb33f-header">
|
|
19
|
-
<div class="logo">
|
|
20
|
+
<div class="logo ${this.wide ? 'wide' : ''}">
|
|
20
21
|
<span class="caret">$</span>
|
|
21
22
|
<span class="name"><a href="${this.url}">${this.name}</a></span>
|
|
22
23
|
</div>
|
|
@@ -33,6 +34,9 @@ __decorate([
|
|
|
33
34
|
__decorate([
|
|
34
35
|
property()
|
|
35
36
|
], HeaderComponent.prototype, "url", void 0);
|
|
37
|
+
__decorate([
|
|
38
|
+
property({ type: Boolean })
|
|
39
|
+
], HeaderComponent.prototype, "wide", void 0);
|
|
36
40
|
HeaderComponent = __decorate([
|
|
37
41
|
customElement('pb33f-header')
|
|
38
42
|
], HeaderComponent);
|
|
@@ -0,0 +1,43 @@
|
|
|
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 { customElement, state } from "lit/decorators.js";
|
|
8
|
+
import { html, LitElement } from "lit";
|
|
9
|
+
let ActivitySpinner = class ActivitySpinner extends LitElement {
|
|
10
|
+
constructor() {
|
|
11
|
+
super();
|
|
12
|
+
this.visible = false;
|
|
13
|
+
}
|
|
14
|
+
show() {
|
|
15
|
+
if (!this.visible) {
|
|
16
|
+
this.visible = true;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
hide() {
|
|
20
|
+
if (this.visible) {
|
|
21
|
+
this.visible = false;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
render() {
|
|
25
|
+
if (this.visible) {
|
|
26
|
+
return html `
|
|
27
|
+
<sl-spinner style="font-size: 1rem;
|
|
28
|
+
--indicator-color: var(--primary-color);
|
|
29
|
+
--track-color: var(--secondary-color);"></sl-spinner>
|
|
30
|
+
`;
|
|
31
|
+
}
|
|
32
|
+
else {
|
|
33
|
+
return html ``;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
__decorate([
|
|
38
|
+
state()
|
|
39
|
+
], ActivitySpinner.prototype, "visible", void 0);
|
|
40
|
+
ActivitySpinner = __decorate([
|
|
41
|
+
customElement('pb33f-activity-spinner')
|
|
42
|
+
], ActivitySpinner);
|
|
43
|
+
export { ActivitySpinner };
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { css } from "lit";
|
|
2
|
+
export default css `
|
|
3
|
+
.feedback {
|
|
4
|
+
font-size: 0.9rem;
|
|
5
|
+
padding: 10px;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
h2 {
|
|
9
|
+
margin-top:0;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
sl-textarea::part(base) {
|
|
13
|
+
font-family: var(--font-stack), monospace;
|
|
14
|
+
border-radius: 0;
|
|
15
|
+
margin-top: 10px;
|
|
16
|
+
margin-bottom: 10px;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
sl-input::part(base) {
|
|
20
|
+
font-family: var(--font-stack), monospace;
|
|
21
|
+
border-radius: 0;
|
|
22
|
+
font-size: 0.9rem;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
sl-input::part(form-control-label) {
|
|
26
|
+
font-family: var(--font-stack), monospace;
|
|
27
|
+
border-radius: 0;
|
|
28
|
+
font-size: 0.9rem;
|
|
29
|
+
}
|
|
30
|
+
`;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import '@shoelace-style/shoelace/dist/components/textarea/textarea.js';
|
|
2
|
+
import { LitElement } from "lit";
|
|
3
|
+
import { SlButton, SlInput, SlTextarea } from "@shoelace-style/shoelace";
|
|
4
|
+
export declare class FeedbackComponent extends LitElement {
|
|
5
|
+
static styles: import("lit").CSSResult[];
|
|
6
|
+
textArea: SlTextarea;
|
|
7
|
+
emailInput: SlInput;
|
|
8
|
+
sendButton: SlButton;
|
|
9
|
+
sent: boolean;
|
|
10
|
+
constructor();
|
|
11
|
+
toggleButton(): void;
|
|
12
|
+
send(): void;
|
|
13
|
+
render(): import("lit-html").TemplateResult<1>;
|
|
14
|
+
}
|
|
@@ -0,0 +1,83 @@
|
|
|
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 '@shoelace-style/shoelace/dist/components/textarea/textarea.js';
|
|
8
|
+
import { customElement, query, state } from "lit/decorators.js";
|
|
9
|
+
import { html, LitElement } from "lit";
|
|
10
|
+
import feedbackCss from "./feedback.css.js";
|
|
11
|
+
import buttonCss from "../../css/button.css";
|
|
12
|
+
import sharedCss from "../../css/shared.css";
|
|
13
|
+
import { FeedbackService } from "@/services/feedback-service";
|
|
14
|
+
let FeedbackComponent = class FeedbackComponent extends LitElement {
|
|
15
|
+
constructor() {
|
|
16
|
+
super();
|
|
17
|
+
this.sent = false;
|
|
18
|
+
}
|
|
19
|
+
toggleButton() {
|
|
20
|
+
this.sendButton.disabled = !(this.textArea.value.length > 0 && this.textArea.value.trim() !== '');
|
|
21
|
+
}
|
|
22
|
+
send() {
|
|
23
|
+
this.sendButton.loading = true;
|
|
24
|
+
FeedbackService.sendFeedback(this.emailInput.value, this.textArea.value).then(() => {
|
|
25
|
+
this.sendButton.loading = false;
|
|
26
|
+
this.sent = true;
|
|
27
|
+
}).catch((error) => {
|
|
28
|
+
console.error("unable to send feedback: ", error);
|
|
29
|
+
this.sendButton.loading = false;
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
render() {
|
|
33
|
+
if (!this.sent) {
|
|
34
|
+
return html `
|
|
35
|
+
<div class="feedback">
|
|
36
|
+
<h2>Penny for your thoughts?</h2>
|
|
37
|
+
<p>
|
|
38
|
+
This is an <strong>early preview</strong>, lots more functionality and capability is coming
|
|
39
|
+
soon. In
|
|
40
|
+
the meantime
|
|
41
|
+
Your feedback about this tool would be <strong>most welcome</strong>.
|
|
42
|
+
</p>
|
|
43
|
+
<p>
|
|
44
|
+
Everything you see has been built from the ground up by a single person, <em>please be kind</em>.
|
|
45
|
+
</p>
|
|
46
|
+
<hr/>
|
|
47
|
+
<sl-input label="Email (optional)" placeholder="your@email.com"></sl-input>
|
|
48
|
+
<sl-textarea placeholder="What do you like? What do you hate? What would make the doctor better?"
|
|
49
|
+
size="small" @sl-input="${this.toggleButton}">
|
|
50
|
+
</sl-textarea>
|
|
51
|
+
<sl-button @click="${this.send}" disabled>Send Feedback</sl-button>
|
|
52
|
+
</div>
|
|
53
|
+
`;
|
|
54
|
+
}
|
|
55
|
+
else {
|
|
56
|
+
return html `
|
|
57
|
+
<div class="feedback">
|
|
58
|
+
<pb33f-attention-box type="success" headerText="Feedback Sent!">
|
|
59
|
+
Thank you, it is most appreciated. Your thoughts have been delivered directly to
|
|
60
|
+
<a href="https://quobix.com">quobix</a> via discord.
|
|
61
|
+
</pb33f-attention-box>
|
|
62
|
+
</div>
|
|
63
|
+
`;
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
};
|
|
67
|
+
FeedbackComponent.styles = [buttonCss, feedbackCss, sharedCss];
|
|
68
|
+
__decorate([
|
|
69
|
+
query('sl-textarea')
|
|
70
|
+
], FeedbackComponent.prototype, "textArea", void 0);
|
|
71
|
+
__decorate([
|
|
72
|
+
query('sl-input')
|
|
73
|
+
], FeedbackComponent.prototype, "emailInput", void 0);
|
|
74
|
+
__decorate([
|
|
75
|
+
query('sl-button')
|
|
76
|
+
], FeedbackComponent.prototype, "sendButton", void 0);
|
|
77
|
+
__decorate([
|
|
78
|
+
state()
|
|
79
|
+
], FeedbackComponent.prototype, "sent", void 0);
|
|
80
|
+
FeedbackComponent = __decorate([
|
|
81
|
+
customElement('pb33f-feedback')
|
|
82
|
+
], FeedbackComponent);
|
|
83
|
+
export { FeedbackComponent };
|
|
@@ -8,6 +8,7 @@ import { customElement, property, query } from "lit/decorators.js";
|
|
|
8
8
|
import { html, LitElement } from "lit";
|
|
9
9
|
import statusBarCss from "./status-bar.css.js";
|
|
10
10
|
import linksCss from "../../css/links.css.js";
|
|
11
|
+
import buttonCss from "../../css/button.css";
|
|
11
12
|
let StatusBar = class StatusBar extends LitElement {
|
|
12
13
|
constructor() {
|
|
13
14
|
super();
|
|
@@ -55,7 +56,7 @@ let StatusBar = class StatusBar extends LitElement {
|
|
|
55
56
|
}
|
|
56
57
|
}
|
|
57
58
|
};
|
|
58
|
-
StatusBar.styles = [statusBarCss, linksCss];
|
|
59
|
+
StatusBar.styles = [statusBarCss, linksCss, buttonCss];
|
|
59
60
|
__decorate([
|
|
60
61
|
property({ type: Boolean })
|
|
61
62
|
], StatusBar.prototype, "visible", void 0);
|
|
@@ -9,6 +9,7 @@ import { LitElement } from "lit";
|
|
|
9
9
|
import { EditorUpdatedEvent, ProblemRuleFilterChangedEvent } from "../../events/doctor.js";
|
|
10
10
|
import { ProblemDrawerEvent } from "../problem-list/details-drawer.js";
|
|
11
11
|
import { SlSwitch, SlTab, SlTabGroup } from "@shoelace-style/shoelace";
|
|
12
|
+
import { AttentionBox } from "../attention-box/attention-box";
|
|
12
13
|
export declare const DoctorDocumentBag = "pb33f-doctor-editor";
|
|
13
14
|
export declare const HowToFixBag = "pb33f-doctor-howtofix";
|
|
14
15
|
export declare const RuleDocumentationBag = "pb33f-doctor-ruledocs";
|
|
@@ -23,9 +24,10 @@ export declare class TheDoctor extends LitElement {
|
|
|
23
24
|
problemsPanel: SlTab;
|
|
24
25
|
tabGroup: SlTabGroup;
|
|
25
26
|
owaspSwitch: SlSwitch;
|
|
27
|
+
welcomeBox: AttentionBox;
|
|
26
28
|
private unavailable;
|
|
27
29
|
doctorEndpoint: string;
|
|
28
|
-
private errorBanner;
|
|
30
|
+
private readonly errorBanner;
|
|
29
31
|
private bagManager;
|
|
30
32
|
private readonly editor;
|
|
31
33
|
private docBag;
|
|
@@ -44,6 +46,8 @@ export declare class TheDoctor extends LitElement {
|
|
|
44
46
|
private OWASPEnabled;
|
|
45
47
|
private readonly statusBar;
|
|
46
48
|
private session;
|
|
49
|
+
private readonly feedback;
|
|
50
|
+
private readonly activitySpinner;
|
|
47
51
|
constructor(doctorEndpoint?: string);
|
|
48
52
|
ruleGroupClicked(event: CustomEvent<ProblemRuleFilterChangedEvent>): void;
|
|
49
53
|
ruleDocsClicked(event: CustomEvent<ProblemDrawerEvent>): void;
|
|
@@ -55,5 +59,7 @@ export declare class TheDoctor extends LitElement {
|
|
|
55
59
|
private fetchDocs;
|
|
56
60
|
specChanged(event: CustomEvent<EditorUpdatedEvent>): void;
|
|
57
61
|
toggleOWASP(): void;
|
|
62
|
+
boostrap(): void;
|
|
58
63
|
render(): import("lit-html").TemplateResult<1>;
|
|
64
|
+
closeWelcome(): void;
|
|
59
65
|
}
|