@things-factory/board-ui 6.2.102 → 6.2.112
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/dist-client/apptools/favorite-tool.d.ts +26 -0
- package/dist-client/apptools/favorite-tool.js +129 -0
- package/dist-client/apptools/favorite-tool.js.map +1 -0
- package/dist-client/board-list/board-importer.d.ts +6 -0
- package/dist-client/board-list/board-importer.js +112 -0
- package/dist-client/board-list/board-importer.js.map +1 -0
- package/dist-client/board-list/board-tile-list.d.ts +22 -0
- package/dist-client/board-list/board-tile-list.js +264 -0
- package/dist-client/board-list/board-tile-list.js.map +1 -0
- package/dist-client/board-list/group-bar.d.ts +14 -0
- package/dist-client/board-list/group-bar.js +145 -0
- package/dist-client/board-list/group-bar.js.map +1 -0
- package/dist-client/board-list/play-group-bar.d.ts +21 -0
- package/dist-client/board-list/play-group-bar.js +142 -0
- package/dist-client/board-list/play-group-bar.js.map +1 -0
- package/dist-client/board-provider.d.ts +3 -0
- package/dist-client/board-provider.js +77 -0
- package/dist-client/board-provider.js.map +1 -0
- package/dist-client/bootstrap.d.ts +2 -0
- package/dist-client/bootstrap.js +30 -0
- package/dist-client/bootstrap.js.map +1 -0
- package/dist-client/data-grist/board-editor.d.ts +14 -0
- package/dist-client/data-grist/board-editor.js +110 -0
- package/dist-client/data-grist/board-editor.js.map +1 -0
- package/dist-client/data-grist/board-renderer.d.ts +2 -0
- package/dist-client/data-grist/board-renderer.js +134 -0
- package/dist-client/data-grist/board-renderer.js.map +1 -0
- package/dist-client/data-grist/color-map-editor.d.ts +4 -0
- package/dist-client/data-grist/color-map-editor.js +15 -0
- package/dist-client/data-grist/color-map-editor.js.map +1 -0
- package/dist-client/data-grist/color-ranges-editor.d.ts +4 -0
- package/dist-client/data-grist/color-ranges-editor.js +15 -0
- package/dist-client/data-grist/color-ranges-editor.js.map +1 -0
- package/dist-client/graphql/board-template.d.ts +5 -0
- package/dist-client/graphql/board-template.js +128 -0
- package/dist-client/graphql/board-template.js.map +1 -0
- package/dist-client/graphql/board.d.ts +19 -0
- package/dist-client/graphql/board.js +231 -0
- package/dist-client/graphql/board.js.map +1 -0
- package/dist-client/graphql/favorite-board.d.ts +1 -0
- package/dist-client/graphql/favorite-board.js +24 -0
- package/dist-client/graphql/favorite-board.js.map +1 -0
- package/dist-client/graphql/group.d.ts +6 -0
- package/dist-client/graphql/group.js +125 -0
- package/dist-client/graphql/group.js.map +1 -0
- package/dist-client/graphql/index.d.ts +6 -0
- package/dist-client/graphql/index.js +7 -0
- package/dist-client/graphql/index.js.map +1 -0
- package/dist-client/graphql/my-board.d.ts +1 -0
- package/dist-client/graphql/my-board.js +24 -0
- package/dist-client/graphql/my-board.js.map +1 -0
- package/dist-client/graphql/play-group.d.ts +7 -0
- package/dist-client/graphql/play-group.js +173 -0
- package/dist-client/graphql/play-group.js.map +1 -0
- package/dist-client/index.d.ts +8 -0
- package/dist-client/index.js +9 -0
- package/dist-client/index.js.map +1 -0
- package/dist-client/pages/attachment-list-page.d.ts +30 -0
- package/dist-client/pages/attachment-list-page.js +128 -0
- package/dist-client/pages/attachment-list-page.js.map +1 -0
- package/dist-client/pages/board-list-page.d.ts +109 -0
- package/dist-client/pages/board-list-page.js +532 -0
- package/dist-client/pages/board-list-page.js.map +1 -0
- package/dist-client/pages/board-modeller-page.d.ts +49 -0
- package/dist-client/pages/board-modeller-page.js +309 -0
- package/dist-client/pages/board-modeller-page.js.map +1 -0
- package/dist-client/pages/board-player-by-name-page.d.ts +4 -0
- package/dist-client/pages/board-player-by-name-page.js +32 -0
- package/dist-client/pages/board-player-by-name-page.js.map +1 -0
- package/dist-client/pages/board-player-page.d.ts +42 -0
- package/dist-client/pages/board-player-page.js +230 -0
- package/dist-client/pages/board-player-page.js.map +1 -0
- package/dist-client/pages/board-template/board-template-list-page.d.ts +37 -0
- package/dist-client/pages/board-template/board-template-list-page.js +226 -0
- package/dist-client/pages/board-template/board-template-list-page.js.map +1 -0
- package/dist-client/pages/board-viewer-by-name-page.d.ts +4 -0
- package/dist-client/pages/board-viewer-by-name-page.js +27 -0
- package/dist-client/pages/board-viewer-by-name-page.js.map +1 -0
- package/dist-client/pages/board-viewer-page.d.ts +41 -0
- package/dist-client/pages/board-viewer-page.js +246 -0
- package/dist-client/pages/board-viewer-page.js.map +1 -0
- package/dist-client/pages/font-list-page.d.ts +9 -0
- package/dist-client/pages/font-list-page.js +31 -0
- package/dist-client/pages/font-list-page.js.map +1 -0
- package/dist-client/pages/play-list-page.d.ts +58 -0
- package/dist-client/pages/play-list-page.js +364 -0
- package/dist-client/pages/play-list-page.js.map +1 -0
- package/dist-client/pages/printable-board-viewer-page.d.ts +11 -0
- package/dist-client/pages/printable-board-viewer-page.js +43 -0
- package/dist-client/pages/printable-board-viewer-page.js.map +1 -0
- package/dist-client/pages/theme/theme-editors.d.ts +5 -0
- package/dist-client/pages/theme/theme-editors.js +53 -0
- package/dist-client/pages/theme/theme-editors.js.map +1 -0
- package/dist-client/pages/theme/theme-list-page.d.ts +49 -0
- package/dist-client/pages/theme/theme-list-page.js +318 -0
- package/dist-client/pages/theme/theme-list-page.js.map +1 -0
- package/dist-client/pages/things-scene-components-with-tools.import +0 -0
- package/dist-client/pages/things-scene-components.import +0 -0
- package/dist-client/route.d.ts +1 -0
- package/dist-client/route.js +41 -0
- package/dist-client/route.js.map +1 -0
- package/dist-client/setting-let/board-view-setting-let.d.ts +14 -0
- package/dist-client/setting-let/board-view-setting-let.js +66 -0
- package/dist-client/setting-let/board-view-setting-let.js.map +1 -0
- package/dist-client/themes/board-theme.css +76 -0
- package/dist-client/tsconfig.tsbuildinfo +1 -0
- package/dist-client/viewparts/board-basic-info.d.ts +47 -0
- package/dist-client/viewparts/board-basic-info.js +641 -0
- package/dist-client/viewparts/board-basic-info.js.map +1 -0
- package/dist-client/viewparts/board-info-link.d.ts +12 -0
- package/dist-client/viewparts/board-info-link.js +59 -0
- package/dist-client/viewparts/board-info-link.js.map +1 -0
- package/dist-client/viewparts/board-info.d.ts +14 -0
- package/dist-client/viewparts/board-info.js +94 -0
- package/dist-client/viewparts/board-info.js.map +1 -0
- package/dist-client/viewparts/board-template-builder.d.ts +16 -0
- package/dist-client/viewparts/board-template-builder.js +145 -0
- package/dist-client/viewparts/board-template-builder.js.map +1 -0
- package/dist-client/viewparts/board-versions.d.ts +12 -0
- package/dist-client/viewparts/board-versions.js +157 -0
- package/dist-client/viewparts/board-versions.js.map +1 -0
- package/dist-client/viewparts/group-info-basic.d.ts +16 -0
- package/dist-client/viewparts/group-info-basic.js +247 -0
- package/dist-client/viewparts/group-info-basic.js.map +1 -0
- package/dist-client/viewparts/group-info-import.d.ts +15 -0
- package/dist-client/viewparts/group-info-import.js +137 -0
- package/dist-client/viewparts/group-info-import.js.map +1 -0
- package/dist-client/viewparts/group-info.d.ts +10 -0
- package/dist-client/viewparts/group-info.js +92 -0
- package/dist-client/viewparts/group-info.js.map +1 -0
- package/dist-client/viewparts/index.d.ts +3 -0
- package/dist-client/viewparts/index.js +4 -0
- package/dist-client/viewparts/index.js.map +1 -0
- package/dist-client/viewparts/link-builder.d.ts +22 -0
- package/dist-client/viewparts/link-builder.js +217 -0
- package/dist-client/viewparts/link-builder.js.map +1 -0
- package/dist-client/viewparts/play-group-info-basic.d.ts +16 -0
- package/dist-client/viewparts/play-group-info-basic.js +249 -0
- package/dist-client/viewparts/play-group-info-basic.js.map +1 -0
- package/dist-client/viewparts/play-group-info-link.d.ts +10 -0
- package/dist-client/viewparts/play-group-info-link.js +48 -0
- package/dist-client/viewparts/play-group-info-link.js.map +1 -0
- package/dist-client/viewparts/play-group-info.d.ts +13 -0
- package/dist-client/viewparts/play-group-info.js +90 -0
- package/dist-client/viewparts/play-group-info.js.map +1 -0
- package/dist-server/index.js +5 -0
- package/dist-server/index.js.map +1 -0
- package/dist-server/migrations/index.js +12 -0
- package/dist-server/migrations/index.js.map +1 -0
- package/dist-server/tsconfig.tsbuildinfo +1 -0
- package/package.json +5 -5
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
import gql from 'graphql-tag';
|
|
2
|
+
import { client } from '@operato/graphql';
|
|
3
|
+
export async function fetchGroup(id) {
|
|
4
|
+
const response = await client.query({
|
|
5
|
+
query: gql `
|
|
6
|
+
query FetchGroupById($id: String!) {
|
|
7
|
+
group(id: $id) {
|
|
8
|
+
id
|
|
9
|
+
name
|
|
10
|
+
description
|
|
11
|
+
createdAt
|
|
12
|
+
creator {
|
|
13
|
+
id
|
|
14
|
+
name
|
|
15
|
+
}
|
|
16
|
+
updatedAt
|
|
17
|
+
updater {
|
|
18
|
+
id
|
|
19
|
+
name
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
`,
|
|
24
|
+
variables: { id }
|
|
25
|
+
});
|
|
26
|
+
return response.data;
|
|
27
|
+
}
|
|
28
|
+
export async function updateGroup(group) {
|
|
29
|
+
var { id, name, description } = group;
|
|
30
|
+
const response = await client.mutate({
|
|
31
|
+
mutation: gql `
|
|
32
|
+
mutation UpdateGroup($id: String!, $patch: GroupPatch!) {
|
|
33
|
+
updateGroup(id: $id, patch: $patch) {
|
|
34
|
+
id
|
|
35
|
+
name
|
|
36
|
+
description
|
|
37
|
+
createdAt
|
|
38
|
+
updatedAt
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
`,
|
|
42
|
+
variables: {
|
|
43
|
+
id,
|
|
44
|
+
patch: { name, description }
|
|
45
|
+
}
|
|
46
|
+
});
|
|
47
|
+
return response.data;
|
|
48
|
+
}
|
|
49
|
+
export async function deleteGroup(id) {
|
|
50
|
+
const response = await client.mutate({
|
|
51
|
+
mutation: gql `
|
|
52
|
+
mutation ($id: String!) {
|
|
53
|
+
deleteGroup(id: $id)
|
|
54
|
+
}
|
|
55
|
+
`,
|
|
56
|
+
variables: {
|
|
57
|
+
id
|
|
58
|
+
}
|
|
59
|
+
});
|
|
60
|
+
return response.data;
|
|
61
|
+
}
|
|
62
|
+
export async function fetchGroupList() {
|
|
63
|
+
const response = await client.query({
|
|
64
|
+
query: gql `
|
|
65
|
+
{
|
|
66
|
+
groups {
|
|
67
|
+
items {
|
|
68
|
+
id
|
|
69
|
+
name
|
|
70
|
+
description
|
|
71
|
+
createdAt
|
|
72
|
+
updatedAt
|
|
73
|
+
}
|
|
74
|
+
total
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
`
|
|
78
|
+
});
|
|
79
|
+
return response.data;
|
|
80
|
+
}
|
|
81
|
+
export async function createGroup(group) {
|
|
82
|
+
const response = await client.mutate({
|
|
83
|
+
mutation: gql `
|
|
84
|
+
mutation CreateGroup($group: NewGroup!) {
|
|
85
|
+
createGroup(group: $group) {
|
|
86
|
+
id
|
|
87
|
+
name
|
|
88
|
+
description
|
|
89
|
+
createdAt
|
|
90
|
+
updatedAt
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
`,
|
|
94
|
+
variables: { group }
|
|
95
|
+
});
|
|
96
|
+
return response.data;
|
|
97
|
+
}
|
|
98
|
+
export async function joinGroup(boardId, groupId) {
|
|
99
|
+
const response = await client.mutate({
|
|
100
|
+
mutation: gql `
|
|
101
|
+
mutation JoinGroup($id: String!, $boardIds: [String!]!) {
|
|
102
|
+
joinGroup(id: $id, boardIds: $boardIds) {
|
|
103
|
+
id
|
|
104
|
+
name
|
|
105
|
+
description
|
|
106
|
+
boards {
|
|
107
|
+
id
|
|
108
|
+
name
|
|
109
|
+
description
|
|
110
|
+
createdAt
|
|
111
|
+
updatedAt
|
|
112
|
+
}
|
|
113
|
+
createdAt
|
|
114
|
+
updatedAt
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
`,
|
|
118
|
+
variables: {
|
|
119
|
+
id: groupId,
|
|
120
|
+
boardIds: [boardId]
|
|
121
|
+
}
|
|
122
|
+
});
|
|
123
|
+
return response.data;
|
|
124
|
+
}
|
|
125
|
+
//# sourceMappingURL=group.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"group.js","sourceRo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AAK,UAAU,WAAW,CAAC,KAAK;IACrC,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,MAAM,CAAC;QACnC,QAAQ,EAAE,GAAG,CAAA;;;;;;;;;;KAUZ;QACD,SAAS,EAAE,EAAE,KAAK,EAAE;KACrB,CAAC,CAAA;IAEF,OAAO,QAAQ,CAAC,IAAI,CAAA;AACtB,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,SAAS,CAAC,OAAO,EAAE,OAAO;IAC9C,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,MAAM,CAAC;QACnC,QAAQ,EAAE,GAAG,CAAA;;;;;;;;;;;;;;;;;KAiBZ;QACD,SAAS,EAAE;YACT,EAAE,EAAE,OAAO;YACX,QAAQ,EAAE,CAAC,OAAO,CAAC;SACpB;KACF,CAAC,CAAA;IAEF,OAAO,QAAQ,CAAC,IAAI,CAAA;AACtB,CAAC","sourcesContent":["import gql from 'graphql-tag'\n\nimport { client } from '@operato/graphql'\n\nexport async function fetchGroup(id) {\n const response = await client.query({\n query: gql`\n query FetchGroupById($id: String!) {\n group(id: $id) {\n id\n name\n description\n createdAt\n creator {\n id\n name\n }\n updatedAt\n updater {\n id\n name\n }\n }\n }\n `,\n variables: { id }\n })\n\n return response.data\n}\n\nexport async function updateGroup(group) {\n var { id, name, description } = group\n\n const response = await client.mutate({\n mutation: gql`\n mutation UpdateGroup($id: String!, $patch: GroupPatch!) {\n updateGroup(id: $id, patch: $patch) {\n id\n name\n description\n createdAt\n updatedAt\n }\n }\n `,\n variables: {\n id,\n patch: { name, description }\n }\n })\n\n return response.data\n}\n\nexport async function deleteGroup(id) {\n const response = await client.mutate({\n mutation: gql`\n mutation ($id: String!) {\n deleteGroup(id: $id)\n }\n `,\n variables: {\n id\n }\n })\n\n return response.data\n}\n\nexport async function fetchGroupList() {\n const response = await client.query({\n query: gql`\n {\n groups {\n items {\n id\n name\n description\n createdAt\n updatedAt\n }\n total\n }\n }\n `\n })\n\n return response.data\n}\n\nexport async function createGroup(group) {\n const response = await client.mutate({\n mutation: gql`\n mutation CreateGroup($group: NewGroup!) {\n createGroup(group: $group) {\n id\n name\n description\n createdAt\n updatedAt\n }\n }\n `,\n variables: { group }\n })\n\n return response.data\n}\n\nexport async function joinGroup(boardId, groupId) {\n const response = await client.mutate({\n mutation: gql`\n mutation JoinGroup($id: String!, $boardIds: [String!]!) {\n joinGroup(id: $id, boardIds: $boardIds) {\n id\n name\n description\n boards {\n id\n name\n description\n createdAt\n updatedAt\n }\n createdAt\n updatedAt\n }\n }\n `,\n variables: {\n id: groupId,\n boardIds: [boardId]\n }\n })\n\n return response.data\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../client/graphql/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAA;AACvB,cAAc,SAAS,CAAA;AACvB,cAAc,cAAc,CAAA;AAC5B,cAAc,kBAAkB,CAAA;AAChC,cAAc,YAAY,CAAA;AAC1B,cAAc,kBAAkB,CAAA","sourcesContent":["export * from './board'\nexport * from './group'\nexport * from './play-group'\nexport * from './favorite-board'\nexport * from './my-board'\nexport * from './board-template'\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function fetchMyBoardList(listParam?: {}): Promise<any>;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import gql from 'graphql-tag';
|
|
2
|
+
import { client } from '@operato/graphql';
|
|
3
|
+
import { gqlBuilder } from '@things-factory/utils';
|
|
4
|
+
export async function fetchMyBoardList(listParam = {}) {
|
|
5
|
+
const response = await client.query({
|
|
6
|
+
query: gql `
|
|
7
|
+
{
|
|
8
|
+
boardsCreatedByMe(${gqlBuilder.buildArgs(listParam)}) {
|
|
9
|
+
items {
|
|
10
|
+
id
|
|
11
|
+
name
|
|
12
|
+
description
|
|
13
|
+
thumbnail
|
|
14
|
+
createdAt
|
|
15
|
+
updatedAt
|
|
16
|
+
}
|
|
17
|
+
total
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
`
|
|
21
|
+
});
|
|
22
|
+
return response.data;
|
|
23
|
+
}
|
|
24
|
+
//# sourceMappingURL=my-board.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"my-board.js","sourceRoot":"","sources":["../../client/graphql/my-board.ts"],"names":[],"mappings":"AAAA,OAAO,GAAG,MAAM,aAAa,CAAA;AAC7B,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAA;AACzC,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAA;AAElD,MAAM,CAAC,KAAK,UAAU,gBAAgB,CAAC,SAAS,GAAG,EAAE;IACnD,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,KAAK,CAAC;QAClC,KAAK,EAAE,GAAG,CAAA;;4BAEc,UAAU,CAAC,SAAS,CAAC,SAAS,CAAC;;;;;;;;;;;;KAYtD;KACF,CAAC,CAAA;IAEF,OAAO,QAAQ,CAAC,IAAI,CAAA;AACtB,CAAC","sourcesContent":["import gql from 'graphql-tag'\nimport { client } from '@operato/graphql'\nimport { gqlBuilder } from '@things-factory/utils'\n\nexport async function fetchMyBoardList(listParam = {}) {\n const response = await client.query({\n query: gql`\n {\n boardsCreatedByMe(${gqlBuilder.buildArgs(listParam)}) {\n items {\n id\n name\n description\n thumbnail\n createdAt\n updatedAt\n }\n total\n }\n }\n `\n })\n\n return response.data\n}\n"]}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export declare function fetchPlayGroupList(): Promise<any>;
|
|
2
|
+
export declare function fetchPlayGroup(groupId: any): Promise<any>;
|
|
3
|
+
export declare function createPlayGroup(group: any): Promise<any>;
|
|
4
|
+
export declare function updatePlayGroup(group: any): Promise<any>;
|
|
5
|
+
export declare function deletePlayGroup(id: any): Promise<any>;
|
|
6
|
+
export declare function joinPlayGroup(boardId: any, group: any): Promise<any>;
|
|
7
|
+
export declare function leavePlayGroup(boardId: any, groupId: any): Promise<any>;
|
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
import gql from 'graphql-tag';
|
|
2
|
+
import { client } from '@operato/graphql';
|
|
3
|
+
export async function fetchPlayGroupList() {
|
|
4
|
+
const response = await client.query({
|
|
5
|
+
query: gql `
|
|
6
|
+
{
|
|
7
|
+
playGroups {
|
|
8
|
+
items {
|
|
9
|
+
id
|
|
10
|
+
name
|
|
11
|
+
description
|
|
12
|
+
}
|
|
13
|
+
total
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
`
|
|
17
|
+
});
|
|
18
|
+
return response.data;
|
|
19
|
+
}
|
|
20
|
+
export async function fetchPlayGroup(groupId) {
|
|
21
|
+
const response = await client.query({
|
|
22
|
+
query: gql `
|
|
23
|
+
query FetchPlayGroup($id: String!) {
|
|
24
|
+
playGroup(id: $id) {
|
|
25
|
+
id
|
|
26
|
+
name
|
|
27
|
+
description
|
|
28
|
+
boards {
|
|
29
|
+
id
|
|
30
|
+
name
|
|
31
|
+
description
|
|
32
|
+
model
|
|
33
|
+
thumbnail
|
|
34
|
+
createdAt
|
|
35
|
+
creator {
|
|
36
|
+
id
|
|
37
|
+
name
|
|
38
|
+
}
|
|
39
|
+
updatedAt
|
|
40
|
+
updater {
|
|
41
|
+
id
|
|
42
|
+
name
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
createdAt
|
|
46
|
+
creator {
|
|
47
|
+
id
|
|
48
|
+
name
|
|
49
|
+
}
|
|
50
|
+
updatedAt
|
|
51
|
+
updater {
|
|
52
|
+
id
|
|
53
|
+
name
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
`,
|
|
58
|
+
variables: {
|
|
59
|
+
id: groupId
|
|
60
|
+
}
|
|
61
|
+
});
|
|
62
|
+
return response.data;
|
|
63
|
+
}
|
|
64
|
+
export async function createPlayGroup(group) {
|
|
65
|
+
var { name, description } = group;
|
|
66
|
+
const response = await client.mutate({
|
|
67
|
+
mutation: gql `
|
|
68
|
+
mutation CreatePlayGroup($playGroup: NewPlayGroup!) {
|
|
69
|
+
createPlayGroup(playGroup: $playGroup) {
|
|
70
|
+
id
|
|
71
|
+
name
|
|
72
|
+
description
|
|
73
|
+
createdAt
|
|
74
|
+
updatedAt
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
`,
|
|
78
|
+
variables: {
|
|
79
|
+
playGroup: { name, description }
|
|
80
|
+
}
|
|
81
|
+
});
|
|
82
|
+
return response.data;
|
|
83
|
+
}
|
|
84
|
+
export async function updatePlayGroup(group) {
|
|
85
|
+
var { id, name, description } = group;
|
|
86
|
+
const response = await client.mutate({
|
|
87
|
+
mutation: gql `
|
|
88
|
+
mutation UpdatePlayGroup($id: String!, $patch: PlayGroupPatch!) {
|
|
89
|
+
updatePlayGroup(id: $id, patch: $patch) {
|
|
90
|
+
id
|
|
91
|
+
name
|
|
92
|
+
description
|
|
93
|
+
createdAt
|
|
94
|
+
updatedAt
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
`,
|
|
98
|
+
variables: {
|
|
99
|
+
id,
|
|
100
|
+
patch: { name, description }
|
|
101
|
+
}
|
|
102
|
+
});
|
|
103
|
+
return response.data;
|
|
104
|
+
}
|
|
105
|
+
export async function deletePlayGroup(id) {
|
|
106
|
+
const response = await client.mutate({
|
|
107
|
+
mutation: gql `
|
|
108
|
+
mutation ($id: String!) {
|
|
109
|
+
deletePlayGroup(id: $id)
|
|
110
|
+
}
|
|
111
|
+
`,
|
|
112
|
+
variables: {
|
|
113
|
+
id
|
|
114
|
+
}
|
|
115
|
+
});
|
|
116
|
+
return response.data;
|
|
117
|
+
}
|
|
118
|
+
export async function joinPlayGroup(boardId, group) {
|
|
119
|
+
var { id, name, description } = group;
|
|
120
|
+
const response = await client.mutate({
|
|
121
|
+
mutation: gql `
|
|
122
|
+
mutation JoinPlayGroup($id: String!, $boardIds: [String!]!) {
|
|
123
|
+
joinPlayGroup(id: $id, boardIds: $boardIds) {
|
|
124
|
+
id
|
|
125
|
+
name
|
|
126
|
+
description
|
|
127
|
+
boards {
|
|
128
|
+
id
|
|
129
|
+
name
|
|
130
|
+
description
|
|
131
|
+
createdAt
|
|
132
|
+
updatedAt
|
|
133
|
+
}
|
|
134
|
+
createdAt
|
|
135
|
+
updatedAt
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
`,
|
|
139
|
+
variables: {
|
|
140
|
+
id,
|
|
141
|
+
boardIds: [boardId]
|
|
142
|
+
}
|
|
143
|
+
});
|
|
144
|
+
return response.data;
|
|
145
|
+
}
|
|
146
|
+
export async function leavePlayGroup(boardId, groupId) {
|
|
147
|
+
const response = await client.mutate({
|
|
148
|
+
mutation: gql `
|
|
149
|
+
mutation ($id: String!, $boardIds: [String]!) {
|
|
150
|
+
leavePlayGroup(id: $id, boardIds: $boardIds) {
|
|
151
|
+
id
|
|
152
|
+
name
|
|
153
|
+
description
|
|
154
|
+
boards {
|
|
155
|
+
id
|
|
156
|
+
name
|
|
157
|
+
description
|
|
158
|
+
createdAt
|
|
159
|
+
updatedAt
|
|
160
|
+
}
|
|
161
|
+
createdAt
|
|
162
|
+
updatedAt
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
`,
|
|
166
|
+
variables: {
|
|
167
|
+
id: groupId,
|
|
168
|
+
boardIds: [boardId]
|
|
169
|
+
}
|
|
170
|
+
});
|
|
171
|
+
return response.data;
|
|
172
|
+
}
|
|
173
|
+
//# sourceMappingURL=play-group.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"play-group.js","sourceRoot":"","sources":["../../client/graphql/play-group.ts"],"names":[],"mappings":"AAAA,OAAO,GAAG,MAAM,aAAa,CAAA;AAE7B,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAA;AAEzC,MAAM,CAAC,KAAK,UAAU,kBAAkB;IACtC,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,KAAK,CAAC;QAClC,KAAK,EAAE,GAAG,CAAA;;;;;;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IZ;QACD,SAAS,EAAE;YACT,EAAE;SACH;KACF,CAAC,CAAA;IACF,OAAO,QAAQ,CAAC,IAAI,CAAA;AACtB,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,aAAa,CAAC,OAAO,EAAE,KAAK;IAChD,IAAI,EAAE,EAAE,EAAE,IAAI,EAAE,WAAW,EAAE,GAAG,KAAK,CAAA;IAErC,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,MAAM,CAAC;QACnC,QAAQ,EAAE,GAAG,CAAA;;;;;;;;;;;;;;;;;KAiBZ;QACD,SAAS,EAAE;YACT,EAAE;YACF,QAAQ,EAAE,CAAC,OAAO,CAAC;SACpB;KACF,CAAC,CAAA;IAEF,OAAO,QAAQ,CAAC,IAAI,CAAA;AACtB,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,cAAc,CAAC,OAAO,EAAE,OAAO;IACnD,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,MAAM,CAAC;QACnC,QAAQ,EAAE,GAAG,CAAA;;;;;;;;;;;;;;;;;KAiBZ;QACD,SAAS,EAAE;YACT,EAAE,EAAE,OAAO;YACX,QAAQ,EAAE,CAAC,OAAO,CAAC;SACpB;KACF,CAAC,CAAA;IAEF,OAAO,QAAQ,CAAC,IAAI,CAAA;AACtB,CAAC","sourcesContent":["import gql from 'graphql-tag'\n\nimport { client } from '@operato/graphql'\n\nexport async function fetchPlayGroupList() {\n const response = await client.query({\n query: gql`\n {\n playGroups {\n items {\n id\n name\n description\n }\n total\n }\n }\n `\n })\n\n return response.data\n}\n\nexport async function fetchPlayGroup(groupId) {\n const response = await client.query({\n query: gql`\n query FetchPlayGroup($id: String!) {\n playGroup(id: $id) {\n id\n name\n description\n boards {\n id\n name\n description\n model\n thumbnail\n createdAt\n creator {\n id\n name\n }\n updatedAt\n updater {\n id\n name\n }\n }\n createdAt\n creator {\n id\n name\n }\n updatedAt\n updater {\n id\n name\n }\n }\n }\n `,\n variables: {\n id: groupId\n }\n })\n\n return response.data\n}\n\nexport async function createPlayGroup(group) {\n var { name, description } = group\n\n const response = await client.mutate({\n mutation: gql`\n mutation CreatePlayGroup($playGroup: NewPlayGroup!) {\n createPlayGroup(playGroup: $playGroup) {\n id\n name\n description\n createdAt\n updatedAt\n }\n }\n `,\n variables: {\n playGroup: { name, description }\n }\n })\n\n return response.data\n}\n\nexport async function updatePlayGroup(group) {\n var { id, name, description } = group\n\n const response = await client.mutate({\n mutation: gql`\n mutation UpdatePlayGroup($id: String!, $patch: PlayGroupPatch!) {\n updatePlayGroup(id: $id, patch: $patch) {\n id\n name\n description\n createdAt\n updatedAt\n }\n }\n `,\n variables: {\n id,\n patch: { name, description }\n }\n })\n\n return response.data\n}\n\nexport async function deletePlayGroup(id) {\n const response = await client.mutate({\n mutation: gql`\n mutation ($id: String!) {\n deletePlayGroup(id: $id)\n }\n `,\n variables: {\n id\n }\n })\n return response.data\n}\n\nexport async function joinPlayGroup(boardId, group) {\n var { id, name, description } = group\n\n const response = await client.mutate({\n mutation: gql`\n mutation JoinPlayGroup($id: String!, $boardIds: [String!]!) {\n joinPlayGroup(id: $id, boardIds: $boardIds) {\n id\n name\n description\n boards {\n id\n name\n description\n createdAt\n updatedAt\n }\n createdAt\n updatedAt\n }\n }\n `,\n variables: {\n id,\n boardIds: [boardId]\n }\n })\n\n return response.data\n}\n\nexport async function leavePlayGroup(boardId, groupId) {\n const response = await client.mutate({\n mutation: gql`\n mutation ($id: String!, $boardIds: [String]!) {\n leavePlayGroup(id: $id, boardIds: $boardIds) {\n id\n name\n description\n boards {\n id\n name\n description\n createdAt\n updatedAt\n }\n createdAt\n updatedAt\n }\n }\n `,\n variables: {\n id: groupId,\n boardIds: [boardId]\n }\n })\n\n return response.data\n}\n"]}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export * from './board-provider';
|
|
2
|
+
export * from './pages/board-viewer-page';
|
|
3
|
+
export * from './pages/board-player-page';
|
|
4
|
+
export * from './pages/board-modeller-page';
|
|
5
|
+
export * from './setting-let/board-view-setting-let';
|
|
6
|
+
export * from './apptools/favorite-tool';
|
|
7
|
+
export * from './graphql';
|
|
8
|
+
export * from './viewparts';
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export * from './board-provider';
|
|
2
|
+
export * from './pages/board-viewer-page';
|
|
3
|
+
export * from './pages/board-player-page';
|
|
4
|
+
export * from './pages/board-modeller-page';
|
|
5
|
+
export * from './setting-let/board-view-setting-let';
|
|
6
|
+
export * from './apptools/favorite-tool';
|
|
7
|
+
export * from './graphql';
|
|
8
|
+
export * from './viewparts';
|
|
9
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../client/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAA;AAEhC,cAAc,2BAA2B,CAAA;AACzC,cAAc,2BAA2B,CAAA;AACzC,cAAc,6BAA6B,CAAA;AAE3C,cAAc,sCAAsC,CAAA;AACpD,cAAc,0BAA0B,CAAA;AACxC,cAAc,WAAW,CAAA;AACzB,cAAc,aAAa,CAAA","sourcesContent":["export * from './board-provider'\n\nexport * from './pages/board-viewer-page'\nexport * from './pages/board-player-page'\nexport * from './pages/board-modeller-page'\n\nexport * from './setting-let/board-view-setting-let'\nexport * from './apptools/favorite-tool'\nexport * from './graphql'\nexport * from './viewparts'\n"]}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import '@operato/attachment/ox-attachment-list.js';
|
|
2
|
+
import { PageView } from '@operato/shell';
|
|
3
|
+
import { OxAttachmentList } from '@operato/attachment/ox-attachment-list.js';
|
|
4
|
+
declare const AttachmentListPage_base: (new (...args: any[]) => import("lit").LitElement) & typeof PageView;
|
|
5
|
+
export declare class AttachmentListPage extends AttachmentListPage_base {
|
|
6
|
+
static styles: import("lit").CSSResult[];
|
|
7
|
+
attachmentList: OxAttachmentList;
|
|
8
|
+
get context(): {
|
|
9
|
+
title: string;
|
|
10
|
+
search: {
|
|
11
|
+
handler: (search: any) => void;
|
|
12
|
+
value: string;
|
|
13
|
+
};
|
|
14
|
+
board_topmenu: boolean;
|
|
15
|
+
exportable: {
|
|
16
|
+
name: string;
|
|
17
|
+
data: () => Promise<any>;
|
|
18
|
+
};
|
|
19
|
+
importable: {
|
|
20
|
+
handler: (data: any, file: any) => Promise<void>;
|
|
21
|
+
};
|
|
22
|
+
};
|
|
23
|
+
render(): import("lit-html").TemplateResult<1>;
|
|
24
|
+
get grist(): import("@operato/data-grist").DataGrist;
|
|
25
|
+
languageUpdated(i18next: any): void;
|
|
26
|
+
pageInitialized(): Promise<void>;
|
|
27
|
+
exportHandler(): Promise<any>;
|
|
28
|
+
importHandler(data: any, file: any): Promise<void>;
|
|
29
|
+
}
|
|
30
|
+
export {};
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
import { __decorate, __metadata } from "tslib";
|
|
2
|
+
import '@operato/attachment/ox-attachment-list.js';
|
|
3
|
+
import { css, html } from 'lit';
|
|
4
|
+
import { customElement, query } from 'lit/decorators.js';
|
|
5
|
+
import gql from 'graphql-tag';
|
|
6
|
+
import { i18next, localize } from '@operato/i18n';
|
|
7
|
+
import { PageView } from '@operato/shell';
|
|
8
|
+
import { OxAttachmentList } from '@operato/attachment/ox-attachment-list.js';
|
|
9
|
+
import { client } from '@operato/graphql';
|
|
10
|
+
async function fetchDataFromURL(fileURL) {
|
|
11
|
+
try {
|
|
12
|
+
const response = await fetch(fileURL);
|
|
13
|
+
if (!response.ok) {
|
|
14
|
+
throw new Error('Network response was not ok');
|
|
15
|
+
}
|
|
16
|
+
const blob = await response.blob(); // 파일 데이터를 Blob으로 변환
|
|
17
|
+
if (blob.size === 0) {
|
|
18
|
+
throw new Error('Content is empty'); // Content가 비어 있으면 예외
|
|
19
|
+
}
|
|
20
|
+
return new Promise((resolve, reject) => {
|
|
21
|
+
const reader = new FileReader();
|
|
22
|
+
reader.onload = (event) => {
|
|
23
|
+
const dataURL = event.target.result;
|
|
24
|
+
resolve(dataURL);
|
|
25
|
+
};
|
|
26
|
+
reader.onerror = (event) => {
|
|
27
|
+
reject(event.error);
|
|
28
|
+
};
|
|
29
|
+
reader.readAsDataURL(blob); // Blob을 Data URL로 읽기
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
catch (error) {
|
|
33
|
+
throw error;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
let AttachmentListPage = class AttachmentListPage extends localize(i18next)(PageView) {
|
|
37
|
+
get context() {
|
|
38
|
+
var _a;
|
|
39
|
+
return {
|
|
40
|
+
title: i18next.t('title.attachment list'),
|
|
41
|
+
search: {
|
|
42
|
+
handler: search => {
|
|
43
|
+
this.grist.searchText = search;
|
|
44
|
+
},
|
|
45
|
+
value: ((_a = this.grist) === null || _a === void 0 ? void 0 : _a.searchText) || ''
|
|
46
|
+
},
|
|
47
|
+
board_topmenu: true,
|
|
48
|
+
exportable: {
|
|
49
|
+
name: i18next.t('title.attachment list'),
|
|
50
|
+
data: this.exportHandler.bind(this)
|
|
51
|
+
},
|
|
52
|
+
importable: {
|
|
53
|
+
handler: this.importHandler.bind(this)
|
|
54
|
+
}
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
render() {
|
|
58
|
+
return html ` <ox-attachment-list .creatable=${true} without-search></ox-attachment-list> `;
|
|
59
|
+
}
|
|
60
|
+
get grist() {
|
|
61
|
+
return this.attachmentList.grist;
|
|
62
|
+
}
|
|
63
|
+
languageUpdated(i18next) {
|
|
64
|
+
this.attachmentList.requestUpdate();
|
|
65
|
+
}
|
|
66
|
+
async pageInitialized() {
|
|
67
|
+
await this.updateComplete;
|
|
68
|
+
this.attachmentList.refreshAttachments();
|
|
69
|
+
}
|
|
70
|
+
async exportHandler() {
|
|
71
|
+
const records = this.grist.data.records;
|
|
72
|
+
const data = {};
|
|
73
|
+
for (const record of records) {
|
|
74
|
+
const { id, name, mimetype, encoding, category, fullpath } = record;
|
|
75
|
+
try {
|
|
76
|
+
const dataURL = await fetchDataFromURL(fullpath);
|
|
77
|
+
id &&
|
|
78
|
+
(data[id] = {
|
|
79
|
+
id,
|
|
80
|
+
name,
|
|
81
|
+
mimetype,
|
|
82
|
+
encoding,
|
|
83
|
+
category,
|
|
84
|
+
contents: dataURL
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
catch (err) {
|
|
88
|
+
console.log(name, err);
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
return data;
|
|
92
|
+
}
|
|
93
|
+
async importHandler(data, file) {
|
|
94
|
+
await client.mutate({
|
|
95
|
+
mutation: gql `
|
|
96
|
+
mutation importAttachments($file: Upload!) {
|
|
97
|
+
importAttachments(file: $file) {
|
|
98
|
+
id
|
|
99
|
+
name
|
|
100
|
+
description
|
|
101
|
+
path
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
`,
|
|
105
|
+
variables: {
|
|
106
|
+
file
|
|
107
|
+
},
|
|
108
|
+
context: { hasUpload: true }
|
|
109
|
+
});
|
|
110
|
+
this.grist.fetch();
|
|
111
|
+
}
|
|
112
|
+
};
|
|
113
|
+
AttachmentListPage.styles = [
|
|
114
|
+
css `
|
|
115
|
+
:host {
|
|
116
|
+
display: flex;
|
|
117
|
+
}
|
|
118
|
+
`
|
|
119
|
+
];
|
|
120
|
+
__decorate([
|
|
121
|
+
query('ox-attachment-list'),
|
|
122
|
+
__metadata("design:type", OxAttachmentList)
|
|
123
|
+
], AttachmentListPage.prototype, "attachmentList", void 0);
|
|
124
|
+
AttachmentListPage = __decorate([
|
|
125
|
+
customElement('attachment-list-page')
|
|
126
|
+
], AttachmentListPage);
|
|
127
|
+
export { AttachmentListPage };
|
|
128
|
+
//# sourceMappingURL=attachment-list-page.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"attachment-list-page.js","sourceRoot":"","sources":["../../client/pages/attachment-list-page.ts"],"names":[],"mappings":";AAAA,OAAO,2CAA2C,CAAA;AAElD,OAAO,EAAE,GAAG,EA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AG,EAAS,CAAA;QAEtB,KAAK,MAAM,MAAM,IAAI,OAAO,EAAE;YAC5B,MAAM,EAAE,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,QAAQ,EAAE,QAAQ,EAAE,GAAG,MAAM,CAAA;YAEnE,IAAI;gBACF,MAAM,OAAO,GAAG,MAAM,gBAAgB,CAAC,QAAQ,CAAC,CAAA;gBAEhD,EAAE;oBACA,CAAC,IAAI,CAAC,EAAG,CAAC,GAAG;wBACX,EAAE;wBACF,IAAI;wBACJ,QAAQ;wBACR,QAAQ;wBACR,QAAQ;wBACR,QAAQ,EAAE,OAAO;qBAClB,CAAC,CAAA;aACL;YAAC,OAAO,GAAG,EAAE;gBACZ,OAAO,CAAC,GAAG,CAAC,IAAI,EAAE,GAAG,CAAC,CAAA;aACvB;SACF;QAED,OAAO,IAAI,CAAA;IACb,CAAC;IAED,KAAK,CAAC,aAAa,CAAC,IAAI,EAAE,IAAI;QAC5B,MAAM,MAAM,CAAC,MAAM,CAAC;YAClB,QAAQ,EAAE,GAAG,CAAA;;;;;;;;;OASZ;YACD,SAAS,EAAE;gBACT,IAAI;aACL;YACD,OAAO,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE;SAC7B,CAAC,CAAA;QAEF,IAAI,CAAC,KAAK,CAAC,KAAK,EAAE,CAAA;IACpB,CAAC;;AA9FM,yBAAM,GAAG;IACd,GAAG,CAAA;;;;KAIF;CACF,CAAA;AAED;IAAC,KAAK,CAAC,oBAAoB,CAAC;8BAAkB,gBAAgB;0DAAA;AATnD,kBAAkB;IAD9B,aAAa,CAAC,sBAAsB,CAAC;GACzB,kBAAkB,CAgG9B;SAhGY,kBAAkB","sourcesContent":["import '@operato/attachment/ox-attachment-list.js'\n\nimport { css, html } from 'lit'\nimport { customElement, query } from 'lit/decorators.js'\nimport gql from 'graphql-tag'\n\nimport { i18next, localize } from '@operato/i18n'\nimport { PageView } from '@operato/shell'\nimport { OxAttachmentList } from '@operato/attachment/ox-attachment-list.js'\nimport { client } from '@operato/graphql'\n\nasync function fetchDataFromURL(fileURL: string) {\n try {\n const response = await fetch(fileURL)\n\n if (!response.ok) {\n throw new Error('Network response was not ok')\n }\n\n const blob = await response.blob() // 파일 데이터를 Blob으로 변환\n\n if (blob.size === 0) {\n throw new Error('Content is empty') // Content가 비어 있으면 예외\n }\n\n return new Promise((resolve, reject) => {\n const reader = new FileReader()\n\n reader.onload = (event: any) => {\n const dataURL = event.target.result\n resolve(dataURL)\n }\n\n reader.onerror = (event: any) => {\n reject(event.error)\n }\n\n reader.readAsDataURL(blob) // Blob을 Data URL로 읽기\n })\n } catch (error) {\n throw error\n }\n}\n\n@customElement('attachment-list-page')\nexport class AttachmentListPage extends localize(i18next)(PageView) {\n static styles = [\n css`\n :host {\n display: flex;\n }\n `\n ]\n\n @query('ox-attachment-list') attachmentList!: OxAttachmentList\n\n get context() {\n return {\n title: i18next.t('title.attachment list'),\n search: {\n handler: search => {\n this.grist.searchText = search\n },\n value: this.grist?.searchText || ''\n },\n board_topmenu: true,\n exportable: {\n name: i18next.t('title.attachment list'),\n data: this.exportHandler.bind(this)\n },\n importable: {\n handler: this.importHandler.bind(this)\n }\n }\n }\n\n render() {\n return html` <ox-attachment-list .creatable=${true} without-search></ox-attachment-list> `\n }\n\n get grist() {\n return this.attachmentList.grist\n }\n\n languageUpdated(i18next) {\n this.attachmentList.requestUpdate()\n }\n\n async pageInitialized() {\n await this.updateComplete\n\n this.attachmentList.refreshAttachments()\n }\n\n async exportHandler() {\n const records = this.grist.data.records\n const data = {} as any\n\n for (const record of records) {\n const { id, name, mimetype, encoding, category, fullpath } = record\n\n try {\n const dataURL = await fetchDataFromURL(fullpath)\n\n id &&\n (data[id!] = {\n id,\n name,\n mimetype,\n encoding,\n category,\n contents: dataURL\n })\n } catch (err) {\n console.log(name, err)\n }\n }\n\n return data\n }\n\n async importHandler(data, file) {\n await client.mutate({\n mutation: gql`\n mutation importAttachments($file: Upload!) {\n importAttachments(file: $file) {\n id\n name\n description\n path\n }\n }\n `,\n variables: {\n file\n },\n context: { hasUpload: true }\n })\n\n this.grist.fetch()\n }\n}\n"]}
|