@messenger-box/chat-ui 10.0.3-alpha.2 → 10.0.3-alpha.202

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.
@@ -1 +1 @@
1
- {"version":3,"file":"Chat.d.ts","sourceRoot":"","sources":["../../../src/components/CustomerSupportChat/Chat.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA4D,MAAM,OAAO,CAAC;AAiBjF,eAAO,MAAM,IAAI;;;;;uBAsEhB,CAAC"}
1
+ {"version":3,"file":"Chat.d.ts","sourceRoot":"","sources":["../../../src/components/CustomerSupportChat/Chat.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA4D,MAAM,OAAO,CAAC;AAiBjF,eAAO,MAAM,IAAI,GAAI;;;;;CAAwD,sBAsE5E,CAAC"}
@@ -1,11 +1,11 @@
1
- import React__default,{useState,useRef}from'react';import {MainContainer,ChatContainer,MessageList,MessageGroup,Message,MessageInput}from'@chatscope/chat-ui-kit-react';import {useSendPublicMessageMutation,useOnPublicPostAddedSubscription}from'common/lib/generated/generated.js';import {uniqBy}from'lodash-es';const Chat = ({
1
+ import React__default,{useState,useRef}from'react';import {MainContainer,ChatContainer,MessageList,MessageGroup,Message,MessageInput}from'@chatscope/chat-ui-kit-react';import {useSendPublicMessageMutation,useOnPublicPostAddedSubscription}from'common/graphql';import {uniqBy}from'lodash-es';const Chat = ({
2
2
  user,
3
3
  channelId,
4
4
  channelMessages,
5
5
  setChannelMessages
6
6
  }) => {
7
7
  // Message input value
8
- useState('');
8
+ const [value, setValue] = useState('');
9
9
  const [totalCount, setTotalCount] = useState(0);
10
10
  const [sendMsg] = useSendPublicMessageMutation();
11
11
  const chatContainerRef = useRef(null);
@@ -1 +1 @@
1
- {"version":3,"file":"Chat.js","sources":["../../../src/components/CustomerSupportChat/Chat.tsx"],"sourcesContent":[null],"names":[],"mappings":"qTAiBO,MAAM,IAAI,GAAG,CAAC;MACK;WACf;iBACU;AAEjB,EAAA;AAEA,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AAM,OAAO,CAAC;AAcnD,eAAO,MAAM,mBAAmB,yBA0N/B,CAAC"}
1
+ {"version":3,"file":"CustomerSupportChat.d.ts","sourceRoot":"","sources":["../../../src/components/CustomerSupportChat/CustomerSupportChat.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA8B,MAAM,OAAO,CAAC;AA8BnD,eAAO,MAAM,mBAAmB,yBAuI/B,CAAC"}
@@ -1,9 +1,23 @@
1
- import React__default,{useState,useEffect}from'react';import {useMediaQuery,Box,Button,Image}from'@chakra-ui/react';import {BiConversation}from'@react-icons/all-files/bi/BiConversation.js';import {BiMessageDetail}from'@react-icons/all-files/bi/BiMessageDetail.js';import {MdKeyboardArrowDown}from'@react-icons/all-files/md/MdKeyboardArrowDown.js';import {BsCardText}from'@react-icons/all-files/bs/BsCardText.js';import {nanoid}from'nanoid';import {BasicStorage,ChatProvider,AutoDraft}from'@chatscope/use-chat';import {ExampleChatService}from'@chatscope/use-chat/dist/examples/index.js';import {usePublicMessagesQuery}from'common/lib/generated/generated.js';import {uniqBy}from'lodash-es';import {Chat}from'./Chat.js';import {objectId}from'@messenger-box/core';const CustomerSupportChat = () => {
1
+ import React__default,{useState,useEffect}from'react';import {BiConversation}from'@react-icons/all-files/bi/BiConversation.js';import {BiMessageDetail}from'@react-icons/all-files/bi/BiMessageDetail.js';import {MdKeyboardArrowDown}from'@react-icons/all-files/md/MdKeyboardArrowDown.js';import {BsCardText}from'@react-icons/all-files/bs/BsCardText.js';import {nanoid}from'nanoid';import {BasicStorage,ChatProvider,AutoDraft}from'@chatscope/use-chat';import {ExampleChatService}from'@chatscope/use-chat/dist/examples/index.js';import {usePublicMessagesQuery}from'common/graphql';import {uniqBy}from'lodash-es';import {Chat}from'./Chat.js';import {objectId}from'@messenger-box/core';// Custom hook for media query
2
+ const useMediaQuery = query => {
3
+ const [matches, setMatches] = useState(false);
4
+ useEffect(() => {
5
+ const media = window.matchMedia(query);
6
+ if (media.matches !== matches) {
7
+ setMatches(media.matches);
8
+ }
9
+ const listener = () => setMatches(media.matches);
10
+ media.addEventListener('change', listener);
11
+ return () => media.removeEventListener('change', listener);
12
+ }, [matches, query]);
13
+ return matches;
14
+ };
15
+ const CustomerSupportChat = () => {
2
16
  const [isChat, setIsChat] = useState(false);
3
17
  const [isChatOpen, setIsChatOpen] = useState(false);
4
18
  const [channelMessages, setChannelMessages] = useState([]);
5
19
  const [channelId, setChannelId] = useState(null);
6
- const [isMobileView, isNonMobileView] = useMediaQuery(['(max-width: 480px)', '(min-width: 480px)']);
20
+ const isMobileView = useMediaQuery('(max-width: 480px)');
7
21
  // Storage needs to generate id for messages and groups
8
22
  const messageIdGenerator = () => nanoid();
9
23
  const groupIdGenerator = () => nanoid();
@@ -51,105 +65,46 @@ import React__default,{useState,useEffect}from'react';import {useMediaQuery,Box,
51
65
  groupIdGenerator,
52
66
  messageIdGenerator
53
67
  });
54
- return React__default.createElement(React__default.Fragment, null, !isChat ? React__default.createElement(Box, {
55
- style: {
56
- position: 'fixed',
57
- bottom: '20px',
58
- right: '30px',
59
- zIndex: '2'
60
- }
61
- }, React__default.createElement(Button, {
62
- background: '#3182ce',
63
- fontSize: '38px',
64
- padding: '16px',
65
- width: '72px',
66
- height: '72px',
67
- borderRadius: '50%',
68
- display: 'flex',
69
- alignItems: 'center',
70
- justifyContent: 'center',
68
+ return React__default.createElement(React__default.Fragment, null, !isChat ? React__default.createElement("div", {
69
+ className: "fixed bottom-5 right-8 z-[2]"
70
+ }, React__default.createElement("button", {
71
+ className: "bg-blue-600 text-[38px] p-4 w-[72px] h-[72px] rounded-full flex items-center justify-center hover:bg-blue-700 transition-colors cursor-pointer",
71
72
  onClick: handleChatClick
72
- }, React__default.createElement(BiConversation, null))) : React__default.createElement(Box, {
73
- style: {
74
- position: 'fixed',
75
- bottom: '20px',
76
- right: '30px',
77
- zIndex: '2',
78
- width: isMobileView ? '80vw' : '25vw'
79
- }
80
- }, React__default.createElement(Box, {
81
- textAlign: 'left',
82
- marginBottom: '10px'
83
- }, React__default.createElement(Button, {
84
- background: '#3182ce',
85
- fontSize: '42px',
86
- width: '62px',
87
- height: '62px',
88
- borderRadius: '50%',
89
- display: 'flex',
90
- alignItems: 'center',
91
- justifyContent: 'center',
73
+ }, React__default.createElement(BiConversation, null))) : React__default.createElement("div", {
74
+ className: `fixed bottom-5 right-8 z-[2] ${isMobileView ? 'w-[80vw]' : 'w-[25vw]'}`
75
+ }, React__default.createElement("div", {
76
+ className: "text-left mb-2.5"
77
+ }, React__default.createElement("button", {
78
+ className: "bg-blue-600 text-[42px] w-[62px] h-[62px] rounded-full flex items-center justify-center hover:bg-blue-700 transition-colors cursor-pointer",
92
79
  onClick: () => setIsChat(false)
93
- }, React__default.createElement(MdKeyboardArrowDown, null))), React__default.createElement(Box, {
94
- style: {
95
- borderRadius: '20px',
96
- background: 'white'
97
- }
98
- }, React__default.createElement(Box, {
99
- style: {
100
- display: 'flex',
101
- backgroundColor: '#3182ce',
102
- padding: '20px 30px',
103
- lineHeight: '7vh',
104
- alignItems: 'center'
105
- }
106
- }, React__default.createElement(Box, {
80
+ }, React__default.createElement(MdKeyboardArrowDown, null))), React__default.createElement("div", {
81
+ className: "rounded-[20px] bg-white"
82
+ }, React__default.createElement("div", {
83
+ className: "flex bg-blue-600 px-7 py-5 items-center",
107
84
  style: {
108
- background: '#366c96',
109
- padding: '10px',
110
- borderRadius: '54px',
111
- fontSize: '25px'
85
+ lineHeight: '7vh'
112
86
  }
113
- }, React__default.createElement(BiMessageDetail, null)), React__default.createElement(Box, {
114
- style: {
115
- fontWeight: '700',
116
- fontSize: '18px',
117
- marginLeft: '30px'
118
- }
119
- }, "Conversation(s)")), React__default.createElement(Box, {
120
- style: {
121
- height: '50vh',
122
- background: '#fafafa',
123
- color: 'black',
124
- display: 'flex',
125
- flexDirection: 'column',
126
- alignContent: 'stretch',
127
- justifyContent: 'space-evenly',
128
- alignItems: 'center'
129
- }
130
- }, !isChatOpen && !channelMessages.length ? React__default.createElement(Box, {
131
- textAlign: 'center'
132
- }, React__default.createElement(Image, {
133
- width: '50%',
134
- margin: 'auto',
135
- src: "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcThpk_KxVKIRa0_fxwaVgIFcRvTgUem0LbkaA&usqp=CAU"
136
- }), React__default.createElement(Box, {
137
- textAlign: 'center'
138
- }, " No ongoing Conversation"), React__default.createElement(Button, {
139
- style: {
140
- backgroundColor: '#3182ce',
141
- padding: '22px 26px',
142
- marginTop: '20px',
143
- borderRadius: '8px',
144
- color: 'whitesmoke'
145
- },
146
- leftIcon: React__default.createElement(BiMessageDetail, {
147
- fontSize: '22px'
148
- }),
87
+ }, React__default.createElement("div", {
88
+ className: "bg-[#366c96] p-2.5 rounded-[54px] text-[25px]"
89
+ }, React__default.createElement(BiMessageDetail, null)), React__default.createElement("div", {
90
+ className: "font-bold text-lg ml-7"
91
+ }, "Conversation(s)")), React__default.createElement("div", {
92
+ className: "h-[50vh] bg-[#fafafa] text-black flex flex-col content-stretch justify-evenly items-center"
93
+ }, !isChatOpen && !channelMessages.length ? React__default.createElement("div", {
94
+ className: "text-center"
95
+ }, React__default.createElement("img", {
96
+ className: "w-1/2 mx-auto",
97
+ src: "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcThpk_KxVKIRa0_fxwaVgIFcRvTgUem0LbkaA&usqp=CAU",
98
+ alt: "No conversation"
99
+ }), React__default.createElement("div", {
100
+ className: "text-center"
101
+ }, "No ongoing Conversation"), React__default.createElement("button", {
102
+ className: "bg-blue-600 px-7 py-5 mt-5 rounded-lg text-gray-100 hover:bg-blue-700 transition-colors flex items-center gap-2 mx-auto cursor-pointer",
149
103
  onClick: handleChat
150
- }, "Chat now")) : React__default.createElement(Box, {
151
- w: '100%',
152
- h: '50vh'
104
+ }, React__default.createElement(BiMessageDetail, {
105
+ className: "text-[22px]"
106
+ }), "Chat now")) : React__default.createElement("div", {
107
+ className: "w-full h-[50vh]"
153
108
  }, React__default.createElement(ChatProvider, {
154
109
  serviceFactory: serviceFactory,
155
110
  storage: chatStorage,
@@ -167,30 +122,14 @@ import React__default,{useState,useEffect}from'react';import {useMediaQuery,Box,
167
122
  channelId: channelId,
168
123
  setChannelMessages: setChannelMessages,
169
124
  channelMessages: channelMessages
170
- })))), React__default.createElement(Box, {
171
- style: {
172
- height: '7vh',
173
- background: 'white',
174
- color: 'black',
175
- display: 'flex',
176
- alignContent: 'center',
177
- alignItems: 'center',
178
- padding: '30px 0px',
179
- justifyContent: 'space-evenly',
180
- boxShadow: '0 0 5px rgba(0, 0, 0, 0.9)',
181
- outline: '1px solid transparent'
182
- }
183
- }, React__default.createElement(Box, {
184
- style: {
185
- display: 'flex',
186
- flexDirection: 'column',
187
- alignItems: 'center'
188
- }
189
- }, React__default.createElement(BiMessageDetail, null), " Conversation"), React__default.createElement(Box, {
125
+ })))), React__default.createElement("div", {
126
+ className: "h-[7vh] bg-white text-black flex content-center items-center py-7 justify-evenly outline outline-1 outline-transparent",
190
127
  style: {
191
- display: 'flex',
192
- flexDirection: 'column',
193
- alignItems: 'center'
128
+ boxShadow: '0 0 5px rgba(0, 0, 0, 0.9)'
194
129
  }
195
- }, React__default.createElement(BsCardText, null), " Articles", ' ')))));
130
+ }, React__default.createElement("div", {
131
+ className: "flex flex-col items-center"
132
+ }, React__default.createElement(BiMessageDetail, null), " Conversation"), React__default.createElement("div", {
133
+ className: "flex flex-col items-center"
134
+ }, React__default.createElement(BsCardText, null), " Articles")))));
196
135
  };export{CustomerSupportChat};//# sourceMappingURL=CustomerSupportChat.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"CustomerSupportChat.js","sources":["../../../src/components/CustomerSupportChat/CustomerSupportChat.tsx"],"sourcesContent":[null],"names":["React"],"mappings":"wvBAcO,MAAM,mBAAmB,GAAG,MAAK;QAC9B,CAAA,MAAO,EAAA,SAAW,CAAA,WAAY,CAAA,KAAM,CAAA;QACpC,CAAA,UAAW,EAAA,aAAe,CAAA,WAAY,CAAA,KAAM,CAAA;QAC5C,CAAA,eAAgB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A,EAAA,MAAA;;AAAwB,MAAA,YAAA,EAAA,SAM7C;AAEX,MAAE,cAAA,EAAA,cAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"CustomerSupportChat.js","sources":["../../../src/components/CustomerSupportChat/CustomerSupportChat.tsx"],"sourcesContent":[null],"names":["React"],"mappings":"uqBAaA;AACA,MAAM,aAAa,GAAG,KAAC,IAAe;QAClC,CAAA,OAAO,EAAO,UAAE,CAAA,WAAc,CAAA,KAAS,CAAA;WAEvC,CAAA,MAAa;UACT,KAAM,GAAA,MAAQ,CAAA,gBAAkB,CAAA;AAChC,IAAA,IAAA,aAAU,KAAO,OAAK,EAAA;AAClB,MAAA,UAAA,CAAA,KAAU,CAAC,OAAM,CAAA;;UAErB,QAAM,GAAA,MAAW,UAAM,CAAA,KAAW,CAAA,OAAM,CAAA;AACxC,IAAA,KAAA,CAAA,gBAAM,CAAA,kBAA2B,CAAA;WACjC,MAAO,KAAM,CAAA,mBAAM,CAAA,QAAoB,EAAA,QAAU,CAAA;AACrD,EAAA,CAAA,EAAC,QAAG,EAAO,KAAE,CAAA,CAAK;AAElB,EAAA,OAAA;AACJ,CAAC;AAEM,MAAM,mBAAmB,GAAG,MAAK;QACpC,CAAA,MAAO,EAAM,SAAE,CAAA,WAAa,CAAA,KAAS,CAAA;QACrC,CAAA,UAAO,EAAU,aAAE,CAAA,WAAiB,CAAA,KAAS,CAAA;QAC7C,CAAA,eAAO,EAAe,kBAAE,CAAA,WAAsB,CAAA,EAAS,CAAA;QACvD,CAAA,SAAO,EAAS,YAAE,CAAA,WAAgB,CAAA,IAAwB,CAAA;AAC1D,EAAA,MAAA,eAAkB,aAAG,CAAA,oBAAc,CAAA;;AAGnC,EAAA,MAAA,qBAAwB,YAAS,EAAM;AACvC,EAAA,MAAA,mBAAsB,YAAS,EAAM;;AAGrC,EAAA,MAAA,iBAAoB,CAAA,S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AAA;;AAGf,GAAA,EAAAA,cAAA,CAAA,aAAA,CAAA,QAAA,EAAA;AAEJ,IAAA,SAAA,EAAA,gJACgB;;iCAOJ,CAAA,cAAA,EAAA,IAAK,CAAA,CAAA,CAAA,GAAAA,cAAU,CAAA,aAAa,CAAA,KAAA,EAAA;AAC5B,IAAA,SAAA,EAAA,CAAA,6BAAA,EAAA,YACc,GAAA,UAAA,GAAA,UAAA,CAAA;AAGV,GAAA,EAAAA,cAAA,CAAA,aAAA,CAAA,KAAA,EAAA;;iCAMJ,CAAA,QAAA,EAAA;AAIQ,IAAA,SAAA,EAAA,4IAAuB;AACvB,IAAA,OAAA,EAAA,MAAA,SAAA,CAAA,KAAA;AACA,GAAA,EAAAA,cAAA,CAAA,aAAA,CAAA,mBAAoB,EAAA,IAAA,CAAA,CAAA,CAAA,EAAAA,cAAA,CAAA,aAAA,CAAA,KAAA,EAAA;AACpB,IAAA,SAAA,EAAA;AACH,GAAA,EAAAA,cAAA,CAAA,aAAA,CAAA,KAAA,EAAA;AAED,IAAA,SAAA,EAAA,yCACY;;gBAaxB,EAAA;AACI;AACE,GAAA,EAAAA,cAAA,CAAA,aAAA,CAAA,KAAA,EAAA;;AAEF,GAAA,EAAAA,cAAA,CAAA,aAAA,CAAA,eAAC,UAAUA,cAAA,CAAA,aAAG,CAAA,KAAA,EAAA;AACZ,IAAA,SAAA,EAAA;AAOlC,GAAE,EAAA,iBAAA,CAAA,CAAA,EAAAA,cAAA,CAAA,aAAA,CAAA,KAAA,EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
package/lib/compute.d.ts CHANGED
@@ -1,3 +1,3 @@
1
- declare const filteredRoutes: any;
1
+ declare const filteredRoutes: import("@common-stack/core").IRouteMap[];
2
2
  export { filteredRoutes };
3
3
  //# sourceMappingURL=compute.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"compute.d.ts","sourceRoot":"","sources":["../src/compute.ts"],"names":[],"mappings":"AAeA,QAAA,MAAM,cAAc,KAA6B,CAAC;AAElD,OAAO,EAAE,cAAc,EAAE,CAAC"}
1
+ {"version":3,"file":"compute.d.ts","sourceRoot":"","sources":["../src/compute.ts"],"names":[],"mappings":"AAeA,QAAA,MAAM,cAAc,0CAA6B,CAAC;AAElD,OAAO,EAAE,cAAc,EAAE,CAAC"}
package/lib/compute.js CHANGED
@@ -11,7 +11,6 @@ const chatBox = [{
11
11
  hasClientLoader: true,
12
12
  hasComponent: true,
13
13
  loaderReturnInfo: {
14
- returnType: "json",
15
14
  hasOptions: false,
16
15
  keys: ["parentRoute"]
17
16
  }
@@ -1 +1 @@
1
- {"version":3,"file":"compute.js","sources":["../src/compute.ts"],"sourcesContent":[null],"names":[],"mappings":"uFACA,MAAM,GAAG,GAAG,UAAU;AAEtB,MAAM,OAAO,GAAU,CAAA;AACnB,EAAA,IAAA,EAAA,OAAA;AACI,EAAA,GAAA,EAAA,GAAA;AACA,EAAA,KAAA,EAAA,KAAQ;AACR,EAAA,IAAA,EAAA,UAAY;AACZ,EAAA,gBAAgB,EAAA,CAAA,GAAA,CAAA;WACA,EAAA,MAAA,OAAE,kCAAK;AACvB,CAAA,CAAA;AACH;AACH,MAAA,cAAA,GAAA,iBAAA,CAAA,OAAA"}
1
+ {"version":3,"file":"compute.js","sources":["../src/compute.ts"],"sourcesContent":[null],"names":[],"mappings":"uFACA,MAAM,GAAG,GAAG,UAAU;AAEtB,MAAM,OAAO,GAAU,CAAA;AACnB,EAAA,IAAA,EAAA,OAAA;AACI,EAAA,GAAA,EAAA,GAAA;AACA,EAAA,KAAA,EAAA,KAAK;AACL,EAAA,IAAA,EAAA,UAAO;AACP,EAAA,gBAAM,EAAA,CAAA,GAAU,CAAA;WAChB,EAAA,MAAA,OAAkB,kCAAK;AACvB,CAAA,CAAA;AACH;AACH,MAAA,cAAA,GAAA,iBAAA,CAAA,OAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"env-config.js","sources":["../../src/config/env-config.ts"],"sourcesContent":[null],"names":[],"mappings":"mFAGA,MAAM,GAAG,GAAG,cAAc,EAAE;AAEf,MAAA,MAAM,GAAG,QAAQ,CAAC,GAAG,EAAE;AAChC,EAAA,WAAA,EAAW,GAAE,CAAA;AAChB,IAAE,OAAA,EAAA,GAAA;;;"}
1
+ {"version":3,"file":"env-config.js","sources":["../../src/config/env-config.ts"],"sourcesContent":[null],"names":[],"mappings":"mFAGA,MAAM,GAAG,GAAG,cAAc,EAAE;AAErB,MAAM,MAAM,GAAG,QAAQ,CAAC,GAAG,EAAE;AAChC,EAAA,WAAA,EAAW,GAAE,CAAA;AAChB,IAAE,OAAA,EAAA,GAAA;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"chatBoxWithLoader.d.ts","sourceRoot":"","sources":["../../src/container/chatBoxWithLoader.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAM/B,QAAA,MAAM,iBAAiB,mCAEtB,CAAC;AACF,eAAe,iBAAiB,CAAC;AAEjC,eAAO,MAAM,MAAM;;;;;CAMlB,CAAC;AAEF,wBAAsB,YAAY,CAAC,EAAE,OAAO,EAAE,MAAM,EAAE,YAAY,EAAE;;;;CAAA,gBAenE"}
1
+ {"version":3,"file":"chatBoxWithLoader.d.ts","sourceRoot":"","sources":["../../src/container/chatBoxWithLoader.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAM/B,QAAA,MAAM,iBAAiB,GAAI,UAAK,sBAE/B,CAAC;AACF,eAAe,iBAAiB,CAAC;AAEjC,eAAO,MAAM,MAAM,GAAI;;;CAAoB;;CAM1C,CAAC;AAEF,wBAAsB,YAAY,CAAC,EAAE,OAAO,EAAE,MAAM,EAAE,YAAY,EAAE;;;;CAAA,gBAenE"}
@@ -3,7 +3,7 @@ import { ClientContainerService } from '@adminide-stack/core';
3
3
  import { matchParentRoute } from '@admin-layout/client/lib/utils/parentRoute.js';
4
4
  import { config } from '../config/env-config.js';
5
5
  import '@chatscope/chat-ui-kit-react';
6
- import 'common/lib/generated/generated.js';
6
+ import 'common/graphql';
7
7
  import 'lodash-es';
8
8
  import { CustomerSupportChat } from '../components/CustomerSupportChat/CustomerSupportChat.js';
9
9
  const ChatBoxWithLoader = props => {
@@ -17,7 +17,7 @@ const loader = ({
17
17
  routeConfig
18
18
  } = context;
19
19
  const parentRoute = matchParentRoute(routeConfig, config.LAYOUT_ROOT);
20
- // returnInfo: {"returnType":"json","keys":["parentRoute"],"hasOptions":false}
20
+ // returnInfo: {"keys":["parentRoute"],"hasOptions":false}
21
21
  return {
22
22
  data: [parentRoute]
23
23
  };
@@ -1 +1 @@
1
- {"version":3,"file":"chatBoxWithLoader.js","sources":["../../src/container/chatBoxWithLoader.tsx"],"sourcesContent":[null],"names":[],"mappings":"4YAMA,MAAM,iBAAiB,GAAG,KAAC,IAAS;SACzB,KAAA,CAAA,aAAA,CAAA,mBAAoB,EAAA,IAAA,CAAA;AAC/B;AAGa,MAAA,MAAM,GAAG,CAAC;AACnB,EAAA,OAAA;;MAIO;AACX,EAAE,MAAA;AAEF,IAAM;MAC0E,OAAA;AAC5E,EAAA,MAAA,WAAgB,GAAA,gBAAS,CAAA,WAAe,EAAA,MAAA,CAAA,WAAA,CAAA;AACxC,EAAA,OAAA;AAEA,IAAA;AACI,GAAA;;AAEA,eAAA,YAAoB,CAAO;SAC9B;QAAQ;AACL,EAAA;AACA,CAAA,EAAA;;AAGJ,EAAA,MAAA,aAAiB,MAAC,YAAA,EAAA;AACtB,EAAC,MAAA;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"chatBoxWithLoader.js","sources":["../../src/container/chatBoxWithLoader.tsx"],"sourcesContent":[null],"names":[],"mappings":"yXAMA,MAAM,iBAAiB,GAAG,KAAC,IAAO;SAC9B,KAAO,CAAA,aAAA,CAAA,mBAAC,EAAmB,IAAA,CAAA;AAC/B;AAGO,MAAM,MAAM,GAAG,CAAC;AACnB,EAAA,OAAA;;MAIA;AACJ,EAAE,MAAA;AAEF,IAAA;MACI,OAAA;AACA,EAAA,MAAA,WAAM,GAAU,gBAAS,CAAA,WAAe,EAAA,MAAA,CAAA,WAAA,CAAA;AACxC,EAAA,OAAA;AAEA,IAAA;AACI,GAAA;;AAEA,eAAA,YAAoB,CAAO;SAC9B;QAAC;AACE,EAAA;AACA,CAAA,EAAA;;AAGJ,EAAA,MAAA,aAAiB,MAAC,YAAA,EAAA;AACtB,EAAC,MAAA;;;;;;;;;;;;;;"}
package/lib/module.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"module.js","sources":["../src/module.tsx"],"sourcesContent":[null],"names":[],"mappings":"2FAGA,cAAe,IAAI,OAAO,CAAC;AACvB,EAAA,WAAA,EAAW,cAAgB;cACf,EAAA,CAAA,2DAAG;AAClB,CAAA,CAAC"}
1
+ {"version":3,"file":"module.js","sources":["../src/module.tsx"],"sourcesContent":[null],"names":[],"mappings":"2FAGA,cAAe,IAAI,OAAO,CAAC;AACvB,EAAA,WAAA,EAAW,cAAE;cACb,EAAY,CAAA,2DAAG;AAClB,CAAA,CAAC"}
package/lib/routes.json CHANGED
@@ -13,7 +13,6 @@
13
13
  "hasClientLoader": true,
14
14
  "hasComponent": true,
15
15
  "loaderReturnInfo": {
16
- "returnType": "json",
17
16
  "hasOptions": false,
18
17
  "keys": [
19
18
  "parentRoute"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@messenger-box/chat-ui",
3
- "version": "10.0.3-alpha.2",
3
+ "version": "10.0.3-alpha.202",
4
4
  "description": "Account browser",
5
5
  "license": "ISC",
6
6
  "author": "CDMBase LLC",
@@ -43,8 +43,8 @@
43
43
  "@chatscope/chat-ui-kit-react": "^1.10.1",
44
44
  "@chatscope/chat-ui-kit-styles": "^1.4.0",
45
45
  "@chatscope/use-chat": "^3.1.1",
46
- "@messenger-box/core": "10.0.3-alpha.0",
47
- "@messenger-box/platform-client": "10.0.3-alpha.0",
46
+ "@messenger-box/core": "10.0.3-alpha.202",
47
+ "@messenger-box/platform-client": "10.0.3-alpha.202",
48
48
  "date-fns": "^4.1.0",
49
49
  "date-fns-tz": "^3.2.0",
50
50
  "emoji-mart": "^3.0.1",
@@ -55,7 +55,6 @@
55
55
  "@adminide-stack/core": "*",
56
56
  "@adminide-stack/user-auth0-browser": "*",
57
57
  "@cdm-logger/client": "*",
58
- "@chakra-ui/react": "*",
59
58
  "@common-stack/client-react": "*",
60
59
  "@emotion/react": ">=11",
61
60
  "@emotion/styled": ">=11",
@@ -76,5 +75,5 @@
76
75
  "typescript": {
77
76
  "definition": "lib/index.d.ts"
78
77
  },
79
- "gitHead": "5af212ba674f013e84bdf055e0999702f088263d"
78
+ "gitHead": "a52f86b51a44fb8506bd2e2c43ce547f10ec3f4a"
80
79
  }
package/CHANGELOG.md DELETED
@@ -1,88 +0,0 @@
1
- # Change Log
2
-
3
- All notable changes to this project will be documented in this file.
4
- See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
-
6
- ## [10.0.3-alpha.2](https://github.com/cdmbase/messenger-box/compare/v10.0.3-alpha.1...v10.0.3-alpha.2) (2025-02-24)
7
-
8
- **Note:** Version bump only for package @messenger-box/chat-ui
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/chat-ui
13
-
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)
15
-
16
- **Note:** Version bump only for package @messenger-box/chat-ui
17
-
18
- ## [10.0.2-alpha.4](https://github.com/CDEBase/messenger-box/compare/v10.0.2-alpha.3...v10.0.2-alpha.4) (2025-02-10)
19
-
20
- **Note:** Version bump only for package @messenger-box/chat-ui
21
-
22
- ## [10.0.2-alpha.3](https://github.com/CDEBase/messenger-box/compare/v10.0.2-alpha.2...v10.0.2-alpha.3) (2025-02-10)
23
-
24
- **Note:** Version bump only for package @messenger-box/chat-ui
25
-
26
- ## [10.0.2-alpha.2](https://github.com/CDEBase/messenger-box/compare/v10.0.2-alpha.1...v10.0.2-alpha.2) (2025-02-10)
27
-
28
- **Note:** Version bump only for package @messenger-box/chat-ui
29
-
30
- ## [10.0.2-alpha.0](https://github.com/cdmbase/messenger-box/compare/v9.0.4-alpha.23...v10.0.2-alpha.0) (2025-02-04)
31
-
32
- **Note:** Version bump only for package @messenger-box/chat-ui
33
-
34
- ## [10.0.1-alpha.0](https://github.com/cdmbase/messenger-box/compare/v9.0.4-alpha.23...v10.0.1-alpha.0) (2025-02-04)
35
-
36
- **Note:** Version bump only for package @messenger-box/chat-ui
37
-
38
- ## [9.0.4-alpha.23](https://github.com/CDEBase/messenger-box/compare/v9.0.4-alpha.22...v9.0.4-alpha.23) (2025-02-01)
39
-
40
- **Note:** Version bump only for package @messenger-box/chat-ui
41
-
42
- ## [9.0.4-alpha.22](https://github.com/CDEBase/messenger-box/compare/v9.0.4-alpha.21...v9.0.4-alpha.22) (2025-01-31)
43
-
44
- **Note:** Version bump only for package @messenger-box/chat-ui
45
-
46
- ## [9.0.4-alpha.17](https://github.com/CDEBase/messenger-box/compare/v9.0.4-alpha.16...v9.0.4-alpha.17) (2024-10-17)
47
-
48
- **Note:** Version bump only for package @messenger-box/chat-ui
49
-
50
- ## [9.0.4-alpha.16](https://github.com/CDEBase/messenger-box/compare/v9.0.4-alpha.15...v9.0.4-alpha.16) (2024-10-08)
51
-
52
- **Note:** Version bump only for package @messenger-box/chat-ui
53
-
54
- ## [9.0.4-alpha.15](https://github.com/CDEBase/messenger-box/compare/v9.0.4-alpha.14...v9.0.4-alpha.15) (2024-09-30)
55
-
56
- **Note:** Version bump only for package @messenger-box/chat-ui
57
-
58
- ## [9.0.4-alpha.7](https://github.com/CDEBase/messenger-box/compare/v9.0.4-alpha.6...v9.0.4-alpha.7) (2024-09-20)
59
-
60
- **Note:** Version bump only for package @messenger-box/chat-ui
61
-
62
- ## [9.0.4-alpha.1](https://github.com/CDEBase/messenger-box/compare/v9.0.4-alpha.0...v9.0.4-alpha.1) (2024-09-12)
63
-
64
- **Note:** Version bump only for package @messenger-box/chat-ui
65
-
66
- ## [9.0.2-alpha.0](https://github.com/CDEBase/messenger-box/compare/v7.2.6-alpha.10...v9.0.2-alpha.0) (2024-09-06)
67
-
68
- **Note:** Version bump only for package @messenger-box/chat-ui
69
-
70
- ## [7.2.6-alpha.4](https://github.com/CDEBase/messenger-box/compare/v7.2.6-alpha.3...v7.2.6-alpha.4) (2024-08-12)
71
-
72
- **Note:** Version bump only for package @messenger-box/chat-ui
73
-
74
- ## 7.2.6-alpha.0 (2024-08-11)
75
-
76
- **Note:** Version bump only for package @messenger-box/chat-ui
77
-
78
- ## 7.2.4-alpha.0 (2024-07-19)
79
-
80
- **Note:** Version bump only for package @messenger-box/chat-ui
81
-
82
- ## [7.2.1-alpha.2](https://github.com/CDEBase/messenger-box/compare/v7.2.1-alpha.1...v7.2.1-alpha.2) (2024-07-16)
83
-
84
- **Note:** Version bump only for package @messenger-box/chat-ui
85
-
86
- ## 7.2.1-alpha.0 (2024-07-15)
87
-
88
- **Note:** Version bump only for package @messenger-box/chat-ui
package/jest.config.js DELETED
@@ -1,9 +0,0 @@
1
- const base = require('../../../jest.config.base');
2
- const packageJson = require('./package');
3
-
4
- module.exports = {
5
- ...base,
6
- testEnvironment: 'jsdom', // This is overriden, from the base testEnvironment
7
- name: packageJson.name,
8
- displayName: packageJson.name,
9
- };
package/rollup.config.mjs DELETED
@@ -1,36 +0,0 @@
1
-
2
- import { createRollupConfig } from '../../../rollup.config.base.mjs';
3
-
4
- const additionalPlugins = [];
5
- // Use the createRollupConfig function to merge the base and specific configurations
6
- export default (commandLineArgs) => {
7
- const isWatchMode = commandLineArgs.watch;
8
- return [
9
- createRollupConfig(
10
- {
11
- input: ['src/index.ts'],
12
- plugins: [
13
- // Spread in additional plugins specific to this config
14
- ...additionalPlugins,
15
- ],
16
- output: [
17
- {
18
- dir: 'lib',
19
- format: 'es',
20
- name: 'chat-ui',
21
- compact: true,
22
- exports: 'named',
23
- sourcemap: true,
24
- preserveModules: true,
25
- chunkFileNames: '[name]-[hash].[format].js',
26
- globals: { react: 'React' },
27
- },
28
- ],
29
- },
30
- {
31
- isWatchMode,
32
- generateRoutesJSON: true,
33
- },
34
- ),
35
- ];
36
- };
@@ -1,88 +0,0 @@
1
- import React, { useState, useMemo, useEffect, useCallback, useRef } from 'react';
2
- import {
3
- MainContainer,
4
- Sidebar,
5
- ConversationList,
6
- Conversation,
7
- Avatar,
8
- MessageGroup,
9
- Message,
10
- ChatContainer,
11
- ConversationHeader,
12
- MessageList,
13
- MessageInput,
14
- } from '@chatscope/chat-ui-kit-react';
15
- import { useOnPublicPostAddedSubscription, useSendPublicMessageMutation } from 'common/lib/generated/generated.js';
16
- import { uniqBy } from 'lodash-es';
17
-
18
- export const Chat = ({ user, channelId, channelMessages, setChannelMessages }) => {
19
- // Message input value
20
- const [value, setValue] = useState('');
21
- const [totalCount, setTotalCount] = useState(0);
22
-
23
- const [sendMsg] = useSendPublicMessageMutation();
24
-
25
- const chatContainerRef = useRef(null);
26
-
27
- const {
28
- data: newThreadMsg,
29
- loading: newThreadMsgLoading,
30
- error: newThreadMsgError,
31
- } = useOnPublicPostAddedSubscription({
32
- variables: {
33
- channelId: channelId?.toString(),
34
- },
35
- });
36
-
37
- const handleSend = async (text: any) => {
38
- if (!(text && channelId)) {
39
- return;
40
- }
41
-
42
- await sendMsg({
43
- variables: {
44
- channelId: channelId?.toString(),
45
- messageInput: {
46
- content: text?.toString(),
47
- },
48
- },
49
- });
50
- };
51
- React.useEffect(() => {
52
- if (newThreadMsg) {
53
- const msg = newThreadMsg?.publicPostAdded;
54
- setTotalCount((preCount: any) => preCount + 1);
55
- setChannelMessages((oldMessages: any) => uniqBy([...oldMessages, msg], ({ id }) => id));
56
-
57
- // Scroll to the bottom after adding a new message
58
- const chatContainer = chatContainerRef.current;
59
- chatContainer.scrollToBottom();
60
- }
61
- }, []);
62
-
63
- return (
64
- <MainContainer>
65
- <ChatContainer>
66
- <MessageList ref={chatContainerRef}>
67
- {channelMessages.map((g) => (
68
- <MessageGroup key={g.id} direction={'outgoing'}>
69
- <MessageGroup.Messages>
70
- <Message
71
- key={g.id}
72
- model={
73
- {
74
- type: 'text',
75
- payload: g.message,
76
- } as any
77
- }
78
- />
79
- </MessageGroup.Messages>
80
- </MessageGroup>
81
- ))}
82
- </MessageList>
83
-
84
- <MessageInput placeholder="Type message here" onSend={handleSend} />
85
- </ChatContainer>
86
- </MainContainer>
87
- );
88
- };
@@ -1,233 +0,0 @@
1
- import React, { useEffect, useState } from 'react';
2
- import { Box, Button, Image, useMediaQuery } from '@chakra-ui/react';
3
- import { BiConversation } from '@react-icons/all-files/bi/BiConversation.js';
4
- import { BiMessageDetail } from '@react-icons/all-files/bi/BiMessageDetail.js';
5
- import { MdKeyboardArrowDown } from '@react-icons/all-files/md/MdKeyboardArrowDown.js';
6
- import { BsCardText } from '@react-icons/all-files/bs/BsCardText.js';
7
- import { nanoid } from 'nanoid';
8
- import { AutoDraft, BasicStorage, ChatProvider } from '@chatscope/use-chat';
9
- import { ExampleChatService } from '@chatscope/use-chat/dist/examples/index.js';
10
- import { usePublicMessagesQuery } from 'common/lib/generated/generated.js';
11
- import { uniqBy } from 'lodash-es';
12
- import { Chat } from './Chat';
13
- import { objectId } from '@messenger-box/core';
14
-
15
- export const CustomerSupportChat = () => {
16
- const [isChat, setIsChat] = useState(false);
17
- const [isChatOpen, setIsChatOpen] = useState(false);
18
- const [channelMessages, setChannelMessages] = useState([]);
19
- const [channelId, setChannelId] = useState<string | null>(null);
20
- const [isMobileView, isNonMobileView] = useMediaQuery(['(max-width: 480px)', '(min-width: 480px)']);
21
-
22
- // Storage needs to generate id for messages and groups
23
- const messageIdGenerator = () => nanoid();
24
- const groupIdGenerator = () => nanoid();
25
-
26
- // Create serviceFactory
27
- const serviceFactory = (storage, updateState) => {
28
- return new ExampleChatService(storage, updateState);
29
- };
30
-
31
- useEffect(() => {
32
- const storeChannelId = localStorage.getItem('channelId');
33
-
34
- if (!storeChannelId || storeChannelId === 'undefined') {
35
- // ID is undefined or not present in localStorage
36
- const newId = objectId();
37
- localStorage.setItem('channelId', newId);
38
- setChannelId(newId);
39
- } else {
40
- setChannelId(storeChannelId.toString());
41
- }
42
- }, []);
43
-
44
- const { data, loading, error } = usePublicMessagesQuery({
45
- variables: {
46
- channelId: channelId?.toString(),
47
- },
48
- });
49
-
50
- React.useEffect(() => {
51
- if (data?.publicMessages?.data) {
52
- const currentConversaion = data?.publicMessages?.data?.slice().reverse();
53
- currentConversaion.map((msg) => {
54
- setChannelMessages((oldMessages: any) => uniqBy([...oldMessages, msg], ({ id }) => id));
55
- });
56
- }
57
- }, [data, isChat]);
58
- const handleChat = () => {
59
- setIsChatOpen(true);
60
- };
61
- const handleChatClick = () => {
62
- setIsChat(true);
63
- };
64
- const chatStorage = new BasicStorage({ groupIdGenerator, messageIdGenerator });
65
-
66
- return (
67
- <>
68
- {!isChat ? (
69
- <Box style={{ position: 'fixed', bottom: '20px', right: '30px', zIndex: '2' }}>
70
- {/* @ts-ignore */}
71
- <Button
72
- background={'#3182ce'}
73
- fontSize={'38px'}
74
- padding={'16px'}
75
- width={'72px'}
76
- height={'72px'}
77
- borderRadius={'50%'}
78
- display={'flex'}
79
- alignItems={'center'}
80
- justifyContent={'center'}
81
- onClick={handleChatClick}
82
- >
83
- <BiConversation />
84
- </Button>
85
- </Box>
86
- ) : (
87
- <Box
88
- style={{
89
- position: 'fixed',
90
- bottom: '20px',
91
- right: '30px',
92
- zIndex: '2',
93
- width: isMobileView ? '80vw' : '25vw',
94
- }}
95
- >
96
- <Box textAlign={'left'} marginBottom={'10px'}>
97
- {/* @ts-ignore */}
98
- <Button
99
- background={'#3182ce'}
100
- fontSize={'42px'}
101
- width={'62px'}
102
- height={'62px'}
103
- borderRadius={'50%'}
104
- display={'flex'}
105
- alignItems={'center'}
106
- justifyContent={'center'}
107
- onClick={() => setIsChat(false)}
108
- >
109
- <MdKeyboardArrowDown />
110
- </Button>
111
- </Box>
112
-
113
- <Box style={{ borderRadius: '20px', background: 'white' }}>
114
- <Box
115
- style={{
116
- display: 'flex',
117
- backgroundColor: '#3182ce',
118
- padding: '20px 30px',
119
- lineHeight: '7vh',
120
- alignItems: 'center',
121
- }}
122
- >
123
- <Box
124
- style={{
125
- background: '#366c96',
126
- padding: '10px',
127
- borderRadius: '54px',
128
- fontSize: '25px',
129
- }}
130
- >
131
- <BiMessageDetail />
132
- </Box>
133
- <Box style={{ fontWeight: '700', fontSize: '18px', marginLeft: '30px' }}>
134
- Conversation(s)
135
- </Box>
136
- </Box>
137
- <Box
138
- style={{
139
- height: '50vh',
140
- background: '#fafafa',
141
- color: 'black',
142
- display: 'flex',
143
- flexDirection: 'column',
144
- alignContent: 'stretch',
145
- justifyContent: 'space-evenly',
146
- alignItems: 'center',
147
- }}
148
- >
149
- {!isChatOpen && !channelMessages.length ? (
150
- <Box textAlign={'center'}>
151
- {/* @ts-ignore */}
152
- <Image
153
- width={'50%'}
154
- margin={'auto'}
155
- src="https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcThpk_KxVKIRa0_fxwaVgIFcRvTgUem0LbkaA&usqp=CAU"
156
- />
157
- <Box textAlign={'center'}> No ongoing Conversation</Box>
158
- {/* @ts-ignore */}
159
- <Button
160
- style={{
161
- backgroundColor: '#3182ce',
162
- padding: '22px 26px',
163
- marginTop: '20px',
164
- borderRadius: '8px',
165
- color: 'whitesmoke',
166
- }}
167
- leftIcon={<BiMessageDetail fontSize={'22px'} />}
168
- onClick={handleChat}
169
- >
170
- Chat now
171
- </Button>
172
- </Box>
173
- ) : (
174
- <Box w={'100%'} h={'50vh'}>
175
- <ChatProvider
176
- serviceFactory={serviceFactory}
177
- storage={chatStorage}
178
- config={{
179
- typingThrottleTime: 250,
180
- typingDebounceTime: 900,
181
- debounceTyping: true,
182
- autoDraft: AutoDraft.Save | AutoDraft.Restore,
183
- }}
184
- >
185
- <Chat
186
- user={{ name: 'beeena', avatar: '' }}
187
- channelId={channelId}
188
- setChannelMessages={setChannelMessages}
189
- channelMessages={channelMessages}
190
- />
191
- </ChatProvider>
192
- </Box>
193
- )}
194
- </Box>
195
- <Box
196
- style={{
197
- height: '7vh',
198
- background: 'white',
199
- color: 'black',
200
- display: 'flex',
201
- alignContent: 'center',
202
- alignItems: 'center',
203
- padding: '30px 0px',
204
- justifyContent: 'space-evenly',
205
- boxShadow: '0 0 5px rgba(0, 0, 0, 0.9)',
206
- outline: '1px solid transparent',
207
- }}
208
- >
209
- <Box
210
- style={{
211
- display: 'flex',
212
- flexDirection: 'column',
213
- alignItems: 'center',
214
- }}
215
- >
216
- <BiMessageDetail /> Conversation
217
- </Box>
218
- <Box
219
- style={{
220
- display: 'flex',
221
- flexDirection: 'column',
222
- alignItems: 'center',
223
- }}
224
- >
225
- <BsCardText /> Articles{' '}
226
- </Box>
227
- </Box>
228
- </Box>
229
- </Box>
230
- )}
231
- </>
232
- );
233
- };
@@ -1,2 +0,0 @@
1
- export * from './Chat';
2
- export * from './CustomerSupportChat';
@@ -1 +0,0 @@
1
- export { Chat, CustomerSupportChat } from './CustomerSupportChat';
package/src/compute.ts DELETED
@@ -1,18 +0,0 @@
1
- import { getFilteredRoutes } from '@common-stack/client-react/lib/utils/filteredRoutes.js';
2
- const key = 'chat-box';
3
-
4
- const chatBox: any[] = [
5
- {
6
- path: '/chat',
7
- key: key,
8
- exact: false,
9
- auth: 'optional',
10
- extraPermissions: ['*'],
11
- component: () => import('./container/chatBoxWithLoader'),
12
- },
13
- ];
14
-
15
- // get routes
16
- const filteredRoutes = getFilteredRoutes(chatBox);
17
-
18
- export { filteredRoutes };
@@ -1,8 +0,0 @@
1
- import { cleanEnv, num, str } from 'envalid';
2
- import { getEnvironment } from '@common-stack/core';
3
-
4
- const env = getEnvironment();
5
-
6
- export const config = cleanEnv(env, {
7
- LAYOUT_ROOT: str({ default: '/', desc: 'Layout parent route' }),
8
- });
@@ -1 +0,0 @@
1
- export { config } from './env-config';
@@ -1,35 +0,0 @@
1
- import * as React from 'react';
2
- import { ClientContainerService } from '@adminide-stack/core';
3
- import { matchParentRoute } from '@admin-layout/client/lib/utils/parentRoute.js';
4
- import { config } from '../config';
5
- import { CustomerSupportChat } from '../components';
6
-
7
- const ChatBoxWithLoader = (props) => {
8
- return <CustomerSupportChat />;
9
- };
10
- export default ChatBoxWithLoader;
11
-
12
- export const loader = ({ context, request }) => {
13
- const { routeConfig } = context;
14
-
15
- const parentRoute = matchParentRoute(routeConfig, config.LAYOUT_ROOT);
16
-
17
- return { parentRoute };
18
- };
19
-
20
- export async function clientLoader({ request, params, serverLoader }) {
21
- // During client-side navigations, we hit our exposed API endpoints directly
22
- const loaderData = await serverLoader();
23
- const { apolloState } = loaderData;
24
-
25
- try {
26
- const { container } = (window as any).__CLIENT_SERVICE__;
27
- const organizationContext = container.get(ClientContainerService.ApolloErrorHandler);
28
- organizationContext.hydrate(apolloState);
29
- } catch (e) {
30
- console.error('Error in client hydrate');
31
- console.error(e);
32
- }
33
-
34
- return loaderData;
35
- }
package/src/index.ts DELETED
@@ -1,6 +0,0 @@
1
- import { Feature } from '@common-stack/client-react';
2
- import chatBox from './module';
3
-
4
- export { Chat, CustomerSupportChat } from './components';
5
-
6
- export default new Feature(chatBox);
package/src/module.tsx DELETED
@@ -1,7 +0,0 @@
1
- import { Feature } from '@common-stack/client-react';
2
- import { filteredRoutes } from './compute';
3
-
4
- export default new Feature({
5
- routeConfig: filteredRoutes,
6
- stylesInsert: ['@chatscope/chat-ui-kit-styles/dist/default/styles.min.css'],
7
- });
package/tsconfig.json DELETED
@@ -1,14 +0,0 @@
1
- {
2
- "extends": "../../../tsconfig.json",
3
- "compilerOptions": {
4
- "rootDir": "./src",
5
- "outDir": "lib",
6
- "declarationDir": "lib",
7
- "declaration": true,
8
- "declarationMap": true,
9
- "skipLibCheck": true,
10
- "types": ["@types/node", "@types/jest", "../../../typings"]
11
- },
12
- "exclude": ["../../../node_modules", "node_modules", "lib", "dist", "webpack.config.js", "rollup.config.mjs"],
13
- "include": ["src", "./typings/*.d.ts", "type.d.ts"],
14
- }
package/webpack.config.js DELETED
@@ -1,92 +0,0 @@
1
- // eslint-disable-next-line import/no-extraneous-dependencies
2
- const nodeExternals = require('webpack-node-externals');
3
- // eslint-disable-next-line import/no-extraneous-dependencies
4
- const webpack = require('webpack');
5
- const path = require('path');
6
-
7
- const webpackOpts = {
8
- mode: 'development',
9
- entry: {
10
- index: './src/index.ts',
11
- },
12
- target: 'node',
13
- output: {
14
- path: path.join(__dirname, 'lib'),
15
- filename: '[name].js',
16
- libraryTarget: 'commonjs2',
17
- },
18
- resolve: {
19
- extensions: [
20
- '.js',
21
- '.jsx',
22
- '.ts',
23
- '.tsx',
24
- '.graphql',
25
- '.graphqls',
26
- '.gql',
27
- '.native.tsx',
28
- '.native.ts',
29
- '.json',
30
- ],
31
- },
32
- plugins: [
33
- new webpack.LoaderOptionsPlugin({
34
- options: {
35
- test: /\.tsx?$/,
36
- ts: {
37
- compiler: 'typescript',
38
- configFile: 'tsconfig.json',
39
- },
40
- tslint: {
41
- emitErrors: true,
42
- failOnHint: true,
43
- },
44
- },
45
- }),
46
- ],
47
- devtool: 'source-map',
48
- module: {
49
- rules: [
50
- {
51
- test: /\.(tsx)?$/,
52
- use: 'ts-loader',
53
- },
54
- {
55
- test: /\.mjs$/,
56
- include: /node_modules/,
57
- type: 'javascript/auto',
58
- },
59
- {
60
- test: /\.(gql)$/,
61
- exclude: /node_modules/,
62
- use: ['graphql-tag/loader'],
63
- },
64
- {
65
- test: /\.graphql?/,
66
- exclude: /node_modules/,
67
- use: 'raw-loader',
68
- },
69
- {
70
- test: /\.(png|jpg|gif|webp)$/i,
71
- use: {
72
- loader: 'url-loader',
73
- options: {
74
- limit: 8192,
75
- name: 'static/media/[name].[hash:8].[ext]',
76
- },
77
- },
78
- },
79
- {
80
- test: /\.svg$/,
81
- use: ['@svgr/webpack'],
82
- },
83
- {
84
- test: /\.json$/,
85
- loader: 'json-loader',
86
- },
87
- ],
88
- },
89
- externals: [nodeExternals({ modulesDir: '../../../node_modules' }), nodeExternals()],
90
- };
91
-
92
- module.exports = webpackOpts;