@operato/property-panel 9.0.0-beta.14

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.
Files changed (156) hide show
  1. package/.editorconfig +29 -0
  2. package/.storybook/main.js +5 -0
  3. package/.storybook/preview.js +52 -0
  4. package/.storybook/server.mjs +8 -0
  5. package/CHANGELOG.md +11 -0
  6. package/LICENSE +21 -0
  7. package/README.md +76 -0
  8. package/demo/index.html +30 -0
  9. package/dist/src/graphql/board.d.ts +6 -0
  10. package/dist/src/graphql/board.js +130 -0
  11. package/dist/src/graphql/board.js.map +1 -0
  12. package/dist/src/graphql/data-subscription.d.ts +5 -0
  13. package/dist/src/graphql/data-subscription.js +24 -0
  14. package/dist/src/graphql/data-subscription.js.map +1 -0
  15. package/dist/src/graphql/favorite-board.d.ts +1 -0
  16. package/dist/src/graphql/favorite-board.js +23 -0
  17. package/dist/src/graphql/favorite-board.js.map +1 -0
  18. package/dist/src/graphql/group.d.ts +7 -0
  19. package/dist/src/graphql/group.js +125 -0
  20. package/dist/src/graphql/group.js.map +1 -0
  21. package/dist/src/graphql/index.d.ts +4 -0
  22. package/dist/src/graphql/index.js +5 -0
  23. package/dist/src/graphql/index.js.map +1 -0
  24. package/dist/src/graphql/play-group.d.ts +13 -0
  25. package/dist/src/graphql/play-group.js +205 -0
  26. package/dist/src/graphql/play-group.js.map +1 -0
  27. package/dist/src/graphql/scenario.d.ts +6 -0
  28. package/dist/src/graphql/scenario.js +69 -0
  29. package/dist/src/graphql/scenario.js.map +1 -0
  30. package/dist/src/index.d.ts +7 -0
  31. package/dist/src/index.js +8 -0
  32. package/dist/src/index.js.map +1 -0
  33. package/dist/src/ox-property-panel.d.ts +46 -0
  34. package/dist/src/ox-property-panel.js +346 -0
  35. package/dist/src/ox-property-panel.js.map +1 -0
  36. package/dist/src/property-panel/abstract-property.d.ts +10 -0
  37. package/dist/src/property-panel/abstract-property.js +53 -0
  38. package/dist/src/property-panel/abstract-property.js.map +1 -0
  39. package/dist/src/property-panel/data-binding/data-binding-mapper.d.ts +58 -0
  40. package/dist/src/property-panel/data-binding/data-binding-mapper.js +380 -0
  41. package/dist/src/property-panel/data-binding/data-binding-mapper.js.map +1 -0
  42. package/dist/src/property-panel/data-binding/data-binding-value-map.d.ts +6 -0
  43. package/dist/src/property-panel/data-binding/data-binding-value-map.js +20 -0
  44. package/dist/src/property-panel/data-binding/data-binding-value-map.js.map +1 -0
  45. package/dist/src/property-panel/data-binding/data-binding-value-range.d.ts +6 -0
  46. package/dist/src/property-panel/data-binding/data-binding-value-range.js +20 -0
  47. package/dist/src/property-panel/data-binding/data-binding-value-range.js.map +1 -0
  48. package/dist/src/property-panel/data-binding/data-binding.d.ts +44 -0
  49. package/dist/src/property-panel/data-binding/data-binding.js +442 -0
  50. package/dist/src/property-panel/data-binding/data-binding.js.map +1 -0
  51. package/dist/src/property-panel/effects/effects.d.ts +24 -0
  52. package/dist/src/property-panel/effects/effects.js +72 -0
  53. package/dist/src/property-panel/effects/effects.js.map +1 -0
  54. package/dist/src/property-panel/effects/property-animation.d.ts +23 -0
  55. package/dist/src/property-panel/effects/property-animation.js +147 -0
  56. package/dist/src/property-panel/effects/property-animation.js.map +1 -0
  57. package/dist/src/property-panel/effects/property-animations.d.ts +22 -0
  58. package/dist/src/property-panel/effects/property-animations.js +70 -0
  59. package/dist/src/property-panel/effects/property-animations.js.map +1 -0
  60. package/dist/src/property-panel/effects/property-event-hover.d.ts +21 -0
  61. package/dist/src/property-panel/effects/property-event-hover.js +193 -0
  62. package/dist/src/property-panel/effects/property-event-hover.js.map +1 -0
  63. package/dist/src/property-panel/effects/property-event-tap.d.ts +36 -0
  64. package/dist/src/property-panel/effects/property-event-tap.js +262 -0
  65. package/dist/src/property-panel/effects/property-event-tap.js.map +1 -0
  66. package/dist/src/property-panel/effects/property-event.d.ts +22 -0
  67. package/dist/src/property-panel/effects/property-event.js +64 -0
  68. package/dist/src/property-panel/effects/property-event.js.map +1 -0
  69. package/dist/src/property-panel/effects/property-shadow.d.ts +23 -0
  70. package/dist/src/property-panel/effects/property-shadow.js +66 -0
  71. package/dist/src/property-panel/effects/property-shadow.js.map +1 -0
  72. package/dist/src/property-panel/effects/value-converter.d.ts +1 -0
  73. package/dist/src/property-panel/effects/value-converter.js +17 -0
  74. package/dist/src/property-panel/effects/value-converter.js.map +1 -0
  75. package/dist/src/property-panel/inspector/inspector.d.ts +27 -0
  76. package/dist/src/property-panel/inspector/inspector.js +357 -0
  77. package/dist/src/property-panel/inspector/inspector.js.map +1 -0
  78. package/dist/src/property-panel/shapes/shapes.d.ts +26 -0
  79. package/dist/src/property-panel/shapes/shapes.js +312 -0
  80. package/dist/src/property-panel/shapes/shapes.js.map +1 -0
  81. package/dist/src/property-panel/specifics/specific-properties-builder.d.ts +16 -0
  82. package/dist/src/property-panel/specifics/specific-properties-builder.js +138 -0
  83. package/dist/src/property-panel/specifics/specific-properties-builder.js.map +1 -0
  84. package/dist/src/property-panel/specifics/specifics.d.ts +25 -0
  85. package/dist/src/property-panel/specifics/specifics.js +84 -0
  86. package/dist/src/property-panel/specifics/specifics.js.map +1 -0
  87. package/dist/src/property-panel/styles/styles.d.ts +23 -0
  88. package/dist/src/property-panel/styles/styles.js +269 -0
  89. package/dist/src/property-panel/styles/styles.js.map +1 -0
  90. package/dist/src/types.d.ts +43 -0
  91. package/dist/src/types.js +2 -0
  92. package/dist/src/types.js.map +1 -0
  93. package/dist/stories/index.stories.d.ts +22 -0
  94. package/dist/stories/index.stories.js +121 -0
  95. package/dist/stories/index.stories.js.map +1 -0
  96. package/dist/stories/input-table-property.stories.d.ts +21 -0
  97. package/dist/stories/input-table-property.stories.js +84 -0
  98. package/dist/stories/input-table-property.stories.js.map +1 -0
  99. package/dist/test/ox-property-panel.test.d.ts +1 -0
  100. package/dist/test/ox-property-panel.test.js +24 -0
  101. package/dist/test/ox-property-panel.test.js.map +1 -0
  102. package/dist/tsconfig.tsbuildinfo +1 -0
  103. package/package.json +108 -0
  104. package/src/graphql/board.ts +144 -0
  105. package/src/graphql/data-subscription.ts +30 -0
  106. package/src/graphql/favorite-board.ts +25 -0
  107. package/src/graphql/group.ts +138 -0
  108. package/src/graphql/index.ts +4 -0
  109. package/src/graphql/play-group.ts +225 -0
  110. package/src/graphql/scenario.ts +79 -0
  111. package/src/index.ts +8 -0
  112. package/src/ox-property-panel.ts +347 -0
  113. package/src/property-panel/abstract-property.ts +67 -0
  114. package/src/property-panel/data-binding/data-binding-mapper.ts +412 -0
  115. package/src/property-panel/data-binding/data-binding-value-map.ts +19 -0
  116. package/src/property-panel/data-binding/data-binding-value-range.ts +19 -0
  117. package/src/property-panel/data-binding/data-binding.ts +464 -0
  118. package/src/property-panel/effects/effects.ts +77 -0
  119. package/src/property-panel/effects/property-animation.ts +155 -0
  120. package/src/property-panel/effects/property-animations.ts +74 -0
  121. package/src/property-panel/effects/property-event-hover.ts +212 -0
  122. package/src/property-panel/effects/property-event-tap.ts +269 -0
  123. package/src/property-panel/effects/property-event.ts +73 -0
  124. package/src/property-panel/effects/property-shadow.ts +77 -0
  125. package/src/property-panel/effects/value-converter.ts +17 -0
  126. package/src/property-panel/inspector/inspector.ts +407 -0
  127. package/src/property-panel/shapes/shapes.ts +321 -0
  128. package/src/property-panel/specifics/specific-properties-builder.ts +152 -0
  129. package/src/property-panel/specifics/specifics.ts +81 -0
  130. package/src/property-panel/styles/styles.ts +287 -0
  131. package/src/types.ts +63 -0
  132. package/stories/index.stories.ts +134 -0
  133. package/stories/input-table-property.stories.ts +96 -0
  134. package/test/ox-property-panel.test.ts +32 -0
  135. package/themes/app-theme.css +138 -0
  136. package/themes/calendar-theme.css +61 -0
  137. package/themes/dark.css +51 -0
  138. package/themes/grist-theme.css +175 -0
  139. package/themes/help-theme.css +57 -0
  140. package/themes/layout-theme.css +94 -0
  141. package/themes/light.css +51 -0
  142. package/themes/material-theme.css +23 -0
  143. package/themes/md-typescale-styles.css +100 -0
  144. package/themes/oops-theme.css +22 -0
  145. package/themes/report-theme.css +47 -0
  146. package/themes/spacing.css +23 -0
  147. package/themes/state-color.css +6 -0
  148. package/themes/tooltip-theme.css +11 -0
  149. package/translations/en.json +723 -0
  150. package/translations/ja.json +727 -0
  151. package/translations/ko.json +727 -0
  152. package/translations/ms.json +609 -0
  153. package/translations/zh.json +726 -0
  154. package/tsconfig.json +25 -0
  155. package/web-dev-server.config.mjs +27 -0
  156. package/web-test-runner.config.mjs +41 -0
