@messenger-box/platform-mobile 10.0.3-alpha.16 → 10.0.3-alpha.18
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/CHANGELOG.md +8 -0
- package/lib/routes.json +14 -1
- package/lib/screens/inbox/components/CachedImage/consts.js +1 -1
- package/lib/screens/inbox/components/CachedImage/consts.js.map +1 -1
- package/lib/screens/inbox/components/CachedImage/index.js +125 -16
- package/lib/screens/inbox/components/CachedImage/index.js.map +1 -1
- package/lib/screens/inbox/components/SlackMessageContainer/SlackBubble.js +32 -21
- package/lib/screens/inbox/components/SlackMessageContainer/SlackBubble.js.map +1 -1
- package/lib/screens/inbox/containers/ConversationView.js +1175 -400
- package/lib/screens/inbox/containers/ConversationView.js.map +1 -1
- package/lib/screens/inbox/containers/Dialogs.js +290 -21
- package/lib/screens/inbox/containers/Dialogs.js.map +1 -1
- package/lib/screens/inbox/containers/ThreadConversationView.js +858 -351
- package/lib/screens/inbox/containers/ThreadConversationView.js.map +1 -1
- package/lib/screens/inbox/containers/workflow/conversation-xstate.js +380 -0
- package/lib/screens/inbox/containers/workflow/conversation-xstate.js.map +1 -0
- package/lib/screens/inbox/containers/workflow/dialogs-xstate.js +235 -0
- package/lib/screens/inbox/containers/workflow/dialogs-xstate.js.map +1 -0
- package/lib/screens/inbox/containers/workflow/thread-conversation-xstate.js +438 -0
- package/lib/screens/inbox/containers/workflow/thread-conversation-xstate.js.map +1 -0
- package/package.json +4 -4
- package/src/screens/inbox/components/CachedImage/consts.ts +4 -3
- package/src/screens/inbox/components/CachedImage/index.tsx +137 -17
- package/src/screens/inbox/components/SlackMessageContainer/SlackBubble.tsx +35 -9
- package/src/screens/inbox/containers/ConversationView.tsx +1510 -641
- package/src/screens/inbox/containers/Dialogs.tsx +415 -123
- package/src/screens/inbox/containers/ThreadConversationView.tsx +1053 -288
- package/src/screens/inbox/containers/workflow/apollo/handleResult.ts +20 -0
- package/src/screens/inbox/containers/workflow/conversation-xstate.ts +313 -0
- package/src/screens/inbox/containers/workflow/dialogs-xstate.ts +196 -0
- package/src/screens/inbox/containers/workflow/thread-conversation-xstate.ts +401 -0
|
@@ -0,0 +1,380 @@
|
|
|
1
|
+
import {setup,assign}from'xstate';import {merge}from'lodash-es';var __defProp = Object.defineProperty;
|
|
2
|
+
var __defProps = Object.defineProperties;
|
|
3
|
+
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
4
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
7
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
8
|
+
var __spreadValues = (a, b) => {
|
|
9
|
+
for (var prop in b || (b = {}))
|
|
10
|
+
if (__hasOwnProp.call(b, prop))
|
|
11
|
+
__defNormalProp(a, prop, b[prop]);
|
|
12
|
+
if (__getOwnPropSymbols)
|
|
13
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
14
|
+
if (__propIsEnum.call(b, prop))
|
|
15
|
+
__defNormalProp(a, prop, b[prop]);
|
|
16
|
+
}
|
|
17
|
+
return a;
|
|
18
|
+
};
|
|
19
|
+
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
20
|
+
var Actions = /* @__PURE__ */ ((Actions2) => {
|
|
21
|
+
Actions2["INITIAL_CONTEXT"] = "INITIAL_CONTEXT";
|
|
22
|
+
Actions2["ERROR_HANDLED"] = "ERROR_HANDLED";
|
|
23
|
+
Actions2["SEND_MESSAGE"] = "SEND_MESSAGE";
|
|
24
|
+
Actions2["SEND_MESSAGE_WITH_FILE"] = "SEND_MESSAGE_WITH_FILE";
|
|
25
|
+
Actions2["SET_CHANNEL_MESSAGES"] = "SET_CHANNEL_MESSAGES";
|
|
26
|
+
Actions2["CLEAR_MESSAGES"] = "CLEAR_MESSAGES";
|
|
27
|
+
Actions2["FETCH_MORE_MESSAGES"] = "FETCH_MORE_MESSAGES";
|
|
28
|
+
Actions2["SUBSCRIBE_TO_MESSAGES"] = "SUBSCRIBE_TO_MESSAGES";
|
|
29
|
+
Actions2["CREATE_DIRECT_CHANNEL"] = "CREATE_DIRECT_CHANNEL";
|
|
30
|
+
Actions2["START_LOADING"] = "START_LOADING";
|
|
31
|
+
Actions2["STOP_LOADING"] = "STOP_LOADING";
|
|
32
|
+
Actions2["SET_IMAGE"] = "SET_IMAGE";
|
|
33
|
+
Actions2["CLEAR_IMAGE"] = "CLEAR_IMAGE";
|
|
34
|
+
Actions2["SET_MESSAGE_TEXT"] = "SET_MESSAGE_TEXT";
|
|
35
|
+
return Actions2;
|
|
36
|
+
})(Actions || {});
|
|
37
|
+
var BaseState = /* @__PURE__ */ ((BaseState2) => {
|
|
38
|
+
BaseState2["Idle"] = "idle";
|
|
39
|
+
BaseState2["Error"] = "error";
|
|
40
|
+
BaseState2["Loading"] = "loading";
|
|
41
|
+
BaseState2["Done"] = "done";
|
|
42
|
+
BaseState2["FetchChannels"] = "fetchChannels";
|
|
43
|
+
BaseState2["FetchMessages"] = "fetchMessages";
|
|
44
|
+
return BaseState2;
|
|
45
|
+
})(BaseState || {});
|
|
46
|
+
var MainState = /* @__PURE__ */ ((MainState2) => {
|
|
47
|
+
MainState2["SendMessage"] = "sendMessage";
|
|
48
|
+
MainState2["SendMessageWithFile"] = "sendMessageWithFile";
|
|
49
|
+
MainState2["FetchMoreMessages"] = "fetchMoreMessages";
|
|
50
|
+
MainState2["CreateDirectChannel"] = "createDirectChannel";
|
|
51
|
+
return MainState2;
|
|
52
|
+
})(MainState || {});
|
|
53
|
+
setup({
|
|
54
|
+
types: {
|
|
55
|
+
context: {}
|
|
56
|
+
},
|
|
57
|
+
actions: {
|
|
58
|
+
errorState: assign(({
|
|
59
|
+
context,
|
|
60
|
+
event
|
|
61
|
+
}) => {
|
|
62
|
+
var _a;
|
|
63
|
+
return __spreadProps(__spreadValues({}, context), {
|
|
64
|
+
error: ((_a = event.data) == null ? void 0 : _a.message) || "An error occurred",
|
|
65
|
+
loading: false,
|
|
66
|
+
loadingOldMessages: false,
|
|
67
|
+
imageLoading: false
|
|
68
|
+
});
|
|
69
|
+
}),
|
|
70
|
+
setInitialContext: assign(({
|
|
71
|
+
context,
|
|
72
|
+
event
|
|
73
|
+
}) => {
|
|
74
|
+
var _a;
|
|
75
|
+
return merge(__spreadProps(__spreadValues({}, context), {
|
|
76
|
+
channelId: ((_a = event.data) == null ? void 0 : _a.channelId) || null,
|
|
77
|
+
loading: false
|
|
78
|
+
}));
|
|
79
|
+
}),
|
|
80
|
+
setChannelMessages: assign(({
|
|
81
|
+
context,
|
|
82
|
+
event
|
|
83
|
+
}) => {
|
|
84
|
+
var _a, _b;
|
|
85
|
+
return __spreadProps(__spreadValues({}, context), {
|
|
86
|
+
channelMessages: ((_a = event.data) == null ? void 0 : _a.messages) || [],
|
|
87
|
+
totalCount: ((_b = event.data) == null ? void 0 : _b.totalCount) || 0,
|
|
88
|
+
loading: false
|
|
89
|
+
});
|
|
90
|
+
}),
|
|
91
|
+
addChannelMessages: assign(({
|
|
92
|
+
context,
|
|
93
|
+
event
|
|
94
|
+
}) => {
|
|
95
|
+
var _a;
|
|
96
|
+
const messages = ((_a = event.data) == null ? void 0 : _a.messages) || [];
|
|
97
|
+
return __spreadProps(__spreadValues({}, context), {
|
|
98
|
+
channelMessages: [...context.channelMessages, ...messages],
|
|
99
|
+
loadingOldMessages: false
|
|
100
|
+
});
|
|
101
|
+
}),
|
|
102
|
+
addNewMessage: assign(({
|
|
103
|
+
context,
|
|
104
|
+
event
|
|
105
|
+
}) => {
|
|
106
|
+
var _a;
|
|
107
|
+
const message = (_a = event.data) == null ? void 0 : _a.message;
|
|
108
|
+
if (!message)
|
|
109
|
+
return context;
|
|
110
|
+
return __spreadProps(__spreadValues({}, context), {
|
|
111
|
+
channelMessages: [...context.channelMessages, message],
|
|
112
|
+
totalCount: context.totalCount + 1,
|
|
113
|
+
loading: false
|
|
114
|
+
});
|
|
115
|
+
}),
|
|
116
|
+
updateSkip: assign(({
|
|
117
|
+
context,
|
|
118
|
+
event
|
|
119
|
+
}) => {
|
|
120
|
+
return __spreadProps(__spreadValues({}, context), {
|
|
121
|
+
skip: context.channelMessages.length,
|
|
122
|
+
loadingOldMessages: true
|
|
123
|
+
});
|
|
124
|
+
}),
|
|
125
|
+
clearMessages: assign(({
|
|
126
|
+
context
|
|
127
|
+
}) => {
|
|
128
|
+
return __spreadProps(__spreadValues({}, context), {
|
|
129
|
+
channelMessages: [],
|
|
130
|
+
totalCount: 0,
|
|
131
|
+
skip: 0
|
|
132
|
+
});
|
|
133
|
+
}),
|
|
134
|
+
setChannelId: assign(({
|
|
135
|
+
context,
|
|
136
|
+
event
|
|
137
|
+
}) => {
|
|
138
|
+
var _a;
|
|
139
|
+
return __spreadProps(__spreadValues({}, context), {
|
|
140
|
+
channelId: ((_a = event.data) == null ? void 0 : _a.channelId) || null
|
|
141
|
+
});
|
|
142
|
+
}),
|
|
143
|
+
startLoading: assign(({
|
|
144
|
+
context
|
|
145
|
+
}) => {
|
|
146
|
+
return __spreadProps(__spreadValues({}, context), {
|
|
147
|
+
loading: true
|
|
148
|
+
});
|
|
149
|
+
}),
|
|
150
|
+
stopLoading: assign(({
|
|
151
|
+
context
|
|
152
|
+
}) => {
|
|
153
|
+
return __spreadProps(__spreadValues({}, context), {
|
|
154
|
+
loading: false
|
|
155
|
+
});
|
|
156
|
+
}),
|
|
157
|
+
startImageLoading: assign(({
|
|
158
|
+
context
|
|
159
|
+
}) => {
|
|
160
|
+
return __spreadProps(__spreadValues({}, context), {
|
|
161
|
+
imageLoading: true
|
|
162
|
+
});
|
|
163
|
+
}),
|
|
164
|
+
stopImageLoading: assign(({
|
|
165
|
+
context
|
|
166
|
+
}) => {
|
|
167
|
+
return __spreadProps(__spreadValues({}, context), {
|
|
168
|
+
imageLoading: false
|
|
169
|
+
});
|
|
170
|
+
}),
|
|
171
|
+
setSelectedImage: assign(({
|
|
172
|
+
context,
|
|
173
|
+
event
|
|
174
|
+
}) => {
|
|
175
|
+
var _a, _b, _c;
|
|
176
|
+
return __spreadProps(__spreadValues({}, context), {
|
|
177
|
+
selectedImage: ((_a = event.data) == null ? void 0 : _a.image) || "",
|
|
178
|
+
files: ((_b = event.data) == null ? void 0 : _b.files) || context.files,
|
|
179
|
+
images: ((_c = event.data) == null ? void 0 : _c.images) || context.images,
|
|
180
|
+
imageLoading: false
|
|
181
|
+
});
|
|
182
|
+
}),
|
|
183
|
+
clearImageData: assign(({
|
|
184
|
+
context
|
|
185
|
+
}) => {
|
|
186
|
+
return __spreadProps(__spreadValues({}, context), {
|
|
187
|
+
selectedImage: "",
|
|
188
|
+
files: [],
|
|
189
|
+
images: []
|
|
190
|
+
});
|
|
191
|
+
}),
|
|
192
|
+
setMessageText: assign(({
|
|
193
|
+
context,
|
|
194
|
+
event
|
|
195
|
+
}) => {
|
|
196
|
+
var _a;
|
|
197
|
+
return __spreadProps(__spreadValues({}, context), {
|
|
198
|
+
messageText: ((_a = event.data) == null ? void 0 : _a.messageText) || ""
|
|
199
|
+
});
|
|
200
|
+
})
|
|
201
|
+
},
|
|
202
|
+
guards: {
|
|
203
|
+
hasMoreMessages: ({
|
|
204
|
+
context
|
|
205
|
+
}) => {
|
|
206
|
+
return context.totalCount > context.channelMessages.length;
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
}).createMachine({
|
|
210
|
+
id: "conversation-view",
|
|
211
|
+
initial: "idle" /* Idle */,
|
|
212
|
+
context: {
|
|
213
|
+
channelId: null,
|
|
214
|
+
channelMessages: [],
|
|
215
|
+
totalCount: 0,
|
|
216
|
+
skip: 0,
|
|
217
|
+
loading: false,
|
|
218
|
+
loadingOldMessages: false,
|
|
219
|
+
error: null,
|
|
220
|
+
selectedImage: "",
|
|
221
|
+
files: [],
|
|
222
|
+
images: [],
|
|
223
|
+
messageText: "",
|
|
224
|
+
imageLoading: false
|
|
225
|
+
},
|
|
226
|
+
states: {
|
|
227
|
+
["idle" /* Idle */]: {
|
|
228
|
+
on: {
|
|
229
|
+
["INITIAL_CONTEXT" /* INITIAL_CONTEXT */]: {
|
|
230
|
+
target: "fetchMessages" /* FetchMessages */,
|
|
231
|
+
actions: ["setInitialContext"]
|
|
232
|
+
},
|
|
233
|
+
["SEND_MESSAGE" /* SEND_MESSAGE */]: {
|
|
234
|
+
target: "sendMessage" /* SendMessage */,
|
|
235
|
+
actions: ["startLoading"]
|
|
236
|
+
},
|
|
237
|
+
["SEND_MESSAGE_WITH_FILE" /* SEND_MESSAGE_WITH_FILE */]: {
|
|
238
|
+
target: "sendMessageWithFile" /* SendMessageWithFile */,
|
|
239
|
+
actions: ["startLoading"]
|
|
240
|
+
},
|
|
241
|
+
["FETCH_MORE_MESSAGES" /* FETCH_MORE_MESSAGES */]: {
|
|
242
|
+
target: "fetchMoreMessages" /* FetchMoreMessages */,
|
|
243
|
+
actions: ["updateSkip"],
|
|
244
|
+
guard: "hasMoreMessages"
|
|
245
|
+
},
|
|
246
|
+
["CLEAR_MESSAGES" /* CLEAR_MESSAGES */]: {
|
|
247
|
+
target: "idle" /* Idle */,
|
|
248
|
+
actions: ["clearMessages"]
|
|
249
|
+
},
|
|
250
|
+
["CREATE_DIRECT_CHANNEL" /* CREATE_DIRECT_CHANNEL */]: {
|
|
251
|
+
target: "createDirectChannel" /* CreateDirectChannel */,
|
|
252
|
+
actions: ["startLoading"]
|
|
253
|
+
},
|
|
254
|
+
["START_LOADING" /* START_LOADING */]: {
|
|
255
|
+
target: "idle" /* Idle */,
|
|
256
|
+
actions: ["startLoading"]
|
|
257
|
+
},
|
|
258
|
+
["STOP_LOADING" /* STOP_LOADING */]: {
|
|
259
|
+
target: "idle" /* Idle */,
|
|
260
|
+
actions: ["stopLoading"]
|
|
261
|
+
},
|
|
262
|
+
["SET_IMAGE" /* SET_IMAGE */]: {
|
|
263
|
+
target: "idle" /* Idle */,
|
|
264
|
+
actions: ["setSelectedImage"]
|
|
265
|
+
},
|
|
266
|
+
["CLEAR_IMAGE" /* CLEAR_IMAGE */]: {
|
|
267
|
+
target: "idle" /* Idle */,
|
|
268
|
+
actions: ["clearImageData"]
|
|
269
|
+
},
|
|
270
|
+
["SET_MESSAGE_TEXT" /* SET_MESSAGE_TEXT */]: {
|
|
271
|
+
target: "idle" /* Idle */,
|
|
272
|
+
actions: ["setMessageText"]
|
|
273
|
+
}
|
|
274
|
+
}
|
|
275
|
+
},
|
|
276
|
+
["error" /* Error */]: {
|
|
277
|
+
entry: ["errorState"],
|
|
278
|
+
on: {
|
|
279
|
+
["ERROR_HANDLED" /* ERROR_HANDLED */]: {
|
|
280
|
+
target: "idle" /* Idle */
|
|
281
|
+
}
|
|
282
|
+
}
|
|
283
|
+
},
|
|
284
|
+
["fetchMessages" /* FetchMessages */]: {
|
|
285
|
+
invoke: {
|
|
286
|
+
src: "fetchMessages",
|
|
287
|
+
input: ({
|
|
288
|
+
context,
|
|
289
|
+
event
|
|
290
|
+
}) => ({
|
|
291
|
+
context,
|
|
292
|
+
event
|
|
293
|
+
}),
|
|
294
|
+
onDone: {
|
|
295
|
+
target: "idle" /* Idle */,
|
|
296
|
+
actions: ["setChannelMessages"]
|
|
297
|
+
},
|
|
298
|
+
onError: {
|
|
299
|
+
target: "error" /* Error */
|
|
300
|
+
}
|
|
301
|
+
}
|
|
302
|
+
},
|
|
303
|
+
["sendMessage" /* SendMessage */]: {
|
|
304
|
+
invoke: {
|
|
305
|
+
src: "sendMessage",
|
|
306
|
+
input: ({
|
|
307
|
+
context,
|
|
308
|
+
event
|
|
309
|
+
}) => ({
|
|
310
|
+
context,
|
|
311
|
+
event
|
|
312
|
+
}),
|
|
313
|
+
onDone: {
|
|
314
|
+
target: "idle" /* Idle */,
|
|
315
|
+
actions: ["addNewMessage", "stopLoading"]
|
|
316
|
+
},
|
|
317
|
+
onError: {
|
|
318
|
+
target: "error" /* Error */
|
|
319
|
+
}
|
|
320
|
+
}
|
|
321
|
+
},
|
|
322
|
+
["sendMessageWithFile" /* SendMessageWithFile */]: {
|
|
323
|
+
invoke: {
|
|
324
|
+
src: "sendMessageWithFile",
|
|
325
|
+
input: ({
|
|
326
|
+
context,
|
|
327
|
+
event
|
|
328
|
+
}) => ({
|
|
329
|
+
context,
|
|
330
|
+
event
|
|
331
|
+
}),
|
|
332
|
+
onDone: {
|
|
333
|
+
target: "idle" /* Idle */,
|
|
334
|
+
actions: ["addNewMessage", "clearImageData", "stopLoading"]
|
|
335
|
+
},
|
|
336
|
+
onError: {
|
|
337
|
+
target: "error" /* Error */
|
|
338
|
+
}
|
|
339
|
+
}
|
|
340
|
+
},
|
|
341
|
+
["fetchMoreMessages" /* FetchMoreMessages */]: {
|
|
342
|
+
invoke: {
|
|
343
|
+
src: "fetchMoreMessages",
|
|
344
|
+
input: ({
|
|
345
|
+
context,
|
|
346
|
+
event
|
|
347
|
+
}) => ({
|
|
348
|
+
context,
|
|
349
|
+
event
|
|
350
|
+
}),
|
|
351
|
+
onDone: {
|
|
352
|
+
target: "idle" /* Idle */,
|
|
353
|
+
actions: ["addChannelMessages"]
|
|
354
|
+
},
|
|
355
|
+
onError: {
|
|
356
|
+
target: "error" /* Error */
|
|
357
|
+
}
|
|
358
|
+
}
|
|
359
|
+
},
|
|
360
|
+
["createDirectChannel" /* CreateDirectChannel */]: {
|
|
361
|
+
invoke: {
|
|
362
|
+
src: "createDirectChannel",
|
|
363
|
+
input: ({
|
|
364
|
+
context,
|
|
365
|
+
event
|
|
366
|
+
}) => ({
|
|
367
|
+
context,
|
|
368
|
+
event
|
|
369
|
+
}),
|
|
370
|
+
onDone: {
|
|
371
|
+
target: "idle" /* Idle */,
|
|
372
|
+
actions: ["setChannelId", "stopLoading"]
|
|
373
|
+
},
|
|
374
|
+
onError: {
|
|
375
|
+
target: "error" /* Error */
|
|
376
|
+
}
|
|
377
|
+
}
|
|
378
|
+
}
|
|
379
|
+
}
|
|
380
|
+
});export{Actions,BaseState,MainState};//# sourceMappingURL=conversation-xstate.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"conversation-xstate.js","sources":["../../../../../src/screens/inbox/containers/workflow/conversation-xstate.ts"],"sourcesContent":["import { assign, setup } from 'xstate';\nimport { merge } from 'lodash-es';\n\nexport const enum Actions {\n INITIAL_CONTEXT = 'INITIAL_CONTEXT',\n ERROR_HANDLED = 'ERROR_HANDLED',\n SEND_MESSAGE = 'SEND_MESSAGE',\n SEND_MESSAGE_WITH_FILE = 'SEND_MESSAGE_WITH_FILE',\n SET_CHANNEL_MESSAGES = 'SET_CHANNEL_MESSAGES',\n CLEAR_MESSAGES = 'CLEAR_MESSAGES',\n FETCH_MORE_MESSAGES = 'FETCH_MORE_MESSAGES',\n SUBSCRIBE_TO_MESSAGES = 'SUBSCRIBE_TO_MESSAGES',\n CREATE_DIRECT_CHANNEL = 'CREATE_DIRECT_CHANNEL',\n START_LOADING = 'START_LOADING',\n STOP_LOADING = 'STOP_LOADING',\n SET_IMAGE = 'SET_IMAGE',\n CLEAR_IMAGE = 'CLEAR_IMAGE',\n SET_MESSAGE_TEXT = 'SET_MESSAGE_TEXT',\n}\n\nexport const enum BaseState {\n Idle = 'idle',\n Error = 'error',\n Loading = 'loading',\n Done = 'done',\n FetchChannels = 'fetchChannels',\n FetchMessages = 'fetchMessages',\n}\n\nexport const enum MainState {\n SendMessage = 'sendMessage',\n SendMessageWithFile = 'sendMessageWithFile',\n FetchMoreMessages = 'fetchMoreMessages',\n CreateDirectChannel = 'createDirectChannel',\n}\n\nexport const conversationXstate = setup({\n types: {\n context: {} as {\n channelId: string | null;\n channelMessages: any[];\n totalCount: number;\n skip: number;\n loading: boolean;\n loadingOldMessages: boolean;\n error: string | null;\n selectedImage: string;\n files: any[];\n images: any[];\n messageText: string;\n imageLoading: boolean;\n },\n },\n actions: {\n errorState: assign(({ context, event }) => {\n return {\n ...context,\n error: event.data?.message || 'An error occurred',\n loading: false,\n loadingOldMessages: false,\n imageLoading: false,\n };\n }),\n setInitialContext: assign(({ context, event }) => {\n return merge({\n ...context,\n channelId: event.data?.channelId || null,\n loading: false,\n });\n }),\n setChannelMessages: assign(({ context, event }) => {\n return {\n ...context,\n channelMessages: event.data?.messages || [],\n totalCount: event.data?.totalCount || 0,\n loading: false,\n };\n }),\n addChannelMessages: assign(({ context, event }) => {\n const messages = event.data?.messages || [];\n return {\n ...context,\n channelMessages: [...context.channelMessages, ...messages],\n loadingOldMessages: false,\n };\n }),\n addNewMessage: assign(({ context, event }) => {\n const message = event.data?.message;\n if (!message) return context;\n\n return {\n ...context,\n channelMessages: [...context.channelMessages, message],\n totalCount: context.totalCount + 1,\n loading: false,\n };\n }),\n updateSkip: assign(({ context, event }) => {\n return {\n ...context,\n skip: context.channelMessages.length,\n loadingOldMessages: true,\n };\n }),\n clearMessages: assign(({ context }) => {\n return {\n ...context,\n channelMessages: [],\n totalCount: 0,\n skip: 0,\n };\n }),\n setChannelId: assign(({ context, event }) => {\n return {\n ...context,\n channelId: event.data?.channelId || null,\n };\n }),\n startLoading: assign(({ context }) => {\n return {\n ...context,\n loading: true,\n };\n }),\n stopLoading: assign(({ context }) => {\n return {\n ...context,\n loading: false,\n };\n }),\n startImageLoading: assign(({ context }) => {\n return {\n ...context,\n imageLoading: true,\n };\n }),\n stopImageLoading: assign(({ context }) => {\n return {\n ...context,\n imageLoading: false,\n };\n }),\n setSelectedImage: assign(({ context, event }) => {\n return {\n ...context,\n selectedImage: event.data?.image || '',\n files: event.data?.files || context.files,\n images: event.data?.images || context.images,\n imageLoading: false,\n };\n }),\n clearImageData: assign(({ context }) => {\n return {\n ...context,\n selectedImage: '',\n files: [],\n images: [],\n };\n }),\n setMessageText: assign(({ context, event }) => {\n return {\n ...context,\n messageText: event.data?.messageText || '',\n };\n }),\n },\n guards: {\n hasMoreMessages: ({ context }) => {\n return context.totalCount > context.channelMessages.length;\n },\n },\n}).createMachine({\n id: 'conversation-view',\n initial: BaseState.Idle,\n context: {\n channelId: null,\n channelMessages: [],\n totalCount: 0,\n skip: 0,\n loading: false,\n loadingOldMessages: false,\n error: null,\n selectedImage: '',\n files: [],\n images: [],\n messageText: '',\n imageLoading: false,\n },\n states: {\n [BaseState.Idle]: {\n on: {\n [Actions.INITIAL_CONTEXT]: {\n target: BaseState.FetchMessages,\n actions: ['setInitialContext'],\n },\n [Actions.SEND_MESSAGE]: {\n target: MainState.SendMessage,\n actions: ['startLoading'],\n },\n [Actions.SEND_MESSAGE_WITH_FILE]: {\n target: MainState.SendMessageWithFile,\n actions: ['startLoading'],\n },\n [Actions.FETCH_MORE_MESSAGES]: {\n target: MainState.FetchMoreMessages,\n actions: ['updateSkip'],\n guard: 'hasMoreMessages',\n },\n [Actions.CLEAR_MESSAGES]: {\n target: BaseState.Idle,\n actions: ['clearMessages'],\n },\n [Actions.CREATE_DIRECT_CHANNEL]: {\n target: MainState.CreateDirectChannel,\n actions: ['startLoading'],\n },\n [Actions.START_LOADING]: {\n target: BaseState.Idle,\n actions: ['startLoading'],\n },\n [Actions.STOP_LOADING]: {\n target: BaseState.Idle,\n actions: ['stopLoading'],\n },\n [Actions.SET_IMAGE]: {\n target: BaseState.Idle,\n actions: ['setSelectedImage'],\n },\n [Actions.CLEAR_IMAGE]: {\n target: BaseState.Idle,\n actions: ['clearImageData'],\n },\n [Actions.SET_MESSAGE_TEXT]: {\n target: BaseState.Idle,\n actions: ['setMessageText'],\n },\n },\n },\n [BaseState.Error]: {\n entry: ['errorState'],\n on: {\n [Actions.ERROR_HANDLED]: {\n target: BaseState.Idle,\n },\n },\n },\n [BaseState.FetchMessages]: {\n invoke: {\n src: 'fetchMessages',\n input: ({ context, event }) => ({ context, event }),\n onDone: {\n target: BaseState.Idle,\n actions: ['setChannelMessages'],\n },\n onError: {\n target: BaseState.Error,\n },\n },\n },\n [MainState.SendMessage]: {\n invoke: {\n src: 'sendMessage',\n input: ({ context, event }) => ({ context, event }),\n onDone: {\n target: BaseState.Idle,\n actions: ['addNewMessage', 'stopLoading'],\n },\n onError: {\n target: BaseState.Error,\n },\n },\n },\n [MainState.SendMessageWithFile]: {\n invoke: {\n src: 'sendMessageWithFile',\n input: ({ context, event }) => ({ context, event }),\n onDone: {\n target: BaseState.Idle,\n actions: ['addNewMessage', 'clearImageData', 'stopLoading'],\n },\n onError: {\n target: BaseState.Error,\n },\n },\n },\n [MainState.FetchMoreMessages]: {\n invoke: {\n src: 'fetchMoreMessages',\n input: ({ context, event }) => ({ context, event }),\n onDone: {\n target: BaseState.Idle,\n actions: ['addChannelMessages'],\n },\n onError: {\n target: BaseState.Error,\n },\n },\n },\n [MainState.CreateDirectChannel]: {\n invoke: {\n src: 'createDirectChannel',\n input: ({ context, event }) => ({ context, event }),\n onDone: {\n target: BaseState.Idle,\n actions: ['setChannelId', 'stopLoading'],\n },\n onError: {\n target: BaseState.Error,\n },\n },\n },\n },\n} as any);\n"],"names":["Actions","BaseState","MainState"],"mappings":";;;;;;;;;;;;;;;;;;;AAEkB,IAAA,OAAA,qBAAAA,QAAX,KAAA;AACL,EAAAA,SAAA,iBAAkB,CAAA,GAAA,iBAAA;AAClB,EAAAA,SAAA,eAAgB,CAAA,GAAA,eAAA;AAChB,EAAAA,SAAA,cAAe,CAAA,GAAA,cAAA;AACf,EAAAA,SAAA,wBAAyB,CAAA,GAAA,wBAAA;AACzB,EAAAA,SAAA,sBAAuB,CAAA,GAAA,sBAAA;AACvB,EAAAA,SAAA,gBAAiB,CAAA,GAAA,gBAAA;AACjB,EAAAA,SAAA,qBAAsB,CAAA,GAAA,qBAAA;AACtB,EAAAA,SAAA,uBAAwB,CAAA,GAAA,uBAAA;AACxB,EAAAA,SAAA,uBAAwB,CAAA,GAAA,uBAAA;AACxB,EAAAA,SAAA,eAAgB,CAAA,GAAA,eAAA;AAChB,EAAAA,SAAA,cAAe,CAAA,GAAA,cAAA;AACf,EAAAA,SAAA,WAAY,CAAA,GAAA,WAAA;AACZ,EAAAA,SAAA,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,UACA;AAAA,SACK,MAAA;AAAA,UACL,OAAA;AAAA,UACA;AAAA,SACF,CAAA;AAAA,QACA,MAAQ,EAAA;AAAA,UACN,MAAQ,EAAA,MAAA;AAAA,UACR,OAAS,EAAA,CAAC,eAAiB,EAAA,gBAAA,EAAkB,aAAa;AAAA,SAC5D;AAAA,QACA,OAAS,EAAA;AAAA,UACP,MAAQ,EAAA,OAAA;AAAA;AACV;AACF,KACF;AAAA,IACA,CAAC,mBAA8B,2BAAA;AAAA,MAC7B,MAAQ,EAAA;AAAA,QACN,GAAK,EAAA,mBAAA;AAAA,QACL,OAAO,CAAC;AAAA,UACN,OAAA;AAAA,UACA;AAAA,SACK,MAAA;AAAA,UACL,OAAA;AAAA,UACA;AAAA,SACF,CAAA;AAAA,QACA,MAAQ,EAAA;AAAA,UACN,MAAQ,EAAA,MAAA;AAAA,UACR,OAAA,EAAS,CAAC,oBAAoB;AAAA,SAChC;AAAA,QACA,OAAS,EAAA;AAAA,UACP,MAAQ,EAAA,OAAA;AAAA;AACV;AACF,KACF;AAAA,IACA,CAAC,qBAAgC,6BAAA;AAAA,MAC/B,MAAQ,EAAA;AAAA,QACN,GAAK,EAAA,qBAAA;AAAA,QACL,OAAO,CAAC;AAAA,UACN,OAAA;AAAA,UACA;AAAA,SACK,MAAA;AAAA,UACL,OAAA;AAAA,UACA;AAAA,SACF,CAAA;AAAA,QACA,MAAQ,EAAA;AAAA,UACN,MAAQ,EAAA,MAAA;AAAA,UACR,OAAA,EAAS,CAAC,cAAA,EAAgB,aAAa;AAAA,SACzC;AAAA,QACA,OAAS,EAAA;AAAA,UACP,MAAQ,EAAA,OAAA;AAAA;AACV;AACF;AACF;AAEJ,CAAQ"}
|
|
@@ -0,0 +1,235 @@
|
|
|
1
|
+
import {setup,assign}from'xstate';import {merge}from'lodash-es';var __defProp = Object.defineProperty;
|
|
2
|
+
var __defProps = Object.defineProperties;
|
|
3
|
+
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
4
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
7
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
8
|
+
var __spreadValues = (a, b) => {
|
|
9
|
+
for (var prop in b || (b = {}))
|
|
10
|
+
if (__hasOwnProp.call(b, prop))
|
|
11
|
+
__defNormalProp(a, prop, b[prop]);
|
|
12
|
+
if (__getOwnPropSymbols)
|
|
13
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
14
|
+
if (__propIsEnum.call(b, prop))
|
|
15
|
+
__defNormalProp(a, prop, b[prop]);
|
|
16
|
+
}
|
|
17
|
+
return a;
|
|
18
|
+
};
|
|
19
|
+
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
20
|
+
var Actions = /* @__PURE__ */ ((Actions2) => {
|
|
21
|
+
Actions2["INITIAL_CONTEXT"] = "INITIAL_CONTEXT";
|
|
22
|
+
Actions2["ERROR_HANDLED"] = "ERROR_HANDLED";
|
|
23
|
+
Actions2["FETCH_CHANNELS"] = "FETCH_CHANNELS";
|
|
24
|
+
Actions2["REFRESH_CHANNELS"] = "REFRESH_CHANNELS";
|
|
25
|
+
Actions2["SELECT_CHANNEL"] = "SELECT_CHANNEL";
|
|
26
|
+
Actions2["START_LOADING"] = "START_LOADING";
|
|
27
|
+
Actions2["STOP_LOADING"] = "STOP_LOADING";
|
|
28
|
+
Actions2["SET_SEARCH_QUERY"] = "SET_SEARCH_QUERY";
|
|
29
|
+
return Actions2;
|
|
30
|
+
})(Actions || {});
|
|
31
|
+
var BaseState = /* @__PURE__ */ ((BaseState2) => {
|
|
32
|
+
BaseState2["Idle"] = "idle";
|
|
33
|
+
BaseState2["Error"] = "error";
|
|
34
|
+
BaseState2["Loading"] = "loading";
|
|
35
|
+
BaseState2["Done"] = "done";
|
|
36
|
+
BaseState2["FetchChannels"] = "fetchChannels";
|
|
37
|
+
return BaseState2;
|
|
38
|
+
})(BaseState || {});
|
|
39
|
+
var MainState = /* @__PURE__ */ ((MainState2) => {
|
|
40
|
+
MainState2["RefreshChannels"] = "refreshChannels";
|
|
41
|
+
MainState2["SelectChannel"] = "selectChannel";
|
|
42
|
+
return MainState2;
|
|
43
|
+
})(MainState || {});
|
|
44
|
+
setup({
|
|
45
|
+
types: {
|
|
46
|
+
context: {}
|
|
47
|
+
},
|
|
48
|
+
actions: {
|
|
49
|
+
errorState: assign(({
|
|
50
|
+
context,
|
|
51
|
+
event
|
|
52
|
+
}) => {
|
|
53
|
+
var _a;
|
|
54
|
+
return __spreadProps(__spreadValues({}, context), {
|
|
55
|
+
error: ((_a = event.data) == null ? void 0 : _a.message) || "An error occurred",
|
|
56
|
+
loading: false,
|
|
57
|
+
refreshing: false
|
|
58
|
+
});
|
|
59
|
+
}),
|
|
60
|
+
setInitialContext: assign(({
|
|
61
|
+
context,
|
|
62
|
+
event
|
|
63
|
+
}) => {
|
|
64
|
+
var _a, _b, _c, _d;
|
|
65
|
+
return merge(__spreadProps(__spreadValues({}, context), {
|
|
66
|
+
channelRole: ((_a = event.data) == null ? void 0 : _a.channelRole) || null,
|
|
67
|
+
channelFilters: ((_b = event.data) == null ? void 0 : _b.channelFilters) || {},
|
|
68
|
+
supportServices: ((_c = event.data) == null ? void 0 : _c.supportServices) || false,
|
|
69
|
+
selectedChannelId: ((_d = event.data) == null ? void 0 : _d.selectedChannelId) || null,
|
|
70
|
+
loading: true
|
|
71
|
+
}));
|
|
72
|
+
}),
|
|
73
|
+
setChannels: assign(({
|
|
74
|
+
context,
|
|
75
|
+
event
|
|
76
|
+
}) => {
|
|
77
|
+
var _a;
|
|
78
|
+
return __spreadProps(__spreadValues({}, context), {
|
|
79
|
+
channels: ((_a = event.data) == null ? void 0 : _a.channels) || [],
|
|
80
|
+
loading: false,
|
|
81
|
+
refreshing: false
|
|
82
|
+
});
|
|
83
|
+
}),
|
|
84
|
+
startRefreshing: assign(({
|
|
85
|
+
context
|
|
86
|
+
}) => {
|
|
87
|
+
return __spreadProps(__spreadValues({}, context), {
|
|
88
|
+
refreshing: true
|
|
89
|
+
});
|
|
90
|
+
}),
|
|
91
|
+
stopRefreshing: assign(({
|
|
92
|
+
context
|
|
93
|
+
}) => {
|
|
94
|
+
return __spreadProps(__spreadValues({}, context), {
|
|
95
|
+
refreshing: false
|
|
96
|
+
});
|
|
97
|
+
}),
|
|
98
|
+
startLoading: assign(({
|
|
99
|
+
context
|
|
100
|
+
}) => {
|
|
101
|
+
return __spreadProps(__spreadValues({}, context), {
|
|
102
|
+
loading: true
|
|
103
|
+
});
|
|
104
|
+
}),
|
|
105
|
+
stopLoading: assign(({
|
|
106
|
+
context
|
|
107
|
+
}) => {
|
|
108
|
+
return __spreadProps(__spreadValues({}, context), {
|
|
109
|
+
loading: false
|
|
110
|
+
});
|
|
111
|
+
}),
|
|
112
|
+
setSearchQuery: assign(({
|
|
113
|
+
context,
|
|
114
|
+
event
|
|
115
|
+
}) => {
|
|
116
|
+
var _a;
|
|
117
|
+
return __spreadProps(__spreadValues({}, context), {
|
|
118
|
+
searchQuery: ((_a = event.data) == null ? void 0 : _a.searchQuery) || ""
|
|
119
|
+
});
|
|
120
|
+
}),
|
|
121
|
+
selectChannel: assign(({
|
|
122
|
+
context,
|
|
123
|
+
event
|
|
124
|
+
}) => {
|
|
125
|
+
var _a;
|
|
126
|
+
return __spreadProps(__spreadValues({}, context), {
|
|
127
|
+
selectedChannelId: ((_a = event.data) == null ? void 0 : _a.channelId) || null
|
|
128
|
+
});
|
|
129
|
+
})
|
|
130
|
+
},
|
|
131
|
+
guards: {
|
|
132
|
+
hasChannels: ({
|
|
133
|
+
context
|
|
134
|
+
}) => {
|
|
135
|
+
return context.channels.length > 0;
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
}).createMachine({
|
|
139
|
+
id: "dialogs-view",
|
|
140
|
+
initial: "idle" /* Idle */,
|
|
141
|
+
context: {
|
|
142
|
+
channels: [],
|
|
143
|
+
refreshing: false,
|
|
144
|
+
loading: false,
|
|
145
|
+
error: null,
|
|
146
|
+
searchQuery: "",
|
|
147
|
+
selectedChannelId: null,
|
|
148
|
+
channelRole: null,
|
|
149
|
+
channelFilters: {},
|
|
150
|
+
supportServices: false
|
|
151
|
+
},
|
|
152
|
+
states: {
|
|
153
|
+
["idle" /* Idle */]: {
|
|
154
|
+
on: {
|
|
155
|
+
["INITIAL_CONTEXT" /* INITIAL_CONTEXT */]: {
|
|
156
|
+
target: "fetchChannels" /* FetchChannels */,
|
|
157
|
+
actions: ["setInitialContext"]
|
|
158
|
+
},
|
|
159
|
+
["REFRESH_CHANNELS" /* REFRESH_CHANNELS */]: {
|
|
160
|
+
target: "refreshChannels" /* RefreshChannels */,
|
|
161
|
+
actions: ["startRefreshing"]
|
|
162
|
+
},
|
|
163
|
+
["SELECT_CHANNEL" /* SELECT_CHANNEL */]: {
|
|
164
|
+
target: "selectChannel" /* SelectChannel */,
|
|
165
|
+
actions: ["selectChannel"]
|
|
166
|
+
},
|
|
167
|
+
["START_LOADING" /* START_LOADING */]: {
|
|
168
|
+
target: "idle" /* Idle */,
|
|
169
|
+
actions: ["startLoading"]
|
|
170
|
+
},
|
|
171
|
+
["STOP_LOADING" /* STOP_LOADING */]: {
|
|
172
|
+
target: "idle" /* Idle */,
|
|
173
|
+
actions: ["stopLoading"]
|
|
174
|
+
},
|
|
175
|
+
["SET_SEARCH_QUERY" /* SET_SEARCH_QUERY */]: {
|
|
176
|
+
target: "idle" /* Idle */,
|
|
177
|
+
actions: ["setSearchQuery"]
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
},
|
|
181
|
+
["error" /* Error */]: {
|
|
182
|
+
entry: ["errorState"],
|
|
183
|
+
on: {
|
|
184
|
+
["ERROR_HANDLED" /* ERROR_HANDLED */]: {
|
|
185
|
+
target: "idle" /* Idle */
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
},
|
|
189
|
+
["fetchChannels" /* FetchChannels */]: {
|
|
190
|
+
invoke: {
|
|
191
|
+
src: "fetchChannels",
|
|
192
|
+
input: ({
|
|
193
|
+
context,
|
|
194
|
+
event
|
|
195
|
+
}) => ({
|
|
196
|
+
context,
|
|
197
|
+
event
|
|
198
|
+
}),
|
|
199
|
+
onDone: {
|
|
200
|
+
target: "idle" /* Idle */,
|
|
201
|
+
actions: ["setChannels"]
|
|
202
|
+
},
|
|
203
|
+
onError: {
|
|
204
|
+
target: "error" /* Error */,
|
|
205
|
+
actions: ["errorState"]
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
},
|
|
209
|
+
["refreshChannels" /* RefreshChannels */]: {
|
|
210
|
+
invoke: {
|
|
211
|
+
src: "refreshChannels",
|
|
212
|
+
input: ({
|
|
213
|
+
context,
|
|
214
|
+
event
|
|
215
|
+
}) => ({
|
|
216
|
+
context,
|
|
217
|
+
event
|
|
218
|
+
}),
|
|
219
|
+
onDone: {
|
|
220
|
+
target: "idle" /* Idle */,
|
|
221
|
+
actions: ["setChannels"]
|
|
222
|
+
},
|
|
223
|
+
onError: {
|
|
224
|
+
target: "error" /* Error */,
|
|
225
|
+
actions: ["errorState"]
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
},
|
|
229
|
+
["selectChannel" /* SelectChannel */]: {
|
|
230
|
+
always: {
|
|
231
|
+
target: "idle" /* Idle */
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
});export{Actions,BaseState,MainState};//# sourceMappingURL=dialogs-xstate.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dialogs-xstate.js","sources":["../../../../../src/screens/inbox/containers/workflow/dialogs-xstate.ts"],"sourcesContent":["import { assign, setup } from 'xstate';\nimport { merge } from 'lodash-es';\n\nexport const enum Actions {\n INITIAL_CONTEXT = 'INITIAL_CONTEXT',\n ERROR_HANDLED = 'ERROR_HANDLED',\n FETCH_CHANNELS = 'FETCH_CHANNELS',\n REFRESH_CHANNELS = 'REFRESH_CHANNELS',\n SELECT_CHANNEL = 'SELECT_CHANNEL',\n START_LOADING = 'START_LOADING',\n STOP_LOADING = 'STOP_LOADING',\n SET_SEARCH_QUERY = 'SET_SEARCH_QUERY',\n}\n\nexport const enum BaseState {\n Idle = 'idle',\n Error = 'error',\n Loading = 'loading',\n Done = 'done',\n FetchChannels = 'fetchChannels',\n}\n\nexport const enum MainState {\n RefreshChannels = 'refreshChannels',\n SelectChannel = 'selectChannel',\n}\n\nexport const dialogsXstate = setup({\n types: {\n context: {} as {\n channels: any[];\n refreshing: boolean;\n loading: boolean;\n error: string | null;\n searchQuery: string;\n selectedChannelId: string | null;\n channelRole: string | null;\n channelFilters: Record<string, any>;\n supportServices: boolean;\n },\n },\n actions: {\n errorState: assign(({ context, event }) => {\n return {\n ...context,\n error: event.data?.message || 'An error occurred',\n loading: false,\n refreshing: false,\n };\n }),\n setInitialContext: assign(({ context, event }) => {\n return merge({\n ...context,\n channelRole: event.data?.channelRole || null,\n channelFilters: event.data?.channelFilters || {},\n supportServices: event.data?.supportServices || false,\n selectedChannelId: event.data?.selectedChannelId || null,\n loading: true,\n });\n }),\n setChannels: assign(({ context, event }) => {\n return {\n ...context,\n channels: event.data?.channels || [],\n loading: false,\n refreshing: false,\n };\n }),\n startRefreshing: assign(({ context }) => {\n return {\n ...context,\n refreshing: true,\n };\n }),\n stopRefreshing: assign(({ context }) => {\n return {\n ...context,\n refreshing: false,\n };\n }),\n startLoading: assign(({ context }) => {\n return {\n ...context,\n loading: true,\n };\n }),\n stopLoading: assign(({ context }) => {\n return {\n ...context,\n loading: false,\n };\n }),\n setSearchQuery: assign(({ context, event }) => {\n return {\n ...context,\n searchQuery: event.data?.searchQuery || '',\n };\n }),\n selectChannel: assign(({ context, event }) => {\n return {\n ...context,\n selectedChannelId: event.data?.channelId || null,\n };\n }),\n },\n guards: {\n hasChannels: ({ context }) => {\n return context.channels.length > 0;\n },\n },\n}).createMachine({\n id: 'dialogs-view',\n initial: BaseState.Idle,\n context: {\n channels: [],\n refreshing: false,\n loading: false,\n error: null,\n searchQuery: '',\n selectedChannelId: null,\n channelRole: null,\n channelFilters: {},\n supportServices: false,\n },\n states: {\n [BaseState.Idle]: {\n on: {\n [Actions.INITIAL_CONTEXT]: {\n target: BaseState.FetchChannels,\n actions: ['setInitialContext'],\n },\n [Actions.REFRESH_CHANNELS]: {\n target: MainState.RefreshChannels,\n actions: ['startRefreshing'],\n },\n [Actions.SELECT_CHANNEL]: {\n target: MainState.SelectChannel,\n actions: ['selectChannel'],\n },\n [Actions.START_LOADING]: {\n target: BaseState.Idle,\n actions: ['startLoading'],\n },\n [Actions.STOP_LOADING]: {\n target: BaseState.Idle,\n actions: ['stopLoading'],\n },\n [Actions.SET_SEARCH_QUERY]: {\n target: BaseState.Idle,\n actions: ['setSearchQuery'],\n },\n },\n },\n [BaseState.Error]: {\n entry: ['errorState'],\n on: {\n [Actions.ERROR_HANDLED]: {\n target: BaseState.Idle,\n },\n },\n },\n [BaseState.FetchChannels]: {\n invoke: {\n src: 'fetchChannels',\n input: ({ context, event }) => ({ context, event }),\n onDone: {\n target: BaseState.Idle,\n actions: ['setChannels'],\n },\n onError: {\n target: BaseState.Error,\n actions: ['errorState'],\n },\n },\n },\n [MainState.RefreshChannels]: {\n invoke: {\n src: 'refreshChannels',\n input: ({ context, event }) => ({ context, event }),\n onDone: {\n target: BaseState.Idle,\n actions: ['setChannels'],\n },\n onError: {\n target: BaseState.Error,\n actions: ['errorState'],\n },\n },\n },\n [MainState.SelectChannel]: {\n always: {\n target: BaseState.Idle,\n },\n },\n },\n} as any);\n"],"names":["Actions","BaseState","MainState"],"mappings":";;;;;;;;;;;;;;;;;;;AAEkB,IAAA,OAAA,qBAAAA,QAAX,KAAA;AACL,EAAAA,SAAA,iBAAkB,CAAA,GAAA,iBAAA;AAClB,EAAAA,SAAA,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