@pb33f/cowboy-components 0.3.4 → 0.4.0
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 +84 -0
- package/dist/assets/editor.worker-CYC0jP-p.js +12 -0
- package/dist/assets/equalizer.worker-CdIiiqfH.js +1 -0
- package/dist/assets/html.worker-C1BIaUKh.js +461 -0
- package/dist/assets/json.worker-BCyBlh8h.js +49 -0
- package/dist/assets/rule-documentation.worker-B7xOWY5M.js +1 -0
- package/dist/components/credit-ticker/credit-ticker.css.d.ts +2 -0
- package/dist/components/credit-ticker/credit-ticker.css.js +36 -0
- package/dist/components/credit-ticker/credit-ticker.d.ts +14 -0
- package/dist/components/credit-ticker/credit-ticker.js +88 -0
- package/dist/components/editor/editor-breadcrumb.css.d.ts +2 -0
- package/dist/components/editor/editor-breadcrumb.css.js +49 -0
- package/dist/components/editor/editor-breadcrumb.d.ts +9 -0
- package/dist/components/editor/editor-breadcrumb.js +60 -0
- package/dist/components/editor/editor.css.d.ts +2 -0
- package/dist/components/editor/editor.css.js +62 -0
- package/dist/components/editor/editor.d.ts +25 -4
- package/dist/components/editor/editor.js +412 -76
- package/dist/components/manage-ruleset/manage-ruleset.css.js +5 -0
- package/dist/components/manage-ruleset/manage-ruleset.js +8 -6
- package/dist/components/model-icon/model-icon.d.ts +7 -0
- package/dist/components/model-icon/model-icon.js +56 -7
- package/dist/components/model-renderer/clickable-ref.d.ts +2 -2
- package/dist/components/model-renderer/clickable-ref.js +5 -4
- package/dist/components/model-renderer/header.js +10 -10
- package/dist/components/model-renderer/operation.js +2 -2
- package/dist/components/model-renderer/rendered-node.css.js +1 -1
- package/dist/components/model-renderer/schema.js +1 -1
- package/dist/components/model-tree/tree.css.js +1 -0
- package/dist/components/model-tree/tree.d.ts +8 -0
- package/dist/components/model-tree/tree.js +232 -24
- package/dist/components/paginator/paginator.css.js +6 -2
- package/dist/components/paginator/paginator.d.ts +1 -0
- package/dist/components/paginator/paginator.js +8 -4
- package/dist/components/problem-list/details-drawer.css.js +1 -1
- package/dist/components/problem-list/problem-item.js +6 -3
- package/dist/components/problem-list/problem-label-view-filter.d.ts +2 -1
- package/dist/components/problem-list/problem-label-view-filter.js +1 -0
- package/dist/components/problem-list/problem-list.d.ts +1 -0
- package/dist/components/problem-list/problem-list.js +19 -1
- package/dist/components/problem-list/problem-mainview.css.js +1 -1
- package/dist/components/problem-list/problem-mainview.js +6 -0
- package/dist/components/problem-list/problem-sort-filter.d.ts +2 -1
- package/dist/components/problem-list/problem-sort-filter.js +1 -0
- package/dist/components/problems-overview/diagnostic-evaluation.css.js +14 -4
- package/dist/components/problems-overview/diagnostic-evaluation.js +42 -1
- package/dist/components/problems-overview/problems-overview.css.js +1 -0
- package/dist/components/the-doctor/nuke-workspace.d.ts +13 -0
- package/dist/components/the-doctor/nuke-workspace.js +70 -0
- package/dist/components/the-doctor/sparks.d.ts +1 -0
- package/dist/components/the-doctor/sparks.js +11 -2
- package/dist/components/the-doctor/status-bar.css.js +6 -5
- package/dist/components/the-doctor/the-doctor.css.js +117 -16
- package/dist/components/the-doctor/the-doctor.d.ts +70 -21
- package/dist/components/the-doctor/the-doctor.js +1026 -169
- package/dist/components/the-doctor/upload-archive.css.d.ts +2 -0
- package/dist/components/the-doctor/upload-archive.css.js +98 -0
- package/dist/components/the-doctor/upload-archive.d.ts +33 -0
- package/dist/components/the-doctor/upload-archive.js +281 -0
- package/dist/components/visualizer/equalizer.d.ts +3 -1
- package/dist/components/visualizer/equalizer.js +55 -31
- package/dist/components/visualizer/explorer.js +6 -5
- package/dist/cowboy-components.umd.cjs +1846 -1273
- package/dist/css/hr.css.d.ts +2 -0
- package/dist/css/hr.css.js +12 -0
- package/dist/css/pb33f-theme.css +1 -0
- package/dist/events/doctor.d.ts +19 -1
- package/dist/events/doctor.js +5 -0
- package/dist/model/channels.d.ts +1 -0
- package/dist/model/channels.js +1 -0
- package/dist/model/graph.d.ts +17 -0
- package/dist/model/graph.js +17 -1
- package/dist/model/link.d.ts +8 -0
- package/dist/model/node_type.d.ts +22 -1
- package/dist/model/node_type.js +22 -0
- package/dist/model/panel-state.d.ts +5 -0
- package/dist/model/panel-state.js +1 -0
- package/dist/model/problem.d.ts +3 -1
- package/dist/model/problem.js +4 -2
- package/dist/model/rolodex.d.ts +34 -0
- package/dist/model/rolodex.js +1 -0
- package/dist/services/linting-service.d.ts +1 -1
- package/dist/services/linting-service.js +23 -11
- package/dist/services/model-service.d.ts +8 -1
- package/dist/services/model-service.js +127 -0
- package/dist/style.css +1 -1
- package/dist/workers/equalizer.worker.js +4 -3
- package/dist/workers/rule-documentation.worker.d.ts +2 -2
- package/dist/workers/rule-documentation.worker.js +26 -15
- package/package.json +3 -3
- package/dist/assets/css.worker-B_qZXUzt.js +0 -84
- package/dist/assets/editor.worker-HEmB0D7P.js +0 -11
- package/dist/assets/equalizer.worker-icLzyXQ7.js +0 -1
- package/dist/assets/html.worker-D3WUrk8Q.js +0 -458
- package/dist/assets/json.worker-CAhUaBo4.js +0 -42
- package/dist/assets/rule-documentation.worker-D39NS8Lx.js +0 -1
|
@@ -77,12 +77,53 @@ let DiagnosticEvaluation = class DiagnosticEvaluation extends LitElement {
|
|
|
77
77
|
if (parsed === '') {
|
|
78
78
|
parsed = "No diagnosis available, looks like we're missing an OpenAPI specification";
|
|
79
79
|
}
|
|
80
|
+
let grade;
|
|
81
|
+
if (this.score > 95) {
|
|
82
|
+
grade = 'A+';
|
|
83
|
+
}
|
|
84
|
+
else if (this.score > 90 && this.score <= 95) {
|
|
85
|
+
grade = 'A';
|
|
86
|
+
}
|
|
87
|
+
else if (this.score > 85 && this.score <= 90) {
|
|
88
|
+
grade = 'B';
|
|
89
|
+
}
|
|
90
|
+
else if (this.score > 75 && this.score <= 85) {
|
|
91
|
+
grade = 'C';
|
|
92
|
+
}
|
|
93
|
+
else if (this.score > 65 && this.score <= 75) {
|
|
94
|
+
grade = 'D';
|
|
95
|
+
}
|
|
96
|
+
else if (this.score > 55 && this.score <= 65) {
|
|
97
|
+
grade = 'F';
|
|
98
|
+
}
|
|
99
|
+
else if (this.score > 25 && this.score <= 55) {
|
|
100
|
+
grade = '🤒';
|
|
101
|
+
}
|
|
102
|
+
else if (this.score >= 10 && this.score <= 25) {
|
|
103
|
+
grade = '🥵';
|
|
104
|
+
}
|
|
105
|
+
else if (this.score >= 5 && this.score < 10) {
|
|
106
|
+
grade = '😵';
|
|
107
|
+
}
|
|
108
|
+
else if (this.score >= 1 && this.score < 5) {
|
|
109
|
+
grade = '💀';
|
|
110
|
+
}
|
|
111
|
+
else {
|
|
112
|
+
if (this.evaluation === 'Useless') {
|
|
113
|
+
grade = '⛔';
|
|
114
|
+
score = 'invalid';
|
|
115
|
+
}
|
|
116
|
+
else {
|
|
117
|
+
grade = '⏱️';
|
|
118
|
+
}
|
|
119
|
+
}
|
|
80
120
|
return html `
|
|
81
121
|
<div class="diagnostic-evaluation">
|
|
82
122
|
<div class="diagnostic-score">
|
|
83
123
|
<label>Overall score</label>
|
|
84
124
|
<div class="score ${this.scoreClass()}">
|
|
85
|
-
<span>${score}</span
|
|
125
|
+
<span class="score-percent">${score}</span><br/>
|
|
126
|
+
<span class="score-grade">${grade}</span><br/>
|
|
86
127
|
</div>
|
|
87
128
|
<span>${evalString}</span>
|
|
88
129
|
</div>
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import '@shoelace-style/shoelace/dist/components/format-bytes/format-bytes.js';
|
|
2
|
+
import { LitElement } from "lit";
|
|
3
|
+
import SlDialog from "@shoelace-style/shoelace/dist/components/dialog/dialog.js";
|
|
4
|
+
export declare class NukeWorkspaceComponent extends LitElement {
|
|
5
|
+
static styles: import("lit").CSSResult[];
|
|
6
|
+
dialog: SlDialog | undefined;
|
|
7
|
+
visible: boolean;
|
|
8
|
+
constructor();
|
|
9
|
+
show(): void;
|
|
10
|
+
hide(): void;
|
|
11
|
+
nuke(): void;
|
|
12
|
+
render(): import("lit-html").TemplateResult<1>;
|
|
13
|
+
}
|
|
@@ -0,0 +1,70 @@
|
|
|
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/format-bytes/format-bytes.js';
|
|
8
|
+
import { customElement, property, query } from "lit/decorators.js";
|
|
9
|
+
import { html, LitElement } from "lit";
|
|
10
|
+
import dialogCss from "../../css/dialog.css";
|
|
11
|
+
import buttonCss from "../../css/button.css";
|
|
12
|
+
import { AttentionType } from "../attention-box/attention-box";
|
|
13
|
+
import hrCss from "../../css/hr.css";
|
|
14
|
+
import { NukeWorkspaceEvent } from "../../events/doctor";
|
|
15
|
+
let NukeWorkspaceComponent = class NukeWorkspaceComponent extends LitElement {
|
|
16
|
+
constructor() {
|
|
17
|
+
super();
|
|
18
|
+
this.visible = false;
|
|
19
|
+
}
|
|
20
|
+
show() {
|
|
21
|
+
this.visible = true;
|
|
22
|
+
this.dialog?.show();
|
|
23
|
+
}
|
|
24
|
+
hide() {
|
|
25
|
+
this.visible = false;
|
|
26
|
+
this.dialog?.hide();
|
|
27
|
+
}
|
|
28
|
+
nuke() {
|
|
29
|
+
this.dispatchEvent(new Event(NukeWorkspaceEvent));
|
|
30
|
+
}
|
|
31
|
+
render() {
|
|
32
|
+
return html `
|
|
33
|
+
<sl-dialog style="--width: 60vw; --height: 50vh">
|
|
34
|
+
<span slot="label" style="color: var(--error-color);"><sl-icon name="radioactive"
|
|
35
|
+
style="vertical-align: middle">
|
|
36
|
+
</sl-icon> Nuke workspace</span>
|
|
37
|
+
<p style="margin-top: 0; padding-top: 0">Things get messed up sometimes.</p>
|
|
38
|
+
|
|
39
|
+
<p>
|
|
40
|
+
To <strong>reset</strong> the workspace back to factory default, you can <strong>nuke it</strong>.
|
|
41
|
+
</p>
|
|
42
|
+
|
|
43
|
+
<hr/>
|
|
44
|
+
<pb33f-attention-box type="${AttentionType.Warning}" headerText="All changes will be lost">
|
|
45
|
+
The doctor will forget everything you have done and obliterate the workspace.
|
|
46
|
+
<p>
|
|
47
|
+
<strong>This cannot be un-done and cannot be restored, ever.</strong>
|
|
48
|
+
</p>
|
|
49
|
+
</pb33f-attention-box>
|
|
50
|
+
</p>
|
|
51
|
+
<hr/>
|
|
52
|
+
<sl-button class="danger" @click="${this.nuke}">Do it! Destroy it all
|
|
53
|
+
<sl-icon name="radioactive" slot="suffix"></sl-icon>
|
|
54
|
+
<sl-icon name="radioactive" slot="prefix"></sl-icon>
|
|
55
|
+
</sl-button>
|
|
56
|
+
<sl-button variant="primary" @click="${this.hide}" style="float: right">Cancel</sl-button>
|
|
57
|
+
</sl-dialog>`;
|
|
58
|
+
}
|
|
59
|
+
};
|
|
60
|
+
NukeWorkspaceComponent.styles = [dialogCss, buttonCss, hrCss];
|
|
61
|
+
__decorate([
|
|
62
|
+
query('sl-dialog')
|
|
63
|
+
], NukeWorkspaceComponent.prototype, "dialog", void 0);
|
|
64
|
+
__decorate([
|
|
65
|
+
property({ type: Boolean })
|
|
66
|
+
], NukeWorkspaceComponent.prototype, "visible", void 0);
|
|
67
|
+
NukeWorkspaceComponent = __decorate([
|
|
68
|
+
customElement("pb33f-nuke-workspace")
|
|
69
|
+
], NukeWorkspaceComponent);
|
|
70
|
+
export { NukeWorkspaceComponent };
|
|
@@ -4,7 +4,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
4
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
5
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
6
|
};
|
|
7
|
-
import { customElement } from "lit/decorators.js";
|
|
7
|
+
import { customElement, property } from "lit/decorators.js";
|
|
8
8
|
import { css, html, LitElement } from "lit";
|
|
9
9
|
let PixelSparks = class PixelSparks extends LitElement {
|
|
10
10
|
constructor() {
|
|
@@ -12,6 +12,7 @@ let PixelSparks = class PixelSparks extends LitElement {
|
|
|
12
12
|
this.sparkArray = [];
|
|
13
13
|
this.gravity = 0.0001;
|
|
14
14
|
this.spawnRate = 70;
|
|
15
|
+
this.isError = false;
|
|
15
16
|
}
|
|
16
17
|
firstUpdated() {
|
|
17
18
|
const canvas = this.renderRoot.querySelector('canvas');
|
|
@@ -32,11 +33,16 @@ let PixelSparks = class PixelSparks extends LitElement {
|
|
|
32
33
|
return Math.random() * (max - min) + min;
|
|
33
34
|
}
|
|
34
35
|
spawnSpark() {
|
|
36
|
+
let color = Math.random() > 0.5 ? 'rgb(248, 58, 255)' : 'rgb(98, 196, 255)';
|
|
37
|
+
if (this.isError) {
|
|
38
|
+
// create a color between
|
|
39
|
+
color = Math.random() > 0.5 ? 'rgb(255, 60, 116)' : 'rgb(157, 26, 65)';
|
|
40
|
+
}
|
|
35
41
|
this.sparkArray.push({
|
|
36
42
|
x: Math.random() * this.canvas.width,
|
|
37
43
|
y: -2,
|
|
38
44
|
size: 1,
|
|
39
|
-
color:
|
|
45
|
+
color: color,
|
|
40
46
|
velocityY: this.getRandomBetween(0.05, 0.3),
|
|
41
47
|
lifetime: 300,
|
|
42
48
|
initialLifetime: 300,
|
|
@@ -75,6 +81,9 @@ PixelSparks.styles = css `
|
|
|
75
81
|
image-rendering: pixelated; /* Ensures pixelated appearance */
|
|
76
82
|
}
|
|
77
83
|
`;
|
|
84
|
+
__decorate([
|
|
85
|
+
property({ type: Boolean })
|
|
86
|
+
], PixelSparks.prototype, "isError", void 0);
|
|
78
87
|
PixelSparks = __decorate([
|
|
79
88
|
customElement('pb33f-pixel-sparks')
|
|
80
89
|
], PixelSparks);
|
|
@@ -2,21 +2,22 @@ import { css } from "lit";
|
|
|
2
2
|
export default css `
|
|
3
3
|
.status-bar {
|
|
4
4
|
position: absolute;
|
|
5
|
-
bottom:
|
|
5
|
+
bottom: 8px;
|
|
6
6
|
left: 0;
|
|
7
7
|
width: 100%;
|
|
8
8
|
height: 20px;
|
|
9
9
|
background: var(--background-color);
|
|
10
10
|
border: 1px dashed var(--secondary-color);
|
|
11
|
-
z-index:
|
|
11
|
+
z-index: 100;
|
|
12
12
|
border-bottom: none;
|
|
13
|
-
font-size: 0.
|
|
14
|
-
padding:
|
|
13
|
+
font-size: 0.8rem;
|
|
14
|
+
padding: 4px 0 0 5px;
|
|
15
15
|
vertical-align: middle;
|
|
16
|
+
|
|
16
17
|
}
|
|
17
18
|
|
|
18
19
|
sl-icon {
|
|
19
|
-
vertical-align:
|
|
20
|
+
vertical-align: bottom;
|
|
20
21
|
font-size: 1rem;
|
|
21
22
|
}
|
|
22
23
|
|
|
@@ -20,9 +20,10 @@ export default css `
|
|
|
20
20
|
.problems {
|
|
21
21
|
position: relative;
|
|
22
22
|
display: block;
|
|
23
|
-
|
|
23
|
+
padding-left: 10px;
|
|
24
24
|
overflow: hidden;
|
|
25
25
|
width: 100%;
|
|
26
|
+
background-color: var(--background-color);
|
|
26
27
|
}
|
|
27
28
|
|
|
28
29
|
#manager-controls::part(nav) {
|
|
@@ -51,7 +52,7 @@ export default css `
|
|
|
51
52
|
|
|
52
53
|
sl-split-panel {
|
|
53
54
|
width: 100%;
|
|
54
|
-
|
|
55
|
+
// height: calc(100% - 65px);
|
|
55
56
|
--divider-width: 2px;
|
|
56
57
|
}
|
|
57
58
|
|
|
@@ -60,7 +61,7 @@ export default css `
|
|
|
60
61
|
background-color: var(--secondary-color);
|
|
61
62
|
}
|
|
62
63
|
|
|
63
|
-
sl-icon {
|
|
64
|
+
sl-icon.divider-vert {
|
|
64
65
|
position: absolute;
|
|
65
66
|
left: 2px;
|
|
66
67
|
border-radius: 0;
|
|
@@ -71,6 +72,17 @@ export default css `
|
|
|
71
72
|
height: 40px;
|
|
72
73
|
}
|
|
73
74
|
|
|
75
|
+
sl-icon.divider-horiz {
|
|
76
|
+
position: absolute;
|
|
77
|
+
border-radius: 0;
|
|
78
|
+
background: var(--secondary-color);
|
|
79
|
+
color: var(--background-color);
|
|
80
|
+
padding: 0;
|
|
81
|
+
width: 40px;
|
|
82
|
+
height: 8px;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
|
|
74
86
|
sl-split-panel::part(divider):focus-visible {
|
|
75
87
|
background-color: var(--primary-color);
|
|
76
88
|
}
|
|
@@ -87,7 +99,6 @@ export default css `
|
|
|
87
99
|
}
|
|
88
100
|
|
|
89
101
|
.model-tree {
|
|
90
|
-
height: calc(100vh - 95px);
|
|
91
102
|
overflow-x: auto;
|
|
92
103
|
overflow-y: auto;
|
|
93
104
|
}
|
|
@@ -108,6 +119,11 @@ export default css `
|
|
|
108
119
|
}
|
|
109
120
|
|
|
110
121
|
|
|
122
|
+
.split-panel-rolodex {
|
|
123
|
+
--min: 150px;
|
|
124
|
+
--max: calc(100% - 150px);
|
|
125
|
+
}
|
|
126
|
+
|
|
111
127
|
.split-panel {
|
|
112
128
|
--min: 550px;
|
|
113
129
|
--max: calc(100vw - 550px);
|
|
@@ -167,7 +183,8 @@ export default css `
|
|
|
167
183
|
}
|
|
168
184
|
|
|
169
185
|
.tab-panel {
|
|
170
|
-
height:
|
|
186
|
+
height: 100%;
|
|
187
|
+
width: 100%;
|
|
171
188
|
}
|
|
172
189
|
|
|
173
190
|
sl-tab-panel.tab-panel::part(base) {
|
|
@@ -251,7 +268,7 @@ export default css `
|
|
|
251
268
|
margin-top: 2px;
|
|
252
269
|
height: 10px;
|
|
253
270
|
}
|
|
254
|
-
|
|
271
|
+
|
|
255
272
|
.collapse-side {
|
|
256
273
|
position: absolute;
|
|
257
274
|
right: 5px;
|
|
@@ -266,41 +283,49 @@ export default css `
|
|
|
266
283
|
}
|
|
267
284
|
|
|
268
285
|
.controls {
|
|
286
|
+
position: relative;
|
|
269
287
|
display: flex;
|
|
270
|
-
margin-left:
|
|
271
|
-
padding-top:
|
|
288
|
+
margin-left: 0;
|
|
289
|
+
padding-top: 0;
|
|
272
290
|
font-size: 0.8rem;
|
|
273
|
-
height:
|
|
291
|
+
height: 24px;
|
|
274
292
|
border-bottom: 1px dashed var(--secondary-color-dimmer);
|
|
293
|
+
padding-bottom: 5px;
|
|
294
|
+
margin-bottom: 5px;
|
|
275
295
|
}
|
|
276
296
|
|
|
277
297
|
.url-input {
|
|
278
298
|
width: 50%;
|
|
279
299
|
}
|
|
280
|
-
|
|
300
|
+
|
|
281
301
|
.url-problem {
|
|
282
302
|
padding: 50px;
|
|
283
303
|
display: none;
|
|
284
304
|
}
|
|
285
|
-
|
|
305
|
+
|
|
286
306
|
#url-spinner {
|
|
287
307
|
padding: 5px 50px 5px 50px;
|
|
288
308
|
}
|
|
289
|
-
|
|
309
|
+
|
|
290
310
|
.main-view {
|
|
291
|
-
|
|
311
|
+
position: relative;
|
|
292
312
|
width: 100%;
|
|
293
|
-
height:
|
|
313
|
+
height: calc(100vh - 120px);
|
|
314
|
+
overflow: auto;
|
|
294
315
|
}
|
|
295
316
|
|
|
296
317
|
sl-button.url-input-button::part(base) {
|
|
297
318
|
margin-top: 0;
|
|
298
319
|
margin-left: 10px;
|
|
299
320
|
}
|
|
300
|
-
|
|
321
|
+
|
|
322
|
+
sl-button.upload-button {
|
|
323
|
+
margin-left: 10px;
|
|
324
|
+
}
|
|
325
|
+
|
|
301
326
|
.editor-url-overlay {
|
|
302
327
|
position: absolute;
|
|
303
|
-
height: calc(100% - 5px);
|
|
328
|
+
height: calc(100% - 5px);
|
|
304
329
|
width: 100%;
|
|
305
330
|
left: 0;
|
|
306
331
|
top: 0;
|
|
@@ -310,5 +335,81 @@ export default css `
|
|
|
310
335
|
-webkit-backdrop-filter: blur(2px);
|
|
311
336
|
background-color: var(--background-color-withopacity);
|
|
312
337
|
}
|
|
338
|
+
|
|
339
|
+
.import-button {
|
|
340
|
+
border: 0;
|
|
341
|
+
padding: 0;
|
|
342
|
+
font-size: 1rem;
|
|
343
|
+
width: calc(100% - 10px);
|
|
344
|
+
min-width: 100px;
|
|
345
|
+
}
|
|
346
|
+
|
|
347
|
+
.import-button::part(base) {
|
|
348
|
+
height: 5px;
|
|
349
|
+
line-height: 1.2rem;
|
|
350
|
+
margin-top: 0;
|
|
351
|
+
}
|
|
352
|
+
|
|
353
|
+
.minimap-toggle {
|
|
354
|
+
position: absolute;
|
|
355
|
+
right: 10px;
|
|
356
|
+
top: -5px;
|
|
357
|
+
z-index: 10;
|
|
358
|
+
}
|
|
359
|
+
|
|
360
|
+
sl-tooltip.minimap-tip::part(base) {
|
|
361
|
+
font-size: 1rem;
|
|
362
|
+
}
|
|
363
|
+
|
|
364
|
+
.minimap-toggle.active {
|
|
365
|
+
color: var(--warn-color)
|
|
366
|
+
}
|
|
367
|
+
|
|
368
|
+
.nuke-session-button {
|
|
369
|
+
font-size: 1.4rem;
|
|
370
|
+
margin: 0 10px 0 10px;
|
|
371
|
+
}
|
|
372
|
+
|
|
373
|
+
.nuke-session-button::part(base) {
|
|
374
|
+
padding: 0;
|
|
375
|
+
}
|
|
376
|
+
|
|
377
|
+
.nuke-session-button::part(base):hover {
|
|
378
|
+
color: var(--error-color);
|
|
379
|
+
}
|
|
380
|
+
|
|
381
|
+
pb33f-credit-ticker {
|
|
382
|
+
position: fixed;
|
|
383
|
+
display: inline-block;
|
|
384
|
+
bottom: 26px;
|
|
385
|
+
padding-left: 10px;
|
|
386
|
+
padding-top: 6px;
|
|
387
|
+
left: 0;
|
|
388
|
+
z-index: 20;
|
|
389
|
+
width: 100px;
|
|
390
|
+
height: 20px;
|
|
391
|
+
font-size: 0.8rem;
|
|
392
|
+
color: var(--terminal-text);
|
|
393
|
+
background-color: var(--background-color-withopacity);
|
|
394
|
+
|
|
395
|
+
}
|
|
396
|
+
|
|
397
|
+
.url-spinner-icon {
|
|
398
|
+
display: block;
|
|
399
|
+
margin: 20px auto 0 auto;
|
|
400
|
+
width: 200px;
|
|
401
|
+
color: var(--primary-color);
|
|
402
|
+
font-size: 5rem;
|
|
403
|
+
animation: spin 2s linear infinite;
|
|
404
|
+
}
|
|
405
|
+
|
|
406
|
+
@keyframes spin {
|
|
407
|
+
0% {
|
|
408
|
+
transform: rotate(0deg);
|
|
409
|
+
}
|
|
410
|
+
100% {
|
|
411
|
+
transform: rotate(360deg);
|
|
412
|
+
}
|
|
413
|
+
}
|
|
313
414
|
|
|
314
415
|
`;
|
|
@@ -8,22 +8,30 @@ import '@shoelace-style/shoelace/dist/components/alert/alert.js';
|
|
|
8
8
|
import '@shoelace-style/shoelace/dist/components/badge/badge.js';
|
|
9
9
|
import '@shoelace-style/shoelace/dist/components/avatar/avatar.js';
|
|
10
10
|
import { LitElement } from "lit";
|
|
11
|
-
import {
|
|
11
|
+
import { SpecEditor } from "../editor/editor.js";
|
|
12
|
+
import { AddToastEvent, ArchiveURLRequestedEvent, DocumentReference, EditorUpdatedEvent, ExplorerEqualizerChangedEvent, NodeClickedEvent, NodeReferenceEvent, ProblemRuleFilterChangedEvent, RuleClickedEvent, RulesetSavedEvent } from "../../events/doctor.js";
|
|
12
13
|
import { ProblemDrawerEvent } from "../problem-list/details-drawer.js";
|
|
14
|
+
import { Problem } from "../../model/problem.js";
|
|
13
15
|
import { SlButton, SlDialog, SlIcon, SlInput, SlRadioGroup, SlSplitPanel, SlTab, SlTabGroup } from "@shoelace-style/shoelace";
|
|
14
16
|
import { PlatformError } from "../../model/errors.js";
|
|
15
17
|
import { AttentionBox } from "../attention-box/attention-box.js";
|
|
16
18
|
import { Toast } from "../../model/toast.js";
|
|
17
19
|
import SlIconButton from "@shoelace-style/shoelace/dist/components/icon-button/icon-button.js";
|
|
18
|
-
import { Node } from "../../model/graph.js";
|
|
20
|
+
import { Node, Reference } from "../../model/graph.js";
|
|
19
21
|
import { ModelTree } from "../model-tree/tree.js";
|
|
20
22
|
import { ExplorerComponent } from "../visualizer/explorer.js";
|
|
21
23
|
import { RenderedNodeComponent } from "../model-renderer/rendered-node.js";
|
|
22
24
|
import { BusCallback, CommandResponse } from "@pb33f/ranch";
|
|
23
25
|
export declare const GraphBag = "pb33f-doctor-graph";
|
|
26
|
+
export declare const PanelStateBag = "pb33f-doctor-panel-state";
|
|
27
|
+
export declare const RolodexResponseBag = "pb33f-doctor-rolodex-response";
|
|
28
|
+
export declare const RolodexFilesBag = "pb33f-doctor-rolodex-files";
|
|
29
|
+
export declare const RolodexStateBag = "pb33f-doctor-rolodex-state";
|
|
30
|
+
export declare const ReferenceMapBag = "pb33f-doctor-reference-map";
|
|
24
31
|
export declare const DoctorDocumentBag = "pb33f-doctor-editor";
|
|
25
32
|
export declare const HowToFixBag = "pb33f-doctor-howtofix";
|
|
26
33
|
export declare const FunctionDocumentationBag = "pb33f-doctor-funcdocs";
|
|
34
|
+
export declare const DocumentationExpirationBag = "pb33f-doctor-doc-expiration";
|
|
27
35
|
export declare const RuleDocumentationBag = "pb33f-doctor-ruledocs";
|
|
28
36
|
export declare const DiagnosticBag = "pb33f-doctor-diagnostic";
|
|
29
37
|
export declare const DefaultRulesetBag = "pb33f-doctor-default-ruleset";
|
|
@@ -34,8 +42,8 @@ export declare const FunctionsSchemaBag = "pb33f-doctor-function-schema";
|
|
|
34
42
|
export declare const CustomRulesetBag = "pb33f-doctor-custom-ruleset";
|
|
35
43
|
export declare const RuleConfigurationBag = "pb33f-doctor-rule-configuration";
|
|
36
44
|
export declare const SessionRulesetMapBag = "pb33f-doctor-session-rulesetmap";
|
|
37
|
-
export declare const DefaultDocument = "document";
|
|
38
|
-
export declare const DocumentProblems = "problems";
|
|
45
|
+
export declare const DefaultDocument = "pb33f-doctor-document";
|
|
46
|
+
export declare const DocumentProblems = "pb33f-doctor-problems";
|
|
39
47
|
export declare const DoctorEndpoint = "doctor-endpoint";
|
|
40
48
|
export declare class TheDoctor extends LitElement {
|
|
41
49
|
static styles: import("lit").CSSResult[];
|
|
@@ -53,30 +61,50 @@ export declare class TheDoctor extends LitElement {
|
|
|
53
61
|
urlInputButton: SlButton;
|
|
54
62
|
urlInput: SlInput;
|
|
55
63
|
private unavailable;
|
|
64
|
+
urlOverlay: HTMLElement;
|
|
65
|
+
urlProblem: HTMLElement;
|
|
66
|
+
urlSpinner: HTMLDivElement;
|
|
67
|
+
urlErrorCode: number;
|
|
68
|
+
urlErrorMessage: string;
|
|
56
69
|
doctorEndpoint: string;
|
|
57
70
|
exportRulesetDialog: SlDialog;
|
|
58
71
|
collapseButton: SlIconButton;
|
|
59
72
|
splitDivider: SlIcon;
|
|
60
73
|
splitPanel: SlSplitPanel;
|
|
74
|
+
splitPanelExplorer: SlSplitPanel;
|
|
75
|
+
splitPanelRolodex: SlSplitPanel;
|
|
76
|
+
splitPanelInspector: SlSplitPanel;
|
|
61
77
|
private rulesetPulse;
|
|
62
78
|
explorerVisible: boolean;
|
|
79
|
+
minimapVisible: boolean;
|
|
63
80
|
explorerBooted: boolean;
|
|
64
81
|
activeURL: string;
|
|
82
|
+
rolodexNeedsReset: boolean;
|
|
83
|
+
editor: SpecEditor;
|
|
84
|
+
rolodexRoot: Node;
|
|
85
|
+
rolodexProblemMap: Map<string, Problem[]>;
|
|
86
|
+
private readonly uploadArchive;
|
|
87
|
+
private readonly nukeWorkspace;
|
|
65
88
|
private readonly errorBanner;
|
|
66
89
|
private bagManager;
|
|
67
|
-
|
|
68
|
-
private readonly rulesetEditor;
|
|
90
|
+
rulesetEditor: SpecEditor;
|
|
69
91
|
private docBag;
|
|
70
92
|
private problemBag;
|
|
71
93
|
private diagnosticBag;
|
|
72
|
-
private
|
|
94
|
+
private defaultRulesetBag;
|
|
73
95
|
private OWASPRulesetBag;
|
|
74
|
-
private
|
|
75
|
-
private
|
|
76
|
-
private
|
|
77
|
-
private
|
|
78
|
-
private
|
|
96
|
+
private allRulesetBag;
|
|
97
|
+
private customRulesetBag;
|
|
98
|
+
private functionsBag;
|
|
99
|
+
private functionSchemaBag;
|
|
100
|
+
private ruleConfigBag;
|
|
79
101
|
private howToFixBag;
|
|
102
|
+
private rolodexResponseBag;
|
|
103
|
+
private rolodexFilesBag;
|
|
104
|
+
private rolodexStateBag;
|
|
105
|
+
private referenceMapBag;
|
|
106
|
+
private panelStateBag;
|
|
107
|
+
private docExpirationBag;
|
|
80
108
|
private graphBag;
|
|
81
109
|
private ruleDocsBag;
|
|
82
110
|
private functionDocsBag;
|
|
@@ -84,6 +112,7 @@ export declare class TheDoctor extends LitElement {
|
|
|
84
112
|
private readonly problemsOverview;
|
|
85
113
|
private readonly problemList;
|
|
86
114
|
private readonly detailsDrawer;
|
|
115
|
+
private readonly creditTicker;
|
|
87
116
|
private ruleDocsWorker;
|
|
88
117
|
private debounceTime;
|
|
89
118
|
private debounceTimeRuleset;
|
|
@@ -96,16 +125,19 @@ export declare class TheDoctor extends LitElement {
|
|
|
96
125
|
private readonly manageRuleset;
|
|
97
126
|
private defaultRuleset;
|
|
98
127
|
private OWASPRuleset;
|
|
99
|
-
private
|
|
100
|
-
private
|
|
128
|
+
private allRuleset;
|
|
129
|
+
private customRuleset;
|
|
101
130
|
private functions;
|
|
102
131
|
private readonly toastManager;
|
|
103
132
|
private editorMap;
|
|
104
133
|
private selectedEditorTab;
|
|
105
134
|
private sidebarClosed;
|
|
135
|
+
private importDisabled;
|
|
106
136
|
renderedNodeMap: Map<string, Node>;
|
|
107
137
|
selectedNodeHashId: string;
|
|
108
138
|
modelTree: ModelTree;
|
|
139
|
+
rolodexTree: ModelTree;
|
|
140
|
+
references: Reference[];
|
|
109
141
|
explorer: ExplorerComponent;
|
|
110
142
|
nodeMap: Map<string, Node>;
|
|
111
143
|
nodeIdMap: Map<string, Node>;
|
|
@@ -115,23 +147,41 @@ export declare class TheDoctor extends LitElement {
|
|
|
115
147
|
activeNode: Node;
|
|
116
148
|
private readonly bus;
|
|
117
149
|
private readonly specStreamChannel;
|
|
150
|
+
private readonly creditStreamChannel;
|
|
118
151
|
private readonly doctorServiceChannel;
|
|
119
152
|
private specChannelSubscription;
|
|
120
153
|
private doctorChannelSubscription;
|
|
154
|
+
private creditChannelSubscription;
|
|
121
155
|
private brokerConnectionId;
|
|
122
156
|
private readonly busPort;
|
|
123
157
|
private readonly busHost;
|
|
124
158
|
private readonly busVersion;
|
|
125
159
|
private useTLS;
|
|
126
160
|
readonly nodeLimit: number;
|
|
161
|
+
private pendingLine;
|
|
162
|
+
private rolodexDividerPosition;
|
|
127
163
|
constructor(doctorEndpoint?: string);
|
|
164
|
+
nukeWorkspaceHandler(): void;
|
|
165
|
+
minimapToggled(): void;
|
|
166
|
+
firstUpdated(): void;
|
|
128
167
|
whoAmI(): void;
|
|
129
168
|
protected connectToBroker(): void;
|
|
130
169
|
addClickTrack(node: Node): void;
|
|
170
|
+
addRefTrack(ref: string): void;
|
|
131
171
|
doctorServiceHandler(): BusCallback<CommandResponse>;
|
|
172
|
+
startTheDoctor(): void;
|
|
132
173
|
specStreamHandler(): BusCallback<CommandResponse>;
|
|
174
|
+
creditStreamHandler(): BusCallback<CommandResponse>;
|
|
175
|
+
private _firstRun;
|
|
133
176
|
filterTreeModel(event: CustomEvent<ExplorerEqualizerChangedEvent>): void;
|
|
177
|
+
documentReferenceClicked(evt: CustomEvent<DocumentReference>): void;
|
|
134
178
|
explorerReferenceClicked(evt: CustomEvent<NodeReferenceEvent>): void;
|
|
179
|
+
rolodexRootPath: string;
|
|
180
|
+
rolodexRootHash: string;
|
|
181
|
+
rolodexActivePath: string | undefined;
|
|
182
|
+
rolodexActiveHash: string | undefined;
|
|
183
|
+
rolodexTreeNodeClicked(evt: CustomEvent<NodeClickedEvent>): void;
|
|
184
|
+
rolodexRootFileSelected(evt: CustomEvent<NodeClickedEvent>): void;
|
|
135
185
|
modelTreeNodeClicked(evt: CustomEvent<NodeClickedEvent>): void;
|
|
136
186
|
explorerNodeClicked(evt: CustomEvent<NodeClickedEvent>): void;
|
|
137
187
|
exportRuleset(): void;
|
|
@@ -140,7 +190,12 @@ export declare class TheDoctor extends LitElement {
|
|
|
140
190
|
ruleGroupClicked(event: CustomEvent<ProblemRuleFilterChangedEvent>): void;
|
|
141
191
|
ruleDocsClicked(event: CustomEvent<ProblemDrawerEvent>): void;
|
|
142
192
|
rulesetSaved(evt: CustomEvent<RulesetSavedEvent>): void;
|
|
193
|
+
private buildRolodexResultMap;
|
|
143
194
|
private lintSpec;
|
|
195
|
+
updateInspectorDivider(): void;
|
|
196
|
+
updateExplorerDivider(): void;
|
|
197
|
+
updateRolodexDivider(): void;
|
|
198
|
+
private updateRefmapBag;
|
|
144
199
|
private platformUnavailable;
|
|
145
200
|
private specClicked;
|
|
146
201
|
private problemClicked;
|
|
@@ -170,14 +225,8 @@ export declare class TheDoctor extends LitElement {
|
|
|
170
225
|
toggleExplorer(): void;
|
|
171
226
|
closeExplorer(): void;
|
|
172
227
|
render(): import("lit-html").TemplateResult<1>;
|
|
173
|
-
fetchUrl(): void;
|
|
174
|
-
urlOverlay: HTMLElement;
|
|
175
|
-
urlProblem: HTMLElement;
|
|
176
|
-
urlSpinner: HTMLDivElement;
|
|
177
|
-
urlErrorCode: number;
|
|
178
|
-
urlErrorMessage: string;
|
|
228
|
+
fetchUrl(event: CustomEvent<ArchiveURLRequestedEvent>): void;
|
|
179
229
|
hideUrlError(): void;
|
|
180
230
|
showUrlError(e: PlatformError): void;
|
|
181
|
-
validateUrl(evt: KeyboardEvent): void;
|
|
182
231
|
ungrabExplorer(): void;
|
|
183
232
|
}
|