@azure/communication-react 1.3.3-alpha-202208260016.0 → 1.3.3-alpha-202208270015.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (34) hide show
  1. package/dist/communication-react.d.ts +9 -17
  2. package/dist/dist-cjs/communication-react/index.js +182 -86
  3. package/dist/dist-cjs/communication-react/index.js.map +1 -1
  4. package/dist/dist-esm/acs-ui-common/src/telemetryVersion.js +1 -1
  5. package/dist/dist-esm/acs-ui-common/src/telemetryVersion.js.map +1 -1
  6. package/dist/dist-esm/communication-react/src/index.d.ts +1 -1
  7. package/dist/dist-esm/communication-react/src/index.js.map +1 -1
  8. package/dist/dist-esm/react-components/src/components/Dialpad/Dialpad.d.ts +3 -14
  9. package/dist/dist-esm/react-components/src/components/Dialpad/Dialpad.js +64 -42
  10. package/dist/dist-esm/react-components/src/components/Dialpad/Dialpad.js.map +1 -1
  11. package/dist/dist-esm/react-components/src/components/HoldButton.js +1 -1
  12. package/dist/dist-esm/react-components/src/components/HoldButton.js.map +1 -1
  13. package/dist/dist-esm/react-components/src/components/ParticipantItem.js +1 -1
  14. package/dist/dist-esm/react-components/src/components/ParticipantItem.js.map +1 -1
  15. package/dist/dist-esm/react-components/src/components/index.d.ts +1 -1
  16. package/dist/dist-esm/react-components/src/components/index.js.map +1 -1
  17. package/dist/dist-esm/react-components/src/components/utils/useLongPress.d.ts +15 -0
  18. package/dist/dist-esm/react-components/src/components/utils/useLongPress.js +58 -0
  19. package/dist/dist-esm/react-components/src/components/utils/useLongPress.js.map +1 -0
  20. package/dist/dist-esm/react-components/src/theming/icons.d.ts +3 -1
  21. package/dist/dist-esm/react-components/src/theming/icons.js +6 -2
  22. package/dist/dist-esm/react-components/src/theming/icons.js.map +1 -1
  23. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/CallControls.js +3 -3
  24. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/CallControls.js.map +1 -1
  25. package/dist/dist-esm/react-composites/src/composites/CallComposite/styles/Buttons.styles.js +2 -1
  26. package/dist/dist-esm/react-composites/src/composites/CallComposite/styles/Buttons.styles.js.map +1 -1
  27. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/components/DesktopMoreButton.js +1 -1
  28. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/components/DesktopMoreButton.js.map +1 -1
  29. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/components/MoreDrawer.js +1 -1
  30. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/components/MoreDrawer.js.map +1 -1
  31. package/dist/dist-esm/react-composites/src/composites/common/PeoplePaneContent.js +20 -3
  32. package/dist/dist-esm/react-composites/src/composites/common/PeoplePaneContent.js.map +1 -1
  33. package/dist/dist-esm/react-composites/src/composites/common/icons.d.ts +3 -1
  34. package/package.json +8 -8
