@messenger-box/platform-mobile 10.0.2-alpha.5 → 10.0.3-alpha.5
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/compute.js +14 -14
- package/lib/compute.js.map +1 -1
- package/lib/index.js.map +1 -1
- package/lib/module.js +1 -2
- package/lib/module.js.map +1 -1
- package/lib/screens/inbox/DialogMessages.js +44 -20
- package/lib/screens/inbox/DialogMessages.js.map +1 -1
- package/lib/screens/inbox/DialogThreadMessages.js +13 -48
- package/lib/screens/inbox/DialogThreadMessages.js.map +1 -1
- package/lib/screens/inbox/DialogThreads.js +13 -70
- package/lib/screens/inbox/DialogThreads.js.map +1 -1
- package/lib/screens/inbox/Inbox.js +18 -9
- package/lib/screens/inbox/Inbox.js.map +1 -1
- package/lib/screens/inbox/components/CachedImage/consts.js.map +1 -1
- package/lib/screens/inbox/components/CachedImage/index.js +41 -27
- package/lib/screens/inbox/components/CachedImage/index.js.map +1 -1
- package/lib/screens/inbox/components/DialogsListItem.js +96 -146
- package/lib/screens/inbox/components/DialogsListItem.js.map +1 -1
- package/lib/screens/inbox/components/ServiceDialogsListItem.js +95 -148
- package/lib/screens/inbox/components/ServiceDialogsListItem.js.map +1 -1
- package/lib/screens/inbox/components/SlackMessageContainer/ImageViewerModal.js +37 -51
- package/lib/screens/inbox/components/SlackMessageContainer/ImageViewerModal.js.map +1 -1
- package/lib/screens/inbox/components/SlackMessageContainer/SlackBubble.js +113 -97
- package/lib/screens/inbox/components/SlackMessageContainer/SlackBubble.js.map +1 -1
- package/lib/screens/inbox/components/SlackMessageContainer/SlackMessage.js +50 -42
- package/lib/screens/inbox/components/SlackMessageContainer/SlackMessage.js.map +1 -1
- package/lib/screens/inbox/components/ThreadsViewItem.js +41 -149
- package/lib/screens/inbox/components/ThreadsViewItem.js.map +1 -1
- package/lib/screens/inbox/config/config.js +8 -10
- package/lib/screens/inbox/config/config.js.map +1 -1
- package/lib/screens/inbox/containers/ConversationView.js +357 -501
- package/lib/screens/inbox/containers/ConversationView.js.map +1 -1
- package/lib/screens/inbox/containers/Dialogs.js +49 -140
- package/lib/screens/inbox/containers/Dialogs.js.map +1 -1
- package/lib/screens/inbox/containers/ThreadConversationView.js +297 -400
- package/lib/screens/inbox/containers/ThreadConversationView.js.map +1 -1
- package/lib/screens/inbox/containers/ThreadsView.js +83 -190
- package/lib/screens/inbox/containers/ThreadsView.js.map +1 -1
- package/package.json +4 -4
- package/rollup.config.mjs +5 -1
- package/lib/compute.d.ts +0 -5
- package/lib/index.d.ts +0 -4
- package/lib/module.d.ts +0 -3
- package/lib/navigation/InboxNavigation.d.ts +0 -2
- package/lib/navigation/index.d.ts +0 -1
- package/lib/screens/inbox/DialogMessages.d.ts +0 -8
- package/lib/screens/inbox/DialogThreadMessages.d.ts +0 -8
- package/lib/screens/inbox/DialogThreads.d.ts +0 -7
- package/lib/screens/inbox/Inbox.d.ts +0 -2
- package/lib/screens/inbox/components/CachedImage/consts.d.ts +0 -2
- package/lib/screens/inbox/components/CachedImage/index.d.ts +0 -8
- package/lib/screens/inbox/components/DialogsHeader.d.ts +0 -8
- package/lib/screens/inbox/components/DialogsListItem.d.ts +0 -19
- package/lib/screens/inbox/components/ServiceDialogsListItem.d.ts +0 -21
- package/lib/screens/inbox/components/SlackMessageContainer/ImageViewerModal.d.ts +0 -3
- package/lib/screens/inbox/components/SlackMessageContainer/SlackBubble.d.ts +0 -34
- package/lib/screens/inbox/components/SlackMessageContainer/SlackMessage.d.ts +0 -25
- package/lib/screens/inbox/components/SlackMessageContainer/index.d.ts +0 -3
- package/lib/screens/inbox/components/SupportServiceDialogsListItem.d.ts +0 -21
- package/lib/screens/inbox/components/ThreadsViewItem.d.ts +0 -20
- package/lib/screens/inbox/config/config.d.ts +0 -11
- package/lib/screens/inbox/config/index.d.ts +0 -1
- package/lib/screens/inbox/containers/ConversationView.d.ts +0 -11
- package/lib/screens/inbox/containers/Dialogs.d.ts +0 -7
- package/lib/screens/inbox/containers/SupportServiceDialogs.d.ts +0 -6
- package/lib/screens/inbox/containers/ThreadConversationView.d.ts +0 -11
- package/lib/screens/inbox/containers/ThreadsView.d.ts +0 -13
- package/lib/screens/index.d.ts +0 -4
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,14 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [10.0.3-alpha.5](https://github.com/CDEBase/messenger-box/compare/v10.0.3-alpha.4...v10.0.3-alpha.5) (2025-02-25)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @messenger-box/platform-mobile
|
|
9
|
+
|
|
10
|
+
## [10.0.3-alpha.0](https://github.com/cdmbase/messenger-box/compare/v10.0.2-alpha.6...v10.0.3-alpha.0) (2025-02-24)
|
|
11
|
+
|
|
12
|
+
**Note:** Version bump only for package @messenger-box/platform-mobile
|
|
13
|
+
|
|
6
14
|
## [10.0.2-alpha.5](https://github.com/CDEBase/messenger-box/compare/v10.0.2-alpha.4...v10.0.2-alpha.5) (2025-02-24)
|
|
7
15
|
|
|
8
16
|
**Note:** Version bump only for package @messenger-box/platform-mobile
|
package/lib/compute.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { getFilteredRoutes } from '@common-stack/client-react/lib/utils/filteredRoutes.js';
|
|
1
|
+
import { getFilteredRoutes } from '@common-stack/client-react/lib/utils/filteredRoutes.js';
|
|
2
2
|
const inboxPageStore = [{
|
|
3
|
-
key:
|
|
4
|
-
path:
|
|
5
|
-
name:
|
|
3
|
+
key: "message",
|
|
4
|
+
path: "/message",
|
|
5
|
+
name: "Message",
|
|
6
6
|
exact: true,
|
|
7
7
|
props: {
|
|
8
8
|
initialParams: {
|
|
@@ -12,7 +12,7 @@ const inboxPageStore = [{
|
|
|
12
12
|
},
|
|
13
13
|
options: {
|
|
14
14
|
headerShown: true,
|
|
15
|
-
title:
|
|
15
|
+
title: "Inbox",
|
|
16
16
|
headerBackTitleVisible: false,
|
|
17
17
|
gestureEnabled: false,
|
|
18
18
|
swipeEnabled: false
|
|
@@ -21,9 +21,9 @@ const inboxPageStore = [{
|
|
|
21
21
|
componentPath: "@messenger-box/platform-mobile/lib/screens/inbox/DialogMessages.js",
|
|
22
22
|
hasComponent: true
|
|
23
23
|
}, {
|
|
24
|
-
key:
|
|
25
|
-
path:
|
|
26
|
-
name:
|
|
24
|
+
key: "thread",
|
|
25
|
+
path: "/thread",
|
|
26
|
+
name: "Thread",
|
|
27
27
|
exact: true,
|
|
28
28
|
props: {
|
|
29
29
|
initialParams: {
|
|
@@ -33,7 +33,7 @@ const inboxPageStore = [{
|
|
|
33
33
|
},
|
|
34
34
|
options: {
|
|
35
35
|
headerShown: true,
|
|
36
|
-
title:
|
|
36
|
+
title: "Thread",
|
|
37
37
|
headerBackTitleVisible: false,
|
|
38
38
|
gestureEnabled: false,
|
|
39
39
|
swipeEnabled: false
|
|
@@ -46,9 +46,9 @@ const inboxPageStore = [{
|
|
|
46
46
|
ThreadMessagesDocument: "{channelId: params.channelId,role: params.role,limit: params.limit,repliesLimit2: 5}"
|
|
47
47
|
}
|
|
48
48
|
}, {
|
|
49
|
-
key:
|
|
50
|
-
path:
|
|
51
|
-
name:
|
|
49
|
+
key: "threadmessage",
|
|
50
|
+
path: "/threadmessage",
|
|
51
|
+
name: "ThreadMessage",
|
|
52
52
|
exact: true,
|
|
53
53
|
props: {
|
|
54
54
|
initialParams: {
|
|
@@ -59,7 +59,7 @@ const inboxPageStore = [{
|
|
|
59
59
|
},
|
|
60
60
|
options: {
|
|
61
61
|
headerShown: true,
|
|
62
|
-
title:
|
|
62
|
+
title: "Inbox",
|
|
63
63
|
headerBackTitleVisible: false,
|
|
64
64
|
gestureEnabled: false,
|
|
65
65
|
swipeEnabled: false
|
|
@@ -71,6 +71,6 @@ const inboxPageStore = [{
|
|
|
71
71
|
ViewChannelDetailDocument: "{id: params.id}"
|
|
72
72
|
}
|
|
73
73
|
}];
|
|
74
|
-
const selectedRoutes = [
|
|
74
|
+
const selectedRoutes = ["message", "thread", "threadmessage"];
|
|
75
75
|
const filteredRoutes = getFilteredRoutes(inboxPageStore, selectedRoutes);
|
|
76
76
|
export { filteredRoutes, inboxPageStore }; //# sourceMappingURL=compute.js.map
|
package/lib/compute.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"compute.js","sources":["../src/compute.ts"],"sourcesContent":[null],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"compute.js","sources":["../src/compute.ts"],"sourcesContent":["/* eslint-disable import/no-extraneous-dependencies */\nimport { getFilteredRoutes } from '@common-stack/client-react/lib/utils/filteredRoutes.js';\nimport { IRouteData } from '@common-stack/client-react/lib/interfaces/router.js';\nimport { IPageStore } from '@adminide-stack/core/lib/interfaces/page-store.js';\n\nexport const inboxPageStore: IPageStore[] = [\n {\n key: 'message',\n path: '/message',\n name: 'Message',\n exact: true,\n component: () => import('./screens/inbox/DialogMessages'),\n props: {\n initialParams: { channelId: null, role: null, isShowThreadMessage: true },\n options: {\n headerShown: true,\n title: 'Inbox',\n headerBackTitleVisible: false,\n gestureEnabled: false,\n swipeEnabled: false,\n },\n },\n },\n {\n key: 'thread',\n path: '/thread',\n name: 'Thread',\n exact: true,\n component: () => import('./screens/inbox/DialogThreads'),\n props: {\n initialParams: { channelId: null, postParentId: null, role: null },\n options: {\n headerShown: true,\n title: 'Thread',\n headerBackTitleVisible: false,\n gestureEnabled: false,\n swipeEnabled: false,\n },\n },\n },\n {\n key: 'threadmessage',\n path: '/threadmessage',\n name: 'ThreadMessage',\n exact: true,\n component: () => import('./screens/inbox/DialogThreadMessages'),\n props: {\n initialParams: { channelId: null, postParentId: null, isPostParentIdThread: null, role: null },\n options: {\n headerShown: true,\n title: 'Inbox',\n headerBackTitleVisible: false,\n gestureEnabled: false,\n swipeEnabled: false,\n },\n },\n },\n];\n\nconst selectedRoutes = ['message', 'thread','threadmessage'];\n\nconst filteredRoutes: IRouteData[] = getFilteredRoutes(inboxPageStore, selectedRoutes);\n\nexport { filteredRoutes };"],"names":[],"mappings":"uFAIO,MAAM,iBAA+B,CAAC;AAAA,EAC3C,GAAK,EAAA,SAAA;AAAA,EACL,IAAM,EAAA,UAAA;AAAA,EACN,IAAM,EAAA,SAAA;AAAA,EACN,KAAO,EAAA,IAAA;AAAA,EACP,SAAA,EAAW,MAAM,OAAO,mCAAA,CAAA;AAAA,EACxB,KAAO,EAAA;AAAA,IACL,aAAe,EAAA;AAAA,MACb,SAAW,EAAA,IAAA;AAAA,MACX,IAAM,EAAA,IAAA;AAAA,MACN,mBAAqB,EAAA;AAAA,KACvB;AAAA,IACA,OAAS,EAAA;AAAA,MACP,WAAa,EAAA,IAAA;AAAA,MACb,KAAO,EAAA,OAAA;AAAA,MACP,sBAAwB,EAAA,KAAA;AAAA,MACxB,cAAgB,EAAA,KAAA;AAAA,MAChB,YAAc,EAAA;AAAA;AAChB;AAEJ,CAAG,EAAA;AAAA,EACD,GAAK,EAAA,QAAA;AAAA,EACL,IAAM,EAAA,SAAA;AAAA,EACN,IAAM,EAAA,QAAA;AAAA,EACN,KAAO,EAAA,IAAA;AAAA,EACP,SAAA,EAAW,MAAM,OAAO,kCAAA,CAAA;AAAA,EACxB,KAAO,EAAA;AAAA,IACL,aAAe,EAAA;AAAA,MACb,SAAW,EAAA,IAAA;AAAA,MACX,YAAc,EAAA,IAAA;AAAA,MACd,IAAM,EAAA;AAAA,KACR;AAAA,IACA,OAAS,EAAA;AAAA,MACP,WAAa,EAAA,IAAA;AAAA,MACb,KAAO,EAAA,QAAA;AAAA,MACP,sBAAwB,EAAA,KAAA;AAAA,MACxB,cAAgB,EAAA,KAAA;AAAA,MAChB,YAAc,EAAA;AAAA;AAChB;AAEJ,CAAG,EAAA;AAAA,EACD,GAAK,EAAA,eAAA;AAAA,EACL,IAAM,EAAA,gBAAA;AAAA,EACN,IAAM,EAAA,eAAA;AAAA,EACN,KAAO,EAAA,IAAA;AAAA,EACP,SAAA,EAAW,MAAM,OAAO,yCAAA,CAAA;AAAA,EACxB,KAAO,EAAA;AAAA,IACL,aAAe,EAAA;AAAA,MACb,SAAW,EAAA,IAAA;AAAA,MACX,YAAc,EAAA,IAAA;AAAA,MACd,oBAAsB,EAAA,IAAA;AAAA,MACtB,IAAM,EAAA;AAAA,KACR;AAAA,IACA,OAAS,EAAA;AAAA,MACP,WAAa,EAAA,IAAA;AAAA,MACb,KAAO,EAAA,OAAA;AAAA,MACP,sBAAwB,EAAA,KAAA;AAAA,MACxB,cAAgB,EAAA,KAAA;AAAA,MAChB,YAAc,EAAA;AAAA;AAChB;AAEJ,CAAC;AACD,MAAM,cAAiB,GAAA,CAAC,SAAW,EAAA,QAAA,EAAU,eAAe,CAAA;AACtD,MAAA,cAAA,GAA+B,iBAAkB,CAAA,cAAA,EAAgB,cAAc"}
|
package/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../src/index.ts"],"sourcesContent":[
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../src/index.ts"],"sourcesContent":["import PlatformModule from './module';\n\nimport { Feature } from '@common-stack/client-react';\n\nexport default new Feature(PlatformModule);\n// export * from './navigation';\nexport * from './screens';\n"],"names":[],"mappings":"yUAEA,YAAe,IAAI,QAAQ,cAAc,CAAA"}
|
package/lib/module.js
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import {Feature}from'@common-stack/client-react';import {
|
|
2
|
-
var PlatformModule = new Feature({
|
|
1
|
+
import {Feature}from'@common-stack/client-react';import {typePolicies,schema,dataIdFromObject}from'@messenger-box/platform-client';import {filteredRoutes}from'./compute.js';var PlatformModule = new Feature({
|
|
3
2
|
dataIdFromObject,
|
|
4
3
|
clientStateParams: {
|
|
5
4
|
typeDefs: schema,
|
package/lib/module.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"module.js","sources":["../src/module.ts"],"sourcesContent":[
|
|
1
|
+
{"version":3,"file":"module.js","sources":["../src/module.ts"],"sourcesContent":["/* eslint-disable import/no-extraneous-dependencies */\nimport { Feature } from '@common-stack/client-react';\nimport { schema, typePolicies, dataIdFromObject } from '@messenger-box/platform-client';\nimport {filteredRoutes} from './compute';\n\nexport default new Feature({\n dataIdFromObject,\n clientStateParams: { typeDefs: schema, typePolicies },\n routeConfig: filteredRoutes as any,\n});\n"],"names":[],"mappings":"6KAIA,qBAAe,IAAI,OAAQ,CAAA;AAAA,EACzB,gBAAA;AAAA,EACA,iBAAmB,EAAA;AAAA,IACjB,QAAU,EAAA,MAAA;AAAA,IACV;AAAA,GACF;AAAA,EACA,WAAa,EAAA;AACf,CAAC,CAAA"}
|
|
@@ -1,21 +1,45 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
1
|
+
import*as React from'react';import {Box}from'@admin-layout/gluestack-ui-mobile';import {ConversationView}from'./containers/ConversationView.js';import {navigationRef}from'@common-stack/client-react';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 __objRest = (source, exclude) => {
|
|
21
|
+
var target = {};
|
|
22
|
+
for (var prop in source)
|
|
23
|
+
if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
24
|
+
target[prop] = source[prop];
|
|
25
|
+
if (source != null && __getOwnPropSymbols)
|
|
26
|
+
for (var prop of __getOwnPropSymbols(source)) {
|
|
27
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
|
|
28
|
+
target[prop] = source[prop];
|
|
29
|
+
}
|
|
30
|
+
return target;
|
|
31
|
+
};
|
|
32
|
+
function DialogMessages(_a) {
|
|
33
|
+
var _b = _a, {
|
|
34
|
+
channelId,
|
|
35
|
+
role,
|
|
36
|
+
isShowThreadMessage = true
|
|
37
|
+
} = _b, rest = __objRest(_b, [
|
|
38
|
+
"channelId",
|
|
39
|
+
"role",
|
|
40
|
+
"isShowThreadMessage"
|
|
41
|
+
]);
|
|
42
|
+
var _a2, _b2, _c;
|
|
43
|
+
const currentRoute = navigationRef.isReady() ? (_a2 = navigationRef) == null ? void 0 : _a2.getCurrentRoute() : null;
|
|
44
|
+
return /* @__PURE__ */ React.createElement(Box, { bg: "$white", flex: 1 }, /* @__PURE__ */ React.createElement(ConversationView, __spreadProps(__spreadValues({}, rest), { channelId: (_c = (_b2 = currentRoute == null ? void 0 : currentRoute.params) == null ? void 0 : _b2.channelId) != null ? _c : channelId, role, isShowThreadMessage })));
|
|
21
45
|
}export{DialogMessages,DialogMessages as default};//# sourceMappingURL=DialogMessages.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DialogMessages.js","sources":["../../../src/screens/inbox/DialogMessages.tsx"],"sourcesContent":[null],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"DialogMessages.js","sources":["../../../src/screens/inbox/DialogMessages.tsx"],"sourcesContent":["import * as React from 'react';\nimport { Box } from '@admin-layout/gluestack-ui-mobile';\nimport { ConversationView } from './containers/ConversationView';\nimport { navigationRef } from '@common-stack/client-react';\n\nexport function DialogMessages({ channelId, role, isShowThreadMessage = true, ...rest }) {\n const currentRoute = navigationRef.isReady() ? navigationRef?.getCurrentRoute() : null;\n return (\n // <Box bg={'white'} flex={1} pt={5}>\n <Box bg={'$white'} flex={1}>\n <ConversationView\n {...rest}\n channelId={currentRoute?.params?.channelId ?? channelId}\n role={role}\n isShowThreadMessage={isShowThreadMessage}\n />\n </Box>\n );\n}\n\nexport default DialogMessages;\n"],"names":["_a","_b"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAIO,SAAS,eAAe,EAK5B,EAAA;AAL4B,EAC7B,IAAA,EAAA,GAAA,EAAA,EAAA;AAAA,IAAA,SAAA;AAAA,IACA,IAAA;AAAA,IACA,mBAAsB,GAAA;AAAA,GAPxB,GAI+B,EAI1B,EAAA,IAAA,GAAA,SAAA,CAJ0B,EAI1B,EAAA;AAAA,IAHH,WAAA;AAAA,IACA,MAAA;AAAA,IACA;AAAA,GAAA,CAAA;AAPF,EAAA,IAAAA,KAAAC,GAAA,EAAA,EAAA;AAUE,EAAA,MAAM,eAAe,aAAc,CAAA,OAAA,MAAYD,GAAA,GAAA,aAAA,KAAA,IAAA,GAAA,MAAA,GAAAA,IAAe,eAAoB,EAAA,GAAA,IAAA;AAClF,EAEE,uBAAA,KAAA,CAAA,aAAA,CAAC,OAAI,EAAI,EAAA,QAAA,EAAU,MAAM,CACjB,EAAA,kBAAA,KAAA,CAAA,aAAA,CAAC,gBAAqB,EAAA,aAAA,CAAA,cAAA,CAAA,EAAA,EAAA,IAAA,CAAA,EAArB,EAA2B,SAAA,EAAA,CAAW,MAAAC,GAAA,GAAA,YAAA,IAAA,IAAA,GAAA,MAAA,GAAA,YAAA,CAAc,WAAd,IAAAA,GAAAA,MAAAA,GAAAA,GAAAA,CAAsB,cAAtB,IAAmC,GAAA,EAAA,GAAA,SAAA,EAAW,IAAY,EAAA,mBAAA,EAAA,CAA0C,CAC/I,CAAA;AAER"}
|
|
@@ -10,69 +10,34 @@ import*as React from'react';import {Box,Spinner}from'@admin-layout/gluestack-ui-
|
|
|
10
10
|
refetch
|
|
11
11
|
} = useViewChannelDetailQuery({
|
|
12
12
|
variables: {
|
|
13
|
-
id: channelId
|
|
13
|
+
id: channelId == null ? void 0 : channelId.toString()
|
|
14
14
|
}
|
|
15
15
|
});
|
|
16
|
-
useSendThreadMessageMutation();
|
|
16
|
+
const [sendThreadMessage] = useSendThreadMessageMutation();
|
|
17
17
|
const [loading, setLoading] = React.useState(true);
|
|
18
18
|
const [channel, setChannel] = React.useState(null);
|
|
19
19
|
const [parentId, setParentId] = React.useState(postParentId);
|
|
20
|
-
React.useCallback(id => {
|
|
20
|
+
React.useCallback((id) => {
|
|
21
21
|
return refetch({
|
|
22
|
-
id: id
|
|
22
|
+
id: id == null ? void 0 : id.toString()
|
|
23
23
|
});
|
|
24
24
|
}, [channelId]);
|
|
25
25
|
useFocusEffect(React.useCallback(() => {
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
return () => {
|
|
26
|
+
if (channelId)
|
|
27
|
+
refetch({
|
|
28
|
+
id: channelId == null ? void 0 : channelId.toString()
|
|
29
|
+
});
|
|
30
|
+
return () => {
|
|
31
|
+
};
|
|
31
32
|
}, [channelId]));
|
|
32
33
|
React.useEffect(() => {
|
|
33
34
|
setParentId(postParentId);
|
|
34
35
|
}, [postParentId]);
|
|
35
36
|
React.useEffect(() => {
|
|
36
|
-
if (data
|
|
37
|
-
setChannel(data
|
|
37
|
+
if (data == null ? void 0 : data.viewChannelDetail) {
|
|
38
|
+
setChannel(data == null ? void 0 : data.viewChannelDetail);
|
|
38
39
|
setLoading(false);
|
|
39
40
|
}
|
|
40
41
|
}, [data]);
|
|
41
|
-
|
|
42
|
-
// async function sendInitialMessage(channel: any) {
|
|
43
|
-
// const content = `Welcome to ${channel?.title}`;
|
|
44
|
-
// const createdBy = channel?.creator?.id;
|
|
45
|
-
// await sendThreadMessage({
|
|
46
|
-
// variables: {
|
|
47
|
-
// channelId,
|
|
48
|
-
// threadMessageInput: {
|
|
49
|
-
// content,
|
|
50
|
-
// role,
|
|
51
|
-
// },
|
|
52
|
-
// responderId: createdBy,
|
|
53
|
-
// },
|
|
54
|
-
// update: (cache, { data, errors }: any) => {
|
|
55
|
-
// if (!data) {
|
|
56
|
-
// return;
|
|
57
|
-
// }
|
|
58
|
-
// setParentId(data?.sendThreadMessage?.lastMessage?.id);
|
|
59
|
-
// },
|
|
60
|
-
// });
|
|
61
|
-
// }
|
|
62
|
-
// if ((!parentId || parentId == 0) && channel) {
|
|
63
|
-
// sendInitialMessage(channel);
|
|
64
|
-
// }
|
|
65
|
-
// if (parentId) setLoading(false);
|
|
66
|
-
// }, [parentId, channel]);
|
|
67
|
-
return React.createElement(Box, {
|
|
68
|
-
bg: '$white',
|
|
69
|
-
flex: 1
|
|
70
|
-
}, loading ? React.createElement(Spinner, {
|
|
71
|
-
color: '$blue500'
|
|
72
|
-
}) : React.createElement(ThreadConversationView, {
|
|
73
|
-
channelId: channelId,
|
|
74
|
-
postParentId: parentId,
|
|
75
|
-
isPostParentIdThread: isPostParentIdThread,
|
|
76
|
-
role: role
|
|
77
|
-
}));
|
|
42
|
+
return /* @__PURE__ */ React.createElement(Box, { bg: "$white", flex: 1 }, loading ? /* @__PURE__ */ React.createElement(Spinner, { color: "$blue500" }) : /* @__PURE__ */ React.createElement(ThreadConversationView, { channelId, postParentId: parentId, isPostParentIdThread, role }));
|
|
78
43
|
}export{DialogThreadMessages,DialogThreadMessages as default};//# sourceMappingURL=DialogThreadMessages.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DialogThreadMessages.js","sources":["../../../src/screens/inbox/DialogThreadMessages.tsx"],"sourcesContent":[null],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"DialogThreadMessages.js","sources":["../../../src/screens/inbox/DialogThreadMessages.tsx"],"sourcesContent":["import * as React from 'react';\nimport { Box, Spinner, Text } from '@admin-layout/gluestack-ui-mobile';\nimport { ThreadConversationView } from './containers/ThreadConversationView';\nimport { ThreadsView } from './containers/ThreadsView';\nimport { useViewChannelDetailQuery, useSendThreadMessageMutation } from 'common/lib/generated/generated.js';\nimport { useFocusEffect } from '@react-navigation/native';\nimport { useSelector } from 'react-redux';\n\nexport function DialogThreadMessages({ channelId, postParentId, isPostParentIdThread, role }) {\n const {\n data,\n loading: channelLoading,\n refetch,\n } = useViewChannelDetailQuery({\n variables: {\n id: channelId?.toString(),\n },\n });\n\n const [sendThreadMessage] = useSendThreadMessageMutation();\n const [loading, setLoading] = React.useState<boolean>(true);\n const [channel, setChannel] = React.useState<any>(null);\n const [parentId, setParentId] = React.useState<any>(postParentId);\n\n const refetchChannelDetail = React.useCallback(\n (id: string) => {\n return refetch({ id: id?.toString() });\n },\n [channelId],\n );\n\n useFocusEffect(\n React.useCallback(() => {\n // Do something when the screen is focused\n if (channelId) refetch({ id: channelId?.toString() });\n return () => {};\n }, [channelId]),\n );\n\n React.useEffect(() => {\n setParentId(postParentId);\n }, [postParentId]);\n\n React.useEffect(() => {\n if (data?.viewChannelDetail) {\n setChannel(data?.viewChannelDetail);\n setLoading(false);\n }\n }, [data]);\n\n // React.useEffect(() => {\n // async function sendInitialMessage(channel: any) {\n // const content = `Welcome to ${channel?.title}`;\n // const createdBy = channel?.creator?.id;\n // await sendThreadMessage({\n // variables: {\n // channelId,\n // threadMessageInput: {\n // content,\n // role,\n // },\n // responderId: createdBy,\n // },\n // update: (cache, { data, errors }: any) => {\n // if (!data) {\n // return;\n // }\n // setParentId(data?.sendThreadMessage?.lastMessage?.id);\n // },\n // });\n // }\n // if ((!parentId || parentId == 0) && channel) {\n // sendInitialMessage(channel);\n // }\n\n // if (parentId) setLoading(false);\n // }, [parentId, channel]);\n\n return (\n <Box bg={'$white'} flex={1}>\n {/* {loading && !parentId ? ( */}\n {loading ? (\n <Spinner color={'$blue500'} />\n ) : (\n <ThreadConversationView\n channelId={channelId}\n postParentId={parentId}\n isPostParentIdThread={isPostParentIdThread}\n role={role}\n />\n )}\n </Box>\n );\n}\n\nexport default DialogThreadMessages;\n"],"names":[],"mappings":"iUAOO,SAAS,oBAAqB,CAAA;AAAA,EACnC,SAAA;AAAA,EACA,YAAA;AAAA,EACA,oBAAA;AAAA,EACA;AACF,CAAG,EAAA;AACD,EAAM,MAAA;AAAA,IACJ,IAAA;AAAA,IACA,OAAS,EAAA,cAAA;AAAA,IACT;AAAA,MACE,yBAA0B,CAAA;AAAA,IAC5B,SAAW,EAAA;AAAA,MACT,IAAI,SAAW,IAAA,IAAA,GAAA,MAAA,GAAA,SAAA,CAAA,QAAA;AAAA;AACjB,GACD,CAAA;AACD,EAAM,MAAA,CAAC,iBAAiB,CAAA,GAAI,4BAA6B,EAAA;AACzD,EAAA,MAAM,CAAC,OAAS,EAAA,UAAU,CAAI,GAAA,KAAA,CAAM,SAAkB,IAAI,CAAA;AAC1D,EAAA,MAAM,CAAC,OAAS,EAAA,UAAU,CAAI,GAAA,KAAA,CAAM,SAAc,IAAI,CAAA;AACtD,EAAA,MAAM,CAAC,QAAU,EAAA,WAAW,CAAI,GAAA,KAAA,CAAM,SAAc,YAAY,CAAA;AAChE,EAA6B,KAAA,CAAM,WAAY,CAAA,CAAC,EAAe,KAAA;AAC7D,IAAA,OAAO,OAAQ,CAAA;AAAA,MACb,IAAI,EAAI,IAAA,IAAA,GAAA,MAAA,GAAA,EAAA,CAAA,QAAA;AAAA,KACT,CAAA;AAAA,GACH,EAAG,CAAC,SAAS,CAAC;AACd,EAAe,cAAA,CAAA,KAAA,CAAM,YAAY,MAAM;AAErC,IAAI,IAAA,SAAA;AAAW,MAAQ,OAAA,CAAA;AAAA,QACrB,IAAI,SAAW,IAAA,IAAA,GAAA,MAAA,GAAA,SAAA,CAAA,QAAA;AAAA,OAChB,CAAA;AACD,IAAA,OAAO,MAAM;AAAA,KAAC;AAAA,GACb,EAAA,CAAC,SAAS,CAAC,CAAC,CAAA;AACf,EAAA,KAAA,CAAM,UAAU,MAAM;AACpB,IAAA,WAAA,CAAY,YAAY,CAAA;AAAA,GAC1B,EAAG,CAAC,YAAY,CAAC,CAAA;AACjB,EAAA,KAAA,CAAM,UAAU,MAAM;AACpB,IAAA,IAAI,6BAAM,iBAAmB,EAAA;AAC3B,MAAA,UAAA,CAAW,6BAAM,iBAAiB,CAAA;AAClC,MAAA,UAAA,CAAW,KAAK,CAAA;AAAA;AAClB,GACF,EAAG,CAAC,IAAI,CAAC,CAAA;AA8BT,EAAA,2CAAQ,GAAI,EAAA,EAAA,EAAA,EAAI,UAAU,IAAM,EAAA,CAAA,EAAA,EAErB,0BAAW,KAAA,CAAA,aAAA,CAAA,OAAA,EAAA,EAAQ,OAAO,UAAY,EAAA,CAAA,uCAAM,sBAAuB,EAAA,EAAA,SAAA,EAAsB,cAAc,QAAU,EAAA,oBAAA,EAA4C,MAAY,CAC9K,CAAA;AACR"}
|
|
@@ -12,7 +12,7 @@ function DialogThreads({
|
|
|
12
12
|
refetch: channelRefetch
|
|
13
13
|
} = useViewChannelDetailQuery({
|
|
14
14
|
variables: {
|
|
15
|
-
id: channelId
|
|
15
|
+
id: channelId == null ? void 0 : channelId.toString()
|
|
16
16
|
}
|
|
17
17
|
});
|
|
18
18
|
const {
|
|
@@ -23,84 +23,27 @@ function DialogThreads({
|
|
|
23
23
|
subscribeToMore: threadsSubscribeToMore
|
|
24
24
|
} = useThreadMessagesQuery({
|
|
25
25
|
variables: {
|
|
26
|
-
channelId: channelId
|
|
27
|
-
role: role
|
|
26
|
+
channelId: channelId == null ? void 0 : channelId.toString(),
|
|
27
|
+
role: role == null ? void 0 : role.toString(),
|
|
28
28
|
limit: MESSAGES_PER_PAGE,
|
|
29
29
|
repliesLimit2: 5
|
|
30
30
|
}
|
|
31
|
-
// fetchPolicy: 'cache-and-network',
|
|
32
31
|
});
|
|
33
32
|
const channelsDetail = React.useMemo(() => {
|
|
34
|
-
if (!(channelData
|
|
35
|
-
|
|
33
|
+
if (!(channelData == null ? void 0 : channelData.viewChannelDetail))
|
|
34
|
+
return null;
|
|
35
|
+
return channelData == null ? void 0 : channelData.viewChannelDetail;
|
|
36
36
|
}, [channelData]);
|
|
37
|
-
const refetchChannelDetail = React.useCallback(id => {
|
|
37
|
+
const refetchChannelDetail = React.useCallback((id) => {
|
|
38
38
|
return channelRefetch({
|
|
39
|
-
id: id
|
|
39
|
+
id: id == null ? void 0 : id.toString()
|
|
40
40
|
});
|
|
41
41
|
}, [channelId]);
|
|
42
42
|
useFocusEffect(React.useCallback(() => {
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
return () => {
|
|
43
|
+
if (channelId)
|
|
44
|
+
refetchChannelDetail(channelId);
|
|
45
|
+
return () => {
|
|
46
|
+
};
|
|
46
47
|
}, []));
|
|
47
|
-
return (
|
|
48
|
-
// <Box bg={'white'} flex={1} pt={5}>
|
|
49
|
-
React.createElement(React.Fragment, null, channelLoading ? React.createElement(Spinner, {
|
|
50
|
-
color: '$blue500'
|
|
51
|
-
}) : React.createElement(React.Fragment, null, React.createElement(Box, {
|
|
52
|
-
flex: 1,
|
|
53
|
-
"$dark-borderColor": "$coolGray600",
|
|
54
|
-
"$dark-backgroundColor": "$trueGray700",
|
|
55
|
-
"$light-backgroundColor": "$trueGray50"
|
|
56
|
-
}, React.createElement(ThreadsView, {
|
|
57
|
-
data: threadsData,
|
|
58
|
-
loading: threadLoading,
|
|
59
|
-
refetch: threadsRefetch,
|
|
60
|
-
subscribeToMore: threadsSubscribeToMore,
|
|
61
|
-
error: threadsError,
|
|
62
|
-
channelId: channelId,
|
|
63
|
-
role: role,
|
|
64
|
-
channelsDetail: channelsDetail,
|
|
65
|
-
refetchChannelDetail: refetchChannelDetail
|
|
66
|
-
}))))
|
|
67
|
-
);
|
|
68
|
-
// return (
|
|
69
|
-
// // <Box bg={'white'} flex={1} pt={5}>
|
|
70
|
-
// <>
|
|
71
|
-
// {channelLoading ? (
|
|
72
|
-
// <Spinner />
|
|
73
|
-
// ) : (
|
|
74
|
-
// <>
|
|
75
|
-
// {postParentId || postParentId == 0 ? (
|
|
76
|
-
// <Box bg={'white'} flex={1}>
|
|
77
|
-
// <ThreadConversationView
|
|
78
|
-
// channelId={channelId}
|
|
79
|
-
// postParentId={postParentId}
|
|
80
|
-
// channelsDetail={channelsDetail}
|
|
81
|
-
// refetchChannelDetail={refetchChannelDetail}
|
|
82
|
-
// />
|
|
83
|
-
// </Box>
|
|
84
|
-
// ) : (
|
|
85
|
-
// <Box
|
|
86
|
-
// flex={1}
|
|
87
|
-
// _dark={{
|
|
88
|
-
// borderColor: 'coolGray.600',
|
|
89
|
-
// backgroundColor: 'gray.700',
|
|
90
|
-
// }}
|
|
91
|
-
// _light={{
|
|
92
|
-
// backgroundColor: 'gray.50',
|
|
93
|
-
// }}
|
|
94
|
-
// >
|
|
95
|
-
// <ThreadsView
|
|
96
|
-
// channelId={channelId}
|
|
97
|
-
// channelsDetail={channelsDetail}
|
|
98
|
-
// refetchChannelDetail={refetchChannelDetail}
|
|
99
|
-
// />
|
|
100
|
-
// </Box>
|
|
101
|
-
// )}
|
|
102
|
-
// </>
|
|
103
|
-
// )}
|
|
104
|
-
// </>
|
|
105
|
-
// );
|
|
48
|
+
return /* @__PURE__ */ React.createElement(React.Fragment, null, channelLoading ? /* @__PURE__ */ React.createElement(Spinner, { color: "$blue500" }) : /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(Box, { flex: 1, "$dark-borderColor": "$coolGray600", "$dark-backgroundColor": "$trueGray700", "$light-backgroundColor": "$trueGray50" }, /* @__PURE__ */ React.createElement(ThreadsView, { data: threadsData, loading: threadLoading, refetch: threadsRefetch, subscribeToMore: threadsSubscribeToMore, error: threadsError, channelId, role, channelsDetail, refetchChannelDetail }))));
|
|
106
49
|
}export{DialogThreads,DialogThreads as default};//# sourceMappingURL=DialogThreads.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DialogThreads.js","sources":["../../../src/screens/inbox/DialogThreads.tsx"],"sourcesContent":[null],"names":[],"mappings":"6UAQA,MAAM;
|
|
1
|
+
{"version":3,"file":"DialogThreads.js","sources":["../../../src/screens/inbox/DialogThreads.tsx"],"sourcesContent":["import * as React from 'react';\nimport { Box, Spinner, Text } from '@admin-layout/gluestack-ui-mobile';\nimport { ThreadConversationView } from './containers/ThreadConversationView';\nimport { ThreadsView } from './containers/ThreadsView';\nimport { useViewChannelDetailQuery, useThreadMessagesQuery } from 'common/lib/generated/generated.js';\nimport { useFocusEffect } from '@react-navigation/native';\nimport { useSelector } from 'react-redux';\nimport { config } from './config';\nconst { MESSAGES_PER_PAGE } = config;\n\nexport function DialogThreads({ channelId, postParentId, role }) {\n const {\n data: channelData,\n loading: channelLoading,\n refetch: channelRefetch,\n } = useViewChannelDetailQuery({\n variables: {\n id: channelId?.toString(),\n },\n });\n\n const {\n data: threadsData,\n loading: threadLoading,\n error: threadsError,\n refetch: threadsRefetch,\n subscribeToMore: threadsSubscribeToMore,\n } = useThreadMessagesQuery({\n variables: {\n channelId: channelId?.toString(),\n role: role?.toString(),\n limit: MESSAGES_PER_PAGE,\n repliesLimit2: 5,\n },\n // fetchPolicy: 'cache-and-network',\n });\n\n const channelsDetail = React.useMemo(() => {\n if (!channelData?.viewChannelDetail) return null;\n return channelData?.viewChannelDetail;\n }, [channelData]);\n\n const refetchChannelDetail = React.useCallback(\n (id: string) => {\n return channelRefetch({ id: id?.toString() });\n },\n [channelId],\n );\n\n useFocusEffect(\n React.useCallback(() => {\n // Do something when the screen is focused\n if (channelId) refetchChannelDetail(channelId);\n return () => {};\n }, []),\n );\n\n return (\n // <Box bg={'white'} flex={1} pt={5}>\n <>\n {channelLoading ? (\n <Spinner color={'$blue500'} />\n ) : (\n <>\n <Box\n flex={1}\n $dark-borderColor=\"$coolGray600\"\n $dark-backgroundColor=\"$trueGray700\"\n $light-backgroundColor=\"$trueGray50\"\n >\n <ThreadsView\n data={threadsData}\n loading={threadLoading}\n refetch={threadsRefetch}\n subscribeToMore={threadsSubscribeToMore}\n error={threadsError}\n channelId={channelId}\n role={role}\n channelsDetail={channelsDetail}\n refetchChannelDetail={refetchChannelDetail}\n />\n </Box>\n </>\n )}\n </>\n );\n\n // return (\n // // <Box bg={'white'} flex={1} pt={5}>\n // <>\n // {channelLoading ? (\n // <Spinner />\n // ) : (\n // <>\n // {postParentId || postParentId == 0 ? (\n // <Box bg={'white'} flex={1}>\n // <ThreadConversationView\n // channelId={channelId}\n // postParentId={postParentId}\n // channelsDetail={channelsDetail}\n // refetchChannelDetail={refetchChannelDetail}\n // />\n // </Box>\n // ) : (\n // <Box\n // flex={1}\n // _dark={{\n // borderColor: 'coolGray.600',\n // backgroundColor: 'gray.700',\n // }}\n // _light={{\n // backgroundColor: 'gray.50',\n // }}\n // >\n // <ThreadsView\n // channelId={channelId}\n // channelsDetail={channelsDetail}\n // refetchChannelDetail={refetchChannelDetail}\n // />\n // </Box>\n // )}\n // </>\n // )}\n // </>\n // );\n}\n\nexport default DialogThreads;\n"],"names":[],"mappings":"6UAQA,MAAM;AAAA,EACJ;AACF,CAAI,GAAA,MAAA;AACG,SAAS,aAAc,CAAA;AAAA,EAC5B,SAAA;AAAA,EACA,YAAA;AAAA,EACA;AACF,CAAG,EAAA;AACD,EAAM,MAAA;AAAA,IACJ,IAAM,EAAA,WAAA;AAAA,IACN,OAAS,EAAA,cAAA;AAAA,IACT,OAAS,EAAA;AAAA,MACP,yBAA0B,CAAA;AAAA,IAC5B,SAAW,EAAA;AAAA,MACT,IAAI,SAAW,IAAA,IAAA,GAAA,MAAA,GAAA,SAAA,CAAA,QAAA;AAAA;AACjB,GACD,CAAA;AACD,EAAM,MAAA;AAAA,IACJ,IAAM,EAAA,WAAA;AAAA,IACN,OAAS,EAAA,aAAA;AAAA,IACT,KAAO,EAAA,YAAA;AAAA,IACP,OAAS,EAAA,cAAA;AAAA,IACT,eAAiB,EAAA;AAAA,MACf,sBAAuB,CAAA;AAAA,IACzB,SAAW,EAAA;AAAA,MACT,WAAW,SAAW,IAAA,IAAA,GAAA,MAAA,GAAA,SAAA,CAAA,QAAA,EAAA;AAAA,MACtB,MAAM,IAAM,IAAA,IAAA,GAAA,MAAA,GAAA,IAAA,CAAA,QAAA,EAAA;AAAA,MACZ,KAAO,EAAA,iBAAA;AAAA,MACP,aAAe,EAAA;AAAA;AACjB,GAED,CAAA;AACD,EAAM,MAAA,cAAA,GAAiB,KAAM,CAAA,OAAA,CAAQ,MAAM;AACzC,IAAA,IAAI,EAAC,WAAa,IAAA,IAAA,GAAA,MAAA,GAAA,WAAA,CAAA,iBAAA,CAAA;AAAmB,MAAO,OAAA,IAAA;AAC5C,IAAA,OAAO,WAAa,IAAA,IAAA,GAAA,MAAA,GAAA,WAAA,CAAA,iBAAA;AAAA,GACtB,EAAG,CAAC,WAAW,CAAC,CAAA;AAChB,EAAA,MAAM,oBAAuB,GAAA,KAAA,CAAM,WAAY,CAAA,CAAC,EAAe,KAAA;AAC7D,IAAA,OAAO,cAAe,CAAA;AAAA,MACpB,IAAI,EAAI,IAAA,IAAA,GAAA,MAAA,GAAA,EAAA,CAAA,QAAA;AAAA,KACT,CAAA;AAAA,GACH,EAAG,CAAC,SAAS,CAAC,CAAA;AACd,EAAe,cAAA,CAAA,KAAA,CAAM,YAAY,MAAM;AAErC,IAAI,IAAA,SAAA;AAAW,MAAA,oBAAA,CAAqB,SAAS,CAAA;AAC7C,IAAA,OAAO,MAAM;AAAA,KAAC;AAAA,GAChB,EAAG,EAAE,CAAC,CAAA;AACN,EAAA,iEAGW,cAAiB,mBAAA,KAAA,CAAA,aAAA,CAAC,OAAQ,EAAA,EAAA,KAAA,EAAO,YAAY,CAAK,mBAAA,KAAA,CAAA,aAAA,CAAA,KAAA,CAAA,QAAA,EAAA,IAAA,kBAC1C,KAAA,CAAA,aAAA,CAAA,GAAA,EAAA,EAAI,MAAM,CAAG,EAAA,mBAAA,EAAkB,cAAe,EAAA,uBAAA,EAAsB,gBAAe,wBAAuB,EAAA,aAAA,EAAA,kBACtG,KAAA,CAAA,aAAA,CAAA,WAAA,EAAA,EAAY,MAAM,WAAa,EAAA,OAAA,EAAS,aAAe,EAAA,OAAA,EAAS,gBAAgB,eAAiB,EAAA,sBAAA,EAAwB,KAAO,EAAA,YAAA,EAAc,WAAsB,IAAY,EAAA,cAAA,EAAgC,oBAA4C,EAAA,CACjQ,CACJ,CACR,CAAA;AAyCR"}
|
|
@@ -1,15 +1,24 @@
|
|
|
1
|
-
import*as React from'react';import {Box}from'@admin-layout/gluestack-ui-mobile';import {Dialogs}from'./containers/Dialogs.js'
|
|
2
|
-
|
|
1
|
+
import*as React from'react';import {Box}from'@admin-layout/gluestack-ui-mobile';import {Dialogs}from'./containers/Dialogs.js';var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
3
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
4
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
5
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
6
|
+
var __spreadValues = (a, b) => {
|
|
7
|
+
for (var prop in b || (b = {}))
|
|
8
|
+
if (__hasOwnProp.call(b, prop))
|
|
9
|
+
__defNormalProp(a, prop, b[prop]);
|
|
10
|
+
if (__getOwnPropSymbols)
|
|
11
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
12
|
+
if (__propIsEnum.call(b, prop))
|
|
13
|
+
__defNormalProp(a, prop, b[prop]);
|
|
14
|
+
}
|
|
15
|
+
return a;
|
|
16
|
+
};
|
|
17
|
+
const Inbox = (props) => {
|
|
3
18
|
const {
|
|
4
19
|
channelFilters,
|
|
5
20
|
channelRole,
|
|
6
21
|
supportServices
|
|
7
22
|
} = props;
|
|
8
|
-
return React.createElement(Box, {
|
|
9
|
-
bg: '$white',
|
|
10
|
-
flex: 1
|
|
11
|
-
}, React.createElement(Dialogs, Object.assign({
|
|
12
|
-
channelFilters: channelFilters,
|
|
13
|
-
channelRole: channelRole
|
|
14
|
-
}, props)));
|
|
23
|
+
return /* @__PURE__ */ React.createElement(Box, { bg: "$white", flex: 1 }, /* @__PURE__ */ React.createElement(Dialogs, __spreadValues({ channelFilters, channelRole }, props)));
|
|
15
24
|
};export{Inbox};//# sourceMappingURL=Inbox.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Inbox.js","sources":["../../../src/screens/inbox/Inbox.tsx"],"sourcesContent":[
|
|
1
|
+
{"version":3,"file":"Inbox.js","sources":["../../../src/screens/inbox/Inbox.tsx"],"sourcesContent":["import * as React from 'react';\nimport { Box, Text } from '@admin-layout/gluestack-ui-mobile';\n\nimport { Dialogs } from './containers/Dialogs';\n// import { SupportServiceDialogs } from './containers/SupportServiceDialogs';\n\nexport const Inbox = (props: any) => {\n const { channelFilters, channelRole, supportServices } = props;\n return (\n <Box bg={'$white'} flex={1}>\n {/* {supportServices && (\n <SupportServiceDialogs channelFilters={channelFilters} channelRole={channelRole} {...props} />\n )} */}\n <Dialogs channelFilters={channelFilters} channelRole={channelRole} {...props} />\n </Box>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAKa,MAAA,KAAA,GAAQ,CAAC,KAAe,KAAA;AACnC,EAAM,MAAA;AAAA,IACJ,cAAA;AAAA,IACA,WAAA;AAAA,IACA;AAAA,GACE,GAAA,KAAA;AACJ,EAAO,uBAAA,KAAA,CAAA,aAAA,CAAC,GAAI,EAAA,EAAA,EAAA,EAAI,QAAU,EAAA,IAAA,EAAM,CAItB,EAAA,kBAAA,KAAA,CAAA,aAAA,CAAC,OAAQ,EAAA,cAAA,CAAA,EAAA,cAAA,EAAgC,WAA8B,EAAA,EAAA,KAAA,CAAO,CAClF,CAAA;AACR"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"consts.js","sources":["../../../../../src/screens/inbox/components/CachedImage/consts.ts"],"sourcesContent":[
|
|
1
|
+
{"version":3,"file":"consts.js","sources":["../../../../../src/screens/inbox/components/CachedImage/consts.ts"],"sourcesContent":["import * as FileSystem from \"expo-file-system\"\n\nexport const IMAGE_CACHE_FOLDER = `${FileSystem.cacheDirectory}`\n// export const IMAGE_CACHE_FOLDER = `${FileSystem.documentDirectory}images/`\nexport default IMAGE_CACHE_FOLDER\n"],"names":[],"mappings":"4CACa,MAAA,kBAAA,GAAqB,GAAG,UAAW,CAAA,cAAA,CAAA"}
|
|
@@ -1,4 +1,23 @@
|
|
|
1
|
-
import
|
|
1
|
+
import React__default,{useState,useRef,useEffect}from'react';import {Image}from'react-native';import*as FileSystem from'expo-file-system';import {IMAGE_CACHE_FOLDER}from'./consts.js';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
|
+
const CachedImage = (props) => {
|
|
2
21
|
const {
|
|
3
22
|
source,
|
|
4
23
|
cacheKey,
|
|
@@ -15,12 +34,12 @@ import {__awaiter}from'tslib';import React__default,{useState,useRef,useEffect}f
|
|
|
15
34
|
const requestOption = headers ? {
|
|
16
35
|
headers
|
|
17
36
|
} : {};
|
|
18
|
-
const _callback = downloadProgress => {
|
|
37
|
+
const _callback = (downloadProgress) => {
|
|
19
38
|
if (componentIsMounted.current === false) {
|
|
20
39
|
downloadResumableRef.current.pauseAsync();
|
|
21
40
|
FileSystem.deleteAsync(fileURI, {
|
|
22
41
|
idempotent: true
|
|
23
|
-
});
|
|
42
|
+
});
|
|
24
43
|
}
|
|
25
44
|
};
|
|
26
45
|
const downloadResumableRef = useRef(FileSystem.createDownloadResumable(uri, fileURI, requestOption, _callback));
|
|
@@ -29,47 +48,42 @@ import {__awaiter}from'tslib';import React__default,{useState,useRef,useEffect}f
|
|
|
29
48
|
return () => {
|
|
30
49
|
componentIsMounted.current = false;
|
|
31
50
|
};
|
|
32
|
-
}, []);
|
|
33
|
-
const loadImage = () =>
|
|
51
|
+
}, []);
|
|
52
|
+
const loadImage = async () => {
|
|
34
53
|
try {
|
|
35
|
-
|
|
36
|
-
const
|
|
37
|
-
|
|
38
|
-
// console.log({expiresIn, expired})
|
|
39
|
-
// console.log({modificationTime: metadata.modificationTime, currentTime: new Date().getTime() / 1000})
|
|
40
|
-
// console.log({metadata})
|
|
41
|
-
if (!metadata.exists || (metadata === null || metadata === void 0 ? void 0 : metadata.size) === 0 || expired) {
|
|
54
|
+
const metadata = await FileSystem.getInfoAsync(fileURI);
|
|
55
|
+
const expired = expiresIn && new Date().getTime() / 1e3 - (metadata == null ? void 0 : metadata.modificationTime) > expiresIn;
|
|
56
|
+
if (!metadata.exists || (metadata == null ? void 0 : metadata.size) === 0 || expired) {
|
|
42
57
|
if (componentIsMounted.current) {
|
|
43
58
|
setImgUri(null);
|
|
44
59
|
if (expired) {
|
|
45
|
-
|
|
60
|
+
await FileSystem.deleteAsync(fileURI, {
|
|
46
61
|
idempotent: true
|
|
47
62
|
});
|
|
48
63
|
}
|
|
49
|
-
// download to cache
|
|
50
64
|
setImgUri(null);
|
|
51
|
-
const response =
|
|
65
|
+
const response = await downloadResumableRef.current.downloadAsync();
|
|
52
66
|
if (componentIsMounted.current && response.status === 200) {
|
|
53
|
-
setImgUri(`${fileURI}?`);
|
|
67
|
+
setImgUri(`${fileURI}?`);
|
|
54
68
|
}
|
|
55
69
|
if (response.status !== 200) {
|
|
56
70
|
FileSystem.deleteAsync(fileURI, {
|
|
57
71
|
idempotent: true
|
|
58
|
-
});
|
|
72
|
+
});
|
|
59
73
|
}
|
|
60
74
|
}
|
|
61
75
|
}
|
|
62
76
|
} catch (err) {
|
|
63
|
-
// console.log({ err })
|
|
64
77
|
}
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
return React__default.createElement(
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
78
|
+
};
|
|
79
|
+
if (!imgUri)
|
|
80
|
+
return placeholderContent || null;
|
|
81
|
+
return /* @__PURE__ */ React__default.createElement(
|
|
82
|
+
Image,
|
|
83
|
+
__spreadProps(__spreadValues({}, props), {
|
|
84
|
+
source: __spreadProps(__spreadValues({}, source), {
|
|
85
|
+
uri: imgUri
|
|
86
|
+
})
|
|
73
87
|
})
|
|
74
|
-
|
|
88
|
+
);
|
|
75
89
|
};export{CachedImage as default};//# sourceMappingURL=index.js.map
|