@pb33f/cowboy-components 0.0.13 → 0.1.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/abap-DXvTa7XC.js +1404 -0
- package/dist/apex-DsQH3mjJ.js +332 -0
- package/dist/assets/css.worker-B_qZXUzt.js +84 -0
- package/dist/assets/editor.worker-HEmB0D7P.js +11 -0
- package/dist/assets/html.worker-D3WUrk8Q.js +458 -0
- package/dist/assets/json.worker-CAhUaBo4.js +42 -0
- package/dist/assets/rule-documentation.worker-BFIxMBU8.js +1 -0
- package/dist/assets/search-problems.worker-VJi4P9Gj.js +1 -0
- package/dist/azcli-Cir32SBk.js +74 -0
- package/dist/bat-BsNExolo.js +106 -0
- package/dist/bicep-2KcKzeQF.js +108 -0
- package/dist/cameligo-D0ezznwE.js +180 -0
- package/dist/clojure-DxYzAIlu.js +767 -0
- package/dist/coffee-DgiPTF3g.js +238 -0
- package/dist/components/changelog/release.css.js +3 -3
- package/dist/components/editor/editor.d.ts +27 -0
- package/dist/components/editor/editor.js +192 -0
- package/dist/components/error-banner/error-banner.css.d.ts +2 -0
- package/dist/components/error-banner/error-banner.css.js +23 -0
- package/dist/components/error-banner/error-banner.d.ts +9 -0
- package/dist/components/error-banner/error-banner.js +40 -0
- package/dist/components/kv-view/kv-view.css.js +4 -0
- package/dist/components/paginator/paginator-events.d.ts +4 -0
- package/dist/components/paginator/paginator-events.js +4 -0
- package/dist/components/paginator/paginator-navigator.css.d.ts +2 -0
- package/dist/components/paginator/paginator-navigator.css.js +35 -0
- package/dist/components/paginator/paginator-navigator.d.ts +27 -0
- package/dist/components/paginator/paginator-navigator.js +168 -0
- package/dist/components/paginator/paginator.css.d.ts +2 -0
- package/dist/components/paginator/paginator.css.js +38 -0
- package/dist/components/paginator/paginator.d.ts +22 -0
- package/dist/components/paginator/paginator.js +122 -0
- package/dist/components/percent-bar/percent-bar.css.d.ts +2 -0
- package/dist/components/percent-bar/percent-bar.css.js +65 -0
- package/dist/components/percent-bar/percent-bar.d.ts +11 -0
- package/dist/components/percent-bar/percent-bar.js +85 -0
- package/dist/components/problem-list/details-drawer.css.d.ts +2 -0
- package/dist/components/problem-list/details-drawer.css.js +42 -0
- package/dist/components/problem-list/details-drawer.d.ts +22 -0
- package/dist/components/problem-list/details-drawer.js +66 -0
- package/dist/components/problem-list/filter.css.d.ts +2 -0
- package/dist/components/problem-list/filter.css.js +67 -0
- package/dist/components/problem-list/problem-item.css.d.ts +2 -0
- package/dist/components/problem-list/problem-item.css.js +170 -0
- package/dist/components/problem-list/problem-item.d.ts +27 -0
- package/dist/components/problem-list/problem-item.js +126 -0
- package/dist/components/problem-list/problem-label-view-filter.css.d.ts +2 -0
- package/dist/components/problem-list/problem-label-view-filter.css.js +6 -0
- package/dist/components/problem-list/problem-label-view-filter.d.ts +18 -0
- package/dist/components/problem-list/problem-label-view-filter.js +66 -0
- package/dist/components/problem-list/problem-list.css.d.ts +2 -0
- package/dist/components/problem-list/problem-list.css.js +59 -0
- package/dist/components/problem-list/problem-list.d.ts +37 -0
- package/dist/components/problem-list/problem-list.js +334 -0
- package/dist/components/problem-list/problem-mainview.css.d.ts +2 -0
- package/dist/components/problem-list/problem-mainview.css.js +100 -0
- package/dist/components/problem-list/problem-mainview.d.ts +20 -0
- package/dist/components/problem-list/problem-mainview.js +126 -0
- package/dist/components/problem-list/problem-rule-filter.d.ts +13 -0
- package/dist/components/problem-list/problem-rule-filter.js +67 -0
- package/dist/components/problem-list/problem-search-filter.d.ts +13 -0
- package/dist/components/problem-list/problem-search-filter.js +45 -0
- package/dist/components/problem-list/problem-sort-filter.d.ts +19 -0
- package/dist/components/problem-list/problem-sort-filter.js +67 -0
- package/dist/components/problem-list/problem-toolbar.css.d.ts +2 -0
- package/dist/components/problem-list/problem-toolbar.css.js +41 -0
- package/dist/components/problem-list/problem-toolbar.d.ts +14 -0
- package/dist/components/problem-list/problem-toolbar.js +63 -0
- package/dist/components/problem-list/shared.css.d.ts +2 -0
- package/dist/components/problem-list/shared.css.js +91 -0
- package/dist/components/problems-overview/diagnostic-evaluation.css.d.ts +2 -0
- package/dist/components/problems-overview/diagnostic-evaluation.css.js +178 -0
- package/dist/components/problems-overview/diagnostic-evaluation.d.ts +13 -0
- package/dist/components/problems-overview/diagnostic-evaluation.js +119 -0
- package/dist/components/problems-overview/document-statistic.css.d.ts +2 -0
- package/dist/components/problems-overview/document-statistic.css.js +16 -0
- package/dist/components/problems-overview/document-statistic.d.ts +10 -0
- package/dist/components/problems-overview/document-statistic.js +49 -0
- package/dist/components/problems-overview/problem-overview-group.css.d.ts +2 -0
- package/dist/components/problems-overview/problem-overview-group.css.js +84 -0
- package/dist/components/problems-overview/problem-overview-group.d.ts +17 -0
- package/dist/components/problems-overview/problem-overview-group.js +121 -0
- package/dist/components/problems-overview/problem-statistic.css.d.ts +2 -0
- package/dist/components/problems-overview/problem-statistic.css.js +40 -0
- package/dist/components/problems-overview/problem-statistic.d.ts +11 -0
- package/dist/components/problems-overview/problem-statistic.js +57 -0
- package/dist/components/problems-overview/problem-statistics.css.d.ts +2 -0
- package/dist/components/problems-overview/problem-statistics.css.js +46 -0
- package/dist/components/problems-overview/problem-statistics.d.ts +14 -0
- package/dist/components/problems-overview/problem-statistics.js +132 -0
- package/dist/components/problems-overview/problems-overview.css.d.ts +2 -0
- package/dist/components/problems-overview/problems-overview.css.js +49 -0
- package/dist/components/problems-overview/problems-overview.d.ts +21 -0
- package/dist/components/problems-overview/problems-overview.js +108 -0
- package/dist/components/render-json-path/render-json-path.css.d.ts +2 -0
- package/dist/components/render-json-path/render-json-path.css.js +86 -0
- package/dist/components/render-json-path/render-json-path.d.ts +11 -0
- package/dist/components/render-json-path/render-json-path.js +105 -0
- package/dist/components/the-doctor/settings.d.ts +5 -0
- package/dist/components/the-doctor/settings.js +22 -0
- package/dist/components/the-doctor/status-bar.css.d.ts +2 -0
- package/dist/components/the-doctor/status-bar.css.js +47 -0
- package/dist/components/the-doctor/status-bar.d.ts +12 -0
- package/dist/components/the-doctor/status-bar.js +71 -0
- package/dist/components/the-doctor/the-doctor.css.d.ts +2 -0
- package/dist/components/the-doctor/the-doctor.css.js +156 -0
- package/dist/components/the-doctor/the-doctor.d.ts +57 -0
- package/dist/components/the-doctor/the-doctor.js +340 -0
- package/dist/cowboy-components-FcPnnXMU.js +114388 -0
- package/dist/cowboy-components.d.ts +5 -2
- package/dist/cowboy-components.js +8 -2
- package/dist/cowboy-components.umd.cjs +4004 -106
- package/dist/cpp-Bq-GnYlH.js +407 -0
- package/dist/csharp-IDcibKAT.js +332 -0
- package/dist/csp-QdYr8JWa.js +59 -0
- package/dist/css/button.css.d.ts +2 -0
- package/dist/css/button.css.js +34 -0
- package/dist/css/chroma-synxtax.css.d.ts +2 -0
- package/dist/css/chroma-synxtax.css.js +130 -0
- package/dist/css/cowboy-components.css +3 -0
- package/dist/css/links.css.d.ts +2 -0
- package/dist/css/links.css.js +17 -0
- package/dist/css/lists.css.d.ts +2 -0
- package/dist/css/lists.css.js +43 -0
- package/dist/css/pb33f-theme.css +2 -2
- package/dist/css/syntax.css.js +1 -1
- package/dist/css-C-wMMefI.js +193 -0
- package/dist/cssMode-DcUlnXpV.js +1541 -0
- package/dist/cypher-BfBo9yir.js +269 -0
- package/dist/dart-Cv3rVfv_.js +287 -0
- package/dist/dockerfile-DyCXBGhV.js +136 -0
- package/dist/ecl-COP_iObm.js +462 -0
- package/dist/elixir-DoEhbk9F.js +575 -0
- package/dist/events/doctor.d.ts +51 -0
- package/dist/events/doctor.js +17 -0
- package/dist/flow9-DuHGSNW1.js +148 -0
- package/dist/freemarker2-sY6FVddl.js +995 -0
- package/dist/fsharp-Dv9PDxVO.js +223 -0
- package/dist/go-CcdAeqiK.js +224 -0
- package/dist/graphql-CoRm4b1H.js +157 -0
- package/dist/handlebars-BqznQEC5.js +425 -0
- package/dist/hcl-BSgAhV5f.js +189 -0
- package/dist/html-DBpY_ZT1.js +314 -0
- package/dist/htmlMode-Cf0lYQWN.js +1551 -0
- package/dist/ini-ewx9HLIq.js +77 -0
- package/dist/java-B5lwcbTy.js +238 -0
- package/dist/javascript-DRgEI2Yf.js +76 -0
- package/dist/jsonMode-CmuECwTh.js +1958 -0
- package/dist/julia-NCcg_P_q.js +517 -0
- package/dist/kotlin-BYlnmGrb.js +259 -0
- package/dist/less-DG4tqgOo.js +168 -0
- package/dist/lexon-CTTPcJLv.js +163 -0
- package/dist/liquid-DWVJYCIL.js +246 -0
- package/dist/lua-CxQ1RWuo.js +168 -0
- package/dist/m3-mHFfpmgx.js +216 -0
- package/dist/markdown-Dh6sYULt.js +235 -0
- package/dist/mdx-Bjcj5AvL.js +171 -0
- package/dist/mips-CNUcjHD1.js +204 -0
- package/dist/model/document-statistics.d.ts +40 -0
- package/dist/model/document-statistics.js +4 -0
- package/dist/model/how_to_fix.d.ts +4 -0
- package/dist/model/how_to_fix.js +1 -0
- package/dist/model/problem.d.ts +19 -0
- package/dist/model/problem.js +106 -0
- package/dist/model/rule_documentation.d.ts +5 -0
- package/dist/model/rule_documentation.js +1 -0
- package/dist/model/session.d.ts +5 -0
- package/dist/model/session.js +1 -0
- package/dist/msdax-ZvxFeKvs.js +381 -0
- package/dist/mysql-COjg31sJ.js +884 -0
- package/dist/objective-c-BqrCFBhT.js +189 -0
- package/dist/pascal-CUpkilAS.js +257 -0
- package/dist/pascaligo-nJfvRJ7x.js +170 -0
- package/dist/perl-CWsX6Ysg.js +632 -0
- package/dist/pgsql-DwgpEXC8.js +857 -0
- package/dist/php-CrbKyd62.js +506 -0
- package/dist/pla-JxXT6Kb-.js +143 -0
- package/dist/postiats-BOdnTRGv.js +913 -0
- package/dist/powerquery-DTkwcXGH.js +896 -0
- package/dist/powershell-Cx53dGpt.js +245 -0
- package/dist/protobuf-Dp9vE-l-.js +426 -0
- package/dist/pug-BSjKVjwP.js +408 -0
- package/dist/python-CiN6iAi3.js +282 -0
- package/dist/qsharp-C5P1RxY3.js +291 -0
- package/dist/r-sEMYnclc.js +249 -0
- package/dist/razor-B4jDf_4z.js +556 -0
- package/dist/redis-DbzUc-fU.js +308 -0
- package/dist/redshift-nrLijj1O.js +815 -0
- package/dist/restructuredtext-CIbGUl6T.js +180 -0
- package/dist/ruby-JcYJisWg.js +517 -0
- package/dist/rust-BgbFBFXH.js +349 -0
- package/dist/sb-hRFFChi7.js +121 -0
- package/dist/scala-Cs0yVo3Q.js +376 -0
- package/dist/scheme-l_0jNtxy.js +114 -0
- package/dist/scss-C4l7ZIRR.js +268 -0
- package/dist/services/linting-service.d.ts +12 -0
- package/dist/services/linting-service.js +121 -0
- package/dist/shell-ikLk_l24.js +227 -0
- package/dist/solidity-4GxCaH9e.js +1373 -0
- package/dist/sophia-tX0WEZsZ.js +205 -0
- package/dist/sparql-D7ky-uMk.js +207 -0
- package/dist/sql-CqEfBVGS.js +859 -0
- package/dist/st-CNWQPqyI.js +422 -0
- package/dist/style.css +1 -1
- package/dist/swift-C_fDfC0d.js +318 -0
- package/dist/systemverilog-gAvsEtN_.js +582 -0
- package/dist/tcl-KbBChuA6.js +238 -0
- package/dist/tsMode-29i0IHrU.js +886 -0
- package/dist/twig-Bb652BpM.js +398 -0
- package/dist/typescript-FDohSLaF.js +349 -0
- package/dist/vb-2e5hSeUh.js +378 -0
- package/dist/wgsl-CYSDq0zg.js +445 -0
- package/dist/workers/rule-documentation.worker.d.ts +1 -0
- package/dist/workers/rule-documentation.worker.js +85 -0
- package/dist/workers/search-problems.worker.d.ts +1 -0
- package/dist/workers/search-problems.worker.js +19 -0
- package/dist/xml-BdgdiRK4.js +101 -0
- package/dist/yaml-CJDq-Ud3.js +212 -0
- package/package.json +6 -4
|
@@ -0,0 +1,108 @@
|
|
|
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, query } from "lit/decorators.js";
|
|
8
|
+
import { html, LitElement } from "lit";
|
|
9
|
+
import { Problem } from "@/model/problem";
|
|
10
|
+
import { ProblemStatisticsComponent } from "./problem-statistics";
|
|
11
|
+
import './diagnostic-evaluation.js';
|
|
12
|
+
import '@/components/percent-bar/percent-bar.js';
|
|
13
|
+
import { ProblemOverviewGroup } from "./problem-overview-group";
|
|
14
|
+
import problemsOverviewCss from "./problems-overview.css";
|
|
15
|
+
import { Paginator } from "@/components/paginator/paginator";
|
|
16
|
+
import { DrDiagnostics } from "@/model/document-statistics";
|
|
17
|
+
let ProblemsOverview = class ProblemsOverview extends LitElement {
|
|
18
|
+
constructor() {
|
|
19
|
+
super();
|
|
20
|
+
this.problemList = [];
|
|
21
|
+
this.problemStatistics = new ProblemStatisticsComponent();
|
|
22
|
+
this.problemOverviewGroups = [];
|
|
23
|
+
this.paginator = new Paginator();
|
|
24
|
+
this.paginator.label = "Rules";
|
|
25
|
+
this.unavailable = false;
|
|
26
|
+
}
|
|
27
|
+
willUpdate() {
|
|
28
|
+
this.problemStatistics.drDiagnostics = this.statistics;
|
|
29
|
+
this.problemStatistics.problems = this.problemList;
|
|
30
|
+
}
|
|
31
|
+
buildProblemOverviewGroups(problems) {
|
|
32
|
+
let problemOverviewGroups = new Map();
|
|
33
|
+
for (let i = 0; i < problems.length; i++) {
|
|
34
|
+
let problem = problems[i];
|
|
35
|
+
let rule = problem.problemObject.source;
|
|
36
|
+
if (problemOverviewGroups.has(rule)) {
|
|
37
|
+
let group = problemOverviewGroups.get(rule);
|
|
38
|
+
group.totalViolations++;
|
|
39
|
+
group.problems.push(problem);
|
|
40
|
+
}
|
|
41
|
+
else {
|
|
42
|
+
const group = new ProblemOverviewGroup();
|
|
43
|
+
group.groupName = problem.problemObject.source;
|
|
44
|
+
group.totalViolations = 1;
|
|
45
|
+
group.problems = [problem];
|
|
46
|
+
problemOverviewGroups.set(rule, group);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
// now we need to calculate the percentage of violations for each group
|
|
50
|
+
let totalViolations = problems.length;
|
|
51
|
+
for (let group of problemOverviewGroups.values()) {
|
|
52
|
+
group.violationPercent = Math.round((group.totalViolations / totalViolations) * 100);
|
|
53
|
+
}
|
|
54
|
+
const values = Array.from(problemOverviewGroups.values());
|
|
55
|
+
// order by violations
|
|
56
|
+
values.sort((a, b) => {
|
|
57
|
+
return b.totalViolations - a.totalViolations;
|
|
58
|
+
});
|
|
59
|
+
// stack rank.
|
|
60
|
+
for (let i = 0; i < values.length; i++) {
|
|
61
|
+
values[i].rank = i + 1;
|
|
62
|
+
}
|
|
63
|
+
return values;
|
|
64
|
+
}
|
|
65
|
+
set problems(value) {
|
|
66
|
+
this.problemList = value;
|
|
67
|
+
this.problemOverviewGroups = this.buildProblemOverviewGroups(value);
|
|
68
|
+
this.paginator.values = this.problemOverviewGroups;
|
|
69
|
+
this.paginator.itemsPerPage = 10;
|
|
70
|
+
}
|
|
71
|
+
render() {
|
|
72
|
+
if (this.unavailable) {
|
|
73
|
+
return html `
|
|
74
|
+
<div class="overview-container unavailable">
|
|
75
|
+
<sl-icon name="sign-stop" class="stop"></sl-icon>
|
|
76
|
+
<p>The doctor is <strong>unavailable</strong>.</p>
|
|
77
|
+
</div>`;
|
|
78
|
+
}
|
|
79
|
+
return html `
|
|
80
|
+
<div class="overview-container">
|
|
81
|
+
${this.problemStatistics}
|
|
82
|
+
<pb33f-diagnostic-evaluation
|
|
83
|
+
score="${this.statistics?.statistics.overallScore}"
|
|
84
|
+
evaluation="${this.statistics?.evaluation}"
|
|
85
|
+
diagnosis="${this.statistics?.diagnosis}"
|
|
86
|
+
></pb33f-diagnostic-evaluation>
|
|
87
|
+
<div class="paginator">${this.paginator}</div>
|
|
88
|
+
</div>
|
|
89
|
+
`;
|
|
90
|
+
}
|
|
91
|
+
};
|
|
92
|
+
ProblemsOverview.styles = [problemsOverviewCss];
|
|
93
|
+
__decorate([
|
|
94
|
+
property({ type: Problem })
|
|
95
|
+
], ProblemsOverview.prototype, "problemList", void 0);
|
|
96
|
+
__decorate([
|
|
97
|
+
query('sl-resize-observer')
|
|
98
|
+
], ProblemsOverview.prototype, "resizeObserver", void 0);
|
|
99
|
+
__decorate([
|
|
100
|
+
property({ type: DrDiagnostics })
|
|
101
|
+
], ProblemsOverview.prototype, "statistics", void 0);
|
|
102
|
+
__decorate([
|
|
103
|
+
property({ type: Boolean })
|
|
104
|
+
], ProblemsOverview.prototype, "unavailable", void 0);
|
|
105
|
+
ProblemsOverview = __decorate([
|
|
106
|
+
customElement("pb33f-problems-overview")
|
|
107
|
+
], ProblemsOverview);
|
|
108
|
+
export { ProblemsOverview };
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import { css } from "lit";
|
|
2
|
+
export default css `
|
|
3
|
+
:host {
|
|
4
|
+
color: var(--font-color);
|
|
5
|
+
font-family: var(--font-stack), monospace;
|
|
6
|
+
background: none;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
.jsonpath {
|
|
10
|
+
background: none;
|
|
11
|
+
border: none;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
.jsonpath:hover {
|
|
15
|
+
color: var(--font-color);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.jsonpath.selected:hover {
|
|
19
|
+
color: var(--background-color);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
.bracket {
|
|
23
|
+
color: var(--secondary-color);
|
|
24
|
+
font-family: var(--font-stack-bold), monospace;
|
|
25
|
+
text-shadow: 0 0 10px var(--secondary-color);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.bracket-nested {
|
|
29
|
+
color: var(--tertiary-color);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
.param {
|
|
33
|
+
color: var(--primary-color);
|
|
34
|
+
font-family: var(--font-stack), monospace;
|
|
35
|
+
|
|
36
|
+
font-weight: normal;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.param-nested {
|
|
40
|
+
color: var(--primary-color);
|
|
41
|
+
font-family: var(--font-stack-bolditalic), monospace;
|
|
42
|
+
text-shadow: 0 0 10px var(--primary-color);
|
|
43
|
+
font-weight: normal;
|
|
44
|
+
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
.param:hover {
|
|
48
|
+
//text-decoration: underline;
|
|
49
|
+
//cursor: pointer;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
.dot {
|
|
53
|
+
color: var(--font-color-sub2)
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
.dollar {
|
|
57
|
+
color: var(--terminal-yellow)
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
.jsonpath {
|
|
61
|
+
color: var(--font-color-sub1);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
.selected {
|
|
65
|
+
color: var(--background-color)
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
.selected .bracket {
|
|
69
|
+
color: var(--background-color)
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
.selected .bracket-nested {
|
|
73
|
+
color: var(--background-color)
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
.selected .param {
|
|
77
|
+
color: var(--background-color)
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
.selected .param-nested {
|
|
81
|
+
color: var(--background-color)
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
|
|
85
|
+
|
|
86
|
+
`;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { LitElement } from 'lit';
|
|
2
|
+
export declare class RenderJSONPathComponent extends LitElement {
|
|
3
|
+
static styles: import("lit").CSSResult;
|
|
4
|
+
path: string;
|
|
5
|
+
selected: boolean;
|
|
6
|
+
private readonly chars;
|
|
7
|
+
constructor();
|
|
8
|
+
replaceBrackets(value: string): string;
|
|
9
|
+
breakPath(): import("lit-html").TemplateResult<1>;
|
|
10
|
+
render(): import("lit-html").TemplateResult<1>;
|
|
11
|
+
}
|
|
@@ -0,0 +1,105 @@
|
|
|
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 { LitElement, html } from 'lit';
|
|
8
|
+
import { customElement, property } from 'lit/decorators.js';
|
|
9
|
+
import { unsafeHTML } from "lit/directives/unsafe-html.js";
|
|
10
|
+
import renderJsonPathCss from "./render-json-path.css";
|
|
11
|
+
const bracketRegex = /(\{)([\w.-_$:]+)(})|(:)([\w.-_$:]+)/g;
|
|
12
|
+
const pathRegex = /(\[)(["']?)([\w${}:./\\]+)(['"]?)(])/g;
|
|
13
|
+
let RenderJSONPathComponent = class RenderJSONPathComponent extends LitElement {
|
|
14
|
+
constructor() {
|
|
15
|
+
super();
|
|
16
|
+
this.path = "/";
|
|
17
|
+
this.selected = false;
|
|
18
|
+
this.chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
|
|
19
|
+
}
|
|
20
|
+
replaceBrackets(value) {
|
|
21
|
+
let m;
|
|
22
|
+
let returnString = value;
|
|
23
|
+
while ((m = bracketRegex.exec(value)) !== null) {
|
|
24
|
+
m.forEach((match, groupIndex) => {
|
|
25
|
+
if (match !== undefined && (groupIndex === 1 || groupIndex === 4)) {
|
|
26
|
+
returnString = returnString.replaceAll(match, '<span class="bracket">' + match + '</span>');
|
|
27
|
+
}
|
|
28
|
+
if (match !== undefined && (groupIndex === 2 || groupIndex === 5)) {
|
|
29
|
+
returnString = returnString.replaceAll(match, '<span class="param-nested">' + match + '</span>');
|
|
30
|
+
}
|
|
31
|
+
if (match !== undefined && groupIndex === 3) {
|
|
32
|
+
returnString = returnString.replaceAll(match, '<span class="bracket">' + match + '</span>');
|
|
33
|
+
}
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
return returnString;
|
|
37
|
+
}
|
|
38
|
+
breakPath() {
|
|
39
|
+
let segments = this.path.split(".");
|
|
40
|
+
if (segments.length > 0) {
|
|
41
|
+
if (segments[0] == '$')
|
|
42
|
+
segments = segments.slice(1, segments.length);
|
|
43
|
+
}
|
|
44
|
+
let cleaned = segments.join(".");
|
|
45
|
+
const path = cleaned;
|
|
46
|
+
let matchMap = new Map();
|
|
47
|
+
let match;
|
|
48
|
+
// build a match map and replace the matches with a random string that matches the length of the match
|
|
49
|
+
while ((match = pathRegex.exec(path)) !== null) {
|
|
50
|
+
const size = pathRegex.lastIndex - match.index;
|
|
51
|
+
const key = randomString(size, this.chars);
|
|
52
|
+
matchMap.set(key, match);
|
|
53
|
+
cleaned = cleaned.substring(0, match.index) + key + cleaned.substring(pathRegex.lastIndex);
|
|
54
|
+
}
|
|
55
|
+
// replace dots with rendered dots
|
|
56
|
+
cleaned = cleaned.replaceAll(".", '<span class="dot">.</span>');
|
|
57
|
+
// iterate through match map, build the segments and replace the random strings with the segments
|
|
58
|
+
matchMap.forEach((value, key) => {
|
|
59
|
+
let rendered = [];
|
|
60
|
+
if (value[1] !== undefined) {
|
|
61
|
+
rendered.push('<span part="path" class="bracket">' + value[1] + '</span>');
|
|
62
|
+
}
|
|
63
|
+
if (value[2] !== undefined) {
|
|
64
|
+
rendered.push(value[2]);
|
|
65
|
+
}
|
|
66
|
+
if (value[3] !== undefined) {
|
|
67
|
+
rendered.push('<span part="path" class="param">' + this.replaceBrackets(value[3]) + '</span>');
|
|
68
|
+
}
|
|
69
|
+
if (value[4] !== undefined) {
|
|
70
|
+
rendered.push(value[4]);
|
|
71
|
+
}
|
|
72
|
+
if (value[5] !== undefined) {
|
|
73
|
+
rendered.push('<span part="path" class="bracket">' + value[5] + '</span>');
|
|
74
|
+
}
|
|
75
|
+
const renderedString = rendered.join("");
|
|
76
|
+
cleaned = cleaned.replaceAll(key, renderedString);
|
|
77
|
+
});
|
|
78
|
+
let returnString = cleaned;
|
|
79
|
+
returnString = returnString.replaceAll("$", "<span class='dollar'>$</span>");
|
|
80
|
+
if (returnString === '') {
|
|
81
|
+
returnString = "<span part='path' class='dot'>{no path available}</span>";
|
|
82
|
+
}
|
|
83
|
+
return html `${unsafeHTML(returnString)}`;
|
|
84
|
+
}
|
|
85
|
+
render() {
|
|
86
|
+
return html `<span part="path" class="jsonpath ${this.selected ? 'selected' : ''}">${this.breakPath()}</span>`;
|
|
87
|
+
}
|
|
88
|
+
};
|
|
89
|
+
RenderJSONPathComponent.styles = renderJsonPathCss;
|
|
90
|
+
__decorate([
|
|
91
|
+
property()
|
|
92
|
+
], RenderJSONPathComponent.prototype, "path", void 0);
|
|
93
|
+
__decorate([
|
|
94
|
+
property({ type: Boolean })
|
|
95
|
+
], RenderJSONPathComponent.prototype, "selected", void 0);
|
|
96
|
+
RenderJSONPathComponent = __decorate([
|
|
97
|
+
customElement('pb33f-render-json-path')
|
|
98
|
+
], RenderJSONPathComponent);
|
|
99
|
+
export { RenderJSONPathComponent };
|
|
100
|
+
function randomString(length, chars) {
|
|
101
|
+
let result = '';
|
|
102
|
+
for (let i = length; i > 0; --i)
|
|
103
|
+
result += chars[Math.floor(Math.random() * chars.length)];
|
|
104
|
+
return result;
|
|
105
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
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 } from "lit/decorators.js";
|
|
8
|
+
import { html, LitElement } from "lit";
|
|
9
|
+
let DoctorSettings = class DoctorSettings extends LitElement {
|
|
10
|
+
constructor() {
|
|
11
|
+
super();
|
|
12
|
+
}
|
|
13
|
+
render() {
|
|
14
|
+
return html `
|
|
15
|
+
|
|
16
|
+
`;
|
|
17
|
+
}
|
|
18
|
+
};
|
|
19
|
+
DoctorSettings = __decorate([
|
|
20
|
+
customElement("pb33f-doctor-settings")
|
|
21
|
+
], DoctorSettings);
|
|
22
|
+
export { DoctorSettings };
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { css } from "lit";
|
|
2
|
+
export default css `
|
|
3
|
+
.status-bar {
|
|
4
|
+
position: absolute;
|
|
5
|
+
bottom: 0;
|
|
6
|
+
left: 0;
|
|
7
|
+
width: 100%;
|
|
8
|
+
height: 20px;
|
|
9
|
+
background: var(--background-color);
|
|
10
|
+
border: 1px dashed var(--secondary-color);
|
|
11
|
+
z-index: 1000;
|
|
12
|
+
border-bottom: none;
|
|
13
|
+
font-size: 0.9rem;
|
|
14
|
+
padding: 2px 0 0 5px;
|
|
15
|
+
vertical-align: middle;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
sl-icon {
|
|
19
|
+
vertical-align: middle;
|
|
20
|
+
font-size: 1rem;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.warning-icon {
|
|
24
|
+
color: var(--warn-color);
|
|
25
|
+
vertical-align: middle;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.error-icon {
|
|
29
|
+
color: var(--error-color);
|
|
30
|
+
vertical-align: middle;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.warning {
|
|
34
|
+
border: 1px dashed var(--warn-color);
|
|
35
|
+
border-bottom: none;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
.error {
|
|
39
|
+
border: 1px dashed var(--error-color);
|
|
40
|
+
border-bottom: none;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
strong {
|
|
44
|
+
font-family: var(--font-stack-bold), monospace;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
`;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { LitElement } from "lit";
|
|
2
|
+
import { SlDialog } from "@shoelace-style/shoelace";
|
|
3
|
+
export declare class StatusBar extends LitElement {
|
|
4
|
+
static styles: import("lit").CSSResult[];
|
|
5
|
+
visible: boolean;
|
|
6
|
+
callsRemaining: number;
|
|
7
|
+
dialog: SlDialog;
|
|
8
|
+
constructor();
|
|
9
|
+
openDialog(): void;
|
|
10
|
+
closeDialog(): void;
|
|
11
|
+
render(): import("lit-html").TemplateResult<1> | undefined;
|
|
12
|
+
}
|
|
@@ -0,0 +1,71 @@
|
|
|
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, query } from "lit/decorators.js";
|
|
8
|
+
import { html, LitElement } from "lit";
|
|
9
|
+
import statusBarCss from "./status-bar.css";
|
|
10
|
+
import linksCss from "@/css/links.css";
|
|
11
|
+
let StatusBar = class StatusBar extends LitElement {
|
|
12
|
+
constructor() {
|
|
13
|
+
super();
|
|
14
|
+
this.visible = false;
|
|
15
|
+
this.callsRemaining = 0;
|
|
16
|
+
}
|
|
17
|
+
openDialog() {
|
|
18
|
+
this.dialog.show();
|
|
19
|
+
}
|
|
20
|
+
closeDialog() {
|
|
21
|
+
this.dialog.hide();
|
|
22
|
+
}
|
|
23
|
+
render() {
|
|
24
|
+
if (this.visible) {
|
|
25
|
+
let clazz = '';
|
|
26
|
+
let clazzIcon = '';
|
|
27
|
+
let actionText = '';
|
|
28
|
+
let icon = 'info-square';
|
|
29
|
+
if (this.callsRemaining > 0 && this.callsRemaining <= 10) {
|
|
30
|
+
clazz = 'warning';
|
|
31
|
+
clazzIcon = 'warning-icon';
|
|
32
|
+
actionText = 'You are running low.';
|
|
33
|
+
icon = 'exclamation-triangle';
|
|
34
|
+
}
|
|
35
|
+
if (this.callsRemaining <= 0) {
|
|
36
|
+
clazz = 'error';
|
|
37
|
+
clazzIcon = 'error-icon';
|
|
38
|
+
actionText = 'You have run out of credit. Service disabled';
|
|
39
|
+
icon = 'exclamation-square';
|
|
40
|
+
}
|
|
41
|
+
return html `
|
|
42
|
+
<div class="status-bar ${clazz}">
|
|
43
|
+
<sl-dialog label="Credit upgrade coming soon!" class="dialog-overview">
|
|
44
|
+
<p>To get more credit for the doctor, you will need to create an account. This feature is coming soon.</p>
|
|
45
|
+
<p>
|
|
46
|
+
In the meantime please wait 24 hours for your credit to be reset.
|
|
47
|
+
</p>
|
|
48
|
+
<sl-button slot="footer" variant="primary" @click="${this.closeDialog}">Close</sl-button>
|
|
49
|
+
</sl-dialog>
|
|
50
|
+
<sl-icon name="${icon}" class="${clazzIcon}"></sl-icon>
|
|
51
|
+
<span class="status-text">Credits remaining: <strong>${this.callsRemaining}</strong></span> |
|
|
52
|
+
<span class="action-text">${actionText}</span>
|
|
53
|
+
${this.callsRemaining <= 0 ? html ` | <a href="#" @click="${this.openDialog}"><strong>Get more credit</strong></a>` : ''}
|
|
54
|
+
</div>`;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
};
|
|
58
|
+
StatusBar.styles = [statusBarCss, linksCss];
|
|
59
|
+
__decorate([
|
|
60
|
+
property({ type: Boolean })
|
|
61
|
+
], StatusBar.prototype, "visible", void 0);
|
|
62
|
+
__decorate([
|
|
63
|
+
property({ type: Number })
|
|
64
|
+
], StatusBar.prototype, "callsRemaining", void 0);
|
|
65
|
+
__decorate([
|
|
66
|
+
query('sl-dialog')
|
|
67
|
+
], StatusBar.prototype, "dialog", void 0);
|
|
68
|
+
StatusBar = __decorate([
|
|
69
|
+
customElement("pb33f-doctor-statusbar")
|
|
70
|
+
], StatusBar);
|
|
71
|
+
export { StatusBar };
|
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
import { css } from "lit";
|
|
2
|
+
export default css `
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
.doctor {
|
|
6
|
+
width: 100%;
|
|
7
|
+
height: 100%;
|
|
8
|
+
position: relative;
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
.editor {
|
|
14
|
+
|
|
15
|
+
width: 100%;
|
|
16
|
+
height: 100%;
|
|
17
|
+
min-width: 500px;
|
|
18
|
+
min-height: 300px;
|
|
19
|
+
position: relative;
|
|
20
|
+
display: block;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.problems {
|
|
24
|
+
position: relative;
|
|
25
|
+
display: block;
|
|
26
|
+
margin-left: 10px;
|
|
27
|
+
overflow-y: hidden;
|
|
28
|
+
width: 100%;
|
|
29
|
+
height: min-content;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
.problems::-webkit-scrollbar {
|
|
33
|
+
width: 8px;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
.problems::-webkit-scrollbar-track {
|
|
37
|
+
background-color: black;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
.problems::-webkit-scrollbar-thumb {
|
|
41
|
+
box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.3);
|
|
42
|
+
background: var(--secondary-color-lowalpha);
|
|
43
|
+
padding: var(--global-padding);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
sl-split-panel {
|
|
48
|
+
width: calc(100% - 9px);
|
|
49
|
+
height: 100%;
|
|
50
|
+
--divider-width: 2px;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
sl-split-panel::part(divider) {
|
|
55
|
+
background-color: var(--secondary-color);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
sl-icon {
|
|
59
|
+
position: absolute;
|
|
60
|
+
left: 2px;
|
|
61
|
+
border-radius: 0;
|
|
62
|
+
background: var(--secondary-color);
|
|
63
|
+
color: var(--background-color);
|
|
64
|
+
padding: 0;
|
|
65
|
+
width: 10px;
|
|
66
|
+
height:40px;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
sl-split-panel::part(divider):focus-visible {
|
|
70
|
+
background-color: var(--primary-color);
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
sl-split-panel:focus-within sl-icon {
|
|
74
|
+
background-color: var(--primary-color);
|
|
75
|
+
color: var(--background-color);
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
sl-tab-group::part(tabs) {
|
|
79
|
+
height: 30px;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
sl-tab::part(base) {
|
|
83
|
+
padding-top: 0;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
.tab-group {
|
|
87
|
+
--indicator-color: var(--secondary-color);
|
|
88
|
+
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
sl-tab-panel::part(base) {
|
|
92
|
+
padding-top: 10px;
|
|
93
|
+
overflow-y: hidden;
|
|
94
|
+
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
.tab::part(base) {
|
|
98
|
+
font: var(--font-stack);
|
|
99
|
+
font-size: 0.9rem;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
.unavailable {
|
|
103
|
+
opacity: 0.4;
|
|
104
|
+
transition: all 0.5s;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
.split-panel {
|
|
108
|
+
--min: 600px; --max: calc(100vw - 600px);
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
.overlay {
|
|
112
|
+
width: 100%;
|
|
113
|
+
opacity: 1;
|
|
114
|
+
height: 100%;
|
|
115
|
+
position: absolute;
|
|
116
|
+
top: 0;
|
|
117
|
+
left: 0;
|
|
118
|
+
pointer-events: auto;
|
|
119
|
+
cursor: not-allowed;
|
|
120
|
+
z-index: 100;
|
|
121
|
+
//backdrop-filter: blur(2px);
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
.ruleset {
|
|
125
|
+
font-size: 0.9rem;
|
|
126
|
+
margin-left: 10px;
|
|
127
|
+
margin-right: 10px;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
sl-switch::part(label) {
|
|
131
|
+
font-family: var(--font-stack), monospace;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
sl-switch a {
|
|
135
|
+
color: var(--primary-color);
|
|
136
|
+
text-decoration: none;
|
|
137
|
+
}
|
|
138
|
+
sl-switch a:visited {
|
|
139
|
+
color: var(--primary-color);
|
|
140
|
+
}
|
|
141
|
+
sl-switch a:hover {
|
|
142
|
+
color: var(--primary-color);
|
|
143
|
+
text-decoration: underline;
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
sl-switch a:active {
|
|
147
|
+
color: var(--error-color);
|
|
148
|
+
text-decoration: underline;
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
|
|
152
|
+
|
|
153
|
+
|
|
154
|
+
|
|
155
|
+
|
|
156
|
+
`;
|