@messenger-box/platform-mobile 10.0.3-alpha.20 → 10.0.3-alpha.201

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 (112) hide show
  1. package/lib/components/messages-container-ui/BuildModeView.js +428 -0
  2. package/lib/components/messages-container-ui/BuildModeView.js.map +1 -0
  3. package/lib/components/messages-container-ui/MessagesContainerUI.js +55 -0
  4. package/lib/components/messages-container-ui/MessagesContainerUI.js.map +1 -0
  5. package/lib/components/messages-container-ui/PlanModeView.js +336 -0
  6. package/lib/components/messages-container-ui/PlanModeView.js.map +1 -0
  7. package/lib/compute.js +2 -3
  8. package/lib/compute.js.map +1 -1
  9. package/lib/index.js +1 -1
  10. package/lib/index.js.map +1 -1
  11. package/lib/module.js.map +1 -1
  12. package/lib/queries/inboxQueries.js +62 -0
  13. package/lib/queries/inboxQueries.js.map +1 -0
  14. package/lib/routes.json +2 -3
  15. package/lib/screens/inbox/DialogMessages.js +8 -3
  16. package/lib/screens/inbox/DialogMessages.js.map +1 -1
  17. package/lib/screens/inbox/DialogThreadMessages.js +6 -11
  18. package/lib/screens/inbox/DialogThreadMessages.js.map +1 -1
  19. package/lib/screens/inbox/DialogThreads.js +58 -20
  20. package/lib/screens/inbox/DialogThreads.js.map +1 -1
  21. package/lib/screens/inbox/Inbox.js.map +1 -1
  22. package/lib/screens/inbox/components/CachedImage/consts.js +1 -1
  23. package/lib/screens/inbox/components/CachedImage/consts.js.map +1 -1
  24. package/lib/screens/inbox/components/CachedImage/index.js +125 -115
  25. package/lib/screens/inbox/components/CachedImage/index.js.map +1 -1
  26. package/lib/screens/inbox/components/DialogItem.js +160 -0
  27. package/lib/screens/inbox/components/DialogItem.js.map +1 -0
  28. package/lib/screens/inbox/components/GiftedChatInboxComponent.js +315 -0
  29. package/lib/screens/inbox/components/GiftedChatInboxComponent.js.map +1 -0
  30. package/lib/screens/inbox/components/SlackMessageContainer/ImageViewerModal.js +3 -1
  31. package/lib/screens/inbox/components/SlackMessageContainer/ImageViewerModal.js.map +1 -1
  32. package/lib/screens/inbox/components/SlackMessageContainer/PaymentMessage.js +194 -0
  33. package/lib/screens/inbox/components/SlackMessageContainer/PaymentMessage.js.map +1 -0
  34. package/lib/screens/inbox/components/SlackMessageContainer/SlackBubble.js +149 -36
  35. package/lib/screens/inbox/components/SlackMessageContainer/SlackBubble.js.map +1 -1
  36. package/lib/screens/inbox/components/SlackMessageContainer/SlackMessage.js +4 -5
  37. package/lib/screens/inbox/components/SlackMessageContainer/SlackMessage.js.map +1 -1
  38. package/lib/screens/inbox/components/SubscriptionHandler.js +22 -0
  39. package/lib/screens/inbox/components/SubscriptionHandler.js.map +1 -0
  40. package/lib/screens/inbox/components/ThreadsViewItem.js +67 -47
  41. package/lib/screens/inbox/components/ThreadsViewItem.js.map +1 -1
  42. package/lib/screens/inbox/config/config.js +4 -2
  43. package/lib/screens/inbox/config/config.js.map +1 -1
  44. package/lib/screens/inbox/containers/ConversationView.js +1099 -1094
  45. package/lib/screens/inbox/containers/ConversationView.js.map +1 -1
  46. package/lib/screens/inbox/containers/Dialogs.js +132 -534
  47. package/lib/screens/inbox/containers/Dialogs.js.map +1 -1
  48. package/lib/screens/inbox/containers/ThreadConversationView.js +876 -1357
  49. package/lib/screens/inbox/containers/ThreadConversationView.js.map +1 -1
  50. package/lib/screens/inbox/containers/ThreadsView.js +81 -54
  51. package/lib/screens/inbox/containers/ThreadsView.js.map +1 -1
  52. package/lib/screens/inbox/hooks/useInboxMessages.js +31 -0
  53. package/lib/screens/inbox/hooks/useInboxMessages.js.map +1 -0
  54. package/lib/screens/inbox/hooks/useSafeDialogThreadsMachine.js +108 -0
  55. package/lib/screens/inbox/hooks/useSafeDialogThreadsMachine.js.map +1 -0
  56. package/lib/screens/inbox/workflow/dialog-threads-xstate.js +151 -0
  57. package/lib/screens/inbox/workflow/dialog-threads-xstate.js.map +1 -0
  58. package/package.json +9 -7
  59. package/CHANGELOG.md +0 -164
  60. package/jest.config.js +0 -24
  61. package/lib/screens/inbox/components/DialogsListItem.js +0 -548
  62. package/lib/screens/inbox/components/DialogsListItem.js.map +0 -1
  63. package/lib/screens/inbox/components/ServiceDialogsListItem.js +0 -489
  64. package/lib/screens/inbox/components/ServiceDialogsListItem.js.map +0 -1
  65. package/lib/screens/inbox/components/workflow/dialogs-list-item-xstate.js +0 -175
  66. package/lib/screens/inbox/components/workflow/dialogs-list-item-xstate.js.map +0 -1
  67. package/lib/screens/inbox/components/workflow/service-dialogs-list-item-xstate.js +0 -191
  68. package/lib/screens/inbox/components/workflow/service-dialogs-list-item-xstate.js.map +0 -1
  69. package/lib/screens/inbox/containers/workflow/conversation-xstate.js +0 -380
  70. package/lib/screens/inbox/containers/workflow/conversation-xstate.js.map +0 -1
  71. package/lib/screens/inbox/containers/workflow/dialogs-xstate.js +0 -211
  72. package/lib/screens/inbox/containers/workflow/dialogs-xstate.js.map +0 -1
  73. package/lib/screens/inbox/containers/workflow/thread-conversation-xstate.js +0 -438
  74. package/lib/screens/inbox/containers/workflow/thread-conversation-xstate.js.map +0 -1
  75. package/rollup.config.mjs +0 -45
  76. package/src/components/index.ts +0 -0
  77. package/src/compute.ts +0 -63
  78. package/src/index.ts +0 -7
  79. package/src/module.ts +0 -10
  80. package/src/navigation/InboxNavigation.tsx +0 -102
  81. package/src/navigation/index.ts +0 -1
  82. package/src/screens/inbox/DialogMessages.tsx +0 -21
  83. package/src/screens/inbox/DialogThreadMessages.tsx +0 -97
  84. package/src/screens/inbox/DialogThreads.tsx +0 -129
  85. package/src/screens/inbox/Inbox.tsx +0 -17
  86. package/src/screens/inbox/components/CachedImage/consts.ts +0 -6
  87. package/src/screens/inbox/components/CachedImage/index.tsx +0 -223
  88. package/src/screens/inbox/components/DialogsHeader.tsx +0 -30
  89. package/src/screens/inbox/components/DialogsListItem.tsx +0 -819
  90. package/src/screens/inbox/components/ServiceDialogsListItem.tsx +0 -679
  91. package/src/screens/inbox/components/SlackMessageContainer/ImageViewerModal.tsx +0 -113
  92. package/src/screens/inbox/components/SlackMessageContainer/SlackBubble.tsx +0 -313
  93. package/src/screens/inbox/components/SlackMessageContainer/SlackMessage.tsx +0 -145
  94. package/src/screens/inbox/components/SlackMessageContainer/index.ts +0 -3
  95. package/src/screens/inbox/components/SupportServiceDialogsListItem.tsx +0 -301
  96. package/src/screens/inbox/components/ThreadsViewItem.tsx +0 -321
  97. package/src/screens/inbox/components/workflow/dialogs-list-item-xstate.ts +0 -145
  98. package/src/screens/inbox/components/workflow/service-dialogs-list-item-xstate.ts +0 -159
  99. package/src/screens/inbox/config/config.ts +0 -15
  100. package/src/screens/inbox/config/index.ts +0 -1
  101. package/src/screens/inbox/containers/ConversationView.tsx +0 -1782
  102. package/src/screens/inbox/containers/Dialogs.tsx +0 -794
  103. package/src/screens/inbox/containers/SupportServiceDialogs.tsx +0 -119
  104. package/src/screens/inbox/containers/ThreadConversationView.tsx +0 -2312
  105. package/src/screens/inbox/containers/ThreadsView.tsx +0 -305
  106. package/src/screens/inbox/containers/workflow/apollo/handleResult.ts +0 -20
  107. package/src/screens/inbox/containers/workflow/conversation-xstate.ts +0 -313
  108. package/src/screens/inbox/containers/workflow/dialogs-xstate.ts +0 -196
  109. package/src/screens/inbox/containers/workflow/thread-conversation-xstate.ts +0 -401
  110. package/src/screens/index.ts +0 -4
  111. package/tsconfig.json +0 -13
  112. package/webpack.config.js +0 -58
