@microsoft/omnichannel-chat-widget 0.1.0-main.a7e4e7d → 0.1.0-main.b511ad6

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 (110) hide show
  1. package/README.md +32 -0
  2. package/lib/cjs/common/Constants.js +14 -0
  3. package/lib/cjs/common/telemetry/TelemetryConstants.js +20 -2
  4. package/lib/cjs/common/utils.js +49 -3
  5. package/lib/cjs/components/chatbuttonstateful/ChatButtonStateful.js +19 -3
  6. package/lib/cjs/components/confirmationpanestateful/ConfirmationPaneStateful.js +0 -1
  7. package/lib/cjs/components/footerstateful/downloadtranscriptstateful/DownloadTranscriptStateful.js +10 -1
  8. package/lib/cjs/components/headerstateful/HeaderStateful.js +2 -2
  9. package/lib/cjs/components/livechatwidget/common/ActivityStreamHandler.js +44 -0
  10. package/lib/cjs/components/livechatwidget/common/ActivitySubscriber/DefaultActivitySubscriber.js +23 -0
  11. package/lib/cjs/components/livechatwidget/common/ActivitySubscriber/IActivitySubscriber.js +1 -0
  12. package/lib/cjs/components/livechatwidget/common/ActivitySubscriber/PauseActivitySubscriber.js +39 -0
  13. package/lib/cjs/components/livechatwidget/common/ChatAdapterShim.js +70 -0
  14. package/lib/cjs/components/livechatwidget/common/Deferred.js +42 -0
  15. package/lib/cjs/components/livechatwidget/common/createAdapter.js +13 -1
  16. package/lib/cjs/components/livechatwidget/common/createMarkdown.js +31 -30
  17. package/lib/cjs/components/livechatwidget/common/defaultProps/dummyDefaultProps.js +9 -3
  18. package/lib/cjs/components/livechatwidget/common/endChat.js +52 -20
  19. package/lib/cjs/components/livechatwidget/common/initWebChatComposer.js +16 -3
  20. package/lib/cjs/components/livechatwidget/common/reconnectChatHelper.js +23 -15
  21. package/lib/cjs/components/livechatwidget/common/setPostChatContextAndLoadSurvey.js +0 -4
  22. package/lib/cjs/components/livechatwidget/common/shareObservable.js +45 -0
  23. package/lib/cjs/components/livechatwidget/common/startChat.js +152 -81
  24. package/lib/cjs/components/livechatwidget/livechatwidgetstateful/LiveChatWidgetStateful.js +180 -89
  25. package/lib/cjs/components/prechatsurveypanestateful/PreChatSurveyPaneStateful.js +4 -8
  26. package/lib/cjs/components/proactivechatpanestateful/ProactiveChatPaneStateful.js +17 -1
  27. package/lib/cjs/components/webchatcontainerstateful/WebChatContainerStateful.js +80 -0
  28. package/lib/cjs/components/webchatcontainerstateful/common/mockchatsdk.js +2 -0
  29. package/lib/cjs/components/webchatcontainerstateful/interfaces/IBotMagicCodeConfig.js +1 -0
  30. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/BotMagicCodeStore.js +14 -0
  31. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/activityMiddleware.js +16 -2
  32. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/cardActionMiddleware.js +52 -0
  33. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/cardActionMiddleware.spec.js +98 -0
  34. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/messageTimestampMiddleware.js +117 -0
  35. package/lib/cjs/contexts/common/ConversationState.js +3 -2
  36. package/lib/cjs/contexts/common/LiveChatWidgetActionType.js +2 -0
  37. package/lib/cjs/contexts/common/LiveChatWidgetContextInitialState.js +2 -2
  38. package/lib/cjs/contexts/createReducer.js +8 -0
  39. package/lib/cjs/controller/componentController.js +3 -3
  40. package/lib/esm/common/Constants.js +14 -0
  41. package/lib/esm/common/telemetry/TelemetryConstants.js +20 -2
  42. package/lib/esm/common/utils.js +37 -1
  43. package/lib/esm/components/chatbuttonstateful/ChatButtonStateful.js +21 -6
  44. package/lib/esm/components/confirmationpanestateful/ConfirmationPaneStateful.js +0 -1
  45. package/lib/esm/components/footerstateful/downloadtranscriptstateful/DownloadTranscriptStateful.js +8 -2
  46. package/lib/esm/components/headerstateful/HeaderStateful.js +2 -2
  47. package/lib/esm/components/livechatwidget/common/ActivityStreamHandler.js +34 -0
  48. package/lib/esm/components/livechatwidget/common/ActivitySubscriber/DefaultActivitySubscriber.js +14 -0
  49. package/lib/esm/components/livechatwidget/common/ActivitySubscriber/IActivitySubscriber.js +1 -0
  50. package/lib/esm/components/livechatwidget/common/ActivitySubscriber/PauseActivitySubscriber.js +29 -0
  51. package/lib/esm/components/livechatwidget/common/ChatAdapterShim.js +59 -0
  52. package/lib/esm/components/livechatwidget/common/Deferred.js +33 -0
  53. package/lib/esm/components/livechatwidget/common/createAdapter.js +12 -2
  54. package/lib/esm/components/livechatwidget/common/createMarkdown.js +31 -30
  55. package/lib/esm/components/livechatwidget/common/defaultProps/dummyDefaultProps.js +9 -3
  56. package/lib/esm/components/livechatwidget/common/endChat.js +53 -20
  57. package/lib/esm/components/livechatwidget/common/initWebChatComposer.js +15 -5
  58. package/lib/esm/components/livechatwidget/common/reconnectChatHelper.js +23 -15
  59. package/lib/esm/components/livechatwidget/common/setPostChatContextAndLoadSurvey.js +0 -4
  60. package/lib/esm/components/livechatwidget/common/shareObservable.js +38 -0
  61. package/lib/esm/components/livechatwidget/common/startChat.js +147 -80
  62. package/lib/esm/components/livechatwidget/livechatwidgetstateful/LiveChatWidgetStateful.js +175 -91
  63. package/lib/esm/components/prechatsurveypanestateful/PreChatSurveyPaneStateful.js +5 -8
  64. package/lib/esm/components/proactivechatpanestateful/ProactiveChatPaneStateful.js +17 -1
  65. package/lib/esm/components/webchatcontainerstateful/WebChatContainerStateful.js +72 -0
  66. package/lib/esm/components/webchatcontainerstateful/common/mockchatsdk.js +2 -0
  67. package/lib/esm/components/webchatcontainerstateful/interfaces/IBotMagicCodeConfig.js +1 -0
  68. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/BotMagicCodeStore.js +5 -0
  69. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/activityMiddleware.js +16 -2
  70. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/cardActionMiddleware.js +41 -0
  71. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/cardActionMiddleware.spec.js +94 -0
  72. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/messageTimestampMiddleware.js +107 -0
  73. package/lib/esm/contexts/common/ConversationState.js +3 -2
  74. package/lib/esm/contexts/common/LiveChatWidgetActionType.js +2 -0
  75. package/lib/esm/contexts/common/LiveChatWidgetContextInitialState.js +2 -2
  76. package/lib/esm/contexts/createReducer.js +8 -0
  77. package/lib/esm/controller/componentController.js +3 -3
  78. package/lib/types/common/Constants.d.ts +7 -0
  79. package/lib/types/common/interfaces/IContextDataStore.d.ts +1 -1
  80. package/lib/types/common/telemetry/TelemetryConstants.d.ts +20 -3
  81. package/lib/types/common/telemetry/TelemetryHelper.d.ts +1 -1
  82. package/lib/types/common/utils.d.ts +4 -1
  83. package/lib/types/components/footerstateful/downloadtranscriptstateful/DownloadTranscriptStateful.d.ts +1 -1
  84. package/lib/types/components/livechatwidget/common/ActivityStreamHandler.d.ts +14 -0
  85. package/lib/types/components/livechatwidget/common/ActivitySubscriber/DefaultActivitySubscriber.d.ts +5 -0
  86. package/lib/types/components/livechatwidget/common/ActivitySubscriber/IActivitySubscriber.d.ts +6 -0
  87. package/lib/types/components/livechatwidget/common/ActivitySubscriber/PauseActivitySubscriber.d.ts +7 -0
  88. package/lib/types/components/livechatwidget/common/ChatAdapterShim.d.ts +7 -0
  89. package/lib/types/components/livechatwidget/common/Deferred.d.ts +9 -0
  90. package/lib/types/components/livechatwidget/common/endChat.d.ts +1 -1
  91. package/lib/types/components/livechatwidget/common/reconnectChatHelper.d.ts +5 -4
  92. package/lib/types/components/livechatwidget/common/setPostChatContextAndLoadSurvey.d.ts +1 -1
  93. package/lib/types/components/livechatwidget/common/shareObservable.d.ts +1 -0
  94. package/lib/types/components/livechatwidget/common/startChat.d.ts +4 -2
  95. package/lib/types/components/livechatwidget/common/startProactiveChat.d.ts +1 -1
  96. package/lib/types/components/livechatwidget/interfaces/ILiveChatWidgetProps.d.ts +1 -0
  97. package/lib/types/components/reconnectchatpanestateful/interfaces/IReconnectChatPaneStatefulProps.d.ts +0 -1
  98. package/lib/types/components/webchatcontainerstateful/common/mockchatsdk.d.ts +1 -0
  99. package/lib/types/components/webchatcontainerstateful/interfaces/IBotMagicCodeConfig.d.ts +4 -0
  100. package/lib/types/components/webchatcontainerstateful/interfaces/IWebChatContainerStatefulProps.d.ts +2 -0
  101. package/lib/types/components/webchatcontainerstateful/webchatcontroller/BotMagicCodeStore.d.ts +3 -0
  102. package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/activityMiddleware.d.ts +1 -1
  103. package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/avatarMiddleware.d.ts +1 -1
  104. package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/cardActionMiddleware.d.ts +2 -0
  105. package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/cardActionMiddleware.spec.d.ts +1 -0
  106. package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/messageTimestampMiddleware.d.ts +5 -0
  107. package/lib/types/contexts/common/ConversationState.d.ts +3 -2
  108. package/lib/types/contexts/common/ILiveChatWidgetContext.d.ts +1 -1
  109. package/lib/types/contexts/common/LiveChatWidgetActionType.d.ts +3 -1
  110. package/package.json +2 -2
