@azure/communication-react 1.5.1-alpha-202305050017 → 1.5.1-alpha-202305090013
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 +84 -67
- package/dist/dist-cjs/communication-react/index.js +1573 -290
- 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/communication-react/src/index.d.ts +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 +3 -3
- package/dist/dist-esm/react-components/src/components/ChatMessage/ChatMessageComponent.js +7 -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 +2 -0
- package/dist/dist-esm/react-components/src/components/ChatMessage/ChatMessageComponentAsEditBox.js +5 -1
- package/dist/dist-esm/react-components/src/components/ChatMessage/ChatMessageComponentAsEditBox.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/ChatMessage/ChatMessageComponentAsMessageBubble.d.ts +4 -4
- package/dist/dist-esm/react-components/src/components/ChatMessage/ChatMessageComponentAsMessageBubble.js +3 -1
- package/dist/dist-esm/react-components/src/components/ChatMessage/ChatMessageComponentAsMessageBubble.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/ChatMessage/ChatMessageContent.d.ts +2 -2
- package/dist/dist-esm/react-components/src/components/ChatMessage/ChatMessageContent.js +56 -35
- package/dist/dist-esm/react-components/src/components/ChatMessage/ChatMessageContent.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/ChatMessage/MentionRenderer.d.ts +10 -0
- package/dist/dist-esm/react-components/src/components/ChatMessage/MentionRenderer.js +15 -0
- package/dist/dist-esm/react-components/src/components/ChatMessage/MentionRenderer.js.map +1 -0
- package/dist/dist-esm/react-components/src/components/InputBoxComponent.d.ts +3 -3
- package/dist/dist-esm/react-components/src/components/InputBoxComponent.js +1038 -5
- package/dist/dist-esm/react-components/src/components/InputBoxComponent.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/MentionPopover.d.ts +121 -0
- package/dist/dist-esm/react-components/src/components/MentionPopover.js +125 -0
- package/dist/dist-esm/react-components/src/components/MentionPopover.js.map +1 -0
- package/dist/dist-esm/react-components/src/components/MessageThread.d.ts +4 -4
- package/dist/dist-esm/react-components/src/components/MessageThread.js +9 -3
- package/dist/dist-esm/react-components/src/components/MessageThread.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/SendBox.d.ts +7 -7
- package/dist/dist-esm/react-components/src/components/SendBox.js +15 -9
- package/dist/dist-esm/react-components/src/components/SendBox.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/index.d.ts +2 -2
- package/dist/dist-esm/react-components/src/components/index.js +2 -2
- package/dist/dist-esm/react-components/src/components/index.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/styles/{AtMentionFlyout.style.d.ts → MentionPopover.style.d.ts} +4 -4
- package/dist/dist-esm/react-components/src/components/styles/{AtMentionFlyout.style.js → MentionPopover.style.js} +11 -13
- package/dist/dist-esm/react-components/src/components/styles/MentionPopover.style.js.map +1 -0
- package/dist/dist-esm/react-components/src/components/styles/MessageThread.styles.js +5 -1
- package/dist/dist-esm/react-components/src/components/styles/MessageThread.styles.js.map +1 -1
- package/dist/dist-esm/react-components/src/identifiers/IdentifierProvider.d.ts +4 -4
- package/dist/dist-esm/react-components/src/identifiers/IdentifierProvider.js +4 -4
- package/dist/dist-esm/react-components/src/identifiers/IdentifierProvider.js.map +1 -1
- package/dist/dist-esm/react-components/src/localization/LocalizationProvider.d.ts +3 -0
- package/dist/dist-esm/react-components/src/localization/LocalizationProvider.js.map +1 -1
- package/dist/dist-esm/react-components/src/localization/locales/en-US/strings.json +3 -0
- package/dist/dist-esm/react-composites/src/composites/CallComposite/CallComposite.js +1 -3
- package/dist/dist-esm/react-composites/src/composites/CallComposite/CallComposite.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/components/CallArrangement.js +2 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/components/CallArrangement.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/components/SidePane/SidePane.js +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/components/SidePane/SidePane.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/ConfigurationPage.js +30 -13
- package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/ConfigurationPage.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/styles/CallConfiguration.styles.d.ts +5 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/styles/CallConfiguration.styles.js +16 -0
- package/dist/dist-esm/react-composites/src/composites/CallComposite/styles/CallConfiguration.styles.js.map +1 -1
- package/package.json +11 -9
- package/dist/dist-esm/react-components/src/components/AtMentionFlyout.d.ts +0 -91
- package/dist/dist-esm/react-components/src/components/AtMentionFlyout.js +0 -58
- package/dist/dist-esm/react-components/src/components/AtMentionFlyout.js.map +0 -1
- package/dist/dist-esm/react-components/src/components/styles/AtMentionFlyout.style.js.map +0 -1
@@ -14,6 +14,8 @@ var React = require('react');
|
|
14
14
|
var react = require('@fluentui/react');
|
15
15
|
var reactNorthstar = require('@fluentui/react-northstar');
|
16
16
|
var reactIcons = require('@fluentui/react-icons');
|
17
|
+
var textareaCaretTs = require('textarea-caret-ts');
|
18
|
+
var useDebounce = require('use-debounce');
|
17
19
|
var reactFileTypeIcons = require('@fluentui/react-file-type-icons');
|
18
20
|
var reactAriaLive = require('react-aria-live');
|
19
21
|
var htmlToReact = require('html-to-react');
|
@@ -162,7 +164,7 @@ const _toCommunicationIdentifier = (id) => {
|
|
162
164
|
// Copyright (c) Microsoft Corporation.
|
163
165
|
// Licensed under the MIT license.
|
164
166
|
// GENERATED FILE. DO NOT EDIT MANUALLY.
|
165
|
-
var telemetryVersion = '1.5.1-alpha-
|
167
|
+
var telemetryVersion = '1.5.1-alpha-202305090013';
|
166
168
|
|
167
169
|
// Copyright (c) Microsoft Corporation.
|
168
170
|
/**
|
@@ -408,7 +410,7 @@ const getSupportedSpokenLanguages = (state, props) => {
|
|
408
410
|
|
409
411
|
// Copyright (c) Microsoft Corporation.
|
410
412
|
// Licensed under the MIT license.
|
411
|
-
var __awaiter$
|
413
|
+
var __awaiter$J = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
|
412
414
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
413
415
|
return new (P || (P = Promise))(function (resolve, reject) {
|
414
416
|
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
@@ -446,7 +448,7 @@ const _isPreviewOn = (deviceManager) => {
|
|
446
448
|
*
|
447
449
|
* @private
|
448
450
|
*/
|
449
|
-
const disposeAllLocalPreviewViews = (callClient) => __awaiter$
|
451
|
+
const disposeAllLocalPreviewViews = (callClient) => __awaiter$J(void 0, void 0, void 0, function* () {
|
450
452
|
const unparentedViews = callClient.getState().deviceManager.unparentedViews;
|
451
453
|
for (const view of unparentedViews) {
|
452
454
|
yield callClient.disposeView(undefined, undefined, view);
|
@@ -572,7 +574,7 @@ const holdButtonSelector = reselect__namespace.createSelector([getCallState], (c
|
|
572
574
|
|
573
575
|
// Copyright (c) Microsoft Corporation.
|
574
576
|
// Licensed under the MIT license.
|
575
|
-
var __awaiter$
|
577
|
+
var __awaiter$I = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
|
576
578
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
577
579
|
return new (P || (P = Promise))(function (resolve, reject) {
|
578
580
|
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
@@ -593,7 +595,7 @@ const areStreamsEqual = (prevStream, newStream) => {
|
|
593
595
|
* @private
|
594
596
|
*/
|
595
597
|
const createDefaultCommonCallingHandlers = memoizeOne__default['default']((callClient, deviceManager, call) => {
|
596
|
-
const onStartLocalVideo = () => __awaiter$
|
598
|
+
const onStartLocalVideo = () => __awaiter$I(void 0, void 0, void 0, function* () {
|
597
599
|
// Before the call object creates a stream, dispose of any local preview streams.
|
598
600
|
// @TODO: is there any way to parent the unparented view to the call object instead
|
599
601
|
// of disposing and creating a new stream?
|
@@ -613,7 +615,7 @@ const createDefaultCommonCallingHandlers = memoizeOne__default['default']((callC
|
|
613
615
|
yield call.startVideo(stream);
|
614
616
|
}
|
615
617
|
});
|
616
|
-
const onStopLocalVideo = (stream) => __awaiter$
|
618
|
+
const onStopLocalVideo = (stream) => __awaiter$I(void 0, void 0, void 0, function* () {
|
617
619
|
const callId = call === null || call === void 0 ? void 0 : call.id;
|
618
620
|
if (!callId) {
|
619
621
|
return;
|
@@ -622,7 +624,7 @@ const createDefaultCommonCallingHandlers = memoizeOne__default['default']((callC
|
|
622
624
|
yield call.stopVideo(stream);
|
623
625
|
}
|
624
626
|
});
|
625
|
-
const onToggleCamera = (options) => __awaiter$
|
627
|
+
const onToggleCamera = (options) => __awaiter$I(void 0, void 0, void 0, function* () {
|
626
628
|
const previewOn = _isPreviewOn(callClient.getState().deviceManager);
|
627
629
|
if (previewOn && call && call.state === 'Connecting') {
|
628
630
|
// This is to workaround: https://skype.visualstudio.com/SPOOL/_workitems/edit/3030558.
|
@@ -670,19 +672,19 @@ const createDefaultCommonCallingHandlers = memoizeOne__default['default']((callC
|
|
670
672
|
}
|
671
673
|
}
|
672
674
|
});
|
673
|
-
const onSelectMicrophone = (device) => __awaiter$
|
675
|
+
const onSelectMicrophone = (device) => __awaiter$I(void 0, void 0, void 0, function* () {
|
674
676
|
if (!deviceManager) {
|
675
677
|
return;
|
676
678
|
}
|
677
679
|
return deviceManager.selectMicrophone(device);
|
678
680
|
});
|
679
|
-
const onSelectSpeaker = (device) => __awaiter$
|
681
|
+
const onSelectSpeaker = (device) => __awaiter$I(void 0, void 0, void 0, function* () {
|
680
682
|
if (!deviceManager) {
|
681
683
|
return;
|
682
684
|
}
|
683
685
|
return deviceManager.selectSpeaker(device);
|
684
686
|
});
|
685
|
-
const onSelectCamera = (device, options) => __awaiter$
|
687
|
+
const onSelectCamera = (device, options) => __awaiter$I(void 0, void 0, void 0, function* () {
|
686
688
|
if (!deviceManager) {
|
687
689
|
return;
|
688
690
|
}
|
@@ -705,19 +707,19 @@ const createDefaultCommonCallingHandlers = memoizeOne__default['default']((callC
|
|
705
707
|
}, options);
|
706
708
|
}
|
707
709
|
});
|
708
|
-
const onToggleMicrophone = () => __awaiter$
|
710
|
+
const onToggleMicrophone = () => __awaiter$I(void 0, void 0, void 0, function* () {
|
709
711
|
if (!call || !_isInCall(call.state)) {
|
710
712
|
throw new Error(`Please invoke onToggleMicrophone after call is started`);
|
711
713
|
}
|
712
714
|
return call.isMuted ? yield call.unmute() : yield call.mute();
|
713
715
|
});
|
714
|
-
const onStartScreenShare = () => __awaiter$
|
715
|
-
const onStopScreenShare = () => __awaiter$
|
716
|
-
const onToggleScreenShare = () => __awaiter$
|
717
|
-
const onHangUp = (forEveryone) => __awaiter$
|
716
|
+
const onStartScreenShare = () => __awaiter$I(void 0, void 0, void 0, function* () { return yield (call === null || call === void 0 ? void 0 : call.startScreenSharing()); });
|
717
|
+
const onStopScreenShare = () => __awaiter$I(void 0, void 0, void 0, function* () { return yield (call === null || call === void 0 ? void 0 : call.stopScreenSharing()); });
|
718
|
+
const onToggleScreenShare = () => __awaiter$I(void 0, void 0, void 0, function* () { return (call === null || call === void 0 ? void 0 : call.isScreenSharingOn) ? yield onStopScreenShare() : yield onStartScreenShare(); });
|
719
|
+
const onHangUp = (forEveryone) => __awaiter$I(void 0, void 0, void 0, function* () { return yield (call === null || call === void 0 ? void 0 : call.hangUp({ forEveryone: forEveryone === true ? true : false })); });
|
718
720
|
/* @conditional-compile-remove(PSTN-calls) */
|
719
|
-
const onToggleHold = () => __awaiter$
|
720
|
-
const onCreateLocalStreamView = (options = { scalingMode: 'Crop', isMirrored: true }) => __awaiter$
|
721
|
+
const onToggleHold = () => __awaiter$I(void 0, void 0, void 0, function* () { return (call === null || call === void 0 ? void 0 : call.state) === 'LocalHold' ? yield (call === null || call === void 0 ? void 0 : call.resume()) : yield (call === null || call === void 0 ? void 0 : call.hold()); });
|
722
|
+
const onCreateLocalStreamView = (options = { scalingMode: 'Crop', isMirrored: true }) => __awaiter$I(void 0, void 0, void 0, function* () {
|
721
723
|
var _a;
|
722
724
|
if (!call || call.localVideoStreams.length === 0) {
|
723
725
|
return;
|
@@ -733,7 +735,7 @@ const createDefaultCommonCallingHandlers = memoizeOne__default['default']((callC
|
|
733
735
|
const { view } = (_a = (yield callClient.createView(call.id, undefined, localStream, options))) !== null && _a !== void 0 ? _a : {};
|
734
736
|
return view ? { view } : undefined;
|
735
737
|
});
|
736
|
-
const onCreateRemoteStreamView = (userId, options = { scalingMode: 'Crop' }) => __awaiter$
|
738
|
+
const onCreateRemoteStreamView = (userId, options = { scalingMode: 'Crop' }) => __awaiter$I(void 0, void 0, void 0, function* () {
|
737
739
|
if (!call) {
|
738
740
|
return;
|
739
741
|
}
|
@@ -764,7 +766,7 @@ const createDefaultCommonCallingHandlers = memoizeOne__default['default']((callC
|
|
764
766
|
}
|
765
767
|
return (createViewResult === null || createViewResult === void 0 ? void 0 : createViewResult.view) ? { view: createViewResult === null || createViewResult === void 0 ? void 0 : createViewResult.view } : undefined;
|
766
768
|
});
|
767
|
-
const onDisposeRemoteStreamView = (userId) => __awaiter$
|
769
|
+
const onDisposeRemoteStreamView = (userId) => __awaiter$I(void 0, void 0, void 0, function* () {
|
768
770
|
if (!call) {
|
769
771
|
return;
|
770
772
|
}
|
@@ -785,7 +787,7 @@ const createDefaultCommonCallingHandlers = memoizeOne__default['default']((callC
|
|
785
787
|
callClient.disposeView(call.id, participant.identifier, screenShareStream);
|
786
788
|
}
|
787
789
|
});
|
788
|
-
const onDisposeLocalStreamView = () => __awaiter$
|
790
|
+
const onDisposeLocalStreamView = () => __awaiter$I(void 0, void 0, void 0, function* () {
|
789
791
|
// If the user is currently in a call, dispose of the local stream view attached to that call.
|
790
792
|
const callState = call && callClient.getState().calls[call.id];
|
791
793
|
const localStream = callState === null || callState === void 0 ? void 0 : callState.localVideoStreams.find((item) => item.mediaStreamType === 'Video');
|
@@ -798,18 +800,18 @@ const createDefaultCommonCallingHandlers = memoizeOne__default['default']((callC
|
|
798
800
|
yield disposeAllLocalPreviewViews(callClient);
|
799
801
|
});
|
800
802
|
/* @conditional-compile-remove(dialpad) */ /* @conditional-compile-remove(PSTN-calls) */
|
801
|
-
const onSendDtmfTone = (dtmfTone) => __awaiter$
|
803
|
+
const onSendDtmfTone = (dtmfTone) => __awaiter$I(void 0, void 0, void 0, function* () { return yield (call === null || call === void 0 ? void 0 : call.sendDtmf(dtmfTone)); });
|
802
804
|
const notImplemented = () => {
|
803
805
|
throw new Error('Not implemented, cannot call a method from an abstract object');
|
804
806
|
};
|
805
807
|
/* @conditional-compile-remove(call-readiness) */
|
806
|
-
const askDevicePermission = (constrain) => __awaiter$
|
808
|
+
const askDevicePermission = (constrain) => __awaiter$I(void 0, void 0, void 0, function* () {
|
807
809
|
if (deviceManager) {
|
808
810
|
yield (deviceManager === null || deviceManager === void 0 ? void 0 : deviceManager.askDevicePermission(constrain));
|
809
811
|
}
|
810
812
|
});
|
811
813
|
/* @conditional-compile-remove(video-background-effects) */
|
812
|
-
const onRemoveVideoBackgroundEffects = () => __awaiter$
|
814
|
+
const onRemoveVideoBackgroundEffects = () => __awaiter$I(void 0, void 0, void 0, function* () {
|
813
815
|
const stream = (call === null || call === void 0 ? void 0 : call.localVideoStreams.find((stream) => stream.mediaStreamType === 'Video')) ||
|
814
816
|
(deviceManager === null || deviceManager === void 0 ? void 0 : deviceManager.getUnparentedVideoStreams().find((stream) => stream.mediaStreamType === 'Video'));
|
815
817
|
if (stream) {
|
@@ -817,7 +819,7 @@ const createDefaultCommonCallingHandlers = memoizeOne__default['default']((callC
|
|
817
819
|
}
|
818
820
|
});
|
819
821
|
/* @conditional-compile-remove(video-background-effects) */
|
820
|
-
const onBlurVideoBackground = (backgroundBlurConfig) => __awaiter$
|
822
|
+
const onBlurVideoBackground = (backgroundBlurConfig) => __awaiter$I(void 0, void 0, void 0, function* () {
|
821
823
|
const stream = (call === null || call === void 0 ? void 0 : call.localVideoStreams.find((stream) => stream.mediaStreamType === 'Video')) ||
|
822
824
|
(deviceManager === null || deviceManager === void 0 ? void 0 : deviceManager.getUnparentedVideoStreams().find((stream) => stream.mediaStreamType === 'Video'));
|
823
825
|
if (stream) {
|
@@ -825,7 +827,7 @@ const createDefaultCommonCallingHandlers = memoizeOne__default['default']((callC
|
|
825
827
|
}
|
826
828
|
});
|
827
829
|
/* @conditional-compile-remove(video-background-effects) */
|
828
|
-
const onReplaceVideoBackground = (backgroundReplacementConfig) => __awaiter$
|
830
|
+
const onReplaceVideoBackground = (backgroundReplacementConfig) => __awaiter$I(void 0, void 0, void 0, function* () {
|
829
831
|
const stream = (call === null || call === void 0 ? void 0 : call.localVideoStreams.find((stream) => stream.mediaStreamType === 'Video')) ||
|
830
832
|
(deviceManager === null || deviceManager === void 0 ? void 0 : deviceManager.getUnparentedVideoStreams().find((stream) => stream.mediaStreamType === 'Video'));
|
831
833
|
if (stream) {
|
@@ -835,19 +837,19 @@ const createDefaultCommonCallingHandlers = memoizeOne__default['default']((callC
|
|
835
837
|
}
|
836
838
|
});
|
837
839
|
/* @conditional-compile-remove(close-captions) */
|
838
|
-
const onStartCaptions = (options) => __awaiter$
|
840
|
+
const onStartCaptions = (options) => __awaiter$I(void 0, void 0, void 0, function* () {
|
839
841
|
yield (call === null || call === void 0 ? void 0 : call.feature(communicationCalling.Features.TeamsCaptions).startCaptions(options));
|
840
842
|
});
|
841
843
|
/* @conditional-compile-remove(close-captions) */
|
842
|
-
const onStopCaptions = () => __awaiter$
|
844
|
+
const onStopCaptions = () => __awaiter$I(void 0, void 0, void 0, function* () {
|
843
845
|
yield (call === null || call === void 0 ? void 0 : call.feature(communicationCalling.Features.TeamsCaptions).stopCaptions());
|
844
846
|
});
|
845
847
|
/* @conditional-compile-remove(close-captions) */
|
846
|
-
const onSetSpokenLanguage = (language) => __awaiter$
|
848
|
+
const onSetSpokenLanguage = (language) => __awaiter$I(void 0, void 0, void 0, function* () {
|
847
849
|
yield (call === null || call === void 0 ? void 0 : call.feature(communicationCalling.Features.TeamsCaptions).setSpokenLanguage(language));
|
848
850
|
});
|
849
851
|
/* @conditional-compile-remove(close-captions) */
|
850
|
-
const onSetCaptionLanguage = (language) => __awaiter$
|
852
|
+
const onSetCaptionLanguage = (language) => __awaiter$I(void 0, void 0, void 0, function* () {
|
851
853
|
yield (call === null || call === void 0 ? void 0 : call.feature(communicationCalling.Features.TeamsCaptions).setCaptionLanguage(language));
|
852
854
|
});
|
853
855
|
return {
|
@@ -893,7 +895,7 @@ const createDefaultCommonCallingHandlers = memoizeOne__default['default']((callC
|
|
893
895
|
|
894
896
|
// Copyright (c) Microsoft Corporation.
|
895
897
|
// Licensed under the MIT license.
|
896
|
-
var __awaiter$
|
898
|
+
var __awaiter$H = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
|
897
899
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
898
900
|
return new (P || (P = Promise))(function (resolve, reject) {
|
899
901
|
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
@@ -918,7 +920,7 @@ const createDefaultCallingHandlers = memoizeOne__default['default']((callClient,
|
|
918
920
|
return callAgent === null || callAgent === void 0 ? void 0 : callAgent.startCall(participants, options);
|
919
921
|
},
|
920
922
|
/* @conditional-compile-remove(PSTN-calls) */
|
921
|
-
onAddParticipant: (userId, options) => __awaiter$
|
923
|
+
onAddParticipant: (userId, options) => __awaiter$H(void 0, void 0, void 0, function* () {
|
922
924
|
const participant = _toCommunicationIdentifier(userId);
|
923
925
|
if (communicationCommon.isPhoneNumberIdentifier(participant)) {
|
924
926
|
call === null || call === void 0 ? void 0 : call.addParticipant(participant, options);
|
@@ -926,7 +928,7 @@ const createDefaultCallingHandlers = memoizeOne__default['default']((callClient,
|
|
926
928
|
else if (communicationCommon.isCommunicationUserIdentifier(participant) || communicationCommon.isMicrosoftTeamsUserIdentifier(participant)) {
|
927
929
|
call === null || call === void 0 ? void 0 : call.addParticipant(participant);
|
928
930
|
}
|
929
|
-
}), onRemoveParticipant: (userId) => __awaiter$
|
931
|
+
}), onRemoveParticipant: (userId) => __awaiter$H(void 0, void 0, void 0, function* () {
|
930
932
|
const participant = _toCommunicationIdentifier(userId);
|
931
933
|
yield (call === null || call === void 0 ? void 0 : call.removeParticipant(participant));
|
932
934
|
}) });
|
@@ -934,7 +936,7 @@ const createDefaultCallingHandlers = memoizeOne__default['default']((callClient,
|
|
934
936
|
|
935
937
|
// Copyright (c) Microsoft Corporation.
|
936
938
|
// Licensed under the MIT license.
|
937
|
-
var __awaiter$
|
939
|
+
var __awaiter$G = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
|
938
940
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
939
941
|
return new (P || (P = Promise))(function (resolve, reject) {
|
940
942
|
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
@@ -966,7 +968,7 @@ const createDefaultTeamsCallingHandlers = memoizeOne__default['default']((callCl
|
|
966
968
|
},
|
967
969
|
/* @conditional-compile-remove(teams-identity-support) */
|
968
970
|
/* @conditional-compile-remove(PSTN-calls) */
|
969
|
-
onAddParticipant: (userId, options) => __awaiter$
|
971
|
+
onAddParticipant: (userId, options) => __awaiter$G(void 0, void 0, void 0, function* () {
|
970
972
|
const participant = _toCommunicationIdentifier(userId);
|
971
973
|
/* @conditional-compile-remove(teams-identity-support) */
|
972
974
|
const threadId = options === null || options === void 0 ? void 0 : options.threadId;
|
@@ -979,7 +981,7 @@ const createDefaultTeamsCallingHandlers = memoizeOne__default['default']((callCl
|
|
979
981
|
}
|
980
982
|
/* @conditional-compile-remove(teams-identity-support) */
|
981
983
|
call === null || call === void 0 ? void 0 : call.addParticipant(participant);
|
982
|
-
}), onRemoveParticipant: (userId) => __awaiter$
|
984
|
+
}), onRemoveParticipant: (userId) => __awaiter$G(void 0, void 0, void 0, function* () {
|
983
985
|
const participant = _toCommunicationIdentifier(userId);
|
984
986
|
if (communicationCommon.isCommunicationUserIdentifier(participant)) {
|
985
987
|
throw new Error('CommunicationIdentifier in Teams call is not supported!');
|
@@ -1041,7 +1043,7 @@ const _captionsBannerSelector = reselect__namespace.createSelector([getCaptions,
|
|
1041
1043
|
|
1042
1044
|
// Copyright (c) Microsoft Corporation.
|
1043
1045
|
// Licensed under the MIT license.
|
1044
|
-
var __awaiter$
|
1046
|
+
var __awaiter$F = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
|
1045
1047
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
1046
1048
|
return new (P || (P = Promise))(function (resolve, reject) {
|
1047
1049
|
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
@@ -1090,13 +1092,13 @@ class ProxyDeviceManager {
|
|
1090
1092
|
this.selectCamera = (videoDeviceInfo) => {
|
1091
1093
|
this._context.setDeviceManagerSelectedCamera(videoDeviceInfo);
|
1092
1094
|
};
|
1093
|
-
this.videoDevicesUpdated = () => __awaiter$
|
1095
|
+
this.videoDevicesUpdated = () => __awaiter$F(this, void 0, void 0, function* () {
|
1094
1096
|
// Device Manager always has a camera with '' name if there are no real camera devices available.
|
1095
1097
|
// We don't want to show that in the UI.
|
1096
1098
|
const realCameras = (yield this._deviceManager.getCameras()).filter((c) => !!c.name);
|
1097
1099
|
this._context.setDeviceManagerCameras(dedupeById(realCameras));
|
1098
1100
|
});
|
1099
|
-
this.audioDevicesUpdated = () => __awaiter$
|
1101
|
+
this.audioDevicesUpdated = () => __awaiter$F(this, void 0, void 0, function* () {
|
1100
1102
|
this._context.setDeviceManagerMicrophones(dedupeById(yield this._deviceManager.getMicrophones()));
|
1101
1103
|
this._context.setDeviceManagerSpeakers(dedupeById(yield this._deviceManager.getSpeakers()));
|
1102
1104
|
});
|
@@ -1462,7 +1464,7 @@ function convertFromSDKToCaptionInfoState(caption) {
|
|
1462
1464
|
|
1463
1465
|
// Copyright (c) Microsoft Corporation.
|
1464
1466
|
// Licensed under the MIT license.
|
1465
|
-
var __awaiter$
|
1467
|
+
var __awaiter$E = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
|
1466
1468
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
1467
1469
|
return new (P || (P = Promise))(function (resolve, reject) {
|
1468
1470
|
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
@@ -2125,7 +2127,7 @@ class CallContext$2 {
|
|
2125
2127
|
* @throws CallError. Exceptions thrown from `f` are tagged with the failed `target.
|
2126
2128
|
*/
|
2127
2129
|
withAsyncErrorTeedToState(action, target) {
|
2128
|
-
return (...args) => __awaiter$
|
2130
|
+
return (...args) => __awaiter$E(this, void 0, void 0, function* () {
|
2129
2131
|
try {
|
2130
2132
|
return yield action(...args);
|
2131
2133
|
}
|
@@ -2553,7 +2555,7 @@ function _logStreamEvent(eventName, streamLogInfo, error) {
|
|
2553
2555
|
|
2554
2556
|
// Copyright (c) Microsoft Corporation.
|
2555
2557
|
// Licensed under the MIT license.
|
2556
|
-
var __awaiter$
|
2558
|
+
var __awaiter$D = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
|
2557
2559
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
2558
2560
|
return new (P || (P = Promise))(function (resolve, reject) {
|
2559
2561
|
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
@@ -2563,7 +2565,7 @@ var __awaiter$B = (window && window.__awaiter) || function (thisArg, _arguments,
|
|
2563
2565
|
});
|
2564
2566
|
};
|
2565
2567
|
function createViewVideo(context, internalContext, callId, stream, participantId, options) {
|
2566
|
-
return __awaiter$
|
2568
|
+
return __awaiter$D(this, void 0, void 0, function* () {
|
2567
2569
|
// we can only have 3 types of createView
|
2568
2570
|
let streamEventType;
|
2569
2571
|
// we will reuse these for local as well but we need to make sure the remote stream is passed in like before.
|
@@ -2685,7 +2687,7 @@ function createViewVideo(context, internalContext, callId, stream, participantId
|
|
2685
2687
|
});
|
2686
2688
|
}
|
2687
2689
|
function createViewUnparentedVideo(context, internalContext, stream, options) {
|
2688
|
-
return __awaiter$
|
2690
|
+
return __awaiter$D(this, void 0, void 0, function* () {
|
2689
2691
|
const renderInfo = internalContext.getUnparentedRenderInfo(stream);
|
2690
2692
|
if (renderInfo && renderInfo.status === 'Rendered') {
|
2691
2693
|
console.warn('Unparented LocalVideoStream is already rendered');
|
@@ -2853,7 +2855,7 @@ function createView(context, internalContext, callId, participantId, stream, opt
|
|
2853
2855
|
// Render LocalVideoStream that is not part of a Call
|
2854
2856
|
// Because it is not part of the call we don't tee errors to state naturally (e.g. via a Call Client function such as startVideo).
|
2855
2857
|
// We do not have a startLocalPreviewVideo function, so as a workaround we ensure any errors are propagated here.
|
2856
|
-
return context.withAsyncErrorTeedToState(() => __awaiter$
|
2858
|
+
return context.withAsyncErrorTeedToState(() => __awaiter$D(this, void 0, void 0, function* () { return yield createViewUnparentedVideo(context, internalContext, stream, options); }), 'Call.startVideo')();
|
2857
2859
|
}
|
2858
2860
|
else {
|
2859
2861
|
_logStreamEvent(EventNames.CREATE_STREAM_INVALID_PARAMS, { streamType });
|
@@ -3302,7 +3304,7 @@ class CallSubscriber {
|
|
3302
3304
|
|
3303
3305
|
// Copyright (c) Microsoft Corporation.
|
3304
3306
|
// Licensed under the MIT license.
|
3305
|
-
var __awaiter$
|
3307
|
+
var __awaiter$C = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
|
3306
3308
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
3307
3309
|
return new (P || (P = Promise))(function (resolve, reject) {
|
3308
3310
|
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
@@ -3322,14 +3324,14 @@ class ProxyIncomingCall {
|
|
3322
3324
|
switch (prop) {
|
3323
3325
|
case 'accept': {
|
3324
3326
|
return this._context.withAsyncErrorTeedToState(function (...args) {
|
3325
|
-
return __awaiter$
|
3327
|
+
return __awaiter$C(this, void 0, void 0, function* () {
|
3326
3328
|
return yield target.accept(...args);
|
3327
3329
|
});
|
3328
3330
|
}, 'IncomingCall.accept');
|
3329
3331
|
}
|
3330
3332
|
case 'reject': {
|
3331
3333
|
return this._context.withAsyncErrorTeedToState(function (...args) {
|
3332
|
-
return __awaiter$
|
3334
|
+
return __awaiter$C(this, void 0, void 0, function* () {
|
3333
3335
|
return yield target.reject(...args);
|
3334
3336
|
});
|
3335
3337
|
}, 'IncomingCall.reject');
|
@@ -3566,7 +3568,7 @@ const clearCallRelatedState = (context, internalContext) => {
|
|
3566
3568
|
|
3567
3569
|
// Copyright (c) Microsoft Corporation.
|
3568
3570
|
// Licensed under the MIT license.
|
3569
|
-
var __awaiter$
|
3571
|
+
var __awaiter$B = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
|
3570
3572
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
3571
3573
|
return new (P || (P = Promise))(function (resolve, reject) {
|
3572
3574
|
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
@@ -3592,56 +3594,56 @@ class ProxyCallCommon {
|
|
3592
3594
|
switch (prop) {
|
3593
3595
|
case 'mute': {
|
3594
3596
|
return this._context.withAsyncErrorTeedToState(function (...args) {
|
3595
|
-
return __awaiter$
|
3597
|
+
return __awaiter$B(this, void 0, void 0, function* () {
|
3596
3598
|
return yield target.mute(...args);
|
3597
3599
|
});
|
3598
3600
|
}, 'Call.mute');
|
3599
3601
|
}
|
3600
3602
|
case 'unmute': {
|
3601
3603
|
return this._context.withAsyncErrorTeedToState(function (...args) {
|
3602
|
-
return __awaiter$
|
3604
|
+
return __awaiter$B(this, void 0, void 0, function* () {
|
3603
3605
|
return yield target.unmute(...args);
|
3604
3606
|
});
|
3605
3607
|
}, 'Call.unmute');
|
3606
3608
|
}
|
3607
3609
|
case 'startVideo': {
|
3608
3610
|
return this._context.withAsyncErrorTeedToState(function (...args) {
|
3609
|
-
return __awaiter$
|
3611
|
+
return __awaiter$B(this, void 0, void 0, function* () {
|
3610
3612
|
return yield target.startVideo(...args);
|
3611
3613
|
});
|
3612
3614
|
}, 'Call.startVideo');
|
3613
3615
|
}
|
3614
3616
|
case 'stopVideo': {
|
3615
3617
|
return this._context.withAsyncErrorTeedToState(function (...args) {
|
3616
|
-
return __awaiter$
|
3618
|
+
return __awaiter$B(this, void 0, void 0, function* () {
|
3617
3619
|
return yield target.stopVideo(...args);
|
3618
3620
|
});
|
3619
3621
|
}, 'Call.stopVideo');
|
3620
3622
|
}
|
3621
3623
|
case 'startScreenSharing': {
|
3622
3624
|
return this._context.withAsyncErrorTeedToState(function (...args) {
|
3623
|
-
return __awaiter$
|
3625
|
+
return __awaiter$B(this, void 0, void 0, function* () {
|
3624
3626
|
return yield target.startScreenSharing(...args);
|
3625
3627
|
});
|
3626
3628
|
}, 'Call.startScreenSharing');
|
3627
3629
|
}
|
3628
3630
|
case 'stopScreenSharing': {
|
3629
3631
|
return this._context.withAsyncErrorTeedToState(function (...args) {
|
3630
|
-
return __awaiter$
|
3632
|
+
return __awaiter$B(this, void 0, void 0, function* () {
|
3631
3633
|
return yield target.stopScreenSharing(...args);
|
3632
3634
|
});
|
3633
3635
|
}, 'Call.stopScreenSharing');
|
3634
3636
|
}
|
3635
3637
|
case 'hold': {
|
3636
3638
|
return this._context.withAsyncErrorTeedToState(function (...args) {
|
3637
|
-
return __awaiter$
|
3639
|
+
return __awaiter$B(this, void 0, void 0, function* () {
|
3638
3640
|
return yield target.hold(...args);
|
3639
3641
|
});
|
3640
3642
|
}, 'Call.hold');
|
3641
3643
|
}
|
3642
3644
|
case 'resume': {
|
3643
3645
|
return this._context.withAsyncErrorTeedToState(function (...args) {
|
3644
|
-
return __awaiter$
|
3646
|
+
return __awaiter$B(this, void 0, void 0, function* () {
|
3645
3647
|
return yield target.resume(...args);
|
3646
3648
|
});
|
3647
3649
|
}, 'Call.resume');
|
@@ -3675,7 +3677,7 @@ class ProxyTeamsCaptionsFeature {
|
|
3675
3677
|
get(target, prop) {
|
3676
3678
|
switch (prop) {
|
3677
3679
|
case 'startCaptions':
|
3678
|
-
return this._context.withAsyncErrorTeedToState((...args) => __awaiter$
|
3680
|
+
return this._context.withAsyncErrorTeedToState((...args) => __awaiter$B(this, void 0, void 0, function* () {
|
3679
3681
|
var _a, _b;
|
3680
3682
|
const ret = yield target.startCaptions(...args);
|
3681
3683
|
this._context.setIsCaptionActive(this._call.id, true);
|
@@ -3683,19 +3685,19 @@ class ProxyTeamsCaptionsFeature {
|
|
3683
3685
|
return ret;
|
3684
3686
|
}), 'Call.feature');
|
3685
3687
|
case 'stopCaptions':
|
3686
|
-
return this._context.withAsyncErrorTeedToState((...args) => __awaiter$
|
3688
|
+
return this._context.withAsyncErrorTeedToState((...args) => __awaiter$B(this, void 0, void 0, function* () {
|
3687
3689
|
const ret = yield target.stopCaptions(...args);
|
3688
3690
|
this._context.setIsCaptionActive(this._call.id, false);
|
3689
3691
|
return ret;
|
3690
3692
|
}), 'Call.feature');
|
3691
3693
|
case 'setSpokenLanguage':
|
3692
|
-
return this._context.withAsyncErrorTeedToState((...args) => __awaiter$
|
3694
|
+
return this._context.withAsyncErrorTeedToState((...args) => __awaiter$B(this, void 0, void 0, function* () {
|
3693
3695
|
const ret = yield target.setSpokenLanguage(...args);
|
3694
3696
|
this._context.setSelectedSpokenLanguage(this._call.id, args[0]);
|
3695
3697
|
return ret;
|
3696
3698
|
}), 'Call.feature');
|
3697
3699
|
case 'setCaptionLanguage':
|
3698
|
-
return this._context.withAsyncErrorTeedToState((...args) => __awaiter$
|
3700
|
+
return this._context.withAsyncErrorTeedToState((...args) => __awaiter$B(this, void 0, void 0, function* () {
|
3699
3701
|
const ret = yield target.setCaptionLanguage(...args);
|
3700
3702
|
this._context.setSelectedCaptionLanguage(this._call.id, args[0]);
|
3701
3703
|
return ret;
|
@@ -3708,7 +3710,7 @@ class ProxyTeamsCaptionsFeature {
|
|
3708
3710
|
|
3709
3711
|
// Copyright (c) Microsoft Corporation.
|
3710
3712
|
// Licensed under the MIT license.
|
3711
|
-
var __awaiter$
|
3713
|
+
var __awaiter$A = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
|
3712
3714
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
3713
3715
|
return new (P || (P = Promise))(function (resolve, reject) {
|
3714
3716
|
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
@@ -3722,7 +3724,7 @@ class ProxyCall extends ProxyCallCommon {
|
|
3722
3724
|
switch (prop) {
|
3723
3725
|
case 'addParticipant': {
|
3724
3726
|
return this.getContext().withAsyncErrorTeedToState(function (...args) {
|
3725
|
-
return __awaiter$
|
3727
|
+
return __awaiter$A(this, void 0, void 0, function* () {
|
3726
3728
|
return yield target.addParticipant(...args);
|
3727
3729
|
});
|
3728
3730
|
}, 'Call.addParticipant');
|
@@ -3943,7 +3945,7 @@ class InternalCallContext {
|
|
3943
3945
|
|
3944
3946
|
// Copyright (c) Microsoft Corporation.
|
3945
3947
|
// Licensed under the MIT license.
|
3946
|
-
var __awaiter$
|
3948
|
+
var __awaiter$z = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
|
3947
3949
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
3948
3950
|
return new (P || (P = Promise))(function (resolve, reject) {
|
3949
3951
|
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
@@ -3958,7 +3960,7 @@ class ProxyTeamsCall extends ProxyCallCommon {
|
|
3958
3960
|
switch (prop) {
|
3959
3961
|
case 'addParticipant': {
|
3960
3962
|
return this.getContext().withAsyncErrorTeedToState(function (...args) {
|
3961
|
-
return __awaiter$
|
3963
|
+
return __awaiter$z(this, void 0, void 0, function* () {
|
3962
3964
|
return yield target.addParticipant(...args);
|
3963
3965
|
});
|
3964
3966
|
}, 'TeamsCall.addParticipant');
|
@@ -4073,7 +4075,7 @@ const teamsCallAgentDeclaratify = (callAgent, context, internalContext) => {
|
|
4073
4075
|
|
4074
4076
|
// Copyright (c) Microsoft Corporation.
|
4075
4077
|
// Licensed under the MIT license.
|
4076
|
-
var __awaiter$
|
4078
|
+
var __awaiter$y = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
|
4077
4079
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
4078
4080
|
return new (P || (P = Promise))(function (resolve, reject) {
|
4079
4081
|
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
@@ -4095,7 +4097,7 @@ class ProxyVideoStreamRendererView {
|
|
4095
4097
|
get(target, prop) {
|
4096
4098
|
switch (prop) {
|
4097
4099
|
case 'updateScalingMode': {
|
4098
|
-
return (...args) => __awaiter$
|
4100
|
+
return (...args) => __awaiter$y(this, void 0, void 0, function* () {
|
4099
4101
|
yield target.updateScalingMode(...args);
|
4100
4102
|
this._context.setRemoteVideoStreamViewScalingMode(this._callId, this._participantId, this._streamId, args[0]);
|
4101
4103
|
});
|
@@ -4116,7 +4118,7 @@ const videoStreamRendererViewDeclaratify = (view, context, callId, participantId
|
|
4116
4118
|
|
4117
4119
|
// Copyright (c) Microsoft Corporation.
|
4118
4120
|
// Licensed under the MIT license.
|
4119
|
-
var __awaiter$
|
4121
|
+
var __awaiter$x = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
|
4120
4122
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
4121
4123
|
return new (P || (P = Promise))(function (resolve, reject) {
|
4122
4124
|
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
@@ -4138,7 +4140,7 @@ class ProxyCallClient {
|
|
4138
4140
|
get(target, prop) {
|
4139
4141
|
switch (prop) {
|
4140
4142
|
case 'createCallAgent': {
|
4141
|
-
return this._context.withAsyncErrorTeedToState((...args) => __awaiter$
|
4143
|
+
return this._context.withAsyncErrorTeedToState((...args) => __awaiter$x(this, void 0, void 0, function* () {
|
4142
4144
|
// createCallAgent will throw an exception if the previous callAgent was not disposed. If the previous
|
4143
4145
|
// callAgent was disposed then it would have unsubscribed to events so we can just create a new declarative
|
4144
4146
|
// callAgent if the createCallAgent succeeds.
|
@@ -4151,7 +4153,7 @@ class ProxyCallClient {
|
|
4151
4153
|
}), 'CallClient.createCallAgent');
|
4152
4154
|
}
|
4153
4155
|
case 'createTeamsCallAgent': {
|
4154
|
-
/* @conditional-compile-remove(teams-identity-support) */ return this._context.withAsyncErrorTeedToState((...args) => __awaiter$
|
4156
|
+
/* @conditional-compile-remove(teams-identity-support) */ return this._context.withAsyncErrorTeedToState((...args) => __awaiter$x(this, void 0, void 0, function* () {
|
4155
4157
|
// createCallAgent will throw an exception if the previous callAgent was not disposed. If the previous
|
4156
4158
|
// callAgent was disposed then it would have unsubscribed to events so we can just create a new declarative
|
4157
4159
|
// callAgent if the createCallAgent succeeds.
|
@@ -4164,7 +4166,7 @@ class ProxyCallClient {
|
|
4164
4166
|
}), 'CallClient.createTeamsCallAgent');
|
4165
4167
|
}
|
4166
4168
|
case 'getDeviceManager': {
|
4167
|
-
return this._context.withAsyncErrorTeedToState(() => __awaiter$
|
4169
|
+
return this._context.withAsyncErrorTeedToState(() => __awaiter$x(this, void 0, void 0, function* () {
|
4168
4170
|
// As of writing, the SDK always returns the same instance of DeviceManager so we keep a reference of
|
4169
4171
|
// DeviceManager and if it does not change we return the cached DeclarativeDeviceManager. If it does not we'll
|
4170
4172
|
// throw an error that indicate we need to fix this issue as our implementation has diverged from the SDK.
|
@@ -4193,7 +4195,7 @@ class ProxyCallClient {
|
|
4193
4195
|
/**
|
4194
4196
|
* add to this object if we want to proxy anything else off the DebugInfo feature object.
|
4195
4197
|
*/
|
4196
|
-
return Object.assign(Object.assign({}, feature), { getEnvironmentInfo: () => __awaiter$
|
4198
|
+
return Object.assign(Object.assign({}, feature), { getEnvironmentInfo: () => __awaiter$x(this, void 0, void 0, function* () {
|
4197
4199
|
const environmentInfo = yield feature.getEnvironmentInfo();
|
4198
4200
|
this._context.setEnvironmentInfo(environmentInfo);
|
4199
4201
|
return environmentInfo;
|
@@ -4246,7 +4248,7 @@ const createStatefulCallClientWithDeps = (callClient, context, internalContext)
|
|
4246
4248
|
});
|
4247
4249
|
Object.defineProperty(callClient, 'createView', {
|
4248
4250
|
configurable: false,
|
4249
|
-
value: (callId, participantId, stream, options) => __awaiter$
|
4251
|
+
value: (callId, participantId, stream, options) => __awaiter$x(void 0, void 0, void 0, function* () {
|
4250
4252
|
const participantIdKind = participantId ? communicationCommon.getIdentifierKind(participantId) : undefined;
|
4251
4253
|
const result = yield createView(context, internalContext, callId, participantIdKind, stream, options);
|
4252
4254
|
// We only need to declaratify the VideoStreamRendererView object for remote participants. Because the updateScalingMode only needs to be called on remote participant stream views.
|
@@ -4475,7 +4477,7 @@ const typingIndicatorStringStyle = react.mergeStyles({
|
|
4475
4477
|
wordBreak: 'break-word'
|
4476
4478
|
});
|
4477
4479
|
|
4478
|
-
var participantItem$d={isMeText:"(you)",menuTitle:"More Options",removeButtonLabel:"Remove",sharingIconLabel:"Sharing",mutedIconLabel:"Muted",displayNamePlaceholder:"Unnamed participant",participantStateRinging:"Calling...",participantStateHold:"On hold"};var typingIndicator$d={singleUser:"{user} is typing ...",multipleUsers:"{users} are typing ...",multipleUsersAbbreviateOne:"{users} and 1 other are typing ...",multipleUsersAbbreviateMany:"{users} and {numOthers} others are typing ...",delimiter:", "};var sendBox$d={placeholderText:"Enter a message",textTooLong:"Your message length is over the maximum limit.",sendButtonAriaLabel:"Send message",fileUploadsPendingError:"Uploading... Please wait.",removeFile:"Remove file",uploading:"Uploading",uploadCompleted:"Upload completed"};var messageStatusIndicator$d={deliveredAriaLabel:"Message sent",deliveredTooltipText:"Sent",seenAriaLabel:"Message seen by others",seenTooltipText:"Seen",readByTooltipText:"Read by {messageThreadReadCount} of {remoteParticipantsCount}",sendingAriaLabel:"Message sending",sendingTooltipText:"Sending",failedToSendAriaLabel:"Message failed to send",failedToSendTooltipText:"Failed to send"};var endCallButton$d={label:"Leave",tooltipContent:"Leave call"};var cameraButton$d={onLabel:"Turn off",offLabel:"Turn on",tooltipDisabledContent:"Camera is disabled",tooltipOnContent:"Turn off camera",tooltipOffContent:"Turn on camera",tooltipVideoLoadingContent:"Video is loading",cameraMenuTitle:"Camera",cameraMenuTooltip:"Choose camera",cameraButtonSplitRoleDescription:"Split button",onSplitButtonAriaLabel:"Turn off camera and camera options",offSplitButtonAriaLabel:"Turn on camera and camera options",cameraActionTurnedOnAnnouncement:"Your camera has been turned on",cameraActionTurnedOffAnnouncement:"Your camera has been turned off",onSplitButtonPrimaryActionCamera:"Turn off camera",offSplitButtonPrimaryActionCamera:"Turn on camera",cameraPrimaryActionSplitButtonTitle:"Use camera"};var microphoneButton$d={onLabel:"Mute",offLabel:"Unmute",tooltipDisabledContent:"Microphone is disabled",tooltipOnContent:"Mute microphone",tooltipOffContent:"Unmute microphone",microphoneMenuTitle:"Microphone",microphoneMenuTooltip:"Choose microphone",speakerMenuTitle:"Speaker",speakerMenuTooltip:"Choose speaker",microphoneButtonSplitRoleDescription:"Split button",onSplitButtonAriaLabel:"Mute microphone and audio options",offSplitButtonAriaLabel:"Unmute microphone and audio options",microphoneActionTurnedOnAnnouncement:"Your microphone has been turned on",microphoneActionTurnedOffAnnouncement:"Your microphone has been turned off",offSplitButtonMicrophonePrimaryAction:"Unmute microphone",onSplitButtonMicrophonePrimaryAction:"Mute microphone",micPrimaryActionSplitButtonTitle:"Use microphone"};var devicesButton$d={label:"Devices",tooltipContent:"Manage devices",cameraMenuTitle:"Camera",cameraMenuTooltip:"Choose camera",audioDeviceMenuTitle:"Audio Device",audioDeviceMenuTooltip:"Choose audio device",microphoneMenuTitle:"Microphone",microphoneMenuTooltip:"Choose microphone",speakerMenuTitle:"Speaker",speakerMenuTooltip:"Choose speaker"};var participantsButton$d={label:"People",tooltipContent:"Show participants",menuHeader:"In this call",participantsListButtonLabel:"{numParticipants} people",muteAllButtonLabel:"Mute all",copyInviteLinkButtonLabel:"Copy invite link",copyInviteLinkActionedAriaLabel:"Invite link copied"};var screenShareButton$d={onLabel:"Stop presenting",offLabel:"Present",tooltipDisabledContent:"Presenting is disabled",tooltipOnContent:"Presenting your screen",tooltipOffContent:"Present your screen"};var messageThread$d={yesterday:"Yesterday",sunday:"Sunday",monday:"Monday",tuesday:"Tuesday",wednesday:"Wednesday",thursday:"Thursday",friday:"Friday",saturday:"Saturday",participantJoined:"joined the chat.",participantLeft:"left the chat.",editMessage:"Edit",removeMessage:"Delete",resendMessage:"Try sending again",failToSendTag:"Failed to send",editedTag:"Edited",liveAuthorIntro:"{author} says",messageContentAriaText:"{author} said {message}",messageContentMineAriaText:"You said {message}",editBoxTextLimit:"Your message is over the limit of {limitNumber} characters",editBoxPlaceholderText:"Edit your message",newMessagesIndicator:"New messages",noDisplayNameSub:"No name",editBoxCancelButton:"Cancel",editBoxSubmitButton:"Submit",messageReadCount:"Read by {messageReadByCount} of {remoteParticipantsCount}",actionMenuMoreOptions:"More Options",downloadFile:"Download file",blockedWarningText:"This message was deleted due to organizational policy.",blockedWarningLinkText:"Details"};var errorBar$d={unableToReachChatService:"You are offline",accessDenied:"Unable to access chat services - please check the user credentials provided",userNotInChatThread:"You are no longer in this chat thread",sendMessageNotInChatThread:"Failed to send message because you are no longer in this chat thread",sendMessageGeneric:"Failed to send message",callingNetworkFailure:"Troubling connecting call - you seem to be offline",startVideoGeneric:"Failed to start video",stopVideoGeneric:"Failed to stop video",muteGeneric:"Failed to mute microphone",unmuteGeneric:"Failed to unmute microphone",speakingWhileMuted:"Your microphone is muted",startScreenShareGeneric:"Failed to start screen sharing",stopScreenShareGeneric:"Failed to stop screen sharing",callNetworkQualityLow:"Network quality is low.",callNoSpeakerFound:"No speakers or headphones found. Connect an audio device to hear the call.",callNoMicrophoneFound:"No microphones found. Connect an audio input device.",callMicrophoneAccessDenied:"Unable to access microphone. Click the lock in the address bar to grant permission to this webpage.",callMicrophoneAccessDeniedSafari:"Unable to access microphone. Refresh the page to allow permissions, or check this browser’s settings and verify permissions are enabled for this website.",callMicrophoneMutedBySystem:"You are muted by your system.",callMicrophoneUnmutedBySystem:"Your microphone recovered and you were unmuted by your system.",callMacOsMicrophoneAccessDenied:"Unable to access microphone. Grant microphone permission in your macOS privacy settings.",callLocalVideoFreeze:"Network bandwidth is poor. Your video may appear paused for others on the call.",callCameraAccessDenied:"Unable to access camera. Click the lock in the address bar to grant permission to this webpage.",callCameraAccessDeniedSafari:"Unable to access camera. Refresh the page to allow permissions, or check this browser’s settings and verify permissions are enabled for this website.",callCameraAlreadyInUse:"Unable to access camera. It may already be in use by another application.",callVideoStoppedBySystem:"Your video has been stopped by your system.",callVideoRecoveredBySystem:"Your video has resumed.",callMacOsCameraAccessDenied:"MacOS is blocking access to your camera. Update your privacy settings to allow this browser to access your camera.",callMacOsScreenShareAccessDenied:"MacOS is blocking screen sharing. Update your privacy settings to allow this browser to record your screen.",dismissButtonAriaLabel:"Close",failedToJoinCallGeneric:"Failed to join call.",failedToJoinCallInvalidMeetingLink:"Unable to join Meeting. Invalid Link.",startScreenSharingGeneric:"There was an issue starting screen share.",cameraFrozenForRemoteParticipants:"Users in the call are having issues seeing your video. Please check your devices and network.",unableToStartVideoEffect:"Unable to apply video effect."};var videoGallery$d={screenIsBeingSharedMessage:"You are sharing your screen",screenShareLoadingMessage:"Loading {participant}'s screen",localVideoLabel:"You",localVideoCameraSwitcherLabel:"Switch camera",localVideoMovementLabel:"Movable Local Video Tile",localVideoSelectedDescription:"{cameraName} selected",displayNamePlaceholder:"Unnamed participant",fitRemoteParticipantToFrame:"Fit to frame",fillRemoteParticipantFrame:"Fill frame",pinParticipantForMe:"Pin for me",pinParticipantForMeLimitReached:"Pin (limit reached)",unpinParticipantForMe:"Unpin",pinParticipantMenuItemAriaLabel:"Pin {participantName}",unpinParticipantMenuItemAriaLabel:"Unpin {participantName}",pinnedParticipantAnnouncementAriaLabel:"Pinned {participantName}",unpinnedParticipantAnnouncementAriaLabel:"Unpinned {participantName}"};var dialpad$d={placeholderText:"Enter phone number",deleteButtonAriaLabel:"Delete"};var holdButton$d={onLabel:"Resume",offLabel:"Hold",tooltipOnContent:"Resume call",tooltipOffContent:"Hold call"};var videoTile$d={participantStateRinging:"Calling...",participantStateHold:"On hold"};var CameraAndMicrophoneSitePermissionsRequest$d={primaryText:"Allow {appName} to use your camera and microphone",secondaryText:"This is so participants can see and hear you.",linkText:"Need help? Get troubleshooting help",primaryButtonText:"Continue without camera and microphone",ariaLabel:"Allow camera and microphone access"};var CameraSitePermissionsRequest$d={primaryText:"Allow {appName} to use your camera",secondaryText:"This is so participants can see you.",linkText:"Need help? Get troubleshooting help",primaryButtonText:"Continue without camera",ariaLabel:"Allow camera access"};var MicrophoneSitePermissionsRequest$d={primaryText:"Allow {appName} to use your microphone",secondaryText:"This is so participants can hear you.",linkText:"Need help? Get troubleshooting help",primaryButtonText:"Continue without microphone",ariaLabel:"Allow microphone access"};var CameraAndMicrophoneSitePermissionsCheck$d={primaryText:"Checking for camera and microphone access",secondaryText:"Allow access if prompted. This is so participants can see and hear you.",linkText:"Need help? Get troubleshooting help",primaryButtonText:"Continue without camera and microphone",ariaLabel:"Checking for camera and microphone access. Allow access if prompted."};var CameraSitePermissionsCheck$d={primaryText:"Checking for camera access",secondaryText:"Allow access if prompted. This is so participants can see you.",linkText:"Need help? Get troubleshooting help",primaryButtonText:"Continue without camera",ariaLabel:"Checking for camera access. Allow access if prompted."};var MicrophoneSitePermissionsCheck$d={primaryText:"Checking for microphone access",secondaryText:"Allow access if prompted. This is so participants can hear you.",linkText:"Need help? Get troubleshooting help",primaryButtonText:"Continue without microphone",ariaLabel:"Checking for microphone access. Allow access if prompted."};var CameraAndMicrophoneSitePermissionsDenied$d={primaryText:"Unable to access camera and microphone",secondaryText:"Click the lock icon in the address bar to grant microphone permissions to this webpage. A page refresh may be required.",primaryButtonText:"Continue without camera and microphone",linkText:"Need help? Get troubleshooting help"};var CameraAndMicrophoneSitePermissionsDeniedSafari$d={primaryText:"Unable to access camera and microphone",secondaryText:"Refresh the page to allow permissions, or check this browser’s settings and verify permissions are enabled for this website.",primaryButtonText:"Continue without camera and microphone",linkText:"Need help? Get troubleshooting help"};var CameraSitePermissionsDenied$d={primaryText:"Unable to access camera",secondaryText:"Click the lock icon in the address bar to grant camera permissions to this webpage. A page refresh may be required.",primaryButtonText:"Continue without camera",linkText:"Need help? Get troubleshooting help"};var MicrophoneSitePermissionsDenied$d={primaryText:"Unable to access microphone",secondaryText:"Click the lock icon in the address bar to grant microphone permissions to this webpage. A page refresh may be required.",primaryButtonText:"Continue without microphone",linkText:"Need help? Get troubleshooting help"};var CameraSitePermissionsDeniedSafari$d={primaryText:"Unable to access camera",secondaryText:"Refresh the page to allow permissions, or check this browser’s settings and verify permissions are enabled for this website.",primaryButtonText:"Continue without camera",linkText:"Need help? Get troubleshooting help"};var MicrophoneSitePermissionsDeniedSafari$d={primaryText:"Unable to access microphone",secondaryText:"Refresh the page to allow permissions, or check this browser’s settings and verify permissions are enabled for this website.",primaryButtonText:"Continue without microphone",linkText:"Need help? Get troubleshooting help"};var UnsupportedBrowser$e={primaryText:"Browser not supported",secondaryText:"Please join this call using a compatible browser.",moreHelpLinkText:"See compatibility requirements"};var UnsupportedBrowserVersion$e={primaryText:"Browser update needed",secondaryText:"To ensure the best call possible, please update your browser and then try joining the call again.",moreHelpLinkText:"See compatibility requirements",continueAnywayButtonText:"Start call without updating"};var UnsupportedOperatingSystem$e={primaryText:"Operating system not supported",secondaryText:"Please join this call using a device with a compatible operating system.",moreHelpLinkText:"See compatibility requirements"};var BrowserPermissionDenied$d={primaryText:"Can't use your camera or microphone",secondaryText:"Your browser might not have access to your camera or microphone. To fix this, open System Preferences.",primaryButtonText:"Try again",linkText:"Need help? Get troubleshooting help"};var BrowserPermissionDeniedIOS$d={primaryText:"Allow microphone access to continue",secondaryText:"So other participants can hear you.",primaryButtonText:"Try again",imageAltText:"Microphone and camera device permission location for iOS",linkText:"Need help? Get troubleshooting help",step1Text:"Go to the Settings app",step2Text:"Scroll down to settings for this browser",step3Text:"Turn on Microphone (Camera optional)",step4Text:"Try joining the call again",step1DigitText:"1",step2DigitText:"2",step3DigitText:"3",step4DigitText:"4"};var VerticalGallery$e={leftNavButtonAriaLabel:"previous page",rightNavButtonAriaLabel:"next page"};var en_US$1 = {participantItem:participantItem$d,typingIndicator:typingIndicator$d,sendBox:sendBox$d,messageStatusIndicator:messageStatusIndicator$d,endCallButton:endCallButton$d,cameraButton:cameraButton$d,microphoneButton:microphoneButton$d,devicesButton:devicesButton$d,participantsButton:participantsButton$d,screenShareButton:screenShareButton$d,messageThread:messageThread$d,errorBar:errorBar$d,videoGallery:videoGallery$d,dialpad:dialpad$d,holdButton:holdButton$d,videoTile:videoTile$d,CameraAndMicrophoneSitePermissionsRequest:CameraAndMicrophoneSitePermissionsRequest$d,CameraSitePermissionsRequest:CameraSitePermissionsRequest$d,MicrophoneSitePermissionsRequest:MicrophoneSitePermissionsRequest$d,CameraAndMicrophoneSitePermissionsCheck:CameraAndMicrophoneSitePermissionsCheck$d,CameraSitePermissionsCheck:CameraSitePermissionsCheck$d,MicrophoneSitePermissionsCheck:MicrophoneSitePermissionsCheck$d,CameraAndMicrophoneSitePermissionsDenied:CameraAndMicrophoneSitePermissionsDenied$d,CameraAndMicrophoneSitePermissionsDeniedSafari:CameraAndMicrophoneSitePermissionsDeniedSafari$d,CameraSitePermissionsDenied:CameraSitePermissionsDenied$d,MicrophoneSitePermissionsDenied:MicrophoneSitePermissionsDenied$d,CameraSitePermissionsDeniedSafari:CameraSitePermissionsDeniedSafari$d,MicrophoneSitePermissionsDeniedSafari:MicrophoneSitePermissionsDeniedSafari$d,UnsupportedBrowser:UnsupportedBrowser$e,UnsupportedBrowserVersion:UnsupportedBrowserVersion$e,UnsupportedOperatingSystem:UnsupportedOperatingSystem$e,BrowserPermissionDenied:BrowserPermissionDenied$d,BrowserPermissionDeniedIOS:BrowserPermissionDeniedIOS$d,VerticalGallery:VerticalGallery$e};
|
4480
|
+
var participantItem$d={isMeText:"(you)",menuTitle:"More Options",removeButtonLabel:"Remove",sharingIconLabel:"Sharing",mutedIconLabel:"Muted",displayNamePlaceholder:"Unnamed participant",participantStateRinging:"Calling...",participantStateHold:"On hold"};var typingIndicator$d={singleUser:"{user} is typing ...",multipleUsers:"{users} are typing ...",multipleUsersAbbreviateOne:"{users} and 1 other are typing ...",multipleUsersAbbreviateMany:"{users} and {numOthers} others are typing ...",delimiter:", "};var sendBox$d={placeholderText:"Enter a message",textTooLong:"Your message length is over the maximum limit.",sendButtonAriaLabel:"Send message",fileUploadsPendingError:"Uploading... Please wait.",removeFile:"Remove file",uploading:"Uploading",uploadCompleted:"Upload completed"};var mentionPopover={mentionPopoverHeader:"Suggestions"};var messageStatusIndicator$d={deliveredAriaLabel:"Message sent",deliveredTooltipText:"Sent",seenAriaLabel:"Message seen by others",seenTooltipText:"Seen",readByTooltipText:"Read by {messageThreadReadCount} of {remoteParticipantsCount}",sendingAriaLabel:"Message sending",sendingTooltipText:"Sending",failedToSendAriaLabel:"Message failed to send",failedToSendTooltipText:"Failed to send"};var endCallButton$d={label:"Leave",tooltipContent:"Leave call"};var cameraButton$d={onLabel:"Turn off",offLabel:"Turn on",tooltipDisabledContent:"Camera is disabled",tooltipOnContent:"Turn off camera",tooltipOffContent:"Turn on camera",tooltipVideoLoadingContent:"Video is loading",cameraMenuTitle:"Camera",cameraMenuTooltip:"Choose camera",cameraButtonSplitRoleDescription:"Split button",onSplitButtonAriaLabel:"Turn off camera and camera options",offSplitButtonAriaLabel:"Turn on camera and camera options",cameraActionTurnedOnAnnouncement:"Your camera has been turned on",cameraActionTurnedOffAnnouncement:"Your camera has been turned off",onSplitButtonPrimaryActionCamera:"Turn off camera",offSplitButtonPrimaryActionCamera:"Turn on camera",cameraPrimaryActionSplitButtonTitle:"Use camera"};var microphoneButton$d={onLabel:"Mute",offLabel:"Unmute",tooltipDisabledContent:"Microphone is disabled",tooltipOnContent:"Mute microphone",tooltipOffContent:"Unmute microphone",microphoneMenuTitle:"Microphone",microphoneMenuTooltip:"Choose microphone",speakerMenuTitle:"Speaker",speakerMenuTooltip:"Choose speaker",microphoneButtonSplitRoleDescription:"Split button",onSplitButtonAriaLabel:"Mute microphone and audio options",offSplitButtonAriaLabel:"Unmute microphone and audio options",microphoneActionTurnedOnAnnouncement:"Your microphone has been turned on",microphoneActionTurnedOffAnnouncement:"Your microphone has been turned off",offSplitButtonMicrophonePrimaryAction:"Unmute microphone",onSplitButtonMicrophonePrimaryAction:"Mute microphone",micPrimaryActionSplitButtonTitle:"Use microphone"};var devicesButton$d={label:"Devices",tooltipContent:"Manage devices",cameraMenuTitle:"Camera",cameraMenuTooltip:"Choose camera",audioDeviceMenuTitle:"Audio Device",audioDeviceMenuTooltip:"Choose audio device",microphoneMenuTitle:"Microphone",microphoneMenuTooltip:"Choose microphone",speakerMenuTitle:"Speaker",speakerMenuTooltip:"Choose speaker"};var participantsButton$d={label:"People",tooltipContent:"Show participants",menuHeader:"In this call",participantsListButtonLabel:"{numParticipants} people",muteAllButtonLabel:"Mute all",copyInviteLinkButtonLabel:"Copy invite link",copyInviteLinkActionedAriaLabel:"Invite link copied"};var screenShareButton$d={onLabel:"Stop presenting",offLabel:"Present",tooltipDisabledContent:"Presenting is disabled",tooltipOnContent:"Presenting your screen",tooltipOffContent:"Present your screen"};var messageThread$d={yesterday:"Yesterday",sunday:"Sunday",monday:"Monday",tuesday:"Tuesday",wednesday:"Wednesday",thursday:"Thursday",friday:"Friday",saturday:"Saturday",participantJoined:"joined the chat.",participantLeft:"left the chat.",editMessage:"Edit",removeMessage:"Delete",resendMessage:"Try sending again",failToSendTag:"Failed to send",editedTag:"Edited",liveAuthorIntro:"{author} says",messageContentAriaText:"{author} said {message}",messageContentMineAriaText:"You said {message}",editBoxTextLimit:"Your message is over the limit of {limitNumber} characters",editBoxPlaceholderText:"Edit your message",newMessagesIndicator:"New messages",noDisplayNameSub:"No name",editBoxCancelButton:"Cancel",editBoxSubmitButton:"Submit",messageReadCount:"Read by {messageReadByCount} of {remoteParticipantsCount}",actionMenuMoreOptions:"More Options",downloadFile:"Download file",blockedWarningText:"This message was deleted due to organizational policy.",blockedWarningLinkText:"Details"};var errorBar$d={unableToReachChatService:"You are offline",accessDenied:"Unable to access chat services - please check the user credentials provided",userNotInChatThread:"You are no longer in this chat thread",sendMessageNotInChatThread:"Failed to send message because you are no longer in this chat thread",sendMessageGeneric:"Failed to send message",callingNetworkFailure:"Troubling connecting call - you seem to be offline",startVideoGeneric:"Failed to start video",stopVideoGeneric:"Failed to stop video",muteGeneric:"Failed to mute microphone",unmuteGeneric:"Failed to unmute microphone",speakingWhileMuted:"Your microphone is muted",startScreenShareGeneric:"Failed to start screen sharing",stopScreenShareGeneric:"Failed to stop screen sharing",callNetworkQualityLow:"Network quality is low.",callNoSpeakerFound:"No speakers or headphones found. Connect an audio device to hear the call.",callNoMicrophoneFound:"No microphones found. Connect an audio input device.",callMicrophoneAccessDenied:"Unable to access microphone. Click the lock in the address bar to grant permission to this webpage.",callMicrophoneAccessDeniedSafari:"Unable to access microphone. Refresh the page to allow permissions, or check this browser’s settings and verify permissions are enabled for this website.",callMicrophoneMutedBySystem:"You are muted by your system.",callMicrophoneUnmutedBySystem:"Your microphone recovered and you were unmuted by your system.",callMacOsMicrophoneAccessDenied:"Unable to access microphone. Grant microphone permission in your macOS privacy settings.",callLocalVideoFreeze:"Network bandwidth is poor. Your video may appear paused for others on the call.",callCameraAccessDenied:"Unable to access camera. Click the lock in the address bar to grant permission to this webpage.",callCameraAccessDeniedSafari:"Unable to access camera. Refresh the page to allow permissions, or check this browser’s settings and verify permissions are enabled for this website.",callCameraAlreadyInUse:"Unable to access camera. It may already be in use by another application.",callVideoStoppedBySystem:"Your video has been stopped by your system.",callVideoRecoveredBySystem:"Your video has resumed.",callMacOsCameraAccessDenied:"MacOS is blocking access to your camera. Update your privacy settings to allow this browser to access your camera.",callMacOsScreenShareAccessDenied:"MacOS is blocking screen sharing. Update your privacy settings to allow this browser to record your screen.",dismissButtonAriaLabel:"Close",failedToJoinCallGeneric:"Failed to join call.",failedToJoinCallInvalidMeetingLink:"Unable to join Meeting. Invalid Link.",startScreenSharingGeneric:"There was an issue starting screen share.",cameraFrozenForRemoteParticipants:"Users in the call are having issues seeing your video. Please check your devices and network.",unableToStartVideoEffect:"Unable to apply video effect."};var videoGallery$d={screenIsBeingSharedMessage:"You are sharing your screen",screenShareLoadingMessage:"Loading {participant}'s screen",localVideoLabel:"You",localVideoCameraSwitcherLabel:"Switch camera",localVideoMovementLabel:"Movable Local Video Tile",localVideoSelectedDescription:"{cameraName} selected",displayNamePlaceholder:"Unnamed participant",fitRemoteParticipantToFrame:"Fit to frame",fillRemoteParticipantFrame:"Fill frame",pinParticipantForMe:"Pin for me",pinParticipantForMeLimitReached:"Pin (limit reached)",unpinParticipantForMe:"Unpin",pinParticipantMenuItemAriaLabel:"Pin {participantName}",unpinParticipantMenuItemAriaLabel:"Unpin {participantName}",pinnedParticipantAnnouncementAriaLabel:"Pinned {participantName}",unpinnedParticipantAnnouncementAriaLabel:"Unpinned {participantName}"};var dialpad$d={placeholderText:"Enter phone number",deleteButtonAriaLabel:"Delete"};var holdButton$d={onLabel:"Resume",offLabel:"Hold",tooltipOnContent:"Resume call",tooltipOffContent:"Hold call"};var videoTile$d={participantStateRinging:"Calling...",participantStateHold:"On hold"};var CameraAndMicrophoneSitePermissionsRequest$d={primaryText:"Allow {appName} to use your camera and microphone",secondaryText:"This is so participants can see and hear you.",linkText:"Need help? Get troubleshooting help",primaryButtonText:"Continue without camera and microphone",ariaLabel:"Allow camera and microphone access"};var CameraSitePermissionsRequest$d={primaryText:"Allow {appName} to use your camera",secondaryText:"This is so participants can see you.",linkText:"Need help? Get troubleshooting help",primaryButtonText:"Continue without camera",ariaLabel:"Allow camera access"};var MicrophoneSitePermissionsRequest$d={primaryText:"Allow {appName} to use your microphone",secondaryText:"This is so participants can hear you.",linkText:"Need help? Get troubleshooting help",primaryButtonText:"Continue without microphone",ariaLabel:"Allow microphone access"};var CameraAndMicrophoneSitePermissionsCheck$d={primaryText:"Checking for camera and microphone access",secondaryText:"Allow access if prompted. This is so participants can see and hear you.",linkText:"Need help? Get troubleshooting help",primaryButtonText:"Continue without camera and microphone",ariaLabel:"Checking for camera and microphone access. Allow access if prompted."};var CameraSitePermissionsCheck$d={primaryText:"Checking for camera access",secondaryText:"Allow access if prompted. This is so participants can see you.",linkText:"Need help? Get troubleshooting help",primaryButtonText:"Continue without camera",ariaLabel:"Checking for camera access. Allow access if prompted."};var MicrophoneSitePermissionsCheck$d={primaryText:"Checking for microphone access",secondaryText:"Allow access if prompted. This is so participants can hear you.",linkText:"Need help? Get troubleshooting help",primaryButtonText:"Continue without microphone",ariaLabel:"Checking for microphone access. Allow access if prompted."};var CameraAndMicrophoneSitePermissionsDenied$d={primaryText:"Unable to access camera and microphone",secondaryText:"Click the lock icon in the address bar to grant microphone permissions to this webpage. A page refresh may be required.",primaryButtonText:"Continue without camera and microphone",linkText:"Need help? Get troubleshooting help"};var CameraAndMicrophoneSitePermissionsDeniedSafari$d={primaryText:"Unable to access camera and microphone",secondaryText:"Refresh the page to allow permissions, or check this browser’s settings and verify permissions are enabled for this website.",primaryButtonText:"Continue without camera and microphone",linkText:"Need help? Get troubleshooting help"};var CameraSitePermissionsDenied$d={primaryText:"Unable to access camera",secondaryText:"Click the lock icon in the address bar to grant camera permissions to this webpage. A page refresh may be required.",primaryButtonText:"Continue without camera",linkText:"Need help? Get troubleshooting help"};var MicrophoneSitePermissionsDenied$d={primaryText:"Unable to access microphone",secondaryText:"Click the lock icon in the address bar to grant microphone permissions to this webpage. A page refresh may be required.",primaryButtonText:"Continue without microphone",linkText:"Need help? Get troubleshooting help"};var CameraSitePermissionsDeniedSafari$d={primaryText:"Unable to access camera",secondaryText:"Refresh the page to allow permissions, or check this browser’s settings and verify permissions are enabled for this website.",primaryButtonText:"Continue without camera",linkText:"Need help? Get troubleshooting help"};var MicrophoneSitePermissionsDeniedSafari$d={primaryText:"Unable to access microphone",secondaryText:"Refresh the page to allow permissions, or check this browser’s settings and verify permissions are enabled for this website.",primaryButtonText:"Continue without microphone",linkText:"Need help? Get troubleshooting help"};var UnsupportedBrowser$e={primaryText:"Browser not supported",secondaryText:"Please join this call using a compatible browser.",moreHelpLinkText:"See compatibility requirements"};var UnsupportedBrowserVersion$e={primaryText:"Browser update needed",secondaryText:"To ensure the best call possible, please update your browser and then try joining the call again.",moreHelpLinkText:"See compatibility requirements",continueAnywayButtonText:"Start call without updating"};var UnsupportedOperatingSystem$e={primaryText:"Operating system not supported",secondaryText:"Please join this call using a device with a compatible operating system.",moreHelpLinkText:"See compatibility requirements"};var BrowserPermissionDenied$d={primaryText:"Can't use your camera or microphone",secondaryText:"Your browser might not have access to your camera or microphone. To fix this, open System Preferences.",primaryButtonText:"Try again",linkText:"Need help? Get troubleshooting help"};var BrowserPermissionDeniedIOS$d={primaryText:"Allow microphone access to continue",secondaryText:"So other participants can hear you.",primaryButtonText:"Try again",imageAltText:"Microphone and camera device permission location for iOS",linkText:"Need help? Get troubleshooting help",step1Text:"Go to the Settings app",step2Text:"Scroll down to settings for this browser",step3Text:"Turn on Microphone (Camera optional)",step4Text:"Try joining the call again",step1DigitText:"1",step2DigitText:"2",step3DigitText:"3",step4DigitText:"4"};var VerticalGallery$e={leftNavButtonAriaLabel:"previous page",rightNavButtonAriaLabel:"next page"};var en_US$1 = {participantItem:participantItem$d,typingIndicator:typingIndicator$d,sendBox:sendBox$d,mentionPopover:mentionPopover,messageStatusIndicator:messageStatusIndicator$d,endCallButton:endCallButton$d,cameraButton:cameraButton$d,microphoneButton:microphoneButton$d,devicesButton:devicesButton$d,participantsButton:participantsButton$d,screenShareButton:screenShareButton$d,messageThread:messageThread$d,errorBar:errorBar$d,videoGallery:videoGallery$d,dialpad:dialpad$d,holdButton:holdButton$d,videoTile:videoTile$d,CameraAndMicrophoneSitePermissionsRequest:CameraAndMicrophoneSitePermissionsRequest$d,CameraSitePermissionsRequest:CameraSitePermissionsRequest$d,MicrophoneSitePermissionsRequest:MicrophoneSitePermissionsRequest$d,CameraAndMicrophoneSitePermissionsCheck:CameraAndMicrophoneSitePermissionsCheck$d,CameraSitePermissionsCheck:CameraSitePermissionsCheck$d,MicrophoneSitePermissionsCheck:MicrophoneSitePermissionsCheck$d,CameraAndMicrophoneSitePermissionsDenied:CameraAndMicrophoneSitePermissionsDenied$d,CameraAndMicrophoneSitePermissionsDeniedSafari:CameraAndMicrophoneSitePermissionsDeniedSafari$d,CameraSitePermissionsDenied:CameraSitePermissionsDenied$d,MicrophoneSitePermissionsDenied:MicrophoneSitePermissionsDenied$d,CameraSitePermissionsDeniedSafari:CameraSitePermissionsDeniedSafari$d,MicrophoneSitePermissionsDeniedSafari:MicrophoneSitePermissionsDeniedSafari$d,UnsupportedBrowser:UnsupportedBrowser$e,UnsupportedBrowserVersion:UnsupportedBrowserVersion$e,UnsupportedOperatingSystem:UnsupportedOperatingSystem$e,BrowserPermissionDenied:BrowserPermissionDenied$d,BrowserPermissionDeniedIOS:BrowserPermissionDeniedIOS$d,VerticalGallery:VerticalGallery$e};
|
4479
4481
|
|
4480
4482
|
var participantItem$c={isMeText:"(you)",menuTitle:"More Options",removeButtonLabel:"Remove",sharingIconLabel:"Sharing",mutedIconLabel:"Muted",displayNamePlaceholder:"Unnamed participant",participantStateRinging:"Calling...",participantStateHold:"On hold"};var typingIndicator$c={singleUser:"{user} is typing ...",multipleUsers:"{users} are typing ...",multipleUsersAbbreviateOne:"{users} and 1 other are typing ...",multipleUsersAbbreviateMany:"{users} and {numOthers} others are typing ...",delimiter:", "};var sendBox$c={placeholderText:"Enter a message",textTooLong:"Your message length is over the maximum limit.",sendButtonAriaLabel:"Send message",fileUploadsPendingError:"Uploading... Please wait.",removeFile:"Remove file",uploading:"Uploading",uploadCompleted:"Upload completed"};var messageStatusIndicator$c={deliveredAriaLabel:"Message sent",deliveredTooltipText:"Sent",seenAriaLabel:"Message seen by others",seenTooltipText:"Seen",readByTooltipText:"Read by {messageThreadReadCount} of {remoteParticipantsCount}",sendingAriaLabel:"Message sending",sendingTooltipText:"Sending",failedToSendAriaLabel:"Message failed to send",failedToSendTooltipText:"Failed to send"};var endCallButton$c={label:"Leave",tooltipContent:"Leave call"};var cameraButton$c={onLabel:"Turn off",offLabel:"Turn on",tooltipDisabledContent:"Camera is disabled",tooltipOnContent:"Turn off camera",tooltipOffContent:"Turn on camera",tooltipVideoLoadingContent:"Video is loading",cameraMenuTitle:"Camera",cameraMenuTooltip:"Choose camera",cameraButtonSplitRoleDescription:"Split button",onSplitButtonAriaLabel:"Turn off camera and camera options",offSplitButtonAriaLabel:"Turn on camera and camera options",cameraActionTurnedOnAnnouncement:"Your camera has been turned on",cameraActionTurnedOffAnnouncement:"Your camera has been turned off",onSplitButtonPrimaryActionCamera:"Turn off camera",offSplitButtonPrimaryActionCamera:"Turn on camera",cameraPrimaryActionSplitButtonTitle:"Use camera"};var microphoneButton$c={onLabel:"Mute",offLabel:"Unmute",tooltipDisabledContent:"Microphone is disabled",tooltipOnContent:"Mute microphone",tooltipOffContent:"Unmute microphone",microphoneMenuTitle:"Microphone",microphoneMenuTooltip:"Choose microphone",speakerMenuTitle:"Speaker",speakerMenuTooltip:"Choose speaker",microphoneButtonSplitRoleDescription:"Split button",onSplitButtonAriaLabel:"Mute microphone and audio options",offSplitButtonAriaLabel:"Unmute microphone and audio options",microphoneActionTurnedOnAnnouncement:"Your microphone has been turned on",microphoneActionTurnedOffAnnouncement:"Your microphone has been turned off",offSplitButtonMicrophonePrimaryAction:"Unmute microphone",onSplitButtonMicrophonePrimaryAction:"Mute microphone",micPrimaryActionSplitButtonTitle:"Use microphone"};var devicesButton$c={label:"Devices",tooltipContent:"Manage devices",cameraMenuTitle:"Camera",cameraMenuTooltip:"Choose camera",audioDeviceMenuTitle:"Audio Device",audioDeviceMenuTooltip:"Choose audio device",microphoneMenuTitle:"Microphone",microphoneMenuTooltip:"Choose microphone",speakerMenuTitle:"Speaker",speakerMenuTooltip:"Choose speaker"};var participantsButton$c={label:"People",tooltipContent:"Show participants",menuHeader:"In this call",participantsListButtonLabel:"{numParticipants} people",muteAllButtonLabel:"Mute all",copyInviteLinkButtonLabel:"Copy invite link",copyInviteLinkActionedAriaLabel:"Invite link copied"};var screenShareButton$c={onLabel:"Stop presenting",offLabel:"Present",tooltipDisabledContent:"Presenting is disabled",tooltipOnContent:"Presenting your screen",tooltipOffContent:"Present your screen"};var messageThread$c={yesterday:"Yesterday",sunday:"Sunday",monday:"Monday",tuesday:"Tuesday",wednesday:"Wednesday",thursday:"Thursday",friday:"Friday",saturday:"Saturday",participantJoined:"joined the chat.",participantLeft:"left the chat.",editMessage:"Edit",removeMessage:"Delete",resendMessage:"Try sending again",failToSendTag:"Failed to send",editedTag:"Edited",liveAuthorIntro:"{author} says",messageContentAriaText:"{author} said {message}",messageContentMineAriaText:"You said {message}",editBoxTextLimit:"Your message is over the limit of {limitNumber} characters",editBoxPlaceholderText:"Edit your message",newMessagesIndicator:"New messages",noDisplayNameSub:"No name",editBoxCancelButton:"Cancel",editBoxSubmitButton:"Submit",messageReadCount:"Read by {messageReadByCount} of {remoteParticipantsCount}",actionMenuMoreOptions:"More Options",downloadFile:"Download file",blockedWarningText:"This message was deleted due to organisational policy.",blockedWarningLinkText:"Details"};var errorBar$c={unableToReachChatService:"You are offline",accessDenied:"Unable to access chat services - please check the user credentials provided",userNotInChatThread:"You are no longer in this chat thread",sendMessageNotInChatThread:"Failed to send message because you are no longer in this chat thread",sendMessageGeneric:"Failed to send message",callingNetworkFailure:"Troubling connecting call - you seem to be offline",startVideoGeneric:"Failed to start video",stopVideoGeneric:"Failed to stop video",muteGeneric:"Failed to mute microphone",unmuteGeneric:"Failed to unmute microphone",speakingWhileMuted:"Your microphone is muted",startScreenShareGeneric:"Failed to start screen sharing",stopScreenShareGeneric:"Failed to stop screen sharing",callNetworkQualityLow:"Network quality is low.",callNoSpeakerFound:"No speakers or headphones found. Connect an audio device to hear the call.",callNoMicrophoneFound:"No microphones found. Connect an audio input device.",callMicrophoneAccessDenied:"Unable to access microphone. Click the lock in the address bar to grant permission to this webpage.",callMicrophoneAccessDeniedSafari:"Unable to access microphone. Refresh the page to allow permissions, or check this browser’s settings and verify permissions are enabled for this website.",callMicrophoneMutedBySystem:"You are muted by your system.",callMicrophoneUnmutedBySystem:"Your microphone recovered and you were unmuted by your system.",callMacOsMicrophoneAccessDenied:"Unable to access microphone. Grant microphone permission in your macOS privacy settings.",callLocalVideoFreeze:"Network bandwidth is poor. Your video may appear paused for others on the call.",callCameraAccessDenied:"Unable to access camera. Click the lock in the address bar to grant permission to this webpage.",callCameraAccessDeniedSafari:"Unable to access camera. Refresh the page to allow permissions, or check this browser’s settings and verify permissions are enabled for this website.",callCameraAlreadyInUse:"Unable to access camera. It may already be in use by another application.",callVideoStoppedBySystem:"Your video has been stopped by your system.",callVideoRecoveredBySystem:"Your video has resumed.",callMacOsCameraAccessDenied:"MacOS is blocking access to your camera. Update your privacy settings to allow this browser to access your camera.",callMacOsScreenShareAccessDenied:"MacOS is blocking screen sharing. Update your privacy settings to allow this browser to record your screen.",dismissButtonAriaLabel:"Close",failedToJoinCallGeneric:"Failed to join call.",failedToJoinCallInvalidMeetingLink:"Unable to join Meeting. Invalid Link.",startScreenSharingGeneric:"There was an issue starting screen share.",cameraFrozenForRemoteParticipants:"Users in the call are having issues seeing your video. Please check your devices and network."};var videoGallery$c={screenIsBeingSharedMessage:"You are sharing your screen",screenShareLoadingMessage:"Loading {participant}'s screen",localVideoLabel:"You",localVideoCameraSwitcherLabel:"Switch camera",localVideoMovementLabel:"Movable Local Video Tile",localVideoSelectedDescription:"{cameraName} selected",displayNamePlaceholder:"Unnamed participant",fitRemoteParticipantToFrame:"Fit to frame",fillRemoteParticipantFrame:"Fill frame",pinParticipantForMe:"Pin for me",pinParticipantForMeLimitReached:"Pin (limit reached)",unpinParticipantForMe:"Unpin",pinParticipantMenuItemAriaLabel:"Pin {participantName}",unpinParticipantMenuItemAriaLabel:"Unpin {participantName}",pinnedParticipantAnnouncementAriaLabel:"Pinned {participantName}",unpinnedParticipantAnnouncementAriaLabel:"Unpinned {participantName}"};var dialpad$c={placeholderText:"Enter phone number",deleteButtonAriaLabel:"Delete"};var holdButton$c={onLabel:"Resume",offLabel:"Hold",tooltipOnContent:"Resume call",tooltipOffContent:"Hold call"};var videoTile$c={participantStateRinging:"Calling...",participantStateHold:"On hold"};var CameraAndMicrophoneSitePermissionsRequest$c={primaryText:"Allow {appName} to use your camera and microphone",secondaryText:"This is so participants can see and hear you.",linkText:"Need help? Get troubleshooting help",primaryButtonText:"Continue without camera and microphone",ariaLabel:"Allow camera and microphone access"};var CameraSitePermissionsRequest$c={primaryText:"Allow {appName} to use your camera",secondaryText:"This is so participants can see you.",linkText:"Need help? Get troubleshooting help",primaryButtonText:"Continue without camera",ariaLabel:"Allow camera access"};var MicrophoneSitePermissionsRequest$c={primaryText:"Allow {appName} to use your microphone",secondaryText:"This is so participants can hear you.",linkText:"Need help? Get troubleshooting help",primaryButtonText:"Continue without microphone",ariaLabel:"Allow microphone access"};var CameraAndMicrophoneSitePermissionsCheck$c={primaryText:"Checking for camera and microphone access",secondaryText:"Allow access if prompted. This is so participants can see and hear you.",linkText:"Need help? Get troubleshooting help",primaryButtonText:"Continue without camera and microphone",ariaLabel:"Checking for camera and microphone access. Allow access if prompted."};var CameraSitePermissionsCheck$c={primaryText:"Checking for camera access",secondaryText:"Allow access if prompted. This is so participants can see you.",linkText:"Need help? Get troubleshooting help",primaryButtonText:"Continue without camera",ariaLabel:"Checking for camera access. Allow access if prompted."};var MicrophoneSitePermissionsCheck$c={primaryText:"Checking for microphone access",secondaryText:"Allow access if prompted. This is so participants can hear you.",linkText:"Need help? Get troubleshooting help",primaryButtonText:"Continue without microphone",ariaLabel:"Checking for microphone access. Allow access if prompted."};var CameraAndMicrophoneSitePermissionsDenied$c={primaryText:"Unable to access camera and microphone",secondaryText:"Click the lock icon in the address bar to grant microphone permissions to this webpage. A page refresh may be required.",primaryButtonText:"Continue without camera and microphone",linkText:"Need help? Get troubleshooting help"};var CameraAndMicrophoneSitePermissionsDeniedSafari$c={primaryText:"Unable to access camera and microphone",secondaryText:"Refresh the page to allow permissions, or check this browser’s settings and verify permissions are enabled for this website.",primaryButtonText:"Continue without camera and microphone",linkText:"Need help? Get troubleshooting help"};var CameraSitePermissionsDenied$c={primaryText:"Unable to access camera",secondaryText:"Click the lock icon in the address bar to grant camera permissions to this webpage. A page refresh may be required.",primaryButtonText:"Continue without camera",linkText:"Need help? Get troubleshooting help"};var MicrophoneSitePermissionsDenied$c={primaryText:"Unable to access microphone",secondaryText:"Click the lock icon in the address bar to grant microphone permissions to this webpage. A page refresh may be required.",primaryButtonText:"Continue without microphone",linkText:"Need help? Get troubleshooting help"};var CameraSitePermissionsDeniedSafari$c={primaryText:"Unable to access camera",secondaryText:"Refresh the page to allow permissions, or check this browser’s settings and verify permissions are enabled for this website.",primaryButtonText:"Continue without camera",linkText:"Need help? Get troubleshooting help"};var MicrophoneSitePermissionsDeniedSafari$c={primaryText:"Unable to access microphone",secondaryText:"Refresh the page to allow permissions, or check this browser’s settings and verify permissions are enabled for this website.",primaryButtonText:"Continue without microphone",linkText:"Need help? Get troubleshooting help"};var UnsupportedBrowser$d={primaryText:"Browser not supported",secondaryText:"Please join this call using a compatible browser.",moreHelpLinkText:"See compatibility requirements"};var UnsupportedBrowserVersion$d={primaryText:"Browser update needed",secondaryText:"To ensure the best call possible, please update your browser and then try joining the call again.",moreHelpLinkText:"See compatibility requirements",continueAnywayButtonText:"Start call without updating"};var UnsupportedOperatingSystem$d={primaryText:"Operating system not supported",secondaryText:"Please join this call using a device with a compatible operating system.",moreHelpLinkText:"See compatibility requirements"};var BrowserPermissionDenied$c={primaryText:"Can't use your camera or microphone",secondaryText:"Your browser might not have access to your camera or microphone. To fix this, open System Preferences.",primaryButtonText:"Try again",linkText:"Need help? Get troubleshooting help"};var BrowserPermissionDeniedIOS$c={primaryText:"Allow microphone access to continue",secondaryText:"So other participants can hear you.",primaryButtonText:"Try again",imageAltText:"Microphone and camera device permission location for iOS",linkText:"Need help? Get troubleshooting help",step1Text:"Go to the Settings app",step2Text:"Scroll down to settings for this browser",step3Text:"Turn on Microphone (Camera optional)",step4Text:"Try joining the call again",step1DigitText:"1",step2DigitText:"2",step3DigitText:"3",step4DigitText:"4"};var VerticalGallery$d={leftNavButtonAriaLabel:"previous page",rightNavButtonAriaLabel:"next page"};var en_GB$1 = {participantItem:participantItem$c,typingIndicator:typingIndicator$c,sendBox:sendBox$c,messageStatusIndicator:messageStatusIndicator$c,endCallButton:endCallButton$c,cameraButton:cameraButton$c,microphoneButton:microphoneButton$c,devicesButton:devicesButton$c,participantsButton:participantsButton$c,screenShareButton:screenShareButton$c,messageThread:messageThread$c,errorBar:errorBar$c,videoGallery:videoGallery$c,dialpad:dialpad$c,holdButton:holdButton$c,videoTile:videoTile$c,CameraAndMicrophoneSitePermissionsRequest:CameraAndMicrophoneSitePermissionsRequest$c,CameraSitePermissionsRequest:CameraSitePermissionsRequest$c,MicrophoneSitePermissionsRequest:MicrophoneSitePermissionsRequest$c,CameraAndMicrophoneSitePermissionsCheck:CameraAndMicrophoneSitePermissionsCheck$c,CameraSitePermissionsCheck:CameraSitePermissionsCheck$c,MicrophoneSitePermissionsCheck:MicrophoneSitePermissionsCheck$c,CameraAndMicrophoneSitePermissionsDenied:CameraAndMicrophoneSitePermissionsDenied$c,CameraAndMicrophoneSitePermissionsDeniedSafari:CameraAndMicrophoneSitePermissionsDeniedSafari$c,CameraSitePermissionsDenied:CameraSitePermissionsDenied$c,MicrophoneSitePermissionsDenied:MicrophoneSitePermissionsDenied$c,CameraSitePermissionsDeniedSafari:CameraSitePermissionsDeniedSafari$c,MicrophoneSitePermissionsDeniedSafari:MicrophoneSitePermissionsDeniedSafari$c,UnsupportedBrowser:UnsupportedBrowser$d,UnsupportedBrowserVersion:UnsupportedBrowserVersion$d,UnsupportedOperatingSystem:UnsupportedOperatingSystem$d,BrowserPermissionDenied:BrowserPermissionDenied$c,BrowserPermissionDeniedIOS:BrowserPermissionDeniedIOS$c,VerticalGallery:VerticalGallery$d};
|
4481
4483
|
|
@@ -4638,10 +4640,10 @@ const defaultIdentifiers = {
|
|
4638
4640
|
horizontalGalleryVideoTile: 'horizontal-gallery-video-tile',
|
4639
4641
|
/* @conditional-compile-remove(vertical-gallery) */
|
4640
4642
|
verticalGalleryPageCounter: 'vertical-gallery-page-counter',
|
4641
|
-
/* @conditional-compile-remove(
|
4642
|
-
|
4643
|
-
/* @conditional-compile-remove(
|
4644
|
-
|
4643
|
+
/* @conditional-compile-remove(mention) */
|
4644
|
+
mentionSuggestionList: 'mention-suggestion-list',
|
4645
|
+
/* @conditional-compile-remove(mention) */
|
4646
|
+
mentionSuggestionItem: 'mention-suggestion-item'
|
4645
4647
|
};
|
4646
4648
|
/**
|
4647
4649
|
* @private
|
@@ -5835,11 +5837,253 @@ const getPerceptualBrightnessOfHexColor = (hexColor) => {
|
|
5835
5837
|
};
|
5836
5838
|
|
5837
5839
|
// Copyright (c) Microsoft Corporation.
|
5840
|
+
/**
|
5841
|
+
* @private
|
5842
|
+
* z-index to ensure that chat container has lower z-index than mention popover
|
5843
|
+
*/
|
5844
|
+
const CHAT_CONTAINER_ZINDEX$1 = 1;
|
5845
|
+
/**
|
5846
|
+
* @private
|
5847
|
+
*/
|
5848
|
+
const mentionPopoverContainerStyle = (theme) => react.mergeStyles({
|
5849
|
+
boxShadow: theme.effects.elevation16,
|
5850
|
+
background: theme.semanticColors.bodyBackground,
|
5851
|
+
overflow: 'visible',
|
5852
|
+
// zIndex to set the mentionPopover above the chat container
|
5853
|
+
zIndex: CHAT_CONTAINER_ZINDEX$1 + 1
|
5854
|
+
});
|
5855
|
+
/**
|
5856
|
+
* @private
|
5857
|
+
*/
|
5858
|
+
const headerStyleThemed = (theme) => {
|
5859
|
+
return {
|
5860
|
+
root: {
|
5861
|
+
color: theme.palette.neutralSecondary,
|
5862
|
+
margin: '0.5rem 1rem 0.25rem',
|
5863
|
+
fontSize: theme.fonts.smallPlus.fontSize
|
5864
|
+
}
|
5865
|
+
};
|
5866
|
+
};
|
5867
|
+
/**
|
5868
|
+
* @private
|
5869
|
+
*/
|
5870
|
+
react.mergeStyles({
|
5871
|
+
height: '100%',
|
5872
|
+
overflowY: 'visible',
|
5873
|
+
overflowX: 'hidden'
|
5874
|
+
});
|
5875
|
+
/**
|
5876
|
+
* @private
|
5877
|
+
*/
|
5878
|
+
const suggestionListStyle = react.mergeStyles({
|
5879
|
+
padding: '0.25rem 0rem 0',
|
5880
|
+
overflow: 'visible'
|
5881
|
+
});
|
5882
|
+
/**
|
5883
|
+
* @private
|
5884
|
+
*/
|
5885
|
+
const suggestionItemWrapperStyle = (theme) => {
|
5886
|
+
return react.mergeStyles({
|
5887
|
+
margin: '0.05rem 0.1rem',
|
5888
|
+
'&:focus-visible': {
|
5889
|
+
outline: `${theme.palette.black} solid 0.1rem`
|
5890
|
+
}
|
5891
|
+
});
|
5892
|
+
};
|
5893
|
+
/**
|
5894
|
+
* @private
|
5895
|
+
*/
|
5896
|
+
const suggestionItemStackStyle = (theme, isSuggestionHovered, activeBorder) => {
|
5897
|
+
return react.mergeStyles({
|
5898
|
+
width: '10rem',
|
5899
|
+
alignItems: 'center',
|
5900
|
+
height: '36px',
|
5901
|
+
padding: '0 0.75rem',
|
5902
|
+
background: isSuggestionHovered ? theme.palette.neutralLight : theme.palette.white,
|
5903
|
+
border: activeBorder ? `0.0625rem solid ${theme.palette.neutralSecondary}` : 'none'
|
5904
|
+
});
|
5905
|
+
};
|
5906
|
+
|
5907
|
+
// Copyright (c) Microsoft Corporation.
|
5908
|
+
/**
|
5909
|
+
* Component to render a pop-up of mention suggestions.
|
5910
|
+
*
|
5911
|
+
* @internal
|
5912
|
+
*/
|
5913
|
+
const _MentionPopover = (props) => {
|
5914
|
+
const { suggestions, activeSuggestionIndex, title, target, targetPositionOffset, onRenderSuggestionItem, onSuggestionSelected, onDismiss, location } = props;
|
5915
|
+
const theme = react.useTheme();
|
5916
|
+
/* @conditional-compile-remove(mention) */
|
5917
|
+
const ids = useIdentifiers();
|
5918
|
+
const localeStrings = useLocale$1().strings;
|
5919
|
+
const popoverRef = React.useRef();
|
5920
|
+
const [position, setPosition] = React.useState({ left: 0 });
|
5921
|
+
const [hoveredSuggestion, setHoveredSuggestion] = React.useState(undefined);
|
5922
|
+
const [changedSelection, setChangedSelection] = React.useState(undefined); // Selection UI as per teams
|
5923
|
+
const dismissPopoverWhenClickingOutside = React.useCallback((e) => {
|
5924
|
+
const target = e.target;
|
5925
|
+
if (popoverRef.current && !popoverRef.current.contains(target)) {
|
5926
|
+
onDismiss && onDismiss();
|
5927
|
+
}
|
5928
|
+
}, [onDismiss]);
|
5929
|
+
React.useEffect(() => {
|
5930
|
+
if (changedSelection === undefined) {
|
5931
|
+
setChangedSelection(false);
|
5932
|
+
}
|
5933
|
+
else if (changedSelection === false) {
|
5934
|
+
setChangedSelection(true);
|
5935
|
+
}
|
5936
|
+
}, [activeSuggestionIndex, changedSelection]);
|
5937
|
+
React.useEffect(() => {
|
5938
|
+
window && window.addEventListener('click', dismissPopoverWhenClickingOutside);
|
5939
|
+
return () => {
|
5940
|
+
window && window.removeEventListener('click', dismissPopoverWhenClickingOutside);
|
5941
|
+
};
|
5942
|
+
}, [dismissPopoverWhenClickingOutside]);
|
5943
|
+
// Determine popover position
|
5944
|
+
React.useEffect(() => {
|
5945
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
5946
|
+
const rect = (_a = target === null || target === void 0 ? void 0 : target.current) === null || _a === void 0 ? void 0 : _a.getBoundingClientRect();
|
5947
|
+
const maxWidth = 200;
|
5948
|
+
const finalPosition = { maxWidth };
|
5949
|
+
// Figure out whether it will fit horizontally
|
5950
|
+
const leftOffset = (_b = targetPositionOffset === null || targetPositionOffset === void 0 ? void 0 : targetPositionOffset.left) !== null && _b !== void 0 ? _b : 0;
|
5951
|
+
if (leftOffset + maxWidth > ((_c = rect === null || rect === void 0 ? void 0 : rect.width) !== null && _c !== void 0 ? _c : 0)) {
|
5952
|
+
finalPosition.right = ((_d = rect === null || rect === void 0 ? void 0 : rect.width) !== null && _d !== void 0 ? _d : 0) - leftOffset;
|
5953
|
+
}
|
5954
|
+
else {
|
5955
|
+
finalPosition.left = leftOffset;
|
5956
|
+
}
|
5957
|
+
if (location === 'below') {
|
5958
|
+
finalPosition.top = ((_e = rect === null || rect === void 0 ? void 0 : rect.height) !== null && _e !== void 0 ? _e : 0) + ((_f = targetPositionOffset === null || targetPositionOffset === void 0 ? void 0 : targetPositionOffset.top) !== null && _f !== void 0 ? _f : 0);
|
5959
|
+
}
|
5960
|
+
else {
|
5961
|
+
// (location === 'above')
|
5962
|
+
finalPosition.bottom = ((_g = rect === null || rect === void 0 ? void 0 : rect.height) !== null && _g !== void 0 ? _g : 0) - ((_h = targetPositionOffset === null || targetPositionOffset === void 0 ? void 0 : targetPositionOffset.top) !== null && _h !== void 0 ? _h : 0);
|
5963
|
+
}
|
5964
|
+
setPosition(finalPosition);
|
5965
|
+
}, [location, target, targetPositionOffset]);
|
5966
|
+
const handleOnKeyDown = React.useCallback((e) => {
|
5967
|
+
switch (e.key) {
|
5968
|
+
case 'Escape':
|
5969
|
+
onDismiss && onDismiss();
|
5970
|
+
break;
|
5971
|
+
}
|
5972
|
+
}, [onDismiss]);
|
5973
|
+
const personaRenderer = React.useCallback((displayName) => {
|
5974
|
+
const displayNamePlaceholder = localeStrings.participantItem.displayNamePlaceholder;
|
5975
|
+
const avatarOptions = {
|
5976
|
+
text: (displayName === null || displayName === void 0 ? void 0 : displayName.trim()) || displayNamePlaceholder,
|
5977
|
+
size: react.PersonaSize.size24,
|
5978
|
+
initialsColor: theme.palette.neutralLight,
|
5979
|
+
initialsTextColor: theme.palette.neutralSecondary,
|
5980
|
+
showOverflowTooltip: false,
|
5981
|
+
showUnknownPersonaCoin: !(displayName === null || displayName === void 0 ? void 0 : displayName.trim()) || displayName === displayNamePlaceholder
|
5982
|
+
};
|
5983
|
+
return React__default['default'].createElement(react.Persona, Object.assign({}, avatarOptions));
|
5984
|
+
}, [localeStrings, theme]);
|
5985
|
+
const defaultOnRenderSuggestionItem = React.useCallback((suggestion, onSuggestionSelected, active) => {
|
5986
|
+
return (React__default['default'].createElement("div", { "data-is-focusable": true, "data-ui-id": ids.mentionSuggestionItem, key: suggestion.id, onClick: () => onSuggestionSelected(suggestion), onMouseEnter: () => setHoveredSuggestion(suggestion), onMouseLeave: () => setHoveredSuggestion(undefined), onKeyDown: (e) => {
|
5987
|
+
handleOnKeyDown(e);
|
5988
|
+
}, className: suggestionItemWrapperStyle(theme) },
|
5989
|
+
React__default['default'].createElement(react.Stack, { horizontal: true, className: suggestionItemStackStyle(theme, (hoveredSuggestion === null || hoveredSuggestion === void 0 ? void 0 : hoveredSuggestion.id) === suggestion.id, (changedSelection !== null && changedSelection !== void 0 ? changedSelection : false) && active) }, personaRenderer(suggestion.displayText))));
|
5990
|
+
}, [
|
5991
|
+
handleOnKeyDown,
|
5992
|
+
theme,
|
5993
|
+
/* @conditional-compile-remove(mention) */
|
5994
|
+
ids,
|
5995
|
+
hoveredSuggestion,
|
5996
|
+
changedSelection,
|
5997
|
+
personaRenderer
|
5998
|
+
]);
|
5999
|
+
const getHeaderTitle = React.useCallback(() => {
|
6000
|
+
if (title) {
|
6001
|
+
return title;
|
6002
|
+
}
|
6003
|
+
/* @conditional-compile-remove(mention) */
|
6004
|
+
return localeStrings.mentionPopover.mentionPopoverHeader;
|
6005
|
+
}, [localeStrings, title]);
|
6006
|
+
return (React__default['default'].createElement("div", { ref: popoverRef },
|
6007
|
+
React__default['default'].createElement(react.Stack, { className: react.mergeStyles({
|
6008
|
+
maxHeight: 212,
|
6009
|
+
maxWidth: position.maxWidth
|
6010
|
+
}, mentionPopoverContainerStyle(theme), Object.assign(Object.assign({}, position), { position: 'absolute' })) },
|
6011
|
+
React__default['default'].createElement(react.Stack.Item, { styles: headerStyleThemed(theme), "aria-label": title }, getHeaderTitle()),
|
6012
|
+
React__default['default'].createElement(react.Stack
|
6013
|
+
/* @conditional-compile-remove(mention) */
|
6014
|
+
, { "data-ui-id": ids.mentionSuggestionList, className: suggestionListStyle }, suggestions.map((suggestion, index) => {
|
6015
|
+
const active = index === activeSuggestionIndex;
|
6016
|
+
return onRenderSuggestionItem
|
6017
|
+
? onRenderSuggestionItem(suggestion, onSuggestionSelected, active)
|
6018
|
+
: defaultOnRenderSuggestionItem(suggestion, onSuggestionSelected, active);
|
6019
|
+
})))));
|
6020
|
+
};
|
6021
|
+
|
6022
|
+
// Copyright (c) Microsoft Corporation.
|
6023
|
+
// Licensed under the MIT license.
|
6024
|
+
var __awaiter$w = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
|
6025
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
6026
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
6027
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
6028
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
6029
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
6030
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
6031
|
+
});
|
6032
|
+
};
|
6033
|
+
/* @conditional-compile-remove(mention) */
|
6034
|
+
const defaultMentionTrigger = '@';
|
5838
6035
|
/**
|
5839
6036
|
* @private
|
5840
6037
|
*/
|
5841
6038
|
const InputBoxComponent = (props) => {
|
5842
|
-
const { styles, id, 'data-ui-id': dataUiId, textValue, onChange, textFieldRef, placeholderText, onKeyDown, onEnterKeyDown, supportNewline, inputClassName, errorMessage, disabled, children
|
6039
|
+
const { styles, id, 'data-ui-id': dataUiId, textValue, onChange, textFieldRef, placeholderText, onKeyDown, onEnterKeyDown, supportNewline, inputClassName, errorMessage, disabled, children,
|
6040
|
+
/* @conditional-compile-remove(mention) */
|
6041
|
+
mentionLookupOptions } = props;
|
6042
|
+
const inputBoxRef = React.useRef(null);
|
6043
|
+
/* @conditional-compile-remove(mention) */
|
6044
|
+
// Current suggestion list, provided by the callback
|
6045
|
+
const [mentionSuggestions, setMentionSuggestions] = React.useState([]);
|
6046
|
+
/* @conditional-compile-remove(mention) */
|
6047
|
+
// Current suggestion list, provided by the callback
|
6048
|
+
const [activeSuggestionIndex, setActiveSuggestionIndex] = React.useState(undefined);
|
6049
|
+
/* @conditional-compile-remove(mention) */
|
6050
|
+
// Index of the current trigger character in the text field
|
6051
|
+
const [currentTriggerStartIndex, setCurrentTriggerStartIndex] = React.useState(-1);
|
6052
|
+
/* @conditional-compile-remove(mention) */
|
6053
|
+
const [inputTextValue, setInputTextValue] = React.useState('');
|
6054
|
+
/* @conditional-compile-remove(mention) */
|
6055
|
+
const [tagsValue, setTagsValue] = React.useState([]);
|
6056
|
+
/* @conditional-compile-remove(mention) */
|
6057
|
+
const [selectionStartValue, setSelectionStartValue] = React.useState(null);
|
6058
|
+
/* @conditional-compile-remove(mention) */
|
6059
|
+
const [selectionEndValue, setSelectionEndValue] = React.useState(null);
|
6060
|
+
/* @conditional-compile-remove(mention) */
|
6061
|
+
const [shouldHandleOnMouseDownDuringSelect, setShouldHandleOnMouseDownDuringSelect] = React.useState(true);
|
6062
|
+
/* @conditional-compile-remove(mention) */
|
6063
|
+
// Caret position in the text field
|
6064
|
+
const [caretPosition, setCaretPosition] = React.useState(undefined);
|
6065
|
+
/* @conditional-compile-remove(mention) */
|
6066
|
+
// Index of where the caret is in the text field
|
6067
|
+
const [caretIndex, setCaretIndex] = React.useState(undefined);
|
6068
|
+
/* @conditional-compile-remove(mention) */
|
6069
|
+
const localeStrings = useLocale$1().strings;
|
6070
|
+
/* @conditional-compile-remove(mention) */
|
6071
|
+
const updateMentionSuggestions = React.useCallback((suggestions) => {
|
6072
|
+
var _a;
|
6073
|
+
setMentionSuggestions(suggestions);
|
6074
|
+
if (caretIndex !== undefined) {
|
6075
|
+
(_a = textFieldRef === null || textFieldRef === void 0 ? void 0 : textFieldRef.current) === null || _a === void 0 ? void 0 : _a.setSelectionEnd(caretIndex);
|
6076
|
+
}
|
6077
|
+
}, [textFieldRef, caretIndex]);
|
6078
|
+
/* @conditional-compile-remove(mention) */
|
6079
|
+
// Parse the text and get the plain text version to display in the input box
|
6080
|
+
React.useEffect(() => {
|
6081
|
+
const trigger = (mentionLookupOptions === null || mentionLookupOptions === void 0 ? void 0 : mentionLookupOptions.trigger) || defaultMentionTrigger;
|
6082
|
+
const [tags, plainText] = textToTagParser(textValue, trigger);
|
6083
|
+
setInputTextValue(plainText);
|
6084
|
+
setTagsValue(tags);
|
6085
|
+
updateMentionSuggestions([]);
|
6086
|
+
}, [textValue, mentionLookupOptions === null || mentionLookupOptions === void 0 ? void 0 : mentionLookupOptions.trigger, updateMentionSuggestions]);
|
5843
6087
|
const mergedRootStyle = react.mergeStyles(inputBoxWrapperStyle, styles === null || styles === void 0 ? void 0 : styles.root);
|
5844
6088
|
const mergedTextFiledStyle = react.mergeStyles(inputBoxStyle, inputClassName, props.inlineChildren ? {} : inputBoxNewLineSpaceAffordance);
|
5845
6089
|
const mergedTextContainerStyle = react.mergeStyles(textContainerStyle, styles === null || styles === void 0 ? void 0 : styles.textFieldContainer);
|
@@ -5847,20 +6091,307 @@ const InputBoxComponent = (props) => {
|
|
5847
6091
|
fieldGroup: styles === null || styles === void 0 ? void 0 : styles.textField,
|
5848
6092
|
errorMessage: styles === null || styles === void 0 ? void 0 : styles.systemMessage
|
5849
6093
|
});
|
5850
|
-
|
6094
|
+
/* @conditional-compile-remove(mention) */
|
6095
|
+
const onSuggestionSelected = React.useCallback((suggestion) => {
|
6096
|
+
var _a, _b;
|
6097
|
+
let selectionEnd = ((_a = textFieldRef === null || textFieldRef === void 0 ? void 0 : textFieldRef.current) === null || _a === void 0 ? void 0 : _a.selectionEnd) || -1;
|
6098
|
+
if (selectionEnd < 0) {
|
6099
|
+
selectionEnd = 0;
|
6100
|
+
}
|
6101
|
+
else if (selectionEnd > inputTextValue.length) {
|
6102
|
+
selectionEnd = inputTextValue.length;
|
6103
|
+
}
|
6104
|
+
const oldPlainText = inputTextValue;
|
6105
|
+
const mention = htmlStringForMentionSuggestion(suggestion, localeStrings);
|
6106
|
+
// update plain text with the mention html text
|
6107
|
+
const newPlainText = inputTextValue.substring(0, currentTriggerStartIndex) + mention + inputTextValue.substring(selectionEnd);
|
6108
|
+
const triggerText = (_b = mentionLookupOptions === null || mentionLookupOptions === void 0 ? void 0 : mentionLookupOptions.trigger) !== null && _b !== void 0 ? _b : defaultMentionTrigger;
|
6109
|
+
// update html text with updated plain text
|
6110
|
+
const [updatedHTML] = updateHTML(textValue, oldPlainText, newPlainText, tagsValue, currentTriggerStartIndex, selectionEnd, mention, triggerText);
|
6111
|
+
const displayName = getDisplayNameForMentionSuggestion(suggestion, localeStrings);
|
6112
|
+
// Move the caret in the text field to the end of the mention plain text
|
6113
|
+
setCaretIndex(selectionEnd + displayName.length);
|
6114
|
+
setCurrentTriggerStartIndex(-1);
|
6115
|
+
updateMentionSuggestions([]);
|
6116
|
+
setActiveSuggestionIndex(undefined);
|
6117
|
+
onChange && onChange(undefined, updatedHTML);
|
6118
|
+
}, [
|
6119
|
+
textFieldRef,
|
6120
|
+
inputTextValue,
|
6121
|
+
currentTriggerStartIndex,
|
6122
|
+
mentionLookupOptions === null || mentionLookupOptions === void 0 ? void 0 : mentionLookupOptions.trigger,
|
6123
|
+
onChange,
|
6124
|
+
textValue,
|
6125
|
+
tagsValue,
|
6126
|
+
/* @conditional-compile-remove(mention) */
|
6127
|
+
updateMentionSuggestions,
|
6128
|
+
/* @conditional-compile-remove(mention) */
|
6129
|
+
localeStrings
|
6130
|
+
]);
|
6131
|
+
const onTextFieldKeyDown = React.useCallback((ev) => {
|
5851
6132
|
// Uses KeyCode 229 and which code 229 to determine if the press of the enter key is from a composition session or not (Safari only)
|
5852
6133
|
if (ev.nativeEvent.isComposing || ev.nativeEvent.keyCode === 229 || ev.nativeEvent.which === 229) {
|
5853
6134
|
return;
|
5854
6135
|
}
|
6136
|
+
if (ev.key === 'ArrowUp') {
|
6137
|
+
ev.preventDefault();
|
6138
|
+
/* @conditional-compile-remove(mention) */
|
6139
|
+
if (mentionSuggestions.length > 0) {
|
6140
|
+
const newActiveIndex = activeSuggestionIndex === undefined
|
6141
|
+
? mentionSuggestions.length - 1
|
6142
|
+
: Math.max(activeSuggestionIndex - 1, 0);
|
6143
|
+
setActiveSuggestionIndex(newActiveIndex);
|
6144
|
+
}
|
6145
|
+
}
|
6146
|
+
else if (ev.key === 'ArrowDown') {
|
6147
|
+
ev.preventDefault();
|
6148
|
+
/* @conditional-compile-remove(mention) */
|
6149
|
+
if (mentionSuggestions.length > 0) {
|
6150
|
+
const newActiveIndex = activeSuggestionIndex === undefined
|
6151
|
+
? 0
|
6152
|
+
: Math.min(activeSuggestionIndex + 1, mentionSuggestions.length - 1);
|
6153
|
+
setActiveSuggestionIndex(newActiveIndex);
|
6154
|
+
}
|
6155
|
+
}
|
5855
6156
|
if (ev.key === 'Enter' && (ev.shiftKey === false || !supportNewline)) {
|
5856
6157
|
ev.preventDefault();
|
6158
|
+
// If we are looking up a mention, select the focused suggestion
|
6159
|
+
/* @conditional-compile-remove(mention) */
|
6160
|
+
if (mentionSuggestions.length > 0 && activeSuggestionIndex !== undefined) {
|
6161
|
+
const selectedMention = mentionSuggestions[activeSuggestionIndex];
|
6162
|
+
if (selectedMention) {
|
6163
|
+
onSuggestionSelected(selectedMention);
|
6164
|
+
return;
|
6165
|
+
}
|
6166
|
+
}
|
5857
6167
|
onEnterKeyDown && onEnterKeyDown();
|
5858
6168
|
}
|
5859
6169
|
onKeyDown && onKeyDown(ev);
|
5860
|
-
}, [
|
6170
|
+
}, [
|
6171
|
+
onEnterKeyDown,
|
6172
|
+
onKeyDown,
|
6173
|
+
supportNewline,
|
6174
|
+
/* @conditional-compile-remove(mention) */
|
6175
|
+
mentionSuggestions,
|
6176
|
+
/* @conditional-compile-remove(mention) */
|
6177
|
+
activeSuggestionIndex,
|
6178
|
+
/* @conditional-compile-remove(mention) */
|
6179
|
+
onSuggestionSelected
|
6180
|
+
]);
|
6181
|
+
/* @conditional-compile-remove(mention) */
|
6182
|
+
const debouncedQueryUpdate = useDebounce.useDebouncedCallback((query) => __awaiter$w(void 0, void 0, void 0, function* () {
|
6183
|
+
var _a;
|
6184
|
+
const suggestions = (_a = (yield (mentionLookupOptions === null || mentionLookupOptions === void 0 ? void 0 : mentionLookupOptions.onQueryUpdated(query)))) !== null && _a !== void 0 ? _a : [];
|
6185
|
+
if (suggestions.length === 0) {
|
6186
|
+
setActiveSuggestionIndex(undefined);
|
6187
|
+
}
|
6188
|
+
else if (activeSuggestionIndex === undefined) {
|
6189
|
+
setActiveSuggestionIndex(0);
|
6190
|
+
}
|
6191
|
+
updateMentionSuggestions(suggestions);
|
6192
|
+
}), 500);
|
6193
|
+
/* @conditional-compile-remove(mention) */
|
6194
|
+
React.useEffect(() => {
|
6195
|
+
return () => {
|
6196
|
+
debouncedQueryUpdate.cancel();
|
6197
|
+
};
|
6198
|
+
}, [debouncedQueryUpdate]);
|
6199
|
+
/* @conditional-compile-remove(mention) */
|
6200
|
+
const handleOnChange = React.useCallback((event, updatedValue) => __awaiter$w(void 0, void 0, void 0, function* () {
|
6201
|
+
var _b, _c;
|
6202
|
+
const newValue = updatedValue !== null && updatedValue !== void 0 ? updatedValue : '';
|
6203
|
+
const triggerText = (_b = mentionLookupOptions === null || mentionLookupOptions === void 0 ? void 0 : mentionLookupOptions.trigger) !== null && _b !== void 0 ? _b : defaultMentionTrigger;
|
6204
|
+
const newTextLength = newValue.length;
|
6205
|
+
let selectionEnd = ((_c = textFieldRef === null || textFieldRef === void 0 ? void 0 : textFieldRef.current) === null || _c === void 0 ? void 0 : _c.selectionEnd) || -1;
|
6206
|
+
selectionEnd = Math.max(0, selectionEnd);
|
6207
|
+
selectionEnd = Math.min(selectionEnd, newTextLength - 1);
|
6208
|
+
// If we are enabled for lookups,
|
6209
|
+
if (mentionLookupOptions !== undefined) {
|
6210
|
+
// Look at the range of the change for a trigger character
|
6211
|
+
const triggerPriorIndex = newValue.lastIndexOf(triggerText, selectionEnd - 1);
|
6212
|
+
// Update the caret position, if not doing a lookup
|
6213
|
+
setCaretPosition(textareaCaretTs.Caret.getRelativePosition(event.currentTarget));
|
6214
|
+
if (triggerPriorIndex !== undefined) {
|
6215
|
+
// trigger is found
|
6216
|
+
const isSpaceBeforeTrigger = newValue.substring(triggerPriorIndex - 1, triggerPriorIndex) === ' ';
|
6217
|
+
const wordAtSelection = newValue.substring(triggerPriorIndex, selectionEnd);
|
6218
|
+
let tagIndex = currentTriggerStartIndex;
|
6219
|
+
if (!isSpaceBeforeTrigger && triggerPriorIndex !== 0) {
|
6220
|
+
//no space before the trigger <- continuation of the previous word
|
6221
|
+
tagIndex = -1;
|
6222
|
+
setCurrentTriggerStartIndex(tagIndex);
|
6223
|
+
}
|
6224
|
+
else if (wordAtSelection === triggerText) {
|
6225
|
+
// start of the mention
|
6226
|
+
tagIndex = selectionEnd - triggerText.length;
|
6227
|
+
if (tagIndex < 0) {
|
6228
|
+
tagIndex = 0;
|
6229
|
+
}
|
6230
|
+
setCurrentTriggerStartIndex(tagIndex);
|
6231
|
+
}
|
6232
|
+
if (tagIndex === -1) {
|
6233
|
+
updateMentionSuggestions([]);
|
6234
|
+
}
|
6235
|
+
else {
|
6236
|
+
// In the middle of a @mention lookup
|
6237
|
+
if (tagIndex > -1) {
|
6238
|
+
const query = wordAtSelection.substring(triggerText.length, wordAtSelection.length);
|
6239
|
+
if (query !== undefined) {
|
6240
|
+
yield debouncedQueryUpdate(query);
|
6241
|
+
}
|
6242
|
+
}
|
6243
|
+
}
|
6244
|
+
}
|
6245
|
+
}
|
6246
|
+
let result = '';
|
6247
|
+
if (tagsValue.length === 0) {
|
6248
|
+
// no tags in the string, textValue is a sting
|
6249
|
+
result = newValue;
|
6250
|
+
}
|
6251
|
+
else {
|
6252
|
+
// there are tags in the text value, textValue is html string
|
6253
|
+
const { changeStart, oldChangeEnd, newChangeEnd } = findStringsDiffIndexes(inputTextValue, newValue, selectionEnd);
|
6254
|
+
// get updated html string
|
6255
|
+
const change = newValue.substring(changeStart, newChangeEnd);
|
6256
|
+
const [updatedHTML, updatedChangeNewEndIndex] = updateHTML(textValue, inputTextValue, newValue, tagsValue, changeStart, oldChangeEnd, change, triggerText);
|
6257
|
+
result = updatedHTML;
|
6258
|
+
if (updatedChangeNewEndIndex !== null) {
|
6259
|
+
if ((change.length === 1 && event.currentTarget.selectionStart === event.currentTarget.selectionEnd) || // simple input
|
6260
|
+
(change.length === 0 && newChangeEnd === changeStart) //delete
|
6261
|
+
) {
|
6262
|
+
setCaretIndex(updatedChangeNewEndIndex);
|
6263
|
+
}
|
6264
|
+
}
|
6265
|
+
}
|
6266
|
+
onChange && onChange(event, result);
|
6267
|
+
}), [
|
6268
|
+
onChange,
|
6269
|
+
mentionLookupOptions,
|
6270
|
+
tagsValue,
|
6271
|
+
textValue,
|
6272
|
+
inputTextValue,
|
6273
|
+
currentTriggerStartIndex,
|
6274
|
+
setCaretIndex,
|
6275
|
+
setCaretPosition,
|
6276
|
+
updateMentionSuggestions,
|
6277
|
+
debouncedQueryUpdate,
|
6278
|
+
textFieldRef
|
6279
|
+
]);
|
6280
|
+
/* @conditional-compile-remove(mention) */
|
6281
|
+
const updateSelectionIndexesWithMentionIfNeeded = (event) => {
|
6282
|
+
var _a;
|
6283
|
+
let updatedStartIndex = event.currentTarget.selectionStart;
|
6284
|
+
let updatedEndIndex = event.currentTarget.selectionEnd;
|
6285
|
+
if (event.currentTarget.selectionStart === event.currentTarget.selectionEnd &&
|
6286
|
+
event.currentTarget.selectionStart !== null &&
|
6287
|
+
event.currentTarget.selectionStart !== -1) {
|
6288
|
+
const mentionTag = findMentionTagForSelection(tagsValue, event.currentTarget.selectionStart);
|
6289
|
+
if (mentionTag !== undefined && mentionTag.plainTextBeginIndex !== undefined) {
|
6290
|
+
if (selectionStartValue === null) {
|
6291
|
+
updatedStartIndex = mentionTag.plainTextBeginIndex;
|
6292
|
+
updatedEndIndex = (_a = mentionTag.plainTextEndIndex) !== null && _a !== void 0 ? _a : mentionTag.plainTextBeginIndex;
|
6293
|
+
}
|
6294
|
+
else {
|
6295
|
+
const newSelectionIndex = findNewSelectionIndexForMention(mentionTag, inputTextValue, event.currentTarget.selectionStart, selectionStartValue);
|
6296
|
+
updatedStartIndex = newSelectionIndex;
|
6297
|
+
updatedEndIndex = newSelectionIndex;
|
6298
|
+
}
|
6299
|
+
}
|
6300
|
+
}
|
6301
|
+
else if (event.currentTarget.selectionStart !== event.currentTarget.selectionEnd) {
|
6302
|
+
// Both e.currentTarget.selectionStart !== selectionStartValue and e.currentTarget.selectionEnd !== selectionEndValue can be true when a user selects a text by double click
|
6303
|
+
if (event.currentTarget.selectionStart !== null && event.currentTarget.selectionStart !== selectionStartValue) {
|
6304
|
+
// the selection start is changed
|
6305
|
+
const mentionTag = findMentionTagForSelection(tagsValue, event.currentTarget.selectionStart);
|
6306
|
+
if (mentionTag !== undefined && mentionTag.plainTextBeginIndex !== undefined) {
|
6307
|
+
//TODO: here it takes -1 when it shouldn't, update selectionstart and end with mouse move and or touch move
|
6308
|
+
updatedStartIndex = findNewSelectionIndexForMention(mentionTag, inputTextValue, event.currentTarget.selectionStart, selectionStartValue !== null && selectionStartValue !== void 0 ? selectionStartValue : -1);
|
6309
|
+
}
|
6310
|
+
}
|
6311
|
+
if (event.currentTarget.selectionEnd !== null && event.currentTarget.selectionEnd !== selectionEndValue) {
|
6312
|
+
// the selection end is changed
|
6313
|
+
const mentionTag = findMentionTagForSelection(tagsValue, event.currentTarget.selectionEnd);
|
6314
|
+
if (mentionTag !== undefined && mentionTag.plainTextBeginIndex !== undefined) {
|
6315
|
+
//TODO: here it takes -1 when it shouldn't, update selectionstart and end with mouse move and or touch move
|
6316
|
+
updatedEndIndex = findNewSelectionIndexForMention(mentionTag, inputTextValue, event.currentTarget.selectionEnd, selectionEndValue !== null && selectionEndValue !== void 0 ? selectionEndValue : -1);
|
6317
|
+
}
|
6318
|
+
}
|
6319
|
+
}
|
6320
|
+
// e.currentTarget.selectionDirection should be set to handle shift + arrow keys
|
6321
|
+
if (event.currentTarget.selectionDirection === null) {
|
6322
|
+
event.currentTarget.setSelectionRange(updatedStartIndex, updatedEndIndex);
|
6323
|
+
}
|
6324
|
+
else {
|
6325
|
+
event.currentTarget.setSelectionRange(updatedStartIndex, updatedEndIndex, event.currentTarget.selectionDirection);
|
6326
|
+
}
|
6327
|
+
setSelectionStartValue(updatedStartIndex);
|
6328
|
+
setSelectionEndValue(updatedEndIndex);
|
6329
|
+
};
|
6330
|
+
const getInputFieldTextValue = () => {
|
6331
|
+
/* @conditional-compile-remove(mention) */
|
6332
|
+
return inputTextValue;
|
6333
|
+
};
|
5861
6334
|
return (React__default['default'].createElement(react.Stack, { className: mergedRootStyle },
|
5862
6335
|
React__default['default'].createElement("div", { className: mergedTextContainerStyle },
|
5863
|
-
React__default['default'].createElement(
|
6336
|
+
/* @conditional-compile-remove(mention) */ mentionSuggestions.length > 0 && (React__default['default'].createElement(_MentionPopover, { suggestions: mentionSuggestions, activeSuggestionIndex: activeSuggestionIndex, target: inputBoxRef, targetPositionOffset: caretPosition, onRenderSuggestionItem: mentionLookupOptions === null || mentionLookupOptions === void 0 ? void 0 : mentionLookupOptions.onRenderSuggestionItem, onSuggestionSelected: onSuggestionSelected, onDismiss: () => {
|
6337
|
+
updateMentionSuggestions([]);
|
6338
|
+
} })),
|
6339
|
+
React__default['default'].createElement(react.TextField, { autoFocus: props.autoFocus === 'sendBoxTextField', "data-ui-id": dataUiId, multiline: true, autoAdjustHeight: true, multiple: false, resizable: false, componentRef: textFieldRef, id: id, inputClassName: mergedTextFiledStyle, placeholder: placeholderText, value: getInputFieldTextValue(), onChange: (e, newValue) => {
|
6340
|
+
/* @conditional-compile-remove(mention) */
|
6341
|
+
setInputTextValue(newValue !== null && newValue !== void 0 ? newValue : '');
|
6342
|
+
/* @conditional-compile-remove(mention) */
|
6343
|
+
handleOnChange(e, newValue);
|
6344
|
+
/* @conditional-compile-remove(mention) */
|
6345
|
+
return;
|
6346
|
+
},
|
6347
|
+
/* @conditional-compile-remove(mention) */
|
6348
|
+
onSelect: (e) => {
|
6349
|
+
var _a, _b, _c;
|
6350
|
+
if (caretIndex !== undefined) {
|
6351
|
+
e.currentTarget.setSelectionRange(caretIndex, caretIndex);
|
6352
|
+
setCaretIndex(undefined);
|
6353
|
+
return;
|
6354
|
+
}
|
6355
|
+
//TODO: need to check to navigate before/after space correctly in tag + when selecting by mouse
|
6356
|
+
/* @conditional-compile-remove(mention) */
|
6357
|
+
if (shouldHandleOnMouseDownDuringSelect &&
|
6358
|
+
e.currentTarget.selectionStart !== null &&
|
6359
|
+
e.currentTarget.selectionStart === e.currentTarget.selectionEnd) {
|
6360
|
+
// handle mention click
|
6361
|
+
const mentionTag = findMentionTagForSelection(tagsValue, e.currentTarget.selectionStart);
|
6362
|
+
if (mentionTag !== undefined && mentionTag.plainTextBeginIndex !== undefined) {
|
6363
|
+
if (e.currentTarget.selectionDirection === null) {
|
6364
|
+
e.currentTarget.setSelectionRange(mentionTag.plainTextBeginIndex, (_a = mentionTag.plainTextEndIndex) !== null && _a !== void 0 ? _a : mentionTag.plainTextBeginIndex);
|
6365
|
+
}
|
6366
|
+
else {
|
6367
|
+
e.currentTarget.setSelectionRange(mentionTag.plainTextBeginIndex, (_b = mentionTag.plainTextEndIndex) !== null && _b !== void 0 ? _b : mentionTag.plainTextBeginIndex, e.currentTarget.selectionDirection);
|
6368
|
+
}
|
6369
|
+
setSelectionStartValue(mentionTag.plainTextBeginIndex);
|
6370
|
+
setSelectionEndValue((_c = mentionTag.plainTextEndIndex) !== null && _c !== void 0 ? _c : mentionTag.plainTextBeginIndex);
|
6371
|
+
}
|
6372
|
+
else {
|
6373
|
+
setSelectionStartValue(e.currentTarget.selectionStart);
|
6374
|
+
setSelectionEndValue(e.currentTarget.selectionEnd);
|
6375
|
+
}
|
6376
|
+
}
|
6377
|
+
else {
|
6378
|
+
updateSelectionIndexesWithMentionIfNeeded(e);
|
6379
|
+
}
|
6380
|
+
/* @conditional-compile-remove(mention) */
|
6381
|
+
setShouldHandleOnMouseDownDuringSelect(false);
|
6382
|
+
}, onMouseDown: () => {
|
6383
|
+
// as events order is onMouseDown -> onSelect -> onClick
|
6384
|
+
// onClick and onMouseDown can't handle clicking on mention event because
|
6385
|
+
// onClick has wrong range as it's called after onSelect
|
6386
|
+
// onMouseDown doesn't have correct selectionRange yet
|
6387
|
+
// so we need to handle onMouseDown to prevent onSelect default behavior
|
6388
|
+
/* @conditional-compile-remove(mention) */
|
6389
|
+
setShouldHandleOnMouseDownDuringSelect(true);
|
6390
|
+
}, onTouchStart: () => {
|
6391
|
+
// see onMouseDown for more details
|
6392
|
+
/* @conditional-compile-remove(mention) */
|
6393
|
+
setShouldHandleOnMouseDownDuringSelect(true);
|
6394
|
+
}, autoComplete: "off", onKeyDown: onTextFieldKeyDown, styles: mergedTextFieldStyle, disabled: disabled, errorMessage: errorMessage, elementRef: inputBoxRef }),
|
5864
6395
|
React__default['default'].createElement(react.Stack, { horizontal: true, className: react.mergeStyles(props.inlineChildren ? inlineButtonsContainerStyle : newLineButtonsContainerStyle) }, children))));
|
5865
6396
|
};
|
5866
6397
|
/**
|
@@ -5885,6 +6416,682 @@ const InputBoxButton = (props) => {
|
|
5885
6416
|
setIsHover(false);
|
5886
6417
|
}, onRenderIcon: () => onRenderIcon(isHover) })));
|
5887
6418
|
};
|
6419
|
+
/* @conditional-compile-remove(mention) */
|
6420
|
+
/**
|
6421
|
+
* Find mention tag if selection is inside of it
|
6422
|
+
*
|
6423
|
+
* @private
|
6424
|
+
*/
|
6425
|
+
const findMentionTagForSelection = (tags, selection) => {
|
6426
|
+
let mentionTag = undefined;
|
6427
|
+
for (let i = 0; i < tags.length; i++) {
|
6428
|
+
const tag = tags[i];
|
6429
|
+
let plainTextEndIndex = 0;
|
6430
|
+
if (tag.plainTextEndIndex !== undefined && tag.closeTagIdx !== undefined) {
|
6431
|
+
// close tag exists
|
6432
|
+
plainTextEndIndex = tag.plainTextEndIndex;
|
6433
|
+
}
|
6434
|
+
else if (tag.plainTextBeginIndex !== undefined) {
|
6435
|
+
//no close tag
|
6436
|
+
plainTextEndIndex = tag.plainTextBeginIndex;
|
6437
|
+
}
|
6438
|
+
if (tag.subTags !== undefined && tag.subTags.length !== 0) {
|
6439
|
+
const selectedTag = findMentionTagForSelection(tag.subTags, selection);
|
6440
|
+
if (selectedTag !== undefined) {
|
6441
|
+
mentionTag = selectedTag;
|
6442
|
+
break;
|
6443
|
+
}
|
6444
|
+
}
|
6445
|
+
else if (tag.tagType === 'msft-mention' &&
|
6446
|
+
tag.plainTextBeginIndex !== undefined &&
|
6447
|
+
tag.plainTextBeginIndex < selection &&
|
6448
|
+
selection < plainTextEndIndex) {
|
6449
|
+
mentionTag = tag;
|
6450
|
+
break;
|
6451
|
+
}
|
6452
|
+
}
|
6453
|
+
return mentionTag;
|
6454
|
+
};
|
6455
|
+
/* @conditional-compile-remove(mention) */
|
6456
|
+
/**
|
6457
|
+
* Go through tags and find a new the selection index if it is inside of a mention tag
|
6458
|
+
*
|
6459
|
+
* @private
|
6460
|
+
*/
|
6461
|
+
const findNewSelectionIndexForMention = (tag, textValue, selection, previousSelection) => {
|
6462
|
+
var _a;
|
6463
|
+
if (tag.plainTextBeginIndex === undefined ||
|
6464
|
+
tag.tagType !== 'msft-mention' ||
|
6465
|
+
selection === previousSelection ||
|
6466
|
+
tag.plainTextEndIndex === undefined) {
|
6467
|
+
return selection;
|
6468
|
+
}
|
6469
|
+
let spaceIndex = 0;
|
6470
|
+
if (selection <= previousSelection) {
|
6471
|
+
// the cursor is moved to the left
|
6472
|
+
spaceIndex = textValue.lastIndexOf(' ', selection !== null && selection !== void 0 ? selection : 0);
|
6473
|
+
if (spaceIndex === -1) {
|
6474
|
+
// no space before the selection
|
6475
|
+
spaceIndex = tag.plainTextBeginIndex;
|
6476
|
+
}
|
6477
|
+
}
|
6478
|
+
else {
|
6479
|
+
// the cursor is moved to the right
|
6480
|
+
spaceIndex = textValue.indexOf(' ', selection !== null && selection !== void 0 ? selection : 0);
|
6481
|
+
if (spaceIndex === -1) {
|
6482
|
+
// no space after the selection
|
6483
|
+
spaceIndex = (_a = tag.plainTextEndIndex) !== null && _a !== void 0 ? _a : tag.plainTextBeginIndex;
|
6484
|
+
}
|
6485
|
+
}
|
6486
|
+
if (spaceIndex < tag.plainTextBeginIndex) {
|
6487
|
+
spaceIndex = tag.plainTextBeginIndex;
|
6488
|
+
}
|
6489
|
+
else if (spaceIndex > tag.plainTextEndIndex) {
|
6490
|
+
spaceIndex = tag.plainTextEndIndex;
|
6491
|
+
}
|
6492
|
+
return spaceIndex;
|
6493
|
+
};
|
6494
|
+
/* @conditional-compile-remove(mention) */
|
6495
|
+
/**
|
6496
|
+
* Handle mention tag edit and by word deleting
|
6497
|
+
*
|
6498
|
+
* @private
|
6499
|
+
*/
|
6500
|
+
const handleMentionTagUpdate = (htmlText, oldPlainText, lastProcessedHTMLIndex, processedChange, tag, closeTagIdx, closeTagLength, plainTextEndIndex, startIndex, oldPlainTextEndIndex, mentionTagLength) => {
|
6501
|
+
if (tag.tagType !== 'msft-mention' || tag.plainTextBeginIndex === undefined) {
|
6502
|
+
return ['', processedChange, lastProcessedHTMLIndex, null];
|
6503
|
+
}
|
6504
|
+
let result = '';
|
6505
|
+
let plainTextSelectionEndIndex = null;
|
6506
|
+
let rangeStart;
|
6507
|
+
let rangeEnd;
|
6508
|
+
// check if space symbol is handled in case if string looks like '<1 2 3>'
|
6509
|
+
let isSpaceLengthHandled = false;
|
6510
|
+
rangeStart = oldPlainText.lastIndexOf(' ', startIndex);
|
6511
|
+
if (rangeStart !== -1 && rangeStart !== undefined && rangeStart > tag.plainTextBeginIndex) {
|
6512
|
+
isSpaceLengthHandled = true;
|
6513
|
+
}
|
6514
|
+
rangeEnd = oldPlainText.indexOf(' ', oldPlainTextEndIndex);
|
6515
|
+
if (rangeEnd === -1 || rangeEnd === undefined) {
|
6516
|
+
// check if space symbol is not found
|
6517
|
+
rangeEnd = plainTextEndIndex;
|
6518
|
+
}
|
6519
|
+
else if (!isSpaceLengthHandled) {
|
6520
|
+
// +1 to include the space symbol
|
6521
|
+
rangeEnd += 1;
|
6522
|
+
}
|
6523
|
+
isSpaceLengthHandled = true;
|
6524
|
+
if (rangeStart === -1 || rangeStart === undefined || rangeStart < tag.plainTextBeginIndex) {
|
6525
|
+
rangeStart = tag.plainTextBeginIndex;
|
6526
|
+
}
|
6527
|
+
if (rangeEnd > plainTextEndIndex) {
|
6528
|
+
rangeEnd = plainTextEndIndex;
|
6529
|
+
}
|
6530
|
+
if (rangeStart === tag.plainTextBeginIndex && rangeEnd === plainTextEndIndex) {
|
6531
|
+
// the whole tag should be removed
|
6532
|
+
result += htmlText.substring(lastProcessedHTMLIndex, tag.openTagIdx) + processedChange;
|
6533
|
+
plainTextSelectionEndIndex = tag.plainTextBeginIndex + processedChange.length;
|
6534
|
+
processedChange = '';
|
6535
|
+
lastProcessedHTMLIndex = closeTagIdx + closeTagLength;
|
6536
|
+
}
|
6537
|
+
else {
|
6538
|
+
// only part of the tag should be removed
|
6539
|
+
let startChangeDiff = 0;
|
6540
|
+
let endChangeDiff = 0;
|
6541
|
+
// need to check only rangeStart > tag.plainTextBeginIndex as when rangeStart === tag.plainTextBeginIndex startChangeDiff = 0 and mentionTagLength shouldn't be subtracted
|
6542
|
+
if (rangeStart > tag.plainTextBeginIndex) {
|
6543
|
+
startChangeDiff = rangeStart - tag.plainTextBeginIndex - mentionTagLength;
|
6544
|
+
}
|
6545
|
+
endChangeDiff = rangeEnd - tag.plainTextBeginIndex - mentionTagLength;
|
6546
|
+
result += htmlText.substring(lastProcessedHTMLIndex, tag.openTagIdx + tag.openTagBody.length + startChangeDiff);
|
6547
|
+
// plainTextSelectionEndIndex = rangeStart + processedChange.length;
|
6548
|
+
lastProcessedHTMLIndex = tag.openTagIdx + tag.openTagBody.length + endChangeDiff;
|
6549
|
+
// processed change should not be changed as it should be added after the tag
|
6550
|
+
}
|
6551
|
+
return [result, processedChange, lastProcessedHTMLIndex, plainTextSelectionEndIndex];
|
6552
|
+
};
|
6553
|
+
/* @conditional-compile-remove(mention) */
|
6554
|
+
/**
|
6555
|
+
* Go through the text and update it with the changed text
|
6556
|
+
*
|
6557
|
+
* @private
|
6558
|
+
*/
|
6559
|
+
const updateHTML = (htmlText, oldPlainText, newPlainText, tags, startIndex, oldPlainTextEndIndex, change, mentionTrigger) => {
|
6560
|
+
let result = '';
|
6561
|
+
if (tags.length === 0) {
|
6562
|
+
// no tags added yet
|
6563
|
+
return [newPlainText, null];
|
6564
|
+
}
|
6565
|
+
if (startIndex === 0 && oldPlainTextEndIndex === oldPlainText.length) {
|
6566
|
+
// the whole text is changed
|
6567
|
+
return [newPlainText, null];
|
6568
|
+
}
|
6569
|
+
let lastProcessedHTMLIndex = 0;
|
6570
|
+
// the value can be updated with empty string when the change covers more than 1 place (tag + before or after the tag)
|
6571
|
+
// in this case change won't be added as part of the tag
|
6572
|
+
// e.g.: change is before and partially in tag => change will be added before the tag and outdated text in the tag will be removed
|
6573
|
+
// e.g.: change is after and partially in tag => change will be added after the tag and outdated text in the tag will be removed
|
6574
|
+
// e.g.: change is on the beginning of the tag => change will be added before the tag
|
6575
|
+
// e.g.: change is on the end of the tag => change will be added to the tag if it's not mention and after the tag if it's mention
|
6576
|
+
let processedChange = change;
|
6577
|
+
// end tag plain text index of the last processed tag
|
6578
|
+
let lastProcessedPlainTextTagEndIndex = 0;
|
6579
|
+
// as some tags/text can be removed fully, selectionEnd should be updated correctly
|
6580
|
+
let changeNewEndIndex = null;
|
6581
|
+
for (let i = 0; i < tags.length; i++) {
|
6582
|
+
const tag = tags[i];
|
6583
|
+
if (tag.plainTextBeginIndex === undefined) {
|
6584
|
+
continue;
|
6585
|
+
}
|
6586
|
+
// all plain text indexes includes trigger length for the mention that shouldn't be included in
|
6587
|
+
// htmlText.substring because html strings don't include the trigger
|
6588
|
+
// mentionTagLength will be set only for 'msft-mention', otherwise should be 0
|
6589
|
+
let mentionTagLength = 0;
|
6590
|
+
let isMentionTag = false;
|
6591
|
+
if (tag.tagType === 'msft-mention') {
|
6592
|
+
mentionTagLength = mentionTrigger.length;
|
6593
|
+
isMentionTag = true;
|
6594
|
+
}
|
6595
|
+
//change start is before the open tag
|
6596
|
+
if (startIndex <= tag.plainTextBeginIndex) {
|
6597
|
+
// Math.max(lastProcessedPlainTextTagEndIndex, startIndex) is used as startIndex may not be in [[previous tag].plainTextEndIndex - tag.plainTextBeginIndex] range
|
6598
|
+
const startChangeDiff = tag.plainTextBeginIndex - Math.max(lastProcessedPlainTextTagEndIndex, startIndex);
|
6599
|
+
result += htmlText.substring(lastProcessedHTMLIndex, tag.openTagIdx - startChangeDiff) + processedChange;
|
6600
|
+
if (oldPlainTextEndIndex <= tag.plainTextBeginIndex) {
|
6601
|
+
// the whole change is before tag start
|
6602
|
+
// oldPlainTextEndIndex already includes mentionTag length
|
6603
|
+
const endChangeDiff = tag.plainTextBeginIndex - oldPlainTextEndIndex;
|
6604
|
+
lastProcessedHTMLIndex = tag.openTagIdx - endChangeDiff;
|
6605
|
+
processedChange = '';
|
6606
|
+
// the change is handled; exit
|
6607
|
+
break;
|
6608
|
+
}
|
6609
|
+
else {
|
6610
|
+
// change continues in the tag
|
6611
|
+
lastProcessedHTMLIndex = tag.openTagIdx;
|
6612
|
+
processedChange = '';
|
6613
|
+
// proceed to the next check
|
6614
|
+
}
|
6615
|
+
}
|
6616
|
+
let plainTextEndIndex = 0;
|
6617
|
+
let closeTagIdx = 0;
|
6618
|
+
let closeTagLength = 0;
|
6619
|
+
if (tag.plainTextEndIndex !== undefined && tag.closeTagIdx !== undefined) {
|
6620
|
+
// close tag exists
|
6621
|
+
plainTextEndIndex = tag.plainTextEndIndex;
|
6622
|
+
closeTagIdx = tag.closeTagIdx;
|
6623
|
+
// tag.tagType.length + </>
|
6624
|
+
closeTagLength = tag.tagType.length + 3;
|
6625
|
+
}
|
6626
|
+
else {
|
6627
|
+
// no close tag
|
6628
|
+
plainTextEndIndex = tag.plainTextBeginIndex;
|
6629
|
+
closeTagIdx = tag.openTagIdx + tag.openTagBody.length;
|
6630
|
+
closeTagLength = 0;
|
6631
|
+
}
|
6632
|
+
if (startIndex < plainTextEndIndex) {
|
6633
|
+
// change started before the end tag
|
6634
|
+
if (startIndex <= tag.plainTextBeginIndex && oldPlainTextEndIndex === plainTextEndIndex) {
|
6635
|
+
// the change is a tag or starts before the tag
|
6636
|
+
// tag should be removed, no matter if there are subtags
|
6637
|
+
result += htmlText.substring(lastProcessedHTMLIndex, tag.openTagIdx) + processedChange;
|
6638
|
+
processedChange = '';
|
6639
|
+
lastProcessedHTMLIndex = closeTagIdx + closeTagLength;
|
6640
|
+
// the change is handled; exit
|
6641
|
+
break;
|
6642
|
+
}
|
6643
|
+
else if (startIndex >= tag.plainTextBeginIndex && oldPlainTextEndIndex < plainTextEndIndex) {
|
6644
|
+
// edge case: the change is between tag
|
6645
|
+
if (isMentionTag) {
|
6646
|
+
if (change !== '') {
|
6647
|
+
// mention tag should be deleted when user tries to edit it
|
6648
|
+
result += htmlText.substring(lastProcessedHTMLIndex, tag.openTagIdx) + processedChange;
|
6649
|
+
changeNewEndIndex = tag.plainTextBeginIndex + processedChange.length;
|
6650
|
+
processedChange = '';
|
6651
|
+
lastProcessedHTMLIndex = closeTagIdx + closeTagLength;
|
6652
|
+
}
|
6653
|
+
else {
|
6654
|
+
const [resultValue, updatedChange, htmlIndex, plainTextSelectionEndIndex] = handleMentionTagUpdate(htmlText, oldPlainText, lastProcessedHTMLIndex, processedChange, tag, closeTagIdx, closeTagLength, plainTextEndIndex, startIndex, oldPlainTextEndIndex, mentionTagLength);
|
6655
|
+
result += resultValue;
|
6656
|
+
changeNewEndIndex = plainTextSelectionEndIndex;
|
6657
|
+
processedChange = updatedChange;
|
6658
|
+
lastProcessedHTMLIndex = htmlIndex;
|
6659
|
+
}
|
6660
|
+
// the change is handled; exit
|
6661
|
+
break;
|
6662
|
+
}
|
6663
|
+
else if (tag.subTags !== undefined && tag.subTags.length !== 0 && tag.content) {
|
6664
|
+
// with subtags
|
6665
|
+
// before the tag content
|
6666
|
+
const stringBefore = htmlText.substring(lastProcessedHTMLIndex, tag.openTagIdx + tag.openTagBody.length);
|
6667
|
+
lastProcessedHTMLIndex = closeTagIdx;
|
6668
|
+
const [content, updatedChangeNewEndIndex] = updateHTML(tag.content, oldPlainText, newPlainText, tag.subTags, startIndex - mentionTagLength, oldPlainTextEndIndex - mentionTagLength, processedChange, mentionTrigger);
|
6669
|
+
result += stringBefore + content;
|
6670
|
+
changeNewEndIndex = updatedChangeNewEndIndex;
|
6671
|
+
break;
|
6672
|
+
}
|
6673
|
+
else {
|
6674
|
+
// no subtags
|
6675
|
+
const startChangeDiff = startIndex - tag.plainTextBeginIndex - mentionTagLength;
|
6676
|
+
const endChangeDiff = oldPlainTextEndIndex - tag.plainTextBeginIndex - mentionTagLength;
|
6677
|
+
result +=
|
6678
|
+
htmlText.substring(lastProcessedHTMLIndex, tag.openTagIdx + tag.openTagBody.length + startChangeDiff) +
|
6679
|
+
processedChange;
|
6680
|
+
processedChange = '';
|
6681
|
+
lastProcessedHTMLIndex = tag.openTagIdx + tag.openTagBody.length + endChangeDiff;
|
6682
|
+
// the change is handled; exit
|
6683
|
+
break;
|
6684
|
+
}
|
6685
|
+
}
|
6686
|
+
else if (startIndex > tag.plainTextBeginIndex && oldPlainTextEndIndex > plainTextEndIndex) {
|
6687
|
+
//the change started in the tag but finishes somewhere further
|
6688
|
+
const startChangeDiff = startIndex - tag.plainTextBeginIndex - mentionTagLength;
|
6689
|
+
if (isMentionTag) {
|
6690
|
+
const [resultValue, updatedChange, htmlIndex] = handleMentionTagUpdate(htmlText, oldPlainText, lastProcessedHTMLIndex, oldPlainText.substring(startIndex, startIndex + 1) !== ' ' && change === '' ? ' ' : '', // if substring !== ' ' && change is empty -> the change should be " " and not empty string but " " wasn't included in change; otherwise the part of mention should be just deleted without processedChange update
|
6691
|
+
tag, closeTagIdx, closeTagLength, plainTextEndIndex, startIndex, oldPlainTextEndIndex, mentionTagLength);
|
6692
|
+
result += resultValue;
|
6693
|
+
lastProcessedHTMLIndex = htmlIndex;
|
6694
|
+
processedChange = updatedChange;
|
6695
|
+
// no need to handle plainTextSelectionEndIndex as the change will be added later
|
6696
|
+
// proceed with the next calculations
|
6697
|
+
}
|
6698
|
+
else if (tag.subTags !== undefined && tag.subTags.length !== 0 && tag.content !== undefined) {
|
6699
|
+
// with subtags
|
6700
|
+
// before the tag content
|
6701
|
+
const stringBefore = htmlText.substring(lastProcessedHTMLIndex, tag.openTagIdx + tag.openTagBody.length);
|
6702
|
+
lastProcessedHTMLIndex = closeTagIdx;
|
6703
|
+
const [content] = updateHTML(tag.content, oldPlainText, newPlainText, tag.subTags, startIndex - mentionTagLength, oldPlainTextEndIndex - mentionTagLength, '', // the part of the tag should be just deleted without processedChange update and change will be added after this tag
|
6704
|
+
mentionTrigger);
|
6705
|
+
result += stringBefore + content;
|
6706
|
+
// proceed with the next calculations
|
6707
|
+
}
|
6708
|
+
else {
|
6709
|
+
// no subtags
|
6710
|
+
result += htmlText.substring(lastProcessedHTMLIndex, tag.openTagIdx + tag.openTagBody.length + startChangeDiff);
|
6711
|
+
lastProcessedHTMLIndex = closeTagIdx;
|
6712
|
+
// proceed with the next calculations
|
6713
|
+
}
|
6714
|
+
}
|
6715
|
+
else if (startIndex < tag.plainTextBeginIndex && oldPlainTextEndIndex > plainTextEndIndex) {
|
6716
|
+
// the change starts before the tag and finishes after it
|
6717
|
+
// tag should be removed, no matter if there are subtags
|
6718
|
+
// no need to save anything between lastProcessedHTMLIndex and closeTagIdx + closeTagLength
|
6719
|
+
lastProcessedHTMLIndex = closeTagIdx + closeTagLength;
|
6720
|
+
// proceed with the next calculations
|
6721
|
+
}
|
6722
|
+
else if (startIndex === tag.plainTextBeginIndex && oldPlainTextEndIndex > plainTextEndIndex) {
|
6723
|
+
// the change starts in the tag and finishes after it
|
6724
|
+
// tag should be removed, no matter if there are subtags
|
6725
|
+
result += htmlText.substring(lastProcessedHTMLIndex, tag.openTagIdx);
|
6726
|
+
// processedChange shouldn't be updated as it will be added after the tag
|
6727
|
+
lastProcessedHTMLIndex = closeTagIdx + closeTagLength;
|
6728
|
+
// proceed with the next calculations
|
6729
|
+
}
|
6730
|
+
else if (startIndex < tag.plainTextBeginIndex && oldPlainTextEndIndex < plainTextEndIndex) {
|
6731
|
+
// the change starts before the tag and ends in a tag
|
6732
|
+
if (isMentionTag) {
|
6733
|
+
const [resultValue, , htmlIndex] = handleMentionTagUpdate(htmlText, oldPlainText, lastProcessedHTMLIndex, '', // the part of mention should be just deleted without processedChange update
|
6734
|
+
tag, closeTagIdx, closeTagLength, plainTextEndIndex, startIndex, oldPlainTextEndIndex, mentionTagLength);
|
6735
|
+
changeNewEndIndex = tag.plainTextBeginIndex;
|
6736
|
+
result += resultValue;
|
6737
|
+
lastProcessedHTMLIndex = htmlIndex;
|
6738
|
+
}
|
6739
|
+
else if (tag.subTags !== undefined && tag.subTags.length !== 0 && tag.content !== undefined) {
|
6740
|
+
// with subtags
|
6741
|
+
// before the tag content
|
6742
|
+
const stringBefore = htmlText.substring(lastProcessedHTMLIndex, tag.openTagIdx + tag.openTagBody.length);
|
6743
|
+
lastProcessedHTMLIndex = closeTagIdx;
|
6744
|
+
const [content] = updateHTML(tag.content, oldPlainText, newPlainText, tag.subTags, startIndex - mentionTagLength, oldPlainTextEndIndex - mentionTagLength, processedChange, // processedChange should equal '' and the part of the tag should be deleted as the change was handled before this tag
|
6745
|
+
mentionTrigger);
|
6746
|
+
result += stringBefore + content;
|
6747
|
+
}
|
6748
|
+
else {
|
6749
|
+
// no subtags
|
6750
|
+
result +=
|
6751
|
+
htmlText.substring(lastProcessedHTMLIndex, tag.openTagIdx + tag.openTagBody.length) + processedChange;
|
6752
|
+
processedChange = '';
|
6753
|
+
// oldPlainTextEndIndex already includes mentionTag length
|
6754
|
+
const endChangeDiff = plainTextEndIndex - oldPlainTextEndIndex;
|
6755
|
+
// as change may be before the end of the tag, we need to add the rest of the tag
|
6756
|
+
lastProcessedHTMLIndex = closeTagIdx - endChangeDiff;
|
6757
|
+
}
|
6758
|
+
// the change is handled; exit
|
6759
|
+
break;
|
6760
|
+
}
|
6761
|
+
else if (startIndex > tag.plainTextBeginIndex && oldPlainTextEndIndex === plainTextEndIndex) {
|
6762
|
+
// the change starts in the tag and ends at the end of a tag
|
6763
|
+
if (isMentionTag) {
|
6764
|
+
if (change !== '' && startIndex === plainTextEndIndex) {
|
6765
|
+
// non empty change at the end of the mention tag to be added after the mention tag
|
6766
|
+
result += htmlText.substring(lastProcessedHTMLIndex, closeTagIdx + closeTagLength) + processedChange;
|
6767
|
+
changeNewEndIndex = plainTextEndIndex + processedChange.length;
|
6768
|
+
processedChange = '';
|
6769
|
+
lastProcessedHTMLIndex = closeTagIdx + closeTagLength;
|
6770
|
+
}
|
6771
|
+
else if (change !== '') {
|
6772
|
+
// mention tag should be deleted when user tries to edit it
|
6773
|
+
result += htmlText.substring(lastProcessedHTMLIndex, tag.openTagIdx) + processedChange;
|
6774
|
+
changeNewEndIndex = tag.plainTextBeginIndex + processedChange.length;
|
6775
|
+
processedChange = '';
|
6776
|
+
lastProcessedHTMLIndex = closeTagIdx + closeTagLength;
|
6777
|
+
}
|
6778
|
+
else {
|
6779
|
+
const [resultValue, updatedChange, htmlIndex, plainTextSelectionEndIndex] = handleMentionTagUpdate(htmlText, oldPlainText, lastProcessedHTMLIndex, processedChange, tag, closeTagIdx, closeTagLength, plainTextEndIndex, startIndex, oldPlainTextEndIndex, mentionTagLength);
|
6780
|
+
result += resultValue;
|
6781
|
+
processedChange = updatedChange;
|
6782
|
+
lastProcessedHTMLIndex = htmlIndex;
|
6783
|
+
changeNewEndIndex = plainTextSelectionEndIndex;
|
6784
|
+
}
|
6785
|
+
// the change is handled; exit
|
6786
|
+
break;
|
6787
|
+
}
|
6788
|
+
else if (tag.subTags !== undefined && tag.subTags.length !== 0 && tag.content !== undefined) {
|
6789
|
+
// with subtags
|
6790
|
+
// before the tag content
|
6791
|
+
const stringBefore = htmlText.substring(lastProcessedHTMLIndex, tag.openTagIdx + tag.openTagBody.length);
|
6792
|
+
lastProcessedHTMLIndex = closeTagIdx;
|
6793
|
+
const [content, updatedChangeNewEndIndex] = updateHTML(tag.content, oldPlainText, newPlainText, tag.subTags, startIndex - mentionTagLength, oldPlainTextEndIndex - mentionTagLength, processedChange, mentionTrigger);
|
6794
|
+
result += stringBefore + content;
|
6795
|
+
changeNewEndIndex = updatedChangeNewEndIndex;
|
6796
|
+
break;
|
6797
|
+
}
|
6798
|
+
else {
|
6799
|
+
// no subtags
|
6800
|
+
const startChangeDiff = startIndex - tag.plainTextBeginIndex - mentionTagLength;
|
6801
|
+
result +=
|
6802
|
+
htmlText.substring(lastProcessedHTMLIndex, tag.openTagIdx + tag.openTagBody.length + startChangeDiff) +
|
6803
|
+
processedChange;
|
6804
|
+
processedChange = '';
|
6805
|
+
lastProcessedHTMLIndex = closeTagIdx;
|
6806
|
+
// the change is handled; exit
|
6807
|
+
break;
|
6808
|
+
}
|
6809
|
+
}
|
6810
|
+
lastProcessedPlainTextTagEndIndex = plainTextEndIndex;
|
6811
|
+
}
|
6812
|
+
if (i === tags.length - 1 && oldPlainTextEndIndex >= plainTextEndIndex) {
|
6813
|
+
// the last tag should handle the end of the change if needed
|
6814
|
+
// oldPlainTextEndIndex already includes mentionTag length
|
6815
|
+
const endChangeDiff = oldPlainTextEndIndex - plainTextEndIndex;
|
6816
|
+
if (startIndex >= plainTextEndIndex) {
|
6817
|
+
const startChangeDiff = startIndex - plainTextEndIndex;
|
6818
|
+
result +=
|
6819
|
+
htmlText.substring(lastProcessedHTMLIndex, closeTagIdx + closeTagLength + startChangeDiff) + processedChange;
|
6820
|
+
}
|
6821
|
+
else {
|
6822
|
+
result += htmlText.substring(lastProcessedHTMLIndex, closeTagIdx + closeTagLength) + processedChange;
|
6823
|
+
}
|
6824
|
+
processedChange = '';
|
6825
|
+
lastProcessedHTMLIndex = closeTagIdx + closeTagLength + endChangeDiff;
|
6826
|
+
// the change is handled; exit
|
6827
|
+
// break is not required here as this is the last element but added for consistency
|
6828
|
+
break;
|
6829
|
+
}
|
6830
|
+
}
|
6831
|
+
if (lastProcessedHTMLIndex < htmlText.length) {
|
6832
|
+
result += htmlText.substring(lastProcessedHTMLIndex);
|
6833
|
+
}
|
6834
|
+
return [result, changeNewEndIndex];
|
6835
|
+
};
|
6836
|
+
/* @conditional-compile-remove(mention) */
|
6837
|
+
/**
|
6838
|
+
* Given the oldText and newText, find the start index, old end index and new end index for the changes
|
6839
|
+
*
|
6840
|
+
* @param oldText - the old text
|
6841
|
+
* @param newText - the new text
|
6842
|
+
* @param selectionEnd - the end of the selection
|
6843
|
+
* @returns change start index, old end index and new end index. The old and new end indexes are exclusive.
|
6844
|
+
* @private
|
6845
|
+
*/
|
6846
|
+
const findStringsDiffIndexes = (oldText, newText, selectionEnd // should be a valid position in the input field
|
6847
|
+
) => {
|
6848
|
+
const newTextLength = newText.length;
|
6849
|
+
const oldTextLength = oldText.length;
|
6850
|
+
let changeStart = 0;
|
6851
|
+
let newChangeEnd = newTextLength;
|
6852
|
+
let oldChangeEnd = oldTextLength;
|
6853
|
+
const length = Math.min(newTextLength, oldTextLength, selectionEnd);
|
6854
|
+
for (let i = 0; i < length; i++) {
|
6855
|
+
if (newText[i] !== oldText[i]) {
|
6856
|
+
// the symbol with changeStart index is updated
|
6857
|
+
changeStart = i;
|
6858
|
+
break;
|
6859
|
+
}
|
6860
|
+
else if (i === length - 1 && newText[i] === oldText[i]) {
|
6861
|
+
// the symbol is added at the end of inputTextValue
|
6862
|
+
changeStart = length;
|
6863
|
+
break;
|
6864
|
+
}
|
6865
|
+
}
|
6866
|
+
if (oldTextLength < newTextLength) {
|
6867
|
+
//insert or replacement
|
6868
|
+
if (oldTextLength === changeStart) {
|
6869
|
+
// when change was at the end of string
|
6870
|
+
// Change is found
|
6871
|
+
newChangeEnd = newTextLength;
|
6872
|
+
oldChangeEnd = oldTextLength;
|
6873
|
+
}
|
6874
|
+
else {
|
6875
|
+
for (let i = 1; i < newTextLength && oldTextLength - i >= changeStart; i++) {
|
6876
|
+
newChangeEnd = newTextLength - i - 1;
|
6877
|
+
oldChangeEnd = oldTextLength - i - 1;
|
6878
|
+
if (newText[newChangeEnd] !== oldText[oldChangeEnd]) {
|
6879
|
+
// Change is found
|
6880
|
+
break;
|
6881
|
+
}
|
6882
|
+
}
|
6883
|
+
// make indexes exclusive
|
6884
|
+
newChangeEnd += 1;
|
6885
|
+
oldChangeEnd += 1;
|
6886
|
+
}
|
6887
|
+
}
|
6888
|
+
else if (oldTextLength > newTextLength) {
|
6889
|
+
//deletion or replacement
|
6890
|
+
if (newTextLength === changeStart) {
|
6891
|
+
// when change was at the end of string
|
6892
|
+
// Change is found
|
6893
|
+
newChangeEnd = newTextLength;
|
6894
|
+
oldChangeEnd = oldTextLength;
|
6895
|
+
}
|
6896
|
+
else {
|
6897
|
+
for (let i = 1; i < oldTextLength && newTextLength - i >= changeStart; i++) {
|
6898
|
+
newChangeEnd = newTextLength - i - 1;
|
6899
|
+
oldChangeEnd = oldTextLength - i - 1;
|
6900
|
+
if (newText[newChangeEnd] !== oldText[oldChangeEnd]) {
|
6901
|
+
// Change is found
|
6902
|
+
break;
|
6903
|
+
}
|
6904
|
+
}
|
6905
|
+
// make indexes exclusive
|
6906
|
+
newChangeEnd += 1;
|
6907
|
+
oldChangeEnd += 1;
|
6908
|
+
}
|
6909
|
+
}
|
6910
|
+
else {
|
6911
|
+
//replacement
|
6912
|
+
for (let i = 1; i < oldTextLength && oldTextLength - i >= changeStart; i++) {
|
6913
|
+
newChangeEnd = newTextLength - i - 1;
|
6914
|
+
oldChangeEnd = oldTextLength - i - 1;
|
6915
|
+
if (newText[newChangeEnd] !== oldText[oldChangeEnd]) {
|
6916
|
+
// Change is found
|
6917
|
+
break;
|
6918
|
+
}
|
6919
|
+
}
|
6920
|
+
// make indexes exclusive if they aren't equal to the length of the string
|
6921
|
+
if (newChangeEnd !== newText.length) {
|
6922
|
+
newChangeEnd += 1;
|
6923
|
+
}
|
6924
|
+
if (oldChangeEnd !== oldText.length) {
|
6925
|
+
oldChangeEnd += 1;
|
6926
|
+
}
|
6927
|
+
}
|
6928
|
+
return { changeStart, oldChangeEnd, newChangeEnd };
|
6929
|
+
};
|
6930
|
+
/* @conditional-compile-remove(mention) */
|
6931
|
+
const htmlStringForMentionSuggestion = (suggestion, localeStrings) => {
|
6932
|
+
const idHTML = ' id ="' + suggestion.id + '"';
|
6933
|
+
const displayTextHTML = ' displayText ="' + suggestion.displayText + '"';
|
6934
|
+
const displayText = getDisplayNameForMentionSuggestion(suggestion, localeStrings);
|
6935
|
+
return '<msft-mention' + idHTML + displayTextHTML + '>' + displayText + '</msft-mention>';
|
6936
|
+
};
|
6937
|
+
/* @conditional-compile-remove(mention) */
|
6938
|
+
const getDisplayNameForMentionSuggestion = (suggestion, localeStrings) => {
|
6939
|
+
const displayNamePlaceholder = localeStrings.participantItem.displayNamePlaceholder;
|
6940
|
+
return suggestion.displayText !== '' ? suggestion.displayText : displayNamePlaceholder !== null && displayNamePlaceholder !== void 0 ? displayNamePlaceholder : '';
|
6941
|
+
};
|
6942
|
+
/* @conditional-compile-remove(mention) */
|
6943
|
+
/**
|
6944
|
+
* Parse the text and return the tags and the plain text in one go
|
6945
|
+
* @param text - The text to parse for HTML tags
|
6946
|
+
* @param trigger The trigger to show for the msft-mention tag in plain text
|
6947
|
+
*
|
6948
|
+
* @returns An array of tags and the plain text representation
|
6949
|
+
*/
|
6950
|
+
const textToTagParser = (text, trigger) => {
|
6951
|
+
var _a, _b;
|
6952
|
+
const tags = []; // Tags passed back to the caller
|
6953
|
+
const tagParseStack = []; // Local stack to use while parsing
|
6954
|
+
let plainTextRepresentation = '';
|
6955
|
+
let parseIndex = 0;
|
6956
|
+
while (parseIndex < text.length) {
|
6957
|
+
const foundHtmlTag = findNextHtmlTag(text, parseIndex);
|
6958
|
+
if (!foundHtmlTag) {
|
6959
|
+
if (parseIndex !== 0) {
|
6960
|
+
// Add the remaining text to the plain text representation
|
6961
|
+
plainTextRepresentation += text.substring(parseIndex);
|
6962
|
+
}
|
6963
|
+
else {
|
6964
|
+
plainTextRepresentation = text;
|
6965
|
+
}
|
6966
|
+
break;
|
6967
|
+
}
|
6968
|
+
if (foundHtmlTag.type === 'open' || foundHtmlTag.type === 'self-closing') {
|
6969
|
+
const nextTag = parseOpenTag(foundHtmlTag.content, foundHtmlTag.startIdx);
|
6970
|
+
// Add the plain text between the last tag and this one found
|
6971
|
+
plainTextRepresentation += text.substring(parseIndex, foundHtmlTag.startIdx);
|
6972
|
+
nextTag.plainTextBeginIndex = plainTextRepresentation.length;
|
6973
|
+
if (foundHtmlTag.type === 'open') {
|
6974
|
+
tagParseStack.push(nextTag);
|
6975
|
+
}
|
6976
|
+
else {
|
6977
|
+
nextTag.content = '';
|
6978
|
+
nextTag.plainTextBeginIndex = plainTextRepresentation.length;
|
6979
|
+
nextTag.plainTextEndIndex = plainTextRepresentation.length;
|
6980
|
+
addTag(nextTag, tagParseStack, tags);
|
6981
|
+
}
|
6982
|
+
}
|
6983
|
+
if (foundHtmlTag.type === 'close') {
|
6984
|
+
const currentOpenTag = tagParseStack.pop();
|
6985
|
+
const closeTagType = foundHtmlTag.content.substring(2, foundHtmlTag.content.length - 1).toLowerCase();
|
6986
|
+
if (currentOpenTag && currentOpenTag.tagType === closeTagType) {
|
6987
|
+
// Tag startIdx is absolute to the text. This is updated later to be relative to the parent tag
|
6988
|
+
currentOpenTag.content = text.substring(currentOpenTag.openTagIdx + currentOpenTag.openTagBody.length, foundHtmlTag.startIdx);
|
6989
|
+
// Insert the plain text pieces for the sub tags
|
6990
|
+
if (currentOpenTag.tagType === 'msft-mention') {
|
6991
|
+
plainTextRepresentation =
|
6992
|
+
plainTextRepresentation.slice(0, currentOpenTag.plainTextBeginIndex) +
|
6993
|
+
trigger +
|
6994
|
+
plainTextRepresentation.slice(currentOpenTag.plainTextBeginIndex);
|
6995
|
+
}
|
6996
|
+
if (!currentOpenTag.subTags) {
|
6997
|
+
plainTextRepresentation += currentOpenTag.content;
|
6998
|
+
}
|
6999
|
+
else if (currentOpenTag.subTags.length > 0) {
|
7000
|
+
// Add text after the last tag
|
7001
|
+
const lastSubTag = currentOpenTag.subTags[currentOpenTag.subTags.length - 1];
|
7002
|
+
const startOfRemainingText = ((_a = lastSubTag.closeTagIdx) !== null && _a !== void 0 ? _a : lastSubTag.openTagIdx) + lastSubTag.tagType.length + 3;
|
7003
|
+
const trailingText = currentOpenTag.content.substring(startOfRemainingText);
|
7004
|
+
plainTextRepresentation += trailingText;
|
7005
|
+
}
|
7006
|
+
currentOpenTag.plainTextEndIndex = plainTextRepresentation.length;
|
7007
|
+
addTag(currentOpenTag, tagParseStack, tags);
|
7008
|
+
}
|
7009
|
+
else {
|
7010
|
+
console.error('Unexpected close tag found. Got "' +
|
7011
|
+
closeTagType +
|
7012
|
+
'" but expected "' +
|
7013
|
+
((_b = tagParseStack[tagParseStack.length - 1]) === null || _b === void 0 ? void 0 : _b.tagType) +
|
7014
|
+
'"');
|
7015
|
+
}
|
7016
|
+
}
|
7017
|
+
// Update parsing index; move past the end of the close tag
|
7018
|
+
parseIndex = foundHtmlTag.startIdx + foundHtmlTag.content.length;
|
7019
|
+
} // While parseIndex < text.length loop
|
7020
|
+
return [tags, plainTextRepresentation];
|
7021
|
+
};
|
7022
|
+
/* @conditional-compile-remove(mention) */
|
7023
|
+
const parseOpenTag = (tag, startIdx) => {
|
7024
|
+
const tagType = tag
|
7025
|
+
.substring(1, tag.length - 1)
|
7026
|
+
.split(' ')[0]
|
7027
|
+
.toLowerCase()
|
7028
|
+
.replace('/', '');
|
7029
|
+
return {
|
7030
|
+
tagType,
|
7031
|
+
openTagIdx: startIdx,
|
7032
|
+
openTagBody: tag
|
7033
|
+
};
|
7034
|
+
};
|
7035
|
+
/* @conditional-compile-remove(mention) */
|
7036
|
+
const findNextHtmlTag = (text, startIndex) => {
|
7037
|
+
const tagStartIndex = text.indexOf('<', startIndex);
|
7038
|
+
if (tagStartIndex === -1) {
|
7039
|
+
// No more tags
|
7040
|
+
return undefined;
|
7041
|
+
}
|
7042
|
+
const tagEndIndex = text.indexOf('>', tagStartIndex);
|
7043
|
+
if (tagEndIndex === -1) {
|
7044
|
+
// No close tag
|
7045
|
+
return undefined;
|
7046
|
+
}
|
7047
|
+
const tag = text.substring(tagStartIndex, tagEndIndex + 1);
|
7048
|
+
let type = 'open';
|
7049
|
+
if (tag[1] === '/') {
|
7050
|
+
type = 'close';
|
7051
|
+
}
|
7052
|
+
else if (tag[tag.length - 2] === '/') {
|
7053
|
+
type = 'self-closing';
|
7054
|
+
}
|
7055
|
+
return {
|
7056
|
+
content: tag,
|
7057
|
+
startIdx: tagStartIndex,
|
7058
|
+
type
|
7059
|
+
};
|
7060
|
+
};
|
7061
|
+
/* @conditional-compile-remove(mention) */
|
7062
|
+
const addTag = (tag, parseStack, tags) => {
|
7063
|
+
var _a;
|
7064
|
+
// Add as sub-tag to the parent stack tag, if there is one
|
7065
|
+
const parentTag = parseStack[parseStack.length - 1];
|
7066
|
+
if (parentTag) {
|
7067
|
+
// Adjust the open tag index to be relative to the parent tag
|
7068
|
+
const parentContentStartIdx = parentTag.openTagIdx + parentTag.openTagBody.length;
|
7069
|
+
const relativeIdx = tag.openTagIdx - parentContentStartIdx;
|
7070
|
+
tag.openTagIdx = relativeIdx;
|
7071
|
+
}
|
7072
|
+
if (!tag.closeTagIdx) {
|
7073
|
+
// If the tag is self-closing, the close tag is the same as the open tag
|
7074
|
+
if (tag.openTagBody[tag.openTagBody.length - 2] === '/') {
|
7075
|
+
tag.closeTagIdx = tag.openTagIdx;
|
7076
|
+
}
|
7077
|
+
else {
|
7078
|
+
// Otherwise, the close tag index is the open tag index + the open tag body + the content length
|
7079
|
+
tag.closeTagIdx = tag.openTagIdx + tag.openTagBody.length + ((_a = tag.content) !== null && _a !== void 0 ? _a : []).length;
|
7080
|
+
}
|
7081
|
+
}
|
7082
|
+
// Put the tag where it belongs
|
7083
|
+
if (!parentTag) {
|
7084
|
+
tags.push(tag);
|
7085
|
+
}
|
7086
|
+
else {
|
7087
|
+
if (!parentTag.subTags) {
|
7088
|
+
parentTag.subTags = [tag];
|
7089
|
+
}
|
7090
|
+
else {
|
7091
|
+
parentTag.subTags.push(tag);
|
7092
|
+
}
|
7093
|
+
}
|
7094
|
+
};
|
5888
7095
|
|
5889
7096
|
// Copyright (c) Microsoft Corporation.
|
5890
7097
|
/**
|
@@ -6189,7 +7396,9 @@ const MAXIMUM_LENGTH_OF_MESSAGE$1 = 8000;
|
|
6189
7396
|
* @public
|
6190
7397
|
*/
|
6191
7398
|
const SendBox = (props) => {
|
6192
|
-
const { disabled, systemMessage, supportNewline, onSendMessage, onTyping, onRenderIcon, onRenderSystemMessage, styles, autoFocus
|
7399
|
+
const { disabled, systemMessage, supportNewline, onSendMessage, onTyping, onRenderIcon, onRenderSystemMessage, styles, autoFocus,
|
7400
|
+
/* @conditional-compile-remove(mention) */
|
7401
|
+
mentionLookupOptions } = props;
|
6193
7402
|
const theme = useTheme();
|
6194
7403
|
const localeStrings = useLocale$1().strings.sendBox;
|
6195
7404
|
const strings = Object.assign(Object.assign({}, localeStrings), props.strings);
|
@@ -6212,15 +7421,16 @@ const SendBox = (props) => {
|
|
6212
7421
|
setFileUploadsPendingError({ message: strings.fileUploadsPendingError, timestamp: Date.now() });
|
6213
7422
|
return;
|
6214
7423
|
}
|
6215
|
-
|
7424
|
+
const message = textValue;
|
7425
|
+
// we don't want to send empty messages including spaces, newlines, tabs
|
6216
7426
|
// Message can be empty if there is a valid file upload
|
6217
|
-
if (!EMPTY_MESSAGE_REGEX.test(
|
6218
|
-
onSendMessage && onSendMessage(sanitizeText(
|
7427
|
+
if (!EMPTY_MESSAGE_REGEX.test(message) || hasFile(props)) {
|
7428
|
+
onSendMessage && onSendMessage(sanitizeText(message));
|
6219
7429
|
setTextValue('');
|
6220
7430
|
}
|
6221
7431
|
(_a = sendTextFieldRef.current) === null || _a === void 0 ? void 0 : _a.focus();
|
6222
7432
|
};
|
6223
|
-
const setText = (
|
7433
|
+
const setText = (newValue) => {
|
6224
7434
|
if (newValue === undefined) {
|
6225
7435
|
return;
|
6226
7436
|
}
|
@@ -6242,7 +7452,7 @@ const SendBox = (props) => {
|
|
6242
7452
|
color: !!errorMessage || !hasTextOrFile ? theme.palette.neutralTertiary : theme.palette.themePrimary
|
6243
7453
|
}, styles === null || styles === void 0 ? void 0 : styles.sendMessageIcon), [errorMessage, hasTextOrFile, theme, styles === null || styles === void 0 ? void 0 : styles.sendMessageIcon]);
|
6244
7454
|
const onRenderSendIcon = React.useCallback((isHover) => onRenderIcon ? (onRenderIcon(isHover)) : (React__default['default'].createElement(react.Icon, { iconName: isHover && textValue ? 'SendBoxSendHovered' : 'SendBoxSend', className: mergedSendIconStyle })), [mergedSendIconStyle, onRenderIcon, textValue]);
|
6245
|
-
// Ensure that errors are cleared when there are no files in
|
7455
|
+
// Ensure that errors are cleared when there are no files in sendBox
|
6246
7456
|
React__default['default'].useEffect(() => {
|
6247
7457
|
if (!(activeFileUploads === null || activeFileUploads === void 0 ? void 0 : activeFileUploads.filter((upload) => !upload.error).length)) {
|
6248
7458
|
setFileUploadsPendingError(undefined);
|
@@ -6268,21 +7478,24 @@ const SendBox = (props) => {
|
|
6268
7478
|
uploadCompleted: (_f = (_e = props.strings) === null || _e === void 0 ? void 0 : _e.uploadCompleted) !== null && _f !== void 0 ? _f : localeStrings.uploadCompleted
|
6269
7479
|
} })));
|
6270
7480
|
}, [activeFileUploads, props, localeStrings]);
|
6271
|
-
return (React__default['default'].createElement(react.Stack, { className: react.mergeStyles(sendBoxWrapperStyles
|
7481
|
+
return (React__default['default'].createElement(react.Stack, { className: react.mergeStyles(sendBoxWrapperStyles, { overflow: 'visible' } // This is needed for the mention popup to be visible
|
7482
|
+
) },
|
6272
7483
|
React__default['default'].createElement(SendBoxErrors, Object.assign({}, sendBoxErrorsProps)),
|
6273
7484
|
React__default['default'].createElement(react.Stack, { className: react.mergeStyles(borderAndBoxShadowStyle({
|
6274
7485
|
theme,
|
6275
7486
|
hasErrorMessage: !!errorMessage,
|
6276
7487
|
disabled: !!disabled
|
6277
7488
|
})) },
|
6278
|
-
React__default['default'].createElement(InputBoxComponent, { autoFocus: autoFocus, "data-ui-id": ids.sendboxTextField, inlineChildren: true, disabled: disabled, errorMessage: onRenderSystemMessage ? onRenderSystemMessage(errorMessage) : errorMessage, textFieldRef: sendTextFieldRef, id: "sendbox", inputClassName: sendBoxStyle, placeholderText: strings.placeholderText, textValue: textValue, onChange: setText, onKeyDown: (ev) => {
|
7489
|
+
React__default['default'].createElement(InputBoxComponent, { autoFocus: autoFocus, "data-ui-id": ids.sendboxTextField, inlineChildren: true, disabled: disabled, errorMessage: onRenderSystemMessage ? onRenderSystemMessage(errorMessage) : errorMessage, textFieldRef: sendTextFieldRef, id: "sendbox", inputClassName: sendBoxStyle, placeholderText: strings.placeholderText, textValue: textValue, onChange: (_, newValue) => setText(newValue), onKeyDown: (ev) => {
|
6279
7490
|
const keyWasSendingMessage = ev.key === 'Enter' && (ev.shiftKey === false || !supportNewline);
|
6280
7491
|
if (!keyWasSendingMessage) {
|
6281
7492
|
onTyping === null || onTyping === void 0 ? void 0 : onTyping();
|
6282
7493
|
}
|
6283
7494
|
}, onEnterKeyDown: () => {
|
6284
7495
|
sendMessageOnClick();
|
6285
|
-
}, styles: mergedStyles, supportNewline: supportNewline, maxLength: MAXIMUM_LENGTH_OF_MESSAGE$1
|
7496
|
+
}, styles: mergedStyles, supportNewline: supportNewline, maxLength: MAXIMUM_LENGTH_OF_MESSAGE$1,
|
7497
|
+
/* @conditional-compile-remove(mention) */
|
7498
|
+
mentionLookupOptions: mentionLookupOptions },
|
6286
7499
|
React__default['default'].createElement(VoiceOverButton, { onRenderIcon: onRenderSendIcon, onClick: (e) => {
|
6287
7500
|
if (!textValueOverflow) {
|
6288
7501
|
sendMessageOnClick();
|
@@ -6317,22 +7530,6 @@ const activeFileUploadsTrampoline = (props) => {
|
|
6317
7530
|
return props.activeFileUploads;
|
6318
7531
|
};
|
6319
7532
|
|
6320
|
-
// Copyright (c) Microsoft Corporation.
|
6321
|
-
/**
|
6322
|
-
* @private
|
6323
|
-
*/
|
6324
|
-
react.mergeStyles({
|
6325
|
-
height: '100%',
|
6326
|
-
overflowY: 'auto',
|
6327
|
-
overflowX: 'hidden'
|
6328
|
-
});
|
6329
|
-
/**
|
6330
|
-
* @private
|
6331
|
-
*/
|
6332
|
-
react.mergeStyles({
|
6333
|
-
padding: '0.25rem 0rem 0'
|
6334
|
-
});
|
6335
|
-
|
6336
7533
|
// Copyright (c) Microsoft Corporation.
|
6337
7534
|
/** @private */
|
6338
7535
|
const MESSAGE_STATUS_INDICATOR_SIZE_REM = 1;
|
@@ -6486,7 +7683,11 @@ const defaultChatItemMessageContainer = (overlapAvatarAndMessage) => {
|
|
6486
7683
|
marginRight: '0rem',
|
6487
7684
|
marginLeft: `${messageAvatarGap}rem`,
|
6488
7685
|
width: `calc(100% - ${AVATAR_WIDTH_REM + MESSAGE_AMOUNT_OUT_FROM_EDGE_REM + messageAvatarGap}rem)`,
|
6489
|
-
zIndex: CHAT_MESSAGE_ZINDEX
|
7686
|
+
zIndex: CHAT_MESSAGE_ZINDEX,
|
7687
|
+
'& msft-mention': {
|
7688
|
+
color: '#D83B01',
|
7689
|
+
fontWeight: 600
|
7690
|
+
}
|
6490
7691
|
};
|
6491
7692
|
};
|
6492
7693
|
/**
|
@@ -6810,6 +8011,8 @@ const onRenderSubmitIcon = (color) => {
|
|
6810
8011
|
*/
|
6811
8012
|
const ChatMessageComponentAsEditBox = (props) => {
|
6812
8013
|
const { onCancel, onSubmit, strings, message } = props;
|
8014
|
+
/* @conditional-compile-remove(mention) */
|
8015
|
+
const { mentionLookupOptions } = props;
|
6813
8016
|
const [textValue, setTextValue] = React.useState(message.content || '');
|
6814
8017
|
const [attachedFilesMetadata, setAttachedFilesMetadata] = React__default['default'].useState(getMessageAttachedFilesMetadata(message));
|
6815
8018
|
const editTextFieldRef = React__default['default'].useRef(null);
|
@@ -6851,7 +8054,9 @@ const ChatMessageComponentAsEditBox = (props) => {
|
|
6851
8054
|
onSubmit(textValue, message.metadata, {
|
6852
8055
|
attachedFilesMetadata
|
6853
8056
|
});
|
6854
|
-
}, supportNewline: false, maxLength: MAXIMUM_LENGTH_OF_MESSAGE, errorMessage: textTooLongMessage, styles: editBoxStyles
|
8057
|
+
}, supportNewline: false, maxLength: MAXIMUM_LENGTH_OF_MESSAGE, errorMessage: textTooLongMessage, styles: editBoxStyles,
|
8058
|
+
/* @conditional-compile-remove(mention) */
|
8059
|
+
mentionLookupOptions: mentionLookupOptions },
|
6855
8060
|
React__default['default'].createElement(InputBoxButton, { className: editingButtonStyle, ariaLabel: strings.editBoxCancelButton, tooltipContent: strings.editBoxCancelButton, onRenderIcon: onRenderThemedCancelIcon, onClick: () => {
|
6856
8061
|
onCancel && onCancel(message.messageId);
|
6857
8062
|
}, id: 'dismissIconWrapper' }),
|
@@ -7137,8 +8342,19 @@ const preventUnwantedDismissProps = {
|
|
7137
8342
|
};
|
7138
8343
|
|
7139
8344
|
// Copyright (c) Microsoft Corporation.
|
7140
|
-
|
7141
|
-
|
8345
|
+
/**
|
8346
|
+
* Provides the default implementation for rendering an Mention in a message thread
|
8347
|
+
* @param mention - The mention to render
|
8348
|
+
*
|
8349
|
+
* @private
|
8350
|
+
*/
|
8351
|
+
const defaultOnMentionRender = (mention) => {
|
8352
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
8353
|
+
const MsftMention = 'msft-mention';
|
8354
|
+
return (React__default['default'].createElement(MsftMention, { id: mention.id, displayText: mention.displayText }, mention.displayText));
|
8355
|
+
};
|
8356
|
+
|
8357
|
+
// Copyright (c) Microsoft Corporation.
|
7142
8358
|
/** @private */
|
7143
8359
|
const ChatMessageContent = (props) => {
|
7144
8360
|
switch (props.message.contentType) {
|
@@ -7214,44 +8430,65 @@ const messageContentAriaText = (props) => {
|
|
7214
8430
|
})
|
7215
8431
|
: undefined;
|
7216
8432
|
};
|
7217
|
-
const
|
7218
|
-
|
7219
|
-
|
7220
|
-
|
7221
|
-
|
7222
|
-
|
7223
|
-
|
7224
|
-
|
7225
|
-
|
7226
|
-
|
7227
|
-
|
7228
|
-
|
7229
|
-
|
7230
|
-
|
7231
|
-
|
7232
|
-
|
7233
|
-
|
7234
|
-
|
7235
|
-
}
|
7236
|
-
return processNodeDefinitions.processDefaultNode(node, children, index);
|
8433
|
+
const processNodeDefinitions = htmlToReact.ProcessNodeDefinitions();
|
8434
|
+
const htmlToReactParser = htmlToReact.Parser();
|
8435
|
+
/* @conditional-compile-remove(teams-inline-images) */
|
8436
|
+
const processInlineImage = (props) => ({
|
8437
|
+
// Custom <img> processing
|
8438
|
+
shouldProcessNode: (node) => {
|
8439
|
+
var _a;
|
8440
|
+
// Process img node with id in attachments list
|
8441
|
+
return (node.name &&
|
8442
|
+
node.name === 'img' &&
|
8443
|
+
node.attribs &&
|
8444
|
+
node.attribs.id &&
|
8445
|
+
((_a = props.message.attachedFilesMetadata) === null || _a === void 0 ? void 0 : _a.find((f) => f.id === node.attribs.id)));
|
8446
|
+
},
|
8447
|
+
processNode: (node, children, index) => {
|
8448
|
+
// logic to check id in map/list
|
8449
|
+
if (props.attachmentsMap && node.attribs.id in props.attachmentsMap) {
|
8450
|
+
node.attribs = Object.assign(Object.assign({}, node.attribs), { src: props.attachmentsMap[node.attribs.id] });
|
7237
8451
|
}
|
7238
|
-
|
7239
|
-
|
7240
|
-
|
8452
|
+
return processNodeDefinitions.processDefaultNode(node, children, index);
|
8453
|
+
}
|
8454
|
+
});
|
8455
|
+
/* @conditional-compile-remove(mention) */
|
8456
|
+
const processMention = (props) => ({
|
8457
|
+
shouldProcessNode: (node) => {
|
8458
|
+
var _a;
|
8459
|
+
if ((_a = props.mentionDisplayOptions) === null || _a === void 0 ? void 0 : _a.onRenderMention) {
|
8460
|
+
// Override the handling of the <msft-mention> tag in the HTML if there's a custom renderer
|
8461
|
+
return node.name === 'msft-mention';
|
8462
|
+
}
|
8463
|
+
return false;
|
8464
|
+
},
|
8465
|
+
processNode: (node) => {
|
8466
|
+
var _a;
|
8467
|
+
if ((_a = props.mentionDisplayOptions) === null || _a === void 0 ? void 0 : _a.onRenderMention) {
|
8468
|
+
const { id, displaytext } = node.attribs;
|
8469
|
+
const mention = {
|
8470
|
+
id: id,
|
8471
|
+
displayText: displaytext
|
8472
|
+
};
|
8473
|
+
return props.mentionDisplayOptions.onRenderMention(mention, defaultOnMentionRender);
|
8474
|
+
}
|
8475
|
+
return processNodeDefinitions.processDefaultNode;
|
8476
|
+
}
|
8477
|
+
});
|
8478
|
+
const processHtmlToReact = (props) => {
|
8479
|
+
var _a;
|
8480
|
+
const steps = [
|
7241
8481
|
/* @conditional-compile-remove(teams-inline-images) */
|
7242
|
-
|
7243
|
-
|
7244
|
-
|
7245
|
-
const processingInstructions = [
|
7246
|
-
...addProcessingStep(),
|
8482
|
+
processInlineImage(props),
|
8483
|
+
/* @conditional-compile-remove(mention) */
|
8484
|
+
processMention(props),
|
7247
8485
|
{
|
7248
|
-
|
7249
|
-
|
7250
|
-
},
|
8486
|
+
// Process everything else in the default way
|
8487
|
+
shouldProcessNode: htmlToReact.IsValidNodeDefinitions.alwaysValid,
|
7251
8488
|
processNode: processNodeDefinitions.processDefaultNode
|
7252
8489
|
}
|
7253
8490
|
];
|
7254
|
-
return htmlToReactParser.parseWithInstructions(props.message.content,
|
8491
|
+
return htmlToReactParser.parseWithInstructions((_a = props.message.content) !== null && _a !== void 0 ? _a : '', htmlToReact.IsValidNodeDefinitions.alwaysValid, steps);
|
7255
8492
|
};
|
7256
8493
|
|
7257
8494
|
// Copyright (c) Microsoft Corporation.
|
@@ -7286,7 +8523,7 @@ const chatMessageActionMenuProps = (menuProps) => {
|
|
7286
8523
|
return actionMenuProps;
|
7287
8524
|
};
|
7288
8525
|
|
7289
|
-
var __awaiter$
|
8526
|
+
var __awaiter$v = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
|
7290
8527
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
7291
8528
|
return new (P || (P = Promise))(function (resolve, reject) {
|
7292
8529
|
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
@@ -7311,7 +8548,7 @@ const _FileDownloadCards = (props) => {
|
|
7311
8548
|
var _a, _b;
|
7312
8549
|
return (_b = (_a = props.strings) === null || _a === void 0 ? void 0 : _a.downloadFile) !== null && _b !== void 0 ? _b : localeStrings.downloadFile;
|
7313
8550
|
}, [(_a = props.strings) === null || _a === void 0 ? void 0 : _a.downloadFile, localeStrings.downloadFile]);
|
7314
|
-
const fileDownloadHandler = React.useCallback((userId, file) => __awaiter$
|
8551
|
+
const fileDownloadHandler = React.useCallback((userId, file) => __awaiter$v(void 0, void 0, void 0, function* () {
|
7315
8552
|
if (!props.downloadHandler) {
|
7316
8553
|
window.open(file.url, '_blank', 'noopener,noreferrer');
|
7317
8554
|
}
|
@@ -7453,7 +8690,9 @@ const MessageBubble = (props) => {
|
|
7453
8690
|
/* @conditional-compile-remove(teams-inline-images) */
|
7454
8691
|
onFetchAttachment: props.onFetchAttachments,
|
7455
8692
|
/* @conditional-compile-remove(teams-inline-images) */
|
7456
|
-
attachmentsMap: props.attachmentsMap
|
8693
|
+
attachmentsMap: props.attachmentsMap,
|
8694
|
+
/* @conditional-compile-remove(mention) */
|
8695
|
+
mentionDisplayOptions: props.mentionDisplayOptions }),
|
7457
8696
|
props.onRenderFileDownloads ? props.onRenderFileDownloads(userId, message) : defaultOnRenderFileDownloads()));
|
7458
8697
|
}, [defaultOnRenderFileDownloads, message, props, strings, userId]);
|
7459
8698
|
const chatMessage = (React__default['default'].createElement(React__default['default'].Fragment, null,
|
@@ -7480,7 +8719,7 @@ const ChatMessageComponentAsMessageBubble = React__default['default'].memo(Messa
|
|
7480
8719
|
|
7481
8720
|
// Copyright (c) Microsoft Corporation.
|
7482
8721
|
// Licensed under the MIT license.
|
7483
|
-
var __awaiter$
|
8722
|
+
var __awaiter$u = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
|
7484
8723
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
7485
8724
|
return new (P || (P = Promise))(function (resolve, reject) {
|
7486
8725
|
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
@@ -7493,6 +8732,7 @@ var __awaiter$t = (window && window.__awaiter) || function (thisArg, _arguments,
|
|
7493
8732
|
* @private
|
7494
8733
|
*/
|
7495
8734
|
const ChatMessageComponent = (props) => {
|
8735
|
+
var _a, _b;
|
7496
8736
|
const [isEditing, setIsEditing] = React.useState(false);
|
7497
8737
|
const onEditClick = React.useCallback(() => setIsEditing(true), [setIsEditing]);
|
7498
8738
|
const { onDeleteMessage, onSendMessage, message } = props;
|
@@ -7512,7 +8752,7 @@ const ChatMessageComponent = (props) => {
|
|
7512
8752
|
onSendMessage && onSendMessage(content !== undefined ? content : '');
|
7513
8753
|
}, [clientMessageId, content, onSendMessage, onDeleteMessage]);
|
7514
8754
|
if (isEditing && message.messageType === 'chat') {
|
7515
|
-
return (React__default['default'].createElement(ChatMessageComponentAsEditBox, { message: message, inlineEditButtons: props.inlineAcceptRejectEditButtons, strings: props.strings, onSubmit: (text, metadata, options) => __awaiter$
|
8755
|
+
return (React__default['default'].createElement(ChatMessageComponentAsEditBox, { message: message, inlineEditButtons: props.inlineAcceptRejectEditButtons, strings: props.strings, onSubmit: (text, metadata, options) => __awaiter$u(void 0, void 0, void 0, function* () {
|
7516
8756
|
props.onUpdateMessage &&
|
7517
8757
|
message.messageId &&
|
7518
8758
|
(yield props.onUpdateMessage(message.messageId, text, metadata, options));
|
@@ -7520,7 +8760,9 @@ const ChatMessageComponent = (props) => {
|
|
7520
8760
|
}), onCancel: (messageId) => {
|
7521
8761
|
props.onCancelMessageEdit && props.onCancelMessageEdit(messageId);
|
7522
8762
|
setIsEditing(false);
|
7523
|
-
}
|
8763
|
+
},
|
8764
|
+
/* @conditional-compile-remove(mention) */
|
8765
|
+
mentionLookupOptions: (_a = props.mentionOptions) === null || _a === void 0 ? void 0 : _a.lookupOptions }));
|
7524
8766
|
}
|
7525
8767
|
else {
|
7526
8768
|
return (React__default['default'].createElement(ChatMessageComponentAsMessageBubble, Object.assign({}, props, { onRemoveClick: onRemoveClick, onEditClick: onEditClick, onResendClick: onResendClick, onRenderAvatar: props.onRenderAvatar,
|
@@ -7529,7 +8771,9 @@ const ChatMessageComponent = (props) => {
|
|
7529
8771
|
/* @conditional-compile-remove(teams-inline-images) */
|
7530
8772
|
onFetchAttachments: props.onFetchAttachments,
|
7531
8773
|
/* @conditional-compile-remove(teams-inline-images) */
|
7532
|
-
attachmentsMap: props.attachmentsMap
|
8774
|
+
attachmentsMap: props.attachmentsMap,
|
8775
|
+
/* @conditional-compile-remove(mention) */
|
8776
|
+
mentionDisplayOptions: (_b = props.mentionOptions) === null || _b === void 0 ? void 0 : _b.displayOptions })));
|
7533
8777
|
}
|
7534
8778
|
};
|
7535
8779
|
|
@@ -7623,7 +8867,7 @@ var getParticipantsWhoHaveReadMessage = (message, readReceiptsBySenderId) => {
|
|
7623
8867
|
|
7624
8868
|
// Copyright (c) Microsoft Corporation.
|
7625
8869
|
// Licensed under the MIT license.
|
7626
|
-
var __awaiter$
|
8870
|
+
var __awaiter$t = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
|
7627
8871
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
7628
8872
|
return new (P || (P = Promise))(function (resolve, reject) {
|
7629
8873
|
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
@@ -7823,7 +9067,9 @@ const MessageThread = (props) => {
|
|
7823
9067
|
/* @conditional-compile-remove(date-time-customization) */
|
7824
9068
|
onDisplayDateTimeString,
|
7825
9069
|
/* @conditional-compile-remove(teams-inline-images) */
|
7826
|
-
onFetchAttachments
|
9070
|
+
onFetchAttachments,
|
9071
|
+
/* @conditional-compile-remove(mention) */
|
9072
|
+
mentionOptions } = props;
|
7827
9073
|
const onRenderFileDownloads = onRenderFileDownloadsTrampoline(props);
|
7828
9074
|
const [messages, setMessages] = React.useState([]);
|
7829
9075
|
// We need this state to wait for one tick and scroll to bottom after messages have been initialized.
|
@@ -7843,7 +9089,7 @@ const MessageThread = (props) => {
|
|
7843
9089
|
/* @conditional-compile-remove(teams-inline-images) */
|
7844
9090
|
const [inlineAttachments, setInlineAttachments] = React.useState({});
|
7845
9091
|
/* @conditional-compile-remove(teams-inline-images) */
|
7846
|
-
const onFetchInlineAttachment = React.useCallback((attachment) => __awaiter$
|
9092
|
+
const onFetchInlineAttachment = React.useCallback((attachment) => __awaiter$t(void 0, void 0, void 0, function* () {
|
7847
9093
|
if (!onFetchAttachments || attachment.id in inlineAttachments) {
|
7848
9094
|
return;
|
7849
9095
|
}
|
@@ -7888,7 +9134,7 @@ const MessageThread = (props) => {
|
|
7888
9134
|
setChatMessagesInitialized(chatMessagesInitialized);
|
7889
9135
|
};
|
7890
9136
|
// we try to only send those message status if user is scrolled to the bottom.
|
7891
|
-
const sendMessageStatusIfAtBottom = React.useCallback(() => __awaiter$
|
9137
|
+
const sendMessageStatusIfAtBottom = React.useCallback(() => __awaiter$t(void 0, void 0, void 0, function* () {
|
7892
9138
|
if (!isAtBottomOfScrollRef.current ||
|
7893
9139
|
!document.hasFocus() ||
|
7894
9140
|
!messagesRef.current ||
|
@@ -7939,7 +9185,7 @@ const MessageThread = (props) => {
|
|
7939
9185
|
setIsAtBottomOfScrollRef(atBottom);
|
7940
9186
|
}, [scrollToBottom, sendMessageStatusIfAtBottom]);
|
7941
9187
|
// Infinite scrolling + threadInitialize function
|
7942
|
-
const fetchNewMessageWhenAtTop = React.useCallback(() => __awaiter$
|
9188
|
+
const fetchNewMessageWhenAtTop = React.useCallback(() => __awaiter$t(void 0, void 0, void 0, function* () {
|
7943
9189
|
if (!isLoadingChatMessagesRef.current) {
|
7944
9190
|
if (onLoadPreviousChatMessages) {
|
7945
9191
|
isLoadingChatMessagesRef.current = true;
|
@@ -8067,7 +9313,9 @@ const MessageThread = (props) => {
|
|
8067
9313
|
/* @conditional-compile-remove(teams-inline-images) */
|
8068
9314
|
onFetchAttachments: onFetchInlineAttachment,
|
8069
9315
|
/* @conditional-compile-remove(teams-inline-images) */
|
8070
|
-
attachmentsMap: inlineAttachments
|
9316
|
+
attachmentsMap: inlineAttachments,
|
9317
|
+
/* @conditional-compile-remove(mention) */
|
9318
|
+
mentionOptions: mentionOptions })));
|
8071
9319
|
}
|
8072
9320
|
return React__default['default'].createElement(React__default['default'].Fragment, null);
|
8073
9321
|
}, [
|
@@ -8085,7 +9333,9 @@ const MessageThread = (props) => {
|
|
8085
9333
|
/* @conditional-compile-remove(teams-inline-images) */
|
8086
9334
|
onFetchInlineAttachment,
|
8087
9335
|
/* @conditional-compile-remove(teams-inline-images) */
|
8088
|
-
inlineAttachments
|
9336
|
+
inlineAttachments,
|
9337
|
+
/* @conditional-compile-remove(mention) */
|
9338
|
+
mentionOptions
|
8089
9339
|
]);
|
8090
9340
|
const defaultStatusRenderer = React.useCallback((message, status, participantCount, readCount) => {
|
8091
9341
|
const onToggleToolTip = (isToggled) => {
|
@@ -12271,7 +13521,7 @@ const DevicesButton = (props) => {
|
|
12271
13521
|
|
12272
13522
|
// Copyright (c) Microsoft Corporation.
|
12273
13523
|
// Licensed under the MIT license.
|
12274
|
-
var __awaiter$
|
13524
|
+
var __awaiter$s = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
|
12275
13525
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
12276
13526
|
return new (P || (P = Promise))(function (resolve, reject) {
|
12277
13527
|
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
@@ -12309,7 +13559,7 @@ const CameraButton = (props) => {
|
|
12309
13559
|
const toggleAnnouncerString = React.useCallback((isCameraOn) => {
|
12310
13560
|
setAnnouncerString(!isCameraOn ? strings.cameraActionTurnedOffAnnouncement : strings.cameraActionTurnedOnAnnouncement);
|
12311
13561
|
}, [strings.cameraActionTurnedOffAnnouncement, strings.cameraActionTurnedOnAnnouncement]);
|
12312
|
-
const onToggleClick = React.useCallback(() => __awaiter$
|
13562
|
+
const onToggleClick = React.useCallback(() => __awaiter$s(void 0, void 0, void 0, function* () {
|
12313
13563
|
// Throttle click on camera, need to await onToggleCamera then allow another click
|
12314
13564
|
if (onToggleCamera) {
|
12315
13565
|
setWaitForCamera(true);
|
@@ -12477,7 +13727,7 @@ const lightThemeCallButtonStyles = {
|
|
12477
13727
|
|
12478
13728
|
// Copyright (c) Microsoft Corporation.
|
12479
13729
|
// Licensed under the MIT license.
|
12480
|
-
var __awaiter$
|
13730
|
+
var __awaiter$r = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
|
12481
13731
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
12482
13732
|
return new (P || (P = Promise))(function (resolve, reject) {
|
12483
13733
|
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
@@ -12518,7 +13768,7 @@ const MicrophoneButton = (props) => {
|
|
12518
13768
|
const toggleAnnouncerString = React.useCallback((isMicOn) => {
|
12519
13769
|
setAnnouncerString(!isMicOn ? strings.microphoneActionTurnedOffAnnouncement : strings.microphoneActionTurnedOnAnnouncement);
|
12520
13770
|
}, [strings.microphoneActionTurnedOffAnnouncement, strings.microphoneActionTurnedOnAnnouncement]);
|
12521
|
-
const onToggleClick = React.useCallback(() => __awaiter$
|
13771
|
+
const onToggleClick = React.useCallback(() => __awaiter$r(void 0, void 0, void 0, function* () {
|
12522
13772
|
if (onToggleMicrophone) {
|
12523
13773
|
try {
|
12524
13774
|
yield onToggleMicrophone();
|
@@ -13414,7 +14664,7 @@ const formatPhoneNumber = (phoneNumber) => {
|
|
13414
14664
|
|
13415
14665
|
// Copyright (c) Microsoft Corporation.
|
13416
14666
|
// Licensed under the MIT license.
|
13417
|
-
var __awaiter$
|
14667
|
+
var __awaiter$q = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
|
13418
14668
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
13419
14669
|
return new (P || (P = Promise))(function (resolve, reject) {
|
13420
14670
|
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
@@ -13456,10 +14706,10 @@ const DialpadButton = (props) => {
|
|
13456
14706
|
const theme = react.useTheme();
|
13457
14707
|
const { digit, index, onClick, onLongPress, isMobile = false } = props;
|
13458
14708
|
const useLongPressProps = React__default['default'].useMemo(() => ({
|
13459
|
-
onClick: () => __awaiter$
|
14709
|
+
onClick: () => __awaiter$q(void 0, void 0, void 0, function* () {
|
13460
14710
|
onClick(digit, index);
|
13461
14711
|
}),
|
13462
|
-
onLongPress: () => __awaiter$
|
14712
|
+
onLongPress: () => __awaiter$q(void 0, void 0, void 0, function* () {
|
13463
14713
|
onLongPress(digit, index);
|
13464
14714
|
}),
|
13465
14715
|
touchEventsOnly: isMobile
|
@@ -14197,7 +15447,7 @@ const dropdownStyles = {
|
|
14197
15447
|
callout: Object.assign({ height: _pxToRem(300), overflow: 'auto' }, scrollbarStyles)
|
14198
15448
|
};
|
14199
15449
|
|
14200
|
-
var __awaiter$
|
15450
|
+
var __awaiter$p = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
|
14201
15451
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
14202
15452
|
return new (P || (P = Promise))(function (resolve, reject) {
|
14203
15453
|
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
@@ -14222,7 +15472,7 @@ const _CaptionsSettingsModal = (props) => {
|
|
14222
15472
|
onDismissCaptionsSettings();
|
14223
15473
|
}
|
14224
15474
|
}, [onDismissCaptionsSettings]);
|
14225
|
-
const onConfirm = React.useCallback(() => __awaiter$
|
15475
|
+
const onConfirm = React.useCallback(() => __awaiter$p(void 0, void 0, void 0, function* () {
|
14226
15476
|
const languageCode = selectedItem.key.toString();
|
14227
15477
|
if (isCaptionsFeatureActive) {
|
14228
15478
|
onSetSpokenLanguage(languageCode);
|
@@ -14819,7 +16069,7 @@ const findConditionalCompiledSelector = (component) => {
|
|
14819
16069
|
|
14820
16070
|
// Copyright (c) Microsoft Corporation.
|
14821
16071
|
// Licensed under the MIT license.
|
14822
|
-
var __awaiter$
|
16072
|
+
var __awaiter$o = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
|
14823
16073
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
14824
16074
|
return new (P || (P = Promise))(function (resolve, reject) {
|
14825
16075
|
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
@@ -14842,35 +16092,35 @@ const createDefaultChatHandlers = memoizeOne__default['default']((chatClient, ch
|
|
14842
16092
|
let messageIterator = undefined;
|
14843
16093
|
let readReceiptIterator = undefined;
|
14844
16094
|
return {
|
14845
|
-
onSendMessage: (content, options) => __awaiter$
|
16095
|
+
onSendMessage: (content, options) => __awaiter$o(void 0, void 0, void 0, function* () {
|
14846
16096
|
const sendMessageRequest = {
|
14847
16097
|
content,
|
14848
16098
|
senderDisplayName: chatClient.getState().displayName
|
14849
16099
|
};
|
14850
16100
|
yield chatThreadClient.sendMessage(sendMessageRequest, options);
|
14851
16101
|
}),
|
14852
|
-
onUpdateMessage: (messageId, content, metadata, options) => __awaiter$
|
16102
|
+
onUpdateMessage: (messageId, content, metadata, options) => __awaiter$o(void 0, void 0, void 0, function* () {
|
14853
16103
|
const updatedMetadata = metadata ? Object.assign({}, metadata) : {};
|
14854
16104
|
updatedMetadata['fileSharingMetadata'] = JSON.stringify((options === null || options === void 0 ? void 0 : options.attachedFilesMetadata) || []);
|
14855
16105
|
yield chatThreadClient.updateMessage(messageId, { content, metadata: updatedMetadata });
|
14856
16106
|
}),
|
14857
|
-
onDeleteMessage: (messageId) => __awaiter$
|
16107
|
+
onDeleteMessage: (messageId) => __awaiter$o(void 0, void 0, void 0, function* () {
|
14858
16108
|
yield chatThreadClient.deleteMessage(messageId);
|
14859
16109
|
}),
|
14860
16110
|
// This handler is designed for chatThread to consume
|
14861
|
-
onMessageSeen: (chatMessageId) => __awaiter$
|
16111
|
+
onMessageSeen: (chatMessageId) => __awaiter$o(void 0, void 0, void 0, function* () {
|
14862
16112
|
yield chatThreadClient.sendReadReceipt({ chatMessageId });
|
14863
16113
|
}),
|
14864
|
-
onTyping: () => __awaiter$
|
16114
|
+
onTyping: () => __awaiter$o(void 0, void 0, void 0, function* () {
|
14865
16115
|
yield chatThreadClient.sendTypingNotification();
|
14866
16116
|
}),
|
14867
|
-
onRemoveParticipant: (userId) => __awaiter$
|
16117
|
+
onRemoveParticipant: (userId) => __awaiter$o(void 0, void 0, void 0, function* () {
|
14868
16118
|
yield chatThreadClient.removeParticipant(fromFlatCommunicationIdentifier(userId));
|
14869
16119
|
}),
|
14870
|
-
updateThreadTopicName: (topicName) => __awaiter$
|
16120
|
+
updateThreadTopicName: (topicName) => __awaiter$o(void 0, void 0, void 0, function* () {
|
14871
16121
|
yield chatThreadClient.updateTopic(topicName);
|
14872
16122
|
}),
|
14873
|
-
onLoadPreviousChatMessages: (messagesToLoad) => __awaiter$
|
16123
|
+
onLoadPreviousChatMessages: (messagesToLoad) => __awaiter$o(void 0, void 0, void 0, function* () {
|
14874
16124
|
var _a, _b, _c;
|
14875
16125
|
if (messageIterator === undefined) {
|
14876
16126
|
// Lazy definition so that errors in the method call are reported correctly.
|
@@ -15669,7 +16919,7 @@ const chatStatefulLogger = logger.createClientLogger('communication-react:chat-s
|
|
15669
16919
|
|
15670
16920
|
// Copyright (c) Microsoft Corporation.
|
15671
16921
|
// Licensed under the MIT license.
|
15672
|
-
var __awaiter$
|
16922
|
+
var __awaiter$n = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
|
15673
16923
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
15674
16924
|
return new (P || (P = Promise))(function (resolve, reject) {
|
15675
16925
|
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
@@ -15944,7 +17194,7 @@ class ChatContext$1 {
|
|
15944
17194
|
* @throws ChatError. Exceptions thrown from `f` are tagged with the failed `target.
|
15945
17195
|
*/
|
15946
17196
|
withAsyncErrorTeedToState(f, target) {
|
15947
|
-
return (...args) => __awaiter$
|
17197
|
+
return (...args) => __awaiter$n(this, void 0, void 0, function* () {
|
15948
17198
|
try {
|
15949
17199
|
return yield f(...args);
|
15950
17200
|
}
|
@@ -16056,7 +17306,7 @@ const convertChatMessage = (message, status = 'delivered', clientMessageId) => {
|
|
16056
17306
|
|
16057
17307
|
// Copyright (c) Microsoft Corporation.
|
16058
17308
|
// Licensed under the MIT license.
|
16059
|
-
var __awaiter$
|
17309
|
+
var __awaiter$m = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
|
16060
17310
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
16061
17311
|
return new (P || (P = Promise))(function (resolve, reject) {
|
16062
17312
|
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
@@ -16145,7 +17395,7 @@ class EventSubscriber {
|
|
16145
17395
|
};
|
16146
17396
|
// This is a temporary fix that no participant message is received for onChatMessageReceived event, which should be handled by JS SDK.
|
16147
17397
|
// Without the temporary fix, there are missing 'participant joined' and 'participant left' system messages in the chat thread.
|
16148
|
-
this.fetchLastParticipantMessage = (threadId, actionType) => __awaiter$
|
17398
|
+
this.fetchLastParticipantMessage = (threadId, actionType) => __awaiter$m(this, void 0, void 0, function* () {
|
16149
17399
|
var e_1, _a;
|
16150
17400
|
try {
|
16151
17401
|
for (var _b = __asyncValues$1(this.chatClient
|
@@ -16237,7 +17487,7 @@ class EventSubscriber {
|
|
16237
17487
|
|
16238
17488
|
// Copyright (c) Microsoft Corporation.
|
16239
17489
|
// Licensed under the MIT license.
|
16240
|
-
var __awaiter$
|
17490
|
+
var __awaiter$l = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
|
16241
17491
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
16242
17492
|
return new (P || (P = Promise))(function (resolve, reject) {
|
16243
17493
|
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
@@ -16259,7 +17509,7 @@ const createDecoratedIterator = (iteratorCreator, context, decorateFn) => {
|
|
16259
17509
|
const threadsIterator = iteratorCreator(...args);
|
16260
17510
|
return {
|
16261
17511
|
next() {
|
16262
|
-
return __awaiter$
|
17512
|
+
return __awaiter$l(this, void 0, void 0, function* () {
|
16263
17513
|
const result = yield threadsIterator.next();
|
16264
17514
|
if (!result.done && result.value) {
|
16265
17515
|
decorateFn(result.value, context);
|
@@ -16274,7 +17524,7 @@ const createDecoratedIterator = (iteratorCreator, context, decorateFn) => {
|
|
16274
17524
|
const pages = threadsIterator.byPage(settings);
|
16275
17525
|
return {
|
16276
17526
|
next() {
|
16277
|
-
return __awaiter$
|
17527
|
+
return __awaiter$l(this, void 0, void 0, function* () {
|
16278
17528
|
const result = yield pages.next();
|
16279
17529
|
const page = result.value;
|
16280
17530
|
if (!result.done && result.value) {
|
@@ -16358,7 +17608,7 @@ const createDecoratedListParticipants = (chatThreadClient, context) => {
|
|
16358
17608
|
|
16359
17609
|
// Copyright (c) Microsoft Corporation.
|
16360
17610
|
// Licensed under the MIT license.
|
16361
|
-
var __awaiter$
|
17611
|
+
var __awaiter$k = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
|
16362
17612
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
16363
17613
|
return new (P || (P = Promise))(function (resolve, reject) {
|
16364
17614
|
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
@@ -16377,14 +17627,14 @@ class ProxyChatThreadClient {
|
|
16377
17627
|
return createDecoratedListMessages(chatThreadClient, this._context);
|
16378
17628
|
}
|
16379
17629
|
case 'getMessage': {
|
16380
|
-
return this._context.withAsyncErrorTeedToState((...args) => __awaiter$
|
17630
|
+
return this._context.withAsyncErrorTeedToState((...args) => __awaiter$k(this, void 0, void 0, function* () {
|
16381
17631
|
const message = yield chatThreadClient.getMessage(...args);
|
16382
17632
|
this._context.setChatMessage(chatThreadClient.threadId, convertChatMessage(message));
|
16383
17633
|
return message;
|
16384
17634
|
}), 'ChatThreadClient.getMessage');
|
16385
17635
|
}
|
16386
17636
|
case 'sendMessage': {
|
16387
|
-
return this._context.withAsyncErrorTeedToState((...args) => __awaiter$
|
17637
|
+
return this._context.withAsyncErrorTeedToState((...args) => __awaiter$k(this, void 0, void 0, function* () {
|
16388
17638
|
// Retry logic?
|
16389
17639
|
const [request, options] = args;
|
16390
17640
|
const { content } = request;
|
@@ -16424,7 +17674,7 @@ class ProxyChatThreadClient {
|
|
16424
17674
|
}), 'ChatThreadClient.sendMessage');
|
16425
17675
|
}
|
16426
17676
|
case 'addParticipants': {
|
16427
|
-
return this._context.withAsyncErrorTeedToState((...args) => __awaiter$
|
17677
|
+
return this._context.withAsyncErrorTeedToState((...args) => __awaiter$k(this, void 0, void 0, function* () {
|
16428
17678
|
const result = yield chatThreadClient.addParticipants(...args);
|
16429
17679
|
const [addRequest] = args;
|
16430
17680
|
const participantsToAdd = addRequest.participants;
|
@@ -16433,7 +17683,7 @@ class ProxyChatThreadClient {
|
|
16433
17683
|
}), 'ChatThreadClient.addParticipants');
|
16434
17684
|
}
|
16435
17685
|
case 'deleteMessage': {
|
16436
|
-
return this._context.withAsyncErrorTeedToState((...args) => __awaiter$
|
17686
|
+
return this._context.withAsyncErrorTeedToState((...args) => __awaiter$k(this, void 0, void 0, function* () {
|
16437
17687
|
// DeleteMessage is able to either delete local one(for failed message) or synced message
|
16438
17688
|
const [messageId] = args;
|
16439
17689
|
if (this._context.deleteLocalMessage(chatThreadClient.threadId, messageId)) {
|
@@ -16451,12 +17701,12 @@ class ProxyChatThreadClient {
|
|
16451
17701
|
return createDecoratedListReadReceipts(chatThreadClient, this._context);
|
16452
17702
|
}
|
16453
17703
|
case 'sendTypingNotification': {
|
16454
|
-
return this._context.withAsyncErrorTeedToState((...args) => __awaiter$
|
17704
|
+
return this._context.withAsyncErrorTeedToState((...args) => __awaiter$k(this, void 0, void 0, function* () {
|
16455
17705
|
return yield chatThreadClient.sendTypingNotification(...args);
|
16456
17706
|
}), 'ChatThreadClient.sendTypingNotification');
|
16457
17707
|
}
|
16458
17708
|
case 'removeParticipant': {
|
16459
|
-
return this._context.withAsyncErrorTeedToState((...args) => __awaiter$
|
17709
|
+
return this._context.withAsyncErrorTeedToState((...args) => __awaiter$k(this, void 0, void 0, function* () {
|
16460
17710
|
const result = yield chatThreadClient.removeParticipant(...args);
|
16461
17711
|
const [removeIdentifier] = args;
|
16462
17712
|
this._context.deleteParticipant(chatThreadClient.threadId, communicationCommon.getIdentifierKind(removeIdentifier));
|
@@ -16464,7 +17714,7 @@ class ProxyChatThreadClient {
|
|
16464
17714
|
}), 'ChatThreadClient.removeParticipant');
|
16465
17715
|
}
|
16466
17716
|
case 'updateMessage': {
|
16467
|
-
return this._context.withAsyncErrorTeedToState((...args) => __awaiter$
|
17717
|
+
return this._context.withAsyncErrorTeedToState((...args) => __awaiter$k(this, void 0, void 0, function* () {
|
16468
17718
|
const result = yield chatThreadClient.updateMessage(...args);
|
16469
17719
|
const [messageId, updateOption] = args;
|
16470
17720
|
this._context.updateChatMessageContent(chatThreadClient.threadId, messageId, updateOption === null || updateOption === void 0 ? void 0 : updateOption.content);
|
@@ -16472,7 +17722,7 @@ class ProxyChatThreadClient {
|
|
16472
17722
|
}), 'ChatThreadClient.updateMessage');
|
16473
17723
|
}
|
16474
17724
|
case 'updateTopic': {
|
16475
|
-
return this._context.withAsyncErrorTeedToState((...args) => __awaiter$
|
17725
|
+
return this._context.withAsyncErrorTeedToState((...args) => __awaiter$k(this, void 0, void 0, function* () {
|
16476
17726
|
const result = yield chatThreadClient.updateTopic(...args);
|
16477
17727
|
const [topic] = args;
|
16478
17728
|
this._context.updateThreadTopic(chatThreadClient.threadId, topic);
|
@@ -16480,7 +17730,7 @@ class ProxyChatThreadClient {
|
|
16480
17730
|
}), 'ChatThreadClient.updateTopic');
|
16481
17731
|
}
|
16482
17732
|
case 'getProperties': {
|
16483
|
-
return this._context.withAsyncErrorTeedToState((...args) => __awaiter$
|
17733
|
+
return this._context.withAsyncErrorTeedToState((...args) => __awaiter$k(this, void 0, void 0, function* () {
|
16484
17734
|
const result = yield chatThreadClient.getProperties(...args);
|
16485
17735
|
this._context.updateThread(chatThreadClient.threadId, result);
|
16486
17736
|
return result;
|
@@ -16517,7 +17767,7 @@ const createDecoratedListThreads = (chatClient, context) => {
|
|
16517
17767
|
|
16518
17768
|
// Copyright (c) Microsoft Corporation.
|
16519
17769
|
// Licensed under the MIT license.
|
16520
|
-
var __awaiter$
|
17770
|
+
var __awaiter$j = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
|
16521
17771
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
16522
17772
|
return new (P || (P = Promise))(function (resolve, reject) {
|
16523
17773
|
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
@@ -16536,7 +17786,7 @@ const proxyChatClient = {
|
|
16536
17786
|
switch (prop) {
|
16537
17787
|
case 'createChatThread': {
|
16538
17788
|
return context.withAsyncErrorTeedToState(function (...args) {
|
16539
|
-
return __awaiter$
|
17789
|
+
return __awaiter$j(this, void 0, void 0, function* () {
|
16540
17790
|
const result = yield chatClient.createChatThread(...args);
|
16541
17791
|
const thread = result.chatThread;
|
16542
17792
|
if (thread) {
|
@@ -16549,7 +17799,7 @@ const proxyChatClient = {
|
|
16549
17799
|
}
|
16550
17800
|
case 'deleteChatThread': {
|
16551
17801
|
return context.withAsyncErrorTeedToState(function (...args) {
|
16552
|
-
return __awaiter$
|
17802
|
+
return __awaiter$j(this, void 0, void 0, function* () {
|
16553
17803
|
const result = yield chatClient.deleteChatThread(...args);
|
16554
17804
|
context.deleteThread(args[0]);
|
16555
17805
|
return result;
|
@@ -16569,7 +17819,7 @@ const proxyChatClient = {
|
|
16569
17819
|
}
|
16570
17820
|
case 'startRealtimeNotifications': {
|
16571
17821
|
return context.withAsyncErrorTeedToState(function (...args) {
|
16572
|
-
return __awaiter$
|
17822
|
+
return __awaiter$j(this, void 0, void 0, function* () {
|
16573
17823
|
const ret = yield chatClient.startRealtimeNotifications(...args);
|
16574
17824
|
if (!receiver.eventSubscriber) {
|
16575
17825
|
receiver.eventSubscriber = new EventSubscriber(chatClient, context);
|
@@ -16580,7 +17830,7 @@ const proxyChatClient = {
|
|
16580
17830
|
}
|
16581
17831
|
case 'stopRealtimeNotifications': {
|
16582
17832
|
return context.withAsyncErrorTeedToState(function (...args) {
|
16583
|
-
return __awaiter$
|
17833
|
+
return __awaiter$j(this, void 0, void 0, function* () {
|
16584
17834
|
const ret = yield chatClient.stopRealtimeNotifications(...args);
|
16585
17835
|
if (receiver.eventSubscriber) {
|
16586
17836
|
receiver.eventSubscriber.unsubscribe();
|
@@ -17185,7 +18435,7 @@ const END_CALL_PAGES = [
|
|
17185
18435
|
|
17186
18436
|
// Copyright (c) Microsoft Corporation.
|
17187
18437
|
// Licensed under the MIT license.
|
17188
|
-
var __awaiter$
|
18438
|
+
var __awaiter$i = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
|
17189
18439
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
17190
18440
|
return new (P || (P = Promise))(function (resolve, reject) {
|
17191
18441
|
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
@@ -17221,7 +18471,7 @@ const isCameraOn = (state) => {
|
|
17221
18471
|
/**
|
17222
18472
|
* @private
|
17223
18473
|
*/
|
17224
|
-
const startSelectedVideoEffect = (adapter) => __awaiter$
|
18474
|
+
const startSelectedVideoEffect = (adapter) => __awaiter$i(void 0, void 0, void 0, function* () {
|
17225
18475
|
if (adapter.getState().selectedVideoBackgroundEffect) {
|
17226
18476
|
const selectedVideoBackgroundEffect = adapter.getState().selectedVideoBackgroundEffect;
|
17227
18477
|
if ((selectedVideoBackgroundEffect === null || selectedVideoBackgroundEffect === void 0 ? void 0 : selectedVideoBackgroundEffect.effectName) === 'blur') {
|
@@ -17426,7 +18676,7 @@ const isDisabled$2 = (option) => {
|
|
17426
18676
|
/**
|
17427
18677
|
* @returns Permissions state for the camera.
|
17428
18678
|
*/
|
17429
|
-
const queryCameraPermissionFromPermissionsAPI = () => __awaiter$
|
18679
|
+
const queryCameraPermissionFromPermissionsAPI = () => __awaiter$i(void 0, void 0, void 0, function* () {
|
17430
18680
|
try {
|
17431
18681
|
return (yield navigator.permissions.query({ name: 'camera' })).state;
|
17432
18682
|
}
|
@@ -17439,7 +18689,7 @@ const queryCameraPermissionFromPermissionsAPI = () => __awaiter$h(void 0, void 0
|
|
17439
18689
|
/**
|
17440
18690
|
* @returns Permissions state for the microphone.
|
17441
18691
|
*/
|
17442
|
-
const queryMicrophonePermissionFromPermissionsAPI = () => __awaiter$
|
18692
|
+
const queryMicrophonePermissionFromPermissionsAPI = () => __awaiter$i(void 0, void 0, void 0, function* () {
|
17443
18693
|
try {
|
17444
18694
|
return (yield navigator.permissions.query({ name: 'microphone' })).state;
|
17445
18695
|
}
|
@@ -17456,7 +18706,7 @@ const queryMicrophonePermissionFromPermissionsAPI = () => __awaiter$h(void 0, vo
|
|
17456
18706
|
* If permission API is not supported on this browser, permission state is set to unsupported.
|
17457
18707
|
* @private
|
17458
18708
|
*/
|
17459
|
-
const getDevicePermissionState = (setVideoState, setAudioState) => __awaiter$
|
18709
|
+
const getDevicePermissionState = (setVideoState, setAudioState) => __awaiter$i(void 0, void 0, void 0, function* () {
|
17460
18710
|
const [cameraResult, microphoneResult] = yield Promise.all([
|
17461
18711
|
queryCameraPermissionFromPermissionsAPI(),
|
17462
18712
|
queryMicrophonePermissionFromPermissionsAPI()
|
@@ -17546,7 +18796,7 @@ const dismissVideoEffectsError = (toDismiss) => {
|
|
17546
18796
|
|
17547
18797
|
// Copyright (c) Microsoft Corporation.
|
17548
18798
|
// Licensed under the MIT license.
|
17549
|
-
var __awaiter$
|
18799
|
+
var __awaiter$h = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
|
17550
18800
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
17551
18801
|
return new (P || (P = Promise))(function (resolve, reject) {
|
17552
18802
|
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
@@ -17681,9 +18931,9 @@ class AzureCommunicationChatAdapter {
|
|
17681
18931
|
this.unsubscribeAllEvents();
|
17682
18932
|
}
|
17683
18933
|
fetchInitialData() {
|
17684
|
-
return __awaiter$
|
18934
|
+
return __awaiter$h(this, void 0, void 0, function* () {
|
17685
18935
|
// If get properties fails we dont want to try to get the participants after.
|
17686
|
-
yield this.asyncTeeErrorToEventEmitter(() => __awaiter$
|
18936
|
+
yield this.asyncTeeErrorToEventEmitter(() => __awaiter$h(this, void 0, void 0, function* () {
|
17687
18937
|
var e_1, _a;
|
17688
18938
|
yield this.chatThreadClient.getProperties();
|
17689
18939
|
try {
|
@@ -17717,8 +18967,8 @@ class AzureCommunicationChatAdapter {
|
|
17717
18967
|
this.context.offStateChange(handler);
|
17718
18968
|
}
|
17719
18969
|
sendMessage(content, options = {}) {
|
17720
|
-
return __awaiter$
|
17721
|
-
yield this.asyncTeeErrorToEventEmitter(() => __awaiter$
|
18970
|
+
return __awaiter$h(this, void 0, void 0, function* () {
|
18971
|
+
yield this.asyncTeeErrorToEventEmitter(() => __awaiter$h(this, void 0, void 0, function* () {
|
17722
18972
|
/* @conditional-compile-remove(file-sharing) */
|
17723
18973
|
options.metadata = Object.assign(Object.assign({}, options.metadata), convertFileUploadsUiStateToMessageMetadata(this.context.getState().fileUploads));
|
17724
18974
|
/* @conditional-compile-remove(file-sharing) */
|
@@ -17735,51 +18985,51 @@ class AzureCommunicationChatAdapter {
|
|
17735
18985
|
});
|
17736
18986
|
}
|
17737
18987
|
sendReadReceipt(chatMessageId) {
|
17738
|
-
return __awaiter$
|
17739
|
-
yield this.asyncTeeErrorToEventEmitter(() => __awaiter$
|
18988
|
+
return __awaiter$h(this, void 0, void 0, function* () {
|
18989
|
+
yield this.asyncTeeErrorToEventEmitter(() => __awaiter$h(this, void 0, void 0, function* () {
|
17740
18990
|
yield this.handlers.onMessageSeen(chatMessageId);
|
17741
18991
|
}));
|
17742
18992
|
});
|
17743
18993
|
}
|
17744
18994
|
sendTypingIndicator() {
|
17745
|
-
return __awaiter$
|
17746
|
-
yield this.asyncTeeErrorToEventEmitter(() => __awaiter$
|
18995
|
+
return __awaiter$h(this, void 0, void 0, function* () {
|
18996
|
+
yield this.asyncTeeErrorToEventEmitter(() => __awaiter$h(this, void 0, void 0, function* () {
|
17747
18997
|
yield this.handlers.onTyping();
|
17748
18998
|
}));
|
17749
18999
|
});
|
17750
19000
|
}
|
17751
19001
|
removeParticipant(userId) {
|
17752
|
-
return __awaiter$
|
17753
|
-
yield this.asyncTeeErrorToEventEmitter(() => __awaiter$
|
19002
|
+
return __awaiter$h(this, void 0, void 0, function* () {
|
19003
|
+
yield this.asyncTeeErrorToEventEmitter(() => __awaiter$h(this, void 0, void 0, function* () {
|
17754
19004
|
yield this.handlers.onRemoveParticipant(userId);
|
17755
19005
|
}));
|
17756
19006
|
});
|
17757
19007
|
}
|
17758
19008
|
setTopic(topicName) {
|
17759
|
-
return __awaiter$
|
17760
|
-
yield this.asyncTeeErrorToEventEmitter(() => __awaiter$
|
19009
|
+
return __awaiter$h(this, void 0, void 0, function* () {
|
19010
|
+
yield this.asyncTeeErrorToEventEmitter(() => __awaiter$h(this, void 0, void 0, function* () {
|
17761
19011
|
yield this.handlers.updateThreadTopicName(topicName);
|
17762
19012
|
}));
|
17763
19013
|
});
|
17764
19014
|
}
|
17765
19015
|
loadPreviousChatMessages(messagesToLoad) {
|
17766
|
-
return __awaiter$
|
17767
|
-
return yield this.asyncTeeErrorToEventEmitter(() => __awaiter$
|
19016
|
+
return __awaiter$h(this, void 0, void 0, function* () {
|
19017
|
+
return yield this.asyncTeeErrorToEventEmitter(() => __awaiter$h(this, void 0, void 0, function* () {
|
17768
19018
|
return yield this.handlers.onLoadPreviousChatMessages(messagesToLoad);
|
17769
19019
|
}));
|
17770
19020
|
});
|
17771
19021
|
}
|
17772
19022
|
updateMessage(messageId, content, metadata, options) {
|
17773
|
-
return __awaiter$
|
17774
|
-
return yield this.asyncTeeErrorToEventEmitter(() => __awaiter$
|
19023
|
+
return __awaiter$h(this, void 0, void 0, function* () {
|
19024
|
+
return yield this.asyncTeeErrorToEventEmitter(() => __awaiter$h(this, void 0, void 0, function* () {
|
17775
19025
|
/* @conditional-compile-remove(file-sharing) */
|
17776
19026
|
return yield this.handlers.onUpdateMessage(messageId, content, metadata, options);
|
17777
19027
|
}));
|
17778
19028
|
});
|
17779
19029
|
}
|
17780
19030
|
deleteMessage(messageId) {
|
17781
|
-
return __awaiter$
|
17782
|
-
return yield this.asyncTeeErrorToEventEmitter(() => __awaiter$
|
19031
|
+
return __awaiter$h(this, void 0, void 0, function* () {
|
19032
|
+
return yield this.asyncTeeErrorToEventEmitter(() => __awaiter$h(this, void 0, void 0, function* () {
|
17783
19033
|
return yield this.handlers.onDeleteMessage(messageId);
|
17784
19034
|
}));
|
17785
19035
|
});
|
@@ -17814,8 +19064,8 @@ class AzureCommunicationChatAdapter {
|
|
17814
19064
|
}
|
17815
19065
|
/* @conditional-compile-remove(teams-inline-images) */
|
17816
19066
|
downloadAttachments(options) {
|
17817
|
-
return __awaiter$
|
17818
|
-
return this.asyncTeeErrorToEventEmitter(() => __awaiter$
|
19067
|
+
return __awaiter$h(this, void 0, void 0, function* () {
|
19068
|
+
return this.asyncTeeErrorToEventEmitter(() => __awaiter$h(this, void 0, void 0, function* () {
|
17819
19069
|
if (this.credential === undefined) {
|
17820
19070
|
const e = new Error();
|
17821
19071
|
e['target'] = 'ChatThreadClient.getMessage';
|
@@ -17835,9 +19085,9 @@ class AzureCommunicationChatAdapter {
|
|
17835
19085
|
}
|
17836
19086
|
/* @conditional-compile-remove(teams-inline-images) */
|
17837
19087
|
downloadAuthenticatedFile(accessToken, options) {
|
17838
|
-
return __awaiter$
|
19088
|
+
return __awaiter$h(this, void 0, void 0, function* () {
|
17839
19089
|
function fetchWithAuthentication(url, token) {
|
17840
|
-
return __awaiter$
|
19090
|
+
return __awaiter$h(this, void 0, void 0, function* () {
|
17841
19091
|
const headers = new Headers();
|
17842
19092
|
headers.append('Authorization', `Bearer ${token}`);
|
17843
19093
|
try {
|
@@ -17905,7 +19155,7 @@ class AzureCommunicationChatAdapter {
|
|
17905
19155
|
this.emitter.off(event, listener);
|
17906
19156
|
}
|
17907
19157
|
asyncTeeErrorToEventEmitter(f) {
|
17908
|
-
return __awaiter$
|
19158
|
+
return __awaiter$h(this, void 0, void 0, function* () {
|
17909
19159
|
try {
|
17910
19160
|
return yield f();
|
17911
19161
|
}
|
@@ -17947,7 +19197,7 @@ const convertEventType = (type) => {
|
|
17947
19197
|
*
|
17948
19198
|
* @public
|
17949
19199
|
*/
|
17950
|
-
const createAzureCommunicationChatAdapter = ({ endpoint: endpointUrl, userId, displayName, credential, threadId }) => __awaiter$
|
19200
|
+
const createAzureCommunicationChatAdapter = ({ endpoint: endpointUrl, userId, displayName, credential, threadId }) => __awaiter$h(void 0, void 0, void 0, function* () {
|
17951
19201
|
if (!isValidIdentifier(userId)) {
|
17952
19202
|
throw new Error('Provided userId is invalid. Please provide valid identifier object.');
|
17953
19203
|
}
|
@@ -18016,7 +19266,7 @@ beforeDispose) => {
|
|
18016
19266
|
if (!credential || !displayName || !endpoint || !threadId || !userId) {
|
18017
19267
|
return;
|
18018
19268
|
}
|
18019
|
-
(() => __awaiter$
|
19269
|
+
(() => __awaiter$h(void 0, void 0, void 0, function* () {
|
18020
19270
|
if (adapterRef.current) {
|
18021
19271
|
// Dispose the old adapter when a new one is created.
|
18022
19272
|
//
|
@@ -18048,7 +19298,7 @@ beforeDispose) => {
|
|
18048
19298
|
// Dispose any existing adapter when the component unmounts.
|
18049
19299
|
React.useEffect(() => {
|
18050
19300
|
return () => {
|
18051
|
-
(() => __awaiter$
|
19301
|
+
(() => __awaiter$h(void 0, void 0, void 0, function* () {
|
18052
19302
|
if (adapterRef.current) {
|
18053
19303
|
if (beforeDisposeRef.current) {
|
18054
19304
|
yield beforeDisposeRef.current(adapterRef.current);
|
@@ -18072,7 +19322,7 @@ beforeDispose) => {
|
|
18072
19322
|
function createAzureCommunicationChatAdapterFromClient(chatClient, chatThreadClient,
|
18073
19323
|
/* @conditional-compile-remove(teams-inline-images) */
|
18074
19324
|
options) {
|
18075
|
-
return __awaiter$
|
19325
|
+
return __awaiter$h(this, void 0, void 0, function* () {
|
18076
19326
|
return new AzureCommunicationChatAdapter(chatClient, chatThreadClient,
|
18077
19327
|
/* @conditional-compile-remove(teams-inline-images) */ options);
|
18078
19328
|
});
|
@@ -18285,7 +19535,7 @@ const sendboxContainerStyles = {
|
|
18285
19535
|
|
18286
19536
|
// Copyright (c) Microsoft Corporation.
|
18287
19537
|
// Licensed under the MIT license.
|
18288
|
-
var __awaiter$
|
19538
|
+
var __awaiter$g = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
|
18289
19539
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
18290
19540
|
return new (P || (P = Promise))(function (resolve, reject) {
|
18291
19541
|
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
@@ -18306,7 +19556,7 @@ const AvatarPersona = (props) => {
|
|
18306
19556
|
const { userId, dataProvider, text, imageUrl, imageInitials, initialsColor, initialsTextColor, showOverflowTooltip } = props;
|
18307
19557
|
const [data, setData] = React.useState();
|
18308
19558
|
React.useEffect(() => {
|
18309
|
-
(() => __awaiter$
|
19559
|
+
(() => __awaiter$g(void 0, void 0, void 0, function* () {
|
18310
19560
|
if (dataProvider && userId) {
|
18311
19561
|
const newData = yield dataProvider(userId);
|
18312
19562
|
if (avatarDeepDifferenceCheck(data, newData)) {
|
@@ -18670,7 +19920,7 @@ const FileDownloadErrorBar = (props) => {
|
|
18670
19920
|
|
18671
19921
|
// Copyright (c) Microsoft Corporation.
|
18672
19922
|
// Licensed under the MIT license.
|
18673
|
-
var __awaiter$
|
19923
|
+
var __awaiter$f = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
|
18674
19924
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
18675
19925
|
return new (P || (P = Promise))(function (resolve, reject) {
|
18676
19926
|
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
@@ -18691,7 +19941,7 @@ const ChatScreen = (props) => {
|
|
18691
19941
|
const theme = useTheme();
|
18692
19942
|
React.useEffect(() => {
|
18693
19943
|
// Initial data should be always fetched by the composite(or external caller) instead of the adapter
|
18694
|
-
const fetchData = () => __awaiter$
|
19944
|
+
const fetchData = () => __awaiter$f(void 0, void 0, void 0, function* () {
|
18695
19945
|
// Fetch initial data for adapter
|
18696
19946
|
yield adapter.fetchInitialData();
|
18697
19947
|
// Fetch initial set of messages. Without fetching messages here, if the Composite's adapter is changed the message thread does not load new messages.
|
@@ -18725,7 +19975,7 @@ const ChatScreen = (props) => {
|
|
18725
19975
|
setDownloadErrorMessage(errorMessage);
|
18726
19976
|
} })), [fileSharing === null || fileSharing === void 0 ? void 0 : fileSharing.downloadHandler]);
|
18727
19977
|
/* @conditional-compile-remove(teams-inline-images) */
|
18728
|
-
const onRenderInlineAttachment = React.useCallback((attachment) => __awaiter$
|
19978
|
+
const onRenderInlineAttachment = React.useCallback((attachment) => __awaiter$f(void 0, void 0, void 0, function* () {
|
18729
19979
|
if (attachment.previewUrl) {
|
18730
19980
|
const blob = yield adapter.downloadAttachments({ attachmentUrls: [attachment.previewUrl] });
|
18731
19981
|
return blob;
|
@@ -18901,7 +20151,7 @@ const adaptCompositeState = (compositeState) => {
|
|
18901
20151
|
|
18902
20152
|
// Copyright (c) Microsoft Corporation.
|
18903
20153
|
// Licensed under the MIT license.
|
18904
|
-
var __awaiter$
|
20154
|
+
var __awaiter$e = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
|
18905
20155
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
18906
20156
|
return new (P || (P = Promise))(function (resolve, reject) {
|
18907
20157
|
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
@@ -18920,104 +20170,104 @@ _component) => {
|
|
18920
20170
|
return createCompositeHandlers(useAdapter());
|
18921
20171
|
};
|
18922
20172
|
const createCompositeHandlers = memoizeOne__default['default']((adapter) => ({
|
18923
|
-
onCreateLocalStreamView: (options) => __awaiter$
|
20173
|
+
onCreateLocalStreamView: (options) => __awaiter$e(void 0, void 0, void 0, function* () {
|
18924
20174
|
return yield adapter.createStreamView(undefined, options);
|
18925
20175
|
}),
|
18926
|
-
onCreateRemoteStreamView: (userId, options) => __awaiter$
|
20176
|
+
onCreateRemoteStreamView: (userId, options) => __awaiter$e(void 0, void 0, void 0, function* () {
|
18927
20177
|
return yield adapter.createStreamView(userId, options);
|
18928
20178
|
}),
|
18929
|
-
onHangUp: (forEveryone) => __awaiter$
|
20179
|
+
onHangUp: (forEveryone) => __awaiter$e(void 0, void 0, void 0, function* () {
|
18930
20180
|
yield adapter.leaveCall(forEveryone);
|
18931
20181
|
}),
|
18932
20182
|
/* @conditional-compile-remove(PSTN-calls) */
|
18933
|
-
onToggleHold: () => __awaiter$
|
20183
|
+
onToggleHold: () => __awaiter$e(void 0, void 0, void 0, function* () {
|
18934
20184
|
var _a;
|
18935
20185
|
return ((_a = adapter.getState().call) === null || _a === void 0 ? void 0 : _a.state) === 'LocalHold' ? yield adapter.resumeCall() : yield adapter.holdCall();
|
18936
20186
|
}),
|
18937
20187
|
/* @conditional-compile-remove(PSTN-calls) */
|
18938
|
-
onAddParticipant: (participant, options) => __awaiter$
|
20188
|
+
onAddParticipant: (participant, options) => __awaiter$e(void 0, void 0, void 0, function* () {
|
18939
20189
|
return yield adapter.addParticipant(participant, options);
|
18940
20190
|
}),
|
18941
20191
|
/* @conditional-compile-remove(PSTN-calls) */
|
18942
|
-
onSendDtmfTone: (dtmfTone) => __awaiter$
|
20192
|
+
onSendDtmfTone: (dtmfTone) => __awaiter$e(void 0, void 0, void 0, function* () {
|
18943
20193
|
yield adapter.sendDtmfTone(dtmfTone);
|
18944
20194
|
}),
|
18945
|
-
onRemoveParticipant: (userId) => __awaiter$
|
20195
|
+
onRemoveParticipant: (userId) => __awaiter$e(void 0, void 0, void 0, function* () {
|
18946
20196
|
yield adapter.removeParticipant(userId);
|
18947
20197
|
}),
|
18948
|
-
onSelectCamera: (deviceInfo, options) => __awaiter$
|
20198
|
+
onSelectCamera: (deviceInfo, options) => __awaiter$e(void 0, void 0, void 0, function* () {
|
18949
20199
|
yield adapter.setCamera(deviceInfo, options);
|
18950
20200
|
}),
|
18951
|
-
onSelectMicrophone: (deviceInfo) => __awaiter$
|
20201
|
+
onSelectMicrophone: (deviceInfo) => __awaiter$e(void 0, void 0, void 0, function* () {
|
18952
20202
|
yield adapter.setMicrophone(deviceInfo);
|
18953
20203
|
}),
|
18954
|
-
onSelectSpeaker: (deviceInfo) => __awaiter$
|
20204
|
+
onSelectSpeaker: (deviceInfo) => __awaiter$e(void 0, void 0, void 0, function* () {
|
18955
20205
|
yield adapter.setSpeaker(deviceInfo);
|
18956
20206
|
}),
|
18957
20207
|
onStartCall: (participants, options) => {
|
18958
20208
|
const rawIds = participants.map((participant) => toFlatCommunicationIdentifier(participant));
|
18959
20209
|
return adapter.startCall(rawIds, options);
|
18960
20210
|
},
|
18961
|
-
onStartScreenShare: () => __awaiter$
|
20211
|
+
onStartScreenShare: () => __awaiter$e(void 0, void 0, void 0, function* () {
|
18962
20212
|
yield adapter.startScreenShare();
|
18963
20213
|
}),
|
18964
|
-
onStopScreenShare: () => __awaiter$
|
20214
|
+
onStopScreenShare: () => __awaiter$e(void 0, void 0, void 0, function* () {
|
18965
20215
|
yield adapter.stopScreenShare();
|
18966
20216
|
}),
|
18967
|
-
onToggleCamera: (options) => __awaiter$
|
20217
|
+
onToggleCamera: (options) => __awaiter$e(void 0, void 0, void 0, function* () {
|
18968
20218
|
isCameraOn(adapter.getState()) ? yield adapter.stopCamera() : yield adapter.startCamera(options);
|
18969
20219
|
}),
|
18970
|
-
onToggleMicrophone: () => __awaiter$
|
20220
|
+
onToggleMicrophone: () => __awaiter$e(void 0, void 0, void 0, function* () {
|
18971
20221
|
var _b;
|
18972
20222
|
return ((_b = adapter.getState().call) === null || _b === void 0 ? void 0 : _b.isMuted) ? yield adapter.unmute() : yield adapter.mute();
|
18973
20223
|
}),
|
18974
|
-
onToggleScreenShare: () => __awaiter$
|
20224
|
+
onToggleScreenShare: () => __awaiter$e(void 0, void 0, void 0, function* () {
|
18975
20225
|
var _c;
|
18976
20226
|
return ((_c = adapter.getState().call) === null || _c === void 0 ? void 0 : _c.isScreenSharingOn)
|
18977
20227
|
? yield adapter.stopScreenShare()
|
18978
20228
|
: yield adapter.startScreenShare();
|
18979
20229
|
}),
|
18980
|
-
onStartLocalVideo: () => __awaiter$
|
20230
|
+
onStartLocalVideo: () => __awaiter$e(void 0, void 0, void 0, function* () {
|
18981
20231
|
if (adapter.getState().call) {
|
18982
20232
|
return adapter.startCamera();
|
18983
20233
|
}
|
18984
20234
|
}),
|
18985
|
-
onDisposeLocalStreamView: () => __awaiter$
|
20235
|
+
onDisposeLocalStreamView: () => __awaiter$e(void 0, void 0, void 0, function* () {
|
18986
20236
|
return adapter.disposeStreamView();
|
18987
20237
|
}),
|
18988
|
-
onDisposeRemoteStreamView: (userId) => __awaiter$
|
20238
|
+
onDisposeRemoteStreamView: (userId) => __awaiter$e(void 0, void 0, void 0, function* () {
|
18989
20239
|
return adapter.disposeStreamView(userId);
|
18990
20240
|
}),
|
18991
20241
|
/* @conditional-compile-remove(call-readiness) */
|
18992
|
-
askDevicePermission: (constrain) => __awaiter$
|
20242
|
+
askDevicePermission: (constrain) => __awaiter$e(void 0, void 0, void 0, function* () {
|
18993
20243
|
return adapter.askDevicePermission(constrain);
|
18994
20244
|
}),
|
18995
20245
|
/* @conditional-compile-remove(video-background-effects) */
|
18996
|
-
onRemoveVideoBackgroundEffects: () => __awaiter$
|
20246
|
+
onRemoveVideoBackgroundEffects: () => __awaiter$e(void 0, void 0, void 0, function* () {
|
18997
20247
|
return yield adapter.stopVideoBackgroundEffect();
|
18998
20248
|
}),
|
18999
20249
|
/* @conditional-compile-remove(video-background-effects) */
|
19000
|
-
onBlurVideoBackground: (backgroundBlurConfig) => __awaiter$
|
20250
|
+
onBlurVideoBackground: (backgroundBlurConfig) => __awaiter$e(void 0, void 0, void 0, function* () {
|
19001
20251
|
return yield adapter.blurVideoBackground(backgroundBlurConfig);
|
19002
20252
|
}),
|
19003
20253
|
/* @conditional-compile-remove(video-background-effects) */
|
19004
|
-
onReplaceVideoBackground: (backgroundReplacementConfig) => __awaiter$
|
20254
|
+
onReplaceVideoBackground: (backgroundReplacementConfig) => __awaiter$e(void 0, void 0, void 0, function* () {
|
19005
20255
|
return yield adapter.replaceVideoBackground(backgroundReplacementConfig);
|
19006
20256
|
}),
|
19007
20257
|
/* @conditional-compile-remove(close-captions) */
|
19008
|
-
onStartCaptions: (options) => __awaiter$
|
20258
|
+
onStartCaptions: (options) => __awaiter$e(void 0, void 0, void 0, function* () {
|
19009
20259
|
yield adapter.startCaptions(options);
|
19010
20260
|
}),
|
19011
20261
|
/* @conditional-compile-remove(close-captions) */
|
19012
|
-
onStopCaptions: () => __awaiter$
|
20262
|
+
onStopCaptions: () => __awaiter$e(void 0, void 0, void 0, function* () {
|
19013
20263
|
yield adapter.stopCaptions();
|
19014
20264
|
}),
|
19015
20265
|
/* @conditional-compile-remove(close-captions) */
|
19016
|
-
onSetSpokenLanguage: (language) => __awaiter$
|
20266
|
+
onSetSpokenLanguage: (language) => __awaiter$e(void 0, void 0, void 0, function* () {
|
19017
20267
|
yield adapter.setSpokenLanguage(language);
|
19018
20268
|
}),
|
19019
20269
|
/* @conditional-compile-remove(close-captions) */
|
19020
|
-
onSetCaptionLanguage: (language) => __awaiter$
|
20270
|
+
onSetCaptionLanguage: (language) => __awaiter$e(void 0, void 0, void 0, function* () {
|
19021
20271
|
yield adapter.setCaptionLanguage(language);
|
19022
20272
|
})
|
19023
20273
|
}));
|
@@ -19148,7 +20398,7 @@ const MoreButton = (props) => {
|
|
19148
20398
|
return (React__default['default'].createElement(ControlBarButton, Object.assign({}, props, { labelKey: 'optionsButtonLabelKey', showLabel: props.showLabel, onRenderOnIcon: icon$2, onRenderOffIcon: icon$2, onClick: props.onClick, "data-ui-id": props['data-ui-id'] })));
|
19149
20399
|
};
|
19150
20400
|
|
19151
|
-
var __awaiter$
|
20401
|
+
var __awaiter$d = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
|
19152
20402
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
19153
20403
|
return new (P || (P = Promise))(function (resolve, reject) {
|
19154
20404
|
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
@@ -19176,7 +20426,7 @@ const CaptionsBannerMoreButton = (props) => {
|
|
19176
20426
|
/* @conditional-compile-remove(close-captions) */
|
19177
20427
|
const moreButtonContextualMenuItems = [];
|
19178
20428
|
/* @conditional-compile-remove(close-captions) */
|
19179
|
-
const startCaptions = React.useCallback(() => __awaiter$
|
20429
|
+
const startCaptions = React.useCallback(() => __awaiter$d(void 0, void 0, void 0, function* () {
|
19180
20430
|
yield startCaptionsButtonHandlers.onStartCaptions({
|
19181
20431
|
spokenLanguage: startCaptionsButtonProps.currentSpokenLanguage
|
19182
20432
|
});
|
@@ -20016,7 +21266,7 @@ const onFetchCustomButtonPropsTrampoline = (options) => {
|
|
20016
21266
|
|
20017
21267
|
// Copyright (c) Microsoft Corporation.
|
20018
21268
|
// Licensed under the MIT license.
|
20019
|
-
var __awaiter$
|
21269
|
+
var __awaiter$c = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
|
20020
21270
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
20021
21271
|
return new (P || (P = Promise))(function (resolve, reject) {
|
20022
21272
|
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
@@ -20039,7 +21289,7 @@ const DesktopMoreButton = (props) => {
|
|
20039
21289
|
/* @conditional-compile-remove(close-captions) */
|
20040
21290
|
const startCaptionsButtonHandlers = useHandlers();
|
20041
21291
|
/* @conditional-compile-remove(close-captions) */
|
20042
|
-
const startCaptions = React.useCallback(() => __awaiter$
|
21292
|
+
const startCaptions = React.useCallback(() => __awaiter$c(void 0, void 0, void 0, function* () {
|
20043
21293
|
yield startCaptionsButtonHandlers.onStartCaptions({
|
20044
21294
|
spokenLanguage: startCaptionsButtonProps.currentSpokenLanguage
|
20045
21295
|
});
|
@@ -20715,7 +21965,7 @@ const themedToggleButtonStyle = (theme, checked) => {
|
|
20715
21965
|
|
20716
21966
|
// Copyright (c) Microsoft Corporation.
|
20717
21967
|
// Licensed under the MIT license.
|
20718
|
-
var __awaiter$
|
21968
|
+
var __awaiter$b = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
|
20719
21969
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
20720
21970
|
return new (P || (P = Promise))(function (resolve, reject) {
|
20721
21971
|
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
@@ -20857,7 +22107,7 @@ const MoreDrawer = (props) => {
|
|
20857
22107
|
? defaultSpokenLanguage
|
20858
22108
|
: startCaptionsButtonProps.currentSpokenLanguage);
|
20859
22109
|
/* @conditional-compile-remove(close-captions) */
|
20860
|
-
const onToggleChange = React.useCallback(() => __awaiter$
|
22110
|
+
const onToggleChange = React.useCallback(() => __awaiter$b(void 0, void 0, void 0, function* () {
|
20861
22111
|
if (!startCaptionsButtonProps.checked) {
|
20862
22112
|
yield startCaptionsButtonHandlers.onStartCaptions({
|
20863
22113
|
spokenLanguage: currentSpokenLanguage
|
@@ -21160,7 +22410,7 @@ const SidePane = (props) => {
|
|
21160
22410
|
return (React__default['default'].createElement(react.Stack, { verticalFill: true, grow: true, styles: paneStyles, "data-ui-id": "SidePane", tokens: props.mobileView ? {} : sidePaneTokens },
|
21161
22411
|
React__default['default'].createElement(Header, null),
|
21162
22412
|
React__default['default'].createElement(react.Stack.Item, { verticalFill: true, grow: true, styles: paneBodyContainer },
|
21163
|
-
React__default['default'].createElement(react.Stack, {
|
22413
|
+
React__default['default'].createElement(react.Stack, { verticalFill: true, styles: scrollableContainer },
|
21164
22414
|
ContentRender && (React__default['default'].createElement(react.Stack.Item, { verticalFill: true, styles: scrollableContainerContents },
|
21165
22415
|
React__default['default'].createElement(ContentRender, null))),
|
21166
22416
|
OverrideContentRender && (React__default['default'].createElement(react.Stack.Item, { verticalFill: true, styles: !(overrideSidePane === null || overrideSidePane === void 0 ? void 0 : overrideSidePane.isActive) && (overrideSidePane === null || overrideSidePane === void 0 ? void 0 : overrideSidePane.persistRenderingWhenClosed)
|
@@ -21540,7 +22790,7 @@ const AddPeopleButton = (props) => {
|
|
21540
22790
|
|
21541
22791
|
// Copyright (c) Microsoft Corporation.
|
21542
22792
|
// Licensed under the MIT license.
|
21543
|
-
var __awaiter$
|
22793
|
+
var __awaiter$a = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
|
21544
22794
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
21545
22795
|
return new (P || (P = Promise))(function (resolve, reject) {
|
21546
22796
|
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
@@ -21562,11 +22812,11 @@ const PeoplePaneContent = (props) => {
|
|
21562
22812
|
return localeStrings.strings.call;
|
21563
22813
|
};
|
21564
22814
|
const strings = getStrings();
|
21565
|
-
const removeParticipantFromCall = React.useCallback((participantId) => __awaiter$
|
22815
|
+
const removeParticipantFromCall = React.useCallback((participantId) => __awaiter$a(void 0, void 0, void 0, function* () {
|
21566
22816
|
yield adapter.removeParticipant(participantId);
|
21567
22817
|
}), [adapter]);
|
21568
22818
|
/* @conditional-compile-remove(PSTN-calls) */
|
21569
|
-
const addParticipantToCall = React.useCallback((participant, options) => __awaiter$
|
22819
|
+
const addParticipantToCall = React.useCallback((participant, options) => __awaiter$a(void 0, void 0, void 0, function* () {
|
21570
22820
|
yield adapter.addParticipant(participant, options);
|
21571
22821
|
}), [adapter]);
|
21572
22822
|
/* @conditional-compile-remove(PSTN-calls) */
|
@@ -21593,7 +22843,7 @@ const PeoplePaneContent = (props) => {
|
|
21593
22843
|
setDrawerMenuItems
|
21594
22844
|
]);
|
21595
22845
|
const participantListProps = React.useMemo(() => {
|
21596
|
-
const onRemoveAParticipant = (participantId) => __awaiter$
|
22846
|
+
const onRemoveAParticipant = (participantId) => __awaiter$a(void 0, void 0, void 0, function* () { return removeParticipantFromCall(participantId); });
|
21597
22847
|
return Object.assign(Object.assign({}, participantListDefaultProps), {
|
21598
22848
|
// Passing undefined callback for mobile to avoid context menus for participants in ParticipantList are clicked
|
21599
22849
|
onRemoveParticipant: props.mobileView ? undefined : onRemoveAParticipant,
|
@@ -21724,7 +22974,7 @@ const localVideoSelector = reselect__namespace.createSelector([callStatusSelecto
|
|
21724
22974
|
};
|
21725
22975
|
});
|
21726
22976
|
|
21727
|
-
var __awaiter$
|
22977
|
+
var __awaiter$9 = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
|
21728
22978
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
21729
22979
|
return new (P || (P = Promise))(function (resolve, reject) {
|
21730
22980
|
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
@@ -21787,7 +23037,7 @@ const VideoEffectsPaneContent = (props) => {
|
|
21787
23037
|
return videoEffects;
|
21788
23038
|
}, [strings, adapter]);
|
21789
23039
|
/* @conditional-compile-remove(video-background-effects) */
|
21790
|
-
const onEffectChange = React.useCallback((effectKey) => __awaiter$
|
23040
|
+
const onEffectChange = React.useCallback((effectKey) => __awaiter$9(void 0, void 0, void 0, function* () {
|
21791
23041
|
if (effectKey === 'blur') {
|
21792
23042
|
const blurEffect = {
|
21793
23043
|
effectName: effectKey
|
@@ -22153,7 +23403,8 @@ const CallArrangement = (props) => {
|
|
22153
23403
|
display: isMobileWithActivePane ? 'none' : 'flex',
|
22154
23404
|
minWidth: props.mobileView ? 'unset' : `${compositeMinWidthRem}rem`,
|
22155
23405
|
width: '100%',
|
22156
|
-
height: '100%'
|
23406
|
+
height: '100%',
|
23407
|
+
position: 'relative'
|
22157
23408
|
};
|
22158
23409
|
}, [isMobileWithActivePane, props.mobileView]);
|
22159
23410
|
/* @conditional-compile-remove(PSTN-calls) */
|
@@ -23124,6 +24375,22 @@ const effectsButtonStyles = (theme) => {
|
|
23124
24375
|
const fillWidth = react.mergeStyles({
|
23125
24376
|
width: '100%'
|
23126
24377
|
});
|
24378
|
+
/** @private */
|
24379
|
+
const panelStyles = {
|
24380
|
+
content: {
|
24381
|
+
display: 'flex',
|
24382
|
+
flexBasis: '100%'
|
24383
|
+
},
|
24384
|
+
scrollableContent: {
|
24385
|
+
display: 'flex',
|
24386
|
+
flexDirection: 'column',
|
24387
|
+
height: '100%'
|
24388
|
+
}
|
24389
|
+
};
|
24390
|
+
/** @private */
|
24391
|
+
const panelFocusProps = {
|
24392
|
+
forceFocusInsideTrap: false
|
24393
|
+
};
|
23127
24394
|
|
23128
24395
|
// Copyright (c) Microsoft Corporation.
|
23129
24396
|
/**
|
@@ -23189,7 +24456,7 @@ const localPreviewButtonStyle = {
|
|
23189
24456
|
|
23190
24457
|
// Copyright (c) Microsoft Corporation.
|
23191
24458
|
// Licensed under the MIT license.
|
23192
|
-
var __awaiter$
|
24459
|
+
var __awaiter$8 = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
|
23193
24460
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
23194
24461
|
return new (P || (P = Promise))(function (resolve, reject) {
|
23195
24462
|
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
@@ -23209,7 +24476,7 @@ const LocalPreview = (props) => {
|
|
23209
24476
|
const { audio: microphonePermissionGranted, video: cameraPermissionGranted } = useSelector$1(devicePermissionSelector);
|
23210
24477
|
const isLocalMicrophoneEnabled = useSelector$1(getLocalMicrophoneEnabled);
|
23211
24478
|
const adapter = useAdapter();
|
23212
|
-
const onToggleMic = React.useCallback(() => __awaiter$
|
24479
|
+
const onToggleMic = React.useCallback(() => __awaiter$8(void 0, void 0, void 0, function* () {
|
23213
24480
|
isLocalMicrophoneEnabled ? adapter.mute() : adapter.unmute();
|
23214
24481
|
}), [adapter, isLocalMicrophoneEnabled]);
|
23215
24482
|
const hasNoDevices = devicesButtonProps.cameras.length === 0 &&
|
@@ -23476,13 +24743,22 @@ const CallReadinessModalFallBack = (props) => {
|
|
23476
24743
|
};
|
23477
24744
|
|
23478
24745
|
// Copyright (c) Microsoft Corporation.
|
24746
|
+
// Licensed under the MIT license.
|
24747
|
+
var __awaiter$7 = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
|
24748
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
24749
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
24750
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
24751
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
24752
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
24753
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
24754
|
+
});
|
24755
|
+
};
|
23479
24756
|
/**
|
23480
24757
|
* @private
|
23481
24758
|
*/
|
23482
24759
|
const ConfigurationPage = (props) => {
|
23483
24760
|
var _a, _b;
|
23484
|
-
const { startCallHandler, mobileView,
|
23485
|
-
/* @conditional-compile-remove(call-readiness) */ modalLayerHostId,
|
24761
|
+
const { startCallHandler, mobileView, modalLayerHostId,
|
23486
24762
|
/* @conditional-compile-remove(call-readiness) */ deviceChecks,
|
23487
24763
|
/* @conditional-compile-remove(call-readiness) */ onPermissionsTroubleshootingClick,
|
23488
24764
|
/* @conditional-compile-remove(call-readiness) */ onNetworkingTroubleShootingClick } = props;
|
@@ -23575,7 +24851,15 @@ const ConfigurationPage = (props) => {
|
|
23575
24851
|
/* @conditional-compile-remove(call-readiness) */
|
23576
24852
|
const forceShowingCheckPermissions = !minimumFallbackTimerElapsed;
|
23577
24853
|
/* @conditional-compile-remove(video-background-effects) */
|
23578
|
-
const { toggleVideoEffectsPane } = useVideoEffectsPane(props.updateSidePaneRenderer, mobileView);
|
24854
|
+
const { toggleVideoEffectsPane, closeVideoEffectsPane, isVideoEffectsPaneOpen } = useVideoEffectsPane(props.updateSidePaneRenderer, mobileView);
|
24855
|
+
const startCall = React.useCallback(() => __awaiter$7(void 0, void 0, void 0, function* () {
|
24856
|
+
/* @conditional-compile-remove(video-background-effects) */
|
24857
|
+
closeVideoEffectsPane();
|
24858
|
+
startCallHandler();
|
24859
|
+
}), [startCallHandler, /* @conditional-compile-remove(video-background-effects) */ closeVideoEffectsPane]);
|
24860
|
+
const panelLayerProps = React.useMemo(() => ({
|
24861
|
+
hostId: modalLayerHostId
|
24862
|
+
}), [modalLayerHostId]);
|
23579
24863
|
return (React__default['default'].createElement(react.Stack, { className: mobileView ? configurationContainerStyleMobile : configurationContainerStyleDesktop },
|
23580
24864
|
React__default['default'].createElement(react.Stack, { styles: bannerNotificationStyles },
|
23581
24865
|
React__default['default'].createElement(ConfigurationPageErrorBar
|
@@ -23593,11 +24877,7 @@ const ConfigurationPage = (props) => {
|
|
23593
24877
|
onPermissionsTroubleshootingClick: onPermissionsTroubleshootingClick, errorBarProps: errorBarProps })),
|
23594
24878
|
/* @conditional-compile-remove(call-readiness) */
|
23595
24879
|
// show the following screen if permission API is availible (not unsupported) and videoState, audioState is assigned values
|
23596
|
-
videoState && videoState !== 'unsupported' && audioState && audioState !== 'unsupported' && (React__default['default'].createElement(CallReadinessModal
|
23597
|
-
/* @conditional-compile-remove(call-readiness) */
|
23598
|
-
, {
|
23599
|
-
/* @conditional-compile-remove(call-readiness) */
|
23600
|
-
modalLayerHostId: modalLayerHostId, mobileView: mobileView,
|
24880
|
+
videoState && videoState !== 'unsupported' && audioState && audioState !== 'unsupported' && (React__default['default'].createElement(CallReadinessModal, { modalLayerHostId: modalLayerHostId, mobileView: mobileView,
|
23601
24881
|
/* @conditional-compile-remove(unsupported-browser) */
|
23602
24882
|
environmentInfo: environmentInfo, permissionsState: permissionsState, isPermissionsModalDismissed: isPermissionsModalDismissed, setIsPermissionsModalDismissed: setIsPermissionsModalDismissed, onPermissionsTroubleshootingClick: onPermissionsTroubleshootingClick })),
|
23603
24883
|
/* @conditional-compile-remove(call-readiness) */
|
@@ -23631,8 +24911,13 @@ const ConfigurationPage = (props) => {
|
|
23631
24911
|
setIsPermissionsModalDismissed(true);
|
23632
24912
|
} })))),
|
23633
24913
|
React__default['default'].createElement(react.Stack, { styles: mobileWithPreview ? startCallButtonContainerStyleMobile : startCallButtonContainerStyleDesktop },
|
23634
|
-
React__default['default'].createElement(StartCallButton, { className: mobileWithPreview ? startCallButtonStyleMobile : undefined, onClick:
|
23635
|
-
React__default['default'].createElement(
|
24914
|
+
React__default['default'].createElement(StartCallButton, { className: mobileWithPreview ? startCallButtonStyleMobile : undefined, onClick: startCall, disabled: disableStartCallButton })))),
|
24915
|
+
React__default['default'].createElement(react.Panel
|
24916
|
+
/* @conditional-compile-remove(video-background-effects) */
|
24917
|
+
, {
|
24918
|
+
/* @conditional-compile-remove(video-background-effects) */
|
24919
|
+
isOpen: isVideoEffectsPaneOpen, hasCloseButton: false, isBlocking: false, isHiddenOnDismiss: false, styles: panelStyles, focusTrapZoneProps: panelFocusProps, layerProps: panelLayerProps },
|
24920
|
+
React__default['default'].createElement(SidePane, { mobileView: props.mobileView, updateSidePaneRenderer: props.updateSidePaneRenderer })))));
|
23636
24921
|
};
|
23637
24922
|
const localPreviewTrampoline = (mobileView, doNotShow) => {
|
23638
24923
|
/* @conditional-compile-remove(rooms) */
|
@@ -24105,9 +25390,7 @@ const MainScreen = (props) => {
|
|
24105
25390
|
case 'configuration':
|
24106
25391
|
pageElement = (React__default['default'].createElement(ConfigurationPage, { mobileView: props.mobileView, startCallHandler: () => {
|
24107
25392
|
adapter.joinCall();
|
24108
|
-
}, updateSidePaneRenderer: setSidePaneRenderer,
|
24109
|
-
/* @conditional-compile-remove(call-readiness) */
|
24110
|
-
modalLayerHostId: props.modalLayerHostId,
|
25393
|
+
}, updateSidePaneRenderer: setSidePaneRenderer, modalLayerHostId: props.modalLayerHostId,
|
24111
25394
|
/* @conditional-compile-remove(call-readiness) */
|
24112
25395
|
deviceChecks: (_a = props.options) === null || _a === void 0 ? void 0 : _a.deviceChecks,
|
24113
25396
|
/* @conditional-compile-remove(call-readiness) */
|