@azure/communication-react 1.13.0-alpha-202402110013 → 1.13.0-alpha-202402140012

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 (78) hide show
  1. package/dist/communication-react.d.ts +54 -15
  2. package/dist/dist-cjs/communication-react/index.js +178 -100
  3. package/dist/dist-cjs/communication-react/index.js.map +1 -1
  4. package/dist/dist-esm/acs-ui-common/src/telemetryVersion.js +1 -1
  5. package/dist/dist-esm/acs-ui-common/src/telemetryVersion.js.map +1 -1
  6. package/dist/dist-esm/react-components/src/components/ChatMessage/ChatMessageContent.js +23 -8
  7. package/dist/dist-esm/react-components/src/components/ChatMessage/ChatMessageContent.js.map +1 -1
  8. package/dist/dist-esm/react-components/src/components/ImageOverlay.d.ts +7 -3
  9. package/dist/dist-esm/react-components/src/components/ImageOverlay.js +14 -15
  10. package/dist/dist-esm/react-components/src/components/ImageOverlay.js.map +1 -1
  11. package/dist/dist-esm/react-components/src/components/styles/ImageOverlay.style.d.ts +8 -7
  12. package/dist/dist-esm/react-components/src/components/styles/ImageOverlay.style.js +43 -27
  13. package/dist/dist-esm/react-components/src/components/styles/ImageOverlay.style.js.map +1 -1
  14. package/dist/dist-esm/react-components/src/localization/locales/ar-SA/strings.json +8 -2
  15. package/dist/dist-esm/react-components/src/localization/locales/cs-CZ/strings.json +8 -2
  16. package/dist/dist-esm/react-components/src/localization/locales/de-DE/strings.json +8 -2
  17. package/dist/dist-esm/react-components/src/localization/locales/en-GB/strings.json +8 -2
  18. package/dist/dist-esm/react-components/src/localization/locales/es-ES/strings.json +8 -2
  19. package/dist/dist-esm/react-components/src/localization/locales/fi-FI/strings.json +8 -2
  20. package/dist/dist-esm/react-components/src/localization/locales/fr-FR/strings.json +8 -2
  21. package/dist/dist-esm/react-components/src/localization/locales/he-IL/strings.json +8 -2
  22. package/dist/dist-esm/react-components/src/localization/locales/it-IT/strings.json +8 -2
  23. package/dist/dist-esm/react-components/src/localization/locales/ja-JP/strings.json +8 -2
  24. package/dist/dist-esm/react-components/src/localization/locales/ko-KR/strings.json +8 -2
  25. package/dist/dist-esm/react-components/src/localization/locales/nb-NO/strings.json +8 -2
  26. package/dist/dist-esm/react-components/src/localization/locales/nl-NL/strings.json +8 -2
  27. package/dist/dist-esm/react-components/src/localization/locales/pl-PL/strings.json +8 -2
  28. package/dist/dist-esm/react-components/src/localization/locales/pt-BR/strings.json +8 -2
  29. package/dist/dist-esm/react-components/src/localization/locales/ru-RU/strings.json +8 -2
  30. package/dist/dist-esm/react-components/src/localization/locales/sv-SE/strings.json +8 -2
  31. package/dist/dist-esm/react-components/src/localization/locales/tr-TR/strings.json +8 -2
  32. package/dist/dist-esm/react-components/src/localization/locales/zh-CN/strings.json +8 -2
  33. package/dist/dist-esm/react-components/src/localization/locales/zh-TW/strings.json +8 -2
  34. package/dist/dist-esm/react-components/src/theming/themes.d.ts +21 -8
  35. package/dist/dist-esm/react-components/src/theming/themes.js +16 -7
  36. package/dist/dist-esm/react-components/src/theming/themes.js.map +1 -1
  37. package/dist/dist-esm/react-components/src/types/CallSurveyImprovementSuggestions.d.ts +4 -4
  38. package/dist/dist-esm/react-components/src/types/CallSurveyImprovementSuggestions.js.map +1 -1
  39. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/AzureCommunicationCallWithChatAdapter.d.ts +3 -0
  40. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/AzureCommunicationCallWithChatAdapter.js +14 -1
  41. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/AzureCommunicationCallWithChatAdapter.js.map +1 -1
  42. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/CallWithChatAdapter.d.ts +3 -0
  43. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/CallWithChatAdapter.js.map +1 -1
  44. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/CallWithChatBackedChatAdapter.d.ts +3 -0
  45. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/CallWithChatBackedChatAdapter.js +9 -0
  46. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/CallWithChatBackedChatAdapter.js.map +1 -1
  47. package/dist/dist-esm/react-composites/src/composites/ChatComposite/ChatScreen.js +1 -1
  48. package/dist/dist-esm/react-composites/src/composites/ChatComposite/ChatScreen.js.map +1 -1
  49. package/dist/dist-esm/react-composites/src/composites/ChatComposite/adapter/AzureCommunicationChatAdapter.d.ts +3 -0
  50. package/dist/dist-esm/react-composites/src/composites/ChatComposite/adapter/AzureCommunicationChatAdapter.js +17 -1
  51. package/dist/dist-esm/react-composites/src/composites/ChatComposite/adapter/AzureCommunicationChatAdapter.js.map +1 -1
  52. package/dist/dist-esm/react-composites/src/composites/ChatComposite/adapter/ChatAdapter.d.ts +18 -0
  53. package/dist/dist-esm/react-composites/src/composites/ChatComposite/adapter/ChatAdapter.js.map +1 -1
  54. package/dist/dist-esm/react-composites/src/composites/ChatComposite/index.d.ts +1 -0
  55. package/dist/dist-esm/react-composites/src/composites/ChatComposite/index.js.map +1 -1
  56. package/dist/dist-esm/react-composites/src/composites/common/Survey.js +2 -2
  57. package/dist/dist-esm/react-composites/src/composites/common/Survey.js.map +1 -1
  58. package/dist/dist-esm/react-composites/src/composites/localization/locales/ar-SA/strings.json +29 -2
  59. package/dist/dist-esm/react-composites/src/composites/localization/locales/cs-CZ/strings.json +29 -2
  60. package/dist/dist-esm/react-composites/src/composites/localization/locales/de-DE/strings.json +29 -2
  61. package/dist/dist-esm/react-composites/src/composites/localization/locales/en-GB/strings.json +29 -2
  62. package/dist/dist-esm/react-composites/src/composites/localization/locales/es-ES/strings.json +29 -2
  63. package/dist/dist-esm/react-composites/src/composites/localization/locales/fi-FI/strings.json +29 -2
  64. package/dist/dist-esm/react-composites/src/composites/localization/locales/fr-FR/strings.json +29 -2
  65. package/dist/dist-esm/react-composites/src/composites/localization/locales/he-IL/strings.json +29 -2
  66. package/dist/dist-esm/react-composites/src/composites/localization/locales/it-IT/strings.json +29 -2
  67. package/dist/dist-esm/react-composites/src/composites/localization/locales/ja-JP/strings.json +29 -2
  68. package/dist/dist-esm/react-composites/src/composites/localization/locales/ko-KR/strings.json +29 -2
  69. package/dist/dist-esm/react-composites/src/composites/localization/locales/nb-NO/strings.json +29 -2
  70. package/dist/dist-esm/react-composites/src/composites/localization/locales/nl-NL/strings.json +29 -2
  71. package/dist/dist-esm/react-composites/src/composites/localization/locales/pl-PL/strings.json +29 -2
  72. package/dist/dist-esm/react-composites/src/composites/localization/locales/pt-BR/strings.json +29 -2
  73. package/dist/dist-esm/react-composites/src/composites/localization/locales/ru-RU/strings.json +29 -2
  74. package/dist/dist-esm/react-composites/src/composites/localization/locales/sv-SE/strings.json +29 -2
  75. package/dist/dist-esm/react-composites/src/composites/localization/locales/tr-TR/strings.json +29 -2
  76. package/dist/dist-esm/react-composites/src/composites/localization/locales/zh-CN/strings.json +29 -2
  77. package/dist/dist-esm/react-composites/src/composites/localization/locales/zh-TW/strings.json +29 -2
  78. package/package.json +1 -1
@@ -2,5 +2,5 @@
2
2
  // Copyright (c) Microsoft Corporation.
3
3
  // Licensed under the MIT License.
4
4
  // GENERATED FILE. DO NOT EDIT MANUALLY.
5
- module.exports = '1.13.0-alpha-202402110013';
5
+ module.exports = '1.13.0-alpha-202402140012';
6
6
  //# sourceMappingURL=telemetryVersion.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"telemetryVersion.js","sourceRoot":"","sources":["../../../../../acs-ui-common/src/telemetryVersion.js"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;AAElC,wCAAwC;AAExC,MAAM,CAAC,OAAO,GAAG,2BAA2B,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\n// GENERATED FILE. DO NOT EDIT MANUALLY.\n\nmodule.exports = '1.13.0-alpha-202402110013';\n"]}
1
+ {"version":3,"file":"telemetryVersion.js","sourceRoot":"","sources":["../../../../../acs-ui-common/src/telemetryVersion.js"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;AAElC,wCAAwC;AAExC,MAAM,CAAC,OAAO,GAAG,2BAA2B,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\n// GENERATED FILE. DO NOT EDIT MANUALLY.\n\nmodule.exports = '1.13.0-alpha-202402140012';\n"]}
@@ -70,21 +70,36 @@ const generateLiveMessage = (props) => {
70
70
  return `${props.message.editedOn ? props.strings.editedTag : ''} ${props.message.mine ? '' : liveAuthor} ${extractContent(props.message.content || '')} `;
71
71
  };
72
72
  const messageContentAriaText = (props) => {
73
- // Strip all html tags from the content for aria.
74
- return props.message.content
75
- ? props.message.mine
73
+ if (props.message.content) {
74
+ // Replace all <img> tags with 'image' for aria.
75
+ const parsedContent = DOMPurify.sanitize(props.message.content, {
76
+ ALLOWED_TAGS: ['img'],
77
+ RETURN_DOM_FRAGMENT: true
78
+ });
79
+ parsedContent.childNodes.forEach((child) => {
80
+ if (child.nodeName.toLowerCase() !== 'img') {
81
+ return;
82
+ }
83
+ const imageTextNode = document.createElement('div');
84
+ imageTextNode.innerHTML = 'image ';
85
+ parsedContent.replaceChild(imageTextNode, child);
86
+ });
87
+ // Strip all html tags from the content for aria.
88
+ const message = DOMPurify.sanitize(parsedContent, { ALLOWED_TAGS: [] });
89
+ return props.message.mine
76
90
  ? _formatString(props.strings.messageContentMineAriaText, {
77
- message: DOMPurify.sanitize(props.message.content, { ALLOWED_TAGS: [] })
91
+ message: message
78
92
  })
79
93
  : _formatString(props.strings.messageContentAriaText, {
80
94
  author: `${props.message.senderDisplayName}`,
81
- message: DOMPurify.sanitize(props.message.content, { ALLOWED_TAGS: [] })
82
- })
83
- : undefined;
95
+ message: message
96
+ });
97
+ }
98
+ return undefined;
84
99
  };