@@ -1,3 +1,4 @@
1
+ import { IBotMagicCodeConfig } from "./IBotMagicCodeConfig";
1
2
  import { ILiveChatWidgetLocalizedTexts } from "../../../contexts/common/ILiveChatWidgetLocalizedTexts";
2
3
  import { IRenderingMiddlewareProps } from "./IRenderingMiddlewareProps";
3
4
  import { IStyle } from "@fluentui/react";
@@ -13,4 +14,5 @@ export interface IWebChatContainerStatefulProps {
13
14
  storeMiddlewares?: any[];
14
15
  renderingMiddlewareProps?: IRenderingMiddlewareProps;
15
16
  localizedTexts?: ILiveChatWidgetLocalizedTexts;
17
+ botMagicCode?: IBotMagicCodeConfig;
16
18
  }
@@ -0,0 +1,3 @@
1
+ export declare class BotMagicCodeStore {
2
+ static botOAuthSignInId: string;
3
+ }
@@ -7,4 +7,4 @@
7
7
  * 3. Decodes certain html characters that came through from chat services
8
8
  ******/
9
9
  import React from "react";
10
- export declare const createActivityMiddleware: (systemMessageStyleProps?: React.CSSProperties | undefined, userMessageStyleProps?: React.CSSProperties | undefined) => () => (next: any) => (...args: any) => any;
10
+ export declare const createActivityMiddleware: (systemMessageStyleProps?: React.CSSProperties, userMessageStyleProps?: React.CSSProperties) => () => (next: any) => (...args: any) => any;
@@ -5,4 +5,4 @@
5
5
  * 1. Renders the first two letters of the sender as the profile pic