@@ -192,7 +192,7 @@ const fromFlatCommunicationIdentifier = (id) => {
192
192
  // Copyright (c) Microsoft Corporation.
193
193
  // Licensed under the MIT license.
194
194
  // GENERATED FILE. DO NOT EDIT MANUALLY.
195
- var telemetryVersion = '1.3.3-alpha-202208260016.0';
195
+ var telemetryVersion = '1.3.3-alpha-202208270015.0';
196
196
 
197
197
  // Copyright (c) Microsoft Corporation.
198
198
  /**
@@ -391,7 +391,7 @@ const getCallState = (state, props) => { var _a; return (_a = state.calls[props.
391
391
 
392
392
  // Copyright (c) Microsoft Corporation.
393
393
  // Licensed under the MIT license.
394
- var __awaiter$v = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
394
+ var __awaiter$w = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
395
395
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
396
396
  return new (P || (P = Promise))(function (resolve, reject) {
397
397
  function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
@@ -429,7 +429,7 @@ const _isPreviewOn = (deviceManager) => {
429
429
  *
430
430
  * @private
431
431
  */
432
- const disposeAllLocalPreviewViews = (callClient) => __awaiter$v(void 0, void 0, void 0, function* () {
432
+ const disposeAllLocalPreviewViews = (callClient) => __awaiter$w(void 0, void 0, void 0, function* () {
433
433
  const unparentedViews = callClient.getState().deviceManager.unparentedViews;
434
434
  for (const view of unparentedViews) {
435
435
  yield callClient.disposeView(undefined, undefined, view);
@@ -536,7 +536,7 @@ const holdButtonSelector = reselect__namespace.createSelector([getCallState], (c
536
536
 
537
537
  // Copyright (c) Microsoft Corporation.
538
538
  // Licensed under the MIT license.
539
- var __awaiter$u = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
539
+ var __awaiter$v = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
540
540
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
541
541
  return new (P || (P = Promise))(function (resolve, reject) {
542
542
  function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
@@ -560,7 +560,7 @@ const areStreamsEqual = (prevStream, newStream) => {
560
560
  * @public
561
561
  */
562
562
  const createDefaultCallingHandlers = memoizeOne__default['default']((callClient, callAgent, deviceManager, call) => {
563
- const onStartLocalVideo = () => __awaiter$u(void 0, void 0, void 0, function* () {
563
+ const onStartLocalVideo = () => __awaiter$v(void 0, void 0, void 0, function* () {
564
564
  // Before the call object creates a stream, dispose of any local preview streams.
565
565
  // @TODO: is there any way to parent the unparented view to the call object instead
566
566
  // of disposing and creating a new stream?
@@ -580,7 +580,7 @@ const createDefaultCallingHandlers = memoizeOne__default['default']((callClient,
580
580
  yield call.startVideo(stream);
581
581
  }
582
582
  });
583
- const onStopLocalVideo = (stream) => __awaiter$u(void 0, void 0, void 0, function* () {
583
+ const onStopLocalVideo = (stream) => __awaiter$v(void 0, void 0, void 0, function* () {
584
584
  const callId = call === null || call === void 0 ? void 0 : call.id;
585
585
  if (!callId) {
586
586
  return;
@@ -593,7 +593,7 @@ const createDefaultCallingHandlers = memoizeOne__default['default']((callClient,
593
593
  });
594
594
  }
595
595
  });
596
- const onToggleCamera = (options) => __awaiter$u(void 0, void 0, void 0, function* () {
596
+ const onToggleCamera = (options) => __awaiter$v(void 0, void 0, void 0, function* () {
597
597
  if (call && _isInCall(call.state)) {
598
598
  const stream = call.localVideoStreams.find((stream) => stream.mediaStreamType === 'Video');
599
599
  if (stream) {
@@ -623,19 +623,19 @@ const createDefaultCallingHandlers = memoizeOne__default['default']((callClient,
623
623
  const onStartCall = (participants, options) => {
624
624
  return callAgent ? callAgent.startCall(participants, options) : undefined;
625
625
  };
626
- const onSelectMicrophone = (device) => __awaiter$u(void 0, void 0, void 0, function* () {
626
+ const onSelectMicrophone = (device) => __awaiter$v(void 0, void 0, void 0, function* () {
627
627
  if (!deviceManager) {
628
628
  return;
629
629
  }
630
630
  return deviceManager.selectMicrophone(device);
631
631
  });
632
- const onSelectSpeaker = (device) => __awaiter$u(void 0, void 0, void 0, function* () {
632
+ const onSelectSpeaker = (device) => __awaiter$v(void 0, void 0, void 0, function* () {
633
633
  if (!deviceManager) {
634
634
  return;
635
635
  }
636
636
  return deviceManager.selectSpeaker(device);
637
637
  });
638
- const onSelectCamera = (device, options) => __awaiter$u(void 0, void 0, void 0, function* () {
638
+ const onSelectCamera = (device, options) => __awaiter$v(void 0, void 0, void 0, function* () {
639
639
  if (!deviceManager) {
640
640
  return;
641
641
  }
@@ -658,19 +658,19 @@ const createDefaultCallingHandlers = memoizeOne__default['default']((callClient,
658
658
  }, options);
659
659
  }
660
660
  });
661
- const onToggleMicrophone = () => __awaiter$u(void 0, void 0, void 0, function* () {
661
+ const onToggleMicrophone = () => __awaiter$v(void 0, void 0, void 0, function* () {
662
662
  if (!call || !_isInCall(call.state)) {
663
663
  throw new Error(`Please invoke onToggleMicrophone after call is started`);
664
664
  }
665
665
  return call.isMuted ? yield call.unmute() : yield call.mute();
666
666
  });
667
- const onStartScreenShare = () => __awaiter$u(void 0, void 0, void 0, function* () { return yield (call === null || call === void 0 ? void 0 : call.startScreenSharing()); });
668
- const onStopScreenShare = () => __awaiter$u(void 0, void 0, void 0, function* () { return yield (call === null || call === void 0 ? void 0 : call.stopScreenSharing()); });
669
- const onToggleScreenShare = () => __awaiter$u(void 0, void 0, void 0, function* () { return (call === null || call === void 0 ? void 0 : call.isScreenSharingOn) ? yield onStopScreenShare() : yield onStartScreenShare(); });
670
- const onHangUp = () => __awaiter$u(void 0, void 0, void 0, function* () { return yield (call === null || call === void 0 ? void 0 : call.hangUp()); });
667
+ const onStartScreenShare = () => __awaiter$v(void 0, void 0, void 0, function* () { return yield (call === null || call === void 0 ? void 0 : call.startScreenSharing()); });
668
+ const onStopScreenShare = () => __awaiter$v(void 0, void 0, void 0, function* () { return yield (call === null || call === void 0 ? void 0 : call.stopScreenSharing()); });
669
+ const onToggleScreenShare = () => __awaiter$v(void 0, void 0, void 0, function* () { return (call === null || call === void 0 ? void 0 : call.isScreenSharingOn) ? yield onStopScreenShare() : yield onStartScreenShare(); });
670
+ const onHangUp = () => __awaiter$v(void 0, void 0, void 0, function* () { return yield (call === null || call === void 0 ? void 0 : call.hangUp()); });
671
671
  /* @conditional-compile-remove(PSTN-calls) */
672
- const onToggleHold = () => __awaiter$u(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()); });
673
- const onCreateLocalStreamView = (options = { scalingMode: 'Crop', isMirrored: true }) => __awaiter$u(void 0, void 0, void 0, function* () {
672
+ const onToggleHold = () => __awaiter$v(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()); });
673
+ const onCreateLocalStreamView = (options = { scalingMode: 'Crop', isMirrored: true }) => __awaiter$v(void 0, void 0, void 0, function* () {
674
674
  var _a;
675
675
  if (!call || call.localVideoStreams.length === 0) {
676
676
  return;
@@ -686,7 +686,7 @@ const createDefaultCallingHandlers = memoizeOne__default['default']((callClient,
686
686
  const { view } = (_a = (yield callClient.createView(call.id, undefined, localStream, options))) !== null && _a !== void 0 ? _a : {};
687
687
  return view ? { view } : undefined;
688
688
  });
689
- const onCreateRemoteStreamView = (userId, options = { scalingMode: 'Crop' }) => __awaiter$u(void 0, void 0, void 0, function* () {
689
+ const onCreateRemoteStreamView = (userId, options = { scalingMode: 'Crop' }) => __awaiter$v(void 0, void 0, void 0, function* () {
690
690
  if (!call) {
691
691
  return;
692
692
  }
@@ -714,7 +714,7 @@ const createDefaultCallingHandlers = memoizeOne__default['default']((callClient,
714
714
  }
715
715
  return (createViewResult === null || createViewResult === void 0 ? void 0 : createViewResult.view) ? { view: createViewResult === null || createViewResult === void 0 ? void 0 : createViewResult.view } : undefined;
716
716
  });
717
- const onDisposeRemoteStreamView = (userId) => __awaiter$u(void 0, void 0, void 0, function* () {
717
+ const onDisposeRemoteStreamView = (userId) => __awaiter$v(void 0, void 0, void 0, function* () {
718
718
  if (!call) {
719
719
  return;
720
720
  }
@@ -735,7 +735,7 @@ const createDefaultCallingHandlers = memoizeOne__default['default']((callClient,
735
735
  callClient.disposeView(call.id, participant.identifier, screenShareStream);
736
736
  }
737
737
  });
738
- const onDisposeLocalStreamView = () => __awaiter$u(void 0, void 0, void 0, function* () {
738
+ const onDisposeLocalStreamView = () => __awaiter$v(void 0, void 0, void 0, function* () {
739
739
  // If the user is currently in a call, dispose of the local stream view attached to that call.
740
740
  const callState = call && callClient.getState().calls[call.id];
741
741
  const localStream = callState === null || callState === void 0 ? void 0 : callState.localVideoStreams.find((item) => item.mediaStreamType === 'Video');
@@ -747,11 +747,11 @@ const createDefaultCallingHandlers = memoizeOne__default['default']((callClient,
747
747
  // TODO: we need to remember which LocalVideoStream was used for LocalPreview and dispose that one.
748
748
  yield disposeAllLocalPreviewViews(callClient);
749
749
  });
750
- const onRemoveParticipant = (userId) => __awaiter$u(void 0, void 0, void 0, function* () {
750
+ const onRemoveParticipant = (userId) => __awaiter$v(void 0, void 0, void 0, function* () {
751
751
  yield (call === null || call === void 0 ? void 0 : call.removeParticipant(fromFlatCommunicationIdentifier(userId)));
752
752
  });
753
753
  /* @conditional-compile-remove(PSTN-calls) */
754
- const onAddParticipant = (participant, options) => __awaiter$u(void 0, void 0, void 0, function* () {
754
+ const onAddParticipant = (participant, options) => __awaiter$v(void 0, void 0, void 0, function* () {
755
755
  if (communicationCommon.isPhoneNumberIdentifier(participant)) {
756
756
  yield (call === null || call === void 0 ? void 0 : call.addParticipant(participant, options));
757
757
  }
@@ -760,7 +760,7 @@ const createDefaultCallingHandlers = memoizeOne__default['default']((callClient,
760
760
  }
761
761
  });
762
762
  /* @conditional-compile-remove(dialpad) */ /* @conditional-compile-remove(PSTN-calls) */
763
- const onSendDtmfTone = (dtmfTone) => __awaiter$u(void 0, void 0, void 0, function* () { return yield (call === null || call === void 0 ? void 0 : call.sendDtmf(dtmfTone)); });
763
+ const onSendDtmfTone = (dtmfTone) => __awaiter$v(void 0, void 0, void 0, function* () { return yield (call === null || call === void 0 ? void 0 : call.sendDtmf(dtmfTone)); });
764
764
  return {
765
765
  onHangUp,
766
766
  /* @conditional-compile-remove(PSTN-calls) */
@@ -1899,6 +1899,8 @@ const DEFAULT_COMPONENT_ICONS = {
1899
1899
  ControlButtonMicOn: React__default['default'].createElement(reactIcons.MicOn20Filled, null),
1900
1900
  ControlButtonOptions: React__default['default'].createElement(reactIcons.Settings20Filled, null),
1901
1901
  ControlButtonParticipants: React__default['default'].createElement(reactIcons.People20Filled, null),
1902
+ /* @conditional-compile-remove(dialpad) */ /* @conditional-compile-remove(PSTN-calls) */
1903
+ ControlButtonParticipantsContextualMenuItem: React__default['default'].createElement(reactIcons.People20Regular, null),
1902
1904
  ControlButtonScreenShareStart: React__default['default'].createElement(reactIcons.ShareScreenStart20Filled, null),
1903
1905
  ControlButtonScreenShareStop: React__default['default'].createElement(reactIcons.ShareScreenStop20Filled, null),
1904
1906
  /* @conditional-compile-remove(file-sharing) */
@@ -1938,7 +1940,9 @@ const DEFAULT_COMPONENT_ICONS = {
1938
1940
  ParticipantItemOptionsHovered: React__default['default'].createElement(reactIcons.MoreHorizontal20Filled, null),
1939
1941
  ParticipantItemScreenShareStart: React__default['default'].createElement(reactIcons.ShareScreenStart20Filled, null),
1940
1942
  /* @conditional-compile-remove(PSTN-calls) */
1941
- HoldCall: React__default['default'].createElement(reactIcons.Pause20Regular, null),
1943
+ HoldCallContextualMenuItem: React__default['default'].createElement(reactIcons.CallPause20Regular, null),
1944
+ /* @conditional-compile-remove(PSTN-calls) */
1945
+ HoldCallButton: React__default['default'].createElement(reactIcons.CallPause20Filled, null),
1942
1946
  /* @conditional-compile-remove(PSTN-calls) */
1943
1947
  ResumeCall: React__default['default'].createElement(reactIcons.Play20Regular, null),
1944
1948
  SendBoxSend: React__default['default'].createElement(reactIcons.Send20Regular, null),
@@ -3392,7 +3396,7 @@ const chatMessageActionMenuProps = (menuProps) => {
3392
3396
  return actionMenuProps;
3393
3397
  };
3394
3398
 
3395
- var __awaiter$t = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
3399
+ var __awaiter$u = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
3396
3400
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3397
3401
  return new (P || (P = Promise))(function (resolve, reject) {
3398
3402
  function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
@@ -3417,7 +3421,7 @@ const _FileDownloadCards = (props) => {
3417
3421
  var _a, _b;
3418
3422
  return (_b = (_a = props.strings) === null || _a === void 0 ? void 0 : _a.downloadFile) !== null && _b !== void 0 ? _b : localeStrings.downloadFile;
3419
3423
  }, [(_a = props.strings) === null || _a === void 0 ? void 0 : _a.downloadFile, localeStrings.downloadFile]);
3420
- const fileDownloadHandler = React.useCallback((userId, file) => __awaiter$t(void 0, void 0, void 0, function* () {
3424
+ const fileDownloadHandler = React.useCallback((userId, file) => __awaiter$u(void 0, void 0, void 0, function* () {
3421
3425
  if (!props.downloadHandler) {
3422
3426
  window.open(file.url, '_blank', 'noopener,noreferrer');
3423
3427
  }
@@ -3565,7 +3569,7 @@ const ChatMessageComponentAsMessageBubble = React__default['default'].memo(Messa
3565
3569
 
3566
3570
  // Copyright (c) Microsoft Corporation.
3567
3571
  // Licensed under the MIT license.
3568
- var __awaiter$s = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
3572
+ var __awaiter$t = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
3569
3573
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3570
3574
  return new (P || (P = Promise))(function (resolve, reject) {
3571
3575
  function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
@@ -3599,7 +3603,7 @@ const ChatMessageComponent = (props) => {
3599
3603
  return React__default['default'].createElement(React__default['default'].Fragment, null);
3600
3604
  }
3601
3605
  else if (isEditing) {
3602
- return (React__default['default'].createElement(ChatMessageComponentAsEditBox, { message: message, inlineEditButtons: props.inlineAcceptRejectEditButtons, strings: props.strings, onSubmit: (text, metadata, options) => __awaiter$s(void 0, void 0, void 0, function* () {
3606
+ return (React__default['default'].createElement(ChatMessageComponentAsEditBox, { message: message, inlineEditButtons: props.inlineAcceptRejectEditButtons, strings: props.strings, onSubmit: (text, metadata, options) => __awaiter$t(void 0, void 0, void 0, function* () {
3603
3607
  props.onUpdateMessage &&
3604
3608
  props.message.messageId &&
3605
3609
  (yield props.onUpdateMessage(props.message.messageId, text, metadata, options));
@@ -3698,7 +3702,7 @@ const getParticipantsWhoHaveReadMessage = (message, readReceiptsBySenderId) => {
3698
3702
 
3699
3703
  // Copyright (c) Microsoft Corporation.
3700
3704
  // Licensed under the MIT license.
3701
- var __awaiter$r = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
3705
+ var __awaiter$s = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
3702
3706
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3703
3707
  return new (P || (P = Promise))(function (resolve, reject) {
3704
3708
  function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
@@ -3925,7 +3929,7 @@ const MessageThread = (props) => {
3925
3929
  setChatMessagesInitialized(chatMessagesInitialized);
3926
3930
  };
3927
3931
  // we try to only send those message status if user is scrolled to the bottom.
3928
- const sendMessageStatusIfAtBottom = React.useCallback(() => __awaiter$r(void 0, void 0, void 0, function* () {
3932
+ const sendMessageStatusIfAtBottom = React.useCallback(() => __awaiter$s(void 0, void 0, void 0, function* () {
3929
3933
  if (!isAtBottomOfScrollRef.current ||
3930
3934
  !document.hasFocus() ||
3931
3935
  !messagesRef.current ||
@@ -3976,7 +3980,7 @@ const MessageThread = (props) => {
3976
3980
  setIsAtBottomOfScrollRef(atBottom);
3977
3981
  }, [scrollToBottom, sendMessageStatusIfAtBottom]);
3978
3982
  // Infinite scrolling + threadInitialize function
3979
- const fetchNewMessageWhenAtTop = React.useCallback(() => __awaiter$r(void 0, void 0, void 0, function* () {
3983
+ const fetchNewMessageWhenAtTop = React.useCallback(() => __awaiter$s(void 0, void 0, void 0, function* () {
3980
3984
  if (chatScrollDivRef.current && !isLoadingChatMessagesRef.current) {
3981
3985
  if (onLoadPreviousChatMessages) {
3982
3986
  isLoadingChatMessagesRef.current = true;
@@ -4428,7 +4432,7 @@ const ParticipantItem = (props) => {
4428
4432
  setMenuHidden(true);
4429
4433
  };
4430
4434
  const participantStateString = participantStateStringTrampoline$1(props, strings);
4431
- return (React__default['default'].createElement("div", { ref: containerRef, role: 'menuitem', "data-is-focusable": true, className: react.mergeStyles(participantItemContainerStyle({ localparticipant: me, clickable: !!menuItems }), styles === null || styles === void 0 ? void 0 : styles.root), onMouseEnter: () => setItemHovered(true), onMouseLeave: () => setItemHovered(false), onClick: () => {
4435
+ return (React__default['default'].createElement("div", { ref: containerRef, role: 'menuitem', "data-is-focusable": true, "data-ui-id": "participant-item", className: react.mergeStyles(participantItemContainerStyle({ localparticipant: me, clickable: !!menuItems }), styles === null || styles === void 0 ? void 0 : styles.root), onMouseEnter: () => setItemHovered(true), onMouseLeave: () => setItemHovered(false), onClick: () => {
4432
4436
  if (!participantStateString) {
4433
4437
  setItemHovered(true);
4434
4438
  setMenuHidden(false);
@@ -6789,7 +6793,7 @@ const DevicesButton = (props) => {
6789
6793
 
6790
6794
  // Copyright (c) Microsoft Corporation.
6791
6795
  // Licensed under the MIT license.
6792
- var __awaiter$q = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
6796
+ var __awaiter$r = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
6793
6797
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
6794
6798
  return new (P || (P = Promise))(function (resolve, reject) {
6795
6799
  function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
@@ -6831,7 +6835,7 @@ const CameraButton = (props) => {
6831
6835
  const toggleAnnouncerString = React.useCallback((isCameraOn) => {
6832
6836
  setAnnouncerString(!isCameraOn ? strings.cameraActionTurnedOffAnnouncement : strings.cameraActionTurnedOnAnnouncement);
6833
6837
  }, [strings.cameraActionTurnedOffAnnouncement, strings.cameraActionTurnedOnAnnouncement]);
6834
- const onToggleClick = React.useCallback(() => __awaiter$q(void 0, void 0, void 0, function* () {
6838
+ const onToggleClick = React.useCallback(() => __awaiter$r(void 0, void 0, void 0, function* () {
6835
6839
  // Throttle click on camera, need to await onToggleCamera then allow another click
6836
6840
  if (onToggleCamera) {
6837
6841
  setWaitForCamera(true);
@@ -6963,7 +6967,7 @@ const lightThemeCallButtonStyles = {
6963
6967
 
6964
6968
  // Copyright (c) Microsoft Corporation.
6965
6969
  // Licensed under the MIT license.
6966
- var __awaiter$p = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
6970
+ var __awaiter$q = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
6967
6971
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
6968
6972
  return new (P || (P = Promise))(function (resolve, reject) {
6969
6973
  function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
@@ -7006,7 +7010,7 @@ const MicrophoneButton = (props) => {
7006
7010
  const toggleAnnouncerString = React.useCallback((isMicOn) => {
7007
7011
  setAnnouncerString(!isMicOn ? strings.microphoneActionTurnedOffAnnouncement : strings.microphoneActionTurnedOnAnnouncement);
7008
7012
  }, [strings.microphoneActionTurnedOffAnnouncement, strings.microphoneActionTurnedOnAnnouncement]);
7009
- const onToggleClick = React.useCallback(() => __awaiter$p(void 0, void 0, void 0, function* () {
7013
+ const onToggleClick = React.useCallback(() => __awaiter$q(void 0, void 0, void 0, function* () {
7010
7014
  if (onToggleMicrophone) {
7011
7015
  try {
7012
7016
  yield onToggleMicrophone();
@@ -7817,15 +7821,71 @@ const formatPhoneNumber = (phoneNumber) => {
7817
7821
  };
7818
7822
 
7819
7823
  // Copyright (c) Microsoft Corporation.
7820
- const DialpadButton = (props) => {
7821
- var _a, _b, _c, _d;
7822
- const theme = react.useTheme();
7823
- return (React__default['default'].createElement(react.DefaultButton, { "data-test-id": `dialpad-button-${props.index}`, onClick: () => {
7824
- props.onClick(props.primaryContent, props.index);
7825
- }, styles: react.concatStyleSets(buttonStyles(), (_a = props.styles) === null || _a === void 0 ? void 0 : _a.button) },
7826
- React__default['default'].createElement(react.Stack, null,
7827
- React__default['default'].createElement(react.Text, { className: react.mergeStyles(primaryContentStyles(theme), (_b = props.styles) === null || _b === void 0 ? void 0 : _b.primaryContent) }, props.primaryContent),
7828
- React__default['default'].createElement(react.Text, { className: react.mergeStyles(secondaryContentStyles(theme), (_c = props.styles) === null || _c === void 0 ? void 0 : _c.secondaryContent) }, (_d = props.secondaryContent) !== null && _d !== void 0 ? _d : ' '))));
7824
+ /**
7825
+ * @private
7826
+ */
7827
+ function useLongPress(onClick, onLongPress) {
7828
+ const timerRef = React.useRef();
7829
+ const [isLongPress, setIsLongPress] = React.useState(false);
7830
+ const [action, setAction] = React.useState(false);
7831
+ function startPressTimer() {
7832
+ setIsLongPress(false);
7833
+ timerRef.current = setTimeout(() => {
7834
+ setIsLongPress(true);
7835
+ }, 500);
7836
+ }
7837
+ function handleOnClick() {
7838
+ onClick();
7839
+ if (isLongPress) {
7840
+ onLongPress();
7841
+ return;
7842
+ }
7843
+ }
7844
+ function handleOnKeyDown() {
7845
+ if (action) {
7846
+ setAction(false);
7847
+ startPressTimer();
7848
+ }
7849
+ }
7850
+ function handleOnKeyUp() {
7851
+ setAction(true);
7852
+ timerRef.current && clearTimeout(timerRef.current);
7853
+ }
7854
+ function handleOnMouseDown() {
7855
+ startPressTimer();
7856
+ }
7857
+ function handleOnMouseUp() {
7858
+ timerRef.current && clearTimeout(timerRef.current);
7859
+ }
7860
+ function handleOnTouchStart() {
7861
+ startPressTimer();
7862
+ }
7863
+ function handleOnTouchEnd() {
7864
+ timerRef.current && clearTimeout(timerRef.current);
7865
+ }
7866
+ return {
7867
+ handlers: {
7868
+ onClick: handleOnClick,
7869
+ onMouseDown: handleOnMouseDown,
7870
+ onMouseUp: handleOnMouseUp,
7871
+ onTouchStart: handleOnTouchStart,
7872
+ onTouchEnd: handleOnTouchEnd,
7873
+ onKeyDown: handleOnKeyDown,
7874
+ onKeyUp: handleOnKeyUp
7875
+ }
7876
+ };
7877
+ }
7878
+
7879
+ // Copyright (c) Microsoft Corporation.
7880
+ // Licensed under the MIT license.
7881
+ var __awaiter$p = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
7882
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
7883
+ return new (P || (P = Promise))(function (resolve, reject) {
7884
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
7885
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7886
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
7887
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
7888
+ });
7829
7889
  };
7830
7890
  const dialPadButtonsDefault = [
7831
7891
  [
@@ -7859,58 +7919,76 @@ const DtmfTones = [
7859
7919
  'Num0',
7860
7920
  'Pound'
7861
7921
  ];
7922
+ const DialpadButton = (props) => {
7923
+ var _a, _b, _c, _d;
7924
+ const theme = react.useTheme();
7925
+ const { primaryContent, index, onClick, onLongPress } = props;
7926
+ const clickFunction = React.useCallback(() => __awaiter$p(void 0, void 0, void 0, function* () {
7927
+ onClick(primaryContent, index);
7928
+ }), [primaryContent, index, onClick]);
7929
+ const longPressFunction = React.useCallback(() => __awaiter$p(void 0, void 0, void 0, function* () {
7930
+ onLongPress(primaryContent, index);
7931
+ }), [primaryContent, index, onLongPress]);
7932
+ const { handlers } = useLongPress(clickFunction, longPressFunction);
7933
+ return (React__default['default'].createElement(react.DefaultButton, Object.assign({ "data-test-id": `dialpad-button-${props.index}`, styles: react.concatStyleSets(buttonStyles(), (_a = props.styles) === null || _a === void 0 ? void 0 : _a.button) }, handlers),
7934
+ React__default['default'].createElement(react.Stack, null,
7935
+ React__default['default'].createElement(react.Text, { className: react.mergeStyles(primaryContentStyles(theme), (_b = props.styles) === null || _b === void 0 ? void 0 : _b.primaryContent) }, props.primaryContent),
7936
+ React__default['default'].createElement(react.Text, { className: react.mergeStyles(secondaryContentStyles(theme), (_c = props.styles) === null || _c === void 0 ? void 0 : _c.secondaryContent) }, (_d = props.secondaryContent) !== null && _d !== void 0 ? _d : ' '))));
7937
+ };
7862
7938
  const DialpadContainer = (props) => {
7863
7939
  var _a, _b;
7864
7940
  const theme = react.useTheme();
7865
- const [textValue, setTextValue] = React.useState('');
7866
- const { onSendDtmfTone, onClickDialpadButton, onDisplayDialpadInput, onChange, showDeleteButton = true } = props;
7867
- const sanitizeInput = (input) => {
7868
- // remove non-valid characters from input: letters,special characters excluding +, *,#
7869
- return input.replace(/[^\d*#+]/g, '');
7870
- };
7941
+ const { onSendDtmfTone, onClickDialpadButton, textFieldValue, onChange, showDeleteButton = true } = props;
7942
+ const [plainTextValue, setPlainTextValue] = React.useState(textFieldValue !== null && textFieldValue !== void 0 ? textFieldValue : '');
7943
+ React.useEffect(() => {
7944
+ if (onChange) {
7945
+ onChange(plainTextValue);
7946
+ }
7947
+ }, [plainTextValue, onChange]);
7948
+ React.useEffect(() => {
7949
+ setText(textFieldValue !== null && textFieldValue !== void 0 ? textFieldValue : '');
7950
+ }, [textFieldValue]);
7871
7951
  const onClickDialpad = (input, index) => {
7872
- // remove non-valid characters from input: letters,special characters excluding +, *,#
7873
- const value = sanitizeInput(textValue + input);
7874
- setTextValue(value);
7952
+ setText(plainTextValue + input);
7875
7953
  if (onSendDtmfTone) {
7876
7954
  onSendDtmfTone(DtmfTones[index]);
7877
7955
  }
7878
7956
  if (onClickDialpadButton) {
7879
7957
  onClickDialpadButton(input, index);
7880
7958
  }
7881
- if (onChange) {
7882
- onChange(onDisplayDialpadInput ? onDisplayDialpadInput(value) : formatPhoneNumber(value));
7959
+ };
7960
+ const onLongPressDialpad = (input, index) => {
7961
+ if (input === '0' && index === 10) {
7962
+ setText(plainTextValue + '+');
7963
+ }
7964
+ else {
7965
+ setText(plainTextValue + input);
7966
+ }
7967
+ if (onSendDtmfTone) {
7968
+ onSendDtmfTone(DtmfTones[index]);
7969
+ }
7970
+ if (onClickDialpadButton) {
7971
+ onClickDialpadButton(input, index);
7883
7972
  }
7884
7973
  };
7885
7974
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
7886
- const setText = (e) => {
7975
+ const setText = (input) => {
7887
7976
  // remove non-valid characters from input: letters,special characters excluding +, *,#
7888
- const input = sanitizeInput(e.target.value);
7889
- setTextValue(input);
7977
+ const plainInput = sanitizeInput(input);
7978
+ setPlainTextValue(plainInput);
7890
7979
  };
7891
- // Potential Improvement:
7892
- // comment out the following line for now to disable customization for dialpad content
7893
- // const dialpadButtonsContent = props.dialpadButtons ?? dialPadButtonsDefault;
7894
7980
  const deleteNumbers = () => {
7895
- const modifiedInput = textValue.substring(0, textValue.length - 1);
7896
- setTextValue(modifiedInput);
7897
- if (onChange) {
7898
- onChange(onDisplayDialpadInput ? onDisplayDialpadInput(modifiedInput) : formatPhoneNumber(modifiedInput));
7899
- }
7981
+ const modifiedInput = plainTextValue.substring(0, plainTextValue.length - 1);
7982
+ setText(modifiedInput);
7900
7983
  };
7901
7984
  return (React__default['default'].createElement("div", { className: react.mergeStyles(containerStyles$1(theme), (_a = props.styles) === null || _a === void 0 ? void 0 : _a.root), "data-test-id": "dialpadContainer", "data-ui-id": "dialpadContainer" },
7902
- React__default['default'].createElement(react.TextField, { styles: react.concatStyleSets(textFieldStyles(theme), (_b = props.styles) === null || _b === void 0 ? void 0 : _b.textField), value: onDisplayDialpadInput ? onDisplayDialpadInput(textValue) : formatPhoneNumber(textValue),
7985
+ React__default['default'].createElement(react.TextField, { styles: react.concatStyleSets(textFieldStyles(theme), (_b = props.styles) === null || _b === void 0 ? void 0 : _b.textField), value: textFieldValue ? textFieldValue : formatPhoneNumber(plainTextValue),
7903
7986
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
7904
7987
  onChange: (e) => {
7905
- setText(e);
7906
- // remove non-valid characters from input: letters,special characters excluding +, *,#
7907
- const input = sanitizeInput(e.target.value);
7908
- if (onChange) {
7909
- onChange(onDisplayDialpadInput ? onDisplayDialpadInput(input) : formatPhoneNumber(input));
7910
- }
7988
+ setText(e.target.value);
7911
7989
  }, placeholder: props.strings.placeholderText, "data-test-id": "dialpad-input", onRenderSuffix: () => {
7912
7990
  var _a;
7913
- return (React__default['default'].createElement(React__default['default'].Fragment, null, showDeleteButton && textValue.length !== 0 && (React__default['default'].createElement(react.IconButton, { ariaLabel: props.strings.deleteButtonAriaLabel, onClick: deleteNumbers, styles: react.concatStyleSets(iconButtonStyles(theme), (_a = props.styles) === null || _a === void 0 ? void 0 : _a.deleteIcon), iconProps: { iconName: 'BackSpace' } }))));
7991
+ return (React__default['default'].createElement(React__default['default'].Fragment, null, showDeleteButton && plainTextValue.length !== 0 && (React__default['default'].createElement(react.IconButton, { ariaLabel: props.strings.deleteButtonAriaLabel, onClick: deleteNumbers, styles: react.concatStyleSets(iconButtonStyles(theme), (_a = props.styles) === null || _a === void 0 ? void 0 : _a.deleteIcon), iconProps: { iconName: 'BackSpace' } }))));
7914
7992
  } }),
7915
7993
  React__default['default'].createElement(react.FocusZone, null, dialPadButtonsDefault.map((rows, rowIndex) => {
7916
7994
  return (React__default['default'].createElement(react.Stack, { horizontal: true, key: `row_${rowIndex}`, horizontalAlign: "stretch" }, rows.map((button, columnIndex) => (React__default['default'].createElement(DialpadButton, { key: `button_${columnIndex}`,
@@ -7931,7 +8009,7 @@ const DialpadContainer = (props) => {
7931
8009
  then use this index to locate the corresponding dtmf tones
7932
8010
  DtmfTones[index]
7933
8011
  */
7934
- index: columnIndex + rowIndex * rows.length, primaryContent: button.primaryContent, secondaryContent: button.secondaryContent, styles: props.styles, onClick: onClickDialpad })))));
8012
+ index: columnIndex + rowIndex * rows.length, primaryContent: button.primaryContent, secondaryContent: button.secondaryContent, styles: props.styles, onClick: onClickDialpad, onLongPress: onLongPressDialpad })))));
7935
8013
  }))));
7936
8014
  };
7937
8015
  /**
@@ -7950,6 +8028,10 @@ const Dialpad = (props) => {
7950
8028
  const strings = Object.assign(Object.assign({}, dialpadLocaleStringsTrampoline()), props.strings);
7951
8029
  return React__default['default'].createElement(DialpadContainer, Object.assign({ strings: strings }, props));
7952
8030
  };
8031
+ const sanitizeInput = (input) => {
8032
+ // remove non-valid characters from input: letters,special characters excluding +, *,#
8033
+ return input.replace(/[^\d*#+]/g, '');
8034
+ };
7953
8035
 
7954
8036
  // Copyright (c) Microsoft Corporation.
7955
8037
  /**
@@ -7964,7 +8046,7 @@ const Dialpad = (props) => {
7964
8046
  const HoldButton = (props) => {
7965
8047
  const { onToggleHold, strings } = props;
7966
8048
  const onRenderHoldIcon = () => {
7967
- return React__default['default'].createElement(HighContrastAwareIcon, { disabled: props.disabled, iconName: "HoldCall" });
8049
+ return React__default['default'].createElement(HighContrastAwareIcon, { disabled: props.disabled, iconName: "HoldCallButton" });
7968
8050
  };
7969
8051
  const onRenderResumeIcon = () => {
7970
8052
  return React__default['default'].createElement(HighContrastAwareIcon, { disabled: props.disabled, iconName: "ResumeCall" });
@@ -14675,7 +14757,8 @@ const buttonFlyoutIncreasedSizeStyles = {
14675
14757
  maxHeight: 'unset'
14676
14758
  },
14677
14759
  icon: {
14678
- maxHeight: 'unset'
14760
+ maxHeight: 'unset',
14761
+ textAlign: 'center'
14679
14762
  }
14680
14763
  };
14681
14764
  /**
@@ -15096,7 +15179,7 @@ const CallControls = (props) => {
15096
15179
  props.onPeopleButtonClicked();
15097
15180
  }
15098
15181
  },
15099
- iconProps: { iconName: 'ControlButtonParticipants', styles: { root: { lineHeight: 0 } } },
15182
+ iconProps: { iconName: 'ControlButtonParticipantsContextualMenuItem', styles: { root: { lineHeight: 0 } } },
15100
15183
  itemProps: {
15101
15184
  styles: buttonFlyoutIncreasedSizeStyles
15102
15185
  },
@@ -15109,7 +15192,7 @@ const CallControls = (props) => {
15109
15192
  onClick: () => {
15110
15193
  holdButtonProps.onToggleHold();
15111
15194
  },
15112
- iconProps: { iconName: 'HoldCall', styles: { root: { lineHeight: 0 } } },
15195
+ iconProps: { iconName: 'HoldCallContextualMenuItem', styles: { root: { lineHeight: 0 } } },
15113
15196
  itemProps: {
15114
15197
  styles: buttonFlyoutIncreasedSizeStyles
15115
15198
  },
@@ -15123,7 +15206,7 @@ const CallControls = (props) => {
15123
15206
  onClick: () => {
15124
15207
  setShowDialpad(true);
15125
15208
  },
15126
- iconProps: { iconName: 'Dialpad', styles: { root: { lineHeight: 0 } } },
15209
+ iconProps: { iconName: 'PeoplePaneOpenDialpad', styles: { root: { lineHeight: 0 } } },
15127
15210
  itemProps: {
15128
15211
  styles: buttonFlyoutIncreasedSizeStyles
15129
15212
  }
@@ -15866,10 +15949,11 @@ var __awaiter$9 = (window && window.__awaiter) || function (thisArg, _arguments,
15866
15949
  const PeoplePaneContent = (props) => {
15867
15950
  const { inviteLink, onFetchParticipantMenuItems, setDrawerMenuItems, strings, onRemoveParticipant } = props;
15868
15951
  const participantListDefaultProps = usePropsFor$1(ParticipantList);
15952
+ const disableRemoveButton = !hasRemoveParticipantsPermissionTrampoline();
15869
15953
  const setDrawerMenuItemsForParticipant = React.useMemo(() => {
15870
15954
  return (participant) => {
15871
15955
  if (participant) {
15872
- let contextualMenuItems = createDefaultContextualMenuItems(participant, strings, participantListDefaultProps.onRemoveParticipant, participantListDefaultProps.myUserId);
15956
+ let contextualMenuItems = createDefaultContextualMenuItems(participant, strings, participantListDefaultProps.onRemoveParticipant, participantListDefaultProps.myUserId, disableRemoveButton);
15873
15957
  if (onFetchParticipantMenuItems) {
15874
15958
  contextualMenuItems = onFetchParticipantMenuItems(participant.userId, participantListDefaultProps.myUserId, contextualMenuItems);
15875
15959
  }
@@ -15881,6 +15965,7 @@ const PeoplePaneContent = (props) => {
15881
15965
  strings,
15882
15966
  participantListDefaultProps.onRemoveParticipant,
15883
15967
  participantListDefaultProps.myUserId,
15968
+ disableRemoveButton,
15884
15969
  onFetchParticipantMenuItems,
15885
15970
  setDrawerMenuItems
15886
15971
  ]);
@@ -15916,7 +16001,11 @@ const PeoplePaneContent = (props) => {
15916
16001
  * @param localParticipantUserId - Local participant user id
15917
16002
  * @returns - IContextualMenuItem[]
15918
16003
  */
15919
- const createDefaultContextualMenuItems = (participant, strings, onRemoveParticipant, localParticipantUserId) => {
16004
+ const createDefaultContextualMenuItems = (participant, strings, onRemoveParticipant, localParticipantUserId, disableRemoveButton) => {
16005
+ let disabled = !participant.isRemovable;
16006
+ if (disableRemoveButton) {
16007
+ disabled = disabled || disableRemoveButton;
16008
+ }
15920
16009
  const menuItems = [];
15921
16010
  if ((participant === null || participant === void 0 ? void 0 : participant.userId) !== localParticipantUserId) {
15922
16011
  menuItems.push({
@@ -15930,11 +16019,18 @@ const createDefaultContextualMenuItems = (participant, strings, onRemoveParticip
15930
16019
  iconProps: {
15931
16020
  iconName: 'UserRemove'
15932
16021
  },
15933
- disabled: !participant.isRemovable
16022
+ disabled: disabled
15934
16023
  });
15935
16024
  }
15936
16025
  return menuItems;
15937
16026
  };
16027
+ /**
16028
+ * @private
16029
+ */
16030
+ const hasRemoveParticipantsPermissionTrampoline = () => {
16031
+ /* @conditional-compile-remove(rooms) */
16032
+ return _usePermissions().removeParticipantButton;
16033
+ };
15938
16034
 
15939
16035
  // Copyright (c) Microsoft Corporation.
15940
16036
  /**
@@ -18441,7 +18537,7 @@ const DesktopMoreButton = (props) => {
18441
18537
  onClick: () => {
18442
18538
  holdButtonProps.onToggleHold();
18443
18539
  },
18444
- iconProps: { iconName: 'HoldCall', styles: { root: { lineHeight: 0 } } },
18540
+ iconProps: { iconName: 'HoldCallContextualMenuItem', styles: { root: { lineHeight: 0 } } },
18445
18541
  itemProps: {
18446
18542
  styles: buttonFlyoutIncreasedSizeStyles
18447
18543
  },
@@ -18972,7 +19068,7 @@ const MoreDrawer = (props) => {
18972
19068
  onItemClick: () => {
18973
19069
  holdButtonProps.onToggleHold();
18974
19070
  },
18975
- iconProps: { iconName: 'HoldCall', styles: { root: { lineHeight: 0 } } }
19071
+ iconProps: { iconName: 'HoldCallContextualMenuItem', styles: { root: { lineHeight: 0 } } }
18976
19072
  });
18977
19073
  }
18978
19074
  /*@conditional-compile-remove(PSTN-calls) */