85
100
  /* @conditional-compile-remove(image-overlay) */
86
101
  const defaultOnRenderInlineImage = (inlineImage) => {
87
- return (React.createElement("img", Object.assign({}, inlineImage.imgAttrs, { "data-ui-id": inlineImage.imgAttrs.id, tabIndex: 0, role: "button", style: Object.assign({ cursor: 'pointer' }, inlineImage.imgAttrs.style) })));
102
+ return React.createElement("img", Object.assign({ tabIndex: 0, "data-ui-id": inlineImage.imgAttrs.id }, inlineImage.imgAttrs));
88
103
  };
89
104
  const processHtmlToReact = (props) => {
90
105
  var _a;
@@ -1 +1 @@
1
- {"version":3,"file":"ChatMessageContent.js","sourceRoot":"","sources":["../../../../../../../react-components/src/components/ChatMessage/ChatMessageContent.tsx"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,aAAa,EAAE,sCAAgC;AACxD,OAAO,KAAK,EAAE,EAA0B,OAAO,IAAI,UAAU,EAAE,MAAM,mBAAmB,CAAC;AACzF,uEAAuE;AACvE,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AACtD,OAAO,OAAO,MAAM,eAAe,CAAC;AAIpC,OAAO,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AAIvC,uDAAuD;AACvD,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AAElD,OAAO,WAAW,MAAM,0BAA0B,CAAC;AACnD,0CAA0C;AAC1C,OAAO,EAAE,sBAAsB,EAAE,MAAM,mBAAmB,CAAC;AAC3D,OAAO,SAAS,MAAM,WAAW,CAAC;AAqDlC,eAAe;AACf,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,KAA8B,EAAe,EAAE;IAChF,QAAQ,KAAK,CAAC,OAAO,CAAC,WAAW,EAAE,CAAC;QAClC,KAAK,MAAM;YACT,OAAO,oBAAoB,CAAC,KAAK,CAAC,CAAC;QACrC,KAAK,MAAM;YACT,OAAO,4BAA4B,CAAC,KAAK,CAAC,CAAC;QAC7C,KAAK,eAAe;YAClB,OAAO,4BAA4B,CAAC,KAAK,CAAC,CAAC;QAC7C;YACE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oBACf,OAAO,CAAC,OAAO,CAAC,EAAE;qBAClB,MAAA,KAAK,CAAC,OAAO,CAAC,YAAY,0CAAE,IAAI,CAAC,CAAC,QAAQ,EAAE,EAAE;wBAC5C,OAAO,QAAQ,CAAC,EAAE,KAAK,OAAO,CAAC,OAAO,CAAC,EAAE,CAAC;oBAC5C,CAAC,CAAC,CAAA,EACF,CAAC;oBACD,OAAO,CAAC,OAAO,CAAC,YAAY,CAAC,GAAG,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC;oBACrD,MAAM,QAAQ,GAAG,iBAAiB,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;oBACpD,gDAAgD;oBAChD,MAAM,gBAAgB,GAAgB,EAAE,SAAS,EAAE,KAAK,CAAC,OAAO,CAAC,SAAS,EAAE,QAAQ,EAAE,QAAQ,EAAE,CAAC;oBAEjG,gDAAgD;oBAChD,OAAO,CAAA,MAAA,KAAK,CAAC,kBAAkB,0CAAE,mBAAmB;wBAClD,CAAC,CAAC,KAAK,CAAC,kBAAkB,CAAC,mBAAmB,CAAC,gBAAgB,EAAE,0BAA0B,CAAC;wBAC5F,CAAC,CAAC,0BAA0B,CAAC,gBAAgB,CAAC,CAAC;oBAEjD,OAAO,6CAAS,QAAQ,EAAI,CAAC;gBAC/B,CAAC;YACH,CAAC;YACD,iCAAiC;YACjC,OAAO,SAAmC,CAAC;QAC7C,CAAC;KACF,CAAC;IACF,OAAO,0CAAG,KAAK,CAAC,MAAA,KAAK,CAAC,OAAO,CAAC,OAAO,mCAAI,EAAE,EAAE,OAAO,CAAC,CAAI,CAAC;AAC5D,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport React from 'react';\nimport { _formatString } from '@internal/acs-ui-common';\nimport parse, { HTMLReactParserOptions, Element as DOMElement } from 'html-react-parser';\n/* @conditional-compile-remove(teams-inline-images-and-file-sharing) */\nimport { attributesToProps } from 'html-react-parser';\nimport Linkify from 'react-linkify';\nimport { ChatMessage } from '../../types/ChatMessage';\n/* @conditional-compile-remove(data-loss-prevention) */\nimport { BlockedMessage } from '../../types/ChatMessage';\nimport { Link } from '@fluentui/react';\n/* @conditional-compile-remove(mention) */\nimport { MentionDisplayOptions, Mention } from '../MentionPopover';\n\n/* @conditional-compile-remove(data-loss-prevention) */\nimport { FontIcon, Stack } from '@fluentui/react';\nimport { MessageThreadStrings } from '../MessageThread';\nimport LiveMessage from '../Announcer/LiveMessage';\n/* @conditional-compile-remove(mention) */\nimport { defaultOnMentionRender } from './MentionRenderer';\nimport DOMPurify from 'dompurify';\n\ntype ChatMessageContentProps = {\n message: ChatMessage;\n strings: MessageThreadStrings;\n /* @conditional-compile-remove(mention) */\n mentionDisplayOptions?: MentionDisplayOptions;\n /* @conditional-compile-remove(image-overlay) */\n inlineImageOptions?: InlineImageOptions;\n};\n\n/* @conditional-compile-remove(data-loss-prevention) */\ntype BlockedMessageContentProps = {\n message: BlockedMessage;\n strings: MessageThreadStrings;\n};\n\ntype MessageContentWithLiveAriaProps = {\n message: ChatMessage | /* @conditional-compile-remove(data-loss-prevention) */ BlockedMessage;\n liveMessage: string;\n ariaLabel?: string;\n content: JSX.Element;\n};\n\n/* @conditional-compile-remove(image-overlay) */\n/**\n * InlineImage's state, as reflected in the UI.\n *\n * @beta\n */\nexport interface InlineImage {\n /** ID of the message that the inline image is belonged to */\n messageId: string;\n /** Attributes of the inline image */\n imgAttrs: React.ImgHTMLAttributes<HTMLImageElement>;\n}\n\n/* @conditional-compile-remove(image-overlay) */\n/**\n * Options to display inline image in the inline image scenario.\n *\n * @beta\n */\nexport interface InlineImageOptions {\n /**\n * Optional callback to render an inline image of in a message.\n */\n onRenderInlineImage?: (\n inlineImage: InlineImage,\n defaultOnRender: (inlineImage: InlineImage) => JSX.Element\n ) => JSX.Element;\n}\n\n/** @private */\nexport const ChatMessageContent = (props: ChatMessageContentProps): JSX.Element => {\n switch (props.message.contentType) {\n case 'text':\n return MessageContentAsText(props);\n case 'html':\n return MessageContentAsRichTextHTML(props);\n case 'richtext/html':\n return MessageContentAsRichTextHTML(props);\n default:\n console.warn('unknown message content type');\n return <></>;\n }\n};\n\nconst MessageContentWithLiveAria = (props: MessageContentWithLiveAriaProps): JSX.Element => {\n return (\n <div data-ui-status={props.message.status} role=\"text\" aria-label={props.ariaLabel}>\n <LiveMessage message={props.liveMessage} ariaLive=\"polite\" />\n {props.content}\n </div>\n );\n};\n\nconst MessageContentAsRichTextHTML = (props: ChatMessageContentProps): JSX.Element => {\n return (\n <MessageContentWithLiveAria\n message={props.message}\n liveMessage={generateLiveMessage(props)}\n ariaLabel={messageContentAriaText(props)}\n content={processHtmlToReact(props)}\n />\n );\n};\n\nconst MessageContentAsText = (props: ChatMessageContentProps): JSX.Element => {\n return (\n <MessageContentWithLiveAria\n message={props.message}\n liveMessage={generateLiveMessage(props)}\n ariaLabel={messageContentAriaText(props)}\n content={\n <Linkify\n componentDecorator={(decoratedHref: string, decoratedText: string, key: number) => {\n return (\n <Link target=\"_blank\" href={decoratedHref} key={key}>\n {decoratedText}\n </Link>\n );\n }}\n >\n {props.message.content}\n </Linkify>\n }\n />\n );\n};\n\n/* @conditional-compile-remove(data-loss-prevention) */\n/**\n * @private\n */\nexport const BlockedMessageContent = (props: BlockedMessageContentProps): JSX.Element => {\n const Icon: JSX.Element = <FontIcon iconName={'DataLossPreventionProhibited'} />;\n const blockedMessage =\n props.message.warningText === undefined ? props.strings.blockedWarningText : props.message.warningText;\n const blockedMessageLink = props.message.link;\n const blockedMessageLinkText = blockedMessageLink\n ? props.message.linkText ?? props.strings.blockedWarningLinkText\n : '';\n\n const liveAuthor =\n props.message.mine || props.message.senderDisplayName === undefined ? '' : props.message.senderDisplayName;\n const liveBlockedWarningText = `${liveAuthor} ${blockedMessage} ${blockedMessageLinkText}`;\n return (\n <MessageContentWithLiveAria\n message={props.message}\n liveMessage={liveBlockedWarningText}\n ariaLabel={liveBlockedWarningText}\n content={\n <Stack horizontal wrap>\n {Icon}\n {blockedMessage && <p>{blockedMessage}</p>}\n {blockedMessageLink && (\n <Link target={'_blank'} href={blockedMessageLink}>\n {blockedMessageLinkText}\n </Link>\n )}\n </Stack>\n }\n />\n );\n};\n\n// https://stackoverflow.com/questions/28899298/extract-the-text-out-of-html-string-using-javascript\nconst extractContent = (s: string): string => {\n const span = document.createElement('span');\n span.innerHTML = s;\n return span.textContent || span.innerText;\n};\n\nconst generateLiveMessage = (props: ChatMessageContentProps): string => {\n const liveAuthor = _formatString(props.strings.liveAuthorIntro, { author: `${props.message.senderDisplayName}` });\n\n return `${props.message.editedOn ? props.strings.editedTag : ''} ${\n props.message.mine ? '' : liveAuthor\n } ${extractContent(props.message.content || '')} `;\n};\n\nconst messageContentAriaText = (props: ChatMessageContentProps): string | undefined => {\n // Strip all html tags from the content for aria.\n\n return props.message.content\n ? props.message.mine\n ? _formatString(props.strings.messageContentMineAriaText, {\n message: DOMPurify.sanitize(props.message.content, { ALLOWED_TAGS: [] })\n })\n : _formatString(props.strings.messageContentAriaText, {\n author: `${props.message.senderDisplayName}`,\n message: DOMPurify.sanitize(props.message.content, { ALLOWED_TAGS: [] })\n })\n : undefined;\n};\n\n/* @conditional-compile-remove(image-overlay) */\nconst defaultOnRenderInlineImage = (inlineImage: InlineImage): JSX.Element => {\n return (\n <img\n {...inlineImage.imgAttrs}\n data-ui-id={inlineImage.imgAttrs.id}\n tabIndex={0}\n role=\"button\"\n style={{\n cursor: 'pointer',\n ...inlineImage.imgAttrs.style\n }}\n />\n );\n};\n\nconst processHtmlToReact = (props: ChatMessageContentProps): JSX.Element => {\n const options: HTMLReactParserOptions = {\n transform(reactNode, domNode) {\n if (domNode instanceof DOMElement && domNode.attribs) {\n // Transform custom rendering of mentions\n /* @conditional-compile-remove(mention) */\n if (props.mentionDisplayOptions?.onRenderMention && domNode.name === 'msft-mention') {\n const { id } = domNode.attribs;\n const mention: Mention = {\n id: id,\n displayText: (domNode.children[0] as unknown as Text).nodeValue ?? ''\n };\n return props.mentionDisplayOptions.onRenderMention(mention, defaultOnMentionRender);\n }\n\n // Transform inline images\n /* @conditional-compile-remove(teams-inline-images-and-file-sharing) */\n if (\n domNode.name &&\n domNode.name === 'img' &&\n domNode.attribs &&\n domNode.attribs.id &&\n props.message.inlineImages?.find((metadata) => {\n return metadata.id === domNode.attribs.id;\n })\n ) {\n domNode.attribs['aria-label'] = domNode.attribs.name;\n const imgProps = attributesToProps(domNode.attribs);\n /* @conditional-compile-remove(image-overlay) */\n const inlineImageProps: InlineImage = { messageId: props.message.messageId, imgAttrs: imgProps };\n\n /* @conditional-compile-remove(image-overlay) */\n return props.inlineImageOptions?.onRenderInlineImage\n ? props.inlineImageOptions.onRenderInlineImage(inlineImageProps, defaultOnRenderInlineImage)\n : defaultOnRenderInlineImage(inlineImageProps);\n\n return <img {...imgProps} />;\n }\n }\n // Pass through the original node\n return reactNode as unknown as JSX.Element;\n }\n };\n return <>{parse(props.message.content ?? '', options)}</>;\n};\n"]}
1
+ {"version":3,"file":"ChatMessageContent.js","sourceRoot":"","sources":["../../../../../../../react-components/src/components/ChatMessage/ChatMessageContent.tsx"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,aAAa,EAAE,sCAAgC;AACxD,OAAO,KAAK,EAAE,EAA0B,OAAO,IAAI,UAAU,EAAE,MAAM,mBAAmB,CAAC;AACzF,uEAAuE;AACvE,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AACtD,OAAO,OAAO,MAAM,eAAe,CAAC;AAIpC,OAAO,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AAIvC,uDAAuD;AACvD,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AAElD,OAAO,WAAW,MAAM,0BAA0B,CAAC;AACnD,0CAA0C;AAC1C,OAAO,EAAE,sBAAsB,EAAE,MAAM,mBAAmB,CAAC;AAC3D,OAAO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,QAAQ,EAAE,CAAC;oBAEjG,gDAAgD;oBAChD,OAAO,CAAA,MAAA,KAAK,CAAC,kBAAkB,0CAAE,mBAAmB;wBAClD,CAAC,CAAC,KAAK,CAAC,kBAAkB,CAAC,mBAAmB,CAAC,gBAAgB,EAAE,0BAA0B,CAAC;wBAC5F,CAAC,CAAC,0BAA0B,CAAC,gBAAgB,CAAC,CAAC;oBAEjD,OAAO,6CAAS,QAAQ,EAAI,CAAC;gBAC/B,CAAC;YACH,CAAC;YACD,iCAAiC;YACjC,OAAO,SAAmC,CAAC;QAC7C,CAAC;KACF,CAAC;IACF,OAAO,0CAAG,KAAK,CAAC,MAAA,KAAK,CAAC,OAAO,CAAC,OAAO,mCAAI,EAAE,EAAE,OAAO,CAAC,CAAI,CAAC;AAC5D,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport React from 'react';\nimport { _formatString } from '@internal/acs-ui-common';\nimport parse, { HTMLReactParserOptions, Element as DOMElement } from 'html-react-parser';\n/* @conditional-compile-remove(teams-inline-images-and-file-sharing) */\nimport { attributesToProps } from 'html-react-parser';\nimport Linkify from 'react-linkify';\nimport { ChatMessage } from '../../types/ChatMessage';\n/* @conditional-compile-remove(data-loss-prevention) */\nimport { BlockedMessage } from '../../types/ChatMessage';\nimport { Link } from '@fluentui/react';\n/* @conditional-compile-remove(mention) */\nimport { MentionDisplayOptions, Mention } from '../MentionPopover';\n\n/* @conditional-compile-remove(data-loss-prevention) */\nimport { FontIcon, Stack } from '@fluentui/react';\nimport { MessageThreadStrings } from '../MessageThread';\nimport LiveMessage from '../Announcer/LiveMessage';\n/* @conditional-compile-remove(mention) */\nimport { defaultOnMentionRender } from './MentionRenderer';\nimport DOMPurify from 'dompurify';\n\ntype ChatMessageContentProps = {\n message: ChatMessage;\n strings: MessageThreadStrings;\n /* @conditional-compile-remove(mention) */\n mentionDisplayOptions?: MentionDisplayOptions;\n /* @conditional-compile-remove(image-overlay) */\n inlineImageOptions?: InlineImageOptions;\n};\n\n/* @conditional-compile-remove(data-loss-prevention) */\ntype BlockedMessageContentProps = {\n message: BlockedMessage;\n strings: MessageThreadStrings;\n};\n\ntype MessageContentWithLiveAriaProps = {\n message: ChatMessage | /* @conditional-compile-remove(data-loss-prevention) */ BlockedMessage;\n liveMessage: string;\n ariaLabel?: string;\n content: JSX.Element;\n};\n\n/* @conditional-compile-remove(image-overlay) */\n/**\n * InlineImage's state, as reflected in the UI.\n *\n * @beta\n */\nexport interface InlineImage {\n /** ID of the message that the inline image is belonged to */\n messageId: string;\n /** Attributes of the inline image */\n imgAttrs: React.ImgHTMLAttributes<HTMLImageElement>;\n}\n\n/* @conditional-compile-remove(image-overlay) */\n/**\n * Options to display inline image in the inline image scenario.\n *\n * @beta\n */\nexport interface InlineImageOptions {\n /**\n * Optional callback to render an inline image of in a message.\n */\n onRenderInlineImage?: (\n inlineImage: InlineImage,\n defaultOnRender: (inlineImage: InlineImage) => JSX.Element\n ) => JSX.Element;\n}\n\n/** @private */\nexport const ChatMessageContent = (props: ChatMessageContentProps): JSX.Element => {\n switch (props.message.contentType) {\n case 'text':\n return MessageContentAsText(props);\n case 'html':\n return MessageContentAsRichTextHTML(props);\n case 'richtext/html':\n return MessageContentAsRichTextHTML(props);\n default:\n console.warn('unknown message content type');\n return <></>;\n }\n};\n\nconst MessageContentWithLiveAria = (props: MessageContentWithLiveAriaProps): JSX.Element => {\n return (\n <div data-ui-status={props.message.status} role=\"text\" aria-label={props.ariaLabel}>\n <LiveMessage message={props.liveMessage} ariaLive=\"polite\" />\n {props.content}\n </div>\n );\n};\n\nconst MessageContentAsRichTextHTML = (props: ChatMessageContentProps): JSX.Element => {\n return (\n <MessageContentWithLiveAria\n message={props.message}\n liveMessage={generateLiveMessage(props)}\n ariaLabel={messageContentAriaText(props)}\n content={processHtmlToReact(props)}\n />\n );\n};\n\nconst MessageContentAsText = (props: ChatMessageContentProps): JSX.Element => {\n return (\n <MessageContentWithLiveAria\n message={props.message}\n liveMessage={generateLiveMessage(props)}\n ariaLabel={messageContentAriaText(props)}\n content={\n <Linkify\n componentDecorator={(decoratedHref: string, decoratedText: string, key: number) => {\n return (\n <Link target=\"_blank\" href={decoratedHref} key={key}>\n {decoratedText}\n </Link>\n );\n }}\n >\n {props.message.content}\n </Linkify>\n }\n />\n );\n};\n\n/* @conditional-compile-remove(data-loss-prevention) */\n/**\n * @private\n */\nexport const BlockedMessageContent = (props: BlockedMessageContentProps): JSX.Element => {\n const Icon: JSX.Element = <FontIcon iconName={'DataLossPreventionProhibited'} />;\n const blockedMessage =\n props.message.warningText === undefined ? props.strings.blockedWarningText : props.message.warningText;\n const blockedMessageLink = props.message.link;\n const blockedMessageLinkText = blockedMessageLink\n ? props.message.linkText ?? props.strings.blockedWarningLinkText\n : '';\n\n const liveAuthor =\n props.message.mine || props.message.senderDisplayName === undefined ? '' : props.message.senderDisplayName;\n const liveBlockedWarningText = `${liveAuthor} ${blockedMessage} ${blockedMessageLinkText}`;\n return (\n <MessageContentWithLiveAria\n message={props.message}\n liveMessage={liveBlockedWarningText}\n ariaLabel={liveBlockedWarningText}\n content={\n <Stack horizontal wrap>\n {Icon}\n {blockedMessage && <p>{blockedMessage}</p>}\n {blockedMessageLink && (\n <Link target={'_blank'} href={blockedMessageLink}>\n {blockedMessageLinkText}\n </Link>\n )}\n </Stack>\n }\n />\n );\n};\n\n// https://stackoverflow.com/questions/28899298/extract-the-text-out-of-html-string-using-javascript\nconst extractContent = (s: string): string => {\n const span = document.createElement('span');\n span.innerHTML = s;\n return span.textContent || span.innerText;\n};\n\nconst generateLiveMessage = (props: ChatMessageContentProps): string => {\n const liveAuthor = _formatString(props.strings.liveAuthorIntro, { author: `${props.message.senderDisplayName}` });\n\n return `${props.message.editedOn ? props.strings.editedTag : ''} ${\n props.message.mine ? '' : liveAuthor\n } ${extractContent(props.message.content || '')} `;\n};\n\nconst messageContentAriaText = (props: ChatMessageContentProps): string | undefined => {\n if (props.message.content) {\n // Replace all <img> tags with 'image' for aria.\n const parsedContent = DOMPurify.sanitize(props.message.content, {\n ALLOWED_TAGS: ['img'],\n RETURN_DOM_FRAGMENT: true\n });\n\n parsedContent.childNodes.forEach((child) => {\n if (child.nodeName.toLowerCase() !== 'img') {\n return;\n }\n const imageTextNode = document.createElement('div');\n imageTextNode.innerHTML = 'image ';\n parsedContent.replaceChild(imageTextNode, child);\n });\n\n // Strip all html tags from the content for aria.\n const message = DOMPurify.sanitize(parsedContent, { ALLOWED_TAGS: [] });\n\n return props.message.mine\n ? _formatString(props.strings.messageContentMineAriaText, {\n message: message\n })\n : _formatString(props.strings.messageContentAriaText, {\n author: `${props.message.senderDisplayName}`,\n message: message\n });\n }\n return undefined;\n};\n\n/* @conditional-compile-remove(image-overlay) */\nconst defaultOnRenderInlineImage = (inlineImage: InlineImage): JSX.Element => {\n return <img tabIndex={0} data-ui-id={inlineImage.imgAttrs.id} {...inlineImage.imgAttrs} />;\n};\n\nconst processHtmlToReact = (props: ChatMessageContentProps): JSX.Element => {\n const options: HTMLReactParserOptions = {\n transform(reactNode, domNode) {\n if (domNode instanceof DOMElement && domNode.attribs) {\n // Transform custom rendering of mentions\n /* @conditional-compile-remove(mention) */\n if (props.mentionDisplayOptions?.onRenderMention && domNode.name === 'msft-mention') {\n const { id } = domNode.attribs;\n const mention: Mention = {\n id: id,\n displayText: (domNode.children[0] as unknown as Text).nodeValue ?? ''\n };\n return props.mentionDisplayOptions.onRenderMention(mention, defaultOnMentionRender);\n }\n\n // Transform inline images\n /* @conditional-compile-remove(teams-inline-images-and-file-sharing) */\n if (\n domNode.name &&\n domNode.name === 'img' &&\n domNode.attribs &&\n domNode.attribs.id &&\n props.message.inlineImages?.find((metadata) => {\n return metadata.id === domNode.attribs.id;\n })\n ) {\n domNode.attribs['aria-label'] = domNode.attribs.name;\n const imgProps = attributesToProps(domNode.attribs);\n /* @conditional-compile-remove(image-overlay) */\n const inlineImageProps: InlineImage = { messageId: props.message.messageId, imgAttrs: imgProps };\n\n /* @conditional-compile-remove(image-overlay) */\n return props.inlineImageOptions?.onRenderInlineImage\n ? props.inlineImageOptions.onRenderInlineImage(inlineImageProps, defaultOnRenderInlineImage)\n : defaultOnRenderInlineImage(inlineImageProps);\n\n return <img {...imgProps} />;\n }\n }\n // Pass through the original node\n return reactNode as unknown as JSX.Element;\n }\n };\n return <>{parse(props.message.content ?? '', options)}</>;\n};\n"]}
@@ -1,4 +1,4 @@
1
- /// <reference types="react" />
1
+ import { SyntheticEvent } from 'react';
2
2
  /**
3
3
  * Props for {@link ImageOverlay}.
4
4
  *
@@ -30,9 +30,13 @@ export interface ImageOverlayProps {
30
30
  */
31
31
  onDismiss: () => void;
32
32
  /**
33
- * Optional callback called when the download button is clicked. If not provided, the download button will not be rendered.
33
+ * Callback called when the download button is clicked.
34
34
  */
35
- onDownloadButtonClicked?: (imageSrc: string) => void;
35
+ onDownloadButtonClicked: (imageSrc: string) => void;
36
+ /**
37
+ * Callback called when there's an error loading the image.
38
+ */
39
+ onError?: (event: SyntheticEvent<HTMLImageElement, Event>) => void;
36
40
  }
37
41
  /**
38
42
  * Strings of {@link ImageOverlay} that can be overridden.
@@ -7,47 +7,46 @@ import React, { useState } from 'react';
7
7
  /* @conditional-compile-remove(image-overlay) */
8
8
  import { bodyContainer, brokenImageStyle, cancelIcon, closeButtonStyles, controlBarContainerStyle, downloadButtonStyle, downloadIcon, downloadIconStyle, focusTrapZoneStyle, headerStyle, normalImageStyle, overlayStyles, scrollableContentStyle, smallDownloadButtonContainerStyle, titleBarContainerStyle, titleStyle } from './styles/ImageOverlay.style';
9
9
  /* @conditional-compile-remove(image-overlay) */
10
- import { FluentThemeProvider } from '../theming/FluentThemeProvider';
10
+ import { useTheme } from '../theming/FluentThemeProvider';
11
11
  /* @conditional-compile-remove(image-overlay) */
12
12
  import { useLocale } from '../localization';
13
13
  /* @conditional-compile-remove(image-overlay) */
14
- import { imageOverlayTheme } from '../theming';
15
- /* @conditional-compile-remove(image-overlay) */
16
14
  /**
17
15
  * Component to render a fullscreen modal for a selected image.
18
16
  *
19
17
  * @beta
20
18
  */
21
19
  export const ImageOverlay = (props) => {
22
- const { isOpen, imageSrc, title, titleIcon, altText, onDownloadButtonClicked, onDismiss } = props;
20
+ const { isOpen, imageSrc, title, titleIcon, altText, onDownloadButtonClicked, onDismiss, onError } = props;
21
+ const theme = useTheme();
23
22
  /* @conditional-compile-remove(image-overlay) */
24
23
  const localeStrings = useLocale().strings.imageOverlay;
25
24
  const [isImageLoaded, setIsImageLoaded] = useState(true);
26
- const imageStyle = isImageLoaded ? normalImageStyle : brokenImageStyle(imageOverlayTheme);
25
+ const imageStyle = isImageLoaded ? normalImageStyle : brokenImageStyle(theme);
27
26
  const renderHeaderBar = () => {
28
27
  return (React.createElement(Stack, { className: mergeStyles(headerStyle) },
29
28
  React.createElement(Stack, { className: mergeStyles(titleBarContainerStyle) },
30
29
  titleIcon,
31
- React.createElement(Stack.Item, { className: mergeStyles(titleStyle(imageOverlayTheme)), "aria-label": title || 'Image' }, title)),
30
+ React.createElement(Stack.Item, { className: mergeStyles(titleStyle(theme)), "aria-label": title || 'Image' }, title)),
32
31
  React.createElement(Stack, { className: mergeStyles(controlBarContainerStyle) },
33
- onDownloadButtonClicked && (React.createElement(DefaultButton, { className: mergeStyles(downloadButtonStyle),
32
+ React.createElement(DefaultButton, { className: mergeStyles(downloadButtonStyle(theme)),
34
33
  /* @conditional-compile-remove(image-overlay) */
35
- text: localeStrings.downloadButtonLabel, onClick: () => onDownloadButtonClicked && onDownloadButtonClicked(imageSrc), onRenderIcon: () => React.createElement(Icon, { iconName: downloadIcon.iconName, className: mergeStyles(downloadIconStyle) }), "aria-live": 'polite', "aria-label": localeStrings.downloadButtonLabel })),
36
- onDownloadButtonClicked && (React.createElement(IconButton, { iconProps: downloadIcon, className: mergeStyles(smallDownloadButtonContainerStyle(imageOverlayTheme)), onClick: () => onDownloadButtonClicked && onDownloadButtonClicked(imageSrc), "aria-label": localeStrings.downloadButtonLabel, "aria-live": 'polite' })),
37
- React.createElement(IconButton, { iconProps: cancelIcon, className: mergeStyles(closeButtonStyles(imageOverlayTheme)), onClick: onDismiss,
34
+ text: localeStrings.downloadButtonLabel, onClick: () => onDownloadButtonClicked(imageSrc), onRenderIcon: () => React.createElement(Icon, { iconName: downloadIcon.iconName, className: mergeStyles(downloadIconStyle) }), "aria-live": 'polite', "aria-label": localeStrings.downloadButtonLabel }),
35
+ React.createElement(IconButton, { iconProps: downloadIcon, className: mergeStyles(smallDownloadButtonContainerStyle(theme)), onClick: () => onDownloadButtonClicked(imageSrc), "aria-label": localeStrings.downloadButtonLabel, "aria-live": 'polite' }),
36
+ React.createElement(IconButton, { iconProps: cancelIcon, className: mergeStyles(closeButtonStyles(theme)), onClick: onDismiss,
38
37
  /* @conditional-compile-remove(image-overlay) */
39
38
  ariaLabel: localeStrings.dismissButtonAriaLabel, "aria-live": 'polite' }))));
40
39
  };
41
40
  const renderBodyWithLightDismiss = () => {
42
- return (React.createElement(Stack, { className: mergeStyles(bodyContainer), onClick: () => props.onDismiss() }, imageSrc && (React.createElement("img", { src: imageSrc, className: mergeStyles(imageStyle), alt: altText || 'image', "aria-label": 'image-overlay-main-image', "aria-live": 'polite', onError: () => {
41
+ return (React.createElement(Stack, { className: mergeStyles(bodyContainer), onClick: () => props.onDismiss() }, imageSrc && (React.createElement("img", { src: imageSrc, className: mergeStyles(imageStyle), alt: altText || 'image', "aria-label": 'image-overlay-main-image', "aria-live": 'polite', onError: (event) => {
43
42
  setIsImageLoaded(false);
43
+ onError && onError(event);
44
44
  }, onClick: (event) => event.stopPropagation(), onDoubleClick: (event) => {
45
45
  event.persist();
46
46
  } }))));
47
47
  };
48
- return (React.createElement(FluentThemeProvider, { fluentTheme: imageOverlayTheme },
49
- React.createElement(Modal, { titleAriaId: title, isOpen: isOpen, onDismiss: onDismiss, overlay: { styles: Object.assign({}, overlayStyles(imageOverlayTheme)) }, styles: { main: focusTrapZoneStyle, scrollableContent: scrollableContentStyle }, isDarkOverlay: true },
50
- renderHeaderBar(),
51
- renderBodyWithLightDismiss())));
48
+ return (React.createElement(Modal, { titleAriaId: title, isOpen: isOpen, onDismiss: onDismiss, overlay: { styles: Object.assign({}, overlayStyles(theme)) }, styles: { main: focusTrapZoneStyle, scrollableContent: scrollableContentStyle }, isDarkOverlay: true },
49
+ renderHeaderBar(),
50
+ renderBodyWithLightDismiss()));
52
51
  };
53
52
  //# sourceMappingURL=ImageOverlay.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ImageOverlay.js","sourceRoot":"","sources":["../../../../../../react-components/src/components/ImageOverlay.tsx"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,gDAAgD;AAChD,OAAO,EAAE,aAAa,EAAE,IAAI,EAAE,UAAU,EAAE,KAAK,EAAE,KAAK,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAC7F,gDAAgD;AAChD,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACxC,gDAAgD;AAChD,OAAO,EACL,aAAa,EACb,gBAAgB,EAChB,UAAU,EACV,iBAAiB,EACjB,wBAAwB,EACxB,mBAAmB,EACnB,YAAY,EACZ,iBAAiB,EACjB,kBAAkB,EAClB,WAAW,EACX,gBAAgB,EAChB,aAAa,EACb,sBAAsB,EACtB,iCAAiC,EACjC,sBAAsB,EACtB,UAAU,EACX,MAAM,6BAA6B,CAAC;AACrC,gDAAgD;AAChD,OAAO,EAAE,mBAAmB,EAAE,MAAM,gCAAgC,CAAC;AACrE,gDAAgD;AAChD,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,gDAAgD;AAChD,OAAO,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAsD/C,gDAAgD;AAChD;;;;GAIG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,KAAwB,EAAe,EAAE;IACpE,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,KAAK,EAAE,SAAS,EA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iBAAiB,CAAC,CAAE,EAAE,EAC5D,MAAM,EAAE,EAAE,IAAI,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,sBAAsB,EAAE,EAC/E,aAAa,EAAE,IAAI;YAElB,eAAe,EAAE;YACjB,0BAA0B,EAAE,CACvB,CACY,CACvB,CAAC;AACJ,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\n/* @conditional-compile-remove(image-overlay) */\nimport { DefaultButton, Icon, IconButton, Modal, Stack, mergeStyles } from '@fluentui/react';\n/* @conditional-compile-remove(image-overlay) */\nimport React, { useState } from 'react';\n/* @conditional-compile-remove(image-overlay) */\nimport {\n bodyContainer,\n brokenImageStyle,\n cancelIcon,\n closeButtonStyles,\n controlBarContainerStyle,\n downloadButtonStyle,\n downloadIcon,\n downloadIconStyle,\n focusTrapZoneStyle,\n headerStyle,\n normalImageStyle,\n overlayStyles,\n scrollableContentStyle,\n smallDownloadButtonContainerStyle,\n titleBarContainerStyle,\n titleStyle\n} from './styles/ImageOverlay.style';\n/* @conditional-compile-remove(image-overlay) */\nimport { FluentThemeProvider } from '../theming/FluentThemeProvider';\n/* @conditional-compile-remove(image-overlay) */\nimport { useLocale } from '../localization';\n/* @conditional-compile-remove(image-overlay) */\nimport { imageOverlayTheme } from '../theming';\n\n/* @conditional-compile-remove(image-overlay) */\n/**\n * Props for {@link ImageOverlay}.\n *\n * @beta\n */\nexport interface ImageOverlayProps {\n /**\n * Boolean that controls whether the modal is displayed.\n */\n isOpen: boolean;\n /**\n * Image source used to display the image in a large scale.\n */\n imageSrc: string;\n /**\n * Optional string used as a alt text for the image. @default 'image'\n */\n altText?: string;\n /**\n * Optional string used as the title of the image and displayed on the top left corner of the ImageOverlay.\n */\n title?: string;\n /**\n * Optional JSX element used as a title icon and displayed to the left of the title element.\n */\n titleIcon?: JSX.Element;\n /**\n * Callback to invoke when the ImageOverlay modal is dismissed\n */\n onDismiss: () => void;\n /**\n * Optional callback called when the download button is clicked. If not provided, the download button will not be rendered.\n */\n onDownloadButtonClicked?: (imageSrc: string) => void;\n}\n/* @conditional-compile-remove(image-overlay) */\n/**\n * Strings of {@link ImageOverlay} that can be overridden.\n *\n * @beta\n */\nexport interface ImageOverlayStrings {\n /**\n * Download button label for ImageOverlay\n */\n downloadButtonLabel: string;\n /**\n * Dismiss button aria label for ImageOverlay\n */\n dismissButtonAriaLabel: string;\n}\n/* @conditional-compile-remove(image-overlay) */\n/**\n * Component to render a fullscreen modal for a selected image.\n *\n * @beta\n */\nexport const ImageOverlay = (props: ImageOverlayProps): JSX.Element => {\n const { isOpen, imageSrc, title, titleIcon, altText, onDownloadButtonClicked, onDismiss } = props;\n\n /* @conditional-compile-remove(image-overlay) */\n const localeStrings = useLocale().strings.imageOverlay;\n\n const [isImageLoaded, setIsImageLoaded] = useState<boolean>(true);\n\n const imageStyle = isImageLoaded ? normalImageStyle : brokenImageStyle(imageOverlayTheme);\n\n const renderHeaderBar = (): JSX.Element => {\n return (\n <Stack className={mergeStyles(headerStyle)}>\n <Stack className={mergeStyles(titleBarContainerStyle)}>\n {titleIcon}\n <Stack.Item className={mergeStyles(titleStyle(imageOverlayTheme))} aria-label={title || 'Image'}>\n {title}\n </Stack.Item>\n </Stack>\n <Stack className={mergeStyles(controlBarContainerStyle)}>\n {onDownloadButtonClicked && (\n <DefaultButton\n className={mergeStyles(downloadButtonStyle)}\n /* @conditional-compile-remove(image-overlay) */\n text={localeStrings.downloadButtonLabel}\n onClick={() => onDownloadButtonClicked && onDownloadButtonClicked(imageSrc)}\n onRenderIcon={() => <Icon iconName={downloadIcon.iconName} className={mergeStyles(downloadIconStyle)} />}\n aria-live={'polite'}\n /* @conditional-compile-remove(image-overlay) */\n aria-label={localeStrings.downloadButtonLabel}\n />\n )}\n {onDownloadButtonClicked && (\n <IconButton\n iconProps={downloadIcon}\n className={mergeStyles(smallDownloadButtonContainerStyle(imageOverlayTheme))}\n onClick={() => onDownloadButtonClicked && onDownloadButtonClicked(imageSrc)}\n /* @conditional-compile-remove(image-overlay) */\n aria-label={localeStrings.downloadButtonLabel}\n aria-live={'polite'}\n />\n )}\n <IconButton\n iconProps={cancelIcon}\n className={mergeStyles(closeButtonStyles(imageOverlayTheme))}\n onClick={onDismiss}\n /* @conditional-compile-remove(image-overlay) */\n ariaLabel={localeStrings.dismissButtonAriaLabel}\n aria-live={'polite'}\n />\n </Stack>\n </Stack>\n );\n };\n\n const renderBodyWithLightDismiss = (): JSX.Element => {\n return (\n <Stack className={mergeStyles(bodyContainer)} onClick={() => props.onDismiss()}>\n {imageSrc && (\n <img\n src={imageSrc}\n className={mergeStyles(imageStyle)}\n alt={altText || 'image'}\n aria-label={'image-overlay-main-image'}\n aria-live={'polite'}\n onError={() => {\n setIsImageLoaded(false);\n }}\n onClick={(event) => event.stopPropagation()}\n onDoubleClick={(event) => {\n event.persist();\n }}\n />\n )}\n </Stack>\n );\n };\n\n return (\n <FluentThemeProvider fluentTheme={imageOverlayTheme}>\n <Modal\n titleAriaId={title}\n isOpen={isOpen}\n onDismiss={onDismiss}\n overlay={{ styles: { ...overlayStyles(imageOverlayTheme) } }}\n styles={{ main: focusTrapZoneStyle, scrollableContent: scrollableContentStyle }}\n isDarkOverlay={true}\n >\n {renderHeaderBar()}\n {renderBodyWithLightDismiss()}\n </Modal>\n </FluentThemeProvider>\n );\n};\n"]}
1
+ {"version":3,"file":"ImageOverlay.js","sourceRoot":"","sources":["../../../../../../react-components/src/components/ImageOverlay.tsx"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,gDAAgD;AAChD,OAAO,EAAE,aAAa,EAAE,IAAI,EAAE,UAAU,EAAE,KAAK,EAAE,KAAK,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAC7F,gDAAgD;AAChD,OAAO,KAAK,EAAE,EAAkB,QAAQ,EAAE,MAAM,OAAO,CAAC;AACxD,gDAAgD;AAChD,OAAO,EACL,aAAa,EACb,gBAAgB,EAChB,UAAU,EACV,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AAK,EAAE,EAAE;gBACjB,gBAAgB,CAAC,KAAK,CAAC,CAAC;gBACxB,OAAO,IAAI,OAAO,CAAC,KAAK,CAAC,CAAC;YAC5B,CAAC,EACD,OAAO,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,eAAe,EAAE,EAC3C,aAAa,EAAE,CAAC,KAAK,EAAE,EAAE;gBACvB,KAAK,CAAC,OAAO,EAAE,CAAC;YAClB,CAAC,GACD,CACH,CACK,CACT,CAAC;IACJ,CAAC,CAAC;IAEF,OAAO,CACL,oBAAC,KAAK,IACJ,WAAW,EAAE,KAAK,EAClB,MAAM,EAAE,MAAM,EACd,SAAS,EAAE,SAAS,EACpB,OAAO,EAAE,EAAE,MAAM,oBAAO,aAAa,CAAC,KAAK,CAAC,CAAE,EAAE,EAChD,MAAM,EAAE,EAAE,IAAI,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,sBAAsB,EAAE,EAC/E,aAAa,EAAE,IAAI;QAElB,eAAe,EAAE;QACjB,0BAA0B,EAAE,CACvB,CACT,CAAC;AACJ,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\n/* @conditional-compile-remove(image-overlay) */\nimport { DefaultButton, Icon, IconButton, Modal, Stack, mergeStyles } from '@fluentui/react';\n/* @conditional-compile-remove(image-overlay) */\nimport React, { SyntheticEvent, useState } from 'react';\n/* @conditional-compile-remove(image-overlay) */\nimport {\n bodyContainer,\n brokenImageStyle,\n cancelIcon,\n closeButtonStyles,\n controlBarContainerStyle,\n downloadButtonStyle,\n downloadIcon,\n downloadIconStyle,\n focusTrapZoneStyle,\n headerStyle,\n normalImageStyle,\n overlayStyles,\n scrollableContentStyle,\n smallDownloadButtonContainerStyle,\n titleBarContainerStyle,\n titleStyle\n} from './styles/ImageOverlay.style';\n/* @conditional-compile-remove(image-overlay) */\nimport { useTheme } from '../theming/FluentThemeProvider';\n/* @conditional-compile-remove(image-overlay) */\nimport { useLocale } from '../localization';\n/* @conditional-compile-remove(image-overlay) */\nimport { ChatTheme } from '../theming';\n\n/* @conditional-compile-remove(image-overlay) */\n/**\n * Props for {@link ImageOverlay}.\n *\n * @beta\n */\nexport interface ImageOverlayProps {\n /**\n * Boolean that controls whether the modal is displayed.\n */\n isOpen: boolean;\n /**\n * Image source used to display the image in a large scale.\n */\n imageSrc: string;\n /**\n * Optional string used as a alt text for the image. @default 'image'\n */\n altText?: string;\n /**\n * Optional string used as the title of the image and displayed on the top left corner of the ImageOverlay.\n */\n title?: string;\n /**\n * Optional JSX element used as a title icon and displayed to the left of the title element.\n */\n titleIcon?: JSX.Element;\n /**\n * Callback to invoke when the ImageOverlay modal is dismissed\n */\n onDismiss: () => void;\n /**\n * Callback called when the download button is clicked.\n */\n onDownloadButtonClicked: (imageSrc: string) => void;\n /**\n * Callback called when there's an error loading the image.\n */\n onError?: (event: SyntheticEvent<HTMLImageElement, Event>) => void;\n}\n/* @conditional-compile-remove(image-overlay) */\n/**\n * Strings of {@link ImageOverlay} that can be overridden.\n *\n * @beta\n */\nexport interface ImageOverlayStrings {\n /**\n * Download button label for ImageOverlay\n */\n downloadButtonLabel: string;\n /**\n * Dismiss button aria label for ImageOverlay\n */\n dismissButtonAriaLabel: string;\n}\n/* @conditional-compile-remove(image-overlay) */\n/**\n * Component to render a fullscreen modal for a selected image.\n *\n * @beta\n */\nexport const ImageOverlay = (props: ImageOverlayProps): JSX.Element => {\n const { isOpen, imageSrc, title, titleIcon, altText, onDownloadButtonClicked, onDismiss, onError } = props;\n const theme = useTheme() as unknown as ChatTheme;\n\n /* @conditional-compile-remove(image-overlay) */\n const localeStrings = useLocale().strings.imageOverlay;\n\n const [isImageLoaded, setIsImageLoaded] = useState<boolean>(true);\n\n const imageStyle = isImageLoaded ? normalImageStyle : brokenImageStyle(theme);\n\n const renderHeaderBar = (): JSX.Element => {\n return (\n <Stack className={mergeStyles(headerStyle)}>\n <Stack className={mergeStyles(titleBarContainerStyle)}>\n {titleIcon}\n <Stack.Item className={mergeStyles(titleStyle(theme))} aria-label={title || 'Image'}>\n {title}\n </Stack.Item>\n </Stack>\n <Stack className={mergeStyles(controlBarContainerStyle)}>\n <DefaultButton\n className={mergeStyles(downloadButtonStyle(theme))}\n /* @conditional-compile-remove(image-overlay) */\n text={localeStrings.downloadButtonLabel}\n onClick={() => onDownloadButtonClicked(imageSrc)}\n onRenderIcon={() => <Icon iconName={downloadIcon.iconName} className={mergeStyles(downloadIconStyle)} />}\n aria-live={'polite'}\n /* @conditional-compile-remove(image-overlay) */\n aria-label={localeStrings.downloadButtonLabel}\n />\n <IconButton\n iconProps={downloadIcon}\n className={mergeStyles(smallDownloadButtonContainerStyle(theme))}\n onClick={() => onDownloadButtonClicked(imageSrc)}\n /* @conditional-compile-remove(image-overlay) */\n aria-label={localeStrings.downloadButtonLabel}\n aria-live={'polite'}\n />\n <IconButton\n iconProps={cancelIcon}\n className={mergeStyles(closeButtonStyles(theme))}\n onClick={onDismiss}\n /* @conditional-compile-remove(image-overlay) */\n ariaLabel={localeStrings.dismissButtonAriaLabel}\n aria-live={'polite'}\n />\n </Stack>\n </Stack>\n );\n };\n\n const renderBodyWithLightDismiss = (): JSX.Element => {\n return (\n <Stack className={mergeStyles(bodyContainer)} onClick={() => props.onDismiss()}>\n {imageSrc && (\n <img\n src={imageSrc}\n className={mergeStyles(imageStyle)}\n alt={altText || 'image'}\n aria-label={'image-overlay-main-image'}\n aria-live={'polite'}\n onError={(event) => {\n setIsImageLoaded(false);\n onError && onError(event);\n }}\n onClick={(event) => event.stopPropagation()}\n onDoubleClick={(event) => {\n event.persist();\n }}\n />\n )}\n </Stack>\n );\n };\n\n return (\n <Modal\n titleAriaId={title}\n isOpen={isOpen}\n onDismiss={onDismiss}\n overlay={{ styles: { ...overlayStyles(theme) } }}\n styles={{ main: focusTrapZoneStyle, scrollableContent: scrollableContentStyle }}\n isDarkOverlay={true}\n >\n {renderHeaderBar()}\n {renderBodyWithLightDismiss()}\n </Modal>\n );\n};\n"]}
@@ -1,5 +1,6 @@
1
- import { IIconProps, IStyle, PartialTheme } from '@fluentui/react';
1
+ import { IIconProps, IStyle } from '@fluentui/react';
2
2
  import { IOverlayStyles } from '@fluentui/react';
3
+ import { ChatTheme } from '../../theming/themes';
3
4
  /**
4
5
  * @private
5
6
  */
@@ -11,7 +12,7 @@ export declare const downloadIcon: IIconProps;
11
12
  /**
12
13
  * @private
13
14
  */
14
- export declare const overlayStyles: (theme: PartialTheme) => IOverlayStyles;
15
+ export declare const overlayStyles: (theme: ChatTheme) => IOverlayStyles;
15
16
  /**
16
17
  * @private
17
18
  */
@@ -31,7 +32,7 @@ export declare const titleBarContainerStyle: IStyle;
31
32
  /**
32
33
  * @private
33
34
  */
34
- export declare const titleStyle: (theme: PartialTheme) => IStyle;
35
+ export declare const titleStyle: (theme: ChatTheme) => IStyle;
35
36
  /**
36
37
  * @private
37
38
  */
@@ -51,17 +52,17 @@ export declare const normalImageStyle: IStyle;
51
52
  /**
52
53
  * @private
53
54
  */
54
- export declare const brokenImageStyle: (theme: PartialTheme) => IStyle;
55
+ export declare const brokenImageStyle: (theme: ChatTheme) => IStyle;
55
56
  /**
56
57
  * @private
57
58
  */
58
- export declare const closeButtonStyles: (theme: PartialTheme) => IStyle;
59
+ export declare const closeButtonStyles: (theme: ChatTheme) => IStyle;
59
60
  /**
60
61
  * @private
61
62
  */
62
- export declare const downloadButtonStyle: IStyle;
63
+ export declare const downloadButtonStyle: (theme: ChatTheme) => IStyle;
63
64
  /**
64
65
  * @private
65
66
  */
66
- export declare const smallDownloadButtonContainerStyle: (theme: PartialTheme) => IStyle;
67
+ export declare const smallDownloadButtonContainerStyle: (theme: ChatTheme) => IStyle;
67
68
  //# sourceMappingURL=ImageOverlay.style.d.ts.map
@@ -15,11 +15,10 @@ export const downloadIcon = {
15
15
  * @private
16
16
  */
17
17
  export const overlayStyles = (theme) => {
18
- var _a;
19
18
  return {
20
19
  root: {
21
- background: (_a = theme.palette) === null || _a === void 0 ? void 0 : _a.white,
22
- opacity: '0.95'
20
+ background: theme.chatPalette.modalOverlayBlack,
21
+ opacity: '0.85'
23
22
  }
24
23
  };
25
24
  };
@@ -68,14 +67,14 @@ export const titleBarContainerStyle = {
68
67
  alignContent: 'center',
69
68
  alignItems: 'center'
70
69
  };
70
+ /* @conditional-compile-remove(image-overlay) */
71
71
  /**
72
72
  * @private
73
73
  */
74
74
  export const titleStyle = (theme) => {
75
- var _a;
76
75
  return {
77
76
  paddingLeft: '0.5rem',
78
- color: (_a = theme.palette) === null || _a === void 0 ? void 0 : _a.black,
77
+ color: theme.chatPalette.modalTitleWhite,
79
78
  fontFamily: 'inherit',
80
79
  fontSize: '0.875rem',
81
80
  fontStyle: 'normal',
@@ -123,60 +122,77 @@ export const normalImageStyle = {
123
122
  maxHeight: '100%',
124
123
  maxWidth: '100%'
125
124
  };
125
+ /* @conditional-compile-remove(image-overlay) */
126
126
  /**
127
127
  * @private
128
128
  */
129
129
  export const brokenImageStyle = (theme) => {
130
- var _a;
131
130
  return {
132
- color: (_a = theme.palette) === null || _a === void 0 ? void 0 : _a.black
131
+ color: theme.chatPalette.modalTitleWhite
133
132
  };
134
133
  };
134
+ /* @conditional-compile-remove(image-overlay) */
135
135
  /**
136
136
  * @private
137
137
  */
138
138
  export const closeButtonStyles = (theme) => {
139
- var _a, _b, _c;
140
139
  return {
141
- color: (_a = theme.palette) === null || _a === void 0 ? void 0 : _a.black,
140
+ color: theme.chatPalette.modalTitleWhite,
142
141
  ':hover': {
143
- color: (_b = theme.palette) === null || _b === void 0 ? void 0 : _b.black
142
+ color: theme.chatPalette.modalTitleWhite,
143
+ backgroundColor: theme.chatPalette.modalButtonBackgroundHover
144
144
  },
145
145
  ':active': {
146
- color: (_c = theme.palette) === null || _c === void 0 ? void 0 : _c.black
146
+ color: theme.chatPalette.modalTitleWhite,
147
+ backgroundColor: theme.chatPalette.modalButtonBackgroundActive
147
148
  }
148
149
  };
149
150
  };
151
+ /* @conditional-compile-remove(image-overlay) */
150
152
  /**
151
153
  * @private
152
154
  */
153
- export const downloadButtonStyle = {
154
- margin: '0 0.5rem',
155
- height: '32px',
156
- borderWidth: '1px',
157
- fontSize: '0.875rem', // 14px
158
- fontWeight: 600,
159
- padding: '0.38rem 0.75rem',
160
- borderRadius: '4px',
161
- whiteSpace: 'nowrap',
162
- '@media (max-width: 25rem)': {
163
- display: 'none'
164
- }
155
+ export const downloadButtonStyle = (theme) => {
156
+ return {
157
+ margin: '0 0.5rem',
158
+ height: '32px',
159
+ borderWidth: '1px',
160
+ fontSize: '0.875rem', // 14px
161
+ fontWeight: 600,
162
+ padding: '0.38rem 0.75rem',
163
+ borderRadius: '4px',
164
+ backgroundColor: theme.chatPalette.modalButtonBackground,
165
+ color: theme.chatPalette.modalTitleWhite,
166
+ whiteSpace: 'nowrap',
167
+ ':hover': {
168
+ color: theme.chatPalette.modalTitleWhite,
169
+ backgroundColor: theme.chatPalette.modalButtonBackgroundHover
170
+ },
171
+ ':active': {
172
+ color: theme.chatPalette.modalTitleWhite,
173
+ backgroundColor: theme.chatPalette.modalButtonBackgroundActive
174
+ },
175
+ '@media (max-width: 25rem)': {
176
+ display: 'none'
177
+ }
178
+ };
165
179
  };
180
+ /* @conditional-compile-remove(image-overlay) */
166
181
  /**
167
182
  * @private
168
183
  */
169
184
  export const smallDownloadButtonContainerStyle = (theme) => {
170
- var _a, _b, _c;
171
185
  return {
172
186
  marginRight: '0.5rem',
187
+ color: theme.chatPalette.modalTitleWhite,
173
188
  whiteSpace: 'nowrap',
174
- color: (_a = theme.palette) === null || _a === void 0 ? void 0 : _a.black,
175
189
  ':hover': {
176
- color: (_b = theme.palette) === null || _b === void 0 ? void 0 : _b.black
190
+ color: theme.chatPalette.modalTitleWhite,
191
+ backgroundColor: theme.chatPalette.modalButtonBackgroundHover
177
192
  },
178
193
  ':active': {
179
- color: (_c = theme.palette) === null || _c === void 0 ? void 0 : _c.black
194
+ color: theme.chatPalette.modalTitleWhite,
195
+ backgroundColor: theme.chatPalette.modalButtonBackgroundActive
180
196
  },
181
197
  '@media (min-width: 25rem)': {
182
198
  display: 'none'
@@ -1 +1 @@
1
- {"version":3,"file":"ImageOverlay.style.js","sourceRoot":"","sources":["../../../../../../../react-components/src/components/styles/ImageOverlay.style.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAMlC;;GAEG;AACH,MAAM,CAAC,MAAM,UAAU,GAAe,EAAE,QAAQ,EAAE,QAAQ,EAAE,CAAC;AAE7D;;GAEG;AACH,MAAM,CAAC,MAAM,YAAY,GAAe;IACtC,QAAQ,EAAE,UAAU;CACrB,CAAC;AAEF,gDAAgD;AAChD;;GAEG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,KAAmB,EAAkB,EAAE;;IACnE,OAAO;QACL,IAAI,EAAE;YACJ,UAAU,EAAE,MAAA,KAAK,CAAC,OAAO,0CAAE,KAAK;YAChC,OAAO,EAAE,MAAM;SAChB;KACF,CAAC;AACJ,CAAC,CAAC;AAEF;;GAEG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAW;IACxC,SAAS,EAAE,MAAM;IACjB,UAAU,EAAE,aAAa;IACzB,OAAO,EAAE,MAAM;IACf,KAAK,EAAE,MAAM;IACb,MAAM,EAAE,MAAM;IACd,QAAQ,EAAE,MAAM;IAChB,SAAS,EAAE,MAAM;CAClB,CAAC;AAEF;;GAEG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAW;IAC5C,SAAS,EAAE,QAAQ;IACnB,OAAO,EAAE,MAAM;IACf,QAAQ,EAAE,MAAM;IAChB,SAAS,EAAE,MAAM;IACjB,aAAa,EAAE,QAAQ;IACvB,QAAQ,EAAE,QAAQ;CACnB,CAAC;AAEF;;GAEG;AACH,MAAM,CAAC,MAAM,WAAW,GAAW;IACjC,QAAQ,EAAE,SAAS;IACnB,MAAM,EAAE,GAAG;IACX,KAAK,EAAE,MAAM;IACb,MAAM,EAAE,QAAQ;IAChB,aAAa,EAAE,KAAK;IACpB,cAA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0CAAE,KAAK;SAC5B;QACD,2BAA2B,EAAE;YAC3B,OAAO,EAAE,MAAM;SAChB;KACF,CAAC;AACJ,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { IIconProps, IStyle, PartialTheme } from '@fluentui/react';\n/* @conditional-compile-remove(image-overlay) */\nimport { IOverlayStyles } from '@fluentui/react';\n\n/**\n * @private\n */\nexport const cancelIcon: IIconProps = { iconName: 'Cancel' };\n\n/**\n * @private\n */\nexport const downloadIcon: IIconProps = {\n iconName: 'Download'\n};\n\n/* @conditional-compile-remove(image-overlay) */\n/**\n * @private\n */\nexport const overlayStyles = (theme: PartialTheme): IOverlayStyles => {\n return {\n root: {\n background: theme.palette?.white,\n opacity: '0.95'\n }\n };\n};\n\n/**\n * @private\n */\nexport const focusTrapZoneStyle: IStyle = {\n boxShadow: 'none',\n background: 'transparent',\n display: 'flex',\n width: '100%',\n height: '100%',\n maxWidth: '100%',\n maxHeight: '100%'\n};\n\n/**\n * @private\n */\nexport const scrollableContentStyle: IStyle = {\n overflowY: 'hidden',\n display: 'flex',\n maxWidth: '100%',\n maxHeight: '100%',\n flexDirection: 'column',\n flexWrap: 'nowrap'\n};\n\n/**\n * @private\n */\nexport const headerStyle: IStyle = {\n fontSize: 'inherit',\n margin: '0',\n width: '100%',\n height: '3.5rem',\n flexDirection: 'row',\n justifyContent: 'space-between',\n padding: '0.25rem 0.75rem'\n};\n\n/**\n * @private\n */\nexport const titleBarContainerStyle: IStyle = {\n flexDirection: 'row',\n justifyContent: 'start',\n flexWrap: 'wrap',\n alignContent: 'center',\n alignItems: 'center'\n};\n\n/**\n * @private\n */\nexport const titleStyle = (theme: PartialTheme): IStyle => {\n return {\n paddingLeft: '0.5rem',\n color: theme.palette?.black,\n fontFamily: 'inherit',\n fontSize: '0.875rem',\n fontStyle: 'normal',\n fontWeight: '600',\n lineHeight: '1.25rem'\n };\n};\n\n/**\n * @private\n */\nexport const controlBarContainerStyle: IStyle = {\n flexDirection: 'row',\n justifyContent: 'start',\n flexWrap: 'wrap',\n alignContent: 'center',\n alignItems: 'center'\n};\n\n/**\n * @private\n */\nexport const downloadIconStyle: IStyle = {\n marginRight: '0.5em',\n fontSize: '0.875rem' // 14px\n};\n\n/**\n * @private\n */\nexport const bodyContainer: IStyle = {\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n width: '100%',\n height: '100%',\n overflow: 'hidden',\n padding: '1rem 2rem 3rem 2rem',\n '@media (max-width: 25rem) or (max-height: 25rem)': {\n padding: '0rem 1rem 2rem 1rem'\n }\n};\n\n/**\n * @private\n */\nexport const normalImageStyle: IStyle = {\n objectFit: 'contain',\n maxHeight: '100%',\n maxWidth: '100%'\n};\n\n/**\n * @private\n */\nexport const brokenImageStyle = (theme: PartialTheme): IStyle => {\n return {\n color: theme.palette?.black\n };\n};\n\n/**\n * @private\n */\nexport const closeButtonStyles = (theme: PartialTheme): IStyle => {\n return {\n color: theme.palette?.black,\n ':hover': {\n color: theme.palette?.black\n },\n ':active': {\n color: theme.palette?.black\n }\n };\n};\n\n/**\n * @private\n */\nexport const downloadButtonStyle: IStyle = {\n margin: '0 0.5rem',\n height: '32px',\n borderWidth: '1px',\n fontSize: '0.875rem', // 14px\n fontWeight: 600,\n padding: '0.38rem 0.75rem',\n borderRadius: '4px',\n whiteSpace: 'nowrap',\n '@media (max-width: 25rem)': {\n display: 'none'\n }\n};\n\n/**\n * @private\n */\nexport const smallDownloadButtonContainerStyle = (theme: PartialTheme): IStyle => {\n return {\n marginRight: '0.5rem',\n whiteSpace: 'nowrap',\n color: theme.palette?.black,\n ':hover': {\n color: theme.palette?.black\n },\n ':active': {\n color: theme.palette?.black\n },\n '@media (min-width: 25rem)': {\n display: 'none'\n }\n };\n};\n"]}
1
+ {"version":3,"file":"ImageOverlay.style.js","sourceRoot":"","sources":["../../../../../../../react-components/src/components/styles/ImageOverlay.style.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;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H,MAAM,CAAC,MAAM,iCAAiC,GAAG,CAAC,KAAgB,EAAU,EAAE;IAC5E,OAAO;QACL,WAAW,EAAE,QAAQ;QACrB,KAAK,EAAE,KAAK,CAAC,WAAW,CAAC,eAAe;QACxC,UAAU,EAAE,QAAQ;QACpB,QAAQ,EAAE;YACR,KAAK,EAAE,KAAK,CAAC,WAAW,CAAC,eAAe;YACxC,eAAe,EAAE,KAAK,CAAC,WAAW,CAAC,0BAA0B;SAC9D;QACD,SAAS,EAAE;YACT,KAAK,EAAE,KAAK,CAAC,WAAW,CAAC,eAAe;YACxC,eAAe,EAAE,KAAK,CAAC,WAAW,CAAC,2BAA2B;SAC/D;QACD,2BAA2B,EAAE;YAC3B,OAAO,EAAE,MAAM;SAChB;KACF,CAAC;AACJ,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { IIconProps, IStyle } from '@fluentui/react';\n/* @conditional-compile-remove(image-overlay) */\nimport { IOverlayStyles } from '@fluentui/react';\n/* @conditional-compile-remove(image-overlay) */\nimport { ChatTheme } from '../../theming/themes';\n\n/**\n * @private\n */\nexport const cancelIcon: IIconProps = { iconName: 'Cancel' };\n\n/**\n * @private\n */\nexport const downloadIcon: IIconProps = {\n iconName: 'Download'\n};\n\n/* @conditional-compile-remove(image-overlay) */\n/**\n * @private\n */\nexport const overlayStyles = (theme: ChatTheme): IOverlayStyles => {\n return {\n root: {\n background: theme.chatPalette.modalOverlayBlack,\n opacity: '0.85'\n }\n };\n};\n\n/**\n * @private\n */\nexport const focusTrapZoneStyle: IStyle = {\n boxShadow: 'none',\n background: 'transparent',\n display: 'flex',\n width: '100%',\n height: '100%',\n maxWidth: '100%',\n maxHeight: '100%'\n};\n\n/**\n * @private\n */\nexport const scrollableContentStyle: IStyle = {\n overflowY: 'hidden',\n display: 'flex',\n maxWidth: '100%',\n maxHeight: '100%',\n flexDirection: 'column',\n flexWrap: 'nowrap'\n};\n\n/**\n * @private\n */\nexport const headerStyle: IStyle = {\n fontSize: 'inherit',\n margin: '0',\n width: '100%',\n height: '3.5rem',\n flexDirection: 'row',\n justifyContent: 'space-between',\n padding: '0.25rem 0.75rem'\n};\n\n/**\n * @private\n */\nexport const titleBarContainerStyle: IStyle = {\n flexDirection: 'row',\n justifyContent: 'start',\n flexWrap: 'wrap',\n alignContent: 'center',\n alignItems: 'center'\n};\n\n/* @conditional-compile-remove(image-overlay) */\n/**\n * @private\n */\nexport const titleStyle = (theme: ChatTheme): IStyle => {\n return {\n paddingLeft: '0.5rem',\n color: theme.chatPalette.modalTitleWhite,\n fontFamily: 'inherit',\n fontSize: '0.875rem',\n fontStyle: 'normal',\n fontWeight: '600',\n lineHeight: '1.25rem'\n };\n};\n\n/**\n * @private\n */\nexport const controlBarContainerStyle: IStyle = {\n flexDirection: 'row',\n justifyContent: 'start',\n flexWrap: 'wrap',\n alignContent: 'center',\n alignItems: 'center'\n};\n\n/**\n * @private\n */\nexport const downloadIconStyle: IStyle = {\n marginRight: '0.5em',\n fontSize: '0.875rem' // 14px\n};\n\n/**\n * @private\n */\nexport const bodyContainer: IStyle = {\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n width: '100%',\n height: '100%',\n overflow: 'hidden',\n padding: '1rem 2rem 3rem 2rem',\n '@media (max-width: 25rem) or (max-height: 25rem)': {\n padding: '0rem 1rem 2rem 1rem'\n }\n};\n\n/**\n * @private\n */\nexport const normalImageStyle: IStyle = {\n objectFit: 'contain',\n maxHeight: '100%',\n maxWidth: '100%'\n};\n\n/* @conditional-compile-remove(image-overlay) */\n/**\n * @private\n */\nexport const brokenImageStyle = (theme: ChatTheme): IStyle => {\n return {\n color: theme.chatPalette.modalTitleWhite\n };\n};\n\n/* @conditional-compile-remove(image-overlay) */\n/**\n * @private\n */\nexport const closeButtonStyles = (theme: ChatTheme): IStyle => {\n return {\n color: theme.chatPalette.modalTitleWhite,\n ':hover': {\n color: theme.chatPalette.modalTitleWhite,\n backgroundColor: theme.chatPalette.modalButtonBackgroundHover\n },\n ':active': {\n color: theme.chatPalette.modalTitleWhite,\n backgroundColor: theme.chatPalette.modalButtonBackgroundActive\n }\n };\n};\n\n/* @conditional-compile-remove(image-overlay) */\n/**\n * @private\n */\nexport const downloadButtonStyle = (theme: ChatTheme): IStyle => {\n return {\n margin: '0 0.5rem',\n height: '32px',\n borderWidth: '1px',\n fontSize: '0.875rem', // 14px\n fontWeight: 600,\n padding: '0.38rem 0.75rem',\n borderRadius: '4px',\n backgroundColor: theme.chatPalette.modalButtonBackground,\n color: theme.chatPalette.modalTitleWhite,\n whiteSpace: 'nowrap',\n ':hover': {\n color: theme.chatPalette.modalTitleWhite,\n backgroundColor: theme.chatPalette.modalButtonBackgroundHover\n },\n ':active': {\n color: theme.chatPalette.modalTitleWhite,\n backgroundColor: theme.chatPalette.modalButtonBackgroundActive\n },\n '@media (max-width: 25rem)': {\n display: 'none'\n }\n };\n};\n\n/* @conditional-compile-remove(image-overlay) */\n/**\n * @private\n */\nexport const smallDownloadButtonContainerStyle = (theme: ChatTheme): IStyle => {\n return {\n marginRight: '0.5rem',\n color: theme.chatPalette.modalTitleWhite,\n whiteSpace: 'nowrap',\n ':hover': {\n color: theme.chatPalette.modalTitleWhite,\n backgroundColor: theme.chatPalette.modalButtonBackgroundHover\n },\n ':active': {\n color: theme.chatPalette.modalTitleWhite,\n backgroundColor: theme.chatPalette.modalButtonBackgroundActive\n },\n '@media (min-width: 25rem)': {\n display: 'none'\n }\n };\n};\n"]}
@@ -200,7 +200,8 @@
200
200
  "failedToJoinCallGeneric": "فشل في الانضمام إلى المكالمة.",
201
201
  "failedToJoinCallInvalidMeetingLink": "تعذر الانضمام إلى الاجتماع. ارتباط غير صالح.",
202
202
  "cameraFrozenForRemoteParticipants": "يواجه المستخدمون في المكالمة مشكلات في رؤية الفيديو الخاص بك. الرجاء التحقق من أجهزتك وشبكتك.",
203
- "unableToStartVideoEffect": "يتعذر تطبيق تأثير الفيديو."
203
+ "unableToStartVideoEffect": "يتعذر تطبيق تأثير الفيديو.",
204
+ "startSpotlightWhileMaxParticipantsAreSpotlighted": "لا يمكن بدء تسليط الضوء على المشاركين (المشاركين) لأنه تم بالفعل تسليط الضوء على الحد الأقصى لعدد المشاركين."
204
205
  },
205
206
  "videoGallery": {
206
207
  "screenIsBeingSharedMessage": "أنت تشارك شاشتك",
@@ -218,7 +219,12 @@
218
219
  "pinParticipantMenuItemAriaLabel": "تثبيت {participantName}",
219
220
  "unpinParticipantMenuItemAriaLabel": "إزالة تثبيت {participantName}",
220
221
  "pinnedParticipantAnnouncementAriaLabel": "تم تثبيت {participantName}",
221
- "unpinnedParticipantAnnouncementAriaLabel": "تم إلغاء تثبيت {participantName}"
222
+ "unpinnedParticipantAnnouncementAriaLabel": "تم إلغاء تثبيت {participantName}",
223
+ "startSpotlightVideoTileMenuLabel": "تسليط الضوء لدى الجميع",
224
+ "addSpotlightVideoTileMenuLabel": "إضافة تسليط ضوء",
225
+ "spotlightLimitReachedMenuTitle": "تم الوصول إلى الحد الأقصى لتسليط الضوء",
226
+ "stopSpotlightVideoTileMenuLabel": "التوقف عن تسليط الضوء",
227
+ "stopSpotlightOnSelfVideoTileMenuLabel": "الخروج من وضع تسليط الضوء"
222
228
  },
223
229
  "dialpad": {
224
230
  "placeholderText": "أدخل رقم الهاتف",
@@ -200,7 +200,8 @@
200
200
  "failedToJoinCallGeneric": "K hovoru se nepovedlo připojit.",
201
201
  "failedToJoinCallInvalidMeetingLink": "Ke schůzce se nelze připojit. Neplatný odkaz.",
202
202
  "cameraFrozenForRemoteParticipants": "Uživatelé v hovoru mají problémy s zobrazením vašeho videa. Zkontrolujte prosím svá zařízení a síť.",
203
- "unableToStartVideoEffect": "Nelze použít efekt videa."
203
+ "unableToStartVideoEffect": "Nelze použít efekt videa.",
204
+ "startSpotlightWhileMaxParticipantsAreSpotlighted": "Nelze zahájit vytváření hlavního výběru účastníků, protože je již v hlavním výběru maximální počet účastníků."
204
205
  },
205
206
  "videoGallery": {
206
207
  "screenIsBeingSharedMessage": "Sdílíte obrazovku",
@@ -218,7 +219,12 @@
218
219
  "pinParticipantMenuItemAriaLabel": "Připnout {participantName}",
219
220
  "unpinParticipantMenuItemAriaLabel": "Odepnout {participantName}",
220
221
  "pinnedParticipantAnnouncementAriaLabel": "Připnutý účastník {participantName}",
221
- "unpinnedParticipantAnnouncementAriaLabel": "{participantName} odepnut"
222
+ "unpinnedParticipantAnnouncementAriaLabel": "{participantName} odepnut",
223
+ "startSpotlightVideoTileMenuLabel": "Přidat do hlavního výběru všem",
224
+ "addSpotlightVideoTileMenuLabel": "Přidat do hlavního výběru",
225
+ "spotlightLimitReachedMenuTitle": "Dosáhlo se limitu hlavního výběru",
226
+ "stopSpotlightVideoTileMenuLabel": "Zastavit přidávání do hlavního výběru",
227
+ "stopSpotlightOnSelfVideoTileMenuLabel": "Ukončit hlavní výběr"
222
228
  },
223
229
  "dialpad": {
224
230
  "placeholderText": "Zadejte telefonní číslo",
@@ -200,7 +200,8 @@
200
200
  "failedToJoinCallGeneric": "Fehler bei der Teilnahme am Anruf.",
201
201
  "failedToJoinCallInvalidMeetingLink": "Teilnahme an Besprechung nicht möglich. Ungültiger Link.",
202
202
  "cameraFrozenForRemoteParticipants": "Benutzer im Anruf haben Probleme, Ihr Video zu sehen. Überprüfen Sie Ihre Geräte und Ihr Netzwerk.",
203
- "unableToStartVideoEffect": "Videoeffekt kann nicht angewendet werden."
203
+ "unableToStartVideoEffect": "Videoeffekt kann nicht angewendet werden.",
204
+ "startSpotlightWhileMaxParticipantsAreSpotlighted": "Das Spotlight für Teilnehmer*innen kann nicht gestartet werden, da die maximale Anzahl von Teilnehmer*innen bereits im Spotlight ist."
204
205
  },
205
206
  "videoGallery": {
206
207
  "screenIsBeingSharedMessage": "Sie teilen Ihren Bildschirm",
@@ -218,7 +219,12 @@
218
219
  "pinParticipantMenuItemAriaLabel": "{participantName} anheften",
219
220
  "unpinParticipantMenuItemAriaLabel": "{participantName} lösen",
220
221
  "pinnedParticipantAnnouncementAriaLabel": "{participantName} angeheftet",
221
- "unpinnedParticipantAnnouncementAriaLabel": "{participantName} gelöst"
222
+ "unpinnedParticipantAnnouncementAriaLabel": "{participantName} gelöst",
223
+ "startSpotlightVideoTileMenuLabel": "Spotlight für alle",
224
+ "addSpotlightVideoTileMenuLabel": "Spotlight hinzufügen",
225
+ "spotlightLimitReachedMenuTitle": "Spotlight-Limit erreicht",
226
+ "stopSpotlightVideoTileMenuLabel": "Spotlight beenden",
227
+ "stopSpotlightOnSelfVideoTileMenuLabel": "Spotlight beenden"
222
228
  },
223
229
  "dialpad": {
224
230
  "placeholderText": "Telefonnummer eingeben",
@@ -200,7 +200,8 @@
200
200
  "failedToJoinCallGeneric": "Failed to join call.",
201
201
  "failedToJoinCallInvalidMeetingLink": "Unable to join Meeting. Invalid Link.",
202
202
  "cameraFrozenForRemoteParticipants": "Users in the call are having issues seeing your video. Please check your devices and network.",
203
- "unableToStartVideoEffect": "Unable to apply video effect."
203
+ "unableToStartVideoEffect": "Unable to apply video effect.",
204
+ "startSpotlightWhileMaxParticipantsAreSpotlighted": "Cannot start spotlight on participant(s) because the maximum number of participants are already spotlighted."
204
205
  },
205
206
  "videoGallery": {
206
207
  "screenIsBeingSharedMessage": "You are sharing your screen",
@@ -218,7 +219,12 @@
218
219
  "pinParticipantMenuItemAriaLabel": "Pin {participantName}",
219
220
  "unpinParticipantMenuItemAriaLabel": "Unpin {participantName}",
220
221
  "pinnedParticipantAnnouncementAriaLabel": "Pinned {participantName}",
221
- "unpinnedParticipantAnnouncementAriaLabel": "Unpinned {participantName}"
222
+ "unpinnedParticipantAnnouncementAriaLabel": "Unpinned {participantName}",
223
+ "startSpotlightVideoTileMenuLabel": "Spotlight for everyone",
224
+ "addSpotlightVideoTileMenuLabel": "Add spotlight",
225
+ "spotlightLimitReachedMenuTitle": "Spotlight limit reached",
226
+ "stopSpotlightVideoTileMenuLabel": "Stop spotlighting",
227
+ "stopSpotlightOnSelfVideoTileMenuLabel": "Exit spotlight"
222
228
  },
223
229
  "dialpad": {
224
230
  "placeholderText": "Enter phone number",