6
6
  ******/
7
7
  import React from "react";
8
- export declare const createAvatarMiddleware: (avatarStyleProps?: React.CSSProperties | undefined, avatarTextStyleProps?: React.CSSProperties | undefined) => () => (next: any) => (args_0: any) => false | (() => JSX.Element);
8
+ export declare const createAvatarMiddleware: (avatarStyleProps?: React.CSSProperties, avatarTextStyleProps?: React.CSSProperties) => () => (next: any) => (args_0: any) => false | (() => JSX.Element);
@@ -0,0 +1,2 @@
1
+ import { IBotMagicCodeConfig } from "../../../interfaces/IBotMagicCodeConfig";
2
+ export declare const createCardActionMiddleware: (botMagicCodeConfig: IBotMagicCodeConfig | undefined) => () => (next: any) => (...args: any) => any;
@@ -0,0 +1,5 @@
1
+ import { IWebChatAction } from "../../../interfaces/IWebChatAction";
2
+ declare const createMessageTimeStampMiddleware: ({ dispatch }: {
3
+ dispatch: any;
4
+ }) => (next: any) => (action: IWebChatAction) => any;
5
+ export default createMessageTimeStampMiddleware;
@@ -6,6 +6,7 @@ export declare enum ConversationState {
6
6
  ProactiveChat = 4,
7
7
  Active = 5,
8
8
  InActive = 6,
9
- Postchat = 7,
10
- Closed = 8
9
+ PostchatLoading = 7,
10
+ Postchat = 8,
11
+ Closed = 9
11
12
  }
