@pb33f/cowboy-components 0.0.7 → 0.0.9

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.
@@ -1,6 +1,19 @@
1
1
  import { css } from "lit";
2
2
  export default css `
3
+
4
+ sl-alert::part(message) {
5
+ padding-bottom: var(--global-padding);
6
+ color: var(--font-color-sub1);
7
+ }
8
+
9
+ sl-alert.error::part(message) {
10
+ color: var(--error-font-color);
11
+ }
3
12
 
13
+ sl-alert.warning::part(message) {
14
+ color: var(--warn-300);
15
+ }
16
+
4
17
  .attention {
5
18
  margin-top: var(--global-space);
6
19
  margin-bottom: var(--global-space);
@@ -6,8 +6,8 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
6
6
  };
7
7
  import { LitElement, html } from 'lit';
8
8
  import { customElement, property } from 'lit/decorators.js';
9
- import attentionBoxCss from "./attention-box.css";
10
- import alertsCss from "../../css/alerts.css";
9
+ import attentionBoxCss from "./attention-box.css.js";
10
+ import alertsCss from "../../css/alerts.css.js";
11
11
  export var AttentionType;
12
12
  (function (AttentionType) {
13
13
  AttentionType["Context"] = "context";
@@ -41,11 +41,15 @@ let AttentionBox = class AttentionBox extends LitElement {
41
41
  if (this.type === AttentionType.Danger) {
42
42
  this.type = AttentionType.Error;
43
43
  }
44
+ let header = html ``;
45
+ if (this.headerText != '') {
46
+ header = html `<strong>${this.headerText}</strong>`;
47
+ }
44
48
  return html `
45
49
  <div class='attention ${this.type}'>
46
50
  <sl-alert class="${this.type}" open>
47
51
  <sl-icon slot="icon" name="${this.getIcon()}"></sl-icon>
48
- <strong>${this.headerText}</strong>
52
+ ${header}
49
53
  <slot></slot>
50
54
  </sl-alert>
51
55
  </div>
@@ -61,10 +61,8 @@ let ChangelogComponent = class ChangelogComponent extends LitElement {
61
61
  if (i == 0) {
62
62
  latest = true;
63
63
  }
64
- console.log(Date.parse(summary.published_at));
65
- console.log(new Date(summary.published_at));
66
64
  items.push(html `
67
- <pb33f-timeline-item>
65
+ <pb33f-timeline-item id="release_${summary.name}">
68
66
  <span slot="icon">${icon}</span>
69
67
  <span slot="time" class="${milestone ? `major` : null}">${summary.publish_date}</span>
70
68
  <div slot="content">
@@ -7,8 +7,12 @@ export default css `
7
7
  color: var(--secondary-color);
8
8
  }
9
9
 
10
+ sl-details {
11
+ max-width: 780px;
12
+ }
13
+
10
14
  sl-details::part(header) {
11
- padding-top: 12px;
15
+ padding-top: 15px;
12
16
  height: 15px;
13
17
  }
14
18
 
@@ -53,14 +57,21 @@ export default css `
53
57
  text-shadow: 0 0 1rem var(--terminal-text-shadow);
54
58
  font-size: 1.2rem;
55
59
  }
56
-
60
+
61
+
57
62
  html[theme="light"] .latest {
58
63
  text-shadow: none;
59
64
  }
65
+
66
+ pb33f-kv-view {
67
+ max-width: 500px;
68
+ }
69
+
70
+ @media only screen and (max-width: 800px) {
60
71
 
61
-
62
- ;
63
-
64
-
72
+ sl-details {
73
+ max-width: 350px;
74
+ }
65
75
 
76
+ }
66
77
  `;
@@ -6,7 +6,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
6
6
  };
7
7
  import { customElement, property } from "lit/decorators.js";
8
8
  import { html, LitElement } from "lit";
9
- import { ExchangeMethod } from "../../model/exchange_method";
9
+ import { ExchangeMethod } from "../../model/exchange_method.js";
10
10
  import httpMethodCss from "./http-method.css.js";
