@messenger-box/platform-mobile 0.0.1-alpha.197 → 0.0.1-alpha.206
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 +24 -0
- package/lib/index.js +206 -259
- package/lib/index.js.map +1 -1
- package/lib/screens/inbox/Inbox.d.ts +0 -1
- package/lib/screens/inbox/components/CommonMessage.d.ts +0 -1
- package/lib/screens/inbox/components/MessageItem.d.ts +1 -1
- package/lib/screens/inbox/components/PlainMessage.d.ts +0 -1
- package/package.json +4 -4
- package/src/screens/inbox/components/MessageItem.tsx +1 -1
- package/webpack.config.js +1 -1
package/lib/index.js
CHANGED
|
@@ -1,104 +1,21 @@
|
|
|
1
|
-
|
|
2
|
-
/******/
|
|
3
|
-
/******/
|
|
4
|
-
/******/ var installedModules = {};
|
|
5
|
-
/******/
|
|
6
|
-
/******/ // The require function
|
|
7
|
-
/******/ function __webpack_require__(moduleId) {
|
|
8
|
-
/******/
|
|
9
|
-
/******/ // Check if module is in cache
|
|
10
|
-
/******/ if(installedModules[moduleId]) {
|
|
11
|
-
/******/ return installedModules[moduleId].exports;
|
|
12
|
-
/******/ }
|
|
13
|
-
/******/ // Create a new module (and put it into the cache)
|
|
14
|
-
/******/ var module = installedModules[moduleId] = {
|
|
15
|
-
/******/ i: moduleId,
|
|
16
|
-
/******/ l: false,
|
|
17
|
-
/******/ exports: {}
|
|
18
|
-
/******/ };
|
|
19
|
-
/******/
|
|
20
|
-
/******/ // Execute the module function
|
|
21
|
-
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
|
|
22
|
-
/******/
|
|
23
|
-
/******/ // Flag the module as loaded
|
|
24
|
-
/******/ module.l = true;
|
|
25
|
-
/******/
|
|
26
|
-
/******/ // Return the exports of the module
|
|
27
|
-
/******/ return module.exports;
|
|
28
|
-
/******/ }
|
|
29
|
-
/******/
|
|
30
|
-
/******/
|
|
31
|
-
/******/ // expose the modules object (__webpack_modules__)
|
|
32
|
-
/******/ __webpack_require__.m = modules;
|
|
33
|
-
/******/
|
|
34
|
-
/******/ // expose the module cache
|
|
35
|
-
/******/ __webpack_require__.c = installedModules;
|
|
36
|
-
/******/
|
|
37
|
-
/******/ // define getter function for harmony exports
|
|
38
|
-
/******/ __webpack_require__.d = function(exports, name, getter) {
|
|
39
|
-
/******/ if(!__webpack_require__.o(exports, name)) {
|
|
40
|
-
/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
|
|
41
|
-
/******/ }
|
|
42
|
-
/******/ };
|
|
43
|
-
/******/
|
|
44
|
-
/******/ // define __esModule on exports
|
|
45
|
-
/******/ __webpack_require__.r = function(exports) {
|
|
46
|
-
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
|
|
47
|
-
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
48
|
-
/******/ }
|
|
49
|
-
/******/ Object.defineProperty(exports, '__esModule', { value: true });
|
|
50
|
-
/******/ };
|
|
51
|
-
/******/
|
|
52
|
-
/******/ // create a fake namespace object
|
|
53
|
-
/******/ // mode & 1: value is a module id, require it
|
|
54
|
-
/******/ // mode & 2: merge all properties of value into the ns
|
|
55
|
-
/******/ // mode & 4: return value when already ns object
|
|
56
|
-
/******/ // mode & 8|1: behave like require
|
|
57
|
-
/******/ __webpack_require__.t = function(value, mode) {
|
|
58
|
-
/******/ if(mode & 1) value = __webpack_require__(value);
|
|
59
|
-
/******/ if(mode & 8) return value;
|
|
60
|
-
/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
|
|
61
|
-
/******/ var ns = Object.create(null);
|
|
62
|
-
/******/ __webpack_require__.r(ns);
|
|
63
|
-
/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
|
|
64
|
-
/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
|
|
65
|
-
/******/ return ns;
|
|
66
|
-
/******/ };
|
|
67
|
-
/******/
|
|
68
|
-
/******/ // getDefaultExport function for compatibility with non-harmony modules
|
|
69
|
-
/******/ __webpack_require__.n = function(module) {
|
|
70
|
-
/******/ var getter = module && module.__esModule ?
|
|
71
|
-
/******/ function getDefault() { return module['default']; } :
|
|
72
|
-
/******/ function getModuleExports() { return module; };
|
|
73
|
-
/******/ __webpack_require__.d(getter, 'a', getter);
|
|
74
|
-
/******/ return getter;
|
|
75
|
-
/******/ };
|
|
76
|
-
/******/
|
|
77
|
-
/******/ // Object.prototype.hasOwnProperty.call
|
|
78
|
-
/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
|
|
79
|
-
/******/
|
|
80
|
-
/******/ // __webpack_public_path__
|
|
81
|
-
/******/ __webpack_require__.p = "";
|
|
82
|
-
/******/
|
|
83
|
-
/******/
|
|
84
|
-
/******/ // Load entry module and return exports
|
|
85
|
-
/******/ return __webpack_require__(__webpack_require__.s = "./src/index.ts");
|
|
86
|
-
/******/ })
|
|
87
|
-
/************************************************************************/
|
|
88
|
-
/******/ ({
|
|
1
|
+
/******/ (() => { // webpackBootstrap
|
|
2
|
+
/******/ "use strict";
|
|
3
|
+
/******/ var __webpack_modules__ = ({
|
|
89
4
|
|
|
90
5
|
/***/ "./src/index.ts":
|
|
91
6
|
/*!**********************!*\
|
|
92
7
|
!*** ./src/index.ts ***!
|
|
93
8
|
\**********************/
|
|
94
|
-
|
|
95
|
-
/***/ (function(module, exports, __webpack_require__) {
|
|
9
|
+
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
|
96
10
|
|
|
97
|
-
"use strict";
|
|
98
11
|
|
|
99
12
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
100
13
|
if (k2 === undefined) k2 = k;
|
|
101
|
-
Object.
|
|
14
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
15
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
16
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
17
|
+
}
|
|
18
|
+
Object.defineProperty(o, k2, desc);
|
|
102
19
|
}) : (function(o, m, k, k2) {
|
|
103
20
|
if (k2 === undefined) k2 = k;
|
|
104
21
|
o[k2] = m[k];
|
|
@@ -109,10 +26,10 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
109
26
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
110
27
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
111
28
|
};
|
|
112
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
113
30
|
const module_1 = __importDefault(__webpack_require__(/*! ./module */ "./src/module.ts"));
|
|
114
31
|
const client_react_1 = __webpack_require__(/*! @common-stack/client-react */ "@common-stack/client-react");
|
|
115
|
-
exports
|
|
32
|
+
exports["default"] = new client_react_1.Feature(module_1.default);
|
|
116
33
|
__exportStar(__webpack_require__(/*! ./navigation */ "./src/navigation/index.ts"), exports);
|
|
117
34
|
__exportStar(__webpack_require__(/*! ./screens */ "./src/screens/index.ts"), exports);
|
|
118
35
|
|
|
@@ -123,16 +40,14 @@ __exportStar(__webpack_require__(/*! ./screens */ "./src/screens/index.ts"), exp
|
|
|
123
40
|
/*!***********************!*\
|
|
124
41
|
!*** ./src/module.ts ***!
|
|
125
42
|
\***********************/
|
|
126
|
-
|
|
127
|
-
/***/ (function(module, exports, __webpack_require__) {
|
|
43
|
+
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
128
44
|
|
|
129
|
-
"use strict";
|
|
130
45
|
|
|
131
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
46
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
132
47
|
/* eslint-disable import/no-extraneous-dependencies */
|
|
133
48
|
const client_react_1 = __webpack_require__(/*! @common-stack/client-react */ "@common-stack/client-react");
|
|
134
49
|
const platform_client_1 = __webpack_require__(/*! @messenger-box/platform-client */ "@messenger-box/platform-client");
|
|
135
|
-
exports
|
|
50
|
+
exports["default"] = new client_react_1.Feature({
|
|
136
51
|
dataIdFromObject: platform_client_1.dataIdFromObject,
|
|
137
52
|
clientStateParams: { typeDefs: platform_client_1.schema, typePolicies: platform_client_1.typePolicies },
|
|
138
53
|
});
|
|
@@ -144,14 +59,16 @@ exports.default = new client_react_1.Feature({
|
|
|
144
59
|
/*!********************************************!*\
|
|
145
60
|
!*** ./src/navigation/InboxNavigation.tsx ***!
|
|
146
61
|
\********************************************/
|
|
147
|
-
|
|
148
|
-
/***/ (function(module, exports, __webpack_require__) {
|
|
62
|
+
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
|
149
63
|
|
|
150
|
-
"use strict";
|
|
151
64
|
|
|
152
65
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
153
66
|
if (k2 === undefined) k2 = k;
|
|
154
|
-
Object.
|
|
67
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
68
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
69
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
70
|
+
}
|
|
71
|
+
Object.defineProperty(o, k2, desc);
|
|
155
72
|
}) : (function(o, m, k, k2) {
|
|
156
73
|
if (k2 === undefined) k2 = k;
|
|
157
74
|
o[k2] = m[k];
|
|
@@ -168,12 +85,12 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
168
85
|
__setModuleDefault(result, mod);
|
|
169
86
|
return result;
|
|
170
87
|
};
|
|
171
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
88
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
172
89
|
exports.InboxNavigation = void 0;
|
|
173
90
|
const React = __importStar(__webpack_require__(/*! react */ "react"));
|
|
174
91
|
const stack_1 = __webpack_require__(/*! @react-navigation/stack */ "@react-navigation/stack");
|
|
175
92
|
const DialogMessages_1 = __webpack_require__(/*! ../screens/inbox/DialogMessages */ "./src/screens/inbox/DialogMessages.tsx");
|
|
176
|
-
const InboxStack = stack_1.createStackNavigator();
|
|
93
|
+
const InboxStack = (0, stack_1.createStackNavigator)();
|
|
177
94
|
function InboxNavigation({ route }) {
|
|
178
95
|
return (React.createElement(InboxStack.Navigator, { initialRouteName: "DialogMessages" },
|
|
179
96
|
React.createElement(InboxStack.Screen, { name: "DialogMessages", options: { header: () => null } }, (props) => { var _a; return React.createElement(DialogMessages_1.DialogMessages, { channelId: (_a = route === null || route === void 0 ? void 0 : route.params) === null || _a === void 0 ? void 0 : _a.channelId }); })));
|
|
@@ -187,14 +104,16 @@ exports.InboxNavigation = InboxNavigation;
|
|
|
187
104
|
/*!*********************************!*\
|
|
188
105
|
!*** ./src/navigation/index.ts ***!
|
|
189
106
|
\*********************************/
|
|
190
|
-
|
|
191
|
-
/***/ (function(module, exports, __webpack_require__) {
|
|
107
|
+
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
|
192
108
|
|
|
193
|
-
"use strict";
|
|
194
109
|
|
|
195
110
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
196
111
|
if (k2 === undefined) k2 = k;
|
|
197
|
-
Object.
|
|
112
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
113
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
114
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
115
|
+
}
|
|
116
|
+
Object.defineProperty(o, k2, desc);
|
|
198
117
|
}) : (function(o, m, k, k2) {
|
|
199
118
|
if (k2 === undefined) k2 = k;
|
|
200
119
|
o[k2] = m[k];
|
|
@@ -202,7 +121,7 @@ var __createBinding = (this && this.__createBinding) || (Object.create ? (functi
|
|
|
202
121
|
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
203
122
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
204
123
|
};
|
|
205
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
124
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
206
125
|
__exportStar(__webpack_require__(/*! ./InboxNavigation */ "./src/navigation/InboxNavigation.tsx"), exports);
|
|
207
126
|
|
|
208
127
|
|
|
@@ -212,14 +131,16 @@ __exportStar(__webpack_require__(/*! ./InboxNavigation */ "./src/navigation/Inbo
|
|
|
212
131
|
/*!**********************************************!*\
|
|
213
132
|
!*** ./src/screens/inbox/DialogMessages.tsx ***!
|
|
214
133
|
\**********************************************/
|
|
215
|
-
|
|
216
|
-
/***/ (function(module, exports, __webpack_require__) {
|
|
134
|
+
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
|
217
135
|
|
|
218
|
-
"use strict";
|
|
219
136
|
|
|
220
137
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
221
138
|
if (k2 === undefined) k2 = k;
|
|
222
|
-
Object.
|
|
139
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
140
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
141
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
142
|
+
}
|
|
143
|
+
Object.defineProperty(o, k2, desc);
|
|
223
144
|
}) : (function(o, m, k, k2) {
|
|
224
145
|
if (k2 === undefined) k2 = k;
|
|
225
146
|
o[k2] = m[k];
|
|
@@ -236,7 +157,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
236
157
|
__setModuleDefault(result, mod);
|
|
237
158
|
return result;
|
|
238
159
|
};
|
|
239
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
160
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
240
161
|
exports.DialogMessages = void 0;
|
|
241
162
|
const React = __importStar(__webpack_require__(/*! react */ "react"));
|
|
242
163
|
const native_base_1 = __webpack_require__(/*! native-base */ "native-base");
|
|
@@ -254,14 +175,16 @@ exports.DialogMessages = DialogMessages;
|
|
|
254
175
|
/*!*************************************!*\
|
|
255
176
|
!*** ./src/screens/inbox/Inbox.tsx ***!
|
|
256
177
|
\*************************************/
|
|
257
|
-
|
|
258
|
-
/***/ (function(module, exports, __webpack_require__) {
|
|
178
|
+
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
|
259
179
|
|
|
260
|
-
"use strict";
|
|
261
180
|
|
|
262
181
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
263
182
|
if (k2 === undefined) k2 = k;
|
|
264
|
-
Object.
|
|
183
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
184
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
185
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
186
|
+
}
|
|
187
|
+
Object.defineProperty(o, k2, desc);
|
|
265
188
|
}) : (function(o, m, k, k2) {
|
|
266
189
|
if (k2 === undefined) k2 = k;
|
|
267
190
|
o[k2] = m[k];
|
|
@@ -278,7 +201,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
278
201
|
__setModuleDefault(result, mod);
|
|
279
202
|
return result;
|
|
280
203
|
};
|
|
281
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
204
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
282
205
|
exports.Inbox = void 0;
|
|
283
206
|
const React = __importStar(__webpack_require__(/*! react */ "react"));
|
|
284
207
|
const native_base_1 = __webpack_require__(/*! native-base */ "native-base");
|
|
@@ -297,14 +220,16 @@ exports.Inbox = Inbox;
|
|
|
297
220
|
/*!********************************************************!*\
|
|
298
221
|
!*** ./src/screens/inbox/components/CommonMessage.tsx ***!
|
|
299
222
|
\********************************************************/
|
|
300
|
-
|
|
301
|
-
/***/ (function(module, exports, __webpack_require__) {
|
|
223
|
+
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
|
302
224
|
|
|
303
|
-
"use strict";
|
|
304
225
|
|
|
305
226
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
306
227
|
if (k2 === undefined) k2 = k;
|
|
307
|
-
Object.
|
|
228
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
229
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
230
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
231
|
+
}
|
|
232
|
+
Object.defineProperty(o, k2, desc);
|
|
308
233
|
}) : (function(o, m, k, k2) {
|
|
309
234
|
if (k2 === undefined) k2 = k;
|
|
310
235
|
o[k2] = m[k];
|
|
@@ -321,7 +246,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
321
246
|
__setModuleDefault(result, mod);
|
|
322
247
|
return result;
|
|
323
248
|
};
|
|
324
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
249
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
325
250
|
exports.CommonMessage = void 0;
|
|
326
251
|
const React = __importStar(__webpack_require__(/*! react */ "react"));
|
|
327
252
|
const native_base_1 = __webpack_require__(/*! native-base */ "native-base");
|
|
@@ -334,14 +259,14 @@ const CommonMessage = (props) => {
|
|
|
334
259
|
const { message, currentUser } = props;
|
|
335
260
|
return (React.createElement(native_base_1.Box, { mb: "7" },
|
|
336
261
|
React.createElement(native_base_1.HStack, { space: 2 },
|
|
337
|
-
React.createElement(native_base_1.Avatar, { backgroundColor: "grey", source: { uri: ((_a = message === null || message === void 0 ? void 0 : message.author) === null || _a === void 0 ? void 0 : _a.picture) || undefined } }, lodash_1.startCase((_c = (_b = message === null || message === void 0 ? void 0 : message.author) === null || _b === void 0 ? void 0 : _b.username) === null || _c === void 0 ? void 0 : _c.charAt(0))),
|
|
262
|
+
React.createElement(native_base_1.Avatar, { backgroundColor: "grey", source: { uri: ((_a = message === null || message === void 0 ? void 0 : message.author) === null || _a === void 0 ? void 0 : _a.picture) || undefined } }, (0, lodash_1.startCase)((_c = (_b = message === null || message === void 0 ? void 0 : message.author) === null || _b === void 0 ? void 0 : _b.username) === null || _c === void 0 ? void 0 : _c.charAt(0))),
|
|
338
263
|
React.createElement(native_base_1.Box, null,
|
|
339
264
|
React.createElement(native_base_1.HStack, { width: '80%', justifyContent: 'space-between', alignItems: 'center' },
|
|
340
265
|
React.createElement(native_base_1.HStack, { space: 2 },
|
|
341
266
|
React.createElement(native_base_1.Text, { fontSize: "14px", color: "gray.600", fontWeight: 'bold' }, ((_d = message === null || message === void 0 ? void 0 : message.author) === null || _d === void 0 ? void 0 : _d.familyName) && ((_e = message === null || message === void 0 ? void 0 : message.author) === null || _e === void 0 ? void 0 : _e.givenName)
|
|
342
267
|
? ((_f = message === null || message === void 0 ? void 0 : message.author) === null || _f === void 0 ? void 0 : _f.givenName) + ' ' + ((_g = message === null || message === void 0 ? void 0 : message.author) === null || _g === void 0 ? void 0 : _g.familyName)
|
|
343
268
|
: (_h = message === null || message === void 0 ? void 0 : message.author) === null || _h === void 0 ? void 0 : _h.username),
|
|
344
|
-
React.createElement(native_base_1.Text, { fontSize: "14px", color: "gray.500", ml: "10px" }, date_fns_1.formatDistance(new Date(message === null || message === void 0 ? void 0 : message.createdAt), new Date(), {
|
|
269
|
+
React.createElement(native_base_1.Text, { fontSize: "14px", color: "gray.500", ml: "10px" }, (0, date_fns_1.formatDistance)(new Date(message === null || message === void 0 ? void 0 : message.createdAt), new Date(), {
|
|
345
270
|
includeSeconds: true,
|
|
346
271
|
addSuffix: true,
|
|
347
272
|
}))),
|
|
@@ -359,14 +284,16 @@ exports.CommonMessage = CommonMessage;
|
|
|
359
284
|
/*!**********************************************************!*\
|
|
360
285
|
!*** ./src/screens/inbox/components/DialogsListItem.tsx ***!
|
|
361
286
|
\**********************************************************/
|
|
362
|
-
|
|
363
|
-
/***/ (function(module, exports, __webpack_require__) {
|
|
287
|
+
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
|
364
288
|
|
|
365
|
-
"use strict";
|
|
366
289
|
|
|
367
290
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
368
291
|
if (k2 === undefined) k2 = k;
|
|
369
|
-
Object.
|
|
292
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
293
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
294
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
295
|
+
}
|
|
296
|
+
Object.defineProperty(o, k2, desc);
|
|
370
297
|
}) : (function(o, m, k, k2) {
|
|
371
298
|
if (k2 === undefined) k2 = k;
|
|
372
299
|
o[k2] = m[k];
|
|
@@ -383,7 +310,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
383
310
|
__setModuleDefault(result, mod);
|
|
384
311
|
return result;
|
|
385
312
|
};
|
|
386
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
313
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
387
314
|
exports.DialogsListItem = void 0;
|
|
388
315
|
const react_1 = __importStar(__webpack_require__(/*! react */ "react"));
|
|
389
316
|
const native_base_1 = __webpack_require__(/*! native-base */ "native-base");
|
|
@@ -393,11 +320,11 @@ const createdAtText = (value) => {
|
|
|
393
320
|
if (!value)
|
|
394
321
|
return '';
|
|
395
322
|
let date = new Date(value);
|
|
396
|
-
if (date_fns_1.isToday(date))
|
|
323
|
+
if ((0, date_fns_1.isToday)(date))
|
|
397
324
|
return 'Today';
|
|
398
|
-
if (date_fns_1.isYesterday(date))
|
|
325
|
+
if ((0, date_fns_1.isYesterday)(date))
|
|
399
326
|
return 'Yesterday';
|
|
400
|
-
return date_fns_1.format(new Date(value), 'MMM dd, yyyy');
|
|
327
|
+
return (0, date_fns_1.format)(new Date(value), 'MMM dd, yyyy');
|
|
401
328
|
};
|
|
402
329
|
/**
|
|
403
330
|
* TODO:
|
|
@@ -406,14 +333,14 @@ const createdAtText = (value) => {
|
|
|
406
333
|
*/
|
|
407
334
|
const DialogsListItem = function DialogsListItem({ currentUser, users, selectedChannelId, channel, onOpen, }) {
|
|
408
335
|
var _a, _b;
|
|
409
|
-
const { data: messagesQuery, loading: messageLoading } = platform_client_1.useMessagesQuery({
|
|
336
|
+
const { data: messagesQuery, loading: messageLoading } = (0, platform_client_1.useMessagesQuery)({
|
|
410
337
|
variables: {
|
|
411
338
|
channelId: (_a = channel === null || channel === void 0 ? void 0 : channel.id) === null || _a === void 0 ? void 0 : _a.toString(),
|
|
412
339
|
limit: 1,
|
|
413
340
|
},
|
|
414
341
|
fetchPolicy: 'cache-and-network',
|
|
415
342
|
});
|
|
416
|
-
const chatUser = react_1.useMemo(() => users === null || users === void 0 ? void 0 : users.find(({ id }) => {
|
|
343
|
+
const chatUser = (0, react_1.useMemo)(() => users === null || users === void 0 ? void 0 : users.find(({ id }) => {
|
|
417
344
|
var _a;
|
|
418
345
|
const isNotCurrentUser = id !== (currentUser === null || currentUser === void 0 ? void 0 : currentUser.id);
|
|
419
346
|
if (isNotCurrentUser) {
|
|
@@ -421,13 +348,13 @@ const DialogsListItem = function DialogsListItem({ currentUser, users, selectedC
|
|
|
421
348
|
}
|
|
422
349
|
return isNotCurrentUser;
|
|
423
350
|
}), [users, currentUser, channel]);
|
|
424
|
-
const { data: userQuery } = platform_client_1.useUserAccountQuery({
|
|
351
|
+
const { data: userQuery } = (0, platform_client_1.useUserAccountQuery)({
|
|
425
352
|
variables: {
|
|
426
353
|
userId: chatUser === null || chatUser === void 0 ? void 0 : chatUser.id,
|
|
427
354
|
},
|
|
428
355
|
skip: !(chatUser === null || chatUser === void 0 ? void 0 : chatUser.id),
|
|
429
356
|
});
|
|
430
|
-
const lastMessage = react_1.useMemo(() => {
|
|
357
|
+
const lastMessage = (0, react_1.useMemo)(() => {
|
|
431
358
|
var _a, _b;
|
|
432
359
|
if (!((_b = (_a = messagesQuery === null || messagesQuery === void 0 ? void 0 : messagesQuery.messages) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b.length)) {
|
|
433
360
|
return null;
|
|
@@ -435,7 +362,7 @@ const DialogsListItem = function DialogsListItem({ currentUser, users, selectedC
|
|
|
435
362
|
const { data } = messagesQuery.messages;
|
|
436
363
|
return data[data.length - 1];
|
|
437
364
|
}, [messagesQuery]);
|
|
438
|
-
const channelType = react_1.useMemo(() => {
|
|
365
|
+
const channelType = (0, react_1.useMemo)(() => {
|
|
439
366
|
return channel === null || channel === void 0 ? void 0 : channel.type;
|
|
440
367
|
}, [channel]);
|
|
441
368
|
return (react_1.default.createElement(native_base_1.Pressable, { onPress: () => (channel === null || channel === void 0 ? void 0 : channel.id) !== selectedChannelId && onOpen(channel === null || channel === void 0 ? void 0 : channel.id), borderWidth: '1', borderRadius: 10, borderColor: 'gray.200', shadow: '6' },
|
|
@@ -457,14 +384,16 @@ exports.DialogsListItem = DialogsListItem;
|
|
|
457
384
|
/*!****************************************************!*\
|
|
458
385
|
!*** ./src/screens/inbox/components/FilesList.tsx ***!
|
|
459
386
|
\****************************************************/
|
|
460
|
-
|
|
461
|
-
/***/ (function(module, exports, __webpack_require__) {
|
|
387
|
+
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
|
462
388
|
|
|
463
|
-
"use strict";
|
|
464
389
|
|
|
465
390
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
466
391
|
if (k2 === undefined) k2 = k;
|
|
467
|
-
Object.
|
|
392
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
393
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
394
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
395
|
+
}
|
|
396
|
+
Object.defineProperty(o, k2, desc);
|
|
468
397
|
}) : (function(o, m, k, k2) {
|
|
469
398
|
if (k2 === undefined) k2 = k;
|
|
470
399
|
o[k2] = m[k];
|
|
@@ -481,7 +410,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
481
410
|
__setModuleDefault(result, mod);
|
|
482
411
|
return result;
|
|
483
412
|
};
|
|
484
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
413
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
485
414
|
exports.FilesList = void 0;
|
|
486
415
|
const react_1 = __importStar(__webpack_require__(/*! react */ "react"));
|
|
487
416
|
const native_base_1 = __webpack_require__(/*! native-base */ "native-base");
|
|
@@ -495,7 +424,7 @@ FilesList.FilesView = function MessageItemFiles({ files = [], uploaded }) {
|
|
|
495
424
|
return null;
|
|
496
425
|
}
|
|
497
426
|
return (react_1.default.createElement(native_base_1.Box, null, files.map((file) => {
|
|
498
|
-
const url = react_1.useMemo(() => (uploaded ? file.url : URL.createObjectURL(file)), [file, uploaded]);
|
|
427
|
+
const url = (0, react_1.useMemo)(() => (uploaded ? file.url : URL.createObjectURL(file)), [file, uploaded]);
|
|
499
428
|
return (react_1.default.createElement(native_base_1.Image, { alt: 'image', mr: 2, height: "16", width: "16", source: {
|
|
500
429
|
uri: url,
|
|
501
430
|
scale: 0.2,
|
|
@@ -510,14 +439,16 @@ FilesList.FilesView = function MessageItemFiles({ files = [], uploaded }) {
|
|
|
510
439
|
/*!*******************************************************!*\
|
|
511
440
|
!*** ./src/screens/inbox/components/MessageInput.tsx ***!
|
|
512
441
|
\*******************************************************/
|
|
513
|
-
|
|
514
|
-
/***/ (function(module, exports, __webpack_require__) {
|
|
442
|
+
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
|
515
443
|
|
|
516
|
-
"use strict";
|
|
517
444
|
|
|
518
445
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
519
446
|
if (k2 === undefined) k2 = k;
|
|
520
|
-
Object.
|
|
447
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
448
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
449
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
450
|
+
}
|
|
451
|
+
Object.defineProperty(o, k2, desc);
|
|
521
452
|
}) : (function(o, m, k, k2) {
|
|
522
453
|
if (k2 === undefined) k2 = k;
|
|
523
454
|
o[k2] = m[k];
|
|
@@ -534,18 +465,18 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
534
465
|
__setModuleDefault(result, mod);
|
|
535
466
|
return result;
|
|
536
467
|
};
|
|
537
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
468
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
538
469
|
exports.MessageInput = void 0;
|
|
539
470
|
const native_base_1 = __webpack_require__(/*! native-base */ "native-base");
|
|
540
471
|
const vector_icons_1 = __webpack_require__(/*! @expo/vector-icons */ "@expo/vector-icons");
|
|
541
472
|
const ImagePicker = __importStar(__webpack_require__(/*! expo-image-picker */ "expo-image-picker"));
|
|
542
473
|
const react_1 = __importStar(__webpack_require__(/*! react */ "react"));
|
|
543
474
|
const FilesList_1 = __webpack_require__(/*! ./FilesList */ "./src/screens/inbox/components/FilesList.tsx");
|
|
544
|
-
exports.MessageInput = react_1.forwardRef(function MessageInput({ handleSend: handleSendProp }) {
|
|
545
|
-
const [message, setMessage] = react_1.useState('');
|
|
546
|
-
const [sending, setSending] = react_1.useState(false);
|
|
547
|
-
const [files, setFiles] = react_1.useState([]);
|
|
548
|
-
const handleSend = react_1.useCallback(() => {
|
|
475
|
+
exports.MessageInput = (0, react_1.forwardRef)(function MessageInput({ handleSend: handleSendProp }) {
|
|
476
|
+
const [message, setMessage] = (0, react_1.useState)('');
|
|
477
|
+
const [sending, setSending] = (0, react_1.useState)(false);
|
|
478
|
+
const [files, setFiles] = (0, react_1.useState)([]);
|
|
479
|
+
const handleSend = (0, react_1.useCallback)(() => {
|
|
549
480
|
setSending(true);
|
|
550
481
|
handleSendProp(message, files)
|
|
551
482
|
.then(() => {
|
|
@@ -583,32 +514,28 @@ exports.MessageInput = react_1.forwardRef(function MessageInput({ handleSend: ha
|
|
|
583
514
|
/*!******************************************************!*\
|
|
584
515
|
!*** ./src/screens/inbox/components/MessageItem.tsx ***!
|
|
585
516
|
\******************************************************/
|
|
586
|
-
|
|
587
|
-
/***/ (function(module, exports, __webpack_require__) {
|
|
517
|
+
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
|
588
518
|
|
|
589
|
-
"use strict";
|
|
590
519
|
|
|
591
520
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
592
521
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
593
522
|
};
|
|
594
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
523
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
595
524
|
exports.MessageItem = void 0;
|
|
596
525
|
const react_1 = __importDefault(__webpack_require__(/*! react */ "react"));
|
|
597
526
|
const native_base_1 = __webpack_require__(/*! native-base */ "native-base");
|
|
598
|
-
const platform_client_1 = __webpack_require__(/*! @messenger-box/platform-client */ "@messenger-box/platform-client");
|
|
599
527
|
const PlainMessage_1 = __webpack_require__(/*! ./PlainMessage */ "./src/screens/inbox/components/PlainMessage.tsx");
|
|
600
528
|
const CommonMessage_1 = __webpack_require__(/*! ./CommonMessage */ "./src/screens/inbox/components/CommonMessage.tsx");
|
|
601
529
|
const components_pro_1 = __webpack_require__(/*! @common-stack/components-pro */ "@common-stack/components-pro");
|
|
602
530
|
function MessageItem({ message, channelId, currentUser, totalCount, }) {
|
|
603
|
-
var _a;
|
|
604
531
|
if (typeof message === 'string') {
|
|
605
532
|
return react_1.default.createElement(PlainMessage_1.PlainMessage, { message: message });
|
|
606
533
|
}
|
|
607
534
|
const { type } = message;
|
|
608
|
-
if (!type || type ===
|
|
535
|
+
if (!type || type === "Simple" /* IPostTypeEnum.Simple */) {
|
|
609
536
|
return react_1.default.createElement(CommonMessage_1.CommonMessage, { message: message, currentUser: currentUser });
|
|
610
537
|
}
|
|
611
|
-
return (react_1.default.createElement(components_pro_1.Slot, { name:
|
|
538
|
+
return (react_1.default.createElement(components_pro_1.Slot, { name: type === null || type === void 0 ? void 0 : type.toLowerCase(), fillProps: {
|
|
612
539
|
active: true,
|
|
613
540
|
message,
|
|
614
541
|
currentUser,
|
|
@@ -623,15 +550,13 @@ exports.MessageItem = MessageItem;
|
|
|
623
550
|
/*!*******************************************************!*\
|
|
624
551
|
!*** ./src/screens/inbox/components/PlainMessage.tsx ***!
|
|
625
552
|
\*******************************************************/
|
|
626
|
-
|
|
627
|
-
/***/ (function(module, exports, __webpack_require__) {
|
|
553
|
+
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
|
628
554
|
|
|
629
|
-
"use strict";
|
|
630
555
|
|
|
631
556
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
632
557
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
633
558
|
};
|
|
634
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
559
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
635
560
|
exports.PlainMessage = void 0;
|
|
636
561
|
const react_1 = __importDefault(__webpack_require__(/*! react */ "react"));
|
|
637
562
|
const native_base_1 = __webpack_require__(/*! native-base */ "native-base");
|
|
@@ -648,17 +573,15 @@ exports.PlainMessage = PlainMessage;
|
|
|
648
573
|
/*!********************************************!*\
|
|
649
574
|
!*** ./src/screens/inbox/config/config.ts ***!
|
|
650
575
|
\********************************************/
|
|
651
|
-
|
|
652
|
-
/***/ (function(module, exports, __webpack_require__) {
|
|
576
|
+
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
653
577
|
|
|
654
|
-
"use strict";
|
|
655
578
|
|
|
656
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
579
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
657
580
|
exports.config = void 0;
|
|
658
581
|
const envalid_1 = __webpack_require__(/*! envalid */ "envalid");
|
|
659
|
-
exports.config = envalid_1.cleanEnv(process.env, {
|
|
660
|
-
MESSAGES_PER_PAGE: envalid_1.num({ devDefault: 20, default: 50 }),
|
|
661
|
-
FILES_PER_MESSAGE: envalid_1.num({ default: 10 }),
|
|
582
|
+
exports.config = (0, envalid_1.cleanEnv)(process.env, {
|
|
583
|
+
MESSAGES_PER_PAGE: (0, envalid_1.num)({ devDefault: 20, default: 50 }),
|
|
584
|
+
FILES_PER_MESSAGE: (0, envalid_1.num)({ default: 10 }),
|
|
662
585
|
});
|
|
663
586
|
|
|
664
587
|
|
|
@@ -668,15 +591,13 @@ exports.config = envalid_1.cleanEnv(process.env, {
|
|
|
668
591
|
/*!*******************************************!*\
|
|
669
592
|
!*** ./src/screens/inbox/config/index.ts ***!
|
|
670
593
|
\*******************************************/
|
|
671
|
-
|
|
672
|
-
/***/ (function(module, exports, __webpack_require__) {
|
|
594
|
+
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
673
595
|
|
|
674
|
-
"use strict";
|
|
675
596
|
|
|
676
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
597
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
677
598
|
exports.config = void 0;
|
|
678
599
|
var config_1 = __webpack_require__(/*! ./config */ "./src/screens/inbox/config/config.ts");
|
|
679
|
-
Object.defineProperty(exports, "config", { enumerable: true, get: function () { return config_1.config; } });
|
|
600
|
+
Object.defineProperty(exports, "config", ({ enumerable: true, get: function () { return config_1.config; } }));
|
|
680
601
|
|
|
681
602
|
|
|
682
603
|
/***/ }),
|
|
@@ -685,14 +606,16 @@ Object.defineProperty(exports, "config", { enumerable: true, get: function () {
|
|
|
685
606
|
/*!***********************************************************!*\
|
|
686
607
|
!*** ./src/screens/inbox/containers/ConversationView.tsx ***!
|
|
687
608
|
\***********************************************************/
|
|
688
|
-
|
|
689
|
-
/***/ (function(module, exports, __webpack_require__) {
|
|
609
|
+
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
|
690
610
|
|
|
691
|
-
"use strict";
|
|
692
611
|
|
|
693
612
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
694
613
|
if (k2 === undefined) k2 = k;
|
|
695
|
-
Object.
|
|
614
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
615
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
616
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
617
|
+
}
|
|
618
|
+
Object.defineProperty(o, k2, desc);
|
|
696
619
|
}) : (function(o, m, k, k2) {
|
|
697
620
|
if (k2 === undefined) k2 = k;
|
|
698
621
|
o[k2] = m[k];
|
|
@@ -709,7 +632,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
709
632
|
__setModuleDefault(result, mod);
|
|
710
633
|
return result;
|
|
711
634
|
};
|
|
712
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
635
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
713
636
|
exports.ConversationView = void 0;
|
|
714
637
|
const react_1 = __importStar(__webpack_require__(/*! react */ "react"));
|
|
715
638
|
const date_fns_1 = __webpack_require__(/*! date-fns */ "date-fns");
|
|
@@ -723,15 +646,15 @@ const config_1 = __webpack_require__(/*! ../config */ "./src/screens/inbox/confi
|
|
|
723
646
|
const user_auth0_client_1 = __webpack_require__(/*! @adminide-stack/user-auth0-client */ "@adminide-stack/user-auth0-client");
|
|
724
647
|
const { MESSAGES_PER_PAGE } = config_1.config;
|
|
725
648
|
function ConversationView({ channelId }) {
|
|
726
|
-
const messageListRef = react_1.useRef(null);
|
|
727
|
-
const [channelToTop, setChannelToTop] = react_1.useState(0);
|
|
728
|
-
const [channelMessages, setChannelMessages] = react_1.useState([]);
|
|
729
|
-
const auth = react_redux_1.useSelector(user_auth0_client_1.userSelector);
|
|
730
|
-
const [totalCount, setTotalCount] = react_1.useState(0);
|
|
731
|
-
const [loadingOldMessages, setLoadingOldMessages] = react_1.useState(false);
|
|
732
|
-
const { startUpload } = platform_client_1.useUploadFiles();
|
|
733
|
-
const [sendMsg] = platform_client_1.useSendMessagesMutation();
|
|
734
|
-
const { data, loading: messageLoading, refetch, } = platform_client_1.useMessagesQuery({
|
|
649
|
+
const messageListRef = (0, react_1.useRef)(null);
|
|
650
|
+
const [channelToTop, setChannelToTop] = (0, react_1.useState)(0);
|
|
651
|
+
const [channelMessages, setChannelMessages] = (0, react_1.useState)([]);
|
|
652
|
+
const auth = (0, react_redux_1.useSelector)(user_auth0_client_1.userSelector);
|
|
653
|
+
const [totalCount, setTotalCount] = (0, react_1.useState)(0);
|
|
654
|
+
const [loadingOldMessages, setLoadingOldMessages] = (0, react_1.useState)(false);
|
|
655
|
+
const { startUpload } = (0, platform_client_1.useUploadFiles)();
|
|
656
|
+
const [sendMsg] = (0, platform_client_1.useSendMessagesMutation)();
|
|
657
|
+
const { data, loading: messageLoading, refetch, } = (0, platform_client_1.useMessagesQuery)({
|
|
735
658
|
variables: {
|
|
736
659
|
channelId: channelId === null || channelId === void 0 ? void 0 : channelId.toString(),
|
|
737
660
|
limit: MESSAGES_PER_PAGE,
|
|
@@ -740,9 +663,9 @@ function ConversationView({ channelId }) {
|
|
|
740
663
|
fetchPolicy: 'cache-and-network',
|
|
741
664
|
});
|
|
742
665
|
debugger;
|
|
743
|
-
const { data: users } = platform_client_1.useGetAllUsersQuery();
|
|
744
|
-
const currentUser = react_1.useMemo(() => { var _a; return (_a = users === null || users === void 0 ? void 0 : users.getUsers) === null || _a === void 0 ? void 0 : _a.find(({ alias }) => alias.includes(auth === null || auth === void 0 ? void 0 : auth.auth0UserId)); }, [users, auth]);
|
|
745
|
-
const { data: checkForMessages } = platform_client_1.useCheckForNewMessagesQuery({
|
|
666
|
+
const { data: users } = (0, platform_client_1.useGetAllUsersQuery)();
|
|
667
|
+
const currentUser = (0, react_1.useMemo)(() => { var _a; return (_a = users === null || users === void 0 ? void 0 : users.getUsers) === null || _a === void 0 ? void 0 : _a.find(({ alias }) => alias.includes(auth === null || auth === void 0 ? void 0 : auth.auth0UserId)); }, [users, auth]);
|
|
668
|
+
const { data: checkForMessages } = (0, platform_client_1.useCheckForNewMessagesQuery)({
|
|
746
669
|
variables: {
|
|
747
670
|
channelId: channelId === null || channelId === void 0 ? void 0 : channelId.toString(),
|
|
748
671
|
},
|
|
@@ -750,15 +673,15 @@ function ConversationView({ channelId }) {
|
|
|
750
673
|
fetchPolicy: 'network-only',
|
|
751
674
|
pollInterval: 5000,
|
|
752
675
|
});
|
|
753
|
-
react_1.useEffect(() => {
|
|
676
|
+
(0, react_1.useEffect)(() => {
|
|
754
677
|
var _a;
|
|
755
678
|
if (((_a = data === null || data === void 0 ? void 0 : data.messages) === null || _a === void 0 ? void 0 : _a.data) && (loadingOldMessages || channelMessages.length === 0)) {
|
|
756
679
|
const { data: messages, totalCount } = data.messages;
|
|
757
|
-
setChannelMessages((oldMessages) => lodash_1.uniqBy([...[...messages].reverse(), ...oldMessages], ({ id }) => id));
|
|
680
|
+
setChannelMessages((oldMessages) => (0, lodash_1.uniqBy)([...[...messages].reverse(), ...oldMessages], ({ id }) => id));
|
|
758
681
|
setTotalCount(totalCount);
|
|
759
682
|
}
|
|
760
683
|
}, [data, loadingOldMessages, channelMessages]);
|
|
761
|
-
react_1.useLayoutEffect(() => {
|
|
684
|
+
(0, react_1.useLayoutEffect)(() => {
|
|
762
685
|
var _a, _b;
|
|
763
686
|
if (((_a = checkForMessages === null || checkForMessages === void 0 ? void 0 : checkForMessages.messages) === null || _a === void 0 ? void 0 : _a.totalCount) > totalCount) {
|
|
764
687
|
const numberOfNewMessages = ((_b = checkForMessages === null || checkForMessages === void 0 ? void 0 : checkForMessages.messages) === null || _b === void 0 ? void 0 : _b.totalCount) - totalCount;
|
|
@@ -770,18 +693,18 @@ function ConversationView({ channelId }) {
|
|
|
770
693
|
}
|
|
771
694
|
const { data: messages, totalCount } = data.messages;
|
|
772
695
|
setTotalCount(totalCount);
|
|
773
|
-
setChannelMessages((oldMessages) => lodash_1.uniqBy([...oldMessages, ...messages], ({ id }) => id));
|
|
696
|
+
setChannelMessages((oldMessages) => (0, lodash_1.uniqBy)([...oldMessages, ...messages], ({ id }) => id));
|
|
774
697
|
});
|
|
775
698
|
}
|
|
776
699
|
}, [checkForMessages, totalCount, refetch]);
|
|
777
|
-
const onFetchOld = react_1.useCallback(() => {
|
|
700
|
+
const onFetchOld = (0, react_1.useCallback)(() => {
|
|
778
701
|
var _a;
|
|
779
702
|
if (((_a = data === null || data === void 0 ? void 0 : data.messages) === null || _a === void 0 ? void 0 : _a.totalCount) > channelMessages.length) {
|
|
780
703
|
setLoadingOldMessages(true);
|
|
781
704
|
refetch({ skip: channelMessages.length });
|
|
782
705
|
}
|
|
783
706
|
}, [data, channelMessages]);
|
|
784
|
-
const onMessagesScroll = react_1.useCallback((e) => {
|
|
707
|
+
const onMessagesScroll = (0, react_1.useCallback)((e) => {
|
|
785
708
|
if (messageListRef.current) {
|
|
786
709
|
const { scrollTop, scrollHeight, clientHeight } = messageListRef.current;
|
|
787
710
|
if (clientHeight - scrollTop > scrollHeight - 50 && !messageLoading) {
|
|
@@ -789,7 +712,7 @@ function ConversationView({ channelId }) {
|
|
|
789
712
|
}
|
|
790
713
|
}
|
|
791
714
|
}, [onFetchOld]);
|
|
792
|
-
const handleSend = react_1.useCallback(async (message, files) => {
|
|
715
|
+
const handleSend = (0, react_1.useCallback)(async (message, files) => {
|
|
793
716
|
var _a;
|
|
794
717
|
if (!(message && channelId)) {
|
|
795
718
|
return;
|
|
@@ -835,18 +758,18 @@ function ConversationView({ channelId }) {
|
|
|
835
758
|
}));
|
|
836
759
|
}
|
|
837
760
|
}, [setChannelMessages, currentUser, channelId]);
|
|
838
|
-
const messageList = react_1.useMemo(() => {
|
|
761
|
+
const messageList = (0, react_1.useMemo)(() => {
|
|
839
762
|
let currentDate = '';
|
|
840
763
|
let res = [];
|
|
841
|
-
lodash_1.orderBy(channelMessages, ['createdAt'], ['asc']).map((msg) => {
|
|
764
|
+
(0, lodash_1.orderBy)(channelMessages, ['createdAt'], ['asc']).map((msg) => {
|
|
842
765
|
const date = new Date(msg.createdAt);
|
|
843
766
|
let msgDate;
|
|
844
|
-
if (date_fns_1.isToday(date))
|
|
767
|
+
if ((0, date_fns_1.isToday)(date))
|
|
845
768
|
msgDate = 'Today';
|
|
846
|
-
else if (date_fns_1.isYesterday(date))
|
|
769
|
+
else if ((0, date_fns_1.isYesterday)(date))
|
|
847
770
|
msgDate = 'Yesterday';
|
|
848
771
|
else
|
|
849
|
-
msgDate = date_fns_1.format(new Date(msg.createdAt), 'eee, do MMMM');
|
|
772
|
+
msgDate = (0, date_fns_1.format)(new Date(msg.createdAt), 'eee, do MMMM');
|
|
850
773
|
if (msgDate !== currentDate) {
|
|
851
774
|
res.push(msgDate);
|
|
852
775
|
currentDate = msgDate;
|
|
@@ -868,14 +791,16 @@ exports.ConversationView = ConversationView;
|
|
|
868
791
|
/*!**************************************************!*\
|
|
869
792
|
!*** ./src/screens/inbox/containers/Dialogs.tsx ***!
|
|
870
793
|
\**************************************************/
|
|
871
|
-
|
|
872
|
-
/***/ (function(module, exports, __webpack_require__) {
|
|
794
|
+
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
|
873
795
|
|
|
874
|
-
"use strict";
|
|
875
796
|
|
|
876
797
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
877
798
|
if (k2 === undefined) k2 = k;
|
|
878
|
-
Object.
|
|
799
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
800
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
801
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
802
|
+
}
|
|
803
|
+
Object.defineProperty(o, k2, desc);
|
|
879
804
|
}) : (function(o, m, k, k2) {
|
|
880
805
|
if (k2 === undefined) k2 = k;
|
|
881
806
|
o[k2] = m[k];
|
|
@@ -892,7 +817,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
892
817
|
__setModuleDefault(result, mod);
|
|
893
818
|
return result;
|
|
894
819
|
};
|
|
895
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
820
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
896
821
|
exports.Dialogs = void 0;
|
|
897
822
|
const react_1 = __importStar(__webpack_require__(/*! react */ "react"));
|
|
898
823
|
const native_base_1 = __webpack_require__(/*! native-base */ "native-base");
|
|
@@ -906,19 +831,19 @@ const client_1 = __webpack_require__(/*! @admin-layout/client */ "@admin-layout/
|
|
|
906
831
|
function Dialogs(props) {
|
|
907
832
|
var _a;
|
|
908
833
|
const { channelFilters, channelRole } = props;
|
|
909
|
-
const { params } = native_1.useRoute();
|
|
910
|
-
const auth = react_redux_1.useSelector(user_auth0_client_1.userSelector);
|
|
911
|
-
const dispatch = react_redux_1.useDispatch();
|
|
912
|
-
const navigation = native_1.useNavigation();
|
|
913
|
-
const { data: userChannels, loading: userChannelsLoading, refetch: getChannelsRefetch, } = platform_client_1.useGetChannelsByUserQuery({
|
|
834
|
+
const { params } = (0, native_1.useRoute)();
|
|
835
|
+
const auth = (0, react_redux_1.useSelector)(user_auth0_client_1.userSelector);
|
|
836
|
+
const dispatch = (0, react_redux_1.useDispatch)();
|
|
837
|
+
const navigation = (0, native_1.useNavigation)();
|
|
838
|
+
const { data: userChannels, loading: userChannelsLoading, refetch: getChannelsRefetch, } = (0, platform_client_1.useGetChannelsByUserQuery)({
|
|
914
839
|
variables: {
|
|
915
840
|
role: channelRole,
|
|
916
841
|
criteria: channelFilters,
|
|
917
842
|
},
|
|
918
843
|
});
|
|
919
|
-
const { data: users } = platform_client_1.useGetAllUsersQuery();
|
|
920
|
-
const currentUser = react_1.useMemo(() => { var _a; return (_a = users === null || users === void 0 ? void 0 : users.getUsers) === null || _a === void 0 ? void 0 : _a.find(({ alias }) => alias.includes(auth === null || auth === void 0 ? void 0 : auth.auth0UserId)); }, [users, auth]);
|
|
921
|
-
react_1.useEffect(() => {
|
|
844
|
+
const { data: users } = (0, platform_client_1.useGetAllUsersQuery)();
|
|
845
|
+
const currentUser = (0, react_1.useMemo)(() => { var _a; return (_a = users === null || users === void 0 ? void 0 : users.getUsers) === null || _a === void 0 ? void 0 : _a.find(({ alias }) => alias.includes(auth === null || auth === void 0 ? void 0 : auth.auth0UserId)); }, [users, auth]);
|
|
846
|
+
(0, react_1.useEffect)(() => {
|
|
922
847
|
setTimeout(() => {
|
|
923
848
|
dispatch({
|
|
924
849
|
type: client_1.CHANGE_SETTINGS_ACTION,
|
|
@@ -936,7 +861,7 @@ function Dialogs(props) {
|
|
|
936
861
|
});
|
|
937
862
|
};
|
|
938
863
|
}, []);
|
|
939
|
-
const handleSelectChannel = react_1.useCallback((id) => {
|
|
864
|
+
const handleSelectChannel = (0, react_1.useCallback)((id) => {
|
|
940
865
|
if (params === null || params === void 0 ? void 0 : params.channelId) {
|
|
941
866
|
navigation.navigate('Inbox.DialogMessages', { channelId: params === null || params === void 0 ? void 0 : params.channelId, hideTabBar: true });
|
|
942
867
|
}
|
|
@@ -961,14 +886,16 @@ exports.Dialogs = Dialogs;
|
|
|
961
886
|
/*!******************************!*\
|
|
962
887
|
!*** ./src/screens/index.ts ***!
|
|
963
888
|
\******************************/
|
|
964
|
-
|
|
965
|
-
/***/ (function(module, exports, __webpack_require__) {
|
|
889
|
+
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
|
966
890
|
|
|
967
|
-
"use strict";
|
|
968
891
|
|
|
969
892
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
970
893
|
if (k2 === undefined) k2 = k;
|
|
971
|
-
Object.
|
|
894
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
895
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
896
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
897
|
+
}
|
|
898
|
+
Object.defineProperty(o, k2, desc);
|
|
972
899
|
}) : (function(o, m, k, k2) {
|
|
973
900
|
if (k2 === undefined) k2 = k;
|
|
974
901
|
o[k2] = m[k];
|
|
@@ -976,7 +903,7 @@ var __createBinding = (this && this.__createBinding) || (Object.create ? (functi
|
|
|
976
903
|
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
977
904
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
978
905
|
};
|
|
979
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
906
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
980
907
|
__exportStar(__webpack_require__(/*! ./inbox/Inbox */ "./src/screens/inbox/Inbox.tsx"), exports);
|
|
981
908
|
|
|
982
909
|
|
|
@@ -986,8 +913,7 @@ __exportStar(__webpack_require__(/*! ./inbox/Inbox */ "./src/screens/inbox/Inbox
|
|
|
986
913
|
/*!***************************************!*\
|
|
987
914
|
!*** external "@admin-layout/client" ***!
|
|
988
915
|
\***************************************/
|
|
989
|
-
|
|
990
|
-
/***/ (function(module, exports) {
|
|
916
|
+
/***/ ((module) => {
|
|
991
917
|
|
|
992
918
|
module.exports = require("@admin-layout/client");
|
|
993
919
|
|
|
@@ -997,8 +923,7 @@ module.exports = require("@admin-layout/client");
|
|
|
997
923
|
/*!****************************************************!*\
|
|
998
924
|
!*** external "@adminide-stack/user-auth0-client" ***!
|
|
999
925
|
\****************************************************/
|
|
1000
|
-
|
|
1001
|
-
/***/ (function(module, exports) {
|
|
926
|
+
/***/ ((module) => {
|
|
1002
927
|
|
|
1003
928
|
module.exports = require("@adminide-stack/user-auth0-client");
|
|
1004
929
|
|
|
@@ -1008,8 +933,7 @@ module.exports = require("@adminide-stack/user-auth0-client");
|
|
|
1008
933
|
/*!*********************************************!*\
|
|
1009
934
|
!*** external "@common-stack/client-react" ***!
|
|
1010
935
|
\*********************************************/
|
|
1011
|
-
|
|
1012
|
-
/***/ (function(module, exports) {
|
|
936
|
+
/***/ ((module) => {
|
|
1013
937
|
|
|
1014
938
|
module.exports = require("@common-stack/client-react");
|
|
1015
939
|
|
|
@@ -1019,8 +943,7 @@ module.exports = require("@common-stack/client-react");
|
|
|
1019
943
|
/*!***********************************************!*\
|
|
1020
944
|
!*** external "@common-stack/components-pro" ***!
|
|
1021
945
|
\***********************************************/
|
|
1022
|
-
|
|
1023
|
-
/***/ (function(module, exports) {
|
|
946
|
+
/***/ ((module) => {
|
|
1024
947
|
|
|
1025
948
|
module.exports = require("@common-stack/components-pro");
|
|
1026
949
|
|
|
@@ -1030,8 +953,7 @@ module.exports = require("@common-stack/components-pro");
|
|
|
1030
953
|
/*!*************************************!*\
|
|
1031
954
|
!*** external "@expo/vector-icons" ***!
|
|
1032
955
|
\*************************************/
|
|
1033
|
-
|
|
1034
|
-
/***/ (function(module, exports) {
|
|
956
|
+
/***/ ((module) => {
|
|
1035
957
|
|
|
1036
958
|
module.exports = require("@expo/vector-icons");
|
|
1037
959
|
|
|
@@ -1041,8 +963,7 @@ module.exports = require("@expo/vector-icons");
|
|
|
1041
963
|
/*!*************************************************!*\
|
|
1042
964
|
!*** external "@messenger-box/platform-client" ***!
|
|
1043
965
|
\*************************************************/
|
|
1044
|
-
|
|
1045
|
-
/***/ (function(module, exports) {
|
|
966
|
+
/***/ ((module) => {
|
|
1046
967
|
|
|
1047
968
|
module.exports = require("@messenger-box/platform-client");
|
|
1048
969
|
|
|
@@ -1052,8 +973,7 @@ module.exports = require("@messenger-box/platform-client");
|
|
|
1052
973
|
/*!*******************************************!*\
|
|
1053
974
|
!*** external "@react-navigation/native" ***!
|
|
1054
975
|
\*******************************************/
|
|
1055
|
-
|
|
1056
|
-
/***/ (function(module, exports) {
|
|
976
|
+
/***/ ((module) => {
|
|
1057
977
|
|
|
1058
978
|
module.exports = require("@react-navigation/native");
|
|
1059
979
|
|
|
@@ -1063,8 +983,7 @@ module.exports = require("@react-navigation/native");
|
|
|
1063
983
|
/*!******************************************!*\
|
|
1064
984
|
!*** external "@react-navigation/stack" ***!
|
|
1065
985
|
\******************************************/
|
|
1066
|
-
|
|
1067
|
-
/***/ (function(module, exports) {
|
|
986
|
+
/***/ ((module) => {
|
|
1068
987
|
|
|
1069
988
|
module.exports = require("@react-navigation/stack");
|
|
1070
989
|
|
|
@@ -1074,8 +993,7 @@ module.exports = require("@react-navigation/stack");
|
|
|
1074
993
|
/*!***************************!*\
|
|
1075
994
|
!*** external "date-fns" ***!
|
|
1076
995
|
\***************************/
|
|
1077
|
-
|
|
1078
|
-
/***/ (function(module, exports) {
|
|
996
|
+
/***/ ((module) => {
|
|
1079
997
|
|
|
1080
998
|
module.exports = require("date-fns");
|
|
1081
999
|
|
|
@@ -1085,8 +1003,7 @@ module.exports = require("date-fns");
|
|
|
1085
1003
|
/*!**************************!*\
|
|
1086
1004
|
!*** external "envalid" ***!
|
|
1087
1005
|
\**************************/
|
|
1088
|
-
|
|
1089
|
-
/***/ (function(module, exports) {
|
|
1006
|
+
/***/ ((module) => {
|
|
1090
1007
|
|
|
1091
1008
|
module.exports = require("envalid");
|
|
1092
1009
|
|
|
@@ -1096,8 +1013,7 @@ module.exports = require("envalid");
|
|
|
1096
1013
|
/*!************************************!*\
|
|
1097
1014
|
!*** external "expo-image-picker" ***!
|
|
1098
1015
|
\************************************/
|
|
1099
|
-
|
|
1100
|
-
/***/ (function(module, exports) {
|
|
1016
|
+
/***/ ((module) => {
|
|
1101
1017
|
|
|
1102
1018
|
module.exports = require("expo-image-picker");
|
|
1103
1019
|
|
|
@@ -1107,8 +1023,7 @@ module.exports = require("expo-image-picker");
|
|
|
1107
1023
|
/*!*************************!*\
|
|
1108
1024
|
!*** external "lodash" ***!
|
|
1109
1025
|
\*************************/
|
|
1110
|
-
|
|
1111
|
-
/***/ (function(module, exports) {
|
|
1026
|
+
/***/ ((module) => {
|
|
1112
1027
|
|
|
1113
1028
|
module.exports = require("lodash");
|
|
1114
1029
|
|
|
@@ -1118,8 +1033,7 @@ module.exports = require("lodash");
|
|
|
1118
1033
|
/*!******************************!*\
|
|
1119
1034
|
!*** external "native-base" ***!
|
|
1120
1035
|
\******************************/
|
|
1121
|
-
|
|
1122
|
-
/***/ (function(module, exports) {
|
|
1036
|
+
/***/ ((module) => {
|
|
1123
1037
|
|
|
1124
1038
|
module.exports = require("native-base");
|
|
1125
1039
|
|
|
@@ -1129,8 +1043,7 @@ module.exports = require("native-base");
|
|
|
1129
1043
|
/*!************************!*\
|
|
1130
1044
|
!*** external "react" ***!
|
|
1131
1045
|
\************************/
|
|
1132
|
-
|
|
1133
|
-
/***/ (function(module, exports) {
|
|
1046
|
+
/***/ ((module) => {
|
|
1134
1047
|
|
|
1135
1048
|
module.exports = require("react");
|
|
1136
1049
|
|
|
@@ -1140,12 +1053,46 @@ module.exports = require("react");
|
|
|
1140
1053
|
/*!******************************!*\
|
|
1141
1054
|
!*** external "react-redux" ***!
|
|
1142
1055
|
\******************************/
|
|
1143
|
-
|
|
1144
|
-
/***/ (function(module, exports) {
|
|
1056
|
+
/***/ ((module) => {
|
|
1145
1057
|
|
|
1146
1058
|
module.exports = require("react-redux");
|
|
1147
1059
|
|
|
1148
1060
|
/***/ })
|
|
1149
1061
|
|
|
1150
|
-
/******/
|
|
1062
|
+
/******/ });
|
|
1063
|
+
/************************************************************************/
|
|
1064
|
+
/******/ // The module cache
|
|
1065
|
+
/******/ var __webpack_module_cache__ = {};
|
|
1066
|
+
/******/
|
|
1067
|
+
/******/ // The require function
|
|
1068
|
+
/******/ function __webpack_require__(moduleId) {
|
|
1069
|
+
/******/ // Check if module is in cache
|
|
1070
|
+
/******/ var cachedModule = __webpack_module_cache__[moduleId];
|
|
1071
|
+
/******/ if (cachedModule !== undefined) {
|
|
1072
|
+
/******/ return cachedModule.exports;
|
|
1073
|
+
/******/ }
|
|
1074
|
+
/******/ // Create a new module (and put it into the cache)
|
|
1075
|
+
/******/ var module = __webpack_module_cache__[moduleId] = {
|
|
1076
|
+
/******/ // no module.id needed
|
|
1077
|
+
/******/ // no module.loaded needed
|
|
1078
|
+
/******/ exports: {}
|
|
1079
|
+
/******/ };
|
|
1080
|
+
/******/
|
|
1081
|
+
/******/ // Execute the module function
|
|
1082
|
+
/******/ __webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);
|
|
1083
|
+
/******/
|
|
1084
|
+
/******/ // Return the exports of the module
|
|
1085
|
+
/******/ return module.exports;
|
|
1086
|
+
/******/ }
|
|
1087
|
+
/******/
|
|
1088
|
+
/************************************************************************/
|
|
1089
|
+
/******/
|
|
1090
|
+
/******/ // startup
|
|
1091
|
+
/******/ // Load entry module and return exports
|
|
1092
|
+
/******/ // This entry module is referenced by other modules so it can't be inlined
|
|
1093
|
+
/******/ var __webpack_exports__ = __webpack_require__("./src/index.ts");
|
|
1094
|
+
/******/ module.exports = __webpack_exports__;
|
|
1095
|
+
/******/
|
|
1096
|
+
/******/ })()
|
|
1097
|
+
;
|
|
1151
1098
|
//# sourceMappingURL=index.js.map
|