@pb33f/cowboy-components 0.0.1 → 0.0.3
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/README.md +9 -0
- package/dist/components/attention-box/attention-box.css.js +73 -0
- package/dist/components/attention-box/attention-box.d.ts +16 -0
- package/dist/components/attention-box/attention-box.js +65 -0
- package/dist/components/changelog/changelog.css.js +95 -0
- package/dist/components/changelog/changelog.d.ts +12 -0
- package/dist/components/changelog/changelog.js +125 -0
- package/dist/components/changelog/model.d.ts +68 -0
- package/dist/components/changelog/model.js +1 -0
- package/dist/components/changelog/release.css.d.ts +2 -0
- package/dist/components/changelog/release.css.js +66 -0
- package/dist/components/changelog/release.d.ts +16 -0
- package/dist/components/changelog/release.js +96 -0
- package/dist/components/header/header.css.js +102 -0
- package/dist/components/header/header.d.ts +1 -0
- package/dist/components/header/header.js +39 -0
- package/dist/components/http-method/http-method.css.d.ts +2 -0
- package/dist/components/http-method/http-method.css.js +22 -0
- package/dist/components/http-method/http-method.d.ts +8 -0
- package/dist/components/http-method/http-method.js +34 -0
- package/dist/components/http-property-view/http-property-view.css.d.ts +2 -0
- package/dist/components/http-property-view/http-property-view.css.js +108 -0
- package/dist/components/http-property-view/http-property-view.d.ts +19 -0
- package/dist/components/http-property-view/http-property-view.js +102 -0
- package/dist/components/kv-view/kv-view.css.js +81 -0
- package/dist/components/kv-view/kv-view.js +98 -0
- package/dist/components/mailing-list/mailing-list.css.d.ts +2 -0
- package/dist/components/mailing-list/mailing-list.css.js +100 -0
- package/dist/components/mailing-list/mailing-list.d.ts +24 -0
- package/dist/components/mailing-list/mailing-list.js +138 -0
- package/dist/components/terminal/terminal-example.css.js +43 -0
- package/dist/components/terminal/terminal-example.js +34 -0
- package/dist/components/theme-switcher/theme-switcher.css.js +9 -0
- package/dist/components/theme-switcher/theme-switcher.js +76 -0
- package/dist/components/timeline/timeline-item.css.d.ts +2 -0
- package/dist/components/timeline/timeline-item.css.js +63 -0
- package/dist/components/timeline/timeline-item.d.ts +6 -0
- package/dist/components/timeline/timeline-item.js +32 -0
- package/dist/components/timeline/timeline.css.d.ts +2 -0
- package/dist/components/timeline/timeline.css.js +53 -0
- package/dist/components/timeline/timeline.d.ts +6 -0
- package/dist/components/timeline/timeline.js +30 -0
- package/dist/cowboy-components.d.ts +14 -0
- package/dist/cowboy-components.js +18 -4240
- package/dist/cowboy-components.umd.cjs +1146 -1213
- package/dist/css/alerts.css.d.ts +2 -0
- package/dist/css/alerts.css.js +89 -0
- package/dist/css/prism.css.d.ts +2 -0
- package/dist/css/prism.css.js +114 -0
- package/dist/css/shared.css.d.ts +2 -0
- package/dist/css/shared.css.js +116 -0
- package/dist/model/constants.d.ts +23 -0
- package/dist/model/constants.js +23 -0
- package/dist/model/controls.d.ts +30 -0
- package/dist/model/controls.js +25 -0
- package/dist/model/errors.d.ts +7 -0
- package/dist/model/errors.js +1 -0
- package/dist/model/exchange_method.d.ts +1 -0
- package/dist/model/exchange_method.js +16 -0
- package/dist/model/extract_content_type.d.ts +34 -0
- package/dist/model/extract_content_type.js +78 -0
- package/dist/model/extract_query.d.ts +1 -0
- package/dist/model/extract_query.js +11 -0
- package/dist/model/http_transaction.d.ts +78 -0
- package/dist/model/http_transaction.js +109 -0
- package/dist/style.css +1 -1
- package/package.json +18 -7
- package/demo/index.ts +0 -1
- package/demo/kv-view.ts +0 -18
- package/dist/fonts/BerkeleyMono-Bold.woff +0 -0
- package/dist/fonts/BerkeleyMono-Bold.woff2 +0 -0
- package/dist/fonts/BerkeleyMono-BoldItalic.woff +0 -0
- package/dist/fonts/BerkeleyMono-BoldItalic.woff2 +0 -0
- package/dist/fonts/BerkeleyMono-Italic.woff +0 -0
- package/dist/fonts/BerkeleyMono-Italic.woff2 +0 -0
- package/dist/fonts/BerkeleyMono-Regular.woff +0 -0
- package/dist/fonts/BerkeleyMono-Regular.woff2 +0 -0
- package/dist/index.d.ts +0 -9
- package/dist/vite.svg +0 -1
- package/index.html +0 -66
- /package/dist/components/{prism.css.d.ts → attention-box/attention-box.css.d.ts} +0 -0
- /package/dist/components/{shared.css.d.ts → changelog/changelog.css.d.ts} +0 -0
package/README.md
ADDED
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { css } from "lit";
|
|
2
|
+
export default css `
|
|
3
|
+
|
|
4
|
+
.attention {
|
|
5
|
+
margin-top: var(--global-space);
|
|
6
|
+
margin-bottom: var(--global-space);
|
|
7
|
+
border-top: none;
|
|
8
|
+
border-right: none;
|
|
9
|
+
border-bottom: none;
|
|
10
|
+
border-left: 3px solid;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
.error {
|
|
14
|
+
color: var(--error-font-color);
|
|
15
|
+
border-color: var(--error-color);
|
|
16
|
+
border-left: 5px solid var(--error-color);
|
|
17
|
+
animation-name: errorGlow;
|
|
18
|
+
animation-duration: 1.2s;
|
|
19
|
+
animation-iteration-count: infinite;
|
|
20
|
+
animation-direction: alternate;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.context {
|
|
24
|
+
border-left: 5px solid var(--font-color-sub1);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
.info {
|
|
28
|
+
color: var(--primary-color);
|
|
29
|
+
border-color: var(--primary-color-lowalpha);
|
|
30
|
+
border-left: 5px solid var(--primary-color);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
.success {
|
|
35
|
+
color: var(--terminal-text);
|
|
36
|
+
border-color: var(--terminal-text);
|
|
37
|
+
border-left: 5px solid var(--terminal-text);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
.warning {
|
|
42
|
+
color: var(--warn-300);
|
|
43
|
+
border-color: var(--warn-200);
|
|
44
|
+
border-left: 5px solid var(--warn-200);
|
|
45
|
+
animation-name: warningGlow;
|
|
46
|
+
animation-duration: 2s;
|
|
47
|
+
animation-iteration-count: infinite;
|
|
48
|
+
animation-direction: alternate;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
@keyframes errorGlow {
|
|
52
|
+
from {
|
|
53
|
+
box-shadow: 0 0 1px var(--error-color-lowalpha);
|
|
54
|
+
border-color: var(--error-color-verylowalpha);
|
|
55
|
+
|
|
56
|
+
}
|
|
57
|
+
to {
|
|
58
|
+
border-color: var(--error-color);
|
|
59
|
+
box-shadow: 0 0 8px var(--error-color);
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
@keyframes warningGlow {
|
|
64
|
+
from {
|
|
65
|
+
box-shadow: 0 0 1px var(--warn-300-lowalpha);
|
|
66
|
+
border-color: var(--warn-200-lowalpha);
|
|
67
|
+
}
|
|
68
|
+
to {
|
|
69
|
+
border-color: var(--warn-300);
|
|
70
|
+
box-shadow: 0 0 8px var(--warn-200);
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
`;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { LitElement } from 'lit';
|
|
2
|
+
export declare enum AttentionType {
|
|
3
|
+
Context = "context",
|
|
4
|
+
Info = "info",
|
|
5
|
+
Success = "success",
|
|
6
|
+
Warning = "warning",
|
|
7
|
+
Error = "error",
|
|
8
|
+
Danger = "danger"
|
|
9
|
+
}
|
|
10
|
+
export declare class AttentionBox extends LitElement {
|
|
11
|
+
static styles: import("lit").CSSResult[];
|
|
12
|
+
type: AttentionType;
|
|
13
|
+
headerText: string;
|
|
14
|
+
getIcon(): "braces-asterisk" | "info-square" | "exclamation-triangle" | "exclamation-square" | "check-square";
|
|
15
|
+
render(): import("lit-html").TemplateResult<1>;
|
|
16
|
+
}
|
|
@@ -0,0 +1,65 @@
|
|
|
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 attentionBoxCss from "./attention-box.css";
|
|
10
|
+
import alertsCss from "../../css/alerts.css";
|
|
11
|
+
export var AttentionType;
|
|
12
|
+
(function (AttentionType) {
|
|
13
|
+
AttentionType["Context"] = "context";
|
|
14
|
+
AttentionType["Info"] = "info";
|
|
15
|
+
AttentionType["Success"] = "success";
|
|
16
|
+
AttentionType["Warning"] = "warning";
|
|
17
|
+
AttentionType["Error"] = "error";
|
|
18
|
+
AttentionType["Danger"] = "danger";
|
|
19
|
+
})(AttentionType || (AttentionType = {}));
|
|
20
|
+
let AttentionBox = class AttentionBox extends LitElement {
|
|
21
|
+
getIcon() {
|
|
22
|
+
switch (this.type) {
|
|
23
|
+
case AttentionType.Context:
|
|
24
|
+
return 'braces-asterisk';
|
|
25
|
+
case AttentionType.Info:
|
|
26
|
+
return 'info-square';
|
|
27
|
+
case AttentionType.Warning:
|
|
28
|
+
return 'exclamation-triangle';
|
|
29
|
+
case AttentionType.Error:
|
|
30
|
+
return 'exclamation-square';
|
|
31
|
+
case AttentionType.Danger:
|
|
32
|
+
return 'exclamation-square';
|
|
33
|
+
case AttentionType.Success:
|
|
34
|
+
return 'check-square';
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
render() {
|
|
38
|
+
if (!this.type) {
|
|
39
|
+
this.type = AttentionType.Context;
|
|
40
|
+
}
|
|
41
|
+
if (this.type === AttentionType.Danger) {
|
|
42
|
+
this.type = AttentionType.Error;
|
|
43
|
+
}
|
|
44
|
+
return html `
|
|
45
|
+
<div class='attention ${this.type}'>
|
|
46
|
+
<sl-alert class="${this.type}" open>
|
|
47
|
+
<sl-icon slot="icon" name="${this.getIcon()}"></sl-icon>
|
|
48
|
+
<strong>${this.headerText}</strong>
|
|
49
|
+
<slot></slot>
|
|
50
|
+
</sl-alert>
|
|
51
|
+
</div>
|
|
52
|
+
`;
|
|
53
|
+
}
|
|
54
|
+
};
|
|
55
|
+
AttentionBox.styles = [alertsCss, attentionBoxCss];
|
|
56
|
+
__decorate([
|
|
57
|
+
property()
|
|
58
|
+
], AttentionBox.prototype, "type", void 0);
|
|
59
|
+
__decorate([
|
|
60
|
+
property()
|
|
61
|
+
], AttentionBox.prototype, "headerText", void 0);
|
|
62
|
+
AttentionBox = __decorate([
|
|
63
|
+
customElement('pb33f-attention-box')
|
|
64
|
+
], AttentionBox);
|
|
65
|
+
export { AttentionBox };
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import { css } from "lit";
|
|
2
|
+
export default css `
|
|
3
|
+
|
|
4
|
+
.summary {
|
|
5
|
+
font-size: 1.1rem;
|
|
6
|
+
font-family: var(--font-stack-bold), monospace;
|
|
7
|
+
color: var(--primary-color);
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
p > code, pre {
|
|
11
|
+
font-family: var(--font-stack), monospace;
|
|
12
|
+
border: 1px solid var(--secondary-color-lowalpha);
|
|
13
|
+
color: var(--secondary-color);
|
|
14
|
+
border-radius: 0;
|
|
15
|
+
padding: -1px;
|
|
16
|
+
background-color: var(--secondary-color-very-lowalpha);
|
|
17
|
+
vertical-align: top;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
p > img {
|
|
21
|
+
max-width: 800px;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.major {
|
|
25
|
+
color: var(--primary-color);
|
|
26
|
+
font-family: var(--font-stack-bold), monospace;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
.major-icon {
|
|
30
|
+
color: var(--primary-color);
|
|
31
|
+
font-family: var(--font-stack-bold), monospace;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
h1, h2, h3, h4, h5, h6, strong, b {
|
|
35
|
+
font-family: var(--font-stack-bold), monospace;
|
|
36
|
+
font-weight: normal;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
i {
|
|
40
|
+
font-family: var(--font-stack-italic), monospace;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
em {
|
|
44
|
+
font-family: var(--font-stack-bolditalic), monospace;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
ul {
|
|
48
|
+
padding-left: 20px;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
ul > li {
|
|
52
|
+
font-family: var(--font-stack), monospace;
|
|
53
|
+
font-weight: normal;
|
|
54
|
+
list-style-type: none;
|
|
55
|
+
line-height: 1.8em;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
ul > li code {
|
|
59
|
+
font-family: var(--font-stack), monospace;
|
|
60
|
+
border: 1px solid var(--secondary-color-lowalpha);
|
|
61
|
+
color: var(--secondary-color);
|
|
62
|
+
border-radius: 0;
|
|
63
|
+
padding: 0 5px 1px 5px;
|
|
64
|
+
background-color: var(--secondary-color-very-lowalpha);
|
|
65
|
+
vertical-align: top;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
ul > li:before {
|
|
69
|
+
color: var(--primary-color);
|
|
70
|
+
font-family: var(--font-stack-bold), monospace;
|
|
71
|
+
margin-right: 10px;
|
|
72
|
+
content: ">"
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
ul > li > ul > li:before {
|
|
76
|
+
color: var(--primary-color);
|
|
77
|
+
font-family: var(--font-stack-bold), monospace;
|
|
78
|
+
margin-right: 10px;
|
|
79
|
+
content: "-"
|
|
80
|
+
}
|
|
81
|
+
ul > li > ul > li> ul > li:before {
|
|
82
|
+
color: var(--primary-color);
|
|
83
|
+
font-family: var(--font-stack-bold), monospace;
|
|
84
|
+
margin-right: 10px;
|
|
85
|
+
content: "*"
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+
@media only screen and (max-width: 1000px) {
|
|
90
|
+
.major-icon {
|
|
91
|
+
display: none;
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
`;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { LitElement, TemplateResult } from "lit";
|
|
2
|
+
export declare class ChangelogComponent extends LitElement {
|
|
3
|
+
static styles: import("lit").CSSResult[];
|
|
4
|
+
apiURL: string;
|
|
5
|
+
project: string;
|
|
6
|
+
summaries: ReleaseSummary[];
|
|
7
|
+
private error;
|
|
8
|
+
constructor();
|
|
9
|
+
connectedCallback(): void;
|
|
10
|
+
fetchChangelogSummary(): Promise<any>;
|
|
11
|
+
render(): TemplateResult<1>;
|
|
12
|
+
}
|
|
@@ -0,0 +1,125 @@
|
|
|
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, state } from "lit/decorators.js";
|
|
8
|
+
import { html, LitElement } from "lit";
|
|
9
|
+
import { marked } from "marked";
|
|
10
|
+
import { unsafeHTML } from "lit/directives/unsafe-html.js";
|
|
11
|
+
import changelogCss from "./changelog.css";
|
|
12
|
+
import sharedCss from "../../css/shared.css";
|
|
13
|
+
import alertsCss from "../../css/alerts.css";
|
|
14
|
+
let ChangelogComponent = class ChangelogComponent extends LitElement {
|
|
15
|
+
constructor() {
|
|
16
|
+
super();
|
|
17
|
+
this.apiURL = 'https://api.pb33f.io/release-notes/';
|
|
18
|
+
}
|
|
19
|
+
connectedCallback() {
|
|
20
|
+
super.connectedCallback();
|
|
21
|
+
this.fetchChangelogSummary()
|
|
22
|
+
.then((summaries) => {
|
|
23
|
+
this.summaries = summaries;
|
|
24
|
+
})
|
|
25
|
+
.catch((err) => {
|
|
26
|
+
this.error = err;
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
async fetchChangelogSummary() {
|
|
30
|
+
const response = await fetch(`${this.apiURL}/${this.project}`);
|
|
31
|
+
if (!response.ok) {
|
|
32
|
+
return Promise.reject(`HTTP Error ${response.status}`);
|
|
33
|
+
}
|
|
34
|
+
return response.json();
|
|
35
|
+
}
|
|
36
|
+
render() {
|
|
37
|
+
if (this.error) {
|
|
38
|
+
return html `
|
|
39
|
+
<pb33f-attention-box headerText="unable to fetch changelog" type="error">
|
|
40
|
+
${this.error}
|
|
41
|
+
</pb33f-attention-box>
|
|
42
|
+
`;
|
|
43
|
+
}
|
|
44
|
+
if (this.project && this.summaries?.length > 0) {
|
|
45
|
+
// const extractMinorVersion = (version: string): number =>
|
|
46
|
+
// parseInt(version.split('.')[1])
|
|
47
|
+
const extractPatchVersion = (version) => parseInt(version.split('.')[2]);
|
|
48
|
+
const items = [];
|
|
49
|
+
for (let i = 0; i < this.summaries?.length; i++) {
|
|
50
|
+
const summary = this.summaries[i];
|
|
51
|
+
let patchVersion = extractPatchVersion(summary.tag_name);
|
|
52
|
+
let icon = html ``;
|
|
53
|
+
let milestone = false;
|
|
54
|
+
if (patchVersion == 0) {
|
|
55
|
+
milestone = true;
|
|
56
|
+
icon = html `
|
|
57
|
+
<sl-icon name="braces-asterisk" class="major-icon"></sl-icon>`;
|
|
58
|
+
}
|
|
59
|
+
const parsed = marked.parse(summary.body).toString();
|
|
60
|
+
let latest = false;
|
|
61
|
+
if (i == 0) {
|
|
62
|
+
latest = true;
|
|
63
|
+
}
|
|
64
|
+
console.log(Date.parse(summary.published_at));
|
|
65
|
+
console.log(new Date(summary.published_at));
|
|
66
|
+
items.push(html `
|
|
67
|
+
<pb33f-timeline-item>
|
|
68
|
+
<span slot="icon">${icon}</span>
|
|
69
|
+
<span slot="time" class="${milestone ? `major` : null}">${summary.publish_date}</span>
|
|
70
|
+
<div slot="content">
|
|
71
|
+
<pb33f-release
|
|
72
|
+
.latest="${latest}"
|
|
73
|
+
.milestone="${milestone}"
|
|
74
|
+
name="${summary.name}"
|
|
75
|
+
published="${summary.published_at}"
|
|
76
|
+
link="${summary.html_url}"
|
|
77
|
+
author="${summary.author}"
|
|
78
|
+
tarball="${summary.tarball_url}"
|
|
79
|
+
authorLink="${summary.author_url}"
|
|
80
|
+
authorImage="${summary.author_image}">
|
|
81
|
+
${unsafeHTML(parsed)}
|
|
82
|
+
</pb33f-release>
|
|
83
|
+
</div>
|
|
84
|
+
</pb33f-timeline-item>`);
|
|
85
|
+
}
|
|
86
|
+
return html `
|
|
87
|
+
<pb33f-timeline>
|
|
88
|
+
${items.map((item) => {
|
|
89
|
+
return item;
|
|
90
|
+
})}
|
|
91
|
+
</pb33f-timeline>
|
|
92
|
+
`;
|
|
93
|
+
}
|
|
94
|
+
else {
|
|
95
|
+
return html `
|
|
96
|
+
<pb33f-timeline>
|
|
97
|
+
<pb33f-timeline-item>
|
|
98
|
+
<div slot="content">
|
|
99
|
+
<div class="pb33f-loader">
|
|
100
|
+
<div class="spin"></div>
|
|
101
|
+
fetching changelog for <em>${this.project}</em></div>
|
|
102
|
+
</div>
|
|
103
|
+
</pb33f-timeline-item>
|
|
104
|
+
</pb33f-timeline>
|
|
105
|
+
`;
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
};
|
|
109
|
+
ChangelogComponent.styles = [sharedCss, alertsCss, changelogCss];
|
|
110
|
+
__decorate([
|
|
111
|
+
property()
|
|
112
|
+
], ChangelogComponent.prototype, "apiURL", void 0);
|
|
113
|
+
__decorate([
|
|
114
|
+
property()
|
|
115
|
+
], ChangelogComponent.prototype, "project", void 0);
|
|
116
|
+
__decorate([
|
|
117
|
+
state()
|
|
118
|
+
], ChangelogComponent.prototype, "summaries", void 0);
|
|
119
|
+
__decorate([
|
|
120
|
+
state()
|
|
121
|
+
], ChangelogComponent.prototype, "error", void 0);
|
|
122
|
+
ChangelogComponent = __decorate([
|
|
123
|
+
customElement('pb33f-changelog')
|
|
124
|
+
], ChangelogComponent);
|
|
125
|
+
export { ChangelogComponent };
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
interface Asset {
|
|
2
|
+
id: number;
|
|
3
|
+
url: string;
|
|
4
|
+
name: string;
|
|
5
|
+
label: string;
|
|
6
|
+
state: string;
|
|
7
|
+
content_type: string;
|
|
8
|
+
size: number;
|
|
9
|
+
download_count: number;
|
|
10
|
+
created_at: string;
|
|
11
|
+
updated_at: string;
|
|
12
|
+
browser_download_url: string;
|
|
13
|
+
uploader: Uploader;
|
|
14
|
+
node_id: string;
|
|
15
|
+
}
|
|
16
|
+
interface Uploader {
|
|
17
|
+
login: string;
|
|
18
|
+
id: number;
|
|
19
|
+
node_id: string;
|
|
20
|
+
avatar_url: string;
|
|
21
|
+
html_url: string;
|
|
22
|
+
gravatar_id: string;
|
|
23
|
+
type: string;
|
|
24
|
+
site_admin: boolean;
|
|
25
|
+
url: string;
|
|
26
|
+
events_url: string;
|
|
27
|
+
following_url: string;
|
|
28
|
+
followers_url: string;
|
|
29
|
+
gists_url: string;
|
|
30
|
+
organizations_url: string;
|
|
31
|
+
received_events_url: string;
|
|
32
|
+
repos_url: string;
|
|
33
|
+
starred_url: string;
|
|
34
|
+
subscriptions_url: string;
|
|
35
|
+
}
|
|
36
|
+
interface Release {
|
|
37
|
+
tag_name: string;
|
|
38
|
+
target_commitish: string;
|
|
39
|
+
name: string;
|
|
40
|
+
body: string;
|
|
41
|
+
draft: boolean;
|
|
42
|
+
prerelease: boolean;
|
|
43
|
+
id: number;
|
|
44
|
+
created_at: string;
|
|
45
|
+
published_at: string;
|
|
46
|
+
url: string;
|
|
47
|
+
html_url: string;
|
|
48
|
+
assets_url: string;
|
|
49
|
+
assets: Asset[];
|
|
50
|
+
upload_url: string;
|
|
51
|
+
zipball_url: string;
|
|
52
|
+
tarball_url: string;
|
|
53
|
+
author: Uploader;
|
|
54
|
+
node_id: string;
|
|
55
|
+
}
|
|
56
|
+
interface ReleaseSummary {
|
|
57
|
+
id: number;
|
|
58
|
+
name: string;
|
|
59
|
+
tag_name: string;
|
|
60
|
+
published_at: string;
|
|
61
|
+
publish_date: string;
|
|
62
|
+
html_url: string;
|
|
63
|
+
body: string;
|
|
64
|
+
tarball_url: string;
|
|
65
|
+
author: string;
|
|
66
|
+
author_url: string;
|
|
67
|
+
author_image: string;
|
|
68
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { css } from "lit";
|
|
2
|
+
export default css `
|
|
3
|
+
|
|
4
|
+
.summary {
|
|
5
|
+
font-size: 1.1rem;
|
|
6
|
+
font-family: var(--font-stack-bold), monospace;
|
|
7
|
+
color: var(--secondary-color);
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
sl-details::part(header) {
|
|
11
|
+
padding-top: 12px;
|
|
12
|
+
height: 15px;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
sl-details::part(base) {
|
|
16
|
+
border: 1px dashed var(--bars-and-borders-dim);
|
|
17
|
+
margin-bottom: var(--global-space);
|
|
18
|
+
background-color: var(--background-color);
|
|
19
|
+
border-radius: 0;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
sl-details::part(content) {
|
|
23
|
+
font-size: 0.9rem;
|
|
24
|
+
padding: 0 0 0 var(--global-space);
|
|
25
|
+
margin:0;
|
|
26
|
+
overflow-x: auto;
|
|
27
|
+
max-width: 800px;
|
|
28
|
+
padding-bottom: var(--global-space)
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
.published {
|
|
32
|
+
color: var(--font-color-sub1);
|
|
33
|
+
}
|
|
34
|
+
hr {
|
|
35
|
+
margin-top: 0;
|
|
36
|
+
border-top: 1px dashed var(--bars-and-borders);
|
|
37
|
+
height: 1px;
|
|
38
|
+
margin-bottom: var(--global-space);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
.github_link {
|
|
42
|
+
display: block;
|
|
43
|
+
margin-bottom: var(--global-space)
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
.milestone {
|
|
47
|
+
color: var(--primary-color);
|
|
48
|
+
text-shadow: 0 0 10px var(--primary-text-shadow)
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
.latest {
|
|
52
|
+
color: var(--terminal-text);
|
|
53
|
+
text-shadow: 0 0 1rem var(--terminal-text-shadow);
|
|
54
|
+
font-size: 1.2rem;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
html[theme="light"] .latest {
|
|
58
|
+
text-shadow: none;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
;
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
`;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { LitElement } from "lit";
|
|
2
|
+
export declare class ReleaseComponent extends LitElement {
|
|
3
|
+
static styles: import("lit").CSSResult[];
|
|
4
|
+
name: string;
|
|
5
|
+
body: string;
|
|
6
|
+
published: string;
|
|
7
|
+
link: string;
|
|
8
|
+
author: string;
|
|
9
|
+
authorLink: string;
|
|
10
|
+
authorImage: string;
|
|
11
|
+
tarball: string;
|
|
12
|
+
milestone: boolean;
|
|
13
|
+
latest: boolean;
|
|
14
|
+
constructor();
|
|
15
|
+
render(): import("lit-html").TemplateResult<1>;
|
|
16
|
+
}
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
import { customElement, property } from "lit/decorators.js";
|
|
8
|
+
import { html, LitElement } from "lit";
|
|
9
|
+
import { unsafeHTML } from "lit/directives/unsafe-html.js";
|
|
10
|
+
import { KVViewComponent } from "../kv-view/kv-view";
|
|
11
|
+
import releaseCss from "./release.css";
|
|
12
|
+
import sharedCss from "../../css/shared.css";
|
|
13
|
+
let ReleaseComponent = class ReleaseComponent extends LitElement {
|
|
14
|
+
constructor() {
|
|
15
|
+
super();
|
|
16
|
+
}
|
|
17
|
+
render() {
|
|
18
|
+
const kv = new Map();
|
|
19
|
+
if (this.link) {
|
|
20
|
+
kv.set('Release ', `<a href="${this.link}">${this.link}</a>`);
|
|
21
|
+
}
|
|
22
|
+
if (this.author && this.authorImage) {
|
|
23
|
+
let name = this.author;
|
|
24
|
+
if (this.author == 'daveshanley') {
|
|
25
|
+
name = 'quobix';
|
|
26
|
+
}
|
|
27
|
+
kv.set('Author', `<sl-avatar image="${this.authorImage}" label="Avatar of ${name}"></sl-avatar>
|
|
28
|
+
<a href="${this.authorLink}">${name}</a>`);
|
|
29
|
+
}
|
|
30
|
+
if (this.author && !this.authorImage) {
|
|
31
|
+
let name = this.author;
|
|
32
|
+
if (this.author == 'daveshanley') {
|
|
33
|
+
name = 'quobix';
|
|
34
|
+
}
|
|
35
|
+
kv.set('Author', `<a href="${this.authorLink}">${name}</a>`);
|
|
36
|
+
}
|
|
37
|
+
if (this.tarball) {
|
|
38
|
+
kv.set('Tarball', `<a href="${this.tarball}">${this.tarball}</a>`);
|
|
39
|
+
}
|
|
40
|
+
const kvView = new KVViewComponent();
|
|
41
|
+
kvView.data = kv;
|
|
42
|
+
kvView.keyLabel = "";
|
|
43
|
+
kvView.valueLabel = "";
|
|
44
|
+
return html `
|
|
45
|
+
<sl-details>
|
|
46
|
+
<span class="summary ${this.milestone ? 'milestone' : ''} ${this.latest ? 'latest' : ''}" slot="summary">
|
|
47
|
+
${this.name}<slot name="name"></slot>
|
|
48
|
+
${this.latest ? '(latest)' : ''}
|
|
49
|
+
</span>
|
|
50
|
+
<hr/>
|
|
51
|
+
<p class="published">Published: ${this.published}
|
|
52
|
+
<slot name="published"></slot>
|
|
53
|
+
</p>
|
|
54
|
+
${unsafeHTML(this.body)}
|
|
55
|
+
<slot></slot>
|
|
56
|
+
<hr/>
|
|
57
|
+
${kvView}
|
|
58
|
+
</sl-details>
|
|
59
|
+
`;
|
|
60
|
+
}
|
|
61
|
+
};
|
|
62
|
+
ReleaseComponent.styles = [sharedCss, releaseCss];
|
|
63
|
+
__decorate([
|
|
64
|
+
property()
|
|
65
|
+
], ReleaseComponent.prototype, "name", void 0);
|
|
66
|
+
__decorate([
|
|
67
|
+
property()
|
|
68
|
+
], ReleaseComponent.prototype, "body", void 0);
|
|
69
|
+
__decorate([
|
|
70
|
+
property()
|
|
71
|
+
], ReleaseComponent.prototype, "published", void 0);
|
|
72
|
+
__decorate([
|
|
73
|
+
property()
|
|
74
|
+
], ReleaseComponent.prototype, "link", void 0);
|
|
75
|
+
__decorate([
|
|
76
|
+
property()
|
|
77
|
+
], ReleaseComponent.prototype, "author", void 0);
|
|
78
|
+
__decorate([
|
|
79
|
+
property()
|
|
80
|
+
], ReleaseComponent.prototype, "authorLink", void 0);
|
|
81
|
+
__decorate([
|
|
82
|
+
property()
|
|
83
|
+
], ReleaseComponent.prototype, "authorImage", void 0);
|
|
84
|
+
__decorate([
|
|
85
|
+
property()
|
|
86
|
+
], ReleaseComponent.prototype, "tarball", void 0);
|
|
87
|
+
__decorate([
|
|
88
|
+
property({ type: Boolean })
|
|
89
|
+
], ReleaseComponent.prototype, "milestone", void 0);
|
|
90
|
+
__decorate([
|
|
91
|
+
property({ type: Boolean })
|
|
92
|
+
], ReleaseComponent.prototype, "latest", void 0);
|
|
93
|
+
ReleaseComponent = __decorate([
|
|
94
|
+
customElement('pb33f-release')
|
|
95
|
+
], ReleaseComponent);
|
|
96
|
+
export { ReleaseComponent };
|