11
11
  let HttpMethodComponent = class HttpMethodComponent extends LitElement {
12
12
  constructor() {
@@ -1,6 +1,5 @@
1
1
  import { LitElement, TemplateResult } from "lit";
2
2
  import 'prismjs/components/prism-json.js';
3
- import 'prismjs/themes/prism-okaidia.css';
4
3
  export declare class KVViewComponent extends LitElement {
5
4
  static styles: import("lit").CSSResult[];
6
5
  keyLabel: string;
@@ -10,17 +10,21 @@ import { LitElement } from "lit";
10
10
  import { html } from "lit";
11
11
  import kvViewComponentCss from "./kv-view.css.js";
12
12
  import Prism from 'prismjs';
13
+ Prism.manual = true;
13
14
  import 'prismjs/components/prism-json.js';
14
- import 'prismjs/themes/prism-okaidia.css';
15
15
  import { unsafeHTML } from "lit/directives/unsafe-html.js";
16
16
  import prismCss from "../../css/prism.css.js";
17
17
  import sharedCss from "../../css/shared.css.js";
18
+ import syntaxCss from "../../css/syntax.css.js";
19
+ // @ts-ignore
20
+ document.removeEventListener('DOMContentLoaded', Prism.highlightAll);
18
21
  let KVViewComponent = class KVViewComponent extends LitElement {
19
22
  constructor() {
20
23
  super();
21
24
  this._data = new Map();
22
25
  this.keyLabel = 'Key';
23
26
  this.valueLabel = 'Value';
27
+ // tslint:disable
24
28
  }
25
29
  set data(value) {
26
30
  if (value && value.size > 0) {
@@ -82,7 +86,7 @@ let KVViewComponent = class KVViewComponent extends LitElement {
82
86
  return html `${output}`;
83
87
  }
84
88
  };
85
- KVViewComponent.styles = [prismCss, sharedCss, kvViewComponentCss];
89
+ KVViewComponent.styles = [prismCss, sharedCss, syntaxCss, kvViewComponentCss];
86
90
  __decorate([
87
91
  property()
88
92
  ], KVViewComponent.prototype, "keyLabel", void 0);
@@ -0,0 +1,2 @@
1
+ declare const _default: import("lit").CSSResult;
2
+ export default _default;
@@ -0,0 +1,24 @@
1
+ import { css } from "lit";
2
+ export default css `
3
+ :host {
4
+ color: var(--font-color);
5
+ font-family: var(--font-stack), monospace;
6
+ font-size: 0.9rem;
7
+ }
8
+ .bracket {
9
+ color: var(--secondary-color);
10
+ font-family: var(--font-stack-bold), monospace;
11
+ text-shadow: 0 0 10px var(--secondary-color);
12
+ }
13
+ .param {
14
+ color: var(--primary-color);
15
+ font-family: var(--font-stack-bold), monospace;
16
+ text-shadow: 0 0 10px var(--primary-color);
17
+ font-weight: normal;
18
+ }
19
+
20
+ .param:hover {
21
+ //text-decoration: underline;
22
+ //cursor: pointer;
23
+ }
24
+ `;
@@ -0,0 +1,7 @@
1
+ import { LitElement, TemplateResult } from 'lit';
2
+ export declare class PathRenderComponent extends LitElement {
3
+ static styles: import("lit").CSSResult;
4
+ path: string;
5
+ replaceBrackets(): TemplateResult;
6
+ render(): TemplateResult<1>;
7
+ }
@@ -0,0 +1,51 @@
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 renderOperationPathCss from "./render-operation-path.css.js";
11
+ let PathRenderComponent = class PathRenderComponent extends LitElement {
12
+ constructor() {
13
+ super(...arguments);
14
+ this.path = "/";
15
+ }
16
+ replaceBrackets() {
17
+ const regex = /(\{)([\w]+)(\})/gm;
18
+ let m;
19
+ let returnString = this.path;
20
+ while ((m = regex.exec(this.path)) !== null) {
21
+ // This is necessary to avoid infinite loops with zero-width matches
22
+ if (m.index === regex.lastIndex) {
23
+ regex.lastIndex++;
24
+ }
25
+ // The result can be accessed through the `m`-variable.
26
+ m.forEach((match, groupIndex) => {
27
+ if (groupIndex === 1) {
28
+ returnString = returnString.replaceAll(match, '<span class="bracket">' + match + '</span>');
29
+ }
30
+ if (groupIndex === 2) {
31
+ returnString = returnString.replaceAll(match, '<span class="param">' + match + '</span>');
32
+ }
33
+ if (groupIndex === 3) {
34
+ returnString = returnString.replaceAll(match, '<span class="bracket">' + match + '</span>');
35
+ }
36
+ });
37
+ }
38
+ return html `${unsafeHTML(returnString)}`;
39
+ }
40
+ render() {
41
+ return html `${this.replaceBrackets()}`;
42
+ }
43
+ };
44
+ PathRenderComponent.styles = renderOperationPathCss;
45
+ __decorate([
46
+ property()
47
+ ], PathRenderComponent.prototype, "path", void 0);
48
+ PathRenderComponent = __decorate([
49
+ customElement('pb33f-render-operation-path')
50
+ ], PathRenderComponent);
51
+ export { PathRenderComponent };
@@ -1,14 +1,15 @@
1
1
  import './css/cowboy-components.css';
2
2
  import './css/pb33f-theme.css';
3
- import './components/terminal/terminal-example.ts';
4
- import './components/theme-switcher/theme-switcher.ts';
5
- import './components/header/header.ts';
6
- import './components/kv-view/kv-view.ts';
7
- import './components/http-property-view/http-property-view.ts';
8
- import './components/timeline/timeline.ts';
9
- import './components/timeline/timeline-item.ts';
10
- import './components/http-method/http-method.ts';
11
- import './components/mailing-list/mailing-list.ts';
12
- import './components/changelog/changelog.ts';
13
- import './components/changelog/release.ts';
14
- import './components/attention-box/attention-box.ts';
3
+ import './components/terminal/terminal-example.js';
4
+ import './components/theme-switcher/theme-switcher.js';
5
+ import './components/header/header.js';
6
+ import './components/kv-view/kv-view.js';
7
+ import './components/http-property-view/http-property-view.js';
8
+ import './components/timeline/timeline.js';
9
+ import './components/timeline/timeline-item.js';
10
+ import './components/http-method/http-method.js';
11
+ import './components/mailing-list/mailing-list.js';
12
+ import './components/changelog/changelog.js';
13
+ import './components/changelog/release.js';
14
+ import './components/attention-box/attention-box.js';
15
+ import './components/render-operation-path/render-operation-path.js';
@@ -1,17 +1,18 @@
1
1
  import './css/cowboy-components.css';
2
2
  import './css/pb33f-theme.css';
3
- import './components/terminal/terminal-example.ts';
4
- import './components/theme-switcher/theme-switcher.ts';
5
- import './components/header/header.ts';
6
- import './components/kv-view/kv-view.ts';
7
- import './components/http-property-view/http-property-view.ts';
8
- import './components/timeline/timeline.ts';
9
- import './components/timeline/timeline-item.ts';
10
- import './components/http-method/http-method.ts';
11
- import './components/mailing-list/mailing-list.ts';
12
- import './components/changelog/changelog.ts';
13
- import './components/changelog/release.ts';
14
- import './components/attention-box/attention-box.ts';
3
+ import './components/terminal/terminal-example.js';
4
+ import './components/theme-switcher/theme-switcher.js';
5
+ import './components/header/header.js';
6
+ import './components/kv-view/kv-view.js';
7
+ import './components/http-property-view/http-property-view.js';
8
+ import './components/timeline/timeline.js';
9
+ import './components/timeline/timeline-item.js';
10
+ import './components/http-method/http-method.js';
11
+ import './components/mailing-list/mailing-list.js';
12
+ import './components/changelog/changelog.js';
13
+ import './components/changelog/release.js';
14
+ import './components/attention-box/attention-box.js';
15
+ import './components/render-operation-path/render-operation-path.js';
15
16
  // Set the base path to the folder you copied Shoelace's assets to
16
17
  import { setBasePath } from '@shoelace-style/shoelace/dist/utilities/base-path.js';
17
18
  setBasePath('/shoelace');