@@ -16,13 +16,13 @@ export interface ILiveChatWidgetContext {
16
16
  globalDir: "rtl" | "ltr";
17
17
  liveChatContext: any;
18
18
  customContext: any;
19
+ widgetSize: any;
19
20
  };
20
21
  appStates: {
21
22
  conversationState: ConversationState;
22
23
  isMinimized: boolean;
23
24
  previousElementOnFocusBeforeModalOpen: HTMLElement | null;
24
25
  outsideOperatingHours: boolean;
25
- shouldShowPostChat: boolean;
26
26
  preChatResponseEmail: string;
27
27
  isAudioMuted: boolean | null;
28
28
  newMessage: boolean;
@@ -29,5 +29,7 @@ export declare enum LiveChatWidgetActionType {
29
29
  SET_FOCUS_CHAT_BUTTON = 27,
30
30
  SET_CONVERSATION_ENDED_BY_AGENT = 28,
31
31
  SET_WIDGET_STATE = 29,
32
- SET_LIVE_CHAT_CONTEXT = 30
32
+ SET_LIVE_CHAT_CONTEXT = 30,
33
+ SET_BOT_OAUTH_SIGNIN_ID = 31,
34
+ SET_WIDGET_SIZE = 32
33
35
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@microsoft/omnichannel-chat-widget",
3
- "version": "0.1.0-main.a7e4e7d",
3
+ "version": "0.1.0-main.b511ad6",
4
4
  "description": "Microsoft Omnichannel Chat Widget",
5
5
  "main": "lib/cjs/index.js",
6
6
  "types": "lib/types/index.d.ts",
@@ -74,7 +74,7 @@
74
74
  },
75
75
  "dependencies": {
76
76
  "@fluentui/react": "^8.49.1",
77
- "@microsoft/omnichannel-chat-components": "^0.1.0-main.91dd060",
77
+ "@microsoft/omnichannel-chat-components": "0.1.0-main.7a911ca",
78
78
  "@microsoft/omnichannel-chat-sdk": "1.0.1-main.077d17c",
79
79
  "abort-controller-es5": "^2.0.1",
80
80
  "dompurify": "^2.3.4",