@things-factory/shell 7.0.1-alpha.29 → 7.0.1-alpha.34
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/client/route.js +11 -0
- package/client/themes/app-theme.css +1 -1
- package/dist-server/tsconfig.tsbuildinfo +1 -1
- package/package.json +2 -2
- package/client/elements/index.js +0 -3
- package/client/elements/oops-note.js +0 -49
- package/client/elements/oops-progress.js +0 -81
- package/client/elements/oops-spinner.js +0 -31
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@things-factory/shell",
|
3
|
-
"version": "7.0.1-alpha.
|
3
|
+
"version": "7.0.1-alpha.34",
|
4
4
|
"description": "Core module for framework",
|
5
5
|
"bin": {
|
6
6
|
"things-factory": "bin/things-factory",
|
@@ -134,5 +134,5 @@
|
|
134
134
|
"pg": "^8.7.3",
|
135
135
|
"sqlite3": "^5.0.8"
|
136
136
|
},
|
137
|
-
"gitHead": "
|
137
|
+
"gitHead": "d3b1e48a7f78d56a57f80fee3d548d43883187a5"
|
138
138
|
}
|
package/client/elements/index.js
DELETED
@@ -1,49 +0,0 @@
|
|
1
|
-
import { LitElement, html, css } from 'lit'
|
2
|
-
|
3
|
-
import '@material/mwc-icon'
|
4
|
-
|
5
|
-
export class OopsNote extends LitElement {
|
6
|
-
static get styles() {
|
7
|
-
return css`
|
8
|
-
:host {
|
9
|
-
display: block;
|
10
|
-
text-align: center;
|
11
|
-
}
|
12
|
-
mwc-icon {
|
13
|
-
font: var(--oops-note-icon-font);
|
14
|
-
color: var(--oops-note-icon-color);
|
15
|
-
border: var(--oops-note-icon-border);
|
16
|
-
border-radius: var(--oops-note-icon-border-radius);
|
17
|
-
padding: var(--oops-note-icon-padding);
|
18
|
-
}
|
19
|
-
[title] {
|
20
|
-
margin: var(--oops-note-title-margin);
|
21
|
-
font: var(--oops-note-title-font);
|
22
|
-
color: var(--oops-note-title-color);
|
23
|
-
text-transform: capitalize;
|
24
|
-
}
|
25
|
-
[description] {
|
26
|
-
font: var(--oops-note-description-font);
|
27
|
-
color: var(--oops-note-description-color);
|
28
|
-
}
|
29
|
-
`
|
30
|
-
}
|
31
|
-
|
32
|
-
static get properties() {
|
33
|
-
return {
|
34
|
-
icon: String,
|
35
|
-
title: String,
|
36
|
-
description: String
|
37
|
-
}
|
38
|
-
}
|
39
|
-
|
40
|
-
render() {
|
41
|
-
return html`
|
42
|
-
<mwc-icon>${this.icon}</mwc-icon>
|
43
|
-
<div title>${this.title}</div>
|
44
|
-
<div description>${this.description}</div>
|
45
|
-
`
|
46
|
-
}
|
47
|
-
}
|
48
|
-
|
49
|
-
customElements.define('oops-note', OopsNote)
|
@@ -1,81 +0,0 @@
|
|
1
|
-
import gql from 'graphql-tag'
|
2
|
-
import { html, LitElement } from 'lit'
|
3
|
-
|
4
|
-
import { subscribe } from '@operato/graphql'
|
5
|
-
|
6
|
-
export class OopsProgress extends LitElement {
|
7
|
-
static get properties() {
|
8
|
-
return {
|
9
|
-
tag: String,
|
10
|
-
subscription: Boolean
|
11
|
-
}
|
12
|
-
}
|
13
|
-
|
14
|
-
render() {
|
15
|
-
return html` <slot></slot> `
|
16
|
-
}
|
17
|
-
|
18
|
-
disconnectedCallback() {
|
19
|
-
super.disconnectedCallback()
|
20
|
-
this.stopSubscribe()
|
21
|
-
}
|
22
|
-
|
23
|
-
get subscription() {
|
24
|
-
return this._subscription
|
25
|
-
}
|
26
|
-
|
27
|
-
set subscription(subscription) {
|
28
|
-
console.warn('oops-progress#subscription is readonly property')
|
29
|
-
}
|
30
|
-
|
31
|
-
async updated(changes) {
|
32
|
-
if (changes.has('tag') && this.subscription) {
|
33
|
-
await this.stopSubscribe()
|
34
|
-
}
|
35
|
-
}
|
36
|
-
|
37
|
-
async startSubscribe() {
|
38
|
-
if (!this.tag || this._subscription) {
|
39
|
-
return
|
40
|
-
}
|
41
|
-
|
42
|
-
this._subscription = await subscribe(
|
43
|
-
{
|
44
|
-
query: gql`
|
45
|
-
subscription {
|
46
|
-
data(tag: "${this.tag}") {
|
47
|
-
tag
|
48
|
-
data
|
49
|
-
}
|
50
|
-
}`
|
51
|
-
},
|
52
|
-
{
|
53
|
-
next: async ({ data }) => {
|
54
|
-
if (data) {
|
55
|
-
const { progress = 0, message = '' } = data?.data?.data || {}
|
56
|
-
this.dispatchEvent(
|
57
|
-
new CustomEvent('progress', {
|
58
|
-
detail: {
|
59
|
-
progress,
|
60
|
-
message
|
61
|
-
}
|
62
|
-
})
|
63
|
-
)
|
64
|
-
|
65
|
-
if (progress >= 100) {
|
66
|
-
await this.stopSubscribe()
|
67
|
-
this.dispatchEvent(new CustomEvent('finish'))
|
68
|
-
}
|
69
|
-
}
|
70
|
-
}
|
71
|
-
}
|
72
|
-
)
|
73
|
-
}
|
74
|
-
|
75
|
-
async stopSubscribe() {
|
76
|
-
await this._subscription?.unsubscribe()
|
77
|
-
delete this._subscription
|
78
|
-
}
|
79
|
-
}
|
80
|
-
|
81
|
-
customElements.define('oops-progress', OopsProgress)
|
@@ -1,31 +0,0 @@
|
|
1
|
-
import { LitElement, html, css } from 'lit'
|
2
|
-
|
3
|
-
export class OopsSpinner extends LitElement {
|
4
|
-
static get styles() {
|
5
|
-
return css`
|
6
|
-
:host {
|
7
|
-
width: 70px;
|
8
|
-
height: 70px;
|
9
|
-
margin: 0 auto;
|
10
|
-
background: url(/assets/images/spinner.png) 0 0 no-repeat;
|
11
|
-
background-size: 700%;
|
12
|
-
animation: spinner steps(6) 2s infinite both;
|
13
|
-
}
|
14
|
-
|
15
|
-
@keyframes spinner {
|
16
|
-
0% {
|
17
|
-
background-position: 0%;
|
18
|
-
}
|
19
|
-
100% {
|
20
|
-
background-position: 100%;
|
21
|
-
}
|
22
|
-
}
|
23
|
-
`
|
24
|
-
}
|
25
|
-
|
26
|
-
render() {
|
27
|
-
return html``
|
28
|
-
}
|
29
|
-
}
|
30
|
-
|
31
|
-
customElements.define('oops-spinner', OopsSpinner)
|