@pb33f/cowboy-components 0.6.7 → 0.7.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/equalizer.worker-DyLD5JTU.js +1 -0
- package/dist/assets/search-problems.worker-BAF8L2rX.js +1 -0
- package/dist/components/changelog/changelog.js +1 -1
- package/dist/components/charts/beefy-chart.d.ts +21 -0
- package/dist/components/charts/beefy-chart.js +159 -0
- package/dist/components/charts/chart-colors.d.ts +27 -0
- package/dist/components/charts/chart-colors.js +76 -0
- package/dist/components/charts/config.d.ts +15 -0
- package/dist/components/charts/config.js +35 -0
- package/dist/components/charts/doughnut-chart.d.ts +22 -0
- package/dist/components/charts/doughnut-chart.js +128 -0
- package/dist/components/editor/editor.d.ts +9 -3
- package/dist/components/editor/editor.js +115 -60
- package/dist/components/editor/init.d.ts +0 -0
- package/dist/components/editor/init.js +28 -0
- package/dist/components/editor/schemas/openapi3.json +1651 -0
- package/dist/components/editor/schemas/openapi31.json +1449 -0
- package/dist/components/model-icon/model-icon.js +3 -0
- package/dist/components/model-renderer/callback.js +2 -1
- package/dist/components/model-renderer/change.css.d.ts +2 -0
- package/dist/components/model-renderer/change.css.js +254 -0
- package/dist/components/model-renderer/changes.d.ts +19 -0
- package/dist/components/model-renderer/changes.js +306 -0
- package/dist/components/model-renderer/clickable-ref.d.ts +10 -6
- package/dist/components/model-renderer/clickable-ref.js +9 -0
- package/dist/components/model-renderer/components.js +1 -0
- package/dist/components/model-renderer/contact.js +2 -1
- package/dist/components/model-renderer/document.js +11 -9
- package/dist/components/model-renderer/encoding.js +1 -0
- package/dist/components/model-renderer/example.js +1 -0
- package/dist/components/model-renderer/external-docs.js +1 -0
- package/dist/components/model-renderer/has-changes.d.ts +8 -0
- package/dist/components/model-renderer/has-changes.js +50 -0
- package/dist/components/model-renderer/header.js +1 -0
- package/dist/components/model-renderer/info.js +3 -1
- package/dist/components/model-renderer/license.js +3 -3
- package/dist/components/model-renderer/link.js +1 -1
- package/dist/components/model-renderer/media-type.js +1 -1
- package/dist/components/model-renderer/oauth-flows.js +2 -1
- package/dist/components/model-renderer/operation.js +2 -1
- package/dist/components/model-renderer/parameter.js +1 -0
- package/dist/components/model-renderer/path-item.js +1 -0
- package/dist/components/model-renderer/paths.js +1 -0
- package/dist/components/model-renderer/rendered-node.js +20 -20
- package/dist/components/model-renderer/rendered-property.css.js +4 -0
- package/dist/components/model-renderer/rendered-property.js +5 -2
- package/dist/components/model-renderer/request-body.js +1 -1
- package/dist/components/model-renderer/response.js +1 -1
- package/dist/components/model-renderer/schema.js +57 -54
- package/dist/components/model-renderer/security-scheme.js +1 -1
- package/dist/components/model-renderer/server.js +1 -0
- package/dist/components/model-renderer/tag.js +3 -1
- package/dist/components/model-tree/tree.d.ts +7 -4
- package/dist/components/model-tree/tree.js +54 -25
- package/dist/components/paginator/paginator.css.js +5 -2
- package/dist/components/problem-list/problem-mainview.js +8 -1
- package/dist/components/rodeo/npm/download-statistic.d.ts +41 -0
- package/dist/components/rodeo/npm/download-statistic.js +634 -0
- package/dist/components/rodeo/rodeo-nav.js +1 -0
- package/dist/components/rodeo/rodeo.d.ts +1 -0
- package/dist/components/rodeo/rodeo.js +9 -2
- package/dist/components/rodeo/statistic.css.js +17 -0
- package/dist/components/rodeo/statistic.d.ts +4 -2
- package/dist/components/rodeo/statistic.js +15 -4
- package/dist/components/the-doctor/settings.css.d.ts +2 -0
- package/dist/components/the-doctor/settings.css.js +28 -0
- package/dist/components/the-doctor/settings.d.ts +13 -0
- package/dist/components/the-doctor/settings.js +83 -2
- package/dist/components/the-doctor/the-doctor.css.js +80 -47
- package/dist/components/the-doctor/the-doctor.d.ts +24 -6
- package/dist/components/the-doctor/the-doctor.js +344 -109
- package/dist/components/the-doctor/upload-archive.js +1 -1
- package/dist/components/theme-switcher/theme-switcher.d.ts +1 -1
- package/dist/components/theme-switcher/theme-switcher.js +5 -2
- package/dist/components/time-vortex/change-list-item.css.d.ts +2 -0
- package/dist/components/time-vortex/change-list-item.css.js +96 -0
- package/dist/components/time-vortex/change-list-item.d.ts +10 -0
- package/dist/components/time-vortex/change-list-item.js +58 -0
- package/dist/components/time-vortex/history-picker.css.d.ts +2 -0
- package/dist/components/time-vortex/history-picker.css.js +90 -0
- package/dist/components/time-vortex/history-picker.d.ts +18 -0
- package/dist/components/time-vortex/history-picker.js +143 -0
- package/dist/components/time-vortex/spec-summary-timeline-item.css.d.ts +2 -0
- package/dist/components/time-vortex/spec-summary-timeline-item.css.js +144 -0
- package/dist/components/time-vortex/spec-summary-timeline-item.d.ts +11 -0
- package/dist/components/time-vortex/spec-summary-timeline-item.js +153 -0
- package/dist/components/time-vortex/tardis-control.css.d.ts +2 -0
- package/dist/components/time-vortex/tardis-control.css.js +103 -0
- package/dist/components/time-vortex/tardis-control.d.ts +32 -0
- package/dist/components/time-vortex/tardis-control.js +286 -0
- package/dist/components/time-vortex/time-vortex.d.ts +17 -0
- package/dist/components/time-vortex/time-vortex.js +75 -0
- package/dist/components/time-vortex/timeline-view.css.d.ts +2 -0
- package/dist/components/time-vortex/timeline-view.css.js +28 -0
- package/dist/components/time-vortex/timeline-view.d.ts +32 -0
- package/dist/components/time-vortex/timeline-view.js +233 -0
- package/dist/components/timeline/timeline-item.css.js +95 -48
- package/dist/components/timeline/timeline-item.d.ts +1 -0
- package/dist/components/timeline/timeline-item.js +20 -1
- package/dist/components/timeline/timeline.css.js +46 -40
- package/dist/components/timeline/timeline.d.ts +1 -0
- package/dist/components/timeline/timeline.js +9 -5
- package/dist/components/toast/toast-component.css.js +4 -0
- package/dist/components/visualizer/equalizer.d.ts +2 -0
- package/dist/components/visualizer/equalizer.js +13 -5
- package/dist/components/visualizer/explorer.d.ts +5 -0
- package/dist/components/visualizer/explorer.js +41 -37
- package/dist/components/visualizer/foreign-object.js +3 -0
- package/dist/components/visualizer/nodes/callback.js +3 -1
- package/dist/components/visualizer/nodes/changes.css.d.ts +2 -0
- package/dist/components/visualizer/nodes/changes.css.js +33 -0
- package/dist/components/visualizer/nodes/components.js +3 -1
- package/dist/components/visualizer/nodes/contact.js +3 -1
- package/dist/components/visualizer/nodes/document.js +1 -0
- package/dist/components/visualizer/nodes/graph-node.d.ts +8 -7
- package/dist/components/visualizer/nodes/graph-node.js +55 -1
- package/dist/components/visualizer/nodes/header.js +3 -1
- package/dist/components/visualizer/nodes/info.js +3 -1
- package/dist/components/visualizer/nodes/license.js +8 -1
- package/dist/components/visualizer/nodes/link.js +3 -1
- package/dist/components/visualizer/nodes/media-type.js +3 -1
- package/dist/components/visualizer/nodes/operation.js +4 -1
- package/dist/components/visualizer/nodes/parameter.js +3 -1
- package/dist/components/visualizer/nodes/path-item.js +3 -1
- package/dist/components/visualizer/nodes/request-body.js +3 -1
- package/dist/components/visualizer/nodes/response.js +3 -1
- package/dist/components/visualizer/nodes/schema.js +3 -1
- package/dist/components/visualizer/nodes/security-scheme.js +3 -1
- package/dist/components/visualizer/nodes/server.js +3 -1
- package/dist/components/visualizer/nodes/tag.js +3 -1
- package/dist/components/visualizer/nodes/xml.js +3 -1
- package/dist/components/visualizer/orientation-controls.d.ts +1 -0
- package/dist/components/visualizer/orientation-controls.js +31 -16
- package/dist/components/visualizer/search.js +4 -3
- package/dist/components/warning-stripe/warning-stripe.d.ts +20 -0
- package/dist/components/warning-stripe/warning-stripe.js +124 -0
- package/dist/cowboy-components.umd.cjs +3840 -2216
- package/dist/css/panels.css.d.ts +2 -0
- package/dist/css/panels.css.js +44 -0
- package/dist/css/pb33f-theme.css +8 -1
- package/dist/css/scrollbar.css.d.ts +2 -0
- package/dist/css/scrollbar.css.js +16 -0
- package/dist/css/tabs.css.js +1 -1
- package/dist/events/doctor.d.ts +15 -1
- package/dist/events/doctor.js +5 -0
- package/dist/model/api-response.d.ts +6 -0
- package/dist/model/api-response.js +2 -0
- package/dist/model/chart-data.d.ts +15 -0
- package/dist/model/chart-data.js +1 -0
- package/dist/model/diagnostic-report.d.ts +5 -0
- package/dist/model/diagnostic-report.js +3 -0
- package/dist/model/document.d.ts +1 -0
- package/dist/model/graph.d.ts +26 -0
- package/dist/model/media-type.d.ts +2 -0
- package/dist/model/media-type.js +7 -0
- package/dist/model/node_type.d.ts +2 -0
- package/dist/model/node_type.js +2 -0
- package/dist/model/settings.d.ts +5 -0
- package/dist/model/settings.js +1 -0
- package/dist/model/timeline.d.ts +33 -0
- package/dist/model/timeline.js +1 -0
- package/dist/monacoeditorwork/css.worker.bundle.js +53460 -0
- package/dist/monacoeditorwork/editor.worker.bundle.js +13517 -0
- package/dist/monacoeditorwork/html.worker.bundle.js +29660 -0
- package/dist/monacoeditorwork/json.worker.bundle.js +21318 -0
- package/dist/monacoeditorwork/yaml.worker..bundle.js +37321 -0
- package/dist/services/color-service.d.ts +1 -0
- package/dist/services/color-service.js +13 -0
- package/dist/services/linting-service.d.ts +1 -3
- package/dist/services/linting-service.js +21 -29
- package/dist/services/model-service.d.ts +1 -1
- package/dist/services/model-service.js +35 -8
- package/dist/services/rodeo-service.d.ts +6 -0
- package/dist/services/rodeo-service.js +134 -0
- package/dist/services/timeline-service.d.ts +8 -0
- package/dist/services/timeline-service.js +85 -0
- package/dist/style.css +1 -1
- package/dist/workers/equalizer.worker.js +1 -1
- package/dist/workers/search-problems.worker.js +1 -1
- package/package.json +6 -1
- package/dist/assets/css.worker-Byh--afc.js +0 -84
- package/dist/assets/editor.worker-CYC0jP-p.js +0 -12
- package/dist/assets/equalizer.worker-CdIiiqfH.js +0 -1
- package/dist/assets/html.worker-DArWg-Dy.js +0 -461
- package/dist/assets/json.worker-heCfXoJw.js +0 -49
- package/dist/assets/search-problems.worker-VJi4P9Gj.js +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(function(){"use strict";var o=(s=>(s.VERSION="version",s.SCHEMA="schema",s.MEDIA_TYPE="mediaType",s.HEADER="header",s.EXAMPLE="example",s.EXAMPLES="examples",s.ENCODING="encoding",s.REQUEST_BODY="requestBody",s.REQUEST_BODIES="requestBodies",s.PARAMETER="parameter",s.PARAMETER_QUERY="query",s.COOKIE="cookie",s.PARAMETERS="parameters",s.LINK="link",s.LINKS="links",s.RESPONSE="response",s.RESPONSES="responses",s.OPERATION="operation",s.OPERATIONS="operations",s.SECURITY_SCHEME="securityScheme",s.SECURITY_SCHEMES="securitySchemes",s.EXTERNAL_DOCS="externalDocs",s.SECURITY="security",s.CALLBACK="callback",s.CALLBACKS="callbacks",s.PATH_ITEM="pathItem",s.PATH_ITEMS="pathItems",s.XML="xml",s.HEADERS="headers",s.SERVER="server",s.SERVERS="servers",s.SERVER_VARIABLE="serverVariable",s.PATHS="paths",s.COMPONENTS="components",s.CONTACT="contact",s.LICENSE="license",s.INFO="info",s.TAG="tag",s.TAGS="tags",s.DOCUMENT="document",s.WEBHOOK="webhook",s.WEBHOOKS="webhooks",s.EXTENSIONS="extensions",s.EXTENSION="extension",s.NO_EXAMPLE="noExample",s.POLYMORPHIC="polymorphic",s.ERROR="error",s.WARNING="warning",s.ROLODEX_FILE="rolodex-file",s.ROLODEX_FOLDER="rolodex-dir",s.OPENAPI="openapi",s.UPLOAD="upload",s.ADD="add",s.UNKNOWN="unknown",s.JS="js",s.GO="go",s.TS="ts",s.CS="cs",s.C="c",s.CPP="cpp",s.PHP="php",s.PY="py",s.HTML="html",s.MD="md",s.JAVA="java",s.RS="rs",s.ZIG="zig",s.RB="rb",s.YAML="yaml",s.JSON="json",s))(o||{});function I(s,P,h,u,f,l,e,E){if(s&&s.sources.length>0)for(let O=0;O<s.sources.length;O++){const A=s.sources[O];if(f.has(A)){const n=f.get(A);if(n){if(n.filtered)return;if(delete n.x,delete n.y,h.has(n.id)||(Object.keys(E).includes(n.type)||(n.dependency=!0),h.set(n.id,n)),!n.processed){const a=e.get(n.id);a&&a.forEach(R=>{delete R.container,delete R.sections,R.dependency=!0,u.set(R.id,R),I(R,n,h,u,f,l,e,E)})}const S=l.get(n.id);S&&S.forEach(a=>{a.targets.includes(P.id)&&(delete a.container,delete a.sections,u.set(a.id,a),I(a,n,h,u,f,l,e,E))}),n.processed=!0}}}}onmessage=function(s){var P,h,u;if(s.data.graphResponse&&s.data.spacing){const f=s.data.objects,l=s.data.references,e=s.data.graphResponse,E={nodes:[],edges:[],nodesRendered:e.nodesRendered,spacing:s.data.spacing,references:s.data.references},O=new Map,A=new Map,n=new Map,S=new Map,a=new Map,R=(t,r)=>{const i=[];for(const c in r)if(c.includes(t+"_filter_")){const[,,M]=c.split("_");i.push(M)}return i};if(!f){postMessage(E);return}(P=e.nodes)==null||P.forEach(t=>{Object.keys(f).includes(t.type)&&n.set(t.id,t),O.set(t.id,t)}),(h=e.nodesRendered)==null||h.forEach(t=>{A.set(t.id,t)});const C=(t,r,i)=>{if(!i.includes(t+"XX")){r.filtered=!0;const c=O.get(r.id);c&&(c.filtered=!0)}};n.forEach(t=>{var M;const r=R(t.type,f);let i=[],c;if(r.length>0)switch(t.type){case o.RESPONSE:i=["1","2","3","4","5"];for(const k of i)t.label.startsWith(k)&&C(k,t,r);break;case o.PARAMETER:i=["cookie","header","path","query"],c=A.get(t.id),c&&(M=c==null?void 0:c.instance)!=null&&M.hasOwnProperty("in")&&(r.includes(c.instance.in)||C(c.instance.in,t,r));break;case o.OPERATION:i=["get","post","put","patch","delete","head","options","trace"],r.includes(t.label.toLowerCase())||C(t.label,t,r);break}}),(u=e.edges)==null||u.forEach(t=>{l&&!l.renderRefs&&t.ref&&t.ref!=""||l&&!l.renderPoly&&t.ref&&t.ref!=""&&t.poly&&t.poly!=""||(t.sources.forEach(r=>{var i;S.has(r)||S.set(r,[]),delete t.container,delete t.sections,(i=S.get(r))==null||i.push(t)}),t.targets.forEach(r=>{var i;a.has(r)||a.set(r,[]),delete t.container,delete t.sections,(i=a.get(r))==null||i.push(t)}))});const L=new Map,b=new Map;n.forEach(t=>{if(Object.keys(f).includes(t.type)){if(delete t.x,delete t.y,t.filtered)return;E.nodes.push(t);const r=a.get(t.id);r&&r.forEach(i=>{I(i,t,L,b,O,S,a,f)})}}),L.forEach(t=>{let r=!1;E.nodes.forEach(i=>{i.id==t.id&&(r=!0)}),r||E.nodes.push(t)}),b.forEach(t=>{let r=!1;E.edges.forEach(i=>{i.id==t.id&&(r=!0)}),r||E.edges.push(t)}),E.rebuild=s.data.rebuild,postMessage(E)}}})();
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(function(){"use strict";onmessage=function(e){if(e.data.search&&e.data.problems){const r=e.data.problems.filter(s=>{var t,a;return(t=s.jsonPath)!=null&&t.toLowerCase().includes(e.data.search.toLowerCase())||(a=s.message)!=null&&a.toLowerCase().includes(e.data.search.toLowerCase())||s.source==e.data.search?s:null});postMessage(r)}}})();
|
|
@@ -88,7 +88,7 @@ let ChangelogComponent = class ChangelogComponent extends LitElement {
|
|
|
88
88
|
<pb33f-timeline-item id="release_${summary.name}">
|
|
89
89
|
<span slot="icon">${icon}</span>
|
|
90
90
|
<span slot="time" class="${milestone ? `major` : null}">${summary.publish_date}</span>
|
|
91
|
-
<div slot="content">
|
|
91
|
+
<div slot="content" style="width: 100%">
|
|
92
92
|
${release}
|
|
93
93
|
</div>
|
|
94
94
|
</pb33f-timeline-item>`);
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import Chart from 'chart.js/auto';
|
|
2
|
+
import { Colorful } from "./chart-colors";
|
|
3
|
+
import { LineDataSet } from "./config";
|
|
4
|
+
export declare class BeefyChart extends Colorful {
|
|
5
|
+
static styles: import("lit").CSSResult;
|
|
6
|
+
title: string;
|
|
7
|
+
datasets: LineDataSet[];
|
|
8
|
+
labels: string[];
|
|
9
|
+
legend: boolean;
|
|
10
|
+
smallTitle: boolean;
|
|
11
|
+
height: number;
|
|
12
|
+
width: number;
|
|
13
|
+
stepSize: number;
|
|
14
|
+
chartType: any;
|
|
15
|
+
chart: Chart;
|
|
16
|
+
constructor();
|
|
17
|
+
updateChart(): void;
|
|
18
|
+
buildChart(): void;
|
|
19
|
+
firstUpdated(): void;
|
|
20
|
+
render(): import("lit-html").TemplateResult<1>;
|
|
21
|
+
}
|
|
@@ -0,0 +1,159 @@
|
|
|
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 { css, html } from "lit";
|
|
9
|
+
import Chart from 'chart.js/auto';
|
|
10
|
+
import { Colorful } from "./chart-colors";
|
|
11
|
+
let BeefyChart = class BeefyChart extends Colorful {
|
|
12
|
+
constructor() {
|
|
13
|
+
super();
|
|
14
|
+
this.title = 'chart';
|
|
15
|
+
this.legend = false;
|
|
16
|
+
this.height = 458;
|
|
17
|
+
this.width = 800;
|
|
18
|
+
this.smallTitle = false;
|
|
19
|
+
this.stepSize = 1;
|
|
20
|
+
this.chartType = 'line';
|
|
21
|
+
}
|
|
22
|
+
updateChart() {
|
|
23
|
+
if (this.chart) {
|
|
24
|
+
this.chart.data.labels = this.labels;
|
|
25
|
+
this.chart.data.datasets = this.datasets;
|
|
26
|
+
this.chart.update();
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
buildChart() {
|
|
30
|
+
let titleFont = this.titleFont;
|
|
31
|
+
if (this.smallTitle) {
|
|
32
|
+
titleFont = this.fontBold;
|
|
33
|
+
}
|
|
34
|
+
if (this.chart) {
|
|
35
|
+
this.chart.destroy();
|
|
36
|
+
}
|
|
37
|
+
this.chart = new Chart(this.shadowRoot?.querySelector('#chart'), {
|
|
38
|
+
type: this.chartType,
|
|
39
|
+
data: {
|
|
40
|
+
labels: this.labels,
|
|
41
|
+
datasets: this.datasets
|
|
42
|
+
},
|
|
43
|
+
options: {
|
|
44
|
+
responsive: true,
|
|
45
|
+
elements: {
|
|
46
|
+
point: {
|
|
47
|
+
borderColor: this.secondary,
|
|
48
|
+
backgroundColor: this.secondary,
|
|
49
|
+
pointStyle: 'rect',
|
|
50
|
+
radius: 4,
|
|
51
|
+
//@ts-ignore
|
|
52
|
+
pointBorderColor: this.background,
|
|
53
|
+
},
|
|
54
|
+
},
|
|
55
|
+
scales: {
|
|
56
|
+
x: {
|
|
57
|
+
ticks: {
|
|
58
|
+
font: this.smallFont,
|
|
59
|
+
color: this.secondary,
|
|
60
|
+
},
|
|
61
|
+
border: {
|
|
62
|
+
color: this.secondary
|
|
63
|
+
}
|
|
64
|
+
},
|
|
65
|
+
y: {
|
|
66
|
+
min: 0,
|
|
67
|
+
ticks: {
|
|
68
|
+
stepSize: this.stepSize,
|
|
69
|
+
font: this.font,
|
|
70
|
+
color: this.secondary,
|
|
71
|
+
},
|
|
72
|
+
border: {
|
|
73
|
+
color: this.secondary
|
|
74
|
+
}
|
|
75
|
+
},
|
|
76
|
+
},
|
|
77
|
+
layout: {
|
|
78
|
+
autoPadding: false,
|
|
79
|
+
},
|
|
80
|
+
plugins: {
|
|
81
|
+
tooltip: {
|
|
82
|
+
titleFont: this.fontBold,
|
|
83
|
+
bodyFont: this.font,
|
|
84
|
+
titleColor: this.primary,
|
|
85
|
+
displayColors: false,
|
|
86
|
+
borderColor: this.tertiary,
|
|
87
|
+
borderWidth: 1,
|
|
88
|
+
cornerRadius: 0,
|
|
89
|
+
},
|
|
90
|
+
title: {
|
|
91
|
+
display: true,
|
|
92
|
+
text: this.title,
|
|
93
|
+
font: titleFont,
|
|
94
|
+
color: this.primary,
|
|
95
|
+
align: 'start',
|
|
96
|
+
},
|
|
97
|
+
legend: {
|
|
98
|
+
display: this.legend,
|
|
99
|
+
position: 'bottom',
|
|
100
|
+
maxHeight: 40,
|
|
101
|
+
labels: {
|
|
102
|
+
color: 'rgb(255, 255, 255)',
|
|
103
|
+
font: this.mediumFont,
|
|
104
|
+
pointStyle: 'line',
|
|
105
|
+
boxHeight: 1,
|
|
106
|
+
}
|
|
107
|
+
},
|
|
108
|
+
},
|
|
109
|
+
}
|
|
110
|
+
});
|
|
111
|
+
}
|
|
112
|
+
firstUpdated() {
|
|
113
|
+
super.firstUpdated();
|
|
114
|
+
this.buildChart();
|
|
115
|
+
}
|
|
116
|
+
render() {
|
|
117
|
+
return html `
|
|
118
|
+
<canvas id="chart" style="width: ${this.width}px; height: ${this.height}px; "></canvas>
|
|
119
|
+
`;
|
|
120
|
+
}
|
|
121
|
+
};
|
|
122
|
+
BeefyChart.styles = css `
|
|
123
|
+
:host {
|
|
124
|
+
display: block; /* ensures the host takes up space */
|
|
125
|
+
/* Optionally, set explicit dimensions if needed */
|
|
126
|
+
width: 100%;
|
|
127
|
+
|
|
128
|
+
}`;
|
|
129
|
+
__decorate([
|
|
130
|
+
property()
|
|
131
|
+
], BeefyChart.prototype, "title", void 0);
|
|
132
|
+
__decorate([
|
|
133
|
+
property()
|
|
134
|
+
], BeefyChart.prototype, "datasets", void 0);
|
|
135
|
+
__decorate([
|
|
136
|
+
property()
|
|
137
|
+
], BeefyChart.prototype, "labels", void 0);
|
|
138
|
+
__decorate([
|
|
139
|
+
property({ type: Boolean })
|
|
140
|
+
], BeefyChart.prototype, "legend", void 0);
|
|
141
|
+
__decorate([
|
|
142
|
+
property({ type: Boolean })
|
|
143
|
+
], BeefyChart.prototype, "smallTitle", void 0);
|
|
144
|
+
__decorate([
|
|
145
|
+
property({ type: Number })
|
|
146
|
+
], BeefyChart.prototype, "height", void 0);
|
|
147
|
+
__decorate([
|
|
148
|
+
property({ type: Number })
|
|
149
|
+
], BeefyChart.prototype, "width", void 0);
|
|
150
|
+
__decorate([
|
|
151
|
+
property({ type: Number })
|
|
152
|
+
], BeefyChart.prototype, "stepSize", void 0);
|
|
153
|
+
__decorate([
|
|
154
|
+
property()
|
|
155
|
+
], BeefyChart.prototype, "chartType", void 0);
|
|
156
|
+
BeefyChart = __decorate([
|
|
157
|
+
customElement('pb33f-chart')
|
|
158
|
+
], BeefyChart);
|
|
159
|
+
export { BeefyChart };
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { LitElement } from "lit";
|
|
2
|
+
import { Color, FontSpec } from "chart.js/auto";
|
|
3
|
+
export declare class Colorful extends LitElement {
|
|
4
|
+
primary: string;
|
|
5
|
+
secondary: string;
|
|
6
|
+
tertiary: string;
|
|
7
|
+
ok: string;
|
|
8
|
+
error: string;
|
|
9
|
+
warn: string;
|
|
10
|
+
color1: string;
|
|
11
|
+
color2: string;
|
|
12
|
+
color3: string;
|
|
13
|
+
color4: string;
|
|
14
|
+
color5: string;
|
|
15
|
+
background: Color;
|
|
16
|
+
font: FontSpec;
|
|
17
|
+
smallFont: FontSpec;
|
|
18
|
+
mediumFont: FontSpec;
|
|
19
|
+
fontBold: FontSpec;
|
|
20
|
+
titleFont: FontSpec;
|
|
21
|
+
constructor();
|
|
22
|
+
firstUpdated(): void;
|
|
23
|
+
}
|
|
24
|
+
export declare const ChartColors: string[];
|
|
25
|
+
export declare const ChartColorsChanges: string[];
|
|
26
|
+
export declare const BinaryChartColors: string[];
|
|
27
|
+
export declare function CreateRadialGradient(context: any, c1: any, c2: any, c3: any, c4: any): any;
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { LitElement } from "lit";
|
|
2
|
+
import { fontBold, fontSpec, fontTitle, mediumFont, smallFont } from "./config";
|
|
3
|
+
export class Colorful extends LitElement {
|
|
4
|
+
constructor() {
|
|
5
|
+
super();
|
|
6
|
+
}
|
|
7
|
+
firstUpdated() {
|
|
8
|
+
const styles = getComputedStyle(this);
|
|
9
|
+
this.primary = styles.getPropertyValue('--primary-color').trim();
|
|
10
|
+
this.secondary = styles.getPropertyValue('--secondary-color').trim();
|
|
11
|
+
this.tertiary = styles.getPropertyValue('--tertiary-color').trim();
|
|
12
|
+
this.background = styles.getPropertyValue('--background-color').trim();
|
|
13
|
+
this.error = styles.getPropertyValue('--error-color').trim();
|
|
14
|
+
this.ok = styles.getPropertyValue('--terminal-text').trim();
|
|
15
|
+
this.warn = styles.getPropertyValue('--warn-color').trim();
|
|
16
|
+
this.color1 = styles.getPropertyValue('--chart-color1').trim();
|
|
17
|
+
this.color2 = styles.getPropertyValue('--chart-color2').trim();
|
|
18
|
+
this.color3 = styles.getPropertyValue('--chart-color3').trim();
|
|
19
|
+
this.color4 = styles.getPropertyValue('--chart-color4').trim();
|
|
20
|
+
this.color5 = styles.getPropertyValue('--chart-color5').trim();
|
|
21
|
+
this.font = fontSpec;
|
|
22
|
+
this.smallFont = smallFont;
|
|
23
|
+
this.mediumFont = mediumFont;
|
|
24
|
+
this.titleFont = fontTitle;
|
|
25
|
+
this.fontBold = fontBold;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
export const ChartColors = [
|
|
29
|
+
"#f83aff",
|
|
30
|
+
"rgba(98, 196, 255, 1)",
|
|
31
|
+
"rgba(248,58,255,0.47)",
|
|
32
|
+
"rgba(98, 196, 255, 0.8)",
|
|
33
|
+
"rgba(248,58,255,0.2)",
|
|
34
|
+
"rgba(98, 196, 255, 0.5)"
|
|
35
|
+
];
|
|
36
|
+
export const ChartColorsChanges = [
|
|
37
|
+
"#f83aff",
|
|
38
|
+
"#00FF00",
|
|
39
|
+
"#787878",
|
|
40
|
+
];
|
|
41
|
+
export const BinaryChartColors = [
|
|
42
|
+
"#ff246b",
|
|
43
|
+
"rgba(98, 196, 255, 1)",
|
|
44
|
+
];
|
|
45
|
+
const cache = new Map();
|
|
46
|
+
let width = null;
|
|
47
|
+
let height = null;
|
|
48
|
+
export function CreateRadialGradient(context, c1, c2, c3, c4) {
|
|
49
|
+
const chartArea = context.chart.chartArea;
|
|
50
|
+
if (!chartArea) {
|
|
51
|
+
return;
|
|
52
|
+
}
|
|
53
|
+
const chartWidth = chartArea.right - chartArea.left;
|
|
54
|
+
const chartHeight = chartArea.bottom - chartArea.top;
|
|
55
|
+
if (width !== chartWidth || height !== chartHeight) {
|
|
56
|
+
cache.clear();
|
|
57
|
+
}
|
|
58
|
+
let gradient = cache.get(c1 + c2 + c3 + c4);
|
|
59
|
+
if (!gradient) {
|
|
60
|
+
// Create the gradient because this is either the first render
|
|
61
|
+
// or the size of the chart has changed
|
|
62
|
+
width = chartWidth;
|
|
63
|
+
height = chartHeight;
|
|
64
|
+
const centerX = (chartArea.left + chartArea.right) / 2;
|
|
65
|
+
const centerY = (chartArea.top + chartArea.bottom) / 2;
|
|
66
|
+
const r = Math.min((chartArea.right - chartArea.left) / 2, (chartArea.bottom - chartArea.top) / 2);
|
|
67
|
+
const ctx = context.chart.ctx;
|
|
68
|
+
gradient = ctx.createRadialGradient(centerX, centerY, 0, centerX, centerY, r);
|
|
69
|
+
gradient.addColorStop(0.45, c1);
|
|
70
|
+
gradient.addColorStop(0.7, c2);
|
|
71
|
+
gradient.addColorStop(0.93, c3);
|
|
72
|
+
gradient.addColorStop(1, c4);
|
|
73
|
+
cache.set(c1 + c2 + c3 + c4, gradient);
|
|
74
|
+
}
|
|
75
|
+
return gradient;
|
|
76
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Color, FontSpec } from "chart.js/auto";
|
|
2
|
+
export declare const fontSpec: FontSpec;
|
|
3
|
+
export declare const smallFont: FontSpec;
|
|
4
|
+
export declare const mediumFont: FontSpec;
|
|
5
|
+
export declare const fontBold: FontSpec;
|
|
6
|
+
export declare const fontTitle: FontSpec;
|
|
7
|
+
export interface LineDataSet {
|
|
8
|
+
label: string;
|
|
9
|
+
data: number[];
|
|
10
|
+
borderColor?: Color;
|
|
11
|
+
backgroundColor?: string[];
|
|
12
|
+
pointStyle?: string;
|
|
13
|
+
radius?: number;
|
|
14
|
+
pointBorderColor?: Color;
|
|
15
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
export const fontSpec = {
|
|
2
|
+
size: 15,
|
|
3
|
+
family: "BerkeleyMono-Regular, Roboto Mono, Monaco, Menlo, Helvetica Neue,Helvetica,Verdana,Tahoma, Arial",
|
|
4
|
+
lineHeight: 2,
|
|
5
|
+
weight: "normal",
|
|
6
|
+
style: "normal",
|
|
7
|
+
};
|
|
8
|
+
export const smallFont = {
|
|
9
|
+
size: 10,
|
|
10
|
+
family: "BerkeleyMono-Regular, Roboto Mono, Monaco, Menlo, Helvetica Neue,Helvetica,Verdana,Tahoma, Arial",
|
|
11
|
+
lineHeight: 2,
|
|
12
|
+
weight: "normal",
|
|
13
|
+
style: "normal",
|
|
14
|
+
};
|
|
15
|
+
export const mediumFont = {
|
|
16
|
+
size: 12,
|
|
17
|
+
family: "BerkeleyMono-Regular, Roboto Mono, Monaco, Menlo, Helvetica Neue,Helvetica,Verdana,Tahoma, Arial",
|
|
18
|
+
lineHeight: 2,
|
|
19
|
+
weight: "normal",
|
|
20
|
+
style: "normal",
|
|
21
|
+
};
|
|
22
|
+
export const fontBold = {
|
|
23
|
+
size: 15,
|
|
24
|
+
family: "BerkeleyMono-Bold, Roboto Mono, Monaco, Menlo, Helvetica Neue,Helvetica,Verdana,Tahoma, Arial",
|
|
25
|
+
lineHeight: 2,
|
|
26
|
+
weight: "bold",
|
|
27
|
+
style: "normal",
|
|
28
|
+
};
|
|
29
|
+
export const fontTitle = {
|
|
30
|
+
size: 25,
|
|
31
|
+
family: "BerkeleyMono-Bold, Roboto Mono, Monaco, Menlo, Helvetica Neue,Helvetica,Verdana,Tahoma, Arial",
|
|
32
|
+
weight: "bold",
|
|
33
|
+
style: "normal",
|
|
34
|
+
lineHeight: 3,
|
|
35
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import Chart from 'chart.js/auto';
|
|
2
|
+
import { Colorful } from "./chart-colors";
|
|
3
|
+
import { LineDataSet } from "./config";
|
|
4
|
+
export declare class DoughnutChart extends Colorful {
|
|
5
|
+
title: string;
|
|
6
|
+
datasets: LineDataSet[];
|
|
7
|
+
labels: string[];
|
|
8
|
+
width: number;
|
|
9
|
+
height: number;
|
|
10
|
+
changesChart: boolean;
|
|
11
|
+
showLegend: boolean;
|
|
12
|
+
breakingChanges: boolean;
|
|
13
|
+
chart: Chart;
|
|
14
|
+
id: string;
|
|
15
|
+
firstRun: boolean;
|
|
16
|
+
colors: string[];
|
|
17
|
+
constructor();
|
|
18
|
+
refresh(): void;
|
|
19
|
+
firstUpdated(): void;
|
|
20
|
+
updated(): void;
|
|
21
|
+
render(): import("lit-html").TemplateResult<1>;
|
|
22
|
+
}
|
|
@@ -0,0 +1,128 @@
|
|
|
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 } from "lit";
|
|
9
|
+
import Chart from 'chart.js/auto';
|
|
10
|
+
import { BinaryChartColors, ChartColors, ChartColorsChanges, Colorful, } from "./chart-colors";
|
|
11
|
+
let DoughnutChart = class DoughnutChart extends Colorful {
|
|
12
|
+
constructor() {
|
|
13
|
+
super();
|
|
14
|
+
this.colors = ChartColors;
|
|
15
|
+
this.width = 300;
|
|
16
|
+
this.height = 300;
|
|
17
|
+
this.id = crypto.randomUUID();
|
|
18
|
+
this.firstRun = true;
|
|
19
|
+
}
|
|
20
|
+
refresh() {
|
|
21
|
+
this.chart.update();
|
|
22
|
+
}
|
|
23
|
+
firstUpdated() {
|
|
24
|
+
super.firstUpdated();
|
|
25
|
+
}
|
|
26
|
+
updated() {
|
|
27
|
+
if (this.chart) {
|
|
28
|
+
this.chart.destroy();
|
|
29
|
+
}
|
|
30
|
+
if (this.changesChart) {
|
|
31
|
+
this.colors = ChartColorsChanges;
|
|
32
|
+
}
|
|
33
|
+
if (this.breakingChanges) {
|
|
34
|
+
this.colors = BinaryChartColors;
|
|
35
|
+
}
|
|
36
|
+
this.datasets.forEach((data) => {
|
|
37
|
+
data.backgroundColor = this.colors;
|
|
38
|
+
data.borderColor = this.background;
|
|
39
|
+
});
|
|
40
|
+
let displayTitle = false;
|
|
41
|
+
if (this.title) {
|
|
42
|
+
displayTitle = true;
|
|
43
|
+
}
|
|
44
|
+
const animationDuration = this.firstRun ? 1000 : 250;
|
|
45
|
+
this.chart = new Chart(this.shadowRoot?.querySelector('#chart-' + this.id), {
|
|
46
|
+
type: 'doughnut',
|
|
47
|
+
data: {
|
|
48
|
+
labels: this.labels,
|
|
49
|
+
datasets: this.datasets
|
|
50
|
+
},
|
|
51
|
+
options: {
|
|
52
|
+
animation: {
|
|
53
|
+
duration: animationDuration
|
|
54
|
+
},
|
|
55
|
+
responsive: true,
|
|
56
|
+
maintainAspectRatio: false,
|
|
57
|
+
layout: {
|
|
58
|
+
autoPadding: false,
|
|
59
|
+
padding: {
|
|
60
|
+
top: 0,
|
|
61
|
+
bottom: 0
|
|
62
|
+
}
|
|
63
|
+
},
|
|
64
|
+
plugins: {
|
|
65
|
+
tooltip: {
|
|
66
|
+
titleFont: this.fontBold,
|
|
67
|
+
bodyFont: this.font,
|
|
68
|
+
titleColor: this.primary,
|
|
69
|
+
displayColors: false,
|
|
70
|
+
borderColor: this.tertiary,
|
|
71
|
+
borderWidth: 1,
|
|
72
|
+
cornerRadius: 0,
|
|
73
|
+
},
|
|
74
|
+
title: {
|
|
75
|
+
display: displayTitle,
|
|
76
|
+
text: this.title,
|
|
77
|
+
font: this.titleFont,
|
|
78
|
+
color: this.primary,
|
|
79
|
+
align: 'center',
|
|
80
|
+
},
|
|
81
|
+
legend: {
|
|
82
|
+
display: this.showLegend,
|
|
83
|
+
position: 'right',
|
|
84
|
+
maxHeight: 40,
|
|
85
|
+
labels: {
|
|
86
|
+
color: 'rgb(255, 255, 255)',
|
|
87
|
+
font: this.mediumFont,
|
|
88
|
+
}
|
|
89
|
+
},
|
|
90
|
+
},
|
|
91
|
+
}
|
|
92
|
+
});
|
|
93
|
+
this.firstRun = false;
|
|
94
|
+
}
|
|
95
|
+
render() {
|
|
96
|
+
return html `
|
|
97
|
+
<canvas id="chart-${this.id}" style="width: ${this.width}px; height: ${this.height}px"></canvas>
|
|
98
|
+
`;
|
|
99
|
+
}
|
|
100
|
+
};
|
|
101
|
+
__decorate([
|
|
102
|
+
property()
|
|
103
|
+
], DoughnutChart.prototype, "title", void 0);
|
|
104
|
+
__decorate([
|
|
105
|
+
property()
|
|
106
|
+
], DoughnutChart.prototype, "datasets", void 0);
|
|
107
|
+
__decorate([
|
|
108
|
+
property()
|
|
109
|
+
], DoughnutChart.prototype, "labels", void 0);
|
|
110
|
+
__decorate([
|
|
111
|
+
property({ type: Number })
|
|
112
|
+
], DoughnutChart.prototype, "width", void 0);
|
|
113
|
+
__decorate([
|
|
114
|
+
property({ type: Number })
|
|
115
|
+
], DoughnutChart.prototype, "height", void 0);
|
|
116
|
+
__decorate([
|
|
117
|
+
property({ type: Boolean })
|
|
118
|
+
], DoughnutChart.prototype, "changesChart", void 0);
|
|
119
|
+
__decorate([
|
|
120
|
+
property({ type: Boolean })
|
|
121
|
+
], DoughnutChart.prototype, "showLegend", void 0);
|
|
122
|
+
__decorate([
|
|
123
|
+
property({ type: Boolean })
|
|
124
|
+
], DoughnutChart.prototype, "breakingChanges", void 0);
|
|
125
|
+
DoughnutChart = __decorate([
|
|
126
|
+
customElement('pb33f-doughnut-chart')
|
|
127
|
+
], DoughnutChart);
|
|
128
|
+
export { DoughnutChart };
|
|
@@ -1,16 +1,17 @@
|
|
|
1
|
-
import { LitElement } from "lit";
|
|
2
1
|
import * as monaco from "monaco-editor";
|
|
2
|
+
import { LitElement } from "lit";
|
|
3
3
|
import { Reference } from "../../model/graph.js";
|
|
4
4
|
import { SpecEditorBreadcrumb } from "./editor-breadcrumb.js";
|
|
5
5
|
export declare class SpecEditor extends LitElement {
|
|
6
6
|
private container;
|
|
7
|
+
private monacoYaml;
|
|
8
|
+
private currentVersion;
|
|
7
9
|
editor?: monaco.editor.IStandaloneCodeEditor;
|
|
8
10
|
model?: monaco.editor.ITextModel;
|
|
9
11
|
readOnly?: boolean;
|
|
10
12
|
theme?: string;
|
|
11
13
|
language?: string;
|
|
12
14
|
code?: string;
|
|
13
|
-
links: Reference[];
|
|
14
15
|
minimapVisible: boolean;
|
|
15
16
|
currentPath: string;
|
|
16
17
|
id: string;
|
|
@@ -20,6 +21,8 @@ export declare class SpecEditor extends LitElement {
|
|
|
20
21
|
private decorationIdToLinkTarget;
|
|
21
22
|
breadcumb: SpecEditorBreadcrumb;
|
|
22
23
|
private firstboot;
|
|
24
|
+
links: Reference[];
|
|
25
|
+
linkProvider: monaco.IDisposable;
|
|
23
26
|
static styles: import("lit").CSSResult[];
|
|
24
27
|
constructor(id?: string);
|
|
25
28
|
protected createRenderRoot(): HTMLElement | DocumentFragment;
|
|
@@ -33,13 +36,16 @@ export declare class SpecEditor extends LitElement {
|
|
|
33
36
|
switchLanguage(language: string): void;
|
|
34
37
|
private isDark;
|
|
35
38
|
setValue(value: string, firstBoot?: boolean): void;
|
|
36
|
-
getValue(): string
|
|
39
|
+
getValue(): string;
|
|
40
|
+
updated(changed: any): void;
|
|
37
41
|
clearDecorations(): void;
|
|
38
42
|
clearAllMarkers(): void;
|
|
39
43
|
setMarkers(markers: monaco.editor.IMarkerData[]): void;
|
|
40
44
|
toggleMinimap(): void;
|
|
45
|
+
onDocChange(): void;
|
|
41
46
|
firstUpdated(): void;
|
|
42
47
|
open(uri: monaco.Uri): Promise<boolean>;
|
|
43
48
|
applyLinkDecorations(): void;
|
|
49
|
+
linkRun: boolean;
|
|
44
50
|
provideLinks(_model: monaco.editor.ITextModel, _token: monaco.CancellationToken): monaco.languages.ProviderResult<monaco.languages.ILinksList>;
|
|
45
51
|
}
|