@things-factory/shell 9.0.0-beta.21 → 9.0.0-beta.29
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/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@things-factory/shell",
|
3
|
-
"version": "9.0.0-beta.
|
3
|
+
"version": "9.0.0-beta.29",
|
4
4
|
"description": "Core module for framework",
|
5
5
|
"bin": {
|
6
6
|
"things-factory": "bin/things-factory",
|
@@ -43,7 +43,6 @@
|
|
43
43
|
"@graphql-tools/schema": "^8.5.0",
|
44
44
|
"@graphql-tools/utils": "^10.1.2",
|
45
45
|
"@graphql-yoga/redis-event-target": "^3.0.1",
|
46
|
-
"@hatiolab/things-scene": "^9.0.0-beta",
|
47
46
|
"@koa/cors": "^5.0.0",
|
48
47
|
"@material/mwc-button": "^0.27.0",
|
49
48
|
"@material/mwc-icon": "^0.27.0",
|
@@ -52,7 +51,6 @@
|
|
52
51
|
"@material/mwc-textfield": "^0.27.0",
|
53
52
|
"@material/web": "^2.0.0",
|
54
53
|
"@open-wc/scoped-elements": "^2.1.3",
|
55
|
-
"@operato/board": "^9.0.0-beta",
|
56
54
|
"@operato/graphql": "^9.0.0-beta",
|
57
55
|
"@operato/help": "^9.0.0-beta",
|
58
56
|
"@operato/layout": "^9.0.0-beta",
|
@@ -60,11 +58,11 @@
|
|
60
58
|
"@operato/typeorm-history": "^9.0.0-beta",
|
61
59
|
"@operato/utils": "^9.0.0-beta",
|
62
60
|
"@reduxjs/toolkit": "^2.2.5",
|
63
|
-
"@things-factory/ejs-remote": "^9.0.0-beta.
|
64
|
-
"@things-factory/env": "^9.0.0-beta.
|
61
|
+
"@things-factory/ejs-remote": "^9.0.0-beta.29",
|
62
|
+
"@things-factory/env": "^9.0.0-beta.29",
|
65
63
|
"@things-factory/operato-license-checker": "^4.0.4",
|
66
|
-
"@things-factory/styles": "^9.0.0-beta.
|
67
|
-
"@things-factory/utils": "^9.0.0-beta.
|
64
|
+
"@things-factory/styles": "^9.0.0-beta.29",
|
65
|
+
"@things-factory/utils": "^9.0.0-beta.29",
|
68
66
|
"@webcomponents/scoped-custom-element-registry": "^0.0.9",
|
69
67
|
"@webcomponents/webcomponentsjs": "^2.6.0",
|
70
68
|
"args": "^5.0.0",
|
@@ -130,5 +128,5 @@
|
|
130
128
|
"pg": "^8.7.3",
|
131
129
|
"sqlite3": "^5.0.8"
|
132
130
|
},
|
133
|
-
"gitHead": "
|
131
|
+
"gitHead": "98434a6f1498e940e435798c65f6c5abc8c2b967"
|
134
132
|
}
|
@@ -1,103 +0,0 @@
|
|
1
|
-
import './scene-components'
|
2
|
-
import gql from 'graphql-tag'
|
3
|
-
|
4
|
-
import { ReferenceMap, create, error } from '@hatiolab/things-scene'
|
5
|
-
|
6
|
-
export { BoardViewer, BoardPlayer } from '@operato/board'
|
7
|
-
import { client, gqlContext, subscribe } from '@operato/graphql'
|
8
|
-
|
9
|
-
export const provider = new ReferenceMap(
|
10
|
-
async (boardId, resolve, reject) => {
|
11
|
-
try {
|
12
|
-
const response = await client.query({
|
13
|
-
query: gql`
|
14
|
-
query FetchBoardById($id: String!) {
|
15
|
-
board(id: $id) {
|
16
|
-
model
|
17
|
-
}
|
18
|
-
}
|
19
|
-
`,
|
20
|
-
variables: { id: boardId },
|
21
|
-
context: gqlContext()
|
22
|
-
})
|
23
|
-
|
24
|
-
const board = response.data.board
|
25
|
-
|
26
|
-
var model = JSON.parse(board.model)
|
27
|
-
|
28
|
-
var scene
|
29
|
-
|
30
|
-
try {
|
31
|
-
scene = await provider.get(boardId)
|
32
|
-
console.warn('Board fetched more than twice.', boardId)
|
33
|
-
} catch (e) {
|
34
|
-
scene = create({
|
35
|
-
model,
|
36
|
-
mode: 0,
|
37
|
-
refProvider: provider
|
38
|
-
})
|
39
|
-
|
40
|
-
// s.app.baseUrl = undefined;
|
41
|
-
}
|
42
|
-
|
43
|
-
resolve(scene)
|
44
|
-
} catch (e) {
|
45
|
-
error(e)
|
46
|
-
reject(e)
|
47
|
-
}
|
48
|
-
},
|
49
|
-
async (id, ref) => {
|
50
|
-
ref.dispose()
|
51
|
-
}
|
52
|
-
)
|
53
|
-
|
54
|
-
var subscriptionForAutoRefresh
|
55
|
-
|
56
|
-
export const startSubscribingForAutoRefresh = async (playGroupId, callback) => {
|
57
|
-
if (!playGroupId) {
|
58
|
-
return
|
59
|
-
}
|
60
|
-
|
61
|
-
await stopSubscribing()
|
62
|
-
|
63
|
-
subscriptionForAutoRefresh = await subscribe(
|
64
|
-
{
|
65
|
-
query: gql`
|
66
|
-
subscription ($id: String!) {
|
67
|
-
playGroup(id: $id) {
|
68
|
-
id
|
69
|
-
boards {
|
70
|
-
id
|
71
|
-
model
|
72
|
-
}
|
73
|
-
}
|
74
|
-
}
|
75
|
-
`,
|
76
|
-
variables: {
|
77
|
-
id: playGroupId
|
78
|
-
}
|
79
|
-
},
|
80
|
-
{
|
81
|
-
next: async ({ data }) => {
|
82
|
-
const { id, boards = '{}' } = data.playGroup
|
83
|
-
|
84
|
-
if (data) {
|
85
|
-
callback &&
|
86
|
-
(await callback({
|
87
|
-
id,
|
88
|
-
boards
|
89
|
-
}))
|
90
|
-
}
|
91
|
-
}
|
92
|
-
}
|
93
|
-
)
|
94
|
-
}
|
95
|
-
|
96
|
-
export const stopSubscribing = async () => {
|
97
|
-
await subscriptionForAutoRefresh?.unsubscribe()
|
98
|
-
subscriptionForAutoRefresh = null
|
99
|
-
}
|
100
|
-
|
101
|
-
window['headlessSceneProvider'] = provider
|
102
|
-
window['startSubscribingForAutoRefresh'] = startSubscribingForAutoRefresh
|
103
|
-
window['stopSubscribing'] = stopSubscribing
|
@@ -1,106 +0,0 @@
|
|
1
|
-
import './scene-components'
|
2
|
-
|
3
|
-
import { ReferenceMap, create, error } from '@hatiolab/things-scene'
|
4
|
-
import { client, gqlContext, subscribe } from '@operato/graphql'
|
5
|
-
|
6
|
-
import gql from 'graphql-tag'
|
7
|
-
|
8
|
-
export { BoardViewer } from '@operato/board'
|
9
|
-
|
10
|
-
export const provider = new ReferenceMap(
|
11
|
-
async (boardId, resolve, reject) => {
|
12
|
-
try {
|
13
|
-
const response = await client.query({
|
14
|
-
query: gql`
|
15
|
-
query FetchBoardById($id: String!) {
|
16
|
-
board(id: $id) {
|
17
|
-
model
|
18
|
-
}
|
19
|
-
}
|
20
|
-
`,
|
21
|
-
variables: { id: boardId },
|
22
|
-
context: gqlContext()
|
23
|
-
})
|
24
|
-
|
25
|
-
const board = response.data.board
|
26
|
-
|
27
|
-
var model = JSON.parse(board.model)
|
28
|
-
|
29
|
-
var scene
|
30
|
-
|
31
|
-
try {
|
32
|
-
scene = await provider.get(boardId)
|
33
|
-
console.warn('Board fetched more than twice.', boardId)
|
34
|
-
} catch (e) {
|
35
|
-
scene = create({
|
36
|
-
model,
|
37
|
-
mode: 0,
|
38
|
-
refProvider: provider
|
39
|
-
})
|
40
|
-
|
41
|
-
// s.app.baseUrl = undefined;
|
42
|
-
}
|
43
|
-
|
44
|
-
resolve(scene)
|
45
|
-
|
46
|
-
// resolve(scene, {
|
47
|
-
// ...board,
|
48
|
-
// model
|
49
|
-
// })
|
50
|
-
} catch (e) {
|
51
|
-
error(e)
|
52
|
-
reject(e)
|
53
|
-
}
|
54
|
-
},
|
55
|
-
async (id, ref) => {
|
56
|
-
ref.dispose()
|
57
|
-
}
|
58
|
-
)
|
59
|
-
|
60
|
-
var subscriptionForAutoRefresh
|
61
|
-
|
62
|
-
export const startSubscribingForAutoRefresh = async (boardId, callback) => {
|
63
|
-
if (!boardId) {
|
64
|
-
return
|
65
|
-
}
|
66
|
-
|
67
|
-
await stopSubscribing()
|
68
|
-
|
69
|
-
subscriptionForAutoRefresh = await subscribe(
|
70
|
-
{
|
71
|
-
query: gql`
|
72
|
-
subscription ($id: String!) {
|
73
|
-
board(id: $id) {
|
74
|
-
id
|
75
|
-
model
|
76
|
-
}
|
77
|
-
}
|
78
|
-
`,
|
79
|
-
variables: {
|
80
|
-
id: boardId
|
81
|
-
}
|
82
|
-
},
|
83
|
-
{
|
84
|
-
next: async ({ data }) => {
|
85
|
-
const { id, model = '{}' } = data.board
|
86
|
-
|
87
|
-
if (data) {
|
88
|
-
callback &&
|
89
|
-
(await callback({
|
90
|
-
id,
|
91
|
-
model: JSON.parse(model)
|
92
|
-
}))
|
93
|
-
}
|
94
|
-
}
|
95
|
-
}
|
96
|
-
)
|
97
|
-
}
|
98
|
-
|
99
|
-
export const stopSubscribing = async () => {
|
100
|
-
await subscriptionForAutoRefresh?.unsubscribe()
|
101
|
-
subscriptionForAutoRefresh = null
|
102
|
-
}
|
103
|
-
|
104
|
-
window['headlessSceneProvider'] = provider
|
105
|
-
window['startSubscribingForAutoRefresh'] = startSubscribingForAutoRefresh
|
106
|
-
window['stopSubscribing'] = stopSubscribing
|
@@ -1 +0,0 @@
|
|
1
|
-
/* 이 파일은 node_modules/@things-scene 아래에 설치된 컴포넌트들의 리스트를 스캔해서 자동으로 import 하기위해 things-scene-webpack-loader 에 의해 로드되는 파일이다. */
|