@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
@@ -2,5 +2,5 @@
2
2
  // Copyright (c) Microsoft Corporation.
3
3
  // Licensed under the MIT license.
4
4
  // GENERATED FILE. DO NOT EDIT MANUALLY.
5
- module.exports = '1.3.3-alpha-202208260016.0';
5
+ module.exports = '1.3.3-alpha-202208270015.0';
6
6
  //# sourceMappingURL=telemetryVersion.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"telemetryVersion.js","sourceRoot":"","sources":["../../../../../acs-ui-common/src/telemetryVersion.js"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;AAElC,wCAAwC;AAExC,MAAM,CAAC,OAAO,GAAG,4BAA4B,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\n// GENERATED FILE. DO NOT EDIT MANUALLY.\n\nmodule.exports = '1.3.3-alpha-202208260016.0';\n"]}
1
+ {"version":3,"file":"telemetryVersion.js","sourceRoot":"","sources":["../../../../../acs-ui-common/src/telemetryVersion.js"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;AAElC,wCAAwC;AAExC,MAAM,CAAC,OAAO,GAAG,4BAA4B,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\n// GENERATED FILE. DO NOT EDIT MANUALLY.\n\nmodule.exports = '1.3.3-alpha-202208270015.0';\n"]}
@@ -28,7 +28,7 @@ export { HoldButton } from '../../react-components/src';
28
28
  export { Dialpad } from '../../react-components/src';
29
29
  export type { _IdentifierProviderProps, _Identifiers, ActiveErrorMessage, BaseCustomStyles, CallParticipantListParticipant, CameraButtonContextualMenuStyles, CameraButtonProps, CameraButtonStrings, CameraButtonStyles, ChatMessage, CommunicationParticipant, ComponentLocale, ComponentStrings, ContentSystemMessage, ControlBarButtonProps, ControlBarButtonStrings, ControlBarButtonStyles, ControlBarLayout, ControlBarProps, CreateVideoStreamViewResult, CustomAvatarOptions, CustomMessage, DevicesButtonContextualMenuStyles, DevicesButtonProps, DevicesButtonStrings, DevicesButtonStyles, EndCallButtonProps, EndCallButtonStrings, ErrorBarProps, ErrorBarStrings, ErrorType, GridLayoutProps, GridLayoutStyles, HorizontalGalleryStyles, JumpToNewMessageButtonProps, LocalizationProviderProps, LocalVideoCameraCycleButtonProps, LoadingState, Message, MessageAttachedStatus, MessageCommon, MessageContentType, MessageProps, MessageRenderer, MessageStatusIndicatorProps, MessageStatusIndicatorStrings, MessageThreadProps, MessageThreadStrings, MessageThreadStyles, MicrophoneButtonContextualMenuStyles, MicrophoneButtonProps, MicrophoneButtonStrings, MicrophoneButtonStyles, OnRenderAvatarCallback, OptionsDevice, ParticipantAddedSystemMessage, ParticipantItemProps, ParticipantItemStrings, ParticipantItemStyles, ParticipantListItemStyles, ParticipantListParticipant, ParticipantListProps, ParticipantListStyles, ParticipantMenuItemsCallback, ParticipantRemovedSystemMessage, ParticipantState, ParticipantsButtonContextualMenuStyles, ParticipantsButtonProps, ParticipantsButtonStrings, ParticipantsButtonStyles, ReadReceiptsBySenderId, ScreenShareButtonProps, ScreenShareButtonStrings, SendBoxProps, SendBoxStrings, SendBoxStylesProps, StreamMediaProps, SystemMessage, SystemMessageCommon, TopicUpdatedSystemMessage, TypingIndicatorProps, TypingIndicatorStrings, TypingIndicatorStylesProps, UpdateMessageCallback, VideoGalleryLayout, VideoGalleryLocalParticipant, VideoGalleryParticipant, VideoGalleryProps, VideoGalleryRemoteParticipant, VideoGalleryStream, VideoGalleryStrings, VideoGalleryStyles, VideoStreamOptions, VideoTileProps, VideoTileStylesProps, ViewScalingMode } from '../../react-components/src';
30
30
  export type { Role } from '../../react-components/src';
31
- export type { DialpadProps, DialpadStrings, DialpadStyles, DialpadButtonProps, DtmfTone } from '../../react-components/src';
31
+ export type { DialpadProps, DialpadStrings, DialpadStyles, DtmfTone } from '../../react-components/src';
32
32
  export type { ActiveFileUpload, SendBoxErrorBarError, FileDownloadHandler, FileDownloadError, FileMetadata } from '../../react-components/src';
33
33
  export type { HoldButtonProps, HoldButtonStrings, VideoTileStrings } from '../../react-components/src';
34
34
  export * from '../../react-components/src/localization/locales';
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/index.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EAAE,+BAA+B,EAAE,6BAA6B,EAAE,MAAM,yBAAyB,CAAC;AA2BzG,OAAO,EACL,kBAAkB,EAClB,iBAAiB,EACjB,YAAY,EACZ,aAAa,EACb,YAAY,EACZ,OAAO,EACP,gBAAgB,EAChB,kBAAkB,EAClB,4BAA4B,EAC7B,MAAM,sCAAsC,CAAC;AAgB9C,OAAO,EACL,kBAAkB,EAClB,wBAAwB,EACxB,aAAa,EACb,mBAAmB,EACnB,eAAe,EACf,yBAAyB,EAC1B,MAAM,mCAAmC,CAAC;AAU3C,OAAO,EACL,mBAAmB,EACnB,YAAY,EACZ,UAAU,EACV,gBAAgB,EAChB,aAAa,EACb,aAAa,EACb,QAAQ,EACR,UAAU,EACV,oBAAoB,EACpB,sBAAsB,EACtB,aAAa,EACb,gBAAgB,EAChB,eAAe,EACf,eAAe,EACf,kBAAkB,EAClB,iBAAiB,EACjB,OAAO,EACP,WAAW,EACX,eAAe,EACf,YAAY,EACZ,SAAS,EACV,MAAM,4BAA4B,CAAC;AACpC,6CAA6C;AAC7C,OAAO,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;AAExD,0CAA0C,CAAC,6CAA6C;AACxF,OAAO,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAC;AAyHrD,cAAc,iDAAiD,CAAC;AAChE,cAAc,oCAAoC,CAAC;AAEnD,cAAc,mCAAmC,CAAC;AAElD,OAAO,EAAE,wBAAwB,EAAE,MAAM,gCAAgC,CAAC;AAa1E,cAAc,yCAAyC,CAAC;AACxD,cAAc,eAAe,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\n/**\n * `@azure/communication-react` is an npm package that exports the functionality of the Azure Communication Services - UI Library.\n *\n * This package makes it easy for you to build modern communications user experiences using Azure Communication Services. It gives you a library of production-ready UI components that you can drop into your applications:\n * - Composites: These components are turn-key solutions that implement common communication scenarios. You can quickly add video calling or chat experiences to your applications. Composites are open-source higher order components built using UI components.\n * - UI Components - These components are open-source building blocks that let you build custom communications experience. Components are offered for both calling and chat capabilities that can be combined to build experiences.\n *\n * These UI client libraries all use Microsoft's Fluent design language and assets. Fluent UI provides a foundational layer for the UI Library and is actively used across Microsoft products.\n *\n * In conjunction with the UI components, the UI Library exposes a stateful client library for calling and chat. This client is agnostic to any specific state management framework and can be integrated with common state managers like Redux or React Context.\n * This stateful client library can be used with the UI Components to pass props and methods for the UI Components to render data. For more information, see Stateful Client Overview.\n *\n * For more information visit: https://aka.ms/acsstorybook\n *\n * @packageDocumentation\n */\n\nexport { fromFlatCommunicationIdentifier, toFlatCommunicationIdentifier } from '../../acs-ui-common/src';\nexport type {\n AreEqual,\n CommonProperties,\n MessageStatus,\n Common,\n AreTypeEqual,\n AreParamEqual\n} from '../../acs-ui-common/src';\n\n// Not to export chat/calling specific hook from binding package\nexport type {\n CallClientProviderProps,\n CallAgentProviderProps,\n CallProviderProps,\n GetCallingSelector,\n CallingHandlers,\n CallingBaseSelectorProps\n} from '../../calling-component-bindings/src';\nexport type {\n ChatClientProviderProps,\n ChatThreadClientProviderProps,\n GetChatSelector,\n ChatHandlers,\n ChatBaseSelectorProps\n} from '../../chat-component-bindings/src';\n\nexport {\n CallClientProvider,\n CallAgentProvider,\n CallProvider,\n useCallClient,\n useCallAgent,\n useCall,\n useDeviceManager,\n getCallingSelector,\n createDefaultCallingHandlers\n} from '../../calling-component-bindings/src';\n\nexport type {\n ScreenShareButtonSelector,\n CameraButtonSelector,\n VideoGallerySelector,\n DevicesButtonSelector,\n EmptySelector,\n ErrorBarSelector as CallErrorBarSelector,\n ParticipantListSelector,\n MicrophoneButtonSelector,\n ParticipantsButtonSelector\n} from '../../calling-component-bindings/src';\n/* @conditional-compile-remove(PSTN-calls) */\nexport type { HoldButtonSelector } from '../../calling-component-bindings/src';\n\nexport {\n ChatClientProvider,\n ChatThreadClientProvider,\n useChatClient,\n useChatThreadClient,\n getChatSelector,\n createDefaultChatHandlers\n} from '../../chat-component-bindings/src';\n\nexport type {\n MessageThreadSelector,\n TypingIndicatorSelector,\n ChatParticipantListSelector,\n SendBoxSelector,\n ErrorBarSelector as ChatErrorBarSelector\n} from '../../chat-component-bindings/src';\n\nexport {\n _IdentifierProvider,\n CameraButton,\n ControlBar,\n ControlBarButton,\n DevicesButton,\n EndCallButton,\n ErrorBar,\n GridLayout,\n LocalizationProvider,\n MessageStatusIndicator,\n MessageThread,\n MicrophoneButton,\n ParticipantItem,\n ParticipantList,\n ParticipantsButton,\n ScreenShareButton,\n SendBox,\n StreamMedia,\n TypingIndicator,\n VideoGallery,\n VideoTile\n} from '../../react-components/src';\n/* @conditional-compile-remove(PSTN-calls) */\nexport { HoldButton } from '../../react-components/src';\n\n/* @conditional-compile-remove(dialpad) */ /* @conditional-compile-remove(PSTN-calls) */\nexport { Dialpad } from '../../react-components/src';\n\nexport type {\n _IdentifierProviderProps,\n _Identifiers,\n ActiveErrorMessage,\n BaseCustomStyles,\n CallParticipantListParticipant,\n CameraButtonContextualMenuStyles,\n CameraButtonProps,\n CameraButtonStrings,\n CameraButtonStyles,\n ChatMessage,\n CommunicationParticipant,\n ComponentLocale,\n ComponentStrings,\n ContentSystemMessage,\n ControlBarButtonProps,\n ControlBarButtonStrings,\n ControlBarButtonStyles,\n ControlBarLayout,\n ControlBarProps,\n CreateVideoStreamViewResult,\n CustomAvatarOptions,\n CustomMessage,\n DevicesButtonContextualMenuStyles,\n DevicesButtonProps,\n DevicesButtonStrings,\n DevicesButtonStyles,\n EndCallButtonProps,\n EndCallButtonStrings,\n ErrorBarProps,\n ErrorBarStrings,\n ErrorType,\n GridLayoutProps,\n GridLayoutStyles,\n HorizontalGalleryStyles,\n JumpToNewMessageButtonProps,\n LocalizationProviderProps,\n LocalVideoCameraCycleButtonProps,\n LoadingState,\n Message,\n MessageAttachedStatus,\n MessageCommon,\n MessageContentType,\n MessageProps,\n MessageRenderer,\n MessageStatusIndicatorProps,\n MessageStatusIndicatorStrings,\n MessageThreadProps,\n MessageThreadStrings,\n MessageThreadStyles,\n MicrophoneButtonContextualMenuStyles,\n MicrophoneButtonProps,\n MicrophoneButtonStrings,\n MicrophoneButtonStyles,\n OnRenderAvatarCallback,\n OptionsDevice,\n ParticipantAddedSystemMessage,\n ParticipantItemProps,\n ParticipantItemStrings,\n ParticipantItemStyles,\n ParticipantListItemStyles,\n ParticipantListParticipant,\n ParticipantListProps,\n ParticipantListStyles,\n ParticipantMenuItemsCallback,\n ParticipantRemovedSystemMessage,\n ParticipantState,\n ParticipantsButtonContextualMenuStyles,\n ParticipantsButtonProps,\n ParticipantsButtonStrings,\n ParticipantsButtonStyles,\n ReadReceiptsBySenderId,\n ScreenShareButtonProps,\n ScreenShareButtonStrings,\n SendBoxProps,\n SendBoxStrings,\n SendBoxStylesProps,\n StreamMediaProps,\n SystemMessage,\n SystemMessageCommon,\n TopicUpdatedSystemMessage,\n TypingIndicatorProps,\n TypingIndicatorStrings,\n TypingIndicatorStylesProps,\n UpdateMessageCallback,\n VideoGalleryLayout,\n VideoGalleryLocalParticipant,\n VideoGalleryParticipant,\n VideoGalleryProps,\n VideoGalleryRemoteParticipant,\n VideoGalleryStream,\n VideoGalleryStrings,\n VideoGalleryStyles,\n VideoStreamOptions,\n VideoTileProps,\n VideoTileStylesProps,\n ViewScalingMode\n} from '../../react-components/src';\n/* @conditional-compile-remove(rooms) */\nexport type { Role } from '../../react-components/src';\n/* @conditional-compile-remove(dialpad) */ /* @conditional-compile-remove(PSTN-calls) */\nexport type {\n DialpadProps,\n DialpadStrings,\n DialpadStyles,\n DialpadButtonProps,\n DtmfTone\n} from '../../react-components/src';\n/* @conditional-compile-remove(file-sharing) */\nexport type {\n ActiveFileUpload,\n SendBoxErrorBarError,\n FileDownloadHandler,\n FileDownloadError,\n FileMetadata\n} from '../../react-components/src';\n/* @conditional-compile-remove(PSTN-calls) */\nexport type { HoldButtonProps, HoldButtonStrings, VideoTileStrings } from '../../react-components/src';\n\nexport * from '../../react-components/src/localization/locales';\nexport * from '../../react-components/src/theming';\n\nexport * from '../../calling-stateful-client/src';\nexport type { DeclarativeCallAgent } from '../../calling-stateful-client/src';\nexport { createStatefulChatClient } from '../../chat-stateful-client/src';\nexport type {\n StatefulChatClient,\n StatefulChatClientArgs,\n StatefulChatClientOptions,\n ChatMessageWithStatus,\n ChatClientState,\n ChatError,\n ChatErrors,\n ChatThreadClientState,\n ChatThreadProperties,\n ChatErrorTarget\n} from '../../chat-stateful-client/src';\nexport * from '../../react-composites/src/index-public';\nexport * from './mergedHooks';\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/index.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EAAE,+BAA+B,EAAE,6BAA6B,EAAE,MAAM,yBAAyB,CAAC;AA2BzG,OAAO,EACL,kBAAkB,EAClB,iBAAiB,EACjB,YAAY,EACZ,aAAa,EACb,YAAY,EACZ,OAAO,EACP,gBAAgB,EAChB,kBAAkB,EAClB,4BAA4B,EAC7B,MAAM,sCAAsC,CAAC;AAgB9C,OAAO,EACL,kBAAkB,EAClB,wBAAwB,EACxB,aAAa,EACb,mBAAmB,EACnB,eAAe,EACf,yBAAyB,EAC1B,MAAM,mCAAmC,CAAC;AAU3C,OAAO,EACL,mBAAmB,EACnB,YAAY,EACZ,UAAU,EACV,gBAAgB,EAChB,aAAa,EACb,aAAa,EACb,QAAQ,EACR,UAAU,EACV,oBAAoB,EACpB,sBAAsB,EACtB,aAAa,EACb,gBAAgB,EAChB,eAAe,EACf,eAAe,EACf,kBAAkB,EAClB,iBAAiB,EACjB,OAAO,EACP,WAAW,EACX,eAAe,EACf,YAAY,EACZ,SAAS,EACV,MAAM,4BAA4B,CAAC;AACpC,6CAA6C;AAC7C,OAAO,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;AAExD,0CAA0C,CAAC,6CAA6C;AACxF,OAAO,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAC;AAmHrD,cAAc,iDAAiD,CAAC;AAChE,cAAc,oCAAoC,CAAC;AAEnD,cAAc,mCAAmC,CAAC;AAElD,OAAO,EAAE,wBAAwB,EAAE,MAAM,gCAAgC,CAAC;AAa1E,cAAc,yCAAyC,CAAC;AACxD,cAAc,eAAe,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\n/**\n * `@azure/communication-react` is an npm package that exports the functionality of the Azure Communication Services - UI Library.\n *\n * This package makes it easy for you to build modern communications user experiences using Azure Communication Services. It gives you a library of production-ready UI components that you can drop into your applications:\n * - Composites: These components are turn-key solutions that implement common communication scenarios. You can quickly add video calling or chat experiences to your applications. Composites are open-source higher order components built using UI components.\n * - UI Components - These components are open-source building blocks that let you build custom communications experience. Components are offered for both calling and chat capabilities that can be combined to build experiences.\n *\n * These UI client libraries all use Microsoft's Fluent design language and assets. Fluent UI provides a foundational layer for the UI Library and is actively used across Microsoft products.\n *\n * In conjunction with the UI components, the UI Library exposes a stateful client library for calling and chat. This client is agnostic to any specific state management framework and can be integrated with common state managers like Redux or React Context.\n * This stateful client library can be used with the UI Components to pass props and methods for the UI Components to render data. For more information, see Stateful Client Overview.\n *\n * For more information visit: https://aka.ms/acsstorybook\n *\n * @packageDocumentation\n */\n\nexport { fromFlatCommunicationIdentifier, toFlatCommunicationIdentifier } from '../../acs-ui-common/src';\nexport type {\n AreEqual,\n CommonProperties,\n MessageStatus,\n Common,\n AreTypeEqual,\n AreParamEqual\n} from '../../acs-ui-common/src';\n\n// Not to export chat/calling specific hook from binding package\nexport type {\n CallClientProviderProps,\n CallAgentProviderProps,\n CallProviderProps,\n GetCallingSelector,\n CallingHandlers,\n CallingBaseSelectorProps\n} from '../../calling-component-bindings/src';\nexport type {\n ChatClientProviderProps,\n ChatThreadClientProviderProps,\n GetChatSelector,\n ChatHandlers,\n ChatBaseSelectorProps\n} from '../../chat-component-bindings/src';\n\nexport {\n CallClientProvider,\n CallAgentProvider,\n CallProvider,\n useCallClient,\n useCallAgent,\n useCall,\n useDeviceManager,\n getCallingSelector,\n createDefaultCallingHandlers\n} from '../../calling-component-bindings/src';\n\nexport type {\n ScreenShareButtonSelector,\n CameraButtonSelector,\n VideoGallerySelector,\n DevicesButtonSelector,\n EmptySelector,\n ErrorBarSelector as CallErrorBarSelector,\n ParticipantListSelector,\n MicrophoneButtonSelector,\n ParticipantsButtonSelector\n} from '../../calling-component-bindings/src';\n/* @conditional-compile-remove(PSTN-calls) */\nexport type { HoldButtonSelector } from '../../calling-component-bindings/src';\n\nexport {\n ChatClientProvider,\n ChatThreadClientProvider,\n useChatClient,\n useChatThreadClient,\n getChatSelector,\n createDefaultChatHandlers\n} from '../../chat-component-bindings/src';\n\nexport type {\n MessageThreadSelector,\n TypingIndicatorSelector,\n ChatParticipantListSelector,\n SendBoxSelector,\n ErrorBarSelector as ChatErrorBarSelector\n} from '../../chat-component-bindings/src';\n\nexport {\n _IdentifierProvider,\n CameraButton,\n ControlBar,\n ControlBarButton,\n DevicesButton,\n EndCallButton,\n ErrorBar,\n GridLayout,\n LocalizationProvider,\n MessageStatusIndicator,\n MessageThread,\n MicrophoneButton,\n ParticipantItem,\n ParticipantList,\n ParticipantsButton,\n ScreenShareButton,\n SendBox,\n StreamMedia,\n TypingIndicator,\n VideoGallery,\n VideoTile\n} from '../../react-components/src';\n/* @conditional-compile-remove(PSTN-calls) */\nexport { HoldButton } from '../../react-components/src';\n\n/* @conditional-compile-remove(dialpad) */ /* @conditional-compile-remove(PSTN-calls) */\nexport { Dialpad } from '../../react-components/src';\n\nexport type {\n _IdentifierProviderProps,\n _Identifiers,\n ActiveErrorMessage,\n BaseCustomStyles,\n CallParticipantListParticipant,\n CameraButtonContextualMenuStyles,\n CameraButtonProps,\n CameraButtonStrings,\n CameraButtonStyles,\n ChatMessage,\n CommunicationParticipant,\n ComponentLocale,\n ComponentStrings,\n ContentSystemMessage,\n ControlBarButtonProps,\n ControlBarButtonStrings,\n ControlBarButtonStyles,\n ControlBarLayout,\n ControlBarProps,\n CreateVideoStreamViewResult,\n CustomAvatarOptions,\n CustomMessage,\n DevicesButtonContextualMenuStyles,\n DevicesButtonProps,\n DevicesButtonStrings,\n DevicesButtonStyles,\n EndCallButtonProps,\n EndCallButtonStrings,\n ErrorBarProps,\n ErrorBarStrings,\n ErrorType,\n GridLayoutProps,\n GridLayoutStyles,\n HorizontalGalleryStyles,\n JumpToNewMessageButtonProps,\n LocalizationProviderProps,\n LocalVideoCameraCycleButtonProps,\n LoadingState,\n Message,\n MessageAttachedStatus,\n MessageCommon,\n MessageContentType,\n MessageProps,\n MessageRenderer,\n MessageStatusIndicatorProps,\n MessageStatusIndicatorStrings,\n MessageThreadProps,\n MessageThreadStrings,\n MessageThreadStyles,\n MicrophoneButtonContextualMenuStyles,\n MicrophoneButtonProps,\n MicrophoneButtonStrings,\n MicrophoneButtonStyles,\n OnRenderAvatarCallback,\n OptionsDevice,\n ParticipantAddedSystemMessage,\n ParticipantItemProps,\n ParticipantItemStrings,\n ParticipantItemStyles,\n ParticipantListItemStyles,\n ParticipantListParticipant,\n ParticipantListProps,\n ParticipantListStyles,\n ParticipantMenuItemsCallback,\n ParticipantRemovedSystemMessage,\n ParticipantState,\n ParticipantsButtonContextualMenuStyles,\n ParticipantsButtonProps,\n ParticipantsButtonStrings,\n ParticipantsButtonStyles,\n ReadReceiptsBySenderId,\n ScreenShareButtonProps,\n ScreenShareButtonStrings,\n SendBoxProps,\n SendBoxStrings,\n SendBoxStylesProps,\n StreamMediaProps,\n SystemMessage,\n SystemMessageCommon,\n TopicUpdatedSystemMessage,\n TypingIndicatorProps,\n TypingIndicatorStrings,\n TypingIndicatorStylesProps,\n UpdateMessageCallback,\n VideoGalleryLayout,\n VideoGalleryLocalParticipant,\n VideoGalleryParticipant,\n VideoGalleryProps,\n VideoGalleryRemoteParticipant,\n VideoGalleryStream,\n VideoGalleryStrings,\n VideoGalleryStyles,\n VideoStreamOptions,\n VideoTileProps,\n VideoTileStylesProps,\n ViewScalingMode\n} from '../../react-components/src';\n/* @conditional-compile-remove(rooms) */\nexport type { Role } from '../../react-components/src';\n/* @conditional-compile-remove(dialpad) */ /* @conditional-compile-remove(PSTN-calls) */\nexport type { DialpadProps, DialpadStrings, DialpadStyles, DtmfTone } from '../../react-components/src';\n/* @conditional-compile-remove(file-sharing) */\nexport type {\n ActiveFileUpload,\n SendBoxErrorBarError,\n FileDownloadHandler,\n FileDownloadError,\n FileMetadata\n} from '../../react-components/src';\n/* @conditional-compile-remove(PSTN-calls) */\nexport type { HoldButtonProps, HoldButtonStrings, VideoTileStrings } from '../../react-components/src';\n\nexport * from '../../react-components/src/localization/locales';\nexport * from '../../react-components/src/theming';\n\nexport * from '../../calling-stateful-client/src';\nexport type { DeclarativeCallAgent } from '../../calling-stateful-client/src';\nexport { createStatefulChatClient } from '../../chat-stateful-client/src';\nexport type {\n StatefulChatClient,\n StatefulChatClientArgs,\n StatefulChatClientOptions,\n ChatMessageWithStatus,\n ChatClientState,\n ChatError,\n ChatErrors,\n ChatThreadClientState,\n ChatThreadProperties,\n ChatErrorTarget\n} from '../../chat-stateful-client/src';\nexport * from '../../react-composites/src/index-public';\nexport * from './mergedHooks';\n"]}
@@ -22,17 +22,6 @@ export interface DialpadStyles {
22
22
  secondaryContent?: IStyle;
23
23
  deleteIcon?: IButtonStyles;
24
24
  }
25
- /**
26
- * Type for {@link DialpadButton} input
27
- *
28
- * @beta
29
- */
30
- export interface DialpadButtonProps {
31
- /** Number displayed on each dialpad button */
32
- primaryContent: string;
33
- /** Letters displayed on each dialpad button */
34
- secondaryContent?: string;
35
- }
36
25
  /**
37
26
  * DTMF tone for PSTN calls.
38
27
  *
@@ -50,9 +39,9 @@ export interface DialpadProps {
50
39
  onSendDtmfTone?: (dtmfTone: DtmfTone) => Promise<void>;
51
40
  /** Callback for dialpad button behavior*/
52
41
  onClickDialpadButton?: (buttonValue: string, buttonIndex: number) => void;
53
- /** customize dialpad input formatting */
54
- onDisplayDialpadInput?: (input: string) => string;
55
- /** on change function for text field */
42
+ /** set dialpad textfield content */
43
+ textFieldValue?: string;
44
+ /** on change function for text field, provides an unformatted plain text*/
56
45
  onChange?: (input: string) => void;
57
46
  /** boolean input to determine when to show/hide delete button, default true */
58
47
  showDeleteButton?: boolean;
@@ -1,6 +1,15 @@
1
1
  // Copyright (c) Microsoft Corporation.
2
2
  // Licensed under the MIT license.
3
- import React from 'react';
3
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
4
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
5
+ return new (P || (P = Promise))(function (resolve, reject) {
6
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
7
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
8
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
9
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
10
+ });
11
+ };
12
+ import React, { useEffect, useCallback } from 'react';
4
13
  import { IconButton } from '@fluentui/react';
5
14
  import { concatStyleSets, DefaultButton, FocusZone, mergeStyles, Stack, Text, TextField, useTheme } from '@fluentui/react';
6
15
  import { useState } from 'react';
@@ -8,16 +17,7 @@ import { useState } from 'react';
8
17
  import { useLocale } from '../../localization';
9
18
  import { buttonStyles, containerStyles, iconButtonStyles, primaryContentStyles, secondaryContentStyles, textFieldStyles } from '../styles/Dialpad.styles';
10
19
  import { formatPhoneNumber } from '../utils/formatPhoneNumber';
11
- const DialpadButton = (props) => {
12
- var _a, _b, _c, _d;
13
- const theme = useTheme();
14
- return (React.createElement(DefaultButton, { "data-test-id": `dialpad-button-${props.index}`, onClick: () => {
15
- props.onClick(props.primaryContent, props.index);
16
- }, styles: concatStyleSets(buttonStyles(theme), (_a = props.styles) === null || _a === void 0 ? void 0 : _a.button) },
17
- React.createElement(Stack, null,
18
- React.createElement(Text, { className: mergeStyles(primaryContentStyles(theme), (_b = props.styles) === null || _b === void 0 ? void 0 : _b.primaryContent) }, props.primaryContent),
19
- React.createElement(Text, { className: mergeStyles(secondaryContentStyles(theme), (_c = props.styles) === null || _c === void 0 ? void 0 : _c.secondaryContent) }, (_d = props.secondaryContent) !== null && _d !== void 0 ? _d : ' '))));
20
- };
20
+ import useLongPress from '../utils/useLongPress';
21
21
  const dialPadButtonsDefault = [
22
22
  [
23
23
  { primaryContent: '1' },
@@ -50,58 +50,76 @@ const DtmfTones = [
50
50
  'Num0',
51
51
  'Pound'
52
52
  ];
53
+ const DialpadButton = (props) => {
54
+ var _a, _b, _c, _d;
55
+ const theme = useTheme();
56
+ const { primaryContent, index, onClick, onLongPress } = props;
57
+ const clickFunction = useCallback(() => __awaiter(void 0, void 0, void 0, function* () {
58
+ onClick(primaryContent, index);
59
+ }), [primaryContent, index, onClick]);
60
+ const longPressFunction = useCallback(() => __awaiter(void 0, void 0, void 0, function* () {
61
+ onLongPress(primaryContent, index);
62
+ }), [primaryContent, index, onLongPress]);
63
+ const { handlers } = useLongPress(clickFunction, longPressFunction);
64
+ return (React.createElement(DefaultButton, Object.assign({ "data-test-id": `dialpad-button-${props.index}`, styles: concatStyleSets(buttonStyles(theme), (_a = props.styles) === null || _a === void 0 ? void 0 : _a.button) }, handlers),
65
+ React.createElement(Stack, null,
66
+ React.createElement(Text, { className: mergeStyles(primaryContentStyles(theme), (_b = props.styles) === null || _b === void 0 ? void 0 : _b.primaryContent) }, props.primaryContent),
67
+ React.createElement(Text, { className: mergeStyles(secondaryContentStyles(theme), (_c = props.styles) === null || _c === void 0 ? void 0 : _c.secondaryContent) }, (_d = props.secondaryContent) !== null && _d !== void 0 ? _d : ' '))));
68
+ };
53
69
  const DialpadContainer = (props) => {
54
70
  var _a, _b;
55
71
  const theme = useTheme();
56
- const [textValue, setTextValue] = useState('');
57
- const { onSendDtmfTone, onClickDialpadButton, onDisplayDialpadInput, onChange, showDeleteButton = true } = props;
58
- const sanitizeInput = (input) => {
59
- // remove non-valid characters from input: letters,special characters excluding +, *,#
60
- return input.replace(/[^\d*#+]/g, '');
61
- };
72
+ const { onSendDtmfTone, onClickDialpadButton, textFieldValue, onChange, showDeleteButton = true } = props;
73
+ const [plainTextValue, setPlainTextValue] = useState(textFieldValue !== null && textFieldValue !== void 0 ? textFieldValue : '');
74
+ useEffect(() => {
75
+ if (onChange) {
76
+ onChange(plainTextValue);
77
+ }
78
+ }, [plainTextValue, onChange]);
79
+ useEffect(() => {
80
+ setText(textFieldValue !== null && textFieldValue !== void 0 ? textFieldValue : '');
81
+ }, [textFieldValue]);
62
82
  const onClickDialpad = (input, index) => {
63
- // remove non-valid characters from input: letters,special characters excluding +, *,#
64
- const value = sanitizeInput(textValue + input);
65
- setTextValue(value);
83
+ setText(plainTextValue + input);
66
84
  if (onSendDtmfTone) {
67
85
  onSendDtmfTone(DtmfTones[index]);
68
86
  }
69
87
  if (onClickDialpadButton) {
70
88
  onClickDialpadButton(input, index);
71
89
  }
72
- if (onChange) {
73
- onChange(onDisplayDialpadInput ? onDisplayDialpadInput(value) : formatPhoneNumber(value));
90
+ };
91
+ const onLongPressDialpad = (input, index) => {
92
+ if (input === '0' && index === 10) {
93
+ setText(plainTextValue + '+');
94
+ }
95
+ else {
96
+ setText(plainTextValue + input);
97
+ }
98
+ if (onSendDtmfTone) {
99
+ onSendDtmfTone(DtmfTones[index]);
100
+ }
101
+ if (onClickDialpadButton) {
102
+ onClickDialpadButton(input, index);
74
103
  }
75
104
  };
76
105
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
77
- const setText = (e) => {
106
+ const setText = (input) => {
78
107
  // remove non-valid characters from input: letters,special characters excluding +, *,#
79
- const input = sanitizeInput(e.target.value);
80
- setTextValue(input);
108
+ const plainInput = sanitizeInput(input);
109
+ setPlainTextValue(plainInput);
81
110
  };
82
- // Potential Improvement:
83
- // comment out the following line for now to disable customization for dialpad content
84
- // const dialpadButtonsContent = props.dialpadButtons ?? dialPadButtonsDefault;
85
111
  const deleteNumbers = () => {
86
- const modifiedInput = textValue.substring(0, textValue.length - 1);
87
- setTextValue(modifiedInput);
88
- if (onChange) {
89
- onChange(onDisplayDialpadInput ? onDisplayDialpadInput(modifiedInput) : formatPhoneNumber(modifiedInput));
90
- }
112
+ const modifiedInput = plainTextValue.substring(0, plainTextValue.length - 1);
113
+ setText(modifiedInput);
91
114
  };
92
115
  return (React.createElement("div", { className: mergeStyles(containerStyles(theme), (_a = props.styles) === null || _a === void 0 ? void 0 : _a.root), "data-test-id": "dialpadContainer", "data-ui-id": "dialpadContainer" },
93
- React.createElement(TextField, { styles: concatStyleSets(textFieldStyles(theme), (_b = props.styles) === null || _b === void 0 ? void 0 : _b.textField), value: onDisplayDialpadInput ? onDisplayDialpadInput(textValue) : formatPhoneNumber(textValue),
116
+ React.createElement(TextField, { styles: concatStyleSets(textFieldStyles(theme), (_b = props.styles) === null || _b === void 0 ? void 0 : _b.textField), value: textFieldValue ? textFieldValue : formatPhoneNumber(plainTextValue),
94
117
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
95
118
  onChange: (e) => {
96
- setText(e);
97
- // remove non-valid characters from input: letters,special characters excluding +, *,#
98
- const input = sanitizeInput(e.target.value);
99
- if (onChange) {
100
- onChange(onDisplayDialpadInput ? onDisplayDialpadInput(input) : formatPhoneNumber(input));
101
- }
119
+ setText(e.target.value);
102
120
  }, placeholder: props.strings.placeholderText, "data-test-id": "dialpad-input", onRenderSuffix: () => {
103
121
  var _a;
104
- return (React.createElement(React.Fragment, null, showDeleteButton && textValue.length !== 0 && (React.createElement(IconButton, { ariaLabel: props.strings.deleteButtonAriaLabel, onClick: deleteNumbers, styles: concatStyleSets(iconButtonStyles(theme), (_a = props.styles) === null || _a === void 0 ? void 0 : _a.deleteIcon), iconProps: { iconName: 'BackSpace' } }))));
122
+ return (React.createElement(React.Fragment, null, showDeleteButton && plainTextValue.length !== 0 && (React.createElement(IconButton, { ariaLabel: props.strings.deleteButtonAriaLabel, onClick: deleteNumbers, styles: concatStyleSets(iconButtonStyles(theme), (_a = props.styles) === null || _a === void 0 ? void 0 : _a.deleteIcon), iconProps: { iconName: 'BackSpace' } }))));
105
123
  } }),
106
124
  React.createElement(FocusZone, null, dialPadButtonsDefault.map((rows, rowIndex) => {
107
125
  return (React.createElement(Stack, { horizontal: true, key: `row_${rowIndex}`, horizontalAlign: "stretch" }, rows.map((button, columnIndex) => (React.createElement(DialpadButton, { key: `button_${columnIndex}`,
@@ -122,7 +140,7 @@ const DialpadContainer = (props) => {
122
140
  then use this index to locate the corresponding dtmf tones
123
141
  DtmfTones[index]
124
142
  */
125
- index: columnIndex + rowIndex * rows.length, primaryContent: button.primaryContent, secondaryContent: button.secondaryContent, styles: props.styles, onClick: onClickDialpad })))));
143
+ index: columnIndex + rowIndex * rows.length, primaryContent: button.primaryContent, secondaryContent: button.secondaryContent, styles: props.styles, onClick: onClickDialpad, onLongPress: onLongPressDialpad })))));
126
144
  }))));
127
145
  };
128
146
  /**
@@ -144,4 +162,8 @@ export const Dialpad = (props) => {
144
162
  const strings = Object.assign(Object.assign({}, dialpadLocaleStringsTrampoline()), props.strings);
145
163
  return React.createElement(DialpadContainer, Object.assign({ strings: strings }, props));
146
164
  };
165
+ const sanitizeInput = (input) => {
166
+ // remove non-valid characters from input: letters,special characters excluding +, *,#
167
+ return input.replace(/[^\d*#+]/g, '');
168
+ };
147
169
  //# sourceMappingURL=Dialpad.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Dialpad.js","sourceRoot":"","sources":["../../../../../../../react-components/src/components/Dialpad/Dialpad.tsx"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EACL,eAAe,EACf,aAAa,EACb,SAAS,EACT,WAAW,EACX,KAAK,EACL,IAAI,EACJ,SAAS,EACT,QAAQ,EACT,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACjC,0CAA0C;AAC1C,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAC/C,OAAO,EACL,YAAY,EACZ,eAAe,EACf,gBAAgB,EAChB,oBAAoB,EACpB,sBAAsB,EACtB,eAAe,EAChB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAqF/D,MAAM,aAAa,GAAG,CAAC,KAMtB,EAAe,EAAE;;IAChB,MAAM,KAAK,GAAG,QAAQ,EAAE,CAAC;IACzB,OAAO,CACL,oBAAC,aAAa,oBACE,kBAAkB,KAAK,CAAC,KAAK,EAAE,EAC7C,OAAO,EAAE,GAAG,EAAE;YACZ,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,cAAc,EAAE,KAAK,CAAC,KAAK,CAAC,CAAC;QACnD,CAAC,E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AE;IAC1D,0CAA0C,CAAC,6CAA6C;IACxF,MAAM,aAAa,GAAG,SAAS,EAAE,CAAC,OAAO,CAAC,OAAO,CAAC;IAElD,MAAM,8BAA8B,GAAG,GAAmB,EAAE;QAC1D,0CAA0C,CAAC,6CAA6C;QACxF,OAAO,aAAa,CAAC;QACrB,wFAAwF;QACxF,4DAA4D;QAC5D,OAAO,EAA+B,CAAC;IACzC,CAAC,CAAC;IACF,MAAM,OAAO,mCAAQ,8BAA8B,EAAE,GAAK,KAAK,CAAC,OAAO,CAAE,CAAC;IAE1E,OAAO,oBAAC,gBAAgB,kBAAC,OAAO,EAAE,OAAO,IAAM,KAAK,EAAI,CAAC;AAC3D,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport React from 'react';\nimport { IStyle, IButtonStyles, ITextFieldStyles } from '@fluentui/react';\n\nimport { IconButton } from '@fluentui/react';\nimport {\n concatStyleSets,\n DefaultButton,\n FocusZone,\n mergeStyles,\n Stack,\n Text,\n TextField,\n useTheme\n} from '@fluentui/react';\nimport { _formatString } from '@internal/acs-ui-common';\nimport { useState } from 'react';\n/* @conditional-compile-remove(dialpad) */\nimport { useLocale } from '../../localization';\nimport {\n buttonStyles,\n containerStyles,\n iconButtonStyles,\n primaryContentStyles,\n secondaryContentStyles,\n textFieldStyles\n} from '../styles/Dialpad.styles';\nimport { formatPhoneNumber } from '../utils/formatPhoneNumber';\n\n/**\n * Strings of {@link Dialpad} that can be overridden.\n *\n * @beta\n */\nexport interface DialpadStrings {\n placeholderText: string;\n deleteButtonAriaLabel?: string;\n}\n\n/**\n * Styles for {@link Dialpad} component.\n *\n * @beta\n */\nexport interface DialpadStyles {\n root?: IStyle;\n button?: IButtonStyles;\n textField?: Partial<ITextFieldStyles>;\n primaryContent?: IStyle;\n secondaryContent?: IStyle;\n deleteIcon?: IButtonStyles;\n}\n\n/**\n * Type for {@link DialpadButton} input\n *\n * @beta\n */\nexport interface DialpadButtonProps {\n /** Number displayed on each dialpad button */\n primaryContent: string;\n /** Letters displayed on each dialpad button */\n secondaryContent?: string;\n}\n\n/**\n * DTMF tone for PSTN calls.\n *\n * @beta\n */\nexport type DtmfTone =\n | 'A'\n | 'B'\n | 'C'\n | 'D'\n | 'Flash'\n | 'Num0'\n | 'Num1'\n | 'Num2'\n | 'Num3'\n | 'Num4'\n | 'Num5'\n | 'Num6'\n | 'Num7'\n | 'Num8'\n | 'Num9'\n | 'Pound'\n | 'Star';\n\n/**\n * Props for {@link Dialpad} component.\n *\n * @beta\n */\nexport interface DialpadProps {\n strings?: DialpadStrings;\n // Potential Improvement:\n // comment out the following prop for now to disable customization for dialpad content\n // dialpadButtons?: DialpadButtonProps[][];\n /** function to send dtmf tones on button click */\n onSendDtmfTone?: (dtmfTone: DtmfTone) => Promise<void>;\n /** Callback for dialpad button behavior*/\n onClickDialpadButton?: (buttonValue: string, buttonIndex: number) => void;\n /** customize dialpad input formatting */\n onDisplayDialpadInput?: (input: string) => string;\n /** on change function for text field */\n onChange?: (input: string) => void;\n /** boolean input to determine when to show/hide delete button, default true */\n showDeleteButton?: boolean;\n styles?: DialpadStyles;\n}\n\nconst DialpadButton = (props: {\n primaryContent: string;\n secondaryContent?: string;\n styles?: DialpadStyles;\n index: number;\n onClick: (input: string, index: number) => void;\n}): JSX.Element => {\n const theme = useTheme();\n return (\n <DefaultButton\n data-test-id={`dialpad-button-${props.index}`}\n onClick={() => {\n props.onClick(props.primaryContent, props.index);\n }}\n styles={concatStyleSets(buttonStyles(theme), props.styles?.button)}\n >\n <Stack>\n <Text className={mergeStyles(primaryContentStyles(theme), props.styles?.primaryContent)}>\n {props.primaryContent}\n </Text>\n\n <Text className={mergeStyles(secondaryContentStyles(theme), props.styles?.secondaryContent)}>\n {props.secondaryContent ?? ' '}\n </Text>\n </Stack>\n </DefaultButton>\n );\n};\n\nconst dialPadButtonsDefault: DialpadButtonProps[][] = [\n [\n { primaryContent: '1' },\n { primaryContent: '2', secondaryContent: 'ABC' },\n { primaryContent: '3', secondaryContent: 'DEF' }\n ],\n [\n { primaryContent: '4', secondaryContent: 'GHI' },\n { primaryContent: '5', secondaryContent: 'JKL' },\n { primaryContent: '6', secondaryContent: 'MNO' }\n ],\n [\n { primaryContent: '7', secondaryContent: 'PQRS' },\n { primaryContent: '8', secondaryContent: 'TUV' },\n { primaryContent: '9', secondaryContent: 'WXYZ' }\n ],\n [{ primaryContent: '*' }, { primaryContent: '0', secondaryContent: '+' }, { primaryContent: '#' }]\n];\n\nconst DtmfTones: DtmfTone[] = [\n 'Num1',\n 'Num2',\n 'Num3',\n 'Num4',\n 'Num5',\n 'Num6',\n 'Num7',\n 'Num8',\n 'Num9',\n 'Star',\n 'Num0',\n 'Pound'\n];\n\nconst DialpadContainer = (props: {\n strings: DialpadStrings;\n // dialpadButtons?: DialpadButtonProps[][];\n onSendDtmfTone?: (dtmfTone: DtmfTone) => Promise<void>;\n /** Callback for dialpad button behavior */\n onClickDialpadButton?: (buttonValue: string, buttonIndex: number) => void;\n /** customize dialpad input formatting */\n onDisplayDialpadInput?: (input: string) => string;\n /** on change function for text field */\n onChange?: (input: string) => void;\n /** boolean input to determine when to show/hide delete button, default true */\n showDeleteButton?: boolean;\n styles?: DialpadStyles;\n}): JSX.Element => {\n const theme = useTheme();\n const [textValue, setTextValue] = useState('');\n\n const { onSendDtmfTone, onClickDialpadButton, onDisplayDialpadInput, onChange, showDeleteButton = true } = props;\n\n const sanitizeInput = (input: string): string => {\n // remove non-valid characters from input: letters,special characters excluding +, *,#\n return input.replace(/[^\\d*#+]/g, '');\n };\n\n const onClickDialpad = (input: string, index: number): void => {\n // remove non-valid characters from input: letters,special characters excluding +, *,#\n const value = sanitizeInput(textValue + input);\n setTextValue(value);\n if (onSendDtmfTone) {\n onSendDtmfTone(DtmfTones[index]);\n }\n if (onClickDialpadButton) {\n onClickDialpadButton(input, index);\n }\n if (onChange) {\n onChange(onDisplayDialpadInput ? onDisplayDialpadInput(value) : formatPhoneNumber(value));\n }\n };\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const setText = (e: any): void => {\n // remove non-valid characters from input: letters,special characters excluding +, *,#\n const input = sanitizeInput(e.target.value);\n setTextValue(input);\n };\n\n // Potential Improvement:\n // comment out the following line for now to disable customization for dialpad content\n // const dialpadButtonsContent = props.dialpadButtons ?? dialPadButtonsDefault;\n\n const deleteNumbers = (): void => {\n const modifiedInput = textValue.substring(0, textValue.length - 1);\n setTextValue(modifiedInput);\n if (onChange) {\n onChange(onDisplayDialpadInput ? onDisplayDialpadInput(modifiedInput) : formatPhoneNumber(modifiedInput));\n }\n };\n\n return (\n <div\n className={mergeStyles(containerStyles(theme), props.styles?.root)}\n data-test-id=\"dialpadContainer\"\n data-ui-id=\"dialpadContainer\"\n >\n <TextField\n styles={concatStyleSets(textFieldStyles(theme), props.styles?.textField)}\n value={onDisplayDialpadInput ? onDisplayDialpadInput(textValue) : formatPhoneNumber(textValue)}\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n onChange={(e: any) => {\n setText(e);\n // remove non-valid characters from input: letters,special characters excluding +, *,#\n const input = sanitizeInput(e.target.value);\n if (onChange) {\n onChange(onDisplayDialpadInput ? onDisplayDialpadInput(input) : formatPhoneNumber(input));\n }\n }}\n placeholder={props.strings.placeholderText}\n data-test-id=\"dialpad-input\"\n onRenderSuffix={(): JSX.Element => (\n <>\n {showDeleteButton && textValue.length !== 0 && (\n <IconButton\n ariaLabel={props.strings.deleteButtonAriaLabel}\n onClick={deleteNumbers}\n styles={concatStyleSets(iconButtonStyles(theme), props.styles?.deleteIcon)}\n iconProps={{ iconName: 'BackSpace' }}\n />\n )}\n </>\n )}\n />\n <FocusZone>\n {dialPadButtonsDefault.map((rows, rowIndex) => {\n return (\n <Stack horizontal key={`row_${rowIndex}`} horizontalAlign=\"stretch\">\n {rows.map((button, columnIndex) => (\n <DialpadButton\n key={`button_${columnIndex}`}\n /* row index = 0\n columnIndex: (0,1,2) => (0,1,2)\n row index = 1\n columnIndex: (0,1,2)=> (3,4,5)\n row index = 2\n columnIndex: (0,1,2)=> (6,7,8)\n row index = 3\n columnIndex: (0,1,2)=> (9,10,11)\n columnIndex + rowIndex*rows.length calculates the corresponding index for each button\n dialpad index:\n 0 1 2\n 3 4 5\n 6 7 8\n 9 10 11\n then use this index to locate the corresponding dtmf tones\n DtmfTones[index]\n */\n index={columnIndex + rowIndex * rows.length}\n primaryContent={button.primaryContent}\n secondaryContent={button.secondaryContent}\n styles={props.styles}\n onClick={onClickDialpad}\n />\n ))}\n </Stack>\n );\n })}\n </FocusZone>\n </div>\n );\n};\n\n/**\n * A component to allow users to enter phone number through clicking on dialpad/using keyboard\n * It will return empty component for stable builds\n *\n * @beta\n */\nexport const Dialpad = (props: DialpadProps): JSX.Element => {\n /* @conditional-compile-remove(dialpad) */ /* @conditional-compile-remove(PSTN-calls) */\n const localeStrings = useLocale().strings.dialpad;\n\n const dialpadLocaleStringsTrampoline = (): DialpadStrings => {\n /* @conditional-compile-remove(dialpad) */ /* @conditional-compile-remove(PSTN-calls) */\n return localeStrings;\n // Even though the component strings type doesn't have `DialpadStrings` in stable build,\n // the string values exist. So unsafe cast for stable build.\n return '' as unknown as DialpadStrings;\n };\n const strings = { ...dialpadLocaleStringsTrampoline(), ...props.strings };\n\n return <DialpadContainer strings={strings} {...props} />;\n};\n\"../../../../acs-ui-common/src\""]}
1
+ {"version":3,"file":"Dialpad.js","sourceRoot":"","sources":["../../../../../../../react-components/src/components/Dialpad/Dialpad.tsx"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;;;;;;;;;;AAElC,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AAGtD,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EACL,eAAe,EACf,aAAa,EACb,SAAS,EACT,WAAW,EACX,KAAK,EACL,IAAI,EACJ,SAAS,EACT,QAAQ,EACT,MAAM,iBAAiB,CAA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C;IACF,MAAM,OAAO,mCAAQ,8BAA8B,EAAE,GAAK,KAAK,CAAC,OAAO,CAAE,CAAC;IAE1E,OAAO,oBAAC,gBAAgB,kBAAC,OAAO,EAAE,OAAO,IAAM,KAAK,EAAI,CAAC;AAC3D,CAAC,CAAC;AAEF,MAAM,aAAa,GAAG,CAAC,KAAa,EAAU,EAAE;IAC9C,sFAAsF;IACtF,OAAO,KAAK,CAAC,OAAO,CAAC,WAAW,EAAE,EAAE,CAAC,CAAC;AACxC,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport React, { useEffect, useCallback } from 'react';\nimport { IStyle, IButtonStyles, ITextFieldStyles } from '@fluentui/react';\n\nimport { IconButton } from '@fluentui/react';\nimport {\n concatStyleSets,\n DefaultButton,\n FocusZone,\n mergeStyles,\n Stack,\n Text,\n TextField,\n useTheme\n} from '@fluentui/react';\nimport { _formatString } from '@internal/acs-ui-common';\nimport { useState } from 'react';\n/* @conditional-compile-remove(dialpad) */\nimport { useLocale } from '../../localization';\nimport {\n buttonStyles,\n containerStyles,\n iconButtonStyles,\n primaryContentStyles,\n secondaryContentStyles,\n textFieldStyles\n} from '../styles/Dialpad.styles';\nimport { formatPhoneNumber } from '../utils/formatPhoneNumber';\nimport useLongPress from '../utils/useLongPress';\n\n/**\n * Strings of {@link Dialpad} that can be overridden.\n *\n * @beta\n */\nexport interface DialpadStrings {\n placeholderText: string;\n deleteButtonAriaLabel?: string;\n}\n\n/**\n * Styles for {@link Dialpad} component.\n *\n * @beta\n */\nexport interface DialpadStyles {\n root?: IStyle;\n button?: IButtonStyles;\n textField?: Partial<ITextFieldStyles>;\n primaryContent?: IStyle;\n secondaryContent?: IStyle;\n deleteIcon?: IButtonStyles;\n}\n\n/**\n * DTMF tone for PSTN calls.\n *\n * @beta\n */\nexport type DtmfTone =\n | 'A'\n | 'B'\n | 'C'\n | 'D'\n | 'Flash'\n | 'Num0'\n | 'Num1'\n | 'Num2'\n | 'Num3'\n | 'Num4'\n | 'Num5'\n | 'Num6'\n | 'Num7'\n | 'Num8'\n | 'Num9'\n | 'Pound'\n | 'Star';\n\n/**\n * Props for {@link Dialpad} component.\n *\n * @beta\n */\nexport interface DialpadProps {\n strings?: DialpadStrings;\n /** function to send dtmf tones on button click */\n onSendDtmfTone?: (dtmfTone: DtmfTone) => Promise<void>;\n /** Callback for dialpad button behavior*/\n onClickDialpadButton?: (buttonValue: string, buttonIndex: number) => void;\n /** set dialpad textfield content */\n textFieldValue?: string;\n /** on change function for text field, provides an unformatted plain text*/\n onChange?: (input: string) => void;\n /** boolean input to determine when to show/hide delete button, default true */\n showDeleteButton?: boolean;\n styles?: DialpadStyles;\n}\n\ntype DialpadButtonContent = {\n /** Number displayed on each dialpad button */\n primaryContent: string;\n /** Letters displayed on each dialpad button */\n secondaryContent?: string;\n};\n\nconst dialPadButtonsDefault: DialpadButtonContent[][] = [\n [\n { primaryContent: '1' },\n { primaryContent: '2', secondaryContent: 'ABC' },\n { primaryContent: '3', secondaryContent: 'DEF' }\n ],\n [\n { primaryContent: '4', secondaryContent: 'GHI' },\n { primaryContent: '5', secondaryContent: 'JKL' },\n { primaryContent: '6', secondaryContent: 'MNO' }\n ],\n [\n { primaryContent: '7', secondaryContent: 'PQRS' },\n { primaryContent: '8', secondaryContent: 'TUV' },\n { primaryContent: '9', secondaryContent: 'WXYZ' }\n ],\n [{ primaryContent: '*' }, { primaryContent: '0', secondaryContent: '+' }, { primaryContent: '#' }]\n];\n\nconst DtmfTones: DtmfTone[] = [\n 'Num1',\n 'Num2',\n 'Num3',\n 'Num4',\n 'Num5',\n 'Num6',\n 'Num7',\n 'Num8',\n 'Num9',\n 'Star',\n 'Num0',\n 'Pound'\n];\n\nconst DialpadButton = (props: {\n primaryContent: string;\n secondaryContent?: string;\n styles?: DialpadStyles;\n index: number;\n onClick: (input: string, index: number) => void;\n onLongPress: (input: string, index: number) => void;\n}): JSX.Element => {\n const theme = useTheme();\n\n const { primaryContent, index, onClick, onLongPress } = props;\n\n const clickFunction = useCallback(async () => {\n onClick(primaryContent, index);\n }, [primaryContent, index, onClick]);\n\n const longPressFunction = useCallback(async () => {\n onLongPress(primaryContent, index);\n }, [primaryContent, index, onLongPress]);\n\n const { handlers } = useLongPress(clickFunction, longPressFunction);\n return (\n <DefaultButton\n data-test-id={`dialpad-button-${props.index}`}\n styles={concatStyleSets(buttonStyles(theme), props.styles?.button)}\n {...handlers}\n >\n <Stack>\n <Text className={mergeStyles(primaryContentStyles(theme), props.styles?.primaryContent)}>\n {props.primaryContent}\n </Text>\n\n <Text className={mergeStyles(secondaryContentStyles(theme), props.styles?.secondaryContent)}>\n {props.secondaryContent ?? ' '}\n </Text>\n </Stack>\n </DefaultButton>\n );\n};\n\nconst DialpadContainer = (props: {\n strings: DialpadStrings;\n onSendDtmfTone?: (dtmfTone: DtmfTone) => Promise<void>;\n /** Callback for dialpad button behavior */\n onClickDialpadButton?: (buttonValue: string, buttonIndex: number) => void;\n /** Pass in custom content to dialpad textfield */\n textFieldValue?: string;\n /** on change function for text field, provides an unformatted plain text */\n onChange?: (input: string) => void;\n /** boolean input to determine when to show/hide delete button, default true */\n showDeleteButton?: boolean;\n styles?: DialpadStyles;\n}): JSX.Element => {\n const theme = useTheme();\n\n const { onSendDtmfTone, onClickDialpadButton, textFieldValue, onChange, showDeleteButton = true } = props;\n\n const [plainTextValue, setPlainTextValue] = useState(textFieldValue ?? '');\n\n useEffect(() => {\n if (onChange) {\n onChange(plainTextValue);\n }\n }, [plainTextValue, onChange]);\n\n useEffect(() => {\n setText(textFieldValue ?? '');\n }, [textFieldValue]);\n\n const onClickDialpad = (input: string, index: number): void => {\n setText(plainTextValue + input);\n if (onSendDtmfTone) {\n onSendDtmfTone(DtmfTones[index]);\n }\n if (onClickDialpadButton) {\n onClickDialpadButton(input, index);\n }\n };\n\n const onLongPressDialpad = (input: string, index: number): void => {\n if (input === '0' && index === 10) {\n setText(plainTextValue + '+');\n } else {\n setText(plainTextValue + input);\n }\n if (onSendDtmfTone) {\n onSendDtmfTone(DtmfTones[index]);\n }\n if (onClickDialpadButton) {\n onClickDialpadButton(input, index);\n }\n };\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const setText = (input: string): void => {\n // remove non-valid characters from input: letters,special characters excluding +, *,#\n const plainInput = sanitizeInput(input);\n setPlainTextValue(plainInput);\n };\n\n const deleteNumbers = (): void => {\n const modifiedInput = plainTextValue.substring(0, plainTextValue.length - 1);\n setText(modifiedInput);\n };\n\n return (\n <div\n className={mergeStyles(containerStyles(theme), props.styles?.root)}\n data-test-id=\"dialpadContainer\"\n data-ui-id=\"dialpadContainer\"\n >\n <TextField\n styles={concatStyleSets(textFieldStyles(theme), props.styles?.textField)}\n value={textFieldValue ? textFieldValue : formatPhoneNumber(plainTextValue)}\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n onChange={(e: any) => {\n setText(e.target.value);\n }}\n placeholder={props.strings.placeholderText}\n data-test-id=\"dialpad-input\"\n onRenderSuffix={(): JSX.Element => (\n <>\n {showDeleteButton && plainTextValue.length !== 0 && (\n <IconButton\n ariaLabel={props.strings.deleteButtonAriaLabel}\n onClick={deleteNumbers}\n styles={concatStyleSets(iconButtonStyles(theme), props.styles?.deleteIcon)}\n iconProps={{ iconName: 'BackSpace' }}\n />\n )}\n </>\n )}\n />\n <FocusZone>\n {dialPadButtonsDefault.map((rows, rowIndex) => {\n return (\n <Stack horizontal key={`row_${rowIndex}`} horizontalAlign=\"stretch\">\n {rows.map((button, columnIndex) => (\n <DialpadButton\n key={`button_${columnIndex}`}\n /* row index = 0\n columnIndex: (0,1,2) => (0,1,2)\n row index = 1\n columnIndex: (0,1,2)=> (3,4,5)\n row index = 2\n columnIndex: (0,1,2)=> (6,7,8)\n row index = 3\n columnIndex: (0,1,2)=> (9,10,11)\n columnIndex + rowIndex*rows.length calculates the corresponding index for each button\n dialpad index:\n 0 1 2\n 3 4 5\n 6 7 8\n 9 10 11\n then use this index to locate the corresponding dtmf tones\n DtmfTones[index]\n */\n index={columnIndex + rowIndex * rows.length}\n primaryContent={button.primaryContent}\n secondaryContent={button.secondaryContent}\n styles={props.styles}\n onClick={onClickDialpad}\n onLongPress={onLongPressDialpad}\n />\n ))}\n </Stack>\n );\n })}\n </FocusZone>\n </div>\n );\n};\n\n/**\n * A component to allow users to enter phone number through clicking on dialpad/using keyboard\n * It will return empty component for stable builds\n *\n * @beta\n */\nexport const Dialpad = (props: DialpadProps): JSX.Element => {\n /* @conditional-compile-remove(dialpad) */ /* @conditional-compile-remove(PSTN-calls) */\n const localeStrings = useLocale().strings.dialpad;\n\n const dialpadLocaleStringsTrampoline = (): DialpadStrings => {\n /* @conditional-compile-remove(dialpad) */ /* @conditional-compile-remove(PSTN-calls) */\n return localeStrings;\n // Even though the component strings type doesn't have `DialpadStrings` in stable build,\n // the string values exist. So unsafe cast for stable build.\n return '' as unknown as DialpadStrings;\n };\n const strings = { ...dialpadLocaleStringsTrampoline(), ...props.strings };\n\n return <DialpadContainer strings={strings} {...props} />;\n};\n\nconst sanitizeInput = (input: string): string => {\n // remove non-valid characters from input: letters,special characters excluding +, *,#\n return input.replace(/[^\\d*#+]/g, '');\n};\n\"../../../../acs-ui-common/src\""]}
@@ -15,7 +15,7 @@ import { HighContrastAwareIcon } from './HighContrastAwareIcon';
15
15
  export const HoldButton = (props) => {
16
16
  const { onToggleHold, strings } = props;
17
17
  const onRenderHoldIcon = () => {
18
- return React.createElement(HighContrastAwareIcon, { disabled: props.disabled, iconName: "HoldCall" });
18
+ return React.createElement(HighContrastAwareIcon, { disabled: props.disabled, iconName: "HoldCallButton" });
19
19
  };
20
20
  const onRenderResumeIcon = () => {
21
21
  return React.createElement(HighContrastAwareIcon, { disabled: props.disabled, iconName: "ResumeCall" });
@@ -1 +1 @@
1
- {"version":3,"file":"HoldButton.js","sourceRoot":"","sources":["../../../../../../react-components/src/components/HoldButton.tsx"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EAAE,gBAAgB,EAAyB,MAAM,oBAAoB,CAAC;AAC7E,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAwChE;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,KAAsB,EAAe,EAAE;IAChE,MAAM,EAAE,YAAY,EAAE,OAAO,EAAE,GAAG,KAAK,CAAC;IAExC,MAAM,gBAAgB,GAAG,GAAgB,EAAE;QACzC,OAAO,oBAAC,qBAAqB,IAAC,QAAQ,EAAE,KAAK,CAAC,QAAQ,EAAE,QAAQ,EAAC,UAAU,GAAG,CAAC;IACjF,CAAC,CAAC;IACF,MAAM,kBAAkB,GAAG,GAAgB,EAAE;QAC3C,OAAO,oBAAC,qBAAqB,IAAC,QAAQ,EAAE,KAAK,CAAC,QAAQ,EAAE,QAAQ,EAAC,YAAY,GAAG,CAAC;IACnF,CAAC,CAAC;IAEF,OAAO,CACL,oBAAC,gBAAgB,oBACX,KAAK,IACT,OAAO,EAAE,OAAO,EAChB,OAAO,EAAE,YAAY,aAAZ,YAAY,cAAZ,YAAY,GAAI,KAAK,CAAC,OAAO,EACtC,cAAc,EAAE,kBAAkB,EAClC,eAAe,EAAE,gBAAgB,IACjC,CACH,CAAC;AACJ,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { ControlBarButton, ControlBarButtonProps } from './ControlBarButton';\nimport React from 'react';\nimport { HighContrastAwareIcon } from './HighContrastAwareIcon';\n\n/**\n *@beta\n */\nexport interface HoldButtonProps extends ControlBarButtonProps {\n /**\n * Utility property for using this component with communication react handlers\n * Holds the call or resumes it based on call state.\n */\n onToggleHold: () => Promise<void>;\n /**\n * Optional strings to override in component\n */\n strings?: HoldButtonStrings;\n}\n\n/**\n * Strings for the hold button labels\n * @beta\n */\nexport interface HoldButtonStrings {\n /**\n * Label for when action is to resume call.\n */\n onLabel: string;\n /**\n * Label for when action is to hold call.\n */\n offLabel: string;\n /**\n * Content for when button is checked\n */\n tooltipOnContent: string;\n /**\n * Content for when button is unchecked\n */\n tooltipOffContent: string;\n}\n\n/**\n * a button to hold or resume a ongoing call.\n *\n * Can be used with {@link ControlBar}\n *\n * @param props - properties for the hold button.\n * @returns\n * @beta\n */\nexport const HoldButton = (props: HoldButtonProps): JSX.Element => {\n const { onToggleHold, strings } = props;\n\n const onRenderHoldIcon = (): JSX.Element => {\n return <HighContrastAwareIcon disabled={props.disabled} iconName=\"HoldCall\" />;\n };\n const onRenderResumeIcon = (): JSX.Element => {\n return <HighContrastAwareIcon disabled={props.disabled} iconName=\"ResumeCall\" />;\n };\n\n return (\n <ControlBarButton\n {...props}\n strings={strings}\n onClick={onToggleHold ?? props.onClick}\n onRenderOnIcon={onRenderResumeIcon}\n onRenderOffIcon={onRenderHoldIcon}\n />\n );\n};\n"]}
1
+ {"version":3,"file":"HoldButton.js","sourceRoot":"","sources":["../../../../../../react-components/src/components/HoldButton.tsx"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EAAE,gBAAgB,EAAyB,MAAM,oBAAoB,CAAC;AAC7E,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAwChE;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,KAAsB,EAAe,EAAE;IAChE,MAAM,EAAE,YAAY,EAAE,OAAO,EAAE,GAAG,KAAK,CAAC;IAExC,MAAM,gBAAgB,GAAG,GAAgB,EAAE;QACzC,OAAO,oBAAC,qBAAqB,IAAC,QAAQ,EAAE,KAAK,CAAC,QAAQ,EAAE,QAAQ,EAAC,gBAAgB,GAAG,CAAC;IACvF,CAAC,CAAC;IACF,MAAM,kBAAkB,GAAG,GAAgB,EAAE;QAC3C,OAAO,oBAAC,qBAAqB,IAAC,QAAQ,EAAE,KAAK,CAAC,QAAQ,EAAE,QAAQ,EAAC,YAAY,GAAG,CAAC;IACnF,CAAC,CAAC;IAEF,OAAO,CACL,oBAAC,gBAAgB,oBACX,KAAK,IACT,OAAO,EAAE,OAAO,EAChB,OAAO,EAAE,YAAY,aAAZ,YAAY,cAAZ,YAAY,GAAI,KAAK,CAAC,OAAO,EACtC,cAAc,EAAE,kBAAkB,EAClC,eAAe,EAAE,gBAAgB,IACjC,CACH,CAAC;AACJ,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { ControlBarButton, ControlBarButtonProps } from './ControlBarButton';\nimport React from 'react';\nimport { HighContrastAwareIcon } from './HighContrastAwareIcon';\n\n/**\n *@beta\n */\nexport interface HoldButtonProps extends ControlBarButtonProps {\n /**\n * Utility property for using this component with communication react handlers\n * Holds the call or resumes it based on call state.\n */\n onToggleHold: () => Promise<void>;\n /**\n * Optional strings to override in component\n */\n strings?: HoldButtonStrings;\n}\n\n/**\n * Strings for the hold button labels\n * @beta\n */\nexport interface HoldButtonStrings {\n /**\n * Label for when action is to resume call.\n */\n onLabel: string;\n /**\n * Label for when action is to hold call.\n */\n offLabel: string;\n /**\n * Content for when button is checked\n */\n tooltipOnContent: string;\n /**\n * Content for when button is unchecked\n */\n tooltipOffContent: string;\n}\n\n/**\n * a button to hold or resume a ongoing call.\n *\n * Can be used with {@link ControlBar}\n *\n * @param props - properties for the hold button.\n * @returns\n * @beta\n */\nexport const HoldButton = (props: HoldButtonProps): JSX.Element => {\n const { onToggleHold, strings } = props;\n\n const onRenderHoldIcon = (): JSX.Element => {\n return <HighContrastAwareIcon disabled={props.disabled} iconName=\"HoldCallButton\" />;\n };\n const onRenderResumeIcon = (): JSX.Element => {\n return <HighContrastAwareIcon disabled={props.disabled} iconName=\"ResumeCall\" />;\n };\n\n return (\n <ControlBarButton\n {...props}\n strings={strings}\n onClick={onToggleHold ?? props.onClick}\n onRenderOnIcon={onRenderResumeIcon}\n onRenderOffIcon={onRenderHoldIcon}\n />\n );\n};\n"]}
@@ -46,7 +46,7 @@ export const ParticipantItem = (props) => {
46
46
  setMenuHidden(true);
47
47
  };
48
48
  const participantStateString = participantStateStringTrampoline(props, strings);
49
- return (React.createElement("div", { ref: containerRef, role: 'menuitem', "data-is-focusable": true, className: mergeStyles(participantItemContainerStyle({ localparticipant: me, clickable: !!menuItems }), styles === null || styles === void 0 ? void 0 : styles.root), onMouseEnter: () => setItemHovered(true), onMouseLeave: () => setItemHovered(false), onClick: () => {
49
+ return (React.createElement("div", { ref: containerRef, role: 'menuitem', "data-is-focusable": true, "data-ui-id": "participant-item", className: mergeStyles(participantItemContainerStyle({ localparticipant: me, clickable: !!menuItems }), styles === null || styles === void 0 ? void 0 : styles.root), onMouseEnter: () => setItemHovered(true), onMouseLeave: () => setItemHovered(false), onClick: () => {
50
50
  if (!participantStateString) {
51
51
  setItemHovered(true);
52
52
  setMenuHidden(false);
@@ -1 +1 @@
1
- {"version":3,"file":"ParticipantItem.js","sourceRoot":"","sources":["../../../../../../react-components/src/components/ParticipantItem.tsx"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EACL,cAAc,EACd,eAAe,EACf,IAAI,EAGJ,WAAW,EACX,OAAO,EAEP,WAAW,EACX,KAAK,EACL,IAAI,EACL,MAAM,iBAAiB,CAAC;AACzB,OAAO,KAAK,EAAE,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACzD,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAChD,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAEtC,OAAO,EACL,kBAAkB,EAClB,UAAU,EACV,gBAAgB,EAChB,wBAAwB,EACxB,6BAA6B,EAC7B,wBAAwB,EACxB,4BAA4B,EAC7B,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAAE,sBAAsB,I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AO,SAAS,CAAC;AACnB,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport {\n ContextualMenu,\n DirectionalHint,\n Icon,\n IContextualMenuItem,\n IStyle,\n mergeStyles,\n Persona,\n PersonaPresence,\n PersonaSize,\n Stack,\n Text\n} from '@fluentui/react';\nimport React, { useMemo, useRef, useState } from 'react';\nimport { useIdentifiers } from '../identifiers';\nimport { useLocale } from '../localization';\nimport { useTheme } from '../theming';\nimport { BaseCustomStyles, OnRenderAvatarCallback } from '../types';\nimport {\n iconContainerStyle,\n iconStyles,\n meContainerStyle,\n menuButtonContainerStyle,\n participantItemContainerStyle,\n participantStateMaxWidth,\n participantStateStringStyles\n} from './styles/ParticipantItem.styles';\nimport { _preventDismissOnEvent as preventDismissOnEvent } from '@internal/acs-ui-common';\n/* @conditional-compile-remove(one-to-n-calling) */\n/* @conditional-compile-remove(PSTN-calls) */\nimport { ParticipantState } from '../types';\n\n/**\n * Fluent styles for {@link ParticipantItem}.\n *\n * @public\n */\nexport interface ParticipantItemStyles extends BaseCustomStyles {\n /** Styles for the avatar. */\n avatar?: IStyle;\n /** Styles for the (You) string. */\n me?: IStyle;\n /** Styles for the container of the icon. */\n iconContainer?: IStyle;\n /** Styles for the menu. */\n menu?: IStyle;\n}\n\n/**\n * Strings of {@link ParticipantItem} that can be overridden.\n *\n * @public\n */\nexport interface ParticipantItemStrings {\n /** String shown when participant is me */\n isMeText: string;\n /** String shown when hovering over menu button */\n menuTitle: string;\n /** Label for the remove button in participant menu */\n removeButtonLabel: string;\n /** Label for the sharing icon in participant state stack */\n sharingIconLabel: string;\n /** Label for the muted icon in participant state stack */\n mutedIconLabel: string;\n /** placeholder text for participants who does not have a display name*/\n displayNamePlaceholder?: string;\n /* @conditional-compile-remove(one-to-n-calling) */\n /* @conditional-compile-remove(PSTN-calls) */\n /** String shown when `participantState` is `Connecting` */\n participantStateConnecting?: string;\n /* @conditional-compile-remove(one-to-n-calling) */\n /* @conditional-compile-remove(PSTN-calls) */\n /** String shown when `participantState` is `Ringing` */\n participantStateRinging?: string;\n /* @conditional-compile-remove(one-to-n-calling) */\n /* @conditional-compile-remove(PSTN-calls) */\n /** String shown when `participantState` is `Hold` */\n participantStateHold?: string;\n}\n\n/**\n * Props for {@link ParticipantItem}.\n *\n * @public\n */\nexport interface ParticipantItemProps {\n /** Unique User ID of the participant. This `userId` is available in the `onRenderAvatar` callback function */\n userId?: string;\n /** Name of participant. */\n displayName?: string;\n /** Optional indicator to show participant is the user. */\n me?: boolean;\n /** Optional callback returning a JSX element to override avatar. */\n onRenderAvatar?: OnRenderAvatarCallback;\n /** Optional array of IContextualMenuItem for contextual menu. */\n menuItems?: IContextualMenuItem[];\n /** Optional callback returning a JSX element rendered on the right portion of the ParticipantItem. Intended for adding icons. */\n onRenderIcon?: (props?: ParticipantItemProps) => JSX.Element | null;\n /** Optional PersonaPresence to show participant presence. This will not have an effect if property avatar is assigned. */\n presence?: PersonaPresence;\n /**\n * Allows users to pass in an object contains custom CSS styles.\n * @Example\n * ```\n * <ParticipantItem styles={{ root: { background: 'blue' } }} />\n * ```\n */\n styles?: ParticipantItemStyles;\n /**\n * Optional strings to override in component\n */\n strings?: Partial<ParticipantItemStrings>;\n /**\n * Optional callback when component is clicked\n */\n onClick?: (props?: ParticipantItemProps) => void;\n /** prop to determine if we should show tooltip for participants or not */\n showParticipantOverflowTooltip?: boolean;\n /* @conditional-compile-remove(one-to-n-calling) */\n /* @conditional-compile-remove(PSTN-calls) */\n /**\n * Optional value to determine and display a participants connection status.\n * For example, `Connecting`, `Ringing` etc.\n * The actual text that is displayed is determined by the localized string\n * corresponding to the provided participant state.\n * For example, `strings.participantStateConnecting` will be used if `participantState` is `Connecting`.\n */\n participantState?: ParticipantState;\n}\n\n/**\n * Component to render a calling or chat participant.\n *\n * Displays the participant's avatar, displayName and status as well as optional icons and context menu.\n *\n * @public\n */\nexport const ParticipantItem = (props: ParticipantItemProps): JSX.Element => {\n const {\n userId,\n displayName,\n onRenderAvatar,\n menuItems,\n onRenderIcon,\n presence,\n styles,\n me,\n onClick,\n showParticipantOverflowTooltip\n /* @conditional-compile-remove(PSTN-calls) */\n } = props;\n const [itemHovered, setItemHovered] = useState<boolean>(false);\n const [menuHidden, setMenuHidden] = useState<boolean>(true);\n const containerRef = useRef<HTMLDivElement>(null);\n const theme = useTheme();\n const localeStrings = useLocale().strings.participantItem;\n const ids = useIdentifiers();\n\n const strings = { ...localeStrings, ...props.strings };\n\n const avatarOptions = {\n text: displayName,\n size: PersonaSize.size32,\n presence: presence,\n initialsTextColor: 'white',\n showOverflowTooltip: showParticipantOverflowTooltip\n };\n\n const avatar = onRenderAvatar ? (\n onRenderAvatar(userId ?? '', avatarOptions)\n ) : (\n <Persona\n className={mergeStyles(\n {\n // Prevents persona text from being vertically truncated if a global line height is less than 1.15.\n lineHeight: '1.15rem'\n },\n styles?.avatar\n )}\n {...avatarOptions}\n />\n );\n\n const meTextStyle = useMemo(\n () => mergeStyles(meContainerStyle, { color: theme.palette.neutralTertiary }, styles?.me),\n [theme.palette.neutralTertiary, styles?.me]\n );\n const contextualMenuStyle = useMemo(\n () => mergeStyles({ background: theme.palette.neutralLighterAlt }, styles?.menu),\n [theme.palette.neutralLighterAlt, styles?.menu]\n );\n const infoContainerStyle = useMemo(\n () => mergeStyles(iconContainerStyle, { color: theme.palette.neutralTertiary }, styles?.iconContainer),\n [theme.palette.neutralTertiary, styles?.iconContainer]\n );\n\n const menuButton = useMemo(\n () => (\n <Stack\n horizontal={true}\n horizontalAlign=\"end\"\n className={mergeStyles(menuButtonContainerStyle)}\n title={strings.menuTitle}\n data-ui-id={ids.participantItemMenuButton}\n >\n <Icon\n iconName={itemHovered ? 'ParticipantItemOptionsHovered' : 'ParticipantItemOptions'}\n className={iconStyles}\n />\n </Stack>\n ),\n [itemHovered, strings.menuTitle, ids.participantItemMenuButton]\n );\n\n const onDismissMenu = (): void => {\n setItemHovered(false);\n setMenuHidden(true);\n };\n\n const participantStateString = participantStateStringTrampoline(props, strings);\n\n return (\n <div\n ref={containerRef}\n role={'menuitem'}\n data-is-focusable={true}\n className={mergeStyles(\n participantItemContainerStyle({ localparticipant: me, clickable: !!menuItems }),\n styles?.root\n )}\n onMouseEnter={() => setItemHovered(true)}\n onMouseLeave={() => setItemHovered(false)}\n onClick={() => {\n if (!participantStateString) {\n setItemHovered(true);\n setMenuHidden(false);\n onClick?.(props);\n }\n }}\n tabIndex={0}\n >\n <Stack\n horizontal\n className={mergeStyles({\n width: `calc(100% - ${\n !me && participantStateString ? participantStateMaxWidth : menuButtonContainerStyle.width\n })`,\n alignItems: 'center'\n })}\n >\n {avatar}\n {me && <Text className={meTextStyle}>{strings.isMeText}</Text>}\n <Stack horizontal className={mergeStyles(infoContainerStyle)}>\n {onRenderIcon && onRenderIcon(props)}\n </Stack>\n </Stack>\n {/* When the participantStateString has a value, we don't show the menu */}\n {!me && participantStateString ? (\n <Text data-ui-id=\"participant-item-state-string\" className={mergeStyles(participantStateStringStyles)}>\n {participantStateString}\n </Text>\n ) : (\n <div>\n {menuItems && menuItems.length > 0 && (\n <>\n {menuButton}\n <ContextualMenu\n items={menuItems}\n hidden={menuHidden}\n target={containerRef}\n onItemClick={onDismissMenu}\n onDismiss={onDismissMenu}\n directionalHint={DirectionalHint.bottomRightEdge}\n className={contextualMenuStyle}\n calloutProps={{\n preventDismissOnEvent\n }}\n />\n </>\n )}\n </div>\n )}\n </div>\n );\n};\n\nconst participantStateStringTrampoline = (\n props: ParticipantItemProps,\n strings: ParticipantItemStrings\n): string | undefined => {\n /* @conditional-compile-remove(one-to-n-calling) */\n /* @conditional-compile-remove(PSTN-calls) */\n return props.participantState === 'Idle' || props.participantState === 'Connecting'\n ? strings?.participantStateConnecting\n : props.participantState === 'EarlyMedia' || props.participantState === 'Ringing'\n ? strings?.participantStateRinging\n : props.participantState === 'Hold'\n ? strings?.participantStateHold\n : undefined;\n\n return undefined;\n};\n\"../../../acs-ui-common/src\""]}
1
+ {"version":3,"file":"ParticipantItem.js","sourceRoot":"","sources":["../../../../../../react-components/src/components/ParticipantItem.tsx"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EACL,cAAc,EACd,eAAe,EACf,IAAI,EAGJ,WAAW,EACX,OAAO,EAEP,WAAW,EACX,KAAK,EACL,IAAI,EACL,MAAM,iBAAiB,CAAC;AACzB,OAAO,KAAK,EAAE,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACzD,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAChD,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAEtC,OAAO,EACL,kBAAkB,EAClB,UAAU,EACV,gBAAgB,EAChB,wBAAwB,EACxB,6BAA6B,EAC7B,wBAAwB,EACxB,4BAA4B,EAC7B,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAAE,sBAAsB,IAAI,qBAAqB,EAAE,mCAAgC;AAuG1F;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,KAA2B,EAAe,EAAE;IAC1E,MAAM,EACJ,MAAM,EACN,WAAW,EACX,cAAc,EACd,SAAS,EACT,YAAY,EACZ,QAAQ,EACR,MAAM,EACN,EAAE,EACF,OAAO,EACP,8BAA8B;IAC9B,6CAA6C;MAC9C,GAAG,KAAK,CAAC;IACV,MAAM,CAAC,WAAW,EAAE,cAAc,CAAC,GAAG,QAAQ,CAAU,KAAK,CAAC,CAAC;IAC/D,MAAM,CAAC,UAAU,EAAE,aAAa,CAAC,GAAG,QAAQ,CAAU,IAAI,CAAC,CAAC;IAC5D,MAAM,YAAY,GAAG,MAAM,CAAiB,IAAI,CAAC,CAAC;IAClD,MAAM,KAAK,GAAG,QAAQ,EAAE,CAAC;IACzB,MAAM,aAAa,GAAG,SAAS,EAAE,CAAC,OAAO,CAA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,mBAAmB,EAC9B,YAAY,EAAE;oBACZ,qBAAqB;iBACtB,GACD,CACD,CACJ,CACG,CACP,CACG,CACP,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,gCAAgC,GAAG,CACvC,KAA2B,EAC3B,OAA+B,EACX,EAAE;IACtB,mDAAmD;IACnD,6CAA6C;IAC7C,OAAO,KAAK,CAAC,gBAAgB,KAAK,MAAM,IAAI,KAAK,CAAC,gBAAgB,KAAK,YAAY;QACjF,CAAC,CAAC,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,0BAA0B;QACrC,CAAC,CAAC,KAAK,CAAC,gBAAgB,KAAK,YAAY,IAAI,KAAK,CAAC,gBAAgB,KAAK,SAAS;YACjF,CAAC,CAAC,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,uBAAuB;YAClC,CAAC,CAAC,KAAK,CAAC,gBAAgB,KAAK,MAAM;gBACnC,CAAC,CAAC,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,oBAAoB;gBAC/B,CAAC,CAAC,SAAS,CAAC;IAEd,OAAO,SAAS,CAAC;AACnB,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport {\n ContextualMenu,\n DirectionalHint,\n Icon,\n IContextualMenuItem,\n IStyle,\n mergeStyles,\n Persona,\n PersonaPresence,\n PersonaSize,\n Stack,\n Text\n} from '@fluentui/react';\nimport React, { useMemo, useRef, useState } from 'react';\nimport { useIdentifiers } from '../identifiers';\nimport { useLocale } from '../localization';\nimport { useTheme } from '../theming';\nimport { BaseCustomStyles, OnRenderAvatarCallback } from '../types';\nimport {\n iconContainerStyle,\n iconStyles,\n meContainerStyle,\n menuButtonContainerStyle,\n participantItemContainerStyle,\n participantStateMaxWidth,\n participantStateStringStyles\n} from './styles/ParticipantItem.styles';\nimport { _preventDismissOnEvent as preventDismissOnEvent } from '@internal/acs-ui-common';\n/* @conditional-compile-remove(one-to-n-calling) */\n/* @conditional-compile-remove(PSTN-calls) */\nimport { ParticipantState } from '../types';\n\n/**\n * Fluent styles for {@link ParticipantItem}.\n *\n * @public\n */\nexport interface ParticipantItemStyles extends BaseCustomStyles {\n /** Styles for the avatar. */\n avatar?: IStyle;\n /** Styles for the (You) string. */\n me?: IStyle;\n /** Styles for the container of the icon. */\n iconContainer?: IStyle;\n /** Styles for the menu. */\n menu?: IStyle;\n}\n\n/**\n * Strings of {@link ParticipantItem} that can be overridden.\n *\n * @public\n */\nexport interface ParticipantItemStrings {\n /** String shown when participant is me */\n isMeText: string;\n /** String shown when hovering over menu button */\n menuTitle: string;\n /** Label for the remove button in participant menu */\n removeButtonLabel: string;\n /** Label for the sharing icon in participant state stack */\n sharingIconLabel: string;\n /** Label for the muted icon in participant state stack */\n mutedIconLabel: string;\n /** placeholder text for participants who does not have a display name*/\n displayNamePlaceholder?: string;\n /* @conditional-compile-remove(one-to-n-calling) */\n /* @conditional-compile-remove(PSTN-calls) */\n /** String shown when `participantState` is `Connecting` */\n participantStateConnecting?: string;\n /* @conditional-compile-remove(one-to-n-calling) */\n /* @conditional-compile-remove(PSTN-calls) */\n /** String shown when `participantState` is `Ringing` */\n participantStateRinging?: string;\n /* @conditional-compile-remove(one-to-n-calling) */\n /* @conditional-compile-remove(PSTN-calls) */\n /** String shown when `participantState` is `Hold` */\n participantStateHold?: string;\n}\n\n/**\n * Props for {@link ParticipantItem}.\n *\n * @public\n */\nexport interface ParticipantItemProps {\n /** Unique User ID of the participant. This `userId` is available in the `onRenderAvatar` callback function */\n userId?: string;\n /** Name of participant. */\n displayName?: string;\n /** Optional indicator to show participant is the user. */\n me?: boolean;\n /** Optional callback returning a JSX element to override avatar. */\n onRenderAvatar?: OnRenderAvatarCallback;\n /** Optional array of IContextualMenuItem for contextual menu. */\n menuItems?: IContextualMenuItem[];\n /** Optional callback returning a JSX element rendered on the right portion of the ParticipantItem. Intended for adding icons. */\n onRenderIcon?: (props?: ParticipantItemProps) => JSX.Element | null;\n /** Optional PersonaPresence to show participant presence. This will not have an effect if property avatar is assigned. */\n presence?: PersonaPresence;\n /**\n * Allows users to pass in an object contains custom CSS styles.\n * @Example\n * ```\n * <ParticipantItem styles={{ root: { background: 'blue' } }} />\n * ```\n */\n styles?: ParticipantItemStyles;\n /**\n * Optional strings to override in component\n */\n strings?: Partial<ParticipantItemStrings>;\n /**\n * Optional callback when component is clicked\n */\n onClick?: (props?: ParticipantItemProps) => void;\n /** prop to determine if we should show tooltip for participants or not */\n showParticipantOverflowTooltip?: boolean;\n /* @conditional-compile-remove(one-to-n-calling) */\n /* @conditional-compile-remove(PSTN-calls) */\n /**\n * Optional value to determine and display a participants connection status.\n * For example, `Connecting`, `Ringing` etc.\n * The actual text that is displayed is determined by the localized string\n * corresponding to the provided participant state.\n * For example, `strings.participantStateConnecting` will be used if `participantState` is `Connecting`.\n */\n participantState?: ParticipantState;\n}\n\n/**\n * Component to render a calling or chat participant.\n *\n * Displays the participant's avatar, displayName and status as well as optional icons and context menu.\n *\n * @public\n */\nexport const ParticipantItem = (props: ParticipantItemProps): JSX.Element => {\n const {\n userId,\n displayName,\n onRenderAvatar,\n menuItems,\n onRenderIcon,\n presence,\n styles,\n me,\n onClick,\n showParticipantOverflowTooltip\n /* @conditional-compile-remove(PSTN-calls) */\n } = props;\n const [itemHovered, setItemHovered] = useState<boolean>(false);\n const [menuHidden, setMenuHidden] = useState<boolean>(true);\n const containerRef = useRef<HTMLDivElement>(null);\n const theme = useTheme();\n const localeStrings = useLocale().strings.participantItem;\n const ids = useIdentifiers();\n\n const strings = { ...localeStrings, ...props.strings };\n\n const avatarOptions = {\n text: displayName,\n size: PersonaSize.size32,\n presence: presence,\n initialsTextColor: 'white',\n showOverflowTooltip: showParticipantOverflowTooltip\n };\n\n const avatar = onRenderAvatar ? (\n onRenderAvatar(userId ?? '', avatarOptions)\n ) : (\n <Persona\n className={mergeStyles(\n {\n // Prevents persona text from being vertically truncated if a global line height is less than 1.15.\n lineHeight: '1.15rem'\n },\n styles?.avatar\n )}\n {...avatarOptions}\n />\n );\n\n const meTextStyle = useMemo(\n () => mergeStyles(meContainerStyle, { color: theme.palette.neutralTertiary }, styles?.me),\n [theme.palette.neutralTertiary, styles?.me]\n );\n const contextualMenuStyle = useMemo(\n () => mergeStyles({ background: theme.palette.neutralLighterAlt }, styles?.menu),\n [theme.palette.neutralLighterAlt, styles?.menu]\n );\n const infoContainerStyle = useMemo(\n () => mergeStyles(iconContainerStyle, { color: theme.palette.neutralTertiary }, styles?.iconContainer),\n [theme.palette.neutralTertiary, styles?.iconContainer]\n );\n\n const menuButton = useMemo(\n () => (\n <Stack\n horizontal={true}\n horizontalAlign=\"end\"\n className={mergeStyles(menuButtonContainerStyle)}\n title={strings.menuTitle}\n data-ui-id={ids.participantItemMenuButton}\n >\n <Icon\n iconName={itemHovered ? 'ParticipantItemOptionsHovered' : 'ParticipantItemOptions'}\n className={iconStyles}\n />\n </Stack>\n ),\n [itemHovered, strings.menuTitle, ids.participantItemMenuButton]\n );\n\n const onDismissMenu = (): void => {\n setItemHovered(false);\n setMenuHidden(true);\n };\n\n const participantStateString = participantStateStringTrampoline(props, strings);\n\n return (\n <div\n ref={containerRef}\n role={'menuitem'}\n data-is-focusable={true}\n data-ui-id=\"participant-item\"\n className={mergeStyles(\n participantItemContainerStyle({ localparticipant: me, clickable: !!menuItems }),\n styles?.root\n )}\n onMouseEnter={() => setItemHovered(true)}\n onMouseLeave={() => setItemHovered(false)}\n onClick={() => {\n if (!participantStateString) {\n setItemHovered(true);\n setMenuHidden(false);\n onClick?.(props);\n }\n }}\n tabIndex={0}\n >\n <Stack\n horizontal\n className={mergeStyles({\n width: `calc(100% - ${\n !me && participantStateString ? participantStateMaxWidth : menuButtonContainerStyle.width\n })`,\n alignItems: 'center'\n })}\n >\n {avatar}\n {me && <Text className={meTextStyle}>{strings.isMeText}</Text>}\n <Stack horizontal className={mergeStyles(infoContainerStyle)}>\n {onRenderIcon && onRenderIcon(props)}\n </Stack>\n </Stack>\n {/* When the participantStateString has a value, we don't show the menu */}\n {!me && participantStateString ? (\n <Text data-ui-id=\"participant-item-state-string\" className={mergeStyles(participantStateStringStyles)}>\n {participantStateString}\n </Text>\n ) : (\n <div>\n {menuItems && menuItems.length > 0 && (\n <>\n {menuButton}\n <ContextualMenu\n items={menuItems}\n hidden={menuHidden}\n target={containerRef}\n onItemClick={onDismissMenu}\n onDismiss={onDismissMenu}\n directionalHint={DirectionalHint.bottomRightEdge}\n className={contextualMenuStyle}\n calloutProps={{\n preventDismissOnEvent\n }}\n />\n </>\n )}\n </div>\n )}\n </div>\n );\n};\n\nconst participantStateStringTrampoline = (\n props: ParticipantItemProps,\n strings: ParticipantItemStrings\n): string | undefined => {\n /* @conditional-compile-remove(one-to-n-calling) */\n /* @conditional-compile-remove(PSTN-calls) */\n return props.participantState === 'Idle' || props.participantState === 'Connecting'\n ? strings?.participantStateConnecting\n : props.participantState === 'EarlyMedia' || props.participantState === 'Ringing'\n ? strings?.participantStateRinging\n : props.participantState === 'Hold'\n ? strings?.participantStateHold\n : undefined;\n\n return undefined;\n};\n\"../../../acs-ui-common/src\""]}
@@ -56,7 +56,7 @@ export { _useContainerHeight, _useContainerWidth } from './utils/responsive';
56
56
  export { _ComplianceBanner } from './ComplianceBanner';
57
57
  export type { _ComplianceBannerProps, _ComplianceBannerStrings } from './ComplianceBanner';
58
58
  export { Dialpad } from './Dialpad/Dialpad';
59
- export type { DialpadProps, DialpadStrings, DialpadButtonProps, DialpadStyles, DtmfTone } from './Dialpad/Dialpad';
59
+ export type { DialpadProps, DialpadStrings, DialpadStyles, DtmfTone } from './Dialpad/Dialpad';
60
60
  export { HoldButton } from './HoldButton';
61
61
  export type { HoldButtonProps, HoldButtonStrings } from './HoldButton';
62
62
  export { _LocalVideoTile } from './LocalVideoTile';
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../react-components/src/components/index.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EAAE,e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AE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAE7E,OAAO,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAEvD,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAG5C,6CAA6C;AAC7C,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAI1C,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AACnD,OAAO,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nexport { TypingIndicator } from './TypingIndicator';\nexport type { TypingIndicatorProps, TypingIndicatorStrings, TypingIndicatorStylesProps } from './TypingIndicator';\n\nexport { ErrorBar } from './ErrorBar';\nexport type { ActiveErrorMessage, ErrorBarProps, ErrorBarStrings, ErrorType } from './ErrorBar';\n\nexport { GridLayout } from './GridLayout';\nexport type { GridLayoutProps, GridLayoutStyles } from './GridLayout';\n\nexport { SendBox } from './SendBox';\nexport type { SendBoxProps, SendBoxStrings, SendBoxStylesProps } from './SendBox';\n/* @conditional-compile-remove(file-sharing) */\nexport type { ActiveFileUpload } from './SendBox';\n\nexport { MessageStatusIndicator } from './MessageStatusIndicator';\nexport type { MessageStatusIndicatorProps, MessageStatusIndicatorStrings } from './MessageStatusIndicator';\n\nexport { MessageThread } from './MessageThread';\nexport type {\n MessageProps,\n MessageThreadProps,\n MessageThreadStrings,\n MessageThreadStyles,\n JumpToNewMessageButtonProps,\n MessageRenderer,\n UpdateMessageCallback\n} from './MessageThread';\n\nexport { StreamMedia } from './StreamMedia';\nexport type { StreamMediaProps } from './StreamMedia';\nexport type { LoadingState } from './StreamMedia';\n\nexport { ParticipantItem } from './ParticipantItem';\nexport type { ParticipantItemProps, ParticipantItemStrings, ParticipantItemStyles } from './ParticipantItem';\n\nexport { ParticipantList } from './ParticipantList';\nexport type {\n ParticipantListItemStyles,\n ParticipantListProps,\n ParticipantListStyles,\n ParticipantMenuItemsCallback\n} from './ParticipantList';\n\nexport { VideoGallery } from './VideoGallery';\nexport type { VideoGalleryProps, VideoGalleryStrings, VideoGalleryStyles, VideoGalleryLayout } from './VideoGallery';\nexport type { HorizontalGalleryStyles } from './HorizontalGallery';\n\nexport { LocalVideoCameraCycleButton } from './LocalVideoCameraButton';\nexport type { LocalVideoCameraCycleButtonProps } from './LocalVideoCameraButton';\n\nexport { CameraButton } from './CameraButton';\nexport type {\n CameraButtonContextualMenuStyles,\n CameraButtonProps,\n CameraButtonStrings,\n CameraButtonStyles\n} from './CameraButton';\n\nexport { ControlBar } from './ControlBar';\nexport type { ControlBarProps, ControlBarLayout } from './ControlBar';\n\nexport { ControlBarButton } from './ControlBarButton';\nexport type { ControlBarButtonProps, ControlBarButtonStrings, ControlBarButtonStyles } from './ControlBarButton';\n\nexport { EndCallButton } from './EndCallButton';\nexport type { EndCallButtonProps, EndCallButtonStrings } from './EndCallButton';\n\nexport { MicrophoneButton } from './MicrophoneButton';\nexport type {\n MicrophoneButtonStyles,\n MicrophoneButtonContextualMenuStyles,\n MicrophoneButtonProps,\n MicrophoneButtonStrings\n} from './MicrophoneButton';\n\nexport { DevicesButton } from './DevicesButton';\nexport type {\n OptionsDevice,\n DevicesButtonProps,\n DevicesButtonStrings,\n DevicesButtonStyles,\n DevicesButtonContextualMenuStyles\n} from './DevicesButton';\n\nexport { ParticipantsButton } from './ParticipantsButton';\nexport type {\n ParticipantsButtonContextualMenuStyles,\n ParticipantsButtonProps,\n ParticipantsButtonStrings,\n ParticipantsButtonStyles\n} from './ParticipantsButton';\n\nexport { ScreenShareButton } from './ScreenShareButton';\nexport type { ScreenShareButtonProps, ScreenShareButtonStrings } from './ScreenShareButton';\n\nexport { VideoTile } from './VideoTile';\nexport type { VideoTileProps, VideoTileStylesProps } from './VideoTile';\n/* @conditional-compile-remove(PSTN-calls) */\nexport type { VideoTileStrings } from './VideoTile';\n\nexport { _PictureInPictureInPicture } from './PictureInPictureInPicture/PictureInPictureInPicture';\nexport type {\n _PictureInPictureInPictureProps,\n _PictureInPictureInPictureStrings\n} from './PictureInPictureInPicture/PictureInPictureInPicture';\nexport type {\n _PictureInPictureInPictureTileProps,\n _TileOrientation\n} from './PictureInPictureInPicture/PictureInPictureInPictureTile';\n\nexport * from './Drawer';\n/* @conditional-compile-remove(file-sharing) */\nexport type { SendBoxErrorBarError } from './SendBoxErrorBar';\nexport * from './FileCard';\nexport * from './FileCardGroup';\nexport * from './ModalClone/ModalClone';\nexport * from './FileDownloadCards';\nexport type { _FileUploadCardsStrings } from './FileUploadCards';\n\nexport { _useContainerHeight, _useContainerWidth } from './utils/responsive';\n\nexport { _ComplianceBanner } from './ComplianceBanner';\nexport type { _ComplianceBannerProps, _ComplianceBannerStrings } from './ComplianceBanner';\nexport { Dialpad } from './Dialpad/Dialpad';\nexport type { DialpadProps, DialpadStrings, DialpadButtonProps, DialpadStyles, DtmfTone } from './Dialpad/Dialpad';\n\n/* @conditional-compile-remove(PSTN-calls) */\nexport { HoldButton } from './HoldButton';\n/* @conditional-compile-remove(PSTN-calls) */\nexport type { HoldButtonProps, HoldButtonStrings } from './HoldButton';\n\nexport { _LocalVideoTile } from './LocalVideoTile';\nexport { _RemoteVideoTile } from './RemoteVideoTile';\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../react-components/src/components/index.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAGpD,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAGtC,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAG1C,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAKpC,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAGlE,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAWhD,OAAO,EAAE,WAAW,EAAE,MAAM,eAA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yright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nexport { TypingIndicator } from './TypingIndicator';\nexport type { TypingIndicatorProps, TypingIndicatorStrings, TypingIndicatorStylesProps } from './TypingIndicator';\n\nexport { ErrorBar } from './ErrorBar';\nexport type { ActiveErrorMessage, ErrorBarProps, ErrorBarStrings, ErrorType } from './ErrorBar';\n\nexport { GridLayout } from './GridLayout';\nexport type { GridLayoutProps, GridLayoutStyles } from './GridLayout';\n\nexport { SendBox } from './SendBox';\nexport type { SendBoxProps, SendBoxStrings, SendBoxStylesProps } from './SendBox';\n/* @conditional-compile-remove(file-sharing) */\nexport type { ActiveFileUpload } from './SendBox';\n\nexport { MessageStatusIndicator } from './MessageStatusIndicator';\nexport type { MessageStatusIndicatorProps, MessageStatusIndicatorStrings } from './MessageStatusIndicator';\n\nexport { MessageThread } from './MessageThread';\nexport type {\n MessageProps,\n MessageThreadProps,\n MessageThreadStrings,\n MessageThreadStyles,\n JumpToNewMessageButtonProps,\n MessageRenderer,\n UpdateMessageCallback\n} from './MessageThread';\n\nexport { StreamMedia } from './StreamMedia';\nexport type { StreamMediaProps } from './StreamMedia';\nexport type { LoadingState } from './StreamMedia';\n\nexport { ParticipantItem } from './ParticipantItem';\nexport type { ParticipantItemProps, ParticipantItemStrings, ParticipantItemStyles } from './ParticipantItem';\n\nexport { ParticipantList } from './ParticipantList';\nexport type {\n ParticipantListItemStyles,\n ParticipantListProps,\n ParticipantListStyles,\n ParticipantMenuItemsCallback\n} from './ParticipantList';\n\nexport { VideoGallery } from './VideoGallery';\nexport type { VideoGalleryProps, VideoGalleryStrings, VideoGalleryStyles, VideoGalleryLayout } from './VideoGallery';\nexport type { HorizontalGalleryStyles } from './HorizontalGallery';\n\nexport { LocalVideoCameraCycleButton } from './LocalVideoCameraButton';\nexport type { LocalVideoCameraCycleButtonProps } from './LocalVideoCameraButton';\n\nexport { CameraButton } from './CameraButton';\nexport type {\n CameraButtonContextualMenuStyles,\n CameraButtonProps,\n CameraButtonStrings,\n CameraButtonStyles\n} from './CameraButton';\n\nexport { ControlBar } from './ControlBar';\nexport type { ControlBarProps, ControlBarLayout } from './ControlBar';\n\nexport { ControlBarButton } from './ControlBarButton';\nexport type { ControlBarButtonProps, ControlBarButtonStrings, ControlBarButtonStyles } from './ControlBarButton';\n\nexport { EndCallButton } from './EndCallButton';\nexport type { EndCallButtonProps, EndCallButtonStrings } from './EndCallButton';\n\nexport { MicrophoneButton } from './MicrophoneButton';\nexport type {\n MicrophoneButtonStyles,\n MicrophoneButtonContextualMenuStyles,\n MicrophoneButtonProps,\n MicrophoneButtonStrings\n} from './MicrophoneButton';\n\nexport { DevicesButton } from './DevicesButton';\nexport type {\n OptionsDevice,\n DevicesButtonProps,\n DevicesButtonStrings,\n DevicesButtonStyles,\n DevicesButtonContextualMenuStyles\n} from './DevicesButton';\n\nexport { ParticipantsButton } from './ParticipantsButton';\nexport type {\n ParticipantsButtonContextualMenuStyles,\n ParticipantsButtonProps,\n ParticipantsButtonStrings,\n ParticipantsButtonStyles\n} from './ParticipantsButton';\n\nexport { ScreenShareButton } from './ScreenShareButton';\nexport type { ScreenShareButtonProps, ScreenShareButtonStrings } from './ScreenShareButton';\n\nexport { VideoTile } from './VideoTile';\nexport type { VideoTileProps, VideoTileStylesProps } from './VideoTile';\n/* @conditional-compile-remove(PSTN-calls) */\nexport type { VideoTileStrings } from './VideoTile';\n\nexport { _PictureInPictureInPicture } from './PictureInPictureInPicture/PictureInPictureInPicture';\nexport type {\n _PictureInPictureInPictureProps,\n _PictureInPictureInPictureStrings\n} from './PictureInPictureInPicture/PictureInPictureInPicture';\nexport type {\n _PictureInPictureInPictureTileProps,\n _TileOrientation\n} from './PictureInPictureInPicture/PictureInPictureInPictureTile';\n\nexport * from './Drawer';\n/* @conditional-compile-remove(file-sharing) */\nexport type { SendBoxErrorBarError } from './SendBoxErrorBar';\nexport * from './FileCard';\nexport * from './FileCardGroup';\nexport * from './ModalClone/ModalClone';\nexport * from './FileDownloadCards';\nexport type { _FileUploadCardsStrings } from './FileUploadCards';\n\nexport { _useContainerHeight, _useContainerWidth } from './utils/responsive';\n\nexport { _ComplianceBanner } from './ComplianceBanner';\nexport type { _ComplianceBannerProps, _ComplianceBannerStrings } from './ComplianceBanner';\nexport { Dialpad } from './Dialpad/Dialpad';\nexport type { DialpadProps, DialpadStrings, DialpadStyles, DtmfTone } from './Dialpad/Dialpad';\n\n/* @conditional-compile-remove(PSTN-calls) */\nexport { HoldButton } from './HoldButton';\n/* @conditional-compile-remove(PSTN-calls) */\nexport type { HoldButtonProps, HoldButtonStrings } from './HoldButton';\n\nexport { _LocalVideoTile } from './LocalVideoTile';\nexport { _RemoteVideoTile } from './RemoteVideoTile';\n"]}
@@ -0,0 +1,15 @@
1
+ /**
2
+ * @private
3
+ */
4
+ export default function useLongPress(onClick: () => void, onLongPress: () => void): {
5
+ handlers: {
6
+ onClick: () => void;
7
+ onMouseDown: () => void;
8
+ onMouseUp: () => void;
9
+ onTouchStart: () => void;
10
+ onTouchEnd: () => void;
11
+ onKeyDown: () => void;
12
+ onKeyUp: () => void;
13
+ };
14
+ };
15
+ //# sourceMappingURL=useLongPress.d.ts.map
@@ -0,0 +1,58 @@
1
+ // Copyright (c) Microsoft Corporation.
2
+ // Licensed under the MIT license.
3
+ import { useRef, useState } from 'react';
4
+ /**
5
+ * @private
6
+ */
7
+ export default function useLongPress(onClick, onLongPress) {
8
+ const timerRef = useRef();
9
+ const [isLongPress, setIsLongPress] = useState(false);
10
+ const [action, setAction] = useState(false);
11
+ function startPressTimer() {
12
+ setIsLongPress(false);
13
+ timerRef.current = setTimeout(() => {
14
+ setIsLongPress(true);
15
+ }, 500);
16
+ }
17
+ function handleOnClick() {
18
+ onClick();
19
+ if (isLongPress) {
20
+ onLongPress();
21
+ return;
22
+ }
23
+ }
24
+ function handleOnKeyDown() {
25
+ if (action) {
26
+ setAction(false);
27
+ startPressTimer();
28
+ }
29
+ }
30
+ function handleOnKeyUp() {
31
+ setAction(true);
32
+ timerRef.current && clearTimeout(timerRef.current);
33
+ }
34
+ function handleOnMouseDown() {
35
+ startPressTimer();
36
+ }
37
+ function handleOnMouseUp() {
38
+ timerRef.current && clearTimeout(timerRef.current);
39
+ }
40
+ function handleOnTouchStart() {
41
+ startPressTimer();
42
+ }
43
+ function handleOnTouchEnd() {
44
+ timerRef.current && clearTimeout(timerRef.current);
45
+ }
46
+ return {
47
+ handlers: {
48
+ onClick: handleOnClick,
49
+ onMouseDown: handleOnMouseDown,
50
+ onMouseUp: handleOnMouseUp,
51
+ onTouchStart: handleOnTouchStart,
52
+ onTouchEnd: handleOnTouchEnd,
53
+ onKeyDown: handleOnKeyDown,
54
+ onKeyUp: handleOnKeyUp
55
+ }
56
+ };
57
+ }
58
+ //# sourceMappingURL=useLongPress.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useLongPress.js","sourceRoot":"","sources":["../../../../../../../react-components/src/components/utils/useLongPress.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAEzC;;GAEG;AACH,MAAM,CAAC,OAAO,UAAU,YAAY,CAClC,OAAmB,EACnB,WAAuB;IAYvB,MAAM,QAAQ,GAAG,MAAM,EAAiC,CAAC;IACzD,MAAM,CAAC,WAAW,EAAE,cAAc,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IACtD,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IAE5C,SAAS,eAAe;QACtB,cAAc,CAAC,KAAK,CAAC,CAAC;QACtB,QAAQ,CAAC,OAAO,GAAG,UAAU,CAAC,GAAG,EAAE;YACjC,cAAc,CAAC,IAAI,CAAC,CAAC;QACvB,CAAC,EAAE,GAAG,CAAC,CAAC;IACV,CAAC;IAED,SAAS,aAAa;QACpB,OAAO,EAAE,CAAC;QACV,IAAI,WAAW,EAAE;YACf,WAAW,EAAE,CAAC;YACd,OAAO;SACR;IACH,CAAC;IAED,SAAS,eAAe;QACtB,IAAI,MAAM,EAAE;YACV,SAAS,CAAC,KAAK,CAAC,CAAC;YACjB,eAAe,EAAE,CAAC;SACnB;IACH,CAAC;IAED,SAAS,aAAa;QACpB,SAAS,CAAC,IAAI,CAAC,CAAC;QAChB,QAAQ,CAAC,OAAO,IAAI,YAAY,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;IACrD,CAAC;IAED,SAAS,iBAAiB;QACxB,eAAe,EAAE,CAAC;IACpB,CAAC;IAED,SAAS,eAAe;QACtB,QAAQ,CAAC,OAAO,IAAI,YAAY,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;IACrD,CAAC;IAED,SAAS,kBAAkB;QACzB,eAAe,EAAE,CAAC;IACpB,CAAC;IAED,SAAS,gBAAgB;QACvB,QAAQ,CAAC,OAAO,IAAI,YAAY,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;IACrD,CAAC;IAED,OAAO;QACL,QAAQ,EAAE;YACR,OAAO,EAAE,aAAa;YACtB,WAAW,EAAE,iBAAiB;YAC9B,SAAS,EAAE,eAAe;YAC1B,YAAY,EAAE,kBAAkB;YAChC,UAAU,EAAE,gBAAgB;YAC5B,SAAS,EAAE,eAAe;YAC1B,OAAO,EAAE,aAAa;SACvB;KACF,CAAC;AACJ,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { useRef, useState } from 'react';\n\n/**\n * @private\n */\nexport default function useLongPress(\n onClick: () => void,\n onLongPress: () => void\n): {\n handlers: {\n onClick: () => void;\n onMouseDown: () => void;\n onMouseUp: () => void;\n onTouchStart: () => void;\n onTouchEnd: () => void;\n onKeyDown: () => void;\n onKeyUp: () => void;\n };\n} {\n const timerRef = useRef<ReturnType<typeof setTimeout>>();\n const [isLongPress, setIsLongPress] = useState(false);\n const [action, setAction] = useState(false);\n\n function startPressTimer(): void {\n setIsLongPress(false);\n timerRef.current = setTimeout(() => {\n setIsLongPress(true);\n }, 500);\n }\n\n function handleOnClick(): void {\n onClick();\n if (isLongPress) {\n onLongPress();\n return;\n }\n }\n\n function handleOnKeyDown(): void {\n if (action) {\n setAction(false);\n startPressTimer();\n }\n }\n\n function handleOnKeyUp(): void {\n setAction(true);\n timerRef.current && clearTimeout(timerRef.current);\n }\n\n function handleOnMouseDown(): void {\n startPressTimer();\n }\n\n function handleOnMouseUp(): void {\n timerRef.current && clearTimeout(timerRef.current);\n }\n\n function handleOnTouchStart(): void {\n startPressTimer();\n }\n\n function handleOnTouchEnd(): void {\n timerRef.current && clearTimeout(timerRef.current);\n }\n\n return {\n handlers: {\n onClick: handleOnClick,\n onMouseDown: handleOnMouseDown,\n onMouseUp: handleOnMouseUp,\n onTouchStart: handleOnTouchStart,\n onTouchEnd: handleOnTouchEnd,\n onKeyDown: handleOnKeyDown,\n onKeyUp: handleOnKeyUp\n }\n };\n}\n"]}