@azure/communication-react 1.11.1-alpha-202401090013 → 1.11.1-alpha-202401110013
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/communication-react.d.ts +32 -7
- package/dist/dist-cjs/communication-react/index.js +70 -118
- 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/chat-component-bindings/src/errorBarSelector.js +5 -4
- package/dist/dist-esm/chat-component-bindings/src/errorBarSelector.js.map +1 -1
- package/dist/dist-esm/chat-component-bindings/src/hooks/usePropsFor.js.map +1 -1
- package/dist/dist-esm/chat-stateful-client/src/index.d.ts +2 -1
- package/dist/dist-esm/chat-stateful-client/src/index.js +1 -0
- package/dist/dist-esm/chat-stateful-client/src/index.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/ChatMessage/ChatMessageContent.js +46 -69
- package/dist/dist-esm/react-components/src/components/ChatMessage/ChatMessageContent.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/Dialpad/Dialpad.d.ts +32 -7
- package/dist/dist-esm/react-components/src/components/Dialpad/Dialpad.js +11 -31
- package/dist/dist-esm/react-components/src/components/Dialpad/Dialpad.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/FileDownloadCards.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/styles/v8StyleShim.d.ts +2 -2
- package/dist/dist-esm/react-components/src/components/styles/v8StyleShim.js.map +1 -1
- package/dist/dist-esm/react-components/src/theming/generateTheme.js +5 -1
- package/dist/dist-esm/react-components/src/theming/generateTheme.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/ChatButton/NotificationIcon.js +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/ChatButton/NotificationIcon.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/ChatButton/useUnreadMessagesTracker.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/ChatComposite/ChatScreen.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/ChatComposite/adapter/AzureCommunicationChatAdapter.js +7 -16
- package/dist/dist-esm/react-composites/src/composites/ChatComposite/adapter/AzureCommunicationChatAdapter.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/common/BaseComposite.js.map +1 -1
- package/package.json +2 -2
@@ -6419,21 +6419,46 @@ export declare const Dialpad: (props: DialpadProps) => JSX.Element;
|
|
6419
6419
|
*/
|
6420
6420
|
export declare interface DialpadProps {
|
6421
6421
|
strings?: DialpadStrings;
|
6422
|
-
/**
|
6422
|
+
/**
|
6423
|
+
* function to send dtmf tones on button click
|
6424
|
+
*/
|
6423
6425
|
onSendDtmfTone?: (dtmfTone: DtmfTone) => Promise<void>;
|
6424
|
-
/**
|
6426
|
+
/**
|
6427
|
+
* Callback for dialpad button behavior
|
6428
|
+
*/
|
6425
6429
|
onClickDialpadButton?: (buttonValue: string, buttonIndex: number) => void;
|
6426
|
-
/**
|
6430
|
+
/**
|
6431
|
+
* set dialpad textfield content
|
6432
|
+
*/
|
6427
6433
|
textFieldValue?: string;
|
6428
|
-
/**
|
6434
|
+
/**
|
6435
|
+
* on change function for text field, provides an unformatted plain text
|
6436
|
+
*/
|
6429
6437
|
onChange?: (input: string) => void;
|
6430
|
-
/**
|
6438
|
+
/**
|
6439
|
+
* flag to determine when to show/hide delete button, default true
|
6440
|
+
*/
|
6431
6441
|
showDeleteButton?: boolean;
|
6432
|
-
/**
|
6442
|
+
/**
|
6443
|
+
* flag to determine if dialpad is in mobile view, default false
|
6444
|
+
*/
|
6433
6445
|
isMobile?: boolean;
|
6446
|
+
/**
|
6447
|
+
* Styles for customizing the dialpad component
|
6448
|
+
*/
|
6434
6449
|
styles?: DialpadStyles;
|
6435
|
-
/**
|
6450
|
+
/**
|
6451
|
+
* Disables DTMF sounds when dialpad buttons are pressed. the actual
|
6452
|
+
* tones are still sent to the call.
|
6453
|
+
*/
|
6436
6454
|
disableDtmfPlayback?: boolean;
|
6455
|
+
/**
|
6456
|
+
* Enable the ability to edit the number in the text box.
|
6457
|
+
* This mode is for when dailing someone to call to that the user can edit the number before calling if needed.
|
6458
|
+
* @default false
|
6459
|
+
*
|
6460
|
+
*/
|
6461
|
+
enableInputEditing?: boolean;
|
6437
6462
|
}
|
6438
6463
|
|
6439
6464
|
/**
|
@@ -17,7 +17,7 @@ var reactFileTypeIcons = require('@fluentui/react-file-type-icons');
|
|
17
17
|
var uuid = require('uuid');
|
18
18
|
var reactChat = require('@fluentui-contrib/react-chat');
|
19
19
|
var react$1 = require('@griffel/react');
|
20
|
-
var
|
20
|
+
var parse = require('html-react-parser');
|
21
21
|
var Linkify = require('react-linkify');
|
22
22
|
var DOMPurify = require('dompurify');
|
23
23
|
var reactHooks = require('@fluentui/react-hooks');
|
@@ -170,7 +170,7 @@ function getDefaultExportFromCjs (x) {
|
|
170
170
|
// Copyright (c) Microsoft Corporation.
|
171
171
|
// Licensed under the MIT License.
|
172
172
|
// GENERATED FILE. DO NOT EDIT MANUALLY.
|
173
|
-
var telemetryVersion = '1.11.1-alpha-
|
173
|
+
var telemetryVersion = '1.11.1-alpha-202401110013';
|
174
174
|
|
175
175
|
|
176
176
|
var telemetryVersion$1 = /*@__PURE__*/getDefaultExportFromCjs(telemetryVersion);
|
@@ -10413,76 +10413,54 @@ const messageContentAriaText = (props) => {
|
|
10413
10413
|
})
|
10414
10414
|
: undefined;
|
10415
10415
|
};
|
10416
|
-
const processNodeDefinitions = htmlToReact.ProcessNodeDefinitions();
|
10417
|
-
const htmlToReactParser = htmlToReact.Parser();
|
10418
|
-
const processInlineImage = (props) => ({
|
10419
|
-
// Custom <img> processing
|
10420
|
-
shouldProcessNode: (node) => {
|
10421
|
-
var _a;
|
10422
|
-
function matchingImageNode(imageMetadata) {
|
10423
|
-
return imageMetadata.id === node.attribs.id;
|
10424
|
-
}
|
10425
|
-
// Process img node with id in attachments list
|
10426
|
-
return (node.name &&
|
10427
|
-
node.name === 'img' &&
|
10428
|
-
node.attribs &&
|
10429
|
-
node.attribs.id &&
|
10430
|
-
((_a = props.message.inlineImages) === null || _a === void 0 ? void 0 : _a.find(matchingImageNode)));
|
10431
|
-
},
|
10432
|
-
processNode: (node, children, index) => {
|
10433
|
-
node.attribs = Object.assign(Object.assign({}, node.attribs), { 'aria-label': node.attribs.name });
|
10434
|
-
// logic to check id in map/list
|
10435
|
-
if (props.attachmentsMap && node.attribs.id in props.attachmentsMap) {
|
10436
|
-
node.attribs = Object.assign(Object.assign({}, node.attribs), { src: props.attachmentsMap[node.attribs.id] });
|
10437
|
-
}
|
10438
|
-
const handleOnClick = () => {
|
10439
|
-
props.onInlineImageClicked && props.onInlineImageClicked(node.attribs.id);
|
10440
|
-
};
|
10441
|
-
return (React.createElement("span", { "data-ui-id": node.attribs.id, onClick: handleOnClick, tabIndex: 0, role: "button", style: {
|
10442
|
-
cursor: 'pointer'
|
10443
|
-
}, onKeyDown: (e) => {
|
10444
|
-
if (e.key === 'Enter') {
|
10445
|
-
handleOnClick();
|
10446
|
-
}
|
10447
|
-
} }, processNodeDefinitions.processDefaultNode(node, children, index)));
|
10448
|
-
}
|
10449
|
-
});
|
10450
|
-
/* @conditional-compile-remove(mention) */
|
10451
|
-
const processMention = (props) => ({
|
10452
|
-
shouldProcessNode: (node) => {
|
10453
|
-
var _a;
|
10454
|
-
if ((_a = props.mentionDisplayOptions) === null || _a === void 0 ? void 0 : _a.onRenderMention) {
|
10455
|
-
// Override the handling of the <msft-mention> tag in the HTML if there's a custom renderer
|
10456
|
-
return node.name === 'msft-mention';
|
10457
|
-
}
|
10458
|
-
return false;
|
10459
|
-
},
|
10460
|
-
processNode: (node) => {
|
10461
|
-
var _a, _b, _c;
|
10462
|
-
if ((_a = props.mentionDisplayOptions) === null || _a === void 0 ? void 0 : _a.onRenderMention) {
|
10463
|
-
const { id } = node.attribs;
|
10464
|
-
const mention = {
|
10465
|
-
id: id,
|
10466
|
-
displayText: (_c = (_b = node.children[0]) === null || _b === void 0 ? void 0 : _b.data) !== null && _c !== void 0 ? _c : ''
|
10467
|
-
};
|
10468
|
-
return props.mentionDisplayOptions.onRenderMention(mention, defaultOnMentionRender);
|
10469
|
-
}
|
10470
|
-
return processNodeDefinitions.processDefaultNode;
|
10471
|
-
}
|
10472
|
-
});
|
10473
10416
|
const processHtmlToReact = (props) => {
|
10474
10417
|
var _a;
|
10475
|
-
const
|
10476
|
-
|
10477
|
-
|
10478
|
-
|
10479
|
-
|
10480
|
-
|
10481
|
-
|
10482
|
-
|
10418
|
+
const options = {
|
10419
|
+
transform(reactNode, domNode) {
|
10420
|
+
var _a, _b, _c;
|
10421
|
+
if (domNode instanceof parse.Element && domNode.attribs) {
|
10422
|
+
// Transform custom rendering of mentions
|
10423
|
+
/* @conditional-compile-remove(mention) */
|
10424
|
+
if (((_a = props.mentionDisplayOptions) === null || _a === void 0 ? void 0 : _a.onRenderMention) && domNode.name === 'msft-mention') {
|
10425
|
+
const { id } = domNode.attribs;
|
10426
|
+
const mention = {
|
10427
|
+
id: id,
|
10428
|
+
displayText: (_b = domNode.children[0].nodeValue) !== null && _b !== void 0 ? _b : ''
|
10429
|
+
};
|
10430
|
+
return props.mentionDisplayOptions.onRenderMention(mention, defaultOnMentionRender);
|
10431
|
+
}
|
10432
|
+
// Transform inline images
|
10433
|
+
if (domNode.name &&
|
10434
|
+
domNode.name === 'img' &&
|
10435
|
+
domNode.attribs &&
|
10436
|
+
domNode.attribs.id &&
|
10437
|
+
((_c = props.message.inlineImages) === null || _c === void 0 ? void 0 : _c.find((metadata) => {
|
10438
|
+
return metadata.id === domNode.attribs.id;
|
10439
|
+
}))) {
|
10440
|
+
domNode.attribs['aria-label'] = domNode.attribs.name;
|
10441
|
+
// logic to check id in map/list
|
10442
|
+
if (props.attachmentsMap && domNode.attribs.id in props.attachmentsMap) {
|
10443
|
+
domNode.attribs.src = props.attachmentsMap[domNode.attribs.id];
|
10444
|
+
}
|
10445
|
+
const handleOnClick = () => {
|
10446
|
+
props.onInlineImageClicked && props.onInlineImageClicked(domNode.attribs.id);
|
10447
|
+
};
|
10448
|
+
const imgProps = parse.attributesToProps(domNode.attribs);
|
10449
|
+
return (React.createElement("span", { "data-ui-id": domNode.attribs.id, onClick: handleOnClick, tabIndex: 0, role: "button", style: {
|
10450
|
+
cursor: 'pointer'
|
10451
|
+
}, onKeyDown: (e) => {
|
10452
|
+
if (e.key === 'Enter') {
|
10453
|
+
handleOnClick();
|
10454
|
+
}
|
10455
|
+
} },
|
10456
|
+
React.createElement("img", Object.assign({}, imgProps))));
|
10457
|
+
}
|
10458
|
+
}
|
10459
|
+
// Pass through the original node
|
10460
|
+
return reactNode;
|
10483
10461
|
}
|
10484
|
-
|
10485
|
-
return
|
10462
|
+
};
|
10463
|
+
return React.createElement(React.Fragment, null, parse((_a = props.message.content) !== null && _a !== void 0 ? _a : '', options));
|
10486
10464
|
};
|
10487
10465
|
|
10488
10466
|
// Copyright (c) Microsoft Corporation.
|
@@ -17946,12 +17924,8 @@ const DtmfTones = [
|
|
17946
17924
|
const DialpadButton = (props) => {
|
17947
17925
|
var _a, _b, _c, _d;
|
17948
17926
|
const theme = react.useTheme();
|
17949
|
-
const { digit, index, onClick, onLongPress, isMobile = false,
|
17950
|
-
/* @conditional-compile-remove(dtmf-dialer) */ dtmfToneAudioContext,
|
17951
|
-
/* @conditional-compile-remove(dtmf-dialer) */ disableDtmfPlayback } = props;
|
17952
|
-
/* @conditional-compile-remove(dtmf-dialer) */
|
17927
|
+
const { digit, index, onClick, onLongPress, isMobile = false, dtmfToneAudioContext, disableDtmfPlayback } = props;
|
17953
17928
|
const [buttonPressed, setButtonPressed] = React.useState(false);
|
17954
|
-
/* @conditional-compile-remove(dtmf-dialer) */
|
17955
17929
|
const dtmfToneSound = React.useRef(new Tone(dtmfToneAudioContext, dtmfFrequencies[digit].f1, dtmfFrequencies[digit].f2));
|
17956
17930
|
const useLongPressProps = React.useMemo(() => ({
|
17957
17931
|
onClick: () => __awaiter$s(void 0, void 0, void 0, function* () {
|
@@ -17964,7 +17938,6 @@ const DialpadButton = (props) => {
|
|
17964
17938
|
}), [digit, index, isMobile, onClick, onLongPress]);
|
17965
17939
|
const longPressHandlers = useLongPress(useLongPressProps);
|
17966
17940
|
return (React.createElement(react.DefaultButton, Object.assign({ "data-test-id": `dialpad-button-${props.index}`, styles: react.concatStyleSets(buttonStyles$1(), (_a = props.styles) === null || _a === void 0 ? void 0 : _a.button) }, longPressHandlers, { onKeyDown: (e) => {
|
17967
|
-
/* @conditional-compile-remove(dtmf-dialer) */
|
17968
17941
|
if ((e.key === 'Enter' || e.key === ' ') && !buttonPressed) {
|
17969
17942
|
if (!disableDtmfPlayback) {
|
17970
17943
|
dtmfToneSound.current.play();
|
@@ -17975,7 +17948,6 @@ const DialpadButton = (props) => {
|
|
17975
17948
|
}
|
17976
17949
|
longPressHandlers.onKeyDown();
|
17977
17950
|
}, onKeyUp: (e) => {
|
17978
|
-
/* @conditional-compile-remove(dtmf-dialer) */
|
17979
17951
|
if ((e.key === 'Enter' || e.key === ' ') && buttonPressed) {
|
17980
17952
|
dtmfToneSound.current.stop();
|
17981
17953
|
longPressHandlers.onKeyUp();
|
@@ -17983,26 +17955,21 @@ const DialpadButton = (props) => {
|
|
17983
17955
|
}
|
17984
17956
|
longPressHandlers.onKeyUp();
|
17985
17957
|
}, onMouseDown: () => {
|
17986
|
-
/* @conditional-compile-remove(dtmf-dialer) */
|
17987
17958
|
if (!disableDtmfPlayback) {
|
17988
17959
|
dtmfToneSound.current.play();
|
17989
17960
|
}
|
17990
17961
|
longPressHandlers.onMouseDown();
|
17991
17962
|
}, onMouseUp: () => {
|
17992
|
-
/* @conditional-compile-remove(dtmf-dialer) */
|
17993
17963
|
dtmfToneSound.current.stop();
|
17994
17964
|
longPressHandlers.onMouseUp();
|
17995
17965
|
}, onMouseLeave: () => {
|
17996
|
-
/* @conditional-compile-remove(dtmf-dialer) */
|
17997
17966
|
dtmfToneSound.current.stop();
|
17998
17967
|
}, onTouchStart: () => {
|
17999
|
-
/* @conditional-compile-remove(dtmf-dialer) */
|
18000
17968
|
if (!disableDtmfPlayback) {
|
18001
17969
|
dtmfToneSound.current.play();
|
18002
17970
|
}
|
18003
17971
|
longPressHandlers.onTouchStart();
|
18004
17972
|
}, onTouchEnd: () => {
|
18005
|
-
/* @conditional-compile-remove(dtmf-dialer) */
|
18006
17973
|
dtmfToneSound.current.stop();
|
18007
17974
|
longPressHandlers.onTouchEnd();
|
18008
17975
|
} }),
|
@@ -18013,9 +17980,8 @@ const DialpadButton = (props) => {
|
|
18013
17980
|
const DialpadContainer = (props) => {
|
18014
17981
|
var _a, _b;
|
18015
17982
|
const theme = react.useTheme();
|
18016
|
-
const { onSendDtmfTone, onClickDialpadButton, textFieldValue, onChange, showDeleteButton = true, isMobile = false } = props;
|
17983
|
+
const { onSendDtmfTone, onClickDialpadButton, textFieldValue, onChange, showDeleteButton = true, isMobile = false, disableDtmfPlayback, enableInputEditing } = props;
|
18017
17984
|
const [plainTextValue, setPlainTextValue] = React.useState(textFieldValue !== null && textFieldValue !== void 0 ? textFieldValue : '');
|
18018
|
-
/* @conditional-compile-remove(dtmf-dialer) */
|
18019
17985
|
const dtmfToneAudioContext = React.useRef(new AudioContext());
|
18020
17986
|
React.useEffect(() => {
|
18021
17987
|
if (onChange) {
|
@@ -18059,18 +18025,16 @@ const DialpadContainer = (props) => {
|
|
18059
18025
|
setText(modifiedInput);
|
18060
18026
|
};
|
18061
18027
|
return (React.createElement("div", { className: react.mergeStyles(containerStyles$3(theme), (_a = props.styles) === null || _a === void 0 ? void 0 : _a.root), "data-test-id": "dialpadContainer", "data-ui-id": "dialpadContainer" },
|
18062
|
-
React.createElement(react.TextField, { styles: react.concatStyleSets(textFieldStyles(theme), (_b = props.styles) === null || _b === void 0 ? void 0 : _b.textField), value: textFieldValue ? textFieldValue : formatPhoneNumber(plainTextValue),
|
18028
|
+
React.createElement(react.TextField, { styles: react.concatStyleSets(textFieldStyles(theme), (_b = props.styles) === null || _b === void 0 ? void 0 : _b.textField), value: textFieldValue ? textFieldValue : enableInputEditing ? formatPhoneNumber(plainTextValue) : plainTextValue,
|
18063
18029
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
18064
18030
|
onChange: (e) => {
|
18065
|
-
|
18066
|
-
|
18067
|
-
|
18068
|
-
onClick: (e) => {
|
18069
|
-
|
18070
|
-
|
18071
|
-
|
18072
|
-
input.setSelectionRange(end, end);
|
18073
|
-
input.focus();
|
18031
|
+
if (enableInputEditing) {
|
18032
|
+
setText(e.target.value);
|
18033
|
+
}
|
18034
|
+
}, onClick: (e) => {
|
18035
|
+
if (!enableInputEditing) {
|
18036
|
+
e.preventDefault();
|
18037
|
+
}
|
18074
18038
|
}, placeholder: props.strings.placeholderText, "data-test-id": "dialpad-input", onRenderSuffix: () => {
|
18075
18039
|
var _a;
|
18076
18040
|
return (React.createElement(React.Fragment, null, showDeleteButton && plainTextValue.length !== 0 && (React.createElement(react.IconButton, { ariaLabel: props.strings.deleteButtonAriaLabel, onClick: deleteNumbers, styles: react.concatStyleSets(iconButtonStyles(theme), (_a = props.styles) === null || _a === void 0 ? void 0 : _a.deleteIcon), iconProps: { iconName: 'DialpadBackspace' } }))));
|
@@ -18094,11 +18058,7 @@ const DialpadContainer = (props) => {
|
|
18094
18058
|
then use this index to locate the corresponding dtmf tones
|
18095
18059
|
DtmfTones[index]
|
18096
18060
|
*/
|
18097
|
-
index: columnIndex + rowIndex * rows.length, digit: button.digit, letter: button.letter, styles: props.styles, onClick: onClickDialpad, onLongPress: onLongPressDialpad, isMobile: isMobile,
|
18098
|
-
/* @conditional-compile-remove(dtmf-dialer) */
|
18099
|
-
dtmfToneAudioContext: dtmfToneAudioContext.current,
|
18100
|
-
/* @conditional-compile-remove(dtmf-dialer) */
|
18101
|
-
disableDtmfPlayback: props.disableDtmfPlayback })))));
|
18061
|
+
index: columnIndex + rowIndex * rows.length, digit: button.digit, letter: button.letter, styles: props.styles, onClick: onClickDialpad, onLongPress: onLongPressDialpad, isMobile: isMobile, dtmfToneAudioContext: dtmfToneAudioContext.current, disableDtmfPlayback: disableDtmfPlayback })))));
|
18102
18062
|
}))));
|
18103
18063
|
};
|
18104
18064
|
/**
|
@@ -21025,12 +20985,12 @@ const accessErrorTargets = [
|
|
21025
20985
|
];
|
21026
20986
|
const latestUnableToReachChatServiceError = (latestErrors) => {
|
21027
20987
|
return latestActiveErrorSatisfying(latestErrors, 'unableToReachChatService', (error) => {
|
21028
|
-
return !!error && !!error.innerError && error.innerError
|
20988
|
+
return (!!error && !!error.innerError && 'code' in error.innerError && error.innerError.code === 'REQUEST_SEND_ERROR');
|
21029
20989
|
});
|
21030
20990
|
};
|
21031
20991
|
const latestAccessDeniedError = (latestErrors) => {
|
21032
20992
|
return latestActiveErrorSatisfying(latestErrors, 'accessDenied', (error) => {
|
21033
|
-
return !!error && !!error.innerError && error.innerError
|
20993
|
+
return !!error && !!error.innerError && 'statusCode' in error.innerError && error.innerError.statusCode === 401;
|
21034
20994
|
});
|
21035
20995
|
};
|
21036
20996
|
const latestNotInThisThreadError = (latestErrors) => {
|
@@ -21047,11 +21007,12 @@ const latestNotInThisThreadError = (latestErrors) => {
|
|
21047
21007
|
}
|
21048
21008
|
// Chat service returns 403 if a user has been removed from a thread.
|
21049
21009
|
// Chat service returns either 400 or 404 if the thread ID is malformed, depending on how the thread ID is malformed.
|
21050
|
-
return [400, 403, 404].some((statusCode) => error.innerError
|
21010
|
+
return [400, 403, 404].some((statusCode) => 'statusCode' in error.innerError && error.innerError.statusCode === statusCode);
|
21051
21011
|
});
|
21052
21012
|
};
|
21053
21013
|
const botContactMRIPrefix = '28:';
|
21054
|
-
const isErrorDueToBotContact = (error) =>
|
21014
|
+
const isErrorDueToBotContact = (error) => 'statusCode' in error.innerError &&
|
21015
|
+
error.innerError.statusCode === 400 &&
|
21055
21016
|
error.innerError.message.includes(`Identifier format is not supported (${botContactMRIPrefix}`);
|
21056
21017
|
const latestActiveErrorSatisfying = (errors, activeErrorType, predicate) => {
|
21057
21018
|
const activeErrorMessages = [];
|
@@ -22821,17 +22782,11 @@ class AzureCommunicationChatAdapter {
|
|
22821
22782
|
return __awaiter$k(this, void 0, void 0, function* () {
|
22822
22783
|
return this.asyncTeeErrorToEventEmitter(() => __awaiter$k(this, void 0, void 0, function* () {
|
22823
22784
|
if (this.credential === undefined) {
|
22824
|
-
|
22825
|
-
e['target'] = 'ChatThreadClient.getMessage';
|
22826
|
-
e['innerError'] = new Error('AccessToken is null');
|
22827
|
-
throw e;
|
22785
|
+
throw new ChatError('ChatThreadClient.getMessage', new Error('AccessToken is null'));
|
22828
22786
|
}
|
22829
22787
|
const accessToken = yield this.credential.getToken();
|
22830
22788
|
if (!accessToken) {
|
22831
|
-
|
22832
|
-
e['target'] = 'ChatThreadClient.getMessage';
|
22833
|
-
e['innerError'] = new Error('AccessToken is null');
|
22834
|
-
throw e;
|
22789
|
+
throw new ChatError('ChatThreadClient.getMessage', new Error('AccessToken is null'));
|
22835
22790
|
}
|
22836
22791
|
return this.downloadAuthenticatedFile(accessToken.token, options);
|
22837
22792
|
}));
|
@@ -22847,10 +22802,7 @@ class AzureCommunicationChatAdapter {
|
|
22847
22802
|
return yield fetch(url, { headers });
|
22848
22803
|
}
|
22849
22804
|
catch (err) {
|
22850
|
-
|
22851
|
-
e['target'] = 'ChatThreadClient.getMessage';
|
22852
|
-
e['innerError'] = err;
|
22853
|
-
throw e;
|
22805
|
+
throw new ChatError('ChatThreadClient.getMessage', err);
|
22854
22806
|
}
|
22855
22807
|
});
|
22856
22808
|
}
|
@@ -22963,10 +22915,10 @@ const convertEventToChatMessage = (event) => {
|
|
22963
22915
|
};
|
22964
22916
|
};
|
22965
22917
|
const isChatMessageEditedEvent = (event) => {
|
22966
|
-
return
|
22918
|
+
return 'editedOn' in event;
|
22967
22919
|
};
|
22968
22920
|
const isChatMessageDeletedEvent = (event) => {
|
22969
|
-
return
|
22921
|
+
return 'deletedOn' in event;
|
22970
22922
|
};
|
22971
22923
|
// only text/html message type will be received from event
|
22972
22924
|
const convertEventType = (type) => {
|
@@ -23119,7 +23071,7 @@ function createAzureCommunicationChatAdapterFromClient(chatClient, chatThreadCli
|
|
23119
23071
|
});
|
23120
23072
|
}
|
23121
23073
|
const isChatError = (e) => {
|
23122
|
-
return e['target'] !== undefined && e['innerError'] !== undefined;
|
23074
|
+
return 'target' in e && e['target'] !== undefined && 'innerError' in e && e['innerError'] !== undefined;
|
23123
23075
|
};
|
23124
23076
|
|
23125
23077
|
// Copyright (c) Microsoft Corporation.
|
@@ -33586,7 +33538,7 @@ const NotificationIcon = (props) => {
|
|
33586
33538
|
}
|
33587
33539
|
else {
|
33588
33540
|
const textNumberOfMessages = numberOfMessages < 9 ? numberOfMessages : '9+';
|
33589
|
-
return (React.createElement(react.Text, { role: 'status', "aria-label": textNumberOfMessages + label, styles: notificationTextStyles(theme) }, textNumberOfMessages));
|
33541
|
+
return (React.createElement(react.Text, { role: 'status', "aria-label": textNumberOfMessages + (label !== null && label !== void 0 ? label : ''), styles: notificationTextStyles(theme) }, textNumberOfMessages));
|
33590
33542
|
}
|
33591
33543
|
};
|
33592
33544
|
return (React.createElement(react.Stack, { "data-ui-id": "call-with-chat-composite-chat-button-unread-icon", horizontalAlign: "center", verticalAlign: "center", styles: notificationIconContainerStyles(theme) },
|