@microsoft/omnichannel-chat-widget 2.0.1-main.a2ef2a3 → 2.0.1-main.e3352d7

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 (29) hide show
  1. package/README.md +2 -0
  2. package/lib/cjs/common/telemetry/TelemetryConstants.js +4 -0
  3. package/lib/cjs/components/chatbuttonstateful/ChatButtonStateful.js +42 -25
  4. package/lib/cjs/components/livechatwidget/common/endChat.js +39 -0
  5. package/lib/cjs/components/livechatwidget/common/initWebChatComposer.js +33 -9
  6. package/lib/cjs/components/livechatwidget/common/startChat.js +107 -33
  7. package/lib/cjs/components/webchatcontainerstateful/WebChatContainerStateful.js +2 -2
  8. package/lib/cjs/components/webchatcontainerstateful/common/defaultProps/defaultMiddlewareLocalizedTexts.js +2 -1
  9. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/attachmentForScreenReaderMiddleware.js +159 -0
  10. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/attachments/AdaptiveCardAccessibilityWrapper.js +16 -2
  11. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/attachmentSentAnnouncementMiddleware.js +68 -40
  12. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/attachmentUploadValidatorMiddleware.js +0 -27
  13. package/lib/esm/common/telemetry/TelemetryConstants.js +4 -0
  14. package/lib/esm/components/chatbuttonstateful/ChatButtonStateful.js +42 -25
  15. package/lib/esm/components/livechatwidget/common/endChat.js +39 -0
  16. package/lib/esm/components/livechatwidget/common/initWebChatComposer.js +31 -9
  17. package/lib/esm/components/livechatwidget/common/startChat.js +104 -31
  18. package/lib/esm/components/webchatcontainerstateful/WebChatContainerStateful.js +2 -2
  19. package/lib/esm/components/webchatcontainerstateful/common/defaultProps/defaultMiddlewareLocalizedTexts.js +2 -1
  20. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/attachmentForScreenReaderMiddleware.js +153 -0
  21. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/attachments/AdaptiveCardAccessibilityWrapper.js +16 -2
  22. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/attachmentSentAnnouncementMiddleware.js +65 -39
  23. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/attachmentUploadValidatorMiddleware.js +0 -27
  24. package/lib/types/common/telemetry/TelemetryConstants.d.ts +2 -0
  25. package/lib/types/components/livechatwidget/common/initWebChatComposer.d.ts +8 -0
  26. package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/attachmentForScreenReaderMiddleware.d.ts +11 -0
  27. package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/attachmentSentAnnouncementMiddleware.d.ts +11 -4
  28. package/lib/types/contexts/common/ILiveChatWidgetLocalizedTexts.d.ts +9 -2
  29. package/package.json +5 -6
@@ -2,9 +2,16 @@
2
2
  * AttachmentSentAnnouncementMiddleware
3
3
  *
4
4
  * When a file attachment is successfully sent, announces the result to
5
- * screen readers via an aria-live region so that assistive technology
6
- * users receive immediate feedback.
5
+ * screen readers so that assistive technology users receive immediate
6
+ * feedback ("File report.pdf sent").
7
+ *
8
+ * The announcement region lives inside the chat dialog. While the dialog is
9
+ * open it is aria-modal and its host siblings are aria-hidden, so screen
10
+ * readers (TalkBack, VoiceOver) ignore live regions outside it.
7
11
  ******/
12
+ import { ILiveChatWidgetLocalizedTexts } from "../../../../../contexts/common/ILiveChatWidgetLocalizedTexts";
8
13
  import { WebChatStoreMiddleware } from "../../../interfaces/IWebChatAction";
9
- declare const attachmentSentAnnouncementMiddleware: WebChatStoreMiddleware;
10
- export default attachmentSentAnnouncementMiddleware;
14
+ export declare const ATTACHMENT_ANNOUNCEMENT_REGION_ID = "oc-lcw-attachment-announcement";
15
+ export declare const getFileSentMessage: (attachments: any[], localizedTexts?: ILiveChatWidgetLocalizedTexts) => string;
16
+ export declare const createAttachmentSentAnnouncementMiddleware: (localizedTexts?: ILiveChatWidgetLocalizedTexts, widgetElementId?: string) => WebChatStoreMiddleware;
17
+ export default createAttachmentSentAnnouncementMiddleware;
@@ -35,10 +35,17 @@ export interface ILiveChatWidgetLocalizedTexts {
35
35
  */
36
36
  MIDDLEWARE_BANNER_FILE_IS_MALICIOUS?: string;
37
37
  /**
38
- * Success message announced by screen readers when a file is successfully sent.
39
- * e.g. "File sent successfully."
38
+ * Message announced by screen readers when one file is successfully sent.
39
+ * {2} - File name
40
+ * e.g. "File {2} sent"
40
41
  */
41
42
  MIDDLEWARE_BANNER_FILE_SENT?: string;
43
+ /**
44
+ * Message announced by screen readers when several files are sent in one message.
45
+ * {0} - Number of files
46
+ * e.g. "{0} files sent"
47
+ */
48
+ MIDDLEWARE_BANNER_FILES_SENT?: string;
42
49
  /**
43
50
  * Success message, indicating the email address introduced has been registered to receive the transcript.
44
51
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@microsoft/omnichannel-chat-widget",
3
- "version": "2.0.1-main.a2ef2a3",
3
+ "version": "2.0.1-main.e3352d7",
4
4
  "description": "Microsoft Omnichannel Chat Widget",
5
5
  "main": "lib/cjs/index.js",
6
6
  "types": "lib/types/index.d.ts",
@@ -93,18 +93,17 @@
93
93
  "@azure/core-tracing": "^1.2.0",
94
94
  "@microsoft/applicationinsights-web": "^3.3.6",
95
95
  "@microsoft/omnichannel-chat-components": "1.2.0",
96
- "@microsoft/omnichannel-chat-sdk": "2.0.1",
96
+ "@microsoft/omnichannel-chat-sdk": "2.0.2-main.a1ba517",
97
97
  "@opentelemetry/api": "^1.9.0",
98
98
  "abort-controller": "^3",
99
99
  "botframework-webchat": "4.18.1-hotfix.20260308.b15b405",
100
100
  "core-js-pure": "^3.42.0",
101
- "dompurify": "3.4.16",
102
- "markdown-it": "^14.3.0",
101
+ "dompurify": "3.4.17",
102
+ "markdown-it": "^14.3.3",
103
103
  "markdown-it-attrs": "^4.1.6",
104
104
  "markdown-it-for-inline": "^0.1.1",
105
105
  "md5-typescript": "^1.0.5",
106
106
  "rxjs": "5.5.12",
107
- "sanitize-html": "2.17.7",
108
107
  "simple-update-in": "2.2.0",
109
108
  "slack-markdown-it": "^1.0.5"
110
109
  },
@@ -164,7 +163,7 @@
164
163
  "**/@types/trusted-types": "2.0.7",
165
164
  "**/join-images": "1.1.5",
166
165
  "**/valibot": "1.4.2",
167
- "**/nanoid": "3.3.18"
166
+ "**/nanoid": "^3.3.20"
168
167
  },
169
168
  "jest": {
170
169
  "verbose": true,