@@ -1,145 +0,0 @@
1
- import { assign, setup } from 'xstate';
2
- import { merge } from 'lodash-es';
3
-
4
- export const enum Actions {
5
- INITIAL_CONTEXT = 'INITIAL_CONTEXT',
6
- ERROR_HANDLED = 'ERROR_HANDLED',
7
- FETCH_MESSAGES = 'FETCH_MESSAGES',
8
- UPDATE_MESSAGES = 'UPDATE_MESSAGES',
9
- SUBSCRIBE_TO_MESSAGES = 'SUBSCRIBE_TO_MESSAGES',
10
- SET_TITLE = 'SET_TITLE',
11
- START_LOADING = 'START_LOADING',
12
- STOP_LOADING = 'STOP_LOADING',
13
- }
14
-
15
- export const enum BaseState {
16
- Idle = 'idle',
17
- Error = 'error',
18
- FetchingMessages = 'fetchingMessages',
19
- }
20
-
21
- export const dialogsListItemXstate = setup({
22
- types: {
23
- context: {} as {
24
- channelId: string | null;
25
- currentUser: any;
26
- messages: any[];
27
- loading: boolean;
28
- error: string | null;
29
- title: string;
30
- channelMembers: any[];
31
- lastMessage: any;
32
- },
33
- },
34
- actions: {
35
- errorState: assign(({ context, event }) => {
36
- return {
37
- ...context,
38
- error: event.data?.message || 'An error occurred',
39
- loading: false,
40
- };
41
- }),
42
- setInitialContext: assign(({ context, event }) => {
43
- return merge({
44
- ...context,
45
- channelId: event.data?.channelId || null,
46
- currentUser: event.data?.currentUser || null,
47
- loading: true,
48
- });
49
- }),
50
- setMessages: assign(({ context, event }) => {
51
- return {
52
- ...context,
53
- messages: event.data?.messages || [],
54
- loading: false,
55
- };
56
- }),
57
- updateMessages: assign(({ context, event }) => {
58
- const newMessage = event.data?.message;
59
- if (!newMessage) return context;
60
-
61
- return {
62
- ...context,
63
- messages: [...context.messages, newMessage],
64
- };
65
- }),
66
- setTitle: assign(({ context, event }) => {
67
- return {
68
- ...context,
69
- title: event.data?.title || '',
70
- };
71
- }),
72
- startLoading: assign(({ context }) => {
73
- return {
74
- ...context,
75
- loading: true,
76
- };
77
- }),
78
- stopLoading: assign(({ context }) => {
79
- return {
80
- ...context,
81
- loading: false,
82
- };
83
- }),
84
- },
85
- }).createMachine({
86
- id: 'dialogs-list-item',
87
- initial: BaseState.Idle,
88
- context: {
89
- channelId: null,
90
- currentUser: null,
91
- messages: [],
92
- loading: false,
93
- error: null,
94
- title: '',
95
- channelMembers: [],
96
- lastMessage: null,
97
- },
98
- states: {
99
- [BaseState.Idle]: {
100
- on: {
101
- [Actions.INITIAL_CONTEXT]: {
102
- target: BaseState.FetchingMessages,
103
- actions: ['setInitialContext'],
104
- },
105
- [Actions.UPDATE_MESSAGES]: {
106
- target: BaseState.Idle,
107
- actions: ['updateMessages'],
108
- },
109
- [Actions.SET_TITLE]: {
110
- target: BaseState.Idle,
111
- actions: ['setTitle'],
112
- },
113
- [Actions.START_LOADING]: {
114
- target: BaseState.Idle,
115
- actions: ['startLoading'],
116
- },
117
- [Actions.STOP_LOADING]: {
118
- target: BaseState.Idle,
119
- actions: ['stopLoading'],
120
- },
121
- },
122
- },
123
- [BaseState.Error]: {
124
- entry: ['errorState'],
125
- on: {
126
- [Actions.ERROR_HANDLED]: {
127
- target: BaseState.Idle,
128
- },
129
- },
130
- },
131
- [BaseState.FetchingMessages]: {
132
- invoke: {
133
- src: 'fetchMessages',
134
- input: ({ context, event }) => ({ context, event }),
135
- onDone: {
136
- target: BaseState.Idle,
137
- actions: ['setMessages'],
138
- },
139
- onError: {
140
- target: BaseState.Error,
141
- },
142
- },
143
- },
144
- },
145
- } as any);
@@ -1,159 +0,0 @@
1
- import { assign, setup } from 'xstate';
2
- import { merge } from 'lodash-es';
3
-
4
- export const enum Actions {
5
- INITIAL_CONTEXT = 'INITIAL_CONTEXT',
6
- ERROR_HANDLED = 'ERROR_HANDLED',
7
- FETCH_THREAD_MESSAGES = 'FETCH_THREAD_MESSAGES',
8
- UPDATE_THREAD_MESSAGES = 'UPDATE_THREAD_MESSAGES',
9
- SUBSCRIBE_TO_THREAD_MESSAGES = 'SUBSCRIBE_TO_THREAD_MESSAGES',
10
- SET_TITLE = 'SET_TITLE',
11
- START_LOADING = 'START_LOADING',
12
- STOP_LOADING = 'STOP_LOADING',
13
- SET_SERVICE_POST_PARENT_ID = 'SET_SERVICE_POST_PARENT_ID',
14
- }
15
-
16
- export const enum BaseState {
17
- Idle = 'idle',
18
- Error = 'error',
19
- FetchingThreadMessages = 'fetchingThreadMessages',
20
- }
21
-
22
- export const serviceDialogsListItemXstate = setup({
23
- types: {
24
- context: {} as {
25
- channelId: string | null;
26
- currentUser: any;
27
- threadMessages: any[];
28
- loading: boolean;
29
- error: string | null;
30
- title: string;
31
- role: string;
32
- servicePostParentId: string | null;
33
- lastMessage: any;
34
- },
35
- },
36
- actions: {
37
- errorState: assign(({ context, event }) => {
38
- return {
39
- ...context,
40
- error: event.data?.message || 'An error occurred',
41
- loading: false,
42
- };
43
- }),
44
- setInitialContext: assign(({ context, event }) => {
45
- return merge({
46
- ...context,
47
- channelId: event.data?.channelId || null,
48
- currentUser: event.data?.currentUser || null,
49
- role: event.data?.role || null,
50
- loading: true,
51
- });
52
- }),
53
- setThreadMessages: assign(({ context, event }) => {
54
- return {
55
- ...context,
56
- threadMessages: event.data?.threadMessages || [],
57
- loading: false,
58
- };
59
- }),
60
- updateThreadMessages: assign(({ context, event }) => {
61
- const newThreadMessage = event.data?.message;
62
- if (!newThreadMessage) return context;
63
-
64
- return {
65
- ...context,
66
- threadMessages: [...context.threadMessages, newThreadMessage],
67
- };
68
- }),
69
- setTitle: assign(({ context, event }) => {
70
- return {
71
- ...context,
72
- title: event.data?.title || '',
73
- };
74
- }),
75
- setServicePostParentId: assign(({ context, event }) => {
76
- return {
77
- ...context,
78
- servicePostParentId: event.data?.servicePostParentId || null,
79
- };
80
- }),
81
- startLoading: assign(({ context }) => {
82
- return {
83
- ...context,
84
- loading: true,
85
- };
86
- }),
87
- stopLoading: assign(({ context }) => {
88
- return {
89
- ...context,
90
- loading: false,
91
- };
92
- }),
93
- },
94
- }).createMachine({
95
- id: 'service-dialogs-list-item',
96
- initial: BaseState.Idle,
97
- context: {
98
- channelId: null,
99
- currentUser: null,
100
- threadMessages: [],
101
- loading: false,
102
- error: null,
103
- title: '',
104
- role: '',
105
- servicePostParentId: null,
106
- lastMessage: null,
107
- },
108
- states: {
109
- [BaseState.Idle]: {
110
- on: {
111
- [Actions.INITIAL_CONTEXT]: {
112
- target: BaseState.FetchingThreadMessages,
113
- actions: ['setInitialContext'],
114
- },
115
- [Actions.UPDATE_THREAD_MESSAGES]: {
116
- target: BaseState.Idle,
117
- actions: ['updateThreadMessages'],
118
- },
119
- [Actions.SET_TITLE]: {
120
- target: BaseState.Idle,
121
- actions: ['setTitle'],
122
- },
123
- [Actions.SET_SERVICE_POST_PARENT_ID]: {
124
- target: BaseState.Idle,
125
- actions: ['setServicePostParentId'],
126
- },
127
- [Actions.START_LOADING]: {
128
- target: BaseState.Idle,
129
- actions: ['startLoading'],
130
- },
131
- [Actions.STOP_LOADING]: {
132
- target: BaseState.Idle,
133
- actions: ['stopLoading'],
134
- },
135
- },
136
- },
137
- [BaseState.Error]: {
138
- entry: ['errorState'],
139
- on: {
140
- [Actions.ERROR_HANDLED]: {
141
- target: BaseState.Idle,
142
- },
143
- },
144
- },
145
- [BaseState.FetchingThreadMessages]: {
146
- invoke: {
147
- src: 'fetchThreadMessages',
148
- input: ({ context, event }) => ({ context, event }),
149
- onDone: {
150
- target: BaseState.Idle,
151
- actions: ['setThreadMessages'],
152
- },
153
- onError: {
154
- target: BaseState.Error,
155
- },
156
- },
157
- },
158
- },
159
- } as any);
@@ -1,15 +0,0 @@
1
- import { cleanEnv, num, str } from 'envalid';
2
-
3
- export const config = cleanEnv(process['APP_ENV'] || process.env, {
4
- MESSAGES_PER_PAGE: num({ devDefault: 20, default: 20 }),
5
- FILES_PER_MESSAGE: num({ default: 10 }),
6
- INBOX_MESSEGE_PATH: str({ default: 'MainStack.Message' }),
7
- // THREAD_MESSEGE_PATH: str({ default: 'MainStack.Thread' }),
8
- // THREADS_PATH: str({ default: 'MainStack.ThreadMessage' }),
9
- THREAD_MESSEGE_PATH: str({ default: 'MainStack.ThreadMessage' }),
10
- THREADS_PATH: str({ default: 'MainStack.Thread' }),
11
- CALL_TO_ACTION_PATH: str({ default: 'MainStack.GuestReservationRequestDetail' }),
12
- CALL_TO_ACTION_BOX_BGCOLOR: str({ default: '#0084ff' }),
13
- CALL_TO_ACTION_BUTTON_BORDERCOLOR: str({ default: '#fff' }),
14
- CALL_TO_ACTION_TEXT_COLOR: str({ default: '#fff' }),
15
- });
@@ -1 +0,0 @@
1
- export { config } from './config';