@azure/communication-react 1.34.0 → 1.35.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/dist-cjs/communication-react/index.js +22 -5
- package/dist/dist-cjs/communication-react/index.js.map +1 -1
- package/dist/dist-esm/acs-ui-common/src/telemetryVersion.js +1 -1
- package/dist/dist-esm/acs-ui-common/src/telemetryVersion.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/ChatMessage/ChatMessageContent.js +21 -4
- package/dist/dist-esm/react-components/src/components/ChatMessage/ChatMessageContent.js.map +1 -1
- package/package.json +2 -2
|
@@ -15,7 +15,7 @@ var uuid = require('uuid');
|
|
|
15
15
|
var reactChat = require('@fluentui-contrib/react-chat');
|
|
16
16
|
var react$1 = require('@griffel/react');
|
|
17
17
|
var parse = require('html-react-parser');
|
|
18
|
-
var
|
|
18
|
+
var linkifyIt = require('linkify-it');
|
|
19
19
|
var DOMPurify = require('dompurify');
|
|
20
20
|
var reactFileTypeIcons = require('@fluentui/react-file-type-icons');
|
|
21
21
|
var reactHooks = require('@fluentui/react-hooks');
|
|
@@ -178,7 +178,7 @@ function getDefaultExportFromCjs (x) {
|
|
|
178
178
|
// Copyright (c) Microsoft Corporation.
|
|
179
179
|
// Licensed under the MIT License.
|
|
180
180
|
// GENERATED FILE. DO NOT EDIT MANUALLY.
|
|
181
|
-
var telemetryVersion = '1.
|
|
181
|
+
var telemetryVersion = '1.35.0';
|
|
182
182
|
|
|
183
183
|
|
|
184
184
|
var telemetryVersion$1 = /*@__PURE__*/getDefaultExportFromCjs(telemetryVersion);
|
|
@@ -10799,6 +10799,9 @@ const chatMessageActionMenuProps = (menuProps) => {
|
|
|
10799
10799
|
|
|
10800
10800
|
// Copyright (c) Microsoft Corporation.
|
|
10801
10801
|
// Licensed under the MIT License.
|
|
10802
|
+
const linkify = new linkifyIt.LinkifyIt({
|
|
10803
|
+
fuzzyLink: true
|
|
10804
|
+
});
|
|
10802
10805
|
/** @private */
|
|
10803
10806
|
const ChatMessageContent = (props) => {
|
|
10804
10807
|
switch (props.message.contentType) {
|
|
@@ -10822,9 +10825,23 @@ const MessageContentAsRichTextHTML = (props) => {
|
|
|
10822
10825
|
return React.createElement(MessageContentWithLiveAria, { message: props.message, liveMessage: generateLiveMessage(props), ariaLabel: messageContentAriaText(props), content: processHtmlToReact(props) });
|
|
10823
10826
|
};
|
|
10824
10827
|
const MessageContentAsText = (props) => {
|
|
10825
|
-
|
|
10826
|
-
|
|
10827
|
-
|
|
10828
|
+
var _a;
|
|
10829
|
+
return React.createElement(MessageContentWithLiveAria, { message: props.message, liveMessage: generateLiveMessage(props), ariaLabel: messageContentAriaText(props), className: messageTextContentStyles, content: React.createElement(React.Fragment, null, linkifyMessageContent((_a = props.message.content) !== null && _a !== void 0 ? _a : '')) });
|
|
10830
|
+
};
|
|
10831
|
+
const linkifyMessageContent = (content) => {
|
|
10832
|
+
const matches = linkify.match(content);
|
|
10833
|
+
if (!matches) {
|
|
10834
|
+
return [content];
|
|
10835
|
+
}
|
|
10836
|
+
const contentParts = [];
|
|
10837
|
+
let previousMatchEnd = 0;
|
|
10838
|
+
matches.forEach(match => {
|
|
10839
|
+
contentParts.push(content.slice(previousMatchEnd, match.index));
|
|
10840
|
+
contentParts.push(React.createElement(react.Link, { target: "_blank", href: match.url, key: `${match.index}-${match.lastIndex}` }, match.text));
|
|
10841
|
+
previousMatchEnd = match.lastIndex;
|
|
10842
|
+
});
|
|
10843
|
+
contentParts.push(content.slice(previousMatchEnd));
|
|
10844
|
+
return contentParts;
|
|
10828
10845
|
};
|
|
10829
10846
|
const extractContentForAllyMessage = (props) => {
|
|
10830
10847
|
var _a;
|