@@ -0,0 +1,144 @@
1
+ import { buildArgs, client } from '@operato/graphql'
2
+
3
+ import { Board } from '../types.js'
4
+ import gql from 'graphql-tag'
5
+
6
+ export async function fetchBoardList(listParam = {}) {
7
+ const response = await client.query({
8
+ query: gql`
9
+ {
10
+ boards(${buildArgs(listParam)}) {
11
+ items {
12
+ id
13
+ name
14
+ description
15
+ thumbnail
16
+ createdAt
17
+ updatedAt
18
+ }
19
+ total
20
+ }
21
+ }
22
+ `
23
+ })
24
+
25
+ return response.data
26
+ }
27
+
28
+ export async function fetchBoard(id: string) {
29
+ const response = await client.query({
30
+ query: gql`
31
+ query FetchBoardById($id: String!) {
32
+ board(id: $id) {
33
+ id
34
+ name
35
+ description
36
+ group {
37
+ id
38
+ name
39
+ }
40
+ thumbnail
41
+ model
42
+ createdAt
43
+ creator {
44
+ id
45
+ name
46
+ }
47
+ updatedAt
48
+ updater {
49
+ id
50
+ name
51
+ }
52
+ }
53
+ }
54
+ `,
55
+ variables: { id }
56
+ })
57
+
58
+ return response.data
59
+ }
60
+
61
+ export async function createBoard(board: Board) {
62
+ /*
63
+ input NewBoard {
64
+ name : String!
65
+ description : String
66
+ model : String!
67
+ groupId : String!
68
+ }
69
+ */
70
+
71
+ board.model = JSON.stringify(board.model)
72
+
73
+ const response = await client.mutate({
74
+ mutation: gql`
75
+ mutation CreateBoard($board: NewBoard!) {
76
+ createBoard(board: $board) {
77
+ id
78
+ name
79
+ description
80
+ model
81
+ createdAt
82
+ updatedAt
83
+ }
84
+ }
85
+ `,
86
+ variables: {
87
+ board
88
+ }
89
+ })
90
+
91
+ return response.data
92
+ }
93
+
94
+ export async function updateBoard(board: Board) {
95
+ /*
96
+ input BoardPatch {
97
+ name : String
98
+ description : String
99
+ model : String
100
+ }
101
+ */
102
+ var { id, name, description, model, groupId } = board
103
+ model = JSON.stringify(model)
104
+
105
+ const response = await client.mutate({
106
+ mutation: gql`
107
+ mutation UpdateBoard($id: String!, $patch: BoardPatch!) {
108
+ updateBoard(id: $id, patch: $patch) {
109
+ id
110
+ name
111
+ description
112
+ model
113
+ group {
114
+ id
115
+ name
116
+ }
117
+ createdAt
118
+ updatedAt
119
+ }
120
+ }
121
+ `,
122
+ variables: {
123
+ id,
124
+ patch: { name, description, model, groupId }
125
+ }
126
+ })
127
+
128
+ return response.data
129
+ }
130
+
131
+ export async function deleteBoard(id: string) {
132
+ const response = await client.mutate({
133
+ mutation: gql`
134
+ mutation ($id: String!) {
135
+ deleteBoard(id: $id)
136
+ }
137
+ `,
138
+ variables: {
139
+ id
140
+ }
141
+ })
142
+
143
+ return response.data
144
+ }
@@ -0,0 +1,30 @@
1
+ import { Component, DataSubscriptionProvider } from '@hatiolab/things-scene'
2
+
3
+ import gql from 'graphql-tag'
4
+ import { subscribe } from '@operato/graphql'
5
+
6
+ export class DataSubscriptionProviderImpl implements DataSubscriptionProvider {
7
+ async subscribe(tag: string, component: Component) {
8
+ return await subscribe(
9
+ {
10
+ query: gql`
11
+ subscription {
12
+ data(tag: "${tag}") {
13
+ tag
14
+ data
15
+ }
16
+ }
17
+ `
18
+ },
19
+ {
20
+ next: async ({ data }: { data: any }) => {
21
+ if (data) {
22
+ component.data = data.data.data
23
+ }
24
+ }
25
+ }
26
+ )
27
+ }
28
+
29
+ dispose() {}
30
+ }
@@ -0,0 +1,25 @@
1
+ import { buildArgs, client } from '@operato/graphql'
2
+
3
+ import gql from 'graphql-tag'
4
+
5
+ export async function fetchFavoriteBoardList(listParam = {}) {
6
+ const response = await client.query({
7
+ query: gql`
8
+ {
9
+ favoriteBoards(${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 { BoardGroup } from '../types.js'
2
+ import { client } from '@operato/graphql'
3
+ import gql from 'graphql-tag'
4
+
5
+ export async function fetchGroup(id: string) {
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: BoardGroup) {
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: string) {
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: BoardGroup) {
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: string, groupId: string) {
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,4 @@
1
+ export * from './board.js'
2
+ export * from './group.js'
3
+ export * from './play-group.js'
4
+ export * from './favorite-board.js'
@@ -0,0 +1,225 @@
1
+ import { PlayGroup } from '../types.js'
2
+ import { client } from '@operato/graphql'
3
+ import gql from 'graphql-tag'
4
+
5
+ export async function playlists(): Promise<{ name: string; description: string }[]> {
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.playGroups.items
22
+ }
23
+
24
+ export async function fetchPlayGroupList() {
25
+ const response = await client.query({
26
+ query: gql`
27
+ {
28
+ playGroups {
29
+ items {
30
+ id
31
+ name
32
+ description
33
+ }
34
+ total
35
+ }
36
+ }
37
+ `
38
+ })
39
+
40
+ return response.data
41
+ }
42
+
43
+ export async function fetchPlayGroup(groupId: string) {
44
+ const response = await client.query({
45
+ query: gql`
46
+ query FetchPlayGroup($id: String!) {
47
+ playGroup(id: $id) {
48
+ id
49
+ name
50
+ description
51
+ boards {
52
+ id
53
+ name
54
+ description
55
+ model
56
+ thumbnail
57
+ createdAt
58
+ creator {
59
+ id
60
+ name
61
+ }
62
+ updatedAt
63
+ updater {
64
+ id
65
+ name
66
+ }
67
+ }
68
+ createdAt
69
+ creator {
70
+ id
71
+ name
72
+ }
73
+ updatedAt
74
+ updater {
75
+ id
76
+ name
77
+ }
78
+ }
79
+ }
80
+ `,
81
+ variables: {
82
+ id: groupId
83
+ }
84
+ })
85
+
86
+ return response.data
87
+ }
88
+
89
+ export async function fetchPlayGroupByName(name: string) {
90
+ const response = await client.query({
91
+ query: gql`
92
+ query FetchPlayGroupByName($name: String!) {
93
+ playGroupByName(name: $name) {
94
+ id
95
+ }
96
+ }
97
+ `,
98
+ variables: {
99
+ name
100
+ }
101
+ })
102
+
103
+ return response.data.playGroupByName
104
+ }
105
+
106
+ export async function createPlayGroup(group: PlayGroup) {
107
+ var { name, description } = group
108
+
109
+ const response = await client.mutate({
110
+ mutation: gql`
111
+ mutation CreatePlayGroup($playGroup: NewPlayGroup!) {
112
+ createPlayGroup(playGroup: $playGroup) {
113
+ id
114
+ name
115
+ description
116
+ createdAt
117
+ updatedAt
118
+ }
119
+ }
120
+ `,
121
+ variables: {
122
+ playGroup: { name, description }
123
+ }
124
+ })
125
+
126
+ return response.data
127
+ }
128
+
129
+ export async function updatePlayGroup(group: PlayGroup) {
130
+ var { id, name, description } = group
131
+
132
+ const response = await client.mutate({
133
+ mutation: gql`
134
+ mutation UpdatePlayGroup($id: String!, $patch: PlayGroupPatch!) {
135
+ updatePlayGroup(id: $id, patch: $patch) {
136
+ id
137
+ name
138
+ description
139
+ createdAt
140
+ updatedAt
141
+ }
142
+ }
143
+ `,
144
+ variables: {
145
+ id,
146
+ patch: { name, description }
147
+ }
148
+ })
149
+
150
+ return response.data
151
+ }
152
+
153
+ export async function deletePlayGroup(id: string) {
154
+ const response = await client.mutate({
155
+ mutation: gql`
156
+ mutation ($id: String!) {
157
+ deletePlayGroup(id: $id)
158
+ }
159
+ `,
160
+ variables: {
161
+ id
162
+ }
163
+ })
164
+ return response.data
165
+ }
166
+
167
+ export async function joinPlayGroup(boardId: string, group: PlayGroup) {
168
+ var { id, name, description } = group
169
+
170
+ const response = await client.mutate({
171
+ mutation: gql`
172
+ mutation JoinPlayGroup($id: String!, $boardIds: [String!]!) {
173
+ joinPlayGroup(id: $id, boardIds: $boardIds) {
174
+ id
175
+ name
176
+ description
177
+ boards {
178
+ id
179
+ name
180
+ description
181
+ createdAt
182
+ updatedAt
183
+ }
184
+ createdAt
185
+ updatedAt
186
+ }
187
+ }
188
+ `,
189
+ variables: {
190
+ id,
191
+ boardIds: [boardId]
192
+ }
193
+ })
194
+
195
+ return response.data
196
+ }
197
+
198
+ export async function leavePlayGroup(boardId: string, groupId: string) {
199
+ const response = await client.mutate({
200
+ mutation: gql`
201
+ mutation ($id: String!, $boardIds: [String]!) {
202
+ leavePlayGroup(id: $id, boardIds: $boardIds) {
203
+ id
204
+ name
205
+ description
206
+ boards {
207
+ id
208
+ name
209
+ description
210
+ createdAt
211
+ updatedAt
212
+ }
213
+ createdAt
214
+ updatedAt
215
+ }
216
+ }
217
+ `,
218
+ variables: {
219
+ id: groupId,
220
+ boardIds: [boardId]
221
+ }
222
+ })
223
+
224
+ return response.data
225
+ }
@@ -0,0 +1,79 @@
1
+ import gql from 'graphql-tag'
2
+
3
+ import { client } from '@operato/graphql'
4
+
5
+ export const scenarios = async (): Promise<{ name: string; description: string }[]> => {
6
+ var response = await client.query({
7
+ query: gql`
8
+ query {
9
+ scenarios {
10
+ items {
11
+ name
12
+ description
13
+ }
14
+ }
15
+ }
16
+ `
17
+ })
18
+
19
+ if (response.errors) {
20
+ return []
21
+ }
22
+
23
+ return response.data.scenarios.items
24
+ }
25
+
26
+ export const startScenario = async (
27
+ scenarioName: string,
28
+ instanceName: string,
29
+ variables: string | number | object
30
+ ) => {
31
+ if (!scenarioName) {
32
+ return
33
+ }
34
+
35
+ if (client) {
36
+ var response = await client.query({
37
+ query: gql`
38
+ mutation ($instanceName: String, $scenarioName: String!, $variables: Object) {
39
+ startScenario(instanceName: $instanceName, scenarioName: $scenarioName, variables: $variables) {
40
+ state
41
+ message
42
+ data
43
+ }
44
+ }
45
+ `,
46
+ variables: {
47
+ instanceName: instanceName,
48
+ scenarioName: scenarioName,
49
+ variables
50
+ }
51
+ })
52
+
53
+ return response?.data?.startScenario?.data
54
+ }
55
+ }
56
+
57
+ export const runScenario = async (scenarioName: string, variables: string | number | object) => {
58
+ if (!scenarioName) return
59
+
60
+ if (client) {
61
+ var response = await client.query({
62
+ query: gql`
63
+ mutation ($scenarioName: String!, $variables: Object) {
64
+ runScenario(scenarioName: $scenarioName, variables: $variables) {
65
+ state
66
+ message
67
+ data
68
+ }
69
+ }
70
+ `,
71
+ variables: {
72
+ scenarioName: scenarioName,
73
+ variables
74
+ }
75
+ })
76
+
77
+ return response?.data?.runScenario?.data
78
+ }
79
+ }
package/src/index.ts ADDED
@@ -0,0 +1,8 @@
1
+ export { OxPropertyPanel } from './ox-property-panel.js'
2
+
3
+ export * from './property-panel/data-binding/data-binding.js'
4
+ export * from './property-panel/effects/effects.js'
5
+ export * from './property-panel/inspector/inspector.js'
6
+ export * from './property-panel/shapes/shapes.js'
7
+ export * from './property-panel/specifics/specifics.js'
8
+ export * from './property-panel/styles/styles.js'