@things-factory/board-ui 8.0.0-beta.8 → 8.0.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/client/apptools/favorite-tool.ts +124 -0
- package/client/board-list/board-tile-list.ts +272 -0
- package/client/board-list/group-bar-styles.ts +63 -0
- package/client/board-list/group-bar.ts +99 -0
- package/client/board-list/play-group-bar.ts +88 -0
- package/client/board-provider.ts +92 -0
- package/client/bootstrap.ts +39 -0
- package/client/data-grist/board-editor.ts +113 -0
- package/client/data-grist/board-renderer.ts +134 -0
- package/client/data-grist/color-map-editor.ts +17 -0
- package/client/data-grist/color-ranges-editor.ts +17 -0
- package/client/graphql/board-template.ts +141 -0
- package/client/graphql/board.ts +273 -0
- package/client/graphql/favorite-board.ts +25 -0
- package/client/graphql/group.ts +138 -0
- package/client/graphql/index.ts +6 -0
- package/client/graphql/my-board.ts +25 -0
- package/client/graphql/play-group.ts +189 -0
- package/client/index.ts +10 -0
- package/client/pages/attachment-list-page.ts +142 -0
- package/client/pages/board-list-page.ts +603 -0
- package/client/pages/board-modeller-page.ts +288 -0
- package/client/pages/board-player-by-name-page.ts +29 -0
- package/client/pages/board-player-page.ts +241 -0
- package/client/pages/board-template/board-template-list-page.ts +248 -0
- package/client/pages/board-viewer-by-name-page.ts +24 -0
- package/client/pages/board-viewer-page.ts +271 -0
- package/client/pages/font-list-page.ts +31 -0
- package/client/pages/play-list-page.ts +400 -0
- package/client/pages/printable-board-viewer-page.ts +54 -0
- package/client/pages/theme/theme-editors.ts +56 -0
- package/client/pages/theme/theme-list-page.ts +313 -0
- package/client/pages/things-scene-components-with-tools.import +0 -0
- package/client/pages/things-scene-components.import +0 -0
- package/client/route.ts +51 -0
- package/client/setting-let/board-view-setting-let.ts +68 -0
- package/client/themes/board-theme.css +77 -0
- package/client/things-scene-import.d.ts +4 -0
- package/client/viewparts/board-basic-info.ts +646 -0
- package/client/viewparts/board-info-link.ts +56 -0
- package/client/viewparts/board-info.ts +85 -0
- package/client/viewparts/board-template-builder.ts +134 -0
- package/client/viewparts/board-versions.ts +172 -0
- package/client/viewparts/group-info-basic.ts +267 -0
- package/client/viewparts/group-info-import.ts +132 -0
- package/client/viewparts/group-info.ts +87 -0
- package/client/viewparts/index.ts +3 -0
- package/client/viewparts/link-builder.ts +210 -0
- package/client/viewparts/play-group-info-basic.ts +268 -0
- package/client/viewparts/play-group-info-link.ts +46 -0
- package/client/viewparts/play-group-info.ts +81 -0
- package/dist-client/tsconfig.tsbuildinfo +1 -1
- package/dist-server/tsconfig.tsbuildinfo +1 -1
- package/package.json +19 -19
- package/server/index.ts +0 -0
|
@@ -0,0 +1,273 @@
|
|
|
1
|
+
import gql from 'graphql-tag'
|
|
2
|
+
|
|
3
|
+
import { client } from '@operato/graphql'
|
|
4
|
+
import { gqlBuilder } from '@things-factory/utils'
|
|
5
|
+
|
|
6
|
+
export async function fetchBoardList(listParam = {}) {
|
|
7
|
+
const response = await client.query({
|
|
8
|
+
query: gql`
|
|
9
|
+
{
|
|
10
|
+
boards(${gqlBuilder.buildArgs(listParam)}) {
|
|
11
|
+
items {
|
|
12
|
+
id
|
|
13
|
+
name
|
|
14
|
+
description
|
|
15
|
+
thumbnail
|
|
16
|
+
state
|
|
17
|
+
version
|
|
18
|
+
createdAt
|
|
19
|
+
updatedAt
|
|
20
|
+
}
|
|
21
|
+
total
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
`
|
|
25
|
+
})
|
|
26
|
+
|
|
27
|
+
return response.data
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export async function fetchBoard(id) {
|
|
31
|
+
const response = await client.query({
|
|
32
|
+
query: gql`
|
|
33
|
+
query FetchBoardById($id: String!) {
|
|
34
|
+
board(id: $id) {
|
|
35
|
+
id
|
|
36
|
+
name
|
|
37
|
+
description
|
|
38
|
+
group {
|
|
39
|
+
id
|
|
40
|
+
name
|
|
41
|
+
}
|
|
42
|
+
thumbnail
|
|
43
|
+
model
|
|
44
|
+
createdAt
|
|
45
|
+
creator {
|
|
46
|
+
id
|
|
47
|
+
name
|
|
48
|
+
}
|
|
49
|
+
state
|
|
50
|
+
version
|
|
51
|
+
updatedAt
|
|
52
|
+
updater {
|
|
53
|
+
id
|
|
54
|
+
name
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
`,
|
|
59
|
+
variables: { id }
|
|
60
|
+
})
|
|
61
|
+
|
|
62
|
+
return response.data
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
export async function createBoard(board) {
|
|
66
|
+
/*
|
|
67
|
+
input NewBoard {
|
|
68
|
+
name : String!
|
|
69
|
+
description : String
|
|
70
|
+
model : String!
|
|
71
|
+
groupId : String!
|
|
72
|
+
}
|
|
73
|
+
*/
|
|
74
|
+
|
|
75
|
+
board.model = JSON.stringify(board.model)
|
|
76
|
+
|
|
77
|
+
const response = await client.mutate({
|
|
78
|
+
mutation: gql`
|
|
79
|
+
mutation CreateBoard($board: NewBoard!) {
|
|
80
|
+
createBoard(board: $board) {
|
|
81
|
+
id
|
|
82
|
+
name
|
|
83
|
+
description
|
|
84
|
+
model
|
|
85
|
+
state
|
|
86
|
+
version
|
|
87
|
+
createdAt
|
|
88
|
+
updatedAt
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
`,
|
|
92
|
+
variables: {
|
|
93
|
+
board
|
|
94
|
+
}
|
|
95
|
+
})
|
|
96
|
+
|
|
97
|
+
return response.data
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
export async function cloneBoard({
|
|
101
|
+
id,
|
|
102
|
+
name,
|
|
103
|
+
description,
|
|
104
|
+
targetSubdomain,
|
|
105
|
+
targetGroupId
|
|
106
|
+
}: {
|
|
107
|
+
id: string
|
|
108
|
+
name: string
|
|
109
|
+
description: string
|
|
110
|
+
targetSubdomain: string
|
|
111
|
+
targetGroupId: string
|
|
112
|
+
}) {
|
|
113
|
+
const response = await client.mutate({
|
|
114
|
+
mutation: gql`
|
|
115
|
+
mutation CloneBoard($id: String!, $patch: BoardPatch!, $targetSubdomain: String!, $targetGroupId: String) {
|
|
116
|
+
cloneBoard(id: $id, patch: $patch, targetSubdomain: $targetSubdomain, targetGroupId: $targetGroupId) {
|
|
117
|
+
id
|
|
118
|
+
name
|
|
119
|
+
description
|
|
120
|
+
model
|
|
121
|
+
group {
|
|
122
|
+
id
|
|
123
|
+
name
|
|
124
|
+
}
|
|
125
|
+
state
|
|
126
|
+
version
|
|
127
|
+
createdAt
|
|
128
|
+
updatedAt
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
`,
|
|
132
|
+
variables: {
|
|
133
|
+
id,
|
|
134
|
+
patch: { name, description },
|
|
135
|
+
targetSubdomain,
|
|
136
|
+
targetGroupId
|
|
137
|
+
}
|
|
138
|
+
})
|
|
139
|
+
|
|
140
|
+
return response.data
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
export async function releaseBoard(board) {
|
|
144
|
+
var { id } = board
|
|
145
|
+
|
|
146
|
+
const response = await client.mutate({
|
|
147
|
+
mutation: gql`
|
|
148
|
+
mutation ReleaseBoard($id: String!) {
|
|
149
|
+
releaseBoard(id: $id) {
|
|
150
|
+
id
|
|
151
|
+
name
|
|
152
|
+
description
|
|
153
|
+
model
|
|
154
|
+
group {
|
|
155
|
+
id
|
|
156
|
+
name
|
|
157
|
+
}
|
|
158
|
+
state
|
|
159
|
+
version
|
|
160
|
+
createdAt
|
|
161
|
+
updatedAt
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
`,
|
|
165
|
+
variables: {
|
|
166
|
+
id
|
|
167
|
+
}
|
|
168
|
+
})
|
|
169
|
+
|
|
170
|
+
return response.data
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
export async function revertBoardVersion(id, version) {
|
|
174
|
+
const response = await client.mutate({
|
|
175
|
+
mutation: gql`
|
|
176
|
+
mutation RevertBoardVersion($id: String!, $version: Float!) {
|
|
177
|
+
revertBoardVersion(id: $id, version: $version) {
|
|
178
|
+
name
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
`,
|
|
182
|
+
variables: {
|
|
183
|
+
id,
|
|
184
|
+
version
|
|
185
|
+
}
|
|
186
|
+
})
|
|
187
|
+
|
|
188
|
+
return response.data.revertBoardVersion
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
export async function updateBoard(board) {
|
|
192
|
+
/*
|
|
193
|
+
input BoardPatch {
|
|
194
|
+
name : String
|
|
195
|
+
description : String
|
|
196
|
+
model : String
|
|
197
|
+
}
|
|
198
|
+
*/
|
|
199
|
+
var { id, name, description, model, groupId } = board
|
|
200
|
+
model = JSON.stringify(model)
|
|
201
|
+
|
|
202
|
+
const response = await client.mutate({
|
|
203
|
+
mutation: gql`
|
|
204
|
+
mutation UpdateBoard($id: String!, $patch: BoardPatch!) {
|
|
205
|
+
updateBoard(id: $id, patch: $patch) {
|
|
206
|
+
id
|
|
207
|
+
name
|
|
208
|
+
description
|
|
209
|
+
model
|
|
210
|
+
group {
|
|
211
|
+
id
|
|
212
|
+
name
|
|
213
|
+
}
|
|
214
|
+
state
|
|
215
|
+
version
|
|
216
|
+
createdAt
|
|
217
|
+
updatedAt
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
`,
|
|
221
|
+
variables: {
|
|
222
|
+
id,
|
|
223
|
+
patch: { name, description, model, groupId }
|
|
224
|
+
}
|
|
225
|
+
})
|
|
226
|
+
|
|
227
|
+
return response.data
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
export async function deleteBoard(id) {
|
|
231
|
+
const response = await client.mutate({
|
|
232
|
+
mutation: gql`
|
|
233
|
+
mutation ($id: String!) {
|
|
234
|
+
deleteBoard(id: $id)
|
|
235
|
+
}
|
|
236
|
+
`,
|
|
237
|
+
variables: {
|
|
238
|
+
id
|
|
239
|
+
}
|
|
240
|
+
})
|
|
241
|
+
|
|
242
|
+
return response.data
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
export async function importBoards({
|
|
246
|
+
groupId,
|
|
247
|
+
files,
|
|
248
|
+
overwrite
|
|
249
|
+
}: {
|
|
250
|
+
groupId: string
|
|
251
|
+
files: File[]
|
|
252
|
+
overwrite: boolean
|
|
253
|
+
}) {
|
|
254
|
+
const response = await client.mutate({
|
|
255
|
+
mutation: gql`
|
|
256
|
+
mutation importBoards($groupId: String!, $files: [Upload!]!, $overwrite: Boolean!) {
|
|
257
|
+
importBoards(groupId: $groupId, files: $files, overwrite: $overwrite) {
|
|
258
|
+
id
|
|
259
|
+
name
|
|
260
|
+
description
|
|
261
|
+
}
|
|
262
|
+
}
|
|
263
|
+
`,
|
|
264
|
+
variables: {
|
|
265
|
+
groupId,
|
|
266
|
+
files,
|
|
267
|
+
overwrite
|
|
268
|
+
},
|
|
269
|
+
context: { hasUpload: true }
|
|
270
|
+
})
|
|
271
|
+
|
|
272
|
+
return response.data
|
|
273
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import gql from 'graphql-tag'
|
|
2
|
+
import { client } from '@operato/graphql'
|
|
3
|
+
import { gqlBuilder } from '@things-factory/utils'
|
|
4
|
+
|
|
5
|
+
export async function fetchFavoriteBoardList(listParam = {}) {
|
|
6
|
+
const response = await client.query({
|
|
7
|
+
query: gql`
|
|
8
|
+
{
|
|
9
|
+
favoriteBoards(${gqlBuilder.buildArgs(listParam)}) {
|
|
10
|
+
items {
|
|
11
|
+
id
|
|
12
|
+
name
|
|
13
|
+
description
|
|
14
|
+
thumbnail
|
|
15
|
+
createdAt
|
|
16
|
+
updatedAt
|
|
17
|
+
}
|
|
18
|
+
total
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
`
|
|
22
|
+
})
|
|
23
|
+
|
|
24
|
+
return response.data
|
|
25
|
+
}
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
import gql from 'graphql-tag'
|
|
2
|
+
|
|
3
|
+
import { client } from '@operato/graphql'
|
|
4
|
+
|
|
5
|
+
export async function fetchGroup(id) {
|
|
6
|
+
const response = await client.query({
|
|
7
|
+
query: gql`
|
|
8
|
+
query FetchGroupById($id: String!) {
|
|
9
|
+
group(id: $id) {
|
|
10
|
+
id
|
|
11
|
+
name
|
|
12
|
+
description
|
|
13
|
+
createdAt
|
|
14
|
+
creator {
|
|
15
|
+
id
|
|
16
|
+
name
|
|
17
|
+
}
|
|
18
|
+
updatedAt
|
|
19
|
+
updater {
|
|
20
|
+
id
|
|
21
|
+
name
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
`,
|
|
26
|
+
variables: { id }
|
|
27
|
+
})
|
|
28
|
+
|
|
29
|
+
return response.data
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export async function updateGroup(group) {
|
|
33
|
+
var { id, name, description } = group
|
|
34
|
+
|
|
35
|
+
const response = await client.mutate({
|
|
36
|
+
mutation: gql`
|
|
37
|
+
mutation UpdateGroup($id: String!, $patch: GroupPatch!) {
|
|
38
|
+
updateGroup(id: $id, patch: $patch) {
|
|
39
|
+
id
|
|
40
|
+
name
|
|
41
|
+
description
|
|
42
|
+
createdAt
|
|
43
|
+
updatedAt
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
`,
|
|
47
|
+
variables: {
|
|
48
|
+
id,
|
|
49
|
+
patch: { name, description }
|
|
50
|
+
}
|
|
51
|
+
})
|
|
52
|
+
|
|
53
|
+
return response.data
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
export async function deleteGroup(id) {
|
|
57
|
+
const response = await client.mutate({
|
|
58
|
+
mutation: gql`
|
|
59
|
+
mutation ($id: String!) {
|
|
60
|
+
deleteGroup(id: $id)
|
|
61
|
+
}
|
|
62
|
+
`,
|
|
63
|
+
variables: {
|
|
64
|
+
id
|
|
65
|
+
}
|
|
66
|
+
})
|
|
67
|
+
|
|
68
|
+
return response.data
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
export async function fetchGroupList() {
|
|
72
|
+
const response = await client.query({
|
|
73
|
+
query: gql`
|
|
74
|
+
{
|
|
75
|
+
groups {
|
|
76
|
+
items {
|
|
77
|
+
id
|
|
78
|
+
name
|
|
79
|
+
description
|
|
80
|
+
createdAt
|
|
81
|
+
updatedAt
|
|
82
|
+
}
|
|
83
|
+
total
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
`
|
|
87
|
+
})
|
|
88
|
+
|
|
89
|
+
return response.data
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
export async function createGroup(group) {
|
|
93
|
+
const response = await client.mutate({
|
|
94
|
+
mutation: gql`
|
|
95
|
+
mutation CreateGroup($group: NewGroup!) {
|
|
96
|
+
createGroup(group: $group) {
|
|
97
|
+
id
|
|
98
|
+
name
|
|
99
|
+
description
|
|
100
|
+
createdAt
|
|
101
|
+
updatedAt
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
`,
|
|
105
|
+
variables: { group }
|
|
106
|
+
})
|
|
107
|
+
|
|
108
|
+
return response.data
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
export async function joinGroup(boardId, groupId) {
|
|
112
|
+
const response = await client.mutate({
|
|
113
|
+
mutation: gql`
|
|
114
|
+
mutation JoinGroup($id: String!, $boardIds: [String!]!) {
|
|
115
|
+
joinGroup(id: $id, boardIds: $boardIds) {
|
|
116
|
+
id
|
|
117
|
+
name
|
|
118
|
+
description
|
|
119
|
+
boards {
|
|
120
|
+
id
|
|
121
|
+
name
|
|
122
|
+
description
|
|
123
|
+
createdAt
|
|
124
|
+
updatedAt
|
|
125
|
+
}
|
|
126
|
+
createdAt
|
|
127
|
+
updatedAt
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
`,
|
|
131
|
+
variables: {
|
|
132
|
+
id: groupId,
|
|
133
|
+
boardIds: [boardId]
|
|
134
|
+
}
|
|
135
|
+
})
|
|
136
|
+
|
|
137
|
+
return response.data
|
|
138
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import gql from 'graphql-tag'
|
|
2
|
+
import { client } from '@operato/graphql'
|
|
3
|
+
import { gqlBuilder } from '@things-factory/utils'
|
|
4
|
+
|
|
5
|
+
export async function fetchMyBoardList(listParam = {}) {
|
|
6
|
+
const response = await client.query({
|
|
7
|
+
query: gql`
|
|
8
|
+
{
|
|
9
|
+
boardsCreatedByMe(${gqlBuilder.buildArgs(listParam)}) {
|
|
10
|
+
items {
|
|
11
|
+
id
|
|
12
|
+
name
|
|
13
|
+
description
|
|
14
|
+
thumbnail
|
|
15
|
+
createdAt
|
|
16
|
+
updatedAt
|
|
17
|
+
}
|
|
18
|
+
total
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
`
|
|
22
|
+
})
|
|
23
|
+
|
|
24
|
+
return response.data
|
|
25
|
+
}
|
|
@@ -0,0 +1,189 @@
|
|
|
1
|
+
import gql from 'graphql-tag'
|
|
2
|
+
|
|
3
|
+
import { client } from '@operato/graphql'
|
|
4
|
+
|
|
5
|
+
export async function fetchPlayGroupList() {
|
|
6
|
+
const response = await client.query({
|
|
7
|
+
query: gql`
|
|
8
|
+
{
|
|
9
|
+
playGroups {
|
|
10
|
+
items {
|
|
11
|
+
id
|
|
12
|
+
name
|
|
13
|
+
description
|
|
14
|
+
}
|
|
15
|
+
total
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
`
|
|
19
|
+
})
|
|
20
|
+
|
|
21
|
+
return response.data
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export async function fetchPlayGroup(groupId) {
|
|
25
|
+
const response = await client.query({
|
|
26
|
+
query: gql`
|
|
27
|
+
query FetchPlayGroup($id: String!) {
|
|
28
|
+
playGroup(id: $id) {
|
|
29
|
+
id
|
|
30
|
+
name
|
|
31
|
+
description
|
|
32
|
+
boards {
|
|
33
|
+
id
|
|
34
|
+
name
|
|
35
|
+
description
|
|
36
|
+
model
|
|
37
|
+
thumbnail
|
|
38
|
+
createdAt
|
|
39
|
+
creator {
|
|
40
|
+
id
|
|
41
|
+
name
|
|
42
|
+
}
|
|
43
|
+
updatedAt
|
|
44
|
+
updater {
|
|
45
|
+
id
|
|
46
|
+
name
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
createdAt
|
|
50
|
+
creator {
|
|
51
|
+
id
|
|
52
|
+
name
|
|
53
|
+
}
|
|
54
|
+
updatedAt
|
|
55
|
+
updater {
|
|
56
|
+
id
|
|
57
|
+
name
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
`,
|
|
62
|
+
variables: {
|
|
63
|
+
id: groupId
|
|
64
|
+
}
|
|
65
|
+
})
|
|
66
|
+
|
|
67
|
+
return response.data
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
export async function createPlayGroup(group) {
|
|
71
|
+
var { name, description } = group
|
|
72
|
+
|
|
73
|
+
const response = await client.mutate({
|
|
74
|
+
mutation: gql`
|
|
75
|
+
mutation CreatePlayGroup($playGroup: NewPlayGroup!) {
|
|
76
|
+
createPlayGroup(playGroup: $playGroup) {
|
|
77
|
+
id
|
|
78
|
+
name
|
|
79
|
+
description
|
|
80
|
+
createdAt
|
|
81
|
+
updatedAt
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
`,
|
|
85
|
+
variables: {
|
|
86
|
+
playGroup: { name, description }
|
|
87
|
+
}
|
|
88
|
+
})
|
|
89
|
+
|
|
90
|
+
return response.data
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
export async function updatePlayGroup(group) {
|
|
94
|
+
var { id, name, description } = group
|
|
95
|
+
|
|
96
|
+
const response = await client.mutate({
|
|
97
|
+
mutation: gql`
|
|
98
|
+
mutation UpdatePlayGroup($id: String!, $patch: PlayGroupPatch!) {
|
|
99
|
+
updatePlayGroup(id: $id, patch: $patch) {
|
|
100
|
+
id
|
|
101
|
+
name
|
|
102
|
+
description
|
|
103
|
+
createdAt
|
|
104
|
+
updatedAt
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
`,
|
|
108
|
+
variables: {
|
|
109
|
+
id,
|
|
110
|
+
patch: { name, description }
|
|
111
|
+
}
|
|
112
|
+
})
|
|
113
|
+
|
|
114
|
+
return response.data
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
export async function deletePlayGroup(id) {
|
|
118
|
+
const response = await client.mutate({
|
|
119
|
+
mutation: gql`
|
|
120
|
+
mutation ($id: String!) {
|
|
121
|
+
deletePlayGroup(id: $id)
|
|
122
|
+
}
|
|
123
|
+
`,
|
|
124
|
+
variables: {
|
|
125
|
+
id
|
|
126
|
+
}
|
|
127
|
+
})
|
|
128
|
+
return response.data
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
export async function joinPlayGroup(boardId, group) {
|
|
132
|
+
var { id, name, description } = group
|
|
133
|
+
|
|
134
|
+
const response = await client.mutate({
|
|
135
|
+
mutation: gql`
|
|
136
|
+
mutation JoinPlayGroup($id: String!, $boardIds: [String!]!) {
|
|
137
|
+
joinPlayGroup(id: $id, boardIds: $boardIds) {
|
|
138
|
+
id
|
|
139
|
+
name
|
|
140
|
+
description
|
|
141
|
+
boards {
|
|
142
|
+
id
|
|
143
|
+
name
|
|
144
|
+
description
|
|
145
|
+
createdAt
|
|
146
|
+
updatedAt
|
|
147
|
+
}
|
|
148
|
+
createdAt
|
|
149
|
+
updatedAt
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
`,
|
|
153
|
+
variables: {
|
|
154
|
+
id,
|
|
155
|
+
boardIds: [boardId]
|
|
156
|
+
}
|
|
157
|
+
})
|
|
158
|
+
|
|
159
|
+
return response.data
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
export async function leavePlayGroup(boardId, groupId) {
|
|
163
|
+
const response = await client.mutate({
|
|
164
|
+
mutation: gql`
|
|
165
|
+
mutation ($id: String!, $boardIds: [String]!) {
|
|
166
|
+
leavePlayGroup(id: $id, boardIds: $boardIds) {
|
|
167
|
+
id
|
|
168
|
+
name
|
|
169
|
+
description
|
|
170
|
+
boards {
|
|
171
|
+
id
|
|
172
|
+
name
|
|
173
|
+
description
|
|
174
|
+
createdAt
|
|
175
|
+
updatedAt
|
|
176
|
+
}
|
|
177
|
+
createdAt
|
|
178
|
+
updatedAt
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
`,
|
|
182
|
+
variables: {
|
|
183
|
+
id: groupId,
|
|
184
|
+
boardIds: [boardId]
|
|
185
|
+
}
|
|
186
|
+
})
|
|
187
|
+
|
|
188
|
+
return response.data
|
|
189
|
+
}
|
package/client/index.ts
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export * from './board-provider'
|
|
2
|
+
|
|
3
|
+
export * from './pages/board-viewer-page'
|
|
4
|
+
export * from './pages/board-player-page'
|
|
5
|
+
export * from './pages/board-modeller-page'
|
|
6
|
+
|
|
7
|
+
export * from './setting-let/board-view-setting-let'
|
|
8
|
+
export * from './apptools/favorite-tool'
|
|
9
|
+
export * from './graphql'
|
|
10
|
+
export * from './viewparts'
|