@rh-support/react-context 0.3.7 → 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (31) hide show
  1. package/lib/esm/GlobalContextWrapper.d.ts +0 -1
  2. package/lib/esm/GlobalContextWrapper.d.ts.map +1 -1
  3. package/lib/esm/components/index.d.ts +0 -1
  4. package/lib/esm/components/index.d.ts.map +1 -1
  5. package/lib/esm/components/index.js +0 -1
  6. package/lib/esm/hooks/index.d.ts +0 -3
  7. package/lib/esm/hooks/index.d.ts.map +1 -1
  8. package/lib/esm/hooks/index.js +0 -3
  9. package/package.json +7 -7
  10. package/lib/esm/components/EmbeddedServiceChat/ChatSVGIcon.d.ts +0 -2
  11. package/lib/esm/components/EmbeddedServiceChat/ChatSVGIcon.d.ts.map +0 -1
  12. package/lib/esm/components/EmbeddedServiceChat/ChatSVGIcon.js +0 -9
  13. package/lib/esm/components/EmbeddedServiceChat/EmbeddedServiceChat.d.ts +0 -4
  14. package/lib/esm/components/EmbeddedServiceChat/EmbeddedServiceChat.d.ts.map +0 -1
  15. package/lib/esm/components/EmbeddedServiceChat/EmbeddedServiceChat.js +0 -13
  16. package/lib/esm/components/EmbeddedServiceChat/ExtraPreChatInfo.d.ts +0 -12
  17. package/lib/esm/components/EmbeddedServiceChat/ExtraPreChatInfo.d.ts.map +0 -1
  18. package/lib/esm/components/EmbeddedServiceChat/ExtraPreChatInfo.js +0 -29
  19. package/lib/esm/components/EmbeddedServiceChat/embeddedServiceChat.css +0 -22
  20. package/lib/esm/components/EmbeddedServiceChat/index.d.ts +0 -2
  21. package/lib/esm/components/EmbeddedServiceChat/index.d.ts.map +0 -1
  22. package/lib/esm/components/EmbeddedServiceChat/index.js +0 -1
  23. package/lib/esm/hooks/useChatConfig.d.ts +0 -20
  24. package/lib/esm/hooks/useChatConfig.d.ts.map +0 -1
  25. package/lib/esm/hooks/useChatConfig.js +0 -58
  26. package/lib/esm/hooks/useChatInit.d.ts +0 -15
  27. package/lib/esm/hooks/useChatInit.d.ts.map +0 -1
  28. package/lib/esm/hooks/useChatInit.js +0 -62
  29. package/lib/esm/hooks/usePreChatFormDetails.d.ts +0 -12
  30. package/lib/esm/hooks/usePreChatFormDetails.d.ts.map +0 -1
  31. package/lib/esm/hooks/usePreChatFormDetails.js +0 -78
@@ -9,7 +9,6 @@ declare global {
9
9
  portal: any;
10
10
  Raven: any;
11
11
  chrometwo_ready: any;
12
- embedded_svc: any;
13
12
  }
14
13
  interface Document {
15
14
  documentMode: any;
@@ -1 +1 @@
1
- {"version":3,"file":"GlobalContextWrapper.d.ts","sourceRoot":"","sources":["../../src/GlobalContextWrapper.tsx"],"names":[],"mappings":"AAmBA,UAAU,MAAM;IACZ,QAAQ,EAAE,GAAG,CAAC,OAAO,GAAG,GAAG,CAAC,OAAO,EAAE,CAAC;CACzC;AAED,OAAO,CAAC,MAAM,CAAC;IACX,UAAU,MAAM;QACZ,SAAS,EAAE,GAAG,CAAC;QACf,oBAAoB,EAAE,GAAG,CAAC;QAC1B,iBAAiB,EAAE,CAAC,SAAS,EAAE,MAAM,EAAE,EAAE,QAAQ,EAAE,CAAC,GAAG,MAAM,OAAA,KAAK,GAAG,KAAK,GAAG,CAAC;QAC9E,MAAM,EAAE,GAAG,CAAC;QACZ,KAAK,EAAE,GAAG,CAAC;QACX,eAAe,EAAE,GAAG,CAAC;QACrB,YAAY,EAAE,GAAG,CAAC;KACrB;IAED,UAAU,QAAQ;QACd,YAAY,EAAE,GAAG,CAAC;KACrB;CACJ;AA6FD,eAAO,MAAM,oBAAoB,UAAW,MAAM,gBAKjD,CAAC"}
1
+ {"version":3,"file":"GlobalContextWrapper.d.ts","sourceRoot":"","sources":["../../src/GlobalContextWrapper.tsx"],"names":[],"mappings":"AAmBA,UAAU,MAAM;IACZ,QAAQ,EAAE,GAAG,CAAC,OAAO,GAAG,GAAG,CAAC,OAAO,EAAE,CAAC;CACzC;AAED,OAAO,CAAC,MAAM,CAAC;IACX,UAAU,MAAM;QACZ,SAAS,EAAE,GAAG,CAAC;QACf,oBAAoB,EAAE,GAAG,CAAC;QAC1B,iBAAiB,EAAE,CAAC,SAAS,EAAE,MAAM,EAAE,EAAE,QAAQ,EAAE,CAAC,GAAG,MAAM,OAAA,KAAK,GAAG,KAAK,GAAG,CAAC;QAC9E,MAAM,EAAE,GAAG,CAAC;QACZ,KAAK,EAAE,GAAG,CAAC;QACX,eAAe,EAAE,GAAG,CAAC;KACxB;IAED,UAAU,QAAQ;QACd,YAAY,EAAE,GAAG,CAAC;KACrB;CACJ;AA6FD,eAAO,MAAM,oBAAoB,UAAW,MAAM,gBAKjD,CAAC"}
@@ -4,5 +4,4 @@ export * from './AccountSelector';
4
4
  export * from './NewFeatureAnnouncement';
5
5
  export * from './SharedModals';
6
6
  export * from './HostnameAwarenessModal';
7
- export * from './EmbeddedServiceChat';
8
7
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,iBAAiB,CAAC;AAChC,cAAc,mBAAmB,CAAC;AAClC,cAAc,0BAA0B,CAAC;AACzC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,0BAA0B,CAAC;AACzC,cAAc,uBAAuB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,iBAAiB,CAAC;AAChC,cAAc,mBAAmB,CAAC;AAClC,cAAc,0BAA0B,CAAC;AACzC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,0BAA0B,CAAC"}
@@ -4,4 +4,3 @@ export * from './AccountSelector';
4
4
  export * from './NewFeatureAnnouncement';
5
5
  export * from './SharedModals';
6
6
  export * from './HostnameAwarenessModal';
7
- export * from './EmbeddedServiceChat';
@@ -5,7 +5,4 @@ export * from './useSubscriptionAbused';
5
5
  export * from './useCanEditCase';
6
6
  export * from './useCanCreateCase';
7
7
  export * from './useUserPreferences';
8
- export * from './useChatInit';
9
- export * from './usePreChatFormDetails';
10
- export * from './useChatConfig';
11
8
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/hooks/index.ts"],"names":[],"mappings":"AAAA,cAAc,yBAAyB,CAAC;AACxC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,0BAA0B,CAAC;AACzC,cAAc,yBAAyB,CAAC;AACxC,cAAc,kBAAkB,CAAC;AACjC,cAAc,oBAAoB,CAAC;AACnC,cAAc,sBAAsB,CAAC;AACrC,cAAc,eAAe,CAAC;AAC9B,cAAc,yBAAyB,CAAC;AACxC,cAAc,iBAAiB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/hooks/index.ts"],"names":[],"mappings":"AAAA,cAAc,yBAAyB,CAAC;AACxC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,0BAA0B,CAAC;AACzC,cAAc,yBAAyB,CAAC;AACxC,cAAc,kBAAkB,CAAC;AACjC,cAAc,oBAAoB,CAAC;AACnC,cAAc,sBAAsB,CAAC"}
@@ -5,6 +5,3 @@ export * from './useSubscriptionAbused';
5
5
  export * from './useCanEditCase';
6
6
  export * from './useCanCreateCase';
7
7
  export * from './useUserPreferences';
8
- export * from './useChatInit';
9
- export * from './usePreChatFormDetails';
10
- export * from './useChatConfig';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rh-support/react-context",
3
- "version": "0.3.7",
3
+ "version": "1.0.0",
4
4
  "publishConfig": {
5
5
  "access": "public",
6
6
  "registry": "https://registry.npmjs.org"
@@ -26,7 +26,7 @@
26
26
  "lib/**/*"
27
27
  ],
28
28
  "peerDependencies": {
29
- "@cee-eng/hydrajs": "4.12.7",
29
+ "@cee-eng/hydrajs": "4.13.0",
30
30
  "@patternfly/react-core": "4.202.16",
31
31
  "@patternfly/react-icons": "4.53.16",
32
32
  "@rh-support/components": "^0.1.3",
@@ -41,13 +41,13 @@
41
41
  "react-test-renderer": "17.0.1"
42
42
  },
43
43
  "dependencies": {
44
- "@cee-eng/hydrajs": "4.12.7",
44
+ "@cee-eng/hydrajs": "4.13.0",
45
45
  "@patternfly/react-core": "4.202.16",
46
46
  "@patternfly/react-icons": "4.53.16",
47
- "@rh-support/components": "1.1.84",
47
+ "@rh-support/components": "1.2.0",
48
48
  "@rh-support/types": "0.2.0",
49
- "@rh-support/user-permissions": "0.2.68",
50
- "@rh-support/utils": "0.2.50",
49
+ "@rh-support/user-permissions": "1.0.0",
50
+ "@rh-support/utils": "1.0.0",
51
51
  "i18next": "^19.0.1",
52
52
  "localforage": "^1.7.3",
53
53
  "lodash": "^4.17.21",
@@ -87,5 +87,5 @@
87
87
  "not ie <= 11",
88
88
  "not op_mini all"
89
89
  ],
90
- "gitHead": "2a7f8b7b1c07a45c3b2b564a3eb3a32ca0855677"
90
+ "gitHead": "8c4eecd9b17607a5b010dc65d079327167650bee"
91
91
  }
@@ -1,2 +0,0 @@
1
- export declare const ChatSVGIcon: () => JSX.Element;
2
- //# sourceMappingURL=ChatSVGIcon.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ChatSVGIcon.d.ts","sourceRoot":"","sources":["../../../../src/components/EmbeddedServiceChat/ChatSVGIcon.tsx"],"names":[],"mappings":"AAEA,eAAO,MAAM,WAAW,mBAwBvB,CAAC"}
@@ -1,9 +0,0 @@
1
- import React from 'react';
2
- export const ChatSVGIcon = () => {
3
- return (React.createElement("svg", { width: "36", height: "36", viewBox: "0 0 36 36", fill: "none", xmlns: "http://www.w3.org/2000/svg", xmlnsXlink: "http://www.w3.org/1999/xlink" },
4
- React.createElement("rect", { width: "36", height: "36", fill: "url(#pattern0)" }),
5
- React.createElement("defs", null,
6
- React.createElement("pattern", { id: "pattern0", patternContentUnits: "objectBoundingBox", width: "1", height: "1" },
7
- React.createElement("use", { xlinkHref: "#image0_726_235", transform: "scale(0.00277778)" })),
8
- React.createElement("image", { id: "image0_726_235", width: "360", height: "360", xlinkHref: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAWgAAAFoCAYAAAB65WHVAAAACXBIWXMAAG66AABuugHW3rEXAAAKZ0lEQVR4nO3d4XHUSAKG4e6r/Y8VAc4Ah0AISwSwERwXwXkjgAzAEawzWEIgBByBvBH0lfa0V7t7gGfs0eiT+nmq+OOyB01LvMgaqbu21goAef5hnwBkEmiAUAINEEqgAUIJNEAogQYIJdAAoQQaIJRAA4QSaIBQAg0QSqABQgk0QCiBBggl0AChBBoglEADhBJogFACDRBKoAFCCTRAKIEGCCXQAKEEGiCUQAOEEmiAUAINEEqgAUIJNEAogQYIJdAAoQQaIJRAA4QSaIBQAg0QSqABQgk0QCiBBggl0AChBBoglEADhBJogFACDRBKoAFCCTRAKIEGCCXQAKEEGiCUQAOEEmiAUAINEEqgAUL9sPUdM9b6MmAzYBFDa5+MbL9qa22Tb36s9cdSyvtSyvOAzYGl3JVS3g6t3Rrh/mwy0GOtH0sprwM2Bc7lZmjtjdHuy+YCPZ85/xKwKXBur5xJ92WLgf7isgaduhtau7Tz+7GpuzjmDwTFmV49H2u9svf7sbXb7C4CtgHW5N9AR9wHDRBqa4G+D9gGgLNwBg0QSqABQgk0QCiBBgi1+cmSDvCvUsrn+K2kR9M9ze/seb6lh0B/NiMYicZa7Re+yyUOgFACDRBKoAFCCTRAKIEGCCXQAKEEGiCUQAOEEmiAUAINEEqgAUIJNEAogQYIJdAAoQQaIJRAA4QSaIBQAg0QSqABQgk0QCiBBggl0AChBBoglEADhBJogFACDRBKoAFCCTRAKIEGCCXQAKEEGiCUQAOEEmiAUAINEEqgAUIJNEAogQYIJdAAoQQaIJRAA4QSaIBQAg0QSqABQgk0QCiBBggl0AChBBoglEADhBJogFACDRBKoAFCCTRAKIEGCCXQAKEEGiCUQAOEEmiAUAINEEqgAUIJN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Ag38H5HOINDAV4n0+gQa+CaRXpdAA98l0usRaOBBIr0OgQYOItLnJ9DAwUT6vAQaOIpIn49AA0cT6fMQaOBRnhjpe6P+sNpaS99GINi87NUxK7PcDa1d2qcPcwYNPMkjzqTfGvHDCDTwZEdE+mZo7daIH0aggZOYI/1quoTxldebvvZq/h4O5Bo0cHJjrdNK3xd/vO7Q2iejfDyBBgjlEgdAKIEGCCXQAKEEGiCUQAOEEmiAUAINEEqgAUIJNEAogQYIJdAAoQQaIJRAA4QSaIBQAg0QSqABQgk0QCiBBggl0AChBBoglEADhBJogFACDRBKoAFCCTRAKIEGCCXQAKEEGiCUQAOEEmiAUAINEEqgAUIJNEAogQYIJdAAoQQaIJRAA4QSaIBQAg0QSqABQgk0QCiBBggl0AChBBoglEADhBJogFACDRBKoAFCCTRAKIEGCCXQAKEEGiBRKeU/zxSMin2RnsUAAAAASUVORK5CYII=" }))));
9
- };
@@ -1,4 +0,0 @@
1
- import './embeddedServiceChat.css';
2
- import { FC } from 'react';
3
- export declare const EmbeddedServiceChat: FC;
4
- //# sourceMappingURL=EmbeddedServiceChat.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"EmbeddedServiceChat.d.ts","sourceRoot":"","sources":["../../../../src/components/EmbeddedServiceChat/EmbeddedServiceChat.tsx"],"names":[],"mappings":"AAAA,OAAO,2BAA2B,CAAC;AAEnC,OAAc,EAAE,EAAE,EAAa,MAAM,OAAO,CAAC;AAK7C,eAAO,MAAM,mBAAmB,EAAE,EAiBjC,CAAC"}
@@ -1,13 +0,0 @@
1
- import './embeddedServiceChat.css';
2
- import React, { useEffect } from 'react';
3
- import { useChatInit } from '../..';
4
- import { ChatSVGIcon } from './ChatSVGIcon';
5
- export const EmbeddedServiceChat = () => {
6
- const { loadingChat, isChatStarted, initEmbedChat, onStartChat } = useChatInit();
7
- useEffect(() => {
8
- initEmbedChat();
9
- // eslint-disable-next-line react-hooks/exhaustive-deps
10
- }, []);
11
- return !isChatStarted ? (React.createElement("div", { className: `chatButton ${loadingChat && 'chatLoading'}`, onClick: onStartChat, "data-tracking-id": "embedded-service-chat" },
12
- React.createElement(ChatSVGIcon, null))) : null;
13
- };
@@ -1,12 +0,0 @@
1
- export declare const extraPreChatInfo: {
2
- entityFieldMaps: {
3
- doCreate: boolean;
4
- doFind: boolean;
5
- fieldName: string;
6
- isExactMatch: boolean;
7
- label: string;
8
- }[];
9
- entityName: string;
10
- saveToTranscript: string;
11
- }[];
12
- //# sourceMappingURL=ExtraPreChatInfo.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ExtraPreChatInfo.d.ts","sourceRoot":"","sources":["../../../../src/components/EmbeddedServiceChat/ExtraPreChatInfo.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,gBAAgB;;;;;;;;;;GA6B5B,CAAC"}
@@ -1,29 +0,0 @@
1
- export const extraPreChatInfo = [
2
- {
3
- entityFieldMaps: [
4
- {
5
- doCreate: false,
6
- doFind: true,
7
- fieldName: 'SSO_Username__c',
8
- isExactMatch: true,
9
- label: 'SSO Name',
10
- },
11
- {
12
- doCreate: false,
13
- doFind: true,
14
- fieldName: 'ContactSessionId__c',
15
- isExactMatch: false,
16
- label: 'SessionId',
17
- },
18
- {
19
- doCreate: false,
20
- doFind: true,
21
- fieldName: 'Account',
22
- isExactMatch: true,
23
- label: 'account',
24
- },
25
- ],
26
- entityName: '',
27
- saveToTranscript: 'SSO_Username__c',
28
- },
29
- ];
@@ -1,22 +0,0 @@
1
- .chatButton {
2
- position: fixed;
3
- right: 4rem;
4
- bottom: 1rem;
5
- background: #ffffff;
6
- box-shadow: 0px 2px 3px rgb(0 0 0 / 15%);
7
- border-radius: 3px;
8
- cursor: pointer;
9
- padding: 4px;
10
- width: 44px;
11
- height: 44px;
12
- }
13
-
14
- .chatLoading {
15
- opacity: 0.7;
16
- pointer-events: none;
17
- }
18
-
19
- /* Requested by CCM team */
20
- .agent .chat-content[CLWCP-lwcchatpack_lwcchatpack] {
21
- text-align: left;
22
- }
@@ -1,2 +0,0 @@
1
- export * from './EmbeddedServiceChat';
2
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/EmbeddedServiceChat/index.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAC"}
@@ -1 +0,0 @@
1
- export * from './EmbeddedServiceChat';
@@ -1,20 +0,0 @@
1
- /**
2
- *
3
- * This hook is used for selected chat configuration based on environment
4
- */
5
- export declare const useChatConfig: () => {
6
- host: string;
7
- sandBox: string;
8
- gslbBaseURL: string;
9
- key: string;
10
- appName: string;
11
- extra: {
12
- baseLiveAgentContentURL: string;
13
- deploymentId: string;
14
- buttonId: string;
15
- baseLiveAgentURL: string;
16
- eswLiveAgentDevName: string;
17
- isOfflineSupportEnabled: boolean;
18
- };
19
- };
20
- //# sourceMappingURL=useChatConfig.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"useChatConfig.d.ts","sourceRoot":"","sources":["../../../src/hooks/useChatConfig.ts"],"names":[],"mappings":"AACA;;;GAGG;AACH,eAAO,MAAM,aAAa;;;;;;;;;;;;;;CAoDzB,CAAC"}
@@ -1,58 +0,0 @@
1
- import { Env } from '@cee-eng/hydrajs';
2
- /**
3
- *
4
- * This hook is used for selected chat configuration based on environment
5
- */
6
- export const useChatConfig = () => {
7
- const env = Env.getEnvName();
8
- switch (env) {
9
- case Env.EnvNames.QA:
10
- return {
11
- host: 'https://gss--qa.my.salesforce.com',
12
- sandBox: 'https://qa-gssdex.cs203.force.com/botchat',
13
- gslbBaseURL: 'https://service.force.com',
14
- key: '00D7j0000008oSo',
15
- appName: 'RedHatChatBot',
16
- extra: {
17
- baseLiveAgentContentURL: 'https://c.la3-c1cs-ia4.salesforceliveagent.com/content',
18
- deploymentId: '5727j0000004CqR',
19
- buttonId: '5737j0000004CKB',
20
- baseLiveAgentURL: 'https://d.la3-c1cs-ia4.salesforceliveagent.com/chat',
21
- eswLiveAgentDevName: 'EmbeddedServiceLiveAgent_Parent04I7j000000CadEEAS_180b2280b37',
22
- isOfflineSupportEnabled: false,
23
- },
24
- };
25
- case Env.EnvNames.STAGE:
26
- return {
27
- host: 'https://gss--Stage2.my.salesforce.com',
28
- sandBox: 'https://stage2-gssdex.cs16.force.com/botchat',
29
- gslbBaseURL: 'https://service.force.com',
30
- key: '00Df0000003f0P8',
31
- appName: 'RedHatChatBot',
32
- extra: {
33
- baseLiveAgentContentURL: 'https://c.la1-c1cs-ord.salesforceliveagent.com/content',
34
- deploymentId: '572f00000008QON',
35
- buttonId: '573f00000008QWv',
36
- baseLiveAgentURL: 'https://d.la1-c1cs-ord.salesforceliveagent.com/chat',
37
- eswLiveAgentDevName: 'EmbeddedServiceLiveAgent_Parent04If00000004CPqEAM_180cd4fc482',
38
- isOfflineSupportEnabled: false,
39
- },
40
- };
41
- default:
42
- return {
43
- host: 'https://gss--qa.my.salesforce.com',
44
- sandBox: 'https://qa-gssdex.cs203.force.com/botchat',
45
- gslbBaseURL: 'https://service.force.com',
46
- key: '00D7j0000008oSo',
47
- appName: 'RedHatChatBot',
48
- extra: {
49
- baseLiveAgentContentURL: 'https://c.la3-c1cs-ia4.salesforceliveagent.com/content',
50
- deploymentId: '5727j0000004CqR',
51
- buttonId: '5737j0000004CKB',
52
- baseLiveAgentURL: 'https://d.la3-c1cs-ia4.salesforceliveagent.com/chat',
53
- eswLiveAgentDevName: 'EmbeddedServiceLiveAgent_Parent04I7j000000CadEEAS_180b2280b37',
54
- isOfflineSupportEnabled: false,
55
- },
56
- };
57
- }
58
- };
@@ -1,15 +0,0 @@
1
- interface IChatOptions {
2
- loadingChat: boolean;
3
- isChatStarted: boolean;
4
- initEmbedChat: () => void;
5
- onStartChat: () => void;
6
- }
7
- /**
8
- * This hook is used for setting chat up and listing custom event of chat.
9
- * for more details https://developer.salesforce.com/docs/atlas.en-us.snapins_web_dev.meta/snapins_web_dev/snapins_web_chat_events.htm
10
- * @param initialState
11
- * @returns
12
- */
13
- export declare const useChatInit: (initialState?: boolean) => IChatOptions;
14
- export {};
15
- //# sourceMappingURL=useChatInit.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"useChatInit.d.ts","sourceRoot":"","sources":["../../../src/hooks/useChatInit.ts"],"names":[],"mappings":"AAMA,UAAU,YAAY;IAClB,WAAW,EAAE,OAAO,CAAC;IACrB,aAAa,EAAE,OAAO,CAAC;IACvB,aAAa,EAAE,MAAM,IAAI,CAAC;IAC1B,WAAW,EAAE,MAAM,IAAI,CAAC;CAC3B;AAED;;;;;GAKG;AACH,eAAO,MAAM,WAAW,kBAAkB,OAAO,KAAW,YAmD3D,CAAC"}
@@ -1,62 +0,0 @@
1
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3
- return new (P || (P = Promise))(function (resolve, reject) {
4
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
5
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
6
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
7
- step((generator = generator.apply(thisArg, _arguments || [])).next());
8
- });
9
- };
10
- import { useState } from 'react';
11
- import { extraPreChatInfo } from '../components/EmbeddedServiceChat/ExtraPreChatInfo';
12
- import { useChatConfig } from './useChatConfig';
13
- import { usePreChatFormDetails } from './usePreChatFormDetails';
14
- /**
15
- * This hook is used for setting chat up and listing custom event of chat.
16
- * for more details https://developer.salesforce.com/docs/atlas.en-us.snapins_web_dev.meta/snapins_web_dev/snapins_web_chat_events.htm
17
- * @param initialState
18
- * @returns
19
- */
20
- export const useChatInit = (initialState = false) => {
21
- const [isChatStarted, setChatStart] = useState(initialState);
22
- // Need to set loading status true as it will prevent starting chat before loading necessary dependencies
23
- const [loadingChat, setLoadingChat] = useState(true);
24
- const getChatFormDetails = usePreChatFormDetails();
25
- const { host, sandBox, gslbBaseURL, key, appName, extra } = useChatConfig();
26
- const onStartChat = () => __awaiter(void 0, void 0, void 0, function* () {
27
- setLoadingChat(true);
28
- yield window.embedded_svc.liveAgentAPI.startChat({
29
- extraPrechatInfo: extraPreChatInfo,
30
- extraPrechatFormDetails: getChatFormDetails(),
31
- });
32
- setChatStart(true);
33
- setLoadingChat(false);
34
- });
35
- const initEmbedChat = () => {
36
- const extraPreChatFormDetails = getChatFormDetails();
37
- initESW(extraPreChatFormDetails);
38
- };
39
- const initESW = (extraPreChatFormDetails) => {
40
- window.embedded_svc.settings.displayHelpButton = false; //Or false
41
- window.embedded_svc.settings.language = 'en'; //For example, enter 'en' or 'en-US'
42
- window.embedded_svc.settings.enabledFeatures = ['LiveAgent'];
43
- window.embedded_svc.settings.entryFeature = 'LiveAgent';
44
- window.embedded_svc.settings.extraPrechatFormDetails = extraPreChatFormDetails;
45
- window.embedded_svc.settings.extraPrechatInfo = extraPreChatInfo;
46
- window.embedded_svc.init(host, sandBox, gslbBaseURL, key, appName, extra);
47
- // Fired when Embedded Service Chat has ended and the application is closed.
48
- window.embedded_svc.addEventHandler('afterDestroy', function (data) {
49
- setChatStart(false);
50
- });
51
- // After loading and setting step is complete we are good to call `bootstrapEmbeddedService`
52
- window.embedded_svc.addEventHandler('onSettingsCallCompleted', function (data) {
53
- setLoadingChat(false);
54
- });
55
- };
56
- return {
57
- loadingChat,
58
- isChatStarted,
59
- initEmbedChat,
60
- onStartChat,
61
- };
62
- };
@@ -1,12 +0,0 @@
1
- export interface IPreChatFormDetails {
2
- label: string;
3
- value: string;
4
- transcriptFields?: Array<string>;
5
- displayToAgent: boolean;
6
- }
7
- /**
8
- *
9
- * The use of this hook is to generate form details based on user current screen
10
- */
11
- export declare const usePreChatFormDetails: () => (() => IPreChatFormDetails[]);
12
- //# sourceMappingURL=usePreChatFormDetails.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"usePreChatFormDetails.d.ts","sourceRoot":"","sources":["../../../src/hooks/usePreChatFormDetails.ts"],"names":[],"mappings":"AAOA,MAAM,WAAW,mBAAmB;IAChC,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,gBAAgB,CAAC,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;IACjC,cAAc,EAAE,OAAO,CAAC;CAC3B;AAED;;;GAGG;AAEH,eAAO,MAAM,qBAAqB,QAAO,CAAC,MAAM,mBAAmB,EAAE,CA6DpE,CAAC"}
@@ -1,78 +0,0 @@
1
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3
- return new (P || (P = Promise))(function (resolve, reject) {
4
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
5
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
6
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
7
- step((generator = generator.apply(thisArg, _arguments || [])).next());
8
- });
9
- };
10
- import { publicApi } from '@cee-eng/hydrajs';
11
- import { isValidCaseNumber } from '@rh-support/utils';
12
- import { useContext, useEffect, useState } from 'react';
13
- import { useRouteMatch } from 'react-router-dom';
14
- import { GlobalMetadataStateContext } from '../context/GlobalMetadataContext';
15
- /**
16
- *
17
- * The use of this hook is to generate form details based on user current screen
18
- */
19
- export const usePreChatFormDetails = () => {
20
- var _a;
21
- const { globalMetadataState: { loggedInUserRights }, } = useContext(GlobalMetadataStateContext);
22
- const [sessionId, setSessionId] = useState('');
23
- const loggedInUserRightsData = loggedInUserRights === null || loggedInUserRights === void 0 ? void 0 : loggedInUserRights.data;
24
- const ssoName = loggedInUserRightsData.getSSOUsername();
25
- const name = loggedInUserRightsData.getUserFullName();
26
- const accountNumber = loggedInUserRightsData.getAccountNumber();
27
- const match = useRouteMatch('/case/:caseNumber');
28
- const caseNumber = (_a = match === null || match === void 0 ? void 0 : match.params) === null || _a === void 0 ? void 0 : _a.caseNumber;
29
- const isCaseDetailsPage = isValidCaseNumber(caseNumber);
30
- const currentCaseNumber = isCaseDetailsPage ? caseNumber : undefined;
31
- useEffect(() => {
32
- try {
33
- const fetchChatSessionId = () => __awaiter(void 0, void 0, void 0, function* () {
34
- const { message } = yield publicApi.chat.getChatSession();
35
- setSessionId(message);
36
- });
37
- fetchChatSessionId();
38
- }
39
- catch (error) {
40
- console.log('Error', error);
41
- }
42
- }, []);
43
- const getChatFormDetails = () => [
44
- {
45
- label: 'SSO Name',
46
- value: ssoName,
47
- transcriptFields: ['SSO_Username__c'],
48
- displayToAgent: true,
49
- },
50
- {
51
- label: 'SessionId',
52
- value: sessionId,
53
- transcriptFields: ['SessionId__c'],
54
- displayToAgent: true,
55
- },
56
- {
57
- label: 'name',
58
- value: name,
59
- displayToAgent: true,
60
- },
61
- {
62
- label: 'account',
63
- value: accountNumber,
64
- displayToAgent: true,
65
- },
66
- ...(currentCaseNumber
67
- ? [
68
- {
69
- label: 'currentCaseNumber',
70
- transcriptFields: ['CaseNumber__c'],
71
- value: currentCaseNumber,
72
- displayToAgent: true,
73
- },
74
- ]
75
- : []),
76
- ];
77
- return getChatFormDetails;
78
- };