@azure/communication-react 1.2.3-alpha-202205120015.0 → 1.2.3-alpha-202205130015.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/communication-react.d.ts +16 -5
- package/dist/dist-cjs/communication-react/index.js +206 -183
- 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/chat-component-bindings/src/handlers/createHandlers.d.ts +4 -1
- package/dist/dist-esm/chat-component-bindings/src/handlers/createHandlers.d.ts.map +1 -1
- package/dist/dist-esm/chat-component-bindings/src/handlers/createHandlers.js +4 -2
- package/dist/dist-esm/chat-component-bindings/src/handlers/createHandlers.js.map +1 -1
- package/dist/dist-esm/communication-react/src/index.d.ts +2 -2
- package/dist/dist-esm/communication-react/src/index.d.ts.map +1 -1
- package/dist/dist-esm/communication-react/src/index.js +1 -1
- package/dist/dist-esm/communication-react/src/index.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/ChatMessage/ChatMessageComponent.d.ts +4 -2
- package/dist/dist-esm/react-components/src/components/ChatMessage/ChatMessageComponent.d.ts.map +1 -1
- package/dist/dist-esm/react-components/src/components/ChatMessage/ChatMessageComponent.js +2 -2
- package/dist/dist-esm/react-components/src/components/ChatMessage/ChatMessageComponent.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/ChatMessage/ChatMessageComponentAsEditBox.d.ts +4 -1
- package/dist/dist-esm/react-components/src/components/ChatMessage/ChatMessageComponentAsEditBox.d.ts.map +1 -1
- package/dist/dist-esm/react-components/src/components/ChatMessage/ChatMessageComponentAsEditBox.js +24 -13
- package/dist/dist-esm/react-components/src/components/ChatMessage/ChatMessageComponentAsEditBox.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/ComplianceBanner/ComplianceBanner.d.ts +41 -0
- package/dist/dist-esm/react-components/src/components/ComplianceBanner/ComplianceBanner.d.ts.map +1 -0
- package/dist/dist-esm/{react-composites/src/composites/CallComposite/components → react-components/src/components/ComplianceBanner}/ComplianceBanner.js +52 -48
- package/dist/dist-esm/react-components/src/components/ComplianceBanner/ComplianceBanner.js.map +1 -0
- package/dist/dist-esm/react-components/src/components/ComplianceBanner/Utils.d.ts +20 -0
- package/dist/dist-esm/react-components/src/components/ComplianceBanner/Utils.d.ts.map +1 -0
- package/dist/dist-esm/react-components/src/components/ComplianceBanner/Utils.js +42 -0
- package/dist/dist-esm/react-components/src/components/ComplianceBanner/Utils.js.map +1 -0
- package/dist/dist-esm/react-components/src/components/ComplianceBanner/index.d.ts +3 -0
- package/dist/dist-esm/react-components/src/components/ComplianceBanner/index.d.ts.map +1 -0
- package/dist/dist-esm/react-components/src/components/ComplianceBanner/index.js +4 -0
- package/dist/dist-esm/react-components/src/components/ComplianceBanner/index.js.map +1 -0
- package/dist/dist-esm/react-components/src/components/MessageThread.d.ts +10 -4
- package/dist/dist-esm/react-components/src/components/MessageThread.d.ts.map +1 -1
- package/dist/dist-esm/react-components/src/components/MessageThread.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/index.d.ts +3 -1
- package/dist/dist-esm/react-components/src/components/index.d.ts.map +1 -1
- package/dist/dist-esm/react-components/src/components/index.js +1 -0
- package/dist/dist-esm/react-components/src/components/index.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/components/CallArrangement.d.ts +2 -3
- package/dist/dist-esm/react-composites/src/composites/CallComposite/components/CallArrangement.d.ts.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/components/CallArrangement.js +2 -3
- package/dist/dist-esm/react-composites/src/composites/CallComposite/components/CallArrangement.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/CallPage.d.ts.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/CallPage.js +3 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/CallPage.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/LobbyPage.js +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/LobbyPage.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/utils/Utils.d.ts +0 -19
- package/dist/dist-esm/react-composites/src/composites/CallComposite/utils/Utils.d.ts.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/utils/Utils.js +0 -39
- package/dist/dist-esm/react-composites/src/composites/CallComposite/utils/Utils.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/ChatComposite/adapter/AzureCommunicationChatAdapter.d.ts +3 -1
- package/dist/dist-esm/react-composites/src/composites/ChatComposite/adapter/AzureCommunicationChatAdapter.d.ts.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/ChatComposite/adapter/AzureCommunicationChatAdapter.js +4 -2
- package/dist/dist-esm/react-composites/src/composites/ChatComposite/adapter/AzureCommunicationChatAdapter.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/ChatComposite/adapter/ChatAdapter.d.ts +4 -1
- package/dist/dist-esm/react-composites/src/composites/ChatComposite/adapter/ChatAdapter.d.ts.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/localization/index.d.ts +7 -0
- package/dist/dist-esm/react-composites/src/composites/localization/index.d.ts.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/localization/index.js +8 -0
- package/dist/dist-esm/react-composites/src/composites/localization/index.js.map +1 -1
- package/dist/dist-esm/react-composites/src/index-public.d.ts +2 -0
- package/dist/dist-esm/react-composites/src/index-public.d.ts.map +1 -0
- package/dist/dist-esm/react-composites/src/index-public.js +8 -0
- package/dist/dist-esm/react-composites/src/index-public.js.map +1 -0
- package/package.json +7 -7
- package/dist/dist-esm/react-composites/src/composites/CallComposite/components/ComplianceBanner.d.ts +0 -13
- package/dist/dist-esm/react-composites/src/composites/CallComposite/components/ComplianceBanner.d.ts.map +0 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/components/ComplianceBanner.js.map +0 -1
- package/dist/dist-esm/react-composites/src/index.d.ts +0 -2
- package/dist/dist-esm/react-composites/src/index.d.ts.map +0 -1
- package/dist/dist-esm/react-composites/src/index.js +0 -4
- package/dist/dist-esm/react-composites/src/index.js.map +0 -1
@@ -2303,7 +2303,9 @@ export declare interface ChatAdapterThreadManagement {
|
|
2303
2303
|
/**
|
2304
2304
|
* Update a message content.
|
2305
2305
|
*/
|
2306
|
-
updateMessage(messageId: string, content: string, metadata?: Record<string, string
|
2306
|
+
updateMessage(messageId: string, content: string, metadata?: Record<string, string>, options?: {
|
2307
|
+
attachedFilesMetadata?: FileMetadata[];
|
2308
|
+
}): Promise<void>;
|
2307
2309
|
/**
|
2308
2310
|
* Delete a message in the thread.
|
2309
2311
|
*/
|
@@ -2584,7 +2586,9 @@ export declare type ChatHandlers = {
|
|
2584
2586
|
onRemoveParticipant: (userId: string) => Promise<void>;
|
2585
2587
|
updateThreadTopicName: (topicName: string) => Promise<void>;
|
2586
2588
|
onLoadPreviousChatMessages: (messagesToLoad: number) => Promise<boolean>;
|
2587
|
-
onUpdateMessage: (messageId: string, content: string, metadata?: Record<string, string
|
2589
|
+
onUpdateMessage: (messageId: string, content: string, metadata?: Record<string, string>, options?: {
|
2590
|
+
attachedFilesMetadata?: FileMetadata[];
|
2591
|
+
}) => Promise<void>;
|
2588
2592
|
onDeleteMessage: (messageId: string) => Promise<void>;
|
2589
2593
|
};
|
2590
2594
|
|
@@ -4605,9 +4609,8 @@ export declare type MessageProps = {
|
|
4605
4609
|
*
|
4606
4610
|
* @param messageId - message id from chatClient
|
4607
4611
|
* @param content - new content of the message
|
4608
|
-
*
|
4609
4612
|
*/
|
4610
|
-
onUpdateMessage?:
|
4613
|
+
onUpdateMessage?: UpdateMessageCallback;
|
4611
4614
|
/**
|
4612
4615
|
* Optional callback to delete a message.
|
4613
4616
|
*
|
@@ -4846,7 +4849,7 @@ export declare type MessageThreadProps = {
|
|
4846
4849
|
* @param content - new content of the message
|
4847
4850
|
*
|
4848
4851
|
*/
|
4849
|
-
onUpdateMessage?:
|
4852
|
+
onUpdateMessage?: UpdateMessageCallback;
|
4850
4853
|
/**
|
4851
4854
|
* Optional callback to delete a message.
|
4852
4855
|
*
|
@@ -6280,6 +6283,14 @@ export declare interface TypingIndicatorStylesProps extends BaseCustomStyles {
|
|
6280
6283
|
typingString?: IStyle;
|
6281
6284
|
}
|
6282
6285
|
|
6286
|
+
/**
|
6287
|
+
* @public
|
6288
|
+
* Callback function run when a message is updated.
|
6289
|
+
*/
|
6290
|
+
export declare type UpdateMessageCallback = (messageId: string, content: string, metadata?: Record<string, string>, options?: {
|
6291
|
+
attachedFilesMetadata?: FileMetadata[];
|
6292
|
+
}) => Promise<void>;
|
6293
|
+
|
6283
6294
|
/**
|
6284
6295
|
* A custom React hook to simplify the creation of {@link CallAdapter}.
|
6285
6296
|
*
|
@@ -191,7 +191,7 @@ const fromFlatCommunicationIdentifier = (id) => {
|
|
191
191
|
// Copyright (c) Microsoft Corporation.
|
192
192
|
// Licensed under the MIT license.
|
193
193
|
// GENERATED FILE. DO NOT EDIT MANUALLY.
|
194
|
-
var telemetryVersion = '1.2.3-alpha-
|
194
|
+
var telemetryVersion = '1.2.3-alpha-202205130015.0';
|
195
195
|
|
196
196
|
// Copyright (c) Microsoft Corporation.
|
197
197
|
/**
|
@@ -2580,9 +2580,10 @@ const onRenderSubmitIcon = (color) => {
|
|
2580
2580
|
const ChatMessageComponentAsEditBox = (props) => {
|
2581
2581
|
const { onCancel, onSubmit, strings, message } = props;
|
2582
2582
|
const [textValue, setTextValue] = React.useState(message.content || '');
|
2583
|
+
const [attachedFilesMetadata, setAttachedFilesMetadata] = React__default['default'].useState(getMessageAttachedFilesMetadata(message));
|
2583
2584
|
const editTextFieldRef = React__default['default'].useRef(null);
|
2584
2585
|
const theme = useTheme();
|
2585
|
-
const messageState = getMessageState(textValue);
|
2586
|
+
const messageState = getMessageState(textValue, attachedFilesMetadata !== null && attachedFilesMetadata !== void 0 ? attachedFilesMetadata : []);
|
2586
2587
|
const submitEnabled = messageState === 'OK';
|
2587
2588
|
React.useEffect(() => {
|
2588
2589
|
var _a;
|
@@ -2599,37 +2600,47 @@ const ChatMessageComponentAsEditBox = (props) => {
|
|
2599
2600
|
const editBoxStyles = React.useMemo(() => {
|
2600
2601
|
return react.concatStyleSets(editBoxStyleSet, { textField: { borderColor: theme.palette.themePrimary } });
|
2601
2602
|
}, [theme.palette.themePrimary]);
|
2602
|
-
/* @conditional-compile-remove(file-sharing) */
|
2603
2603
|
const onRenderFileUploads = React.useCallback(() => {
|
2604
|
-
|
2605
|
-
|
2606
|
-
React__default['default'].createElement(_FileUploadCards, { activeFileUploads: (_a = message.attachedFilesMetadata) === null || _a === void 0 ? void 0 : _a.map((file) => ({
|
2604
|
+
return ((attachedFilesMetadata === null || attachedFilesMetadata === void 0 ? void 0 : attachedFilesMetadata.length) && (React__default['default'].createElement("div", { style: { margin: '0.25rem' } },
|
2605
|
+
React__default['default'].createElement(_FileUploadCards, { activeFileUploads: attachedFilesMetadata === null || attachedFilesMetadata === void 0 ? void 0 : attachedFilesMetadata.map((file) => ({
|
2607
2606
|
id: file.name,
|
2608
2607
|
filename: file.name,
|
2609
2608
|
progress: 1
|
2610
|
-
}))
|
2611
|
-
|
2609
|
+
})), onCancelFileUpload: (fileId) => {
|
2610
|
+
setAttachedFilesMetadata(attachedFilesMetadata === null || attachedFilesMetadata === void 0 ? void 0 : attachedFilesMetadata.filter((file) => file.name !== fileId));
|
2611
|
+
} }))));
|
2612
|
+
}, [attachedFilesMetadata]);
|
2612
2613
|
return (React__default['default'].createElement(react.Stack, { className: react.mergeStyles(borderAndBoxShadowStyle({
|
2613
2614
|
theme,
|
2614
2615
|
hasErrorMessage: false,
|
2615
2616
|
disabled: false
|
2616
2617
|
})) },
|
2617
2618
|
React__default['default'].createElement(InputBoxComponent, { inlineChildren: props.inlineEditButtons, id: 'editbox', textFieldRef: editTextFieldRef, inputClassName: editBoxStyle(props.inlineEditButtons), placeholderText: strings.editBoxPlaceholderText, textValue: textValue, onChange: setText, onEnterKeyDown: () => {
|
2618
|
-
submitEnabled &&
|
2619
|
+
submitEnabled &&
|
2620
|
+
onSubmit(textValue, message.metadata, {
|
2621
|
+
attachedFilesMetadata
|
2622
|
+
});
|
2619
2623
|
}, supportNewline: false, maxLength: MAXIMUM_LENGTH_OF_MESSAGE, errorMessage: textTooLongMessage, styles: editBoxStyles },
|
2620
2624
|
React__default['default'].createElement(InputBoxButton, { className: editingButtonStyle, ariaLabel: strings.editBoxCancelButton, tooltipContent: strings.editBoxCancelButton, onRenderIcon: onRenderThemedCancelIcon, onClick: () => {
|
2621
2625
|
onCancel && onCancel();
|
2622
2626
|
}, id: 'dismissIconWrapper' }),
|
2623
2627
|
React__default['default'].createElement(InputBoxButton, { className: editingButtonStyle, ariaLabel: strings.editBoxSubmitButton, tooltipContent: strings.editBoxSubmitButton, onRenderIcon: onRenderThemedSubmitIcon, onClick: (e) => {
|
2624
|
-
submitEnabled &&
|
2628
|
+
submitEnabled &&
|
2629
|
+
onSubmit(textValue, message.metadata, {
|
2630
|
+
attachedFilesMetadata
|
2631
|
+
});
|
2625
2632
|
e.stopPropagation();
|
2626
2633
|
}, id: 'submitIconWrapper' })),
|
2627
|
-
/* @conditional-compile-remove(file-sharing) */
|
2628
2634
|
onRenderFileUploads()));
|
2629
2635
|
};
|
2630
2636
|
const isMessageTooLong = (messageText) => messageText.length > MAXIMUM_LENGTH_OF_MESSAGE;
|
2631
|
-
const isMessageEmpty = (messageText) => messageText.trim().length === 0;
|
2632
|
-
const getMessageState = (messageText) => isMessageEmpty(messageText) ? 'too short' : isMessageTooLong(messageText) ? 'too long' : 'OK';
|
2637
|
+
const isMessageEmpty = (messageText, attachedFilesMetadata) => messageText.trim().length === 0 && attachedFilesMetadata.length === 0;
|
2638
|
+
const getMessageState = (messageText, attachedFilesMetadata) => isMessageEmpty(messageText, attachedFilesMetadata) ? 'too short' : isMessageTooLong(messageText) ? 'too long' : 'OK';
|
2639
|
+
// @TODO: Remove when file-sharing feature becomes stable.
|
2640
|
+
const getMessageAttachedFilesMetadata = (message) => {
|
2641
|
+
/* @conditional-compile-remove(file-sharing) */
|
2642
|
+
return message.attachedFilesMetadata;
|
2643
|
+
};
|
2633
2644
|
|
2634
2645
|
// Copyright (c) Microsoft Corporation.
|
2635
2646
|
const MINIMUM_TOUCH_TARGET_HEIGHT_REM$1 = 3;
|
@@ -3218,10 +3229,10 @@ const ChatMessageComponent = (props) => {
|
|
3218
3229
|
return React__default['default'].createElement(React__default['default'].Fragment, null);
|
3219
3230
|
}
|
3220
3231
|
else if (isEditing) {
|
3221
|
-
return (React__default['default'].createElement(ChatMessageComponentAsEditBox, { message: message, inlineEditButtons: props.inlineAcceptRejectEditButtons, strings: props.strings, onSubmit: (text) => __awaiter$o(void 0, void 0, void 0, function* () {
|
3232
|
+
return (React__default['default'].createElement(ChatMessageComponentAsEditBox, { message: message, inlineEditButtons: props.inlineAcceptRejectEditButtons, strings: props.strings, onSubmit: (text, metadata, options) => __awaiter$o(void 0, void 0, void 0, function* () {
|
3222
3233
|
props.onUpdateMessage &&
|
3223
3234
|
props.message.messageId &&
|
3224
|
-
(yield props.onUpdateMessage(props.message.messageId, text));
|
3235
|
+
(yield props.onUpdateMessage(props.message.messageId, text, metadata, options));
|
3225
3236
|
setIsEditing(false);
|
3226
3237
|
}), onCancel: () => {
|
3227
3238
|
setIsEditing(false);
|
@@ -6755,6 +6766,175 @@ const _DrawerMenu = (props) => {
|
|
6755
6766
|
} })))))));
|
6756
6767
|
};
|
6757
6768
|
|
6769
|
+
// Copyright (c) Microsoft Corporation.
|
6770
|
+
// Licensed under the MIT license.
|
6771
|
+
/**
|
6772
|
+
* Return different conditions based on the current and previous state of recording and transcribing
|
6773
|
+
*
|
6774
|
+
* @param callRecordState - The current call record state: on, off, stopped
|
6775
|
+
* @param callTranscribeState - The current call transcribe state: on, off, stopped
|
6776
|
+
*
|
6777
|
+
* @remarks - The stopped state means: previously on but currently off
|
6778
|
+
*
|
6779
|
+
* @private
|
6780
|
+
*/
|
6781
|
+
const computeVariant = (callRecordState, callTranscribeState) => {
|
6782
|
+
if (callRecordState === 'on' && callTranscribeState === 'on') {
|
6783
|
+
return 'RECORDING_AND_TRANSCRIPTION_STARTED';
|
6784
|
+
}
|
6785
|
+
else if (callRecordState === 'on' && callTranscribeState === 'off') {
|
6786
|
+
return 'RECORDING_STARTED';
|
6787
|
+
}
|
6788
|
+
else if (callRecordState === 'off' && callTranscribeState === 'on') {
|
6789
|
+
return 'TRANSCRIPTION_STARTED';
|
6790
|
+
}
|
6791
|
+
else if (callRecordState === 'on' && callTranscribeState === 'stopped') {
|
6792
|
+
return 'TRANSCRIPTION_STOPPED_STILL_RECORDING';
|
6793
|
+
}
|
6794
|
+
else if (callRecordState === 'stopped' && callTranscribeState === 'on') {
|
6795
|
+
return 'RECORDING_STOPPED_STILL_TRANSCRIBING';
|
6796
|
+
}
|
6797
|
+
else if (callRecordState === 'off' && callTranscribeState === 'stopped') {
|
6798
|
+
return 'TRANSCRIPTION_STOPPED';
|
6799
|
+
}
|
6800
|
+
else if (callRecordState === 'stopped' && callTranscribeState === 'off') {
|
6801
|
+
return 'RECORDING_STOPPED';
|
6802
|
+
}
|
6803
|
+
else if (callRecordState === 'stopped' && callTranscribeState === 'stopped') {
|
6804
|
+
return 'RECORDING_AND_TRANSCRIPTION_STOPPED';
|
6805
|
+
}
|
6806
|
+
else {
|
6807
|
+
return 'NO_STATE';
|
6808
|
+
}
|
6809
|
+
};
|
6810
|
+
|
6811
|
+
// Copyright (c) Microsoft Corporation.
|
6812
|
+
/**
|
6813
|
+
* A component that displays banners to notify the user when call recording and
|
6814
|
+
* transcription is enabled or disabled in a call.
|
6815
|
+
*
|
6816
|
+
* This component implements a state machine that tracks the changes to call
|
6817
|
+
* recording and transcription state and shows the corresponding message.
|
6818
|
+
*
|
6819
|
+
* @internal
|
6820
|
+
*/
|
6821
|
+
const _ComplianceBanner = (props) => {
|
6822
|
+
//set variant when incoming state is different from current state
|
6823
|
+
//when variant change, return message bar
|
6824
|
+
//when message bar is dismissed,set variant to default nostate and if current state is stopped, set to off
|
6825
|
+
const [variant, setVariant] = React.useState('NO_STATE');
|
6826
|
+
const cachedProps = React.useRef({
|
6827
|
+
latestBooleanState: {
|
6828
|
+
callTranscribeState: false,
|
6829
|
+
callRecordState: false
|
6830
|
+
},
|
6831
|
+
latestStringState: {
|
6832
|
+
callTranscribeState: 'off',
|
6833
|
+
callRecordState: 'off'
|
6834
|
+
}
|
6835
|
+
});
|
6836
|
+
// Only update cached props and variant if there is _some_ change in the latest props.
|
6837
|
+
// This ensures that state machine is only updated if there is an actual change in the props.
|
6838
|
+
if (props.callRecordState !== cachedProps.current.latestBooleanState.callRecordState ||
|
6839
|
+
props.callTranscribeState !== cachedProps.current.latestBooleanState.callTranscribeState) {
|
6840
|
+
cachedProps.current = {
|
6841
|
+
latestBooleanState: props,
|
6842
|
+
latestStringState: {
|
6843
|
+
callRecordState: determineStates(cachedProps.current.latestStringState.callRecordState, props.callRecordState),
|
6844
|
+
callTranscribeState: determineStates(cachedProps.current.latestStringState.callTranscribeState, props.callTranscribeState)
|
6845
|
+
}
|
6846
|
+
};
|
6847
|
+
setVariant(computeVariant(cachedProps.current.latestStringState.callRecordState, cachedProps.current.latestStringState.callTranscribeState));
|
6848
|
+
// when both states are stopped, after displaying message "RECORDING_AND_TRANSCRIPTION_STOPPED", change both states to off (going back to the default state)
|
6849
|
+
if (cachedProps.current.latestStringState.callRecordState === 'stopped' &&
|
6850
|
+
cachedProps.current.latestStringState.callTranscribeState === 'stopped') {
|
6851
|
+
cachedProps.current.latestStringState.callRecordState = 'off';
|
6852
|
+
cachedProps.current.latestStringState.callTranscribeState = 'off';
|
6853
|
+
}
|
6854
|
+
}
|
6855
|
+
return variant === 'NO_STATE' ? (React__default['default'].createElement(React__default['default'].Fragment, null)) : (React__default['default'].createElement(react.MessageBar, { messageBarType: react.MessageBarType.warning, onDismiss: () => {
|
6856
|
+
// when closing the banner, change variant to nostate and change stopped state to off state.
|
6857
|
+
// Reason: on banner close, going back to the default state
|
6858
|
+
setVariant('NO_STATE');
|
6859
|
+
if (cachedProps.current.latestStringState.callRecordState === 'stopped') {
|
6860
|
+
cachedProps.current.latestStringState.callRecordState = 'off';
|
6861
|
+
}
|
6862
|
+
if (cachedProps.current.latestStringState.callTranscribeState === 'stopped') {
|
6863
|
+
cachedProps.current.latestStringState.callTranscribeState = 'off';
|
6864
|
+
}
|
6865
|
+
}, dismissButtonAriaLabel: props.strings.close },
|
6866
|
+
React__default['default'].createElement(BannerMessage, { variant: variant, strings: props.strings })));
|
6867
|
+
};
|
6868
|
+
function determineStates(previous, current) {
|
6869
|
+
// if current state is on, then return on
|
6870
|
+
if (current) {
|
6871
|
+
return 'on';
|
6872
|
+
}
|
6873
|
+
// if current state is off
|
6874
|
+
else {
|
6875
|
+
// if previous state is on and current state is off, return stopped (on -> off)
|
6876
|
+
if (previous === 'on') {
|
6877
|
+
return 'stopped';
|
6878
|
+
}
|
6879
|
+
// otherwise remain previous state unchanged
|
6880
|
+
else {
|
6881
|
+
return previous;
|
6882
|
+
}
|
6883
|
+
}
|
6884
|
+
}
|
6885
|
+
function BannerMessage(props) {
|
6886
|
+
const { variant, strings } = props;
|
6887
|
+
switch (variant) {
|
6888
|
+
case 'TRANSCRIPTION_STOPPED_STILL_RECORDING':
|
6889
|
+
return (React__default['default'].createElement(React__default['default'].Fragment, null,
|
6890
|
+
React__default['default'].createElement("b", null, strings.complianceBannerTranscriptionStopped),
|
6891
|
+
` ${strings.complianceBannerNowOnlyRecording}`,
|
6892
|
+
React__default['default'].createElement(PrivacyPolicy, { linkText: strings.privacyPolicy })));
|
6893
|
+
case 'RECORDING_STOPPED_STILL_TRANSCRIBING':
|
6894
|
+
return (React__default['default'].createElement(React__default['default'].Fragment, null,
|
6895
|
+
React__default['default'].createElement("b", null, strings.complianceBannerRecordingStopped),
|
6896
|
+
` ${strings.complianceBannerNowOnlyTranscription}`,
|
6897
|
+
React__default['default'].createElement(PrivacyPolicy, { linkText: strings.privacyPolicy })));
|
6898
|
+
case 'RECORDING_AND_TRANSCRIPTION_STOPPED':
|
6899
|
+
return (React__default['default'].createElement(React__default['default'].Fragment, null,
|
6900
|
+
React__default['default'].createElement("b", null, strings.complianceBannerRecordingAndTranscriptionSaved),
|
6901
|
+
` ${strings.complianceBannerRecordingAndTranscriptionStopped}`,
|
6902
|
+
React__default['default'].createElement(LearnMore, { linkText: strings.learnMore })));
|
6903
|
+
case 'RECORDING_AND_TRANSCRIPTION_STARTED':
|
6904
|
+
return (React__default['default'].createElement(React__default['default'].Fragment, null,
|
6905
|
+
React__default['default'].createElement("b", null, strings.complianceBannerRecordingAndTranscriptionStarted),
|
6906
|
+
` ${strings.complianceBannerTranscriptionConsent}`,
|
6907
|
+
React__default['default'].createElement(PrivacyPolicy, { linkText: strings.privacyPolicy })));
|
6908
|
+
case 'TRANSCRIPTION_STARTED':
|
6909
|
+
return (React__default['default'].createElement(React__default['default'].Fragment, null,
|
6910
|
+
React__default['default'].createElement("b", null, strings.complianceBannerTranscriptionStarted),
|
6911
|
+
` ${strings.complianceBannerTranscriptionConsent}`,
|
6912
|
+
React__default['default'].createElement(PrivacyPolicy, { linkText: strings.privacyPolicy })));
|
6913
|
+
case 'RECORDING_STOPPED':
|
6914
|
+
return (React__default['default'].createElement(React__default['default'].Fragment, null,
|
6915
|
+
React__default['default'].createElement("b", null, strings.complianceBannerRecordingSaving),
|
6916
|
+
` ${strings.complianceBannerRecordingStopped}`,
|
6917
|
+
React__default['default'].createElement(LearnMore, { linkText: strings.learnMore })));
|
6918
|
+
case 'RECORDING_STARTED':
|
6919
|
+
return (React__default['default'].createElement(React__default['default'].Fragment, null,
|
6920
|
+
React__default['default'].createElement("b", null, strings.complianceBannerRecordingStarted),
|
6921
|
+
` ${strings.complianceBannerTranscriptionConsent}`,
|
6922
|
+
React__default['default'].createElement(PrivacyPolicy, { linkText: strings.privacyPolicy })));
|
6923
|
+
case 'TRANSCRIPTION_STOPPED':
|
6924
|
+
return (React__default['default'].createElement(React__default['default'].Fragment, null,
|
6925
|
+
React__default['default'].createElement("b", null, strings.complianceBannerTranscriptionSaving),
|
6926
|
+
` ${strings.complianceBannerTranscriptionStopped}`,
|
6927
|
+
React__default['default'].createElement(LearnMore, { linkText: strings.learnMore })));
|
6928
|
+
}
|
6929
|
+
return React__default['default'].createElement(React__default['default'].Fragment, null);
|
6930
|
+
}
|
6931
|
+
function PrivacyPolicy(props) {
|
6932
|
+
return (React__default['default'].createElement(react.Link, { href: "https://privacy.microsoft.com/privacystatement#mainnoticetoendusersmodule", target: "_blank", underline: true }, props.linkText));
|
6933
|
+
}
|
6934
|
+
function LearnMore(props) {
|
6935
|
+
return (React__default['default'].createElement(react.Link, { href: "https://support.microsoft.com/office/record-a-meeting-in-teams-34dfbe7f-b07d-4a27-b4c6-de62f1348c24", target: "_blank", underline: true }, props.linkText));
|
6936
|
+
}
|
6937
|
+
|
6758
6938
|
// Copyright (c) Microsoft Corporation.
|
6759
6939
|
// Licensed under the MIT license.
|
6760
6940
|
/**
|
@@ -7164,8 +7344,10 @@ const createDefaultChatHandlers = memoizeOne__default['default']((chatClient, ch
|
|
7164
7344
|
};
|
7165
7345
|
yield chatThreadClient.sendMessage(sendMessageRequest, options);
|
7166
7346
|
}),
|
7167
|
-
onUpdateMessage: (messageId, content, metadata) => __awaiter$k(void 0, void 0, void 0, function* () {
|
7168
|
-
|
7347
|
+
onUpdateMessage: (messageId, content, metadata, options) => __awaiter$k(void 0, void 0, void 0, function* () {
|
7348
|
+
const updatedMetadata = metadata ? Object.assign({}, metadata) : {};
|
7349
|
+
updatedMetadata['fileSharingMetadata'] = JSON.stringify((options === null || options === void 0 ? void 0 : options.attachedFilesMetadata) || []);
|
7350
|
+
yield chatThreadClient.updateMessage(messageId, { content, metadata: updatedMetadata });
|
7169
7351
|
}),
|
7170
7352
|
onDeleteMessage: (messageId) => __awaiter$k(void 0, void 0, void 0, function* () {
|
7171
7353
|
yield chatThreadClient.deleteMessage(messageId);
|
@@ -11488,10 +11670,11 @@ class AzureCommunicationChatAdapter {
|
|
11488
11670
|
}));
|
11489
11671
|
});
|
11490
11672
|
}
|
11491
|
-
updateMessage(messageId, content, metadata) {
|
11673
|
+
updateMessage(messageId, content, metadata, options) {
|
11492
11674
|
return __awaiter$9(this, void 0, void 0, function* () {
|
11493
11675
|
return yield this.asyncTeeErrorToEventEmitter(() => __awaiter$9(this, void 0, void 0, function* () {
|
11494
|
-
|
11676
|
+
/* @conditional-compile-remove(file-sharing) */
|
11677
|
+
return yield this.handlers.onUpdateMessage(messageId, content, metadata, options);
|
11495
11678
|
}));
|
11496
11679
|
});
|
11497
11680
|
}
|
@@ -12785,45 +12968,6 @@ const getCallCompositePage = (call, previousCall) => {
|
|
12785
12968
|
// No call state - show starting page (configuration)
|
12786
12969
|
return 'configuration';
|
12787
12970
|
};
|
12788
|
-
/**
|
12789
|
-
* Return different conditions based on the current and previous state of recording and transcribing
|
12790
|
-
*
|
12791
|
-
* @param callRecordState - The current call record state: on, off, stopped
|
12792
|
-
* @param callTranscribeState - The current call transcribe state: on, off, stopped
|
12793
|
-
*
|
12794
|
-
* @remarks - The stopped state means: previously on but currently off
|
12795
|
-
*
|
12796
|
-
* @private
|
12797
|
-
*/
|
12798
|
-
const computeVariant = (callRecordState, callTranscribeState) => {
|
12799
|
-
if (callRecordState === 'on' && callTranscribeState === 'on') {
|
12800
|
-
return 'RECORDING_AND_TRANSCRIPTION_STARTED';
|
12801
|
-
}
|
12802
|
-
else if (callRecordState === 'on' && callTranscribeState === 'off') {
|
12803
|
-
return 'RECORDING_STARTED';
|
12804
|
-
}
|
12805
|
-
else if (callRecordState === 'off' && callTranscribeState === 'on') {
|
12806
|
-
return 'TRANSCRIPTION_STARTED';
|
12807
|
-
}
|
12808
|
-
else if (callRecordState === 'on' && callTranscribeState === 'stopped') {
|
12809
|
-
return 'TRANSCRIPTION_STOPPED_STILL_RECORDING';
|
12810
|
-
}
|
12811
|
-
else if (callRecordState === 'stopped' && callTranscribeState === 'on') {
|
12812
|
-
return 'RECORDING_STOPPED_STILL_TRANSCRIBING';
|
12813
|
-
}
|
12814
|
-
else if (callRecordState === 'off' && callTranscribeState === 'stopped') {
|
12815
|
-
return 'TRANSCRIPTION_STOPPED';
|
12816
|
-
}
|
12817
|
-
else if (callRecordState === 'stopped' && callTranscribeState === 'off') {
|
12818
|
-
return 'RECORDING_STOPPED';
|
12819
|
-
}
|
12820
|
-
else if (callRecordState === 'stopped' && callTranscribeState === 'stopped') {
|
12821
|
-
return 'RECORDING_AND_TRANSCRIPTION_STOPPED';
|
12822
|
-
}
|
12823
|
-
else {
|
12824
|
-
return 'NO_STATE';
|
12825
|
-
}
|
12826
|
-
};
|
12827
12971
|
|
12828
12972
|
// Copyright (c) Microsoft Corporation.
|
12829
12973
|
// Licensed under the MIT license.
|
@@ -13232,128 +13376,6 @@ const onFetchCustomButtonPropsTrampoline = (options) => {
|
|
13232
13376
|
return response;
|
13233
13377
|
};
|
13234
13378
|
|
13235
|
-
// Copyright (c) Microsoft Corporation.
|
13236
|
-
/**
|
13237
|
-
* @private
|
13238
|
-
*/
|
13239
|
-
const ComplianceBanner = (props) => {
|
13240
|
-
function determineStates(previous, current) {
|
13241
|
-
// if current state is on, then return on
|
13242
|
-
if (current) {
|
13243
|
-
return 'on';
|
13244
|
-
}
|
13245
|
-
// if current state is off
|
13246
|
-
else {
|
13247
|
-
// if previous state is on and current state is off, return stopped (on -> off)
|
13248
|
-
if (previous === 'on') {
|
13249
|
-
return 'stopped';
|
13250
|
-
}
|
13251
|
-
// otherwise remain previous state unchanged
|
13252
|
-
else {
|
13253
|
-
return previous;
|
13254
|
-
}
|
13255
|
-
}
|
13256
|
-
}
|
13257
|
-
//set variant when incoming state is different from current state
|
13258
|
-
//when variant change, return message bar
|
13259
|
-
//when message bar is dismissed,set variant to default nostate and if current state is stopped, set to off
|
13260
|
-
const strings = useLocale().strings;
|
13261
|
-
const [variant, setVariant] = React.useState('NO_STATE');
|
13262
|
-
const cachedProps = React.useRef({
|
13263
|
-
latestBooleanState: {
|
13264
|
-
callTranscribeState: false,
|
13265
|
-
callRecordState: false
|
13266
|
-
},
|
13267
|
-
latestStringState: {
|
13268
|
-
callTranscribeState: 'off',
|
13269
|
-
callRecordState: 'off'
|
13270
|
-
}
|
13271
|
-
});
|
13272
|
-
// Only update cached props and variant if there is _some_ change in the latest props.
|
13273
|
-
// This ensures that state machine is only updated if there is an actual change in the props.
|
13274
|
-
if (props.callRecordState !== cachedProps.current.latestBooleanState.callRecordState ||
|
13275
|
-
props.callTranscribeState !== cachedProps.current.latestBooleanState.callTranscribeState) {
|
13276
|
-
cachedProps.current = {
|
13277
|
-
latestBooleanState: props,
|
13278
|
-
latestStringState: {
|
13279
|
-
callRecordState: determineStates(cachedProps.current.latestStringState.callRecordState, props.callRecordState),
|
13280
|
-
callTranscribeState: determineStates(cachedProps.current.latestStringState.callTranscribeState, props.callTranscribeState)
|
13281
|
-
}
|
13282
|
-
};
|
13283
|
-
setVariant(computeVariant(cachedProps.current.latestStringState.callRecordState, cachedProps.current.latestStringState.callTranscribeState));
|
13284
|
-
// when both states are stopped, after displaying message "RECORDING_AND_TRANSCRIPTION_STOPPED", change both states to off (going back to the default state)
|
13285
|
-
if (cachedProps.current.latestStringState.callRecordState === 'stopped' &&
|
13286
|
-
cachedProps.current.latestStringState.callTranscribeState === 'stopped') {
|
13287
|
-
cachedProps.current.latestStringState.callRecordState = 'off';
|
13288
|
-
cachedProps.current.latestStringState.callTranscribeState = 'off';
|
13289
|
-
}
|
13290
|
-
}
|
13291
|
-
return variant === 'NO_STATE' ? (React__default['default'].createElement(React__default['default'].Fragment, null)) : (React__default['default'].createElement(react.MessageBar, { messageBarType: react.MessageBarType.warning, onDismiss: () => {
|
13292
|
-
// when closing the banner, change variant to nostate and change stopped state to off state.
|
13293
|
-
// Reason: on banner close, going back to the default state
|
13294
|
-
setVariant('NO_STATE');
|
13295
|
-
if (cachedProps.current.latestStringState.callRecordState === 'stopped') {
|
13296
|
-
cachedProps.current.latestStringState.callRecordState = 'off';
|
13297
|
-
}
|
13298
|
-
if (cachedProps.current.latestStringState.callTranscribeState === 'stopped') {
|
13299
|
-
cachedProps.current.latestStringState.callTranscribeState = 'off';
|
13300
|
-
}
|
13301
|
-
}, dismissButtonAriaLabel: strings.call.close },
|
13302
|
-
React__default['default'].createElement(BannerMessage, { variant: variant, strings: strings })));
|
13303
|
-
};
|
13304
|
-
function BannerMessage(props) {
|
13305
|
-
const { variant, strings } = props;
|
13306
|
-
switch (variant) {
|
13307
|
-
case 'TRANSCRIPTION_STOPPED_STILL_RECORDING':
|
13308
|
-
return (React__default['default'].createElement(React__default['default'].Fragment, null,
|
13309
|
-
React__default['default'].createElement("b", null, strings.call.complianceBannerTranscriptionStopped),
|
13310
|
-
` ${strings.call.complianceBannerNowOnlyRecording}`,
|
13311
|
-
React__default['default'].createElement(PrivacyPolicy, { linkText: strings.call.privacyPolicy })));
|
13312
|
-
case 'RECORDING_STOPPED_STILL_TRANSCRIBING':
|
13313
|
-
return (React__default['default'].createElement(React__default['default'].Fragment, null,
|
13314
|
-
React__default['default'].createElement("b", null, strings.call.complianceBannerRecordingStopped),
|
13315
|
-
` ${strings.call.complianceBannerNowOnlyTranscription}`,
|
13316
|
-
React__default['default'].createElement(PrivacyPolicy, { linkText: strings.call.privacyPolicy })));
|
13317
|
-
case 'RECORDING_AND_TRANSCRIPTION_STOPPED':
|
13318
|
-
return (React__default['default'].createElement(React__default['default'].Fragment, null,
|
13319
|
-
React__default['default'].createElement("b", null, strings.call.complianceBannerRecordingAndTranscriptionSaved),
|
13320
|
-
` ${strings.call.complianceBannerRecordingAndTranscriptionStopped}`,
|
13321
|
-
React__default['default'].createElement(LearnMore, { linkText: strings.call.learnMore })));
|
13322
|
-
case 'RECORDING_AND_TRANSCRIPTION_STARTED':
|
13323
|
-
return (React__default['default'].createElement(React__default['default'].Fragment, null,
|
13324
|
-
React__default['default'].createElement("b", null, strings.call.complianceBannerRecordingAndTranscriptionStarted),
|
13325
|
-
` ${strings.call.complianceBannerTranscriptionConsent}`,
|
13326
|
-
React__default['default'].createElement(PrivacyPolicy, { linkText: strings.call.privacyPolicy })));
|
13327
|
-
case 'TRANSCRIPTION_STARTED':
|
13328
|
-
return (React__default['default'].createElement(React__default['default'].Fragment, null,
|
13329
|
-
React__default['default'].createElement("b", null, strings.call.complianceBannerTranscriptionStarted),
|
13330
|
-
` ${strings.call.complianceBannerTranscriptionConsent}`,
|
13331
|
-
React__default['default'].createElement(PrivacyPolicy, { linkText: strings.call.privacyPolicy })));
|
13332
|
-
case 'RECORDING_STOPPED':
|
13333
|
-
return (React__default['default'].createElement(React__default['default'].Fragment, null,
|
13334
|
-
React__default['default'].createElement("b", null, strings.call.complianceBannerRecordingSaving),
|
13335
|
-
` ${strings.call.complianceBannerRecordingStopped}`,
|
13336
|
-
React__default['default'].createElement(LearnMore, { linkText: strings.call.learnMore })));
|
13337
|
-
case 'RECORDING_STARTED':
|
13338
|
-
return (React__default['default'].createElement(React__default['default'].Fragment, null,
|
13339
|
-
React__default['default'].createElement("b", null, strings.call.complianceBannerRecordingStarted),
|
13340
|
-
` ${strings.call.complianceBannerTranscriptionConsent}`,
|
13341
|
-
React__default['default'].createElement(PrivacyPolicy, { linkText: strings.call.privacyPolicy })));
|
13342
|
-
case 'TRANSCRIPTION_STOPPED':
|
13343
|
-
return (React__default['default'].createElement(React__default['default'].Fragment, null,
|
13344
|
-
React__default['default'].createElement("b", null, strings.call.complianceBannerTranscriptionSaving),
|
13345
|
-
` ${strings.call.complianceBannerTranscriptionStopped}`,
|
13346
|
-
React__default['default'].createElement(LearnMore, { linkText: strings.call.learnMore })));
|
13347
|
-
}
|
13348
|
-
return React__default['default'].createElement(React__default['default'].Fragment, null);
|
13349
|
-
}
|
13350
|
-
function PrivacyPolicy(props) {
|
13351
|
-
return (React__default['default'].createElement(react.Link, { href: "https://privacy.microsoft.com/privacystatement#mainnoticetoendusersmodule", target: "_blank", underline: true }, props.linkText));
|
13352
|
-
}
|
13353
|
-
function LearnMore(props) {
|
13354
|
-
return (React__default['default'].createElement(react.Link, { href: "https://support.microsoft.com/office/record-a-meeting-in-teams-34dfbe7f-b07d-4a27-b4c6-de62f1348c24", target: "_blank", underline: true }, props.linkText));
|
13355
|
-
}
|
13356
|
-
|
13357
13379
|
// Copyright (c) Microsoft Corporation.
|
13358
13380
|
// Licensed under the MIT license.
|
13359
13381
|
/** @private */
|
@@ -13489,7 +13511,7 @@ const CallArrangement = (props) => {
|
|
13489
13511
|
React__default['default'].createElement(react.Stack, { verticalFill: true, horizontalAlign: "stretch", className: containerClassName, "data-ui-id": props.dataUiId },
|
13490
13512
|
React__default['default'].createElement(react.Stack.Item, { styles: notificationsContainerStyles },
|
13491
13513
|
React__default['default'].createElement(react.Stack, { styles: bannerNotificationStyles },
|
13492
|
-
React__default['default'].createElement(
|
13514
|
+
React__default['default'].createElement(_ComplianceBanner, Object.assign({}, props.complianceBannerProps))),
|
13493
13515
|
props.errorBarProps !== false && (React__default['default'].createElement(react.Stack, { styles: bannerNotificationStyles },
|
13494
13516
|
React__default['default'].createElement(ErrorBar, Object.assign({}, props.errorBarProps)))),
|
13495
13517
|
!!props.mutedNotificationProps && React__default['default'].createElement(MutedNotification, Object.assign({}, props.mutedNotificationProps))),
|
@@ -13817,9 +13839,10 @@ const CallPage = (props) => {
|
|
13817
13839
|
const errorBarProps = usePropsFor$1(ErrorBar);
|
13818
13840
|
const mutedNotificationProps = useSelector$1(mutedNotificationSelector);
|
13819
13841
|
const networkReconnectTileProps = useSelector$1(networkReconnectTileSelector);
|
13842
|
+
const strings = useLocale().strings.call;
|
13820
13843
|
// Reduce the controls shown when mobile view is enabled.
|
13821
13844
|
const callControlOptions = mobileView ? reduceCallControlsForMobile(options === null || options === void 0 ? void 0 : options.callControls) : options === null || options === void 0 ? void 0 : options.callControls;
|
13822
|
-
return (React__default['default'].createElement(CallArrangement, { complianceBannerProps: Object.assign({}, complianceBannerProps), errorBarProps: (options === null || options === void 0 ? void 0 : options.errorBar) !== false && Object.assign({}, errorBarProps), mutedNotificationProps: mutedNotificationProps, callControlProps: {
|
13845
|
+
return (React__default['default'].createElement(CallArrangement, { complianceBannerProps: Object.assign(Object.assign({}, complianceBannerProps), { strings }), errorBarProps: (options === null || options === void 0 ? void 0 : options.errorBar) !== false && Object.assign({}, errorBarProps), mutedNotificationProps: mutedNotificationProps, callControlProps: {
|
13823
13846
|
callInvitationURL: callInvitationURL,
|
13824
13847
|
onFetchParticipantMenuItems: onFetchParticipantMenuItems,
|
13825
13848
|
options: callControlOptions,
|
@@ -14373,7 +14396,7 @@ const LobbyPage = (props) => {
|
|
14373
14396
|
? reduceCallControlsForMobile((_a = props.options) === null || _a === void 0 ? void 0 : _a.callControls)
|
14374
14397
|
: (_b = props.options) === null || _b === void 0 ? void 0 : _b.callControls;
|
14375
14398
|
callControlOptions = disableLobbyPageControls(callControlOptions);
|
14376
|
-
return (React__default['default'].createElement(CallArrangement, { complianceBannerProps: {}, errorBarProps: ((_c = props.options) === null || _c === void 0 ? void 0 : _c.errorBar) !== false && Object.assign({}, errorBarProps), callControlProps: {
|
14399
|
+
return (React__default['default'].createElement(CallArrangement, { complianceBannerProps: { strings }, errorBarProps: ((_c = props.options) === null || _c === void 0 ? void 0 : _c.errorBar) !== false && Object.assign({}, errorBarProps), callControlProps: {
|
14377
14400
|
options: callControlOptions,
|
14378
14401
|
increaseFlyoutItemSize: props.mobileView
|
14379
14402
|
}, mobileView: props.mobileView, onRenderGalleryContent: () => React__default['default'].createElement(LobbyTile, Object.assign({}, lobbyProps, { overlayProps: overlayProps(strings, inLobby) })), dataUiId: 'lobby-page' }));
|