@azure/communication-react 1.17.0-alpha-202405310013 → 1.17.0-alpha-202406010014

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 (93) hide show
  1. package/dist/communication-react.d.ts +19 -0
  2. package/dist/dist-cjs/communication-react/{ChatMessageComponentAsRichTextEditBox-anI3y0oU.js → ChatMessageComponentAsRichTextEditBox-SEDy46f4.js} +2 -2
  3. package/dist/dist-cjs/communication-react/{ChatMessageComponentAsRichTextEditBox-anI3y0oU.js.map → ChatMessageComponentAsRichTextEditBox-SEDy46f4.js.map} +1 -1
  4. package/dist/dist-cjs/communication-react/{RichTextSendBoxWrapper-CZ0LZbKA.js → RichTextSendBoxWrapper-BHdu0XqK.js} +2 -2
  5. package/dist/dist-cjs/communication-react/{RichTextSendBoxWrapper-CZ0LZbKA.js.map → RichTextSendBoxWrapper-BHdu0XqK.js.map} +1 -1
  6. package/dist/dist-cjs/communication-react/{index-BqQ1gXi4.js → index-HwuTcEP-.js} +206 -107
  7. package/dist/dist-cjs/communication-react/index-HwuTcEP-.js.map +1 -0
  8. package/dist/dist-cjs/communication-react/index.js +1 -1
  9. package/dist/dist-esm/acs-ui-common/src/telemetryVersion.js +1 -1
  10. package/dist/dist-esm/acs-ui-common/src/telemetryVersion.js.map +1 -1
  11. package/dist/dist-esm/calling-component-bindings/src/handlers/createCommonHandlers.d.ts +1 -0
  12. package/dist/dist-esm/calling-component-bindings/src/handlers/createCommonHandlers.js +15 -3
  13. package/dist/dist-esm/calling-component-bindings/src/handlers/createCommonHandlers.js.map +1 -1
  14. package/dist/dist-esm/calling-stateful-client/src/CallDeclarativeCommon.js +18 -6
  15. package/dist/dist-esm/calling-stateful-client/src/CallDeclarativeCommon.js.map +1 -1
  16. package/dist/dist-esm/communication-react/src/index.js.map +1 -1
  17. package/dist/dist-esm/react-components/src/components/ParticipantItem.js +1 -1
  18. package/dist/dist-esm/react-components/src/components/ParticipantItem.js.map +1 -1
  19. package/dist/dist-esm/react-components/src/components/ParticipantList.d.ts +2 -0
  20. package/dist/dist-esm/react-components/src/components/ParticipantList.js.map +1 -1
  21. package/dist/dist-esm/react-components/src/components/RemoteVideoTile.d.ts +1 -0
  22. package/dist/dist-esm/react-components/src/components/RemoteVideoTile.js +4 -2
  23. package/dist/dist-esm/react-components/src/components/RemoteVideoTile.js.map +1 -1
  24. package/dist/dist-esm/react-components/src/components/RichTextEditor/RichTextEditor.js +24 -4
  25. package/dist/dist-esm/react-components/src/components/RichTextEditor/RichTextEditor.js.map +1 -1
  26. package/dist/dist-esm/react-components/src/components/RichTextEditor/Toolbar/Table/RichTextInsertTablePane.js +5 -2
  27. package/dist/dist-esm/react-components/src/components/RichTextEditor/Toolbar/Table/RichTextInsertTablePane.js.map +1 -1
  28. package/dist/dist-esm/react-components/src/components/VideoEffects/VideoEffectsItem.js +2 -2
  29. package/dist/dist-esm/react-components/src/components/VideoEffects/VideoEffectsItem.js.map +1 -1
  30. package/dist/dist-esm/react-components/src/components/VideoGallery/useVideoTileContextualMenuProps.d.ts +1 -0
  31. package/dist/dist-esm/react-components/src/components/VideoGallery/useVideoTileContextualMenuProps.js +20 -2
  32. package/dist/dist-esm/react-components/src/components/VideoGallery/useVideoTileContextualMenuProps.js.map +1 -1
  33. package/dist/dist-esm/react-components/src/components/VideoGallery.d.ts +4 -0
  34. package/dist/dist-esm/react-components/src/components/VideoGallery.js +7 -2
  35. package/dist/dist-esm/react-components/src/components/VideoGallery.js.map +1 -1
  36. package/dist/dist-esm/react-components/src/components/index.js +0 -3
  37. package/dist/dist-esm/react-components/src/components/index.js.map +1 -1
  38. package/dist/dist-esm/react-components/src/components/styles/MessageThread.styles.js +7 -1
  39. package/dist/dist-esm/react-components/src/components/styles/MessageThread.styles.js.map +1 -1
  40. package/dist/dist-esm/react-components/src/components/styles/RichTextEditor.styles.js +10 -16
  41. package/dist/dist-esm/react-components/src/components/styles/RichTextEditor.styles.js.map +1 -1
  42. package/dist/dist-esm/react-components/src/index.js.map +1 -1
  43. package/dist/dist-esm/react-components/src/theming/icons.d.ts +1 -0
  44. package/dist/dist-esm/react-components/src/theming/icons.js +3 -4
  45. package/dist/dist-esm/react-components/src/theming/icons.js.map +1 -1
  46. package/dist/dist-esm/react-components/src/theming/v9ThemeShim.js +1 -1
  47. package/dist/dist-esm/react-components/src/theming/v9ThemeShim.js.map +1 -1
  48. package/dist/dist-esm/react-composites/src/composites/CallComposite/CallComposite.js +0 -2
  49. package/dist/dist-esm/react-composites/src/composites/CallComposite/CallComposite.js.map +1 -1
  50. package/dist/dist-esm/react-composites/src/composites/CallComposite/Strings.js.map +1 -1
  51. package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/AzureCommunicationCallAdapter.d.ts +1 -0
  52. package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/AzureCommunicationCallAdapter.js +8 -2
  53. package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/AzureCommunicationCallAdapter.js.map +1 -1
  54. package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/CallAdapter.d.ts +6 -0
  55. package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/CallAdapter.js.map +1 -1
  56. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/CallArrangement.js +18 -4
  57. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/CallArrangement.js.map +1 -1
  58. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/MediaGallery.js +5 -1
  59. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/MediaGallery.js.map +1 -1
  60. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/SidePane/usePeoplePane.d.ts +2 -0
  61. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/SidePane/usePeoplePane.js +36 -2
  62. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/SidePane/usePeoplePane.js.map +1 -1
  63. package/dist/dist-esm/react-composites/src/composites/CallComposite/hooks/useHandlers.js +5 -2
  64. package/dist/dist-esm/react-composites/src/composites/CallComposite/hooks/useHandlers.js.map +1 -1
  65. package/dist/dist-esm/react-composites/src/composites/CallComposite/hooks/usePropsFor.d.ts +1 -1
  66. package/dist/dist-esm/react-composites/src/composites/CallComposite/hooks/usePropsFor.js.map +1 -1
  67. package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/SurveyPage.js +0 -8
  68. package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/SurveyPage.js.map +1 -1
  69. package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/ThankYouForFeedbackPage.js +1 -9
  70. package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/ThankYouForFeedbackPage.js.map +1 -1
  71. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/CallWithChatComposite.js +1 -6
  72. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/CallWithChatComposite.js.map +1 -1
  73. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/AzureCommunicationCallWithChatAdapter.d.ts +1 -0
  74. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/AzureCommunicationCallWithChatAdapter.js +6 -1
  75. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/AzureCommunicationCallWithChatAdapter.js.map +1 -1
  76. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/CallWithChatAdapter.d.ts +4 -0
  77. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/CallWithChatAdapter.js.map +1 -1
  78. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/CallWithChatBackedCallAdapter.d.ts +1 -0
  79. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/CallWithChatBackedCallAdapter.js +6 -1
  80. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/CallWithChatBackedCallAdapter.js.map +1 -1
  81. package/dist/dist-esm/react-composites/src/composites/common/StarSurvey.js +1 -9
  82. package/dist/dist-esm/react-composites/src/composites/common/StarSurvey.js.map +1 -1
  83. package/dist/dist-esm/react-composites/src/composites/common/Survey.js +0 -19
  84. package/dist/dist-esm/react-composites/src/composites/common/Survey.js.map +1 -1
  85. package/dist/dist-esm/react-composites/src/composites/common/SurveyContent.js +1 -11
  86. package/dist/dist-esm/react-composites/src/composites/common/SurveyContent.js.map +1 -1
  87. package/dist/dist-esm/react-composites/src/composites/common/TagsSurvey.js +1 -8
  88. package/dist/dist-esm/react-composites/src/composites/common/TagsSurvey.js.map +1 -1
  89. package/dist/dist-esm/react-composites/src/composites/common/icons.d.ts +1 -0
  90. package/dist/dist-esm/react-composites/src/composites/common/styles/Survey.styles.js +0 -4
  91. package/dist/dist-esm/react-composites/src/composites/common/styles/Survey.styles.js.map +1 -1
  92. package/package.json +6 -6
  93. package/dist/dist-cjs/communication-react/index-BqQ1gXi4.js.map +0 -1
@@ -5,6 +5,10 @@ import { useIsParticularSidePaneOpen } from './SidePaneProvider';
5
5
  import { SidePaneHeader } from '../../../common/SidePaneHeader';
6
6
  import { PeoplePaneContent } from '../../../common/PeoplePaneContent';
7
7
  import { useLocale } from '../../../localization';
8
+ /* @conditional-compile-remove(soft-mute) */
9
+ import { getRemoteParticipants } from '../../selectors/baseSelectors';
10
+ /* @conditional-compile-remove(soft-mute) */
11
+ import { useSelector } from '../../hooks/useSelector';
8
12
  const PEOPLE_SIDE_PANE_ID = 'people';
9
13
  /** @private */
10
14
  export const usePeoplePane = (props) => {
@@ -22,13 +26,17 @@ export const usePeoplePane = (props) => {
22
26
  /* @conditional-compile-remove(spotlight) */
23
27
  onStopAllSpotlight,
24
28
  /* @conditional-compile-remove(spotlight) */
25
- maxParticipantsToSpotlight } = props;
29
+ maxParticipantsToSpotlight,
30
+ /* @conditional-compile-remove(soft-mute) */
31
+ onMuteParticipant } = props;
26
32
  const closePane = useCallback(() => {
27
33
  var _a;
28
34
  updateSidePaneRenderer(undefined);
29
35
  (_a = peopleButtonRef === null || peopleButtonRef === void 0 ? void 0 : peopleButtonRef.current) === null || _a === void 0 ? void 0 : _a.focus();
30
36
  }, [peopleButtonRef, updateSidePaneRenderer]);
31
37
  const localeStrings = useLocale().strings.call;
38
+ /* @conditional-compile-remove(soft-mute) */
39
+ const remoteParticipants = useSelector(getRemoteParticipants);
32
40
  /* @conditional-compile-remove(spotlight) */
33
41
  const sidePaneHeaderMenuProps = useMemo(() => {
34
42
  const menuItems = [];
@@ -48,11 +56,15 @@ export const usePeoplePane = (props) => {
48
56
  };
49
57
  }, [onStopAllSpotlight, spotlightedParticipantUserIds, localeStrings.stopAllSpotlightMenuLabel]);
50
58
  const onRenderHeader = useCallback(() => (React.createElement(SidePaneHeader, { onClose: closePane, headingText: localeStrings.peoplePaneTitle, dismissSidePaneButtonAriaLabel: localeStrings.dismissSidePaneButtonLabel, mobileView: mobileView !== null && mobileView !== void 0 ? mobileView : false })), [mobileView, closePane, localeStrings]);
51
- /* @conditional-compile-remove(spotlight) */
59
+ /* @conditional-compile-remove(spotlight) */ /* @conditional-compile-remove(soft-mute) */
52
60
  const onFetchParticipantMenuItemsForCallComposite = useCallback((participantId, myUserId, defaultMenuItems) => {
61
+ var _a;
53
62
  const _defaultMenuItems = defaultMenuItems !== null && defaultMenuItems !== void 0 ? defaultMenuItems : [];
63
+ /* @conditional-compile-remove(spotlight) */
54
64
  const isSpotlighted = spotlightedParticipantUserIds === null || spotlightedParticipantUserIds === void 0 ? void 0 : spotlightedParticipantUserIds.find((p) => p === participantId);
65
+ /* @conditional-compile-remove(spotlight) */
55
66
  const isMe = myUserId === participantId;
67
+ /* @conditional-compile-remove(spotlight) */
56
68
  if (isSpotlighted) {
57
69
  const stopSpotlightMenuText = isMe
58
70
  ? localeStrings.stopSpotlightOnSelfMenuLabel
@@ -108,6 +120,24 @@ export const usePeoplePane = (props) => {
108
120
  });
109
121
  }
110
122
  }
123
+ /* @conditional-compile-remove(soft-mute) */
124
+ if (onMuteParticipant && !isMe) {
125
+ const isMuted = remoteParticipants && ((_a = remoteParticipants[participantId]) === null || _a === void 0 ? void 0 : _a.isMuted);
126
+ _defaultMenuItems.push({
127
+ key: 'mute',
128
+ text: 'Mute',
129
+ iconProps: {
130
+ iconName: 'ContextualMenuMicMutedIcon',
131
+ styles: { root: { lineHeight: 0 } }
132
+ },
133
+ onClick: () => {
134
+ onMuteParticipant(participantId);
135
+ },
136
+ 'data-ui-id': 'participant-item-mute-participant',
137
+ ariaLabel: 'Mute',
138
+ disabled: isMuted
139
+ });
140
+ }
111
141
  return onFetchParticipantMenuItems
112
142
  ? onFetchParticipantMenuItems(participantId, myUserId, _defaultMenuItems)
113
143
  : _defaultMenuItems;
@@ -118,6 +148,10 @@ export const usePeoplePane = (props) => {
118
148
  onStartRemoteSpotlight,
119
149
  onStopRemoteSpotlight,
120
150
  onFetchParticipantMenuItems,
151
+ /* @conditional-compile-remove(soft-mute) */
152
+ onMuteParticipant,
153
+ /* @conditional-compile-remove(soft-mute) */
154
+ remoteParticipants,
121
155
  localeStrings.stopSpotlightMenuLabel,
122
156
  localeStrings.stopSpotlightOnSelfMenuLabel,
123
157
  localeStrings.addSpotlightMenuLabel,
@@ -1 +1 @@
1
- {"version":3,"file":"usePeoplePane.js","sourceRoot":"","sources":["../../../../../../../../../react-composites/src/composites/CallComposite/components/SidePane/usePeoplePane.tsx"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,KAAK,EAAE,EAAa,WAAW,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAC1E,OAAO,EAAoB,2BAA2B,EAAE,MAAM,oBAAoB,CAAC;AACnF,OAAO,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAC;AAChE,OAAO,EAAE,iBAAiB,EAAE,MAAM,mCAAmC,CAAC;AACtE,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAOlD,MAAM,mBAAmB,GAAG,QAAQ,CAAC;AAErC,eAAe;AACf,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,KAuB7B,EAIC,EAAE;IACF,MAAM,EAC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AEF,MAAM,QAAQ,GAAG,WAAW,CAAC,GAAG,EAAE;QAChC,sBAAsB,CAAC,gBAAgB,CAAC,CAAC;IAC3C,CAAC,EAAE,CAAC,gBAAgB,EAAE,sBAAsB,CAAC,CAAC,CAAC;IAE/C,MAAM,MAAM,GAAG,2BAA2B,CAAC,mBAAmB,CAAC,CAAC;IAEhE,kEAAkE;IAClE,SAAS,CAAC,GAAG,EAAE;QACb,IAAI,MAAM,EAAE,CAAC;YACX,QAAQ,EAAE,CAAC;QACb,CAAC;IACH,CAAC,EAAE,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC,CAAC;IAEvB,OAAO,EAAE,cAAc,EAAE,QAAQ,EAAE,eAAe,EAAE,SAAS,EAAE,gBAAgB,EAAE,MAAM,EAAE,CAAC;AAC5F,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport React, { RefObject, useCallback, useEffect, useMemo } from 'react';\nimport { SidePaneRenderer, useIsParticularSidePaneOpen } from './SidePaneProvider';\nimport { SidePaneHeader } from '../../../common/SidePaneHeader';\nimport { PeoplePaneContent } from '../../../common/PeoplePaneContent';\nimport { useLocale } from '../../../localization';\nimport { ParticipantMenuItemsCallback, _DrawerMenuItemProps } from '@internal/react-components';\nimport { AvatarPersonaDataCallback } from '../../../common/AvatarPersona';\nimport { IButton } from '@fluentui/react';\n/* @conditional-compile-remove(spotlight) */\nimport { IContextualMenuItem, IContextualMenuProps } from '@fluentui/react';\n\nconst PEOPLE_SIDE_PANE_ID = 'people';\n\n/** @private */\nexport const usePeoplePane = (props: {\n updateSidePaneRenderer: (renderer: SidePaneRenderer | undefined) => void;\n setDrawerMenuItems: (items: _DrawerMenuItemProps[]) => void;\n inviteLink?: string;\n onFetchAvatarPersonaData?: AvatarPersonaDataCallback;\n onFetchParticipantMenuItems?: ParticipantMenuItemsCallback;\n mobileView?: boolean;\n peopleButtonRef?: RefObject<IButton>;\n setParticipantActioned?: (userId: string) => void;\n /* @conditional-compile-remove(spotlight) */\n spotlightedParticipantUserIds?: string[];\n /* @conditional-compile-remove(spotlight) */\n onStartLocalSpotlight?: () => Promise<void>;\n /* @conditional-compile-remove(spotlight) */\n onStopLocalSpotlight?: () => Promise<void>;\n /* @conditional-compile-remove(spotlight) */\n onStartRemoteSpotlight?: (userIds: string[]) => Promise<void>;\n /* @conditional-compile-remove(spotlight) */\n onStopRemoteSpotlight?: (userIds: string[]) => Promise<void>;\n /* @conditional-compile-remove(spotlight) */\n onStopAllSpotlight?: () => Promise<void>;\n /* @conditional-compile-remove(spotlight) */\n maxParticipantsToSpotlight?: number;\n}): {\n openPeoplePane: () => void;\n closePeoplePane: () => void;\n isPeoplePaneOpen: boolean;\n} => {\n const {\n updateSidePaneRenderer,\n inviteLink,\n onFetchAvatarPersonaData,\n onFetchParticipantMenuItems,\n setDrawerMenuItems,\n mobileView,\n peopleButtonRef,\n setParticipantActioned,\n /* @conditional-compile-remove(spotlight) */\n spotlightedParticipantUserIds,\n /* @conditional-compile-remove(spotlight) */\n onStartLocalSpotlight,\n /* @conditional-compile-remove(spotlight) */\n onStopLocalSpotlight,\n /* @conditional-compile-remove(spotlight) */\n onStartRemoteSpotlight,\n /* @conditional-compile-remove(spotlight) */\n onStopRemoteSpotlight,\n /* @conditional-compile-remove(spotlight) */\n onStopAllSpotlight,\n /* @conditional-compile-remove(spotlight) */\n maxParticipantsToSpotlight\n } = props;\n\n const closePane = useCallback(() => {\n updateSidePaneRenderer(undefined);\n peopleButtonRef?.current?.focus();\n }, [peopleButtonRef, updateSidePaneRenderer]);\n\n const localeStrings = useLocale().strings.call;\n\n /* @conditional-compile-remove(spotlight) */\n const sidePaneHeaderMenuProps: IContextualMenuProps = useMemo(() => {\n const menuItems: IContextualMenuItem[] = [];\n if (onStopAllSpotlight && spotlightedParticipantUserIds && spotlightedParticipantUserIds.length > 0) {\n menuItems.push({\n key: 'stopAllSpotlightKey',\n text: localeStrings.stopAllSpotlightMenuLabel,\n iconProps: { iconName: 'StopAllSpotlightMenuButton', styles: { root: { lineHeight: 0 } } },\n onClick: () => {\n onStopAllSpotlight();\n },\n ariaLabel: localeStrings.stopAllSpotlightMenuLabel\n });\n }\n return {\n items: menuItems\n };\n }, [onStopAllSpotlight, spotlightedParticipantUserIds, localeStrings.stopAllSpotlightMenuLabel]);\n\n const onRenderHeader = useCallback(\n () => (\n <SidePaneHeader\n onClose={closePane}\n headingText={localeStrings.peoplePaneTitle}\n dismissSidePaneButtonAriaLabel={localeStrings.dismissSidePaneButtonLabel}\n mobileView={mobileView ?? false}\n />\n ),\n [mobileView, closePane, localeStrings]\n );\n\n /* @conditional-compile-remove(spotlight) */\n const onFetchParticipantMenuItemsForCallComposite = useCallback(\n (participantId: string, myUserId?: string, defaultMenuItems?: IContextualMenuItem[]): IContextualMenuItem[] => {\n const _defaultMenuItems: IContextualMenuItem[] = defaultMenuItems ?? [];\n const isSpotlighted = spotlightedParticipantUserIds?.find((p) => p === participantId);\n const isMe = myUserId === participantId;\n if (isSpotlighted) {\n const stopSpotlightMenuText = isMe\n ? localeStrings.stopSpotlightOnSelfMenuLabel\n : localeStrings.stopSpotlightMenuLabel;\n const onStopSpotlight = isMe\n ? onStopLocalSpotlight\n : onStopRemoteSpotlight\n ? () => {\n onStopRemoteSpotlight([participantId]);\n }\n : undefined;\n if (onStopSpotlight && stopSpotlightMenuText) {\n _defaultMenuItems.push({\n key: 'stop-spotlight',\n text: stopSpotlightMenuText,\n onClick: onStopSpotlight,\n iconProps: {\n iconName: 'StopSpotlightContextualMenuItem',\n styles: { root: { lineHeight: 0 } }\n },\n ariaLabel: stopSpotlightMenuText\n });\n }\n } else {\n const startSpotlightMenuText =\n spotlightedParticipantUserIds && spotlightedParticipantUserIds.length > 0\n ? localeStrings.addSpotlightMenuLabel\n : localeStrings.startSpotlightMenuLabel;\n const maxSpotlightedParticipantsReached = maxParticipantsToSpotlight\n ? spotlightedParticipantUserIds\n ? spotlightedParticipantUserIds.length >= maxParticipantsToSpotlight\n : false\n : false;\n const onStartSpotlight = isMe\n ? onStartLocalSpotlight\n : onStartRemoteSpotlight\n ? () => {\n onStartRemoteSpotlight([participantId]);\n }\n : undefined;\n if (onStartSpotlight && startSpotlightMenuText) {\n _defaultMenuItems.push({\n key: 'start-spotlight',\n text: startSpotlightMenuText,\n onClick: onStartSpotlight,\n iconProps: {\n iconName: 'StartSpotlightContextualMenuItem',\n styles: { root: { lineHeight: 0 } }\n },\n ariaLabel: startSpotlightMenuText,\n disabled: maxSpotlightedParticipantsReached,\n title: maxSpotlightedParticipantsReached ? localeStrings.spotlightLimitReachedMenuTitle : undefined\n });\n }\n }\n return onFetchParticipantMenuItems\n ? onFetchParticipantMenuItems(participantId, myUserId, _defaultMenuItems)\n : _defaultMenuItems;\n },\n [\n spotlightedParticipantUserIds,\n onStartLocalSpotlight,\n onStopLocalSpotlight,\n onStartRemoteSpotlight,\n onStopRemoteSpotlight,\n onFetchParticipantMenuItems,\n localeStrings.stopSpotlightMenuLabel,\n localeStrings.stopSpotlightOnSelfMenuLabel,\n localeStrings.addSpotlightMenuLabel,\n localeStrings.startSpotlightMenuLabel,\n localeStrings.spotlightLimitReachedMenuTitle,\n maxParticipantsToSpotlight\n ]\n );\n\n let _onFetchParticipantMenuItems = onFetchParticipantMenuItems;\n /* @conditional-compile-remove(spotlight) */\n _onFetchParticipantMenuItems = onFetchParticipantMenuItemsForCallComposite;\n\n const onRenderContent = useCallback((): JSX.Element => {\n return (\n <PeoplePaneContent\n inviteLink={inviteLink}\n onFetchAvatarPersonaData={onFetchAvatarPersonaData}\n onFetchParticipantMenuItems={_onFetchParticipantMenuItems}\n setDrawerMenuItems={setDrawerMenuItems}\n mobileView={mobileView}\n setParticipantActioned={setParticipantActioned}\n /* @conditional-compile-remove(spotlight) */\n participantListHeadingMoreButtonProps={sidePaneHeaderMenuProps}\n />\n );\n }, [\n inviteLink,\n mobileView,\n onFetchAvatarPersonaData,\n _onFetchParticipantMenuItems,\n setDrawerMenuItems,\n setParticipantActioned,\n /* @conditional-compile-remove(spotlight) */ sidePaneHeaderMenuProps\n ]);\n\n const sidePaneRenderer: SidePaneRenderer = useMemo(\n () => ({\n headerRenderer: onRenderHeader,\n contentRenderer: onRenderContent,\n id: PEOPLE_SIDE_PANE_ID\n }),\n [onRenderContent, onRenderHeader]\n );\n\n const openPane = useCallback(() => {\n updateSidePaneRenderer(sidePaneRenderer);\n }, [sidePaneRenderer, updateSidePaneRenderer]);\n\n const isOpen = useIsParticularSidePaneOpen(PEOPLE_SIDE_PANE_ID);\n\n // Update pane renderer if it is open and the openPane dep changes\n useEffect(() => {\n if (isOpen) {\n openPane();\n }\n }, [isOpen, openPane]);\n\n return { openPeoplePane: openPane, closePeoplePane: closePane, isPeoplePaneOpen: isOpen };\n};\n"]}
1
+ {"version":3,"file":"usePeoplePane.js","sourceRoot":"","sources":["../../../../../../../../../react-composites/src/composites/CallComposite/components/SidePane/usePeoplePane.tsx"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,KAAK,EAAE,EAAa,WAAW,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAC1E,OAAO,EAAoB,2BAA2B,EAAE,MAAM,oBAAoB,CAAC;AACnF,OAAO,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAC;AAChE,OAAO,EAAE,iBAAiB,EAAE,MAAM,mCAAmC,CAAC;AACtE,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAMlD,4CAA4C;AAC5C,OAAO,EAAE,qBAAqB,EAAE,MAAM,+BAA+B,CAAC;AACtE,4CAA4C;AAC5C,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAEtD,MAAM,mBAAmB,GAAG,QAAQ,CAAC;AAErC,eAAe;AACf,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,KA2B7B,EAIC,EAAE;IACF,MAAM,EACJ,sBAAsB,EACtB,UAAU,EACV,wBAAwB,EACxB,2BAA2B,E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AC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport React, { RefObject, useCallback, useEffect, useMemo } from 'react';\nimport { SidePaneRenderer, useIsParticularSidePaneOpen } from './SidePaneProvider';\nimport { SidePaneHeader } from '../../../common/SidePaneHeader';\nimport { PeoplePaneContent } from '../../../common/PeoplePaneContent';\nimport { useLocale } from '../../../localization';\nimport { ParticipantMenuItemsCallback, _DrawerMenuItemProps } from '@internal/react-components';\nimport { AvatarPersonaDataCallback } from '../../../common/AvatarPersona';\nimport { IButton } from '@fluentui/react';\n/* @conditional-compile-remove(spotlight) */\nimport { IContextualMenuItem, IContextualMenuProps } from '@fluentui/react';\n/* @conditional-compile-remove(soft-mute) */\nimport { getRemoteParticipants } from '../../selectors/baseSelectors';\n/* @conditional-compile-remove(soft-mute) */\nimport { useSelector } from '../../hooks/useSelector';\n\nconst PEOPLE_SIDE_PANE_ID = 'people';\n\n/** @private */\nexport const usePeoplePane = (props: {\n updateSidePaneRenderer: (renderer: SidePaneRenderer | undefined) => void;\n setDrawerMenuItems: (items: _DrawerMenuItemProps[]) => void;\n inviteLink?: string;\n onFetchAvatarPersonaData?: AvatarPersonaDataCallback;\n onFetchParticipantMenuItems?: ParticipantMenuItemsCallback;\n mobileView?: boolean;\n peopleButtonRef?: RefObject<IButton>;\n setParticipantActioned?: (userId: string) => void;\n /* @conditional-compile-remove(spotlight) */\n spotlightedParticipantUserIds?: string[];\n /* @conditional-compile-remove(spotlight) */\n onStartLocalSpotlight?: () => Promise<void>;\n /* @conditional-compile-remove(spotlight) */\n onStopLocalSpotlight?: () => Promise<void>;\n /* @conditional-compile-remove(spotlight) */\n onStartRemoteSpotlight?: (userIds: string[]) => Promise<void>;\n /* @conditional-compile-remove(spotlight) */\n onStopRemoteSpotlight?: (userIds: string[]) => Promise<void>;\n /* @conditional-compile-remove(spotlight) */\n onStopAllSpotlight?: () => Promise<void>;\n /* @conditional-compile-remove(spotlight) */\n maxParticipantsToSpotlight?: number;\n /* @conditional-compile-remove(soft-mute) */\n onMuteParticipant?: (userId: string) => Promise<void>;\n /* @conditional-compile-remove(soft-mute) */\n mutedParticipantUserIds?: string[];\n}): {\n openPeoplePane: () => void;\n closePeoplePane: () => void;\n isPeoplePaneOpen: boolean;\n} => {\n const {\n updateSidePaneRenderer,\n inviteLink,\n onFetchAvatarPersonaData,\n onFetchParticipantMenuItems,\n setDrawerMenuItems,\n mobileView,\n peopleButtonRef,\n setParticipantActioned,\n /* @conditional-compile-remove(spotlight) */\n spotlightedParticipantUserIds,\n /* @conditional-compile-remove(spotlight) */\n onStartLocalSpotlight,\n /* @conditional-compile-remove(spotlight) */\n onStopLocalSpotlight,\n /* @conditional-compile-remove(spotlight) */\n onStartRemoteSpotlight,\n /* @conditional-compile-remove(spotlight) */\n onStopRemoteSpotlight,\n /* @conditional-compile-remove(spotlight) */\n onStopAllSpotlight,\n /* @conditional-compile-remove(spotlight) */\n maxParticipantsToSpotlight,\n /* @conditional-compile-remove(soft-mute) */\n onMuteParticipant\n } = props;\n\n const closePane = useCallback(() => {\n updateSidePaneRenderer(undefined);\n peopleButtonRef?.current?.focus();\n }, [peopleButtonRef, updateSidePaneRenderer]);\n\n const localeStrings = useLocale().strings.call;\n /* @conditional-compile-remove(soft-mute) */\n const remoteParticipants = useSelector(getRemoteParticipants);\n\n /* @conditional-compile-remove(spotlight) */\n const sidePaneHeaderMenuProps: IContextualMenuProps = useMemo(() => {\n const menuItems: IContextualMenuItem[] = [];\n if (onStopAllSpotlight && spotlightedParticipantUserIds && spotlightedParticipantUserIds.length > 0) {\n menuItems.push({\n key: 'stopAllSpotlightKey',\n text: localeStrings.stopAllSpotlightMenuLabel,\n iconProps: { iconName: 'StopAllSpotlightMenuButton', styles: { root: { lineHeight: 0 } } },\n onClick: () => {\n onStopAllSpotlight();\n },\n ariaLabel: localeStrings.stopAllSpotlightMenuLabel\n });\n }\n return {\n items: menuItems\n };\n }, [onStopAllSpotlight, spotlightedParticipantUserIds, localeStrings.stopAllSpotlightMenuLabel]);\n\n const onRenderHeader = useCallback(\n () => (\n <SidePaneHeader\n onClose={closePane}\n headingText={localeStrings.peoplePaneTitle}\n dismissSidePaneButtonAriaLabel={localeStrings.dismissSidePaneButtonLabel}\n mobileView={mobileView ?? false}\n />\n ),\n [mobileView, closePane, localeStrings]\n );\n\n /* @conditional-compile-remove(spotlight) */ /* @conditional-compile-remove(soft-mute) */\n const onFetchParticipantMenuItemsForCallComposite = useCallback(\n (participantId: string, myUserId?: string, defaultMenuItems?: IContextualMenuItem[]): IContextualMenuItem[] => {\n const _defaultMenuItems: IContextualMenuItem[] = defaultMenuItems ?? [];\n /* @conditional-compile-remove(spotlight) */\n const isSpotlighted = spotlightedParticipantUserIds?.find((p) => p === participantId);\n /* @conditional-compile-remove(spotlight) */\n const isMe = myUserId === participantId;\n /* @conditional-compile-remove(spotlight) */\n if (isSpotlighted) {\n const stopSpotlightMenuText = isMe\n ? localeStrings.stopSpotlightOnSelfMenuLabel\n : localeStrings.stopSpotlightMenuLabel;\n const onStopSpotlight = isMe\n ? onStopLocalSpotlight\n : onStopRemoteSpotlight\n ? () => {\n onStopRemoteSpotlight([participantId]);\n }\n : undefined;\n if (onStopSpotlight && stopSpotlightMenuText) {\n _defaultMenuItems.push({\n key: 'stop-spotlight',\n text: stopSpotlightMenuText,\n onClick: onStopSpotlight,\n iconProps: {\n iconName: 'StopSpotlightContextualMenuItem',\n styles: { root: { lineHeight: 0 } }\n },\n ariaLabel: stopSpotlightMenuText\n });\n }\n } else {\n const startSpotlightMenuText =\n spotlightedParticipantUserIds && spotlightedParticipantUserIds.length > 0\n ? localeStrings.addSpotlightMenuLabel\n : localeStrings.startSpotlightMenuLabel;\n const maxSpotlightedParticipantsReached = maxParticipantsToSpotlight\n ? spotlightedParticipantUserIds\n ? spotlightedParticipantUserIds.length >= maxParticipantsToSpotlight\n : false\n : false;\n const onStartSpotlight = isMe\n ? onStartLocalSpotlight\n : onStartRemoteSpotlight\n ? () => {\n onStartRemoteSpotlight([participantId]);\n }\n : undefined;\n if (onStartSpotlight && startSpotlightMenuText) {\n _defaultMenuItems.push({\n key: 'start-spotlight',\n text: startSpotlightMenuText,\n onClick: onStartSpotlight,\n iconProps: {\n iconName: 'StartSpotlightContextualMenuItem',\n styles: { root: { lineHeight: 0 } }\n },\n ariaLabel: startSpotlightMenuText,\n disabled: maxSpotlightedParticipantsReached,\n title: maxSpotlightedParticipantsReached ? localeStrings.spotlightLimitReachedMenuTitle : undefined\n });\n }\n }\n /* @conditional-compile-remove(soft-mute) */\n if (onMuteParticipant && !isMe) {\n const isMuted = remoteParticipants && remoteParticipants[participantId]?.isMuted;\n _defaultMenuItems.push({\n key: 'mute',\n text: 'Mute',\n iconProps: {\n iconName: 'ContextualMenuMicMutedIcon',\n styles: { root: { lineHeight: 0 } }\n },\n onClick: () => {\n onMuteParticipant(participantId);\n },\n 'data-ui-id': 'participant-item-mute-participant',\n ariaLabel: 'Mute',\n disabled: isMuted\n });\n }\n return onFetchParticipantMenuItems\n ? onFetchParticipantMenuItems(participantId, myUserId, _defaultMenuItems)\n : _defaultMenuItems;\n },\n [\n spotlightedParticipantUserIds,\n onStartLocalSpotlight,\n onStopLocalSpotlight,\n onStartRemoteSpotlight,\n onStopRemoteSpotlight,\n onFetchParticipantMenuItems,\n /* @conditional-compile-remove(soft-mute) */\n onMuteParticipant,\n /* @conditional-compile-remove(soft-mute) */\n remoteParticipants,\n localeStrings.stopSpotlightMenuLabel,\n localeStrings.stopSpotlightOnSelfMenuLabel,\n localeStrings.addSpotlightMenuLabel,\n localeStrings.startSpotlightMenuLabel,\n localeStrings.spotlightLimitReachedMenuTitle,\n maxParticipantsToSpotlight\n ]\n );\n\n let _onFetchParticipantMenuItems = onFetchParticipantMenuItems;\n /* @conditional-compile-remove(spotlight) */\n _onFetchParticipantMenuItems = onFetchParticipantMenuItemsForCallComposite;\n\n const onRenderContent = useCallback((): JSX.Element => {\n return (\n <PeoplePaneContent\n inviteLink={inviteLink}\n onFetchAvatarPersonaData={onFetchAvatarPersonaData}\n onFetchParticipantMenuItems={_onFetchParticipantMenuItems}\n setDrawerMenuItems={setDrawerMenuItems}\n mobileView={mobileView}\n setParticipantActioned={setParticipantActioned}\n /* @conditional-compile-remove(spotlight) */\n participantListHeadingMoreButtonProps={sidePaneHeaderMenuProps}\n />\n );\n }, [\n inviteLink,\n mobileView,\n onFetchAvatarPersonaData,\n _onFetchParticipantMenuItems,\n setDrawerMenuItems,\n setParticipantActioned,\n /* @conditional-compile-remove(spotlight) */ sidePaneHeaderMenuProps\n ]);\n\n const sidePaneRenderer: SidePaneRenderer = useMemo(\n () => ({\n headerRenderer: onRenderHeader,\n contentRenderer: onRenderContent,\n id: PEOPLE_SIDE_PANE_ID\n }),\n [onRenderContent, onRenderHeader]\n );\n\n const openPane = useCallback(() => {\n updateSidePaneRenderer(sidePaneRenderer);\n }, [sidePaneRenderer, updateSidePaneRenderer]);\n\n const isOpen = useIsParticularSidePaneOpen(PEOPLE_SIDE_PANE_ID);\n\n // Update pane renderer if it is open and the openPane dep changes\n useEffect(() => {\n if (isOpen) {\n openPane();\n }\n }, [isOpen, openPane]);\n\n return { openPeoplePane: openPane, closePeoplePane: closePane, isPeoplePaneOpen: isOpen };\n};\n"]}
@@ -155,7 +155,6 @@ const createCompositeHandlers = memoizeOne((adapter, capabilities) => {
155
155
  onSetCaptionLanguage: (language) => __awaiter(void 0, void 0, void 0, function* () {
156
156
  yield adapter.setCaptionLanguage(language);
157
157
  }),
158
- /* @conditional-compile-remove(end-of-call-survey) */
159
158
  onSubmitSurvey: (survey) => __awaiter(void 0, void 0, void 0, function* () {
160
159
  return yield adapter.submitSurvey(survey);
161
160
  }),
@@ -192,7 +191,11 @@ const createCompositeHandlers = memoizeOne((adapter, capabilities) => {
192
191
  ? (userIds) => __awaiter(void 0, void 0, void 0, function* () {
193
192
  yield adapter.stopSpotlight(userIds);
194
193
  })
195
- : undefined
194
+ : undefined,
195
+ /* @conditional-compile-remove(soft-mute) */
196
+ onMuteParticipant: (userId) => __awaiter(void 0, void 0, void 0, function* () {
197
+ yield adapter.muteParticipant(userId);
198
+ })
196
199
  };
197
200
  });
198
201
  //# sourceMappingURL=useHandlers.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"useHandlers.js","sourceRoot":"","sources":["../../../../../../../../react-composites/src/composites/CallComposite/hooks/useHandlers.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;;;;;;;;;;AAKlC,OAAO,EAAoB,6BAA6B,EAAE,yCAAgC;AAE1F,OAAO,UAAU,MAAM,aAAa,CAAC;AAIrC,OAAO,EAAE,UAAU,EAAE,MAAM,gCAAgC,CAAC;AAC5D,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAmBtC,6CAA6C;AAC7C,OAAO,EAAE,0BAA0B,EAAE,yCAAgC;AAErE;;GAEG;AACH,+HAA+H;AAC/H,MAAM,CAAC,MAAM,WAAW,GAAG;AACzB,6DAA6D;AAC7D,UAAkD,EAE8B,EAAE;;IAClF,MAAM,OAAO,GAAG,UAAU,EAAE,CAAC;IAC7B,MAAM,YAAY,GAAG,MAAA,MAAA,OAAO,CAAC,QAAQ,EAAE,CAAC,IAAI,0CAAE,mBAAmB,0CAAE,YAAY,CAAC;IAChF,OAAO,uBAAuB,CAAC,OAAO,EAAE,YAAY,CAAC,CAAC;AACxD,CAAC,CAAC;AAEF,MAAM,uBAAuB,GAAG,UAAU,CACxC,CACE,OAA0B,EAC1B,YAAsC,EACmE,EAAE;IAC3G,OAAO;QACL,uBAAuB,EAAE,CAAO,OAAO,EAAE,EAAE;YACzC,OAAO,MAAM,OAAO,CAAC,gBAAgB,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC;QAC5D,CAAC,CAAA;QACD,wBAAwB,EAAE,CAAO,MAAM,EAAE,OAAO,EAAE,EAAE;YAClD,OAAO,MAAM,OAAO,CAAC,gBAAgB,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;QACzD,CAAC,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CAAC,CAAA;YACH,CAAC,CAAC,SAAS;KACd,CAAC;AACJ,CAAC,CACF,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { CommonCallingHandlers } from '@internal/calling-component-bindings';\n/* @conditional-compile-remove(spotlight) */\nimport { _ComponentCallingHandlers } from '@internal/calling-component-bindings';\nimport { CommonProperties, toFlatCommunicationIdentifier } from '@internal/acs-ui-common';\nimport { ReactElement } from 'react';\nimport memoizeOne from 'memoize-one';\nimport { CommonCallAdapter } from '..';\n\nimport { VideoBackgroundBlurEffect, VideoBackgroundReplacementEffect } from '..';\nimport { useAdapter } from '../adapter/CallAdapterProvider';\nimport { isCameraOn } from '../utils';\nimport { DtmfTone } from '@azure/communication-calling';\n/* @conditional-compile-remove(PSTN-calls) */\nimport { AddPhoneNumberOptions } from '@azure/communication-calling';\nimport { Reaction } from '@azure/communication-calling';\n\nimport type {\n BackgroundReplacementConfig,\n BackgroundBlurConfig,\n ParticipantCapabilities\n} from '@azure/communication-calling';\n/* @conditional-compile-remove(end-of-call-survey) */\nimport { CallSurvey, CallSurveyResponse } from '@azure/communication-calling';\n/* @conditional-compile-remove(PSTN-calls) */\nimport {\n CommunicationIdentifier,\n CommunicationUserIdentifier,\n PhoneNumberIdentifier\n} from '@azure/communication-common';\n/* @conditional-compile-remove(PSTN-calls) */\nimport { _toCommunicationIdentifier } from '@internal/acs-ui-common';\n\n/**\n * @private\n */\n// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/explicit-function-return-type\nexport const useHandlers = <PropsT>(\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n _component: (props: PropsT) => ReactElement | null\n): Pick<CommonCallingHandlers, CommonProperties<CommonCallingHandlers, PropsT>> &\n /* @conditional-compile-remove(spotlight) */ Partial<_ComponentCallingHandlers> => {\n const adapter = useAdapter();\n const capabilities = adapter.getState().call?.capabilitiesFeature?.capabilities;\n return createCompositeHandlers(adapter, capabilities);\n};\n\nconst createCompositeHandlers = memoizeOne(\n (\n adapter: CommonCallAdapter,\n capabilities?: ParticipantCapabilities\n ): CommonCallingHandlers & /* @conditional-compile-remove(spotlight) */ Partial<_ComponentCallingHandlers> => {\n return {\n onCreateLocalStreamView: async (options) => {\n return await adapter.createStreamView(undefined, options);\n },\n onCreateRemoteStreamView: async (userId, options) => {\n return await adapter.createStreamView(userId, options);\n },\n onHangUp: async (forEveryone?: boolean) => {\n await adapter.leaveCall(forEveryone);\n },\n /* @conditional-compile-remove(PSTN-calls) */\n onToggleHold: async () => {\n return adapter.getState().call?.state === 'LocalHold' ? await adapter.resumeCall() : await adapter.holdCall();\n },\n /* @conditional-compile-remove(PSTN-calls) */\n onAddParticipant: async (\n participant: Partial<CommunicationUserIdentifier & PhoneNumberIdentifier>,\n options?: AddPhoneNumberOptions\n ) => {\n if ('communicationUserId' in participant) {\n return await adapter.addParticipant(participant as CommunicationUserIdentifier);\n } else if ('phoneNumber' in participant) {\n return await adapter.addParticipant(participant as PhoneNumberIdentifier, options);\n }\n },\n onSendDtmfTone: async (dtmfTone: DtmfTone) => {\n await adapter.sendDtmfTone(dtmfTone);\n },\n onRemoveParticipant: async (\n userId: string | /* @conditional-compile-remove(PSTN-calls) */ CommunicationIdentifier\n ) => {\n if (typeof userId === 'string') {\n await adapter.removeParticipant(userId);\n } else {\n /* @conditional-compile-remove(PSTN-calls) */\n await adapter.removeParticipant(_toCommunicationIdentifier(userId));\n }\n },\n onRaiseHand: async () => {\n await adapter.raiseHand();\n },\n onLowerHand: async () => {\n await adapter.lowerHand();\n },\n onToggleRaiseHand: async () => {\n adapter.getState().call?.raiseHand.localParticipantRaisedHand\n ? await adapter.lowerHand()\n : await adapter.raiseHand();\n },\n onReactionClick: async (reaction: Reaction) => {\n await adapter.onReactionClick(reaction);\n },\n onSelectCamera: async (deviceInfo, options) => {\n await adapter.setCamera(deviceInfo, options);\n },\n onSelectMicrophone: async (deviceInfo) => {\n await adapter.setMicrophone(deviceInfo);\n },\n onSelectSpeaker: async (deviceInfo) => {\n await adapter.setSpeaker(deviceInfo);\n },\n onStartCall: (participants, options?) => {\n const rawIds = participants.map((participant) => toFlatCommunicationIdentifier(participant));\n return adapter.startCall(rawIds, options);\n },\n onStartScreenShare: async () => {\n await adapter.startScreenShare();\n },\n onStopScreenShare: async () => {\n await adapter.stopScreenShare();\n },\n onToggleCamera: async (options) => {\n isCameraOn(adapter.getState()) ? await adapter.stopCamera() : await adapter.startCamera(options);\n },\n onToggleMicrophone: async () => {\n return adapter.getState().call?.isMuted ? await adapter.unmute() : await adapter.mute();\n },\n onToggleScreenShare: async () => {\n return adapter.getState().call?.isScreenSharingOn\n ? await adapter.stopScreenShare()\n : await adapter.startScreenShare();\n },\n onStartLocalVideo: async () => {\n if (adapter.getState().call) {\n return adapter.startCamera();\n }\n },\n onDisposeLocalStreamView: async () => {\n return adapter.disposeLocalVideoStreamView();\n },\n onDisposeRemoteStreamView: async (userId) => {\n return adapter.disposeStreamView(userId);\n },\n onDisposeRemoteScreenShareStreamView: async (userId) => {\n return adapter.disposeScreenShareStreamView(userId);\n },\n onDisposeRemoteVideoStreamView: async (userId) => {\n return adapter.disposeRemoteVideoStreamView(userId);\n },\n /* @conditional-compile-remove(call-readiness) */\n askDevicePermission: async (constrain) => {\n return adapter.askDevicePermission(constrain);\n },\n\n onRemoveVideoBackgroundEffects: async () => {\n return await adapter.stopVideoBackgroundEffects();\n },\n\n onBlurVideoBackground: async (backgroundBlurConfig?: BackgroundBlurConfig) => {\n const blurConfig: VideoBackgroundBlurEffect = {\n effectName: 'blur',\n ...backgroundBlurConfig\n };\n return await adapter.startVideoBackgroundEffect(blurConfig);\n },\n\n onReplaceVideoBackground: async (backgroundReplacementConfig: BackgroundReplacementConfig) => {\n const replacementConfig: VideoBackgroundReplacementEffect = {\n effectName: 'replacement',\n ...backgroundReplacementConfig\n };\n return await adapter.startVideoBackgroundEffect(replacementConfig);\n },\n onStartCaptions: async (options) => {\n await adapter.startCaptions(options);\n },\n onStopCaptions: async () => {\n await adapter.stopCaptions();\n },\n onSetSpokenLanguage: async (language) => {\n await adapter.setSpokenLanguage(language);\n },\n onSetCaptionLanguage: async (language) => {\n await adapter.setCaptionLanguage(language);\n },\n /* @conditional-compile-remove(end-of-call-survey) */\n onSubmitSurvey: async (survey: CallSurvey): Promise<CallSurveyResponse | undefined> => {\n return await adapter.submitSurvey(survey);\n },\n /* @conditional-compile-remove(spotlight) */\n onStartSpotlight: async (userIds?: string[]): Promise<void> => {\n await adapter.startSpotlight(userIds);\n },\n /* @conditional-compile-remove(spotlight) */\n onStopSpotlight: async (userIds?: string[]): Promise<void> => {\n await adapter.stopSpotlight(userIds);\n },\n /* @conditional-compile-remove(spotlight) */\n onStopAllSpotlight: async (): Promise<void> => {\n await adapter.stopAllSpotlight();\n },\n /* @conditional-compile-remove(spotlight) */\n onStartLocalSpotlight: capabilities?.spotlightParticipant.isPresent\n ? async (): Promise<void> => {\n await adapter.startSpotlight();\n }\n : undefined,\n /* @conditional-compile-remove(spotlight) */\n onStopLocalSpotlight: async (): Promise<void> => {\n await adapter.stopSpotlight();\n },\n /* @conditional-compile-remove(spotlight) */\n onStartRemoteSpotlight: capabilities?.spotlightParticipant.isPresent\n ? async (userIds?: string[]): Promise<void> => {\n await adapter.startSpotlight(userIds);\n }\n : undefined,\n /* @conditional-compile-remove(spotlight) */\n onStopRemoteSpotlight: capabilities?.removeParticipantsSpotlight.isPresent\n ? async (userIds?: string[]): Promise<void> => {\n await adapter.stopSpotlight(userIds);\n }\n : undefined\n };\n }\n);\n"]}
1
+ {"version":3,"file":"useHandlers.js","sourceRoot":"","sources":["../../../../../../../../react-composites/src/composites/CallComposite/hooks/useHandlers.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;;;;;;;;;;AAKlC,OAAO,EAAoB,6BAA6B,EAAE,yCAAgC;AAE1F,OAAO,UAAU,MAAM,aAAa,CAAC;AAIrC,OAAO,EAAE,UAAU,EAAE,MAAM,gCAAgC,C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E,CAAC;QACnC,CAAC,CAAA;QACD,4CAA4C;QAC5C,qBAAqB,EAAE,CAAA,YAAY,aAAZ,YAAY,uBAAZ,YAAY,CAAE,oBAAoB,CAAC,SAAS;YACjE,CAAC,CAAC,GAAwB,EAAE;gBACxB,MAAM,OAAO,CAAC,cAAc,EAAE,CAAC;YACjC,CAAC,CAAA;YACH,CAAC,CAAC,SAAS;QACb,4CAA4C;QAC5C,oBAAoB,EAAE,GAAwB,EAAE;YAC9C,MAAM,OAAO,CAAC,aAAa,EAAE,CAAC;QAChC,CAAC,CAAA;QACD,4CAA4C;QAC5C,sBAAsB,EAAE,CAAA,YAAY,aAAZ,YAAY,uBAAZ,YAAY,CAAE,oBAAoB,CAAC,SAAS;YAClE,CAAC,CAAC,CAAO,OAAkB,EAAiB,EAAE;gBAC1C,MAAM,OAAO,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC;YACxC,CAAC,CAAA;YACH,CAAC,CAAC,SAAS;QACb,4CAA4C;QAC5C,qBAAqB,EAAE,CAAA,YAAY,aAAZ,YAAY,uBAAZ,YAAY,CAAE,2BAA2B,CAAC,SAAS;YACxE,CAAC,CAAC,CAAO,OAAkB,EAAiB,EAAE;gBAC1C,MAAM,OAAO,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC;YACvC,CAAC,CAAA;YACH,CAAC,CAAC,SAAS;QACb,4CAA4C;QAC5C,iBAAiB,EAAE,CAAO,MAAc,EAAiB,EAAE;YACzD,MAAM,OAAO,CAAC,eAAe,CAAC,MAAM,CAAC,CAAC;QACxC,CAAC,CAAA;KACF,CAAC;AACJ,CAAC,CACF,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { CommonCallingHandlers } from '@internal/calling-component-bindings';\n/* @conditional-compile-remove(spotlight) */ /* @conditional-compile-remove(soft-mute) */\nimport { _ComponentCallingHandlers } from '@internal/calling-component-bindings';\nimport { CommonProperties, toFlatCommunicationIdentifier } from '@internal/acs-ui-common';\nimport { ReactElement } from 'react';\nimport memoizeOne from 'memoize-one';\nimport { CommonCallAdapter } from '..';\n\nimport { VideoBackgroundBlurEffect, VideoBackgroundReplacementEffect } from '..';\nimport { useAdapter } from '../adapter/CallAdapterProvider';\nimport { isCameraOn } from '../utils';\nimport { DtmfTone } from '@azure/communication-calling';\n/* @conditional-compile-remove(PSTN-calls) */\nimport { AddPhoneNumberOptions } from '@azure/communication-calling';\nimport { Reaction } from '@azure/communication-calling';\n\nimport type {\n BackgroundReplacementConfig,\n BackgroundBlurConfig,\n ParticipantCapabilities\n} from '@azure/communication-calling';\nimport { CallSurvey, CallSurveyResponse } from '@azure/communication-calling';\n/* @conditional-compile-remove(PSTN-calls) */\nimport {\n CommunicationIdentifier,\n CommunicationUserIdentifier,\n PhoneNumberIdentifier\n} from '@azure/communication-common';\n/* @conditional-compile-remove(PSTN-calls) */\nimport { _toCommunicationIdentifier } from '@internal/acs-ui-common';\n\n/**\n * @private\n */\n// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/explicit-function-return-type\nexport const useHandlers = <PropsT>(\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n _component: (props: PropsT) => ReactElement | null\n): Pick<CommonCallingHandlers, CommonProperties<CommonCallingHandlers, PropsT>> &\n /* @conditional-compile-remove(spotlight) */ /* @conditional-compile-remove(soft-mute) */ Partial<_ComponentCallingHandlers> => {\n const adapter = useAdapter();\n const capabilities = adapter.getState().call?.capabilitiesFeature?.capabilities;\n return createCompositeHandlers(adapter, capabilities);\n};\n\nconst createCompositeHandlers = memoizeOne(\n (\n adapter: CommonCallAdapter,\n capabilities?: ParticipantCapabilities\n ): CommonCallingHandlers &\n /* @conditional-compile-remove(spotlight) */ /* @conditional-compile-remove(soft-mute) */ Partial<_ComponentCallingHandlers> => {\n return {\n onCreateLocalStreamView: async (options) => {\n return await adapter.createStreamView(undefined, options);\n },\n onCreateRemoteStreamView: async (userId, options) => {\n return await adapter.createStreamView(userId, options);\n },\n onHangUp: async (forEveryone?: boolean) => {\n await adapter.leaveCall(forEveryone);\n },\n /* @conditional-compile-remove(PSTN-calls) */\n onToggleHold: async () => {\n return adapter.getState().call?.state === 'LocalHold' ? await adapter.resumeCall() : await adapter.holdCall();\n },\n /* @conditional-compile-remove(PSTN-calls) */\n onAddParticipant: async (\n participant: Partial<CommunicationUserIdentifier & PhoneNumberIdentifier>,\n options?: AddPhoneNumberOptions\n ) => {\n if ('communicationUserId' in participant) {\n return await adapter.addParticipant(participant as CommunicationUserIdentifier);\n } else if ('phoneNumber' in participant) {\n return await adapter.addParticipant(participant as PhoneNumberIdentifier, options);\n }\n },\n onSendDtmfTone: async (dtmfTone: DtmfTone) => {\n await adapter.sendDtmfTone(dtmfTone);\n },\n onRemoveParticipant: async (\n userId: string | /* @conditional-compile-remove(PSTN-calls) */ CommunicationIdentifier\n ) => {\n if (typeof userId === 'string') {\n await adapter.removeParticipant(userId);\n } else {\n /* @conditional-compile-remove(PSTN-calls) */\n await adapter.removeParticipant(_toCommunicationIdentifier(userId));\n }\n },\n onRaiseHand: async () => {\n await adapter.raiseHand();\n },\n onLowerHand: async () => {\n await adapter.lowerHand();\n },\n onToggleRaiseHand: async () => {\n adapter.getState().call?.raiseHand.localParticipantRaisedHand\n ? await adapter.lowerHand()\n : await adapter.raiseHand();\n },\n onReactionClick: async (reaction: Reaction) => {\n await adapter.onReactionClick(reaction);\n },\n onSelectCamera: async (deviceInfo, options) => {\n await adapter.setCamera(deviceInfo, options);\n },\n onSelectMicrophone: async (deviceInfo) => {\n await adapter.setMicrophone(deviceInfo);\n },\n onSelectSpeaker: async (deviceInfo) => {\n await adapter.setSpeaker(deviceInfo);\n },\n onStartCall: (participants, options?) => {\n const rawIds = participants.map((participant) => toFlatCommunicationIdentifier(participant));\n return adapter.startCall(rawIds, options);\n },\n onStartScreenShare: async () => {\n await adapter.startScreenShare();\n },\n onStopScreenShare: async () => {\n await adapter.stopScreenShare();\n },\n onToggleCamera: async (options) => {\n isCameraOn(adapter.getState()) ? await adapter.stopCamera() : await adapter.startCamera(options);\n },\n onToggleMicrophone: async () => {\n return adapter.getState().call?.isMuted ? await adapter.unmute() : await adapter.mute();\n },\n onToggleScreenShare: async () => {\n return adapter.getState().call?.isScreenSharingOn\n ? await adapter.stopScreenShare()\n : await adapter.startScreenShare();\n },\n onStartLocalVideo: async () => {\n if (adapter.getState().call) {\n return adapter.startCamera();\n }\n },\n onDisposeLocalStreamView: async () => {\n return adapter.disposeLocalVideoStreamView();\n },\n onDisposeRemoteStreamView: async (userId) => {\n return adapter.disposeStreamView(userId);\n },\n onDisposeRemoteScreenShareStreamView: async (userId) => {\n return adapter.disposeScreenShareStreamView(userId);\n },\n onDisposeRemoteVideoStreamView: async (userId) => {\n return adapter.disposeRemoteVideoStreamView(userId);\n },\n /* @conditional-compile-remove(call-readiness) */\n askDevicePermission: async (constrain) => {\n return adapter.askDevicePermission(constrain);\n },\n\n onRemoveVideoBackgroundEffects: async () => {\n return await adapter.stopVideoBackgroundEffects();\n },\n\n onBlurVideoBackground: async (backgroundBlurConfig?: BackgroundBlurConfig) => {\n const blurConfig: VideoBackgroundBlurEffect = {\n effectName: 'blur',\n ...backgroundBlurConfig\n };\n return await adapter.startVideoBackgroundEffect(blurConfig);\n },\n\n onReplaceVideoBackground: async (backgroundReplacementConfig: BackgroundReplacementConfig) => {\n const replacementConfig: VideoBackgroundReplacementEffect = {\n effectName: 'replacement',\n ...backgroundReplacementConfig\n };\n return await adapter.startVideoBackgroundEffect(replacementConfig);\n },\n onStartCaptions: async (options) => {\n await adapter.startCaptions(options);\n },\n onStopCaptions: async () => {\n await adapter.stopCaptions();\n },\n onSetSpokenLanguage: async (language) => {\n await adapter.setSpokenLanguage(language);\n },\n onSetCaptionLanguage: async (language) => {\n await adapter.setCaptionLanguage(language);\n },\n onSubmitSurvey: async (survey: CallSurvey): Promise<CallSurveyResponse | undefined> => {\n return await adapter.submitSurvey(survey);\n },\n /* @conditional-compile-remove(spotlight) */\n onStartSpotlight: async (userIds?: string[]): Promise<void> => {\n await adapter.startSpotlight(userIds);\n },\n /* @conditional-compile-remove(spotlight) */\n onStopSpotlight: async (userIds?: string[]): Promise<void> => {\n await adapter.stopSpotlight(userIds);\n },\n /* @conditional-compile-remove(spotlight) */\n onStopAllSpotlight: async (): Promise<void> => {\n await adapter.stopAllSpotlight();\n },\n /* @conditional-compile-remove(spotlight) */\n onStartLocalSpotlight: capabilities?.spotlightParticipant.isPresent\n ? async (): Promise<void> => {\n await adapter.startSpotlight();\n }\n : undefined,\n /* @conditional-compile-remove(spotlight) */\n onStopLocalSpotlight: async (): Promise<void> => {\n await adapter.stopSpotlight();\n },\n /* @conditional-compile-remove(spotlight) */\n onStartRemoteSpotlight: capabilities?.spotlightParticipant.isPresent\n ? async (userIds?: string[]): Promise<void> => {\n await adapter.startSpotlight(userIds);\n }\n : undefined,\n /* @conditional-compile-remove(spotlight) */\n onStopRemoteSpotlight: capabilities?.removeParticipantsSpotlight.isPresent\n ? async (userIds?: string[]): Promise<void> => {\n await adapter.stopSpotlight(userIds);\n }\n : undefined,\n /* @conditional-compile-remove(soft-mute) */\n onMuteParticipant: async (userId: string): Promise<void> => {\n await adapter.muteParticipant(userId);\n }\n };\n }\n);\n"]}
@@ -6,6 +6,6 @@ type Selector = (state: any, props: any) => any;
6
6
  /**
7
7
  * @private
8
8
  */
9
- export declare const usePropsFor: <Component extends (props: any) => JSX.Element>(component: Component) => GetCallingSelector<Component> extends Selector ? ReturnType<GetCallingSelector<Component>> & Common<CallingHandlers & /* @conditional-compile-remove(spotlight) */ _ComponentCallingHandlers, Parameters<Component>[0]> : Record<string, never>;
9
+ export declare const usePropsFor: <Component extends (props: any) => JSX.Element>(component: Component) => GetCallingSelector<Component> extends Selector ? ReturnType<GetCallingSelector<Component>> & Common<CallingHandlers & _ComponentCallingHandlers, Parameters<Component>[0]> : Record<string, never>;
10
10
  export {};
11
11
  //# sourceMappingURL=usePropsFor.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"usePropsFor.js","sourceRoot":"","sources":["../../../../../../../../react-composites/src/composites/CallComposite/hooks/usePropsFor.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAKlC,OAAO,EAAmB,kBAAkB,EAAsB,sDAA6C;AAG/G,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAI5C;;GAEG;AACH,+HAA+H;AAC/H,MAAM,CAAC,MAAM,WAAW,GAAG,CACzB,SAAoB,EAOI,EAAE;IAC1B,MAAM,QAAQ,GAAG,kBAAkB,CAAC,SAAS,CAAC,CAAC;IAC/C,IAAI,CAAC,QAAQ,EAAE,CAAC;QACd,MAAM,IAAI,KAAK,CAAC,8EAA8E,CAAC,CAAC;IAClG,CAAC;IACD,uCAAY,kBAAkB,CAAC,QAAoB,CAAC,GAAK,WAAW,CAAC,SAAS,CAAC,EAAG;AACpF,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\n/* eslint-disable @typescript-eslint/no-explicit-any */\n\nimport { Common } from '@internal/acs-ui-common';\nimport { CallingHandlers, getCallingSelector, GetCallingSelector } from '@internal/calling-component-bindings';\n/* @conditional-compile-remove(spotlight) */\nimport { _ComponentCallingHandlers } from '@internal/calling-component-bindings';\nimport { useAdaptedSelector } from './useAdaptedSelector';\nimport { useHandlers } from './useHandlers';\n\ntype Selector = (state: any, props: any) => any;\n\n/**\n * @private\n */\n// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/explicit-function-return-type\nexport const usePropsFor = <Component extends (props: any) => JSX.Element>(\n component: Component\n): GetCallingSelector<Component> extends Selector\n ? ReturnType<GetCallingSelector<Component>> &\n Common<\n CallingHandlers & /* @conditional-compile-remove(spotlight) */ _ComponentCallingHandlers,\n Parameters<Component>[0]\n >\n : Record<string, never> => {\n const selector = getCallingSelector(component);\n if (!selector) {\n throw new Error(\"Can't find the selector for component, please check supported component list\");\n }\n return { ...useAdaptedSelector(selector as Selector), ...useHandlers(component) };\n};\n"]}
1
+ {"version":3,"file":"usePropsFor.js","sourceRoot":"","sources":["../../../../../../../../react-composites/src/composites/CallComposite/hooks/usePropsFor.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAKlC,OAAO,EAAmB,kBAAkB,EAAsB,sDAA6C;AAG/G,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAI5C;;GAEG;AACH,+HAA+H;AAC/H,MAAM,CAAC,MAAM,WAAW,GAAG,CACzB,SAAoB,EAQI,EAAE;IAC1B,MAAM,QAAQ,GAAG,kBAAkB,CAAC,SAAS,CAAC,CAAC;IAC/C,IAAI,CAAC,QAAQ,EAAE,CAAC;QACd,MAAM,IAAI,KAAK,CAAC,8EAA8E,CAAC,CAAC;IAClG,CAAC;IACD,uCAAY,kBAAkB,CAAC,QAAoB,CAAC,GAAK,WAAW,CAAC,SAAS,CAAC,EAAG;AACpF,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\n/* eslint-disable @typescript-eslint/no-explicit-any */\n\nimport { Common } from '@internal/acs-ui-common';\nimport { CallingHandlers, getCallingSelector, GetCallingSelector } from '@internal/calling-component-bindings';\n/* @conditional-compile-remove(spotlight) */ /* @conditional-compile-remove(soft-mute) */\nimport { _ComponentCallingHandlers } from '@internal/calling-component-bindings';\nimport { useAdaptedSelector } from './useAdaptedSelector';\nimport { useHandlers } from './useHandlers';\n\ntype Selector = (state: any, props: any) => any;\n\n/**\n * @private\n */\n// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/explicit-function-return-type\nexport const usePropsFor = <Component extends (props: any) => JSX.Element>(\n component: Component\n): GetCallingSelector<Component> extends Selector\n ? ReturnType<GetCallingSelector<Component>> &\n Common<\n CallingHandlers &\n /* @conditional-compile-remove(spotlight) */ /* @conditional-compile-remove(soft-mute) */ _ComponentCallingHandlers,\n Parameters<Component>[0]\n >\n : Record<string, never> => {\n const selector = getCallingSelector(component);\n if (!selector) {\n throw new Error(\"Can't find the selector for component, please check supported component list\");\n }\n return { ...useAdaptedSelector(selector as Selector), ...useHandlers(component) };\n};\n"]}
@@ -1,15 +1,10 @@
1
1
  // Copyright (c) Microsoft Corporation.
2
2
  // Licensed under the MIT License.
3
3
  import React from 'react';
4
- /* @conditional-compile-remove(end-of-call-survey) */
5
4
  import { useHandlers } from '../hooks/useHandlers';
6
- /* @conditional-compile-remove(end-of-call-survey) */
7
5
  import { Survey } from '../../common/Survey';
8
- /* @conditional-compile-remove(end-of-call-survey) */
9
6
  import { Stack, mergeStyles } from '@fluentui/react';
10
- /* @conditional-compile-remove(end-of-call-survey) */
11
7
  import { containerStyle } from '../styles/NetworkReconnectTile.styles';
12
- /* @conditional-compile-remove(end-of-call-survey) */
13
8
  import { containerItemGap } from '../styles/NoticePage.styles';
14
9
  /**
15
10
  * Generic page with a title and more details text for serving up a notice to the user.
@@ -18,12 +13,9 @@ import { containerItemGap } from '../styles/NoticePage.styles';
18
13
  */
19
14
  export function SurveyPage(props) {
20
15
  var _a, _b;
21
- /* @conditional-compile-remove(end-of-call-survey) */
22
16
  const handlers = useHandlers(Survey);
23
- /* @conditional-compile-remove(end-of-call-survey) */
24
17
  return (React.createElement(Stack, { verticalFill: true, verticalAlign: "center", horizontalAlign: "center", "data-ui-id": props.dataUiId, "aria-atomic": true },
25
18
  React.createElement(Stack, { className: mergeStyles(containerStyle), tokens: containerItemGap },
26
19
  React.createElement(Survey, Object.assign({}, handlers, props, { onSurveySubmittedCustom: (_a = props.surveyOptions) === null || _a === void 0 ? void 0 : _a.onSurveySubmitted, onSurveyClosed: (_b = props.surveyOptions) === null || _b === void 0 ? void 0 : _b.onSurveyClosed, isMobile: props.mobileView })))));
27
- return React.createElement(React.Fragment, null);
28
20
  }
29
21
  //# sourceMappingURL=SurveyPage.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"SurveyPage.js","sourceRoot":"","sources":["../../../../../../../../react-composites/src/composites/CallComposite/pages/SurveyPage.tsx"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,qDAAqD;AACrD,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AACnD,qDAAqD;AACrD,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAG7C,qDAAqD;AACrD,OAAO,EAAE,KAAK,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AACrD,qDAAqD;AACrD,OAAO,EAAE,cAAc,EAAE,MAAM,uCAAuC,CAAC;AACvE,qDAAqD;AACrD,OAAO,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AA4D/D;;;;GAIG;AACH,MAAM,UAAU,UAAU,CAAC,KAAsB;;IAC/C,qDAAqD;IACrD,MAAM,QAAQ,GAAG,WAAW,CAAC,MAAM,CAAC,CAAC;IACrC,qDAAqD;IACrD,OAAO,CACL,oBAAC,KAAK,IAAC,YAAY,QAAC,aAAa,EAAC,QAAQ,EAAC,eAAe,EAAC,QAAQ,gBAAa,KAAK,CAAC,QAAQ;QAC5F,oBAAC,KAAK,IAAC,SAAS,EAAE,WAAW,CAAC,cAAc,CAAC,EAAE,MAAM,EAAE,gBAAgB;YACrE,oBAAC,MAAM,oBACD,QAAQ,EACR,KAAK,IACT,uBAAuB,EAAE,MAAA,KAAK,CAAC,aAAa,0CAAE,iBAAiB,EAC/D,cAAc,EAAE,MAAA,KAAK,CAAC,aAAa,0CAAE,cAAc,EACnD,QAAQ,EAAE,KAAK,CAAC,UAAU,IAC1B,CACI,CACF,CACT,CAAC;IAEF,OAAO,yCAAK,CAAC;AACf,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport React from 'react';\n/* @conditional-compile-remove(end-of-call-survey) */\nimport { CallSurvey } from '@azure/communication-calling';\n/* @conditional-compile-remove(end-of-call-survey) */\nimport { useHandlers } from '../hooks/useHandlers';\n/* @conditional-compile-remove(end-of-call-survey) */\nimport { Survey } from '../../common/Survey';\n/* @conditional-compile-remove(end-of-call-survey) */\nimport { CallSurveyImprovementSuggestions } from '@internal/react-components';\n/* @conditional-compile-remove(end-of-call-survey) */\nimport { Stack, mergeStyles } from '@fluentui/react';\n/* @conditional-compile-remove(end-of-call-survey) */\nimport { containerStyle } from '../styles/NetworkReconnectTile.styles';\n/* @conditional-compile-remove(end-of-call-survey) */\nimport { containerItemGap } from '../styles/NoticePage.styles';\n/* @conditional-compile-remove(end-of-call-survey) */\nimport { CallCompositeIcons } from '../../common/icons';\n\n/**\n * @private\n */\nexport interface SurveyPageProps {\n /* @conditional-compile-remove(end-of-call-survey) */\n iconName?: keyof CallCompositeIcons;\n /* @conditional-compile-remove(end-of-call-survey) */\n title: string;\n /* @conditional-compile-remove(end-of-call-survey) */\n moreDetails?: string;\n /* @conditional-compile-remove(end-of-call-survey) */\n dataUiId: string;\n /* @conditional-compile-remove(end-of-call-survey) */\n disableStartCallButton?: boolean;\n /* @conditional-compile-remove(end-of-call-survey) */\n mobileView?: boolean;\n /* @conditional-compile-remove(end-of-call-survey) */\n /**\n * Options for end of call survey\n */\n surveyOptions?: {\n /**\n * Disable call survey at the end of a call.\n * @defaultValue false\n */\n disableSurvey?: boolean;\n /**\n * Optional callback to redirect users to custom screens when survey is done, note that default end call screen will be shown if this callback is not provided\n * This callback can be used to redirect users to different screens depending on survey state, whether it is submitted, skipped or has a problem when submitting the survey\n */\n onSurveyClosed?: (surveyState: 'sent' | 'skipped' | 'error', surveyError?: string) => void;\n /**\n * Optional callback to handle survey data including free form text response\n * Note that free form text response survey option is only going to be enabled when this callback is provided\n * User will need to handle all free form text response on their own\n */\n onSurveySubmitted?: (\n callId: string,\n surveyId: string,\n /**\n * This is the survey results containing star survey data and API tag survey data.\n * This part of the result will always be sent to the calling sdk\n * This callback provides user with the ability to gain access to survey data\n */\n submittedSurvey: CallSurvey,\n /**\n * This is the survey results containing free form text\n * This part of the result will not be handled by composites\n * User will need to collect and handle this information 100% on their own\n * Free form text survey is not going to show in the UI if onSurveySubmitted is not populated\n */\n improvementSuggestions: CallSurveyImprovementSuggestions\n ) => Promise<void>;\n };\n}\n\n/**\n * Generic page with a title and more details text for serving up a notice to the user.\n *\n * @private\n */\nexport function SurveyPage(props: SurveyPageProps): JSX.Element {\n /* @conditional-compile-remove(end-of-call-survey) */\n const handlers = useHandlers(Survey);\n /* @conditional-compile-remove(end-of-call-survey) */\n return (\n <Stack verticalFill verticalAlign=\"center\" horizontalAlign=\"center\" data-ui-id={props.dataUiId} aria-atomic>\n <Stack className={mergeStyles(containerStyle)} tokens={containerItemGap}>\n <Survey\n {...handlers}\n {...props}\n onSurveySubmittedCustom={props.surveyOptions?.onSurveySubmitted}\n onSurveyClosed={props.surveyOptions?.onSurveyClosed}\n isMobile={props.mobileView}\n />\n </Stack>\n </Stack>\n );\n\n return <></>;\n}\n"]}
1
+ {"version":3,"file":"SurveyPage.js","sourceRoot":"","sources":["../../../../../../../../react-composites/src/composites/CallComposite/pages/SurveyPage.tsx"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AACnD,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAE7C,OAAO,EAAE,KAAK,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AACrD,OAAO,EAAE,cAAc,EAAE,MAAM,uCAAuC,CAAC;AACvE,OAAO,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AAqD/D;;;;GAIG;AACH,MAAM,UAAU,UAAU,CAAC,KAAsB;;IAC/C,MAAM,QAAQ,GAAG,WAAW,CAAC,MAAM,CAAC,CAAC;IACrC,OAAO,CACL,oBAAC,KAAK,IAAC,YAAY,QAAC,aAAa,EAAC,QAAQ,EAAC,eAAe,EAAC,QAAQ,gBAAa,KAAK,CAAC,QAAQ;QAC5F,oBAAC,KAAK,IAAC,SAAS,EAAE,WAAW,CAAC,cAAc,CAAC,EAAE,MAAM,EAAE,gBAAgB;YACrE,oBAAC,MAAM,oBACD,QAAQ,EACR,KAAK,IACT,uBAAuB,EAAE,MAAA,KAAK,CAAC,aAAa,0CAAE,iBAAiB,EAC/D,cAAc,EAAE,MAAA,KAAK,CAAC,aAAa,0CAAE,cAAc,EACnD,QAAQ,EAAE,KAAK,CAAC,UAAU,IAC1B,CACI,CACF,CACT,CAAC;AACJ,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport React from 'react';\nimport { CallSurvey } from '@azure/communication-calling';\nimport { useHandlers } from '../hooks/useHandlers';\nimport { Survey } from '../../common/Survey';\nimport { CallSurveyImprovementSuggestions } from '@internal/react-components';\nimport { Stack, mergeStyles } from '@fluentui/react';\nimport { containerStyle } from '../styles/NetworkReconnectTile.styles';\nimport { containerItemGap } from '../styles/NoticePage.styles';\nimport { CallCompositeIcons } from '../../common/icons';\n\n/**\n * @private\n */\nexport interface SurveyPageProps {\n iconName?: keyof CallCompositeIcons;\n title: string;\n moreDetails?: string;\n dataUiId: string;\n disableStartCallButton?: boolean;\n mobileView?: boolean;\n\n /**\n * Options for end of call survey\n */\n surveyOptions?: {\n /**\n * Disable call survey at the end of a call.\n * @defaultValue false\n */\n disableSurvey?: boolean;\n /**\n * Optional callback to redirect users to custom screens when survey is done, note that default end call screen will be shown if this callback is not provided\n * This callback can be used to redirect users to different screens depending on survey state, whether it is submitted, skipped or has a problem when submitting the survey\n */\n onSurveyClosed?: (surveyState: 'sent' | 'skipped' | 'error', surveyError?: string) => void;\n /**\n * Optional callback to handle survey data including free form text response\n * Note that free form text response survey option is only going to be enabled when this callback is provided\n * User will need to handle all free form text response on their own\n */\n onSurveySubmitted?: (\n callId: string,\n surveyId: string,\n /**\n * This is the survey results containing star survey data and API tag survey data.\n * This part of the result will always be sent to the calling sdk\n * This callback provides user with the ability to gain access to survey data\n */\n submittedSurvey: CallSurvey,\n /**\n * This is the survey results containing free form text\n * This part of the result will not be handled by composites\n * User will need to collect and handle this information 100% on their own\n * Free form text survey is not going to show in the UI if onSurveySubmitted is not populated\n */\n improvementSuggestions: CallSurveyImprovementSuggestions\n ) => Promise<void>;\n };\n}\n\n/**\n * Generic page with a title and more details text for serving up a notice to the user.\n *\n * @private\n */\nexport function SurveyPage(props: SurveyPageProps): JSX.Element {\n const handlers = useHandlers(Survey);\n return (\n <Stack verticalFill verticalAlign=\"center\" horizontalAlign=\"center\" data-ui-id={props.dataUiId} aria-atomic>\n <Stack className={mergeStyles(containerStyle)} tokens={containerItemGap}>\n <Survey\n {...handlers}\n {...props}\n onSurveySubmittedCustom={props.surveyOptions?.onSurveySubmitted}\n onSurveyClosed={props.surveyOptions?.onSurveyClosed}\n isMobile={props.mobileView}\n />\n </Stack>\n </Stack>\n );\n}\n"]}
@@ -1,27 +1,19 @@
1
1
  // Copyright (c) Microsoft Corporation.
2
2
  // Licensed under the MIT License.
3
3
  import React from 'react';
4
- /* @conditional-compile-remove(end-of-call-survey) */
5
4
  import { mergeStyles, Stack, Text } from '@fluentui/react';
6
- /* @conditional-compile-remove(end-of-call-survey) */
7
5
  import { CallCompositeIcon } from '../../common/icons';
8
- /* @conditional-compile-remove(end-of-call-survey) */
9
6
  import { containerItemGap, containerStyle, titleStyles } from '../styles/NoticePage.styles';
10
- /* @conditional-compile-remove(end-of-call-survey) */
11
7
  import { useLocale } from '../../localization';
12
8
  /**
13
9
  * Page shown after the survey is submitted.
14
10
  * @private
15
11
  */
16
- export function ThankYouForFeedbackPage(
17
- /* @conditional-compile-remove(end-of-call-survey) */ props) {
18
- /* @conditional-compile-remove(end-of-call-survey) */
12
+ export function ThankYouForFeedbackPage(props) {
19
13
  const strings = useLocale().strings.call;
20
- /* @conditional-compile-remove(end-of-call-survey) */
21
14
  return (React.createElement(Stack, { verticalFill: true, verticalAlign: "center", horizontalAlign: "center", "data-ui-id": 'thank-you-page', "aria-atomic": true },
22
15
  React.createElement(Stack, { className: mergeStyles(containerStyle), tokens: containerItemGap },
23
16
  props.iconName && React.createElement(CallCompositeIcon, { iconName: props.iconName }),
24
17
  React.createElement(Text, { className: mergeStyles(titleStyles), "aria-live": "assertive" }, strings.endOfSurveyText))));
25
- return React.createElement(React.Fragment, null);
26
18
  }
27
19
  //# sourceMappingURL=ThankYouForFeedbackPage.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ThankYouForFeedbackPage.js","sourceRoot":"","sources":["../../../../../../../../react-composites/src/composites/CallComposite/pages/ThankYouForFeedbackPage.tsx"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,qDAAqD;AACrD,OAAO,EAAE,WAAW,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AAC3D,qDAAqD;AACrD,OAAO,EAAE,iBAAiB,EAAsB,MAAM,oBAAoB,CAAC;AAC3E,qDAAqD;AACrD,OAAO,EAAE,gBAAgB,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAC5F,qDAAqD;AACrD,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAU/C;;;GAGG;AACH,MAAM,UAAU,uBAAuB;AACrC,qDAAqD,CAAC,KAAmC;IAEzF,qDAAqD;IACrD,MAAM,OAAO,GAAG,SAAS,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC;IACzC,qDAAqD;IACrD,OAAO,CACL,oBAAC,KAAK,IAAC,YAAY,QAAC,aAAa,EAAC,QAAQ,EAAC,eAAe,EAAC,QAAQ,gBAAa,gBAAgB;QAC9F,oBAAC,KAAK,IAAC,SAAS,EAAE,WAAW,CAAC,cAAc,CAAC,EAAE,MAAM,EAAE,gBAAgB;YACpE,KAAK,CAAC,QAAQ,IAAI,oBAAC,iBAAiB,IAAC,QAAQ,EAAE,KAAK,CAAC,QAAQ,GAAI;YAClE,oBAAC,IAAI,IAAC,SAAS,EAAE,WAAW,CAAC,WAAW,CAAC,eAAY,WAAW,IAC7D,OAAO,CAAC,eAAe,CACnB,CACD,CACF,CACT,CAAC;IACF,OAAO,yCAAK,CAAC;AACf,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport React from 'react';\n/* @conditional-compile-remove(end-of-call-survey) */\nimport { mergeStyles, Stack, Text } from '@fluentui/react';\n/* @conditional-compile-remove(end-of-call-survey) */\nimport { CallCompositeIcon, CallCompositeIcons } from '../../common/icons';\n/* @conditional-compile-remove(end-of-call-survey) */\nimport { containerItemGap, containerStyle, titleStyles } from '../styles/NoticePage.styles';\n/* @conditional-compile-remove(end-of-call-survey) */\nimport { useLocale } from '../../localization';\n\n/* @conditional-compile-remove(end-of-call-survey) */\n/**\n * @private\n */\nexport interface ThankYouForFeedbackPageProps {\n iconName?: keyof CallCompositeIcons;\n}\n\n/**\n * Page shown after the survey is submitted.\n * @private\n */\nexport function ThankYouForFeedbackPage(\n /* @conditional-compile-remove(end-of-call-survey) */ props: ThankYouForFeedbackPageProps\n): JSX.Element {\n /* @conditional-compile-remove(end-of-call-survey) */\n const strings = useLocale().strings.call;\n /* @conditional-compile-remove(end-of-call-survey) */\n return (\n <Stack verticalFill verticalAlign=\"center\" horizontalAlign=\"center\" data-ui-id={'thank-you-page'} aria-atomic>\n <Stack className={mergeStyles(containerStyle)} tokens={containerItemGap}>\n {props.iconName && <CallCompositeIcon iconName={props.iconName} />}\n <Text className={mergeStyles(titleStyles)} aria-live=\"assertive\">\n {strings.endOfSurveyText}\n </Text>\n </Stack>\n </Stack>\n );\n return <></>;\n}\n"]}
1
+ {"version":3,"file":"ThankYouForFeedbackPage.js","sourceRoot":"","sources":["../../../../../../../../react-composites/src/composites/CallComposite/pages/ThankYouForFeedbackPage.tsx"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,WAAW,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AAC3D,OAAO,EAAE,iBAAiB,EAAsB,MAAM,oBAAoB,CAAC;AAC3E,OAAO,EAAE,gBAAgB,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAC5F,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAS/C;;;GAGG;AACH,MAAM,UAAU,uBAAuB,CAAC,KAAmC;IACzE,MAAM,OAAO,GAAG,SAAS,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC;IACzC,OAAO,CACL,oBAAC,KAAK,IAAC,YAAY,QAAC,aAAa,EAAC,QAAQ,EAAC,eAAe,EAAC,QAAQ,gBAAa,gBAAgB;QAC9F,oBAAC,KAAK,IAAC,SAAS,EAAE,WAAW,CAAC,cAAc,CAAC,EAAE,MAAM,EAAE,gBAAgB;YACpE,KAAK,CAAC,QAAQ,IAAI,oBAAC,iBAAiB,IAAC,QAAQ,EAAE,KAAK,CAAC,QAAQ,GAAI;YAClE,oBAAC,IAAI,IAAC,SAAS,EAAE,WAAW,CAAC,WAAW,CAAC,eAAY,WAAW,IAC7D,OAAO,CAAC,eAAe,CACnB,CACD,CACF,CACT,CAAC;AACJ,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport React from 'react';\nimport { mergeStyles, Stack, Text } from '@fluentui/react';\nimport { CallCompositeIcon, CallCompositeIcons } from '../../common/icons';\nimport { containerItemGap, containerStyle, titleStyles } from '../styles/NoticePage.styles';\nimport { useLocale } from '../../localization';\n\n/**\n * @private\n */\nexport interface ThankYouForFeedbackPageProps {\n iconName?: keyof CallCompositeIcons;\n}\n\n/**\n * Page shown after the survey is submitted.\n * @private\n */\nexport function ThankYouForFeedbackPage(props: ThankYouForFeedbackPageProps): JSX.Element {\n const strings = useLocale().strings.call;\n return (\n <Stack verticalFill verticalAlign=\"center\" horizontalAlign=\"center\" data-ui-id={'thank-you-page'} aria-atomic>\n <Stack className={mergeStyles(containerStyle)} tokens={containerItemGap}>\n {props.iconName && <CallCompositeIcon iconName={props.iconName} />}\n <Text className={mergeStyles(titleStyles)} aria-live=\"assertive\">\n {strings.endOfSurveyText}\n </Text>\n </Stack>\n </Stack>\n );\n}\n"]}
@@ -19,7 +19,6 @@ import { SidePaneHeader } from '../common/SidePaneHeader';
19
19
  import { useUnreadMessagesTracker } from './ChatButton/useUnreadMessagesTracker';
20
20
  const CallWithChatScreen = (props) => {
21
21
  const { callWithChatAdapter, fluentTheme, formFactor = 'desktop' } = props;
22
- /* @conditional-compile-remove(end-of-call-survey) */
23
22
  const { surveyOptions } = props;
24
23
  const mobileView = formFactor === 'mobile';
25
24
  if (!callWithChatAdapter) {
@@ -134,7 +133,6 @@ const CallWithChatScreen = (props) => {
134
133
  remoteVideoTileMenuOptions: props.remoteVideoTileMenuOptions,
135
134
  galleryOptions: props.galleryOptions,
136
135
  localVideoTile: props.localVideoTile,
137
- /* @conditional-compile-remove(end-of-call-survey) */
138
136
  surveyOptions: surveyOptions,
139
137
  branding: {
140
138
  logo: props.logo,
@@ -159,7 +157,6 @@ const CallWithChatScreen = (props) => {
159
157
  props.galleryOptions,
160
158
  props.localVideoTile,
161
159
  props.remoteVideoTileMenuOptions,
162
- /* @conditional-compile-remove(end-of-call-survey) */
163
160
  surveyOptions,
164
161
  props.logo,
165
162
  props.backgroundImage,
@@ -229,9 +226,7 @@ export const CallWithChatComposite = (props) => {
229
226
  /* @conditional-compile-remove(call-readiness) */
230
227
  deviceChecks: options === null || options === void 0 ? void 0 : options.deviceChecks, callWithChatAdapter: adapter, formFactor: formFactor, callControls: options === null || options === void 0 ? void 0 : options.callControls, joinInvitationURL: joinInvitationURL, fluentTheme: fluentTheme, remoteVideoTileMenuOptions: options === null || options === void 0 ? void 0 : options.remoteVideoTileMenuOptions,
231
228
  /* @conditional-compile-remove(attachment-download) @conditional-compile-remove(attachment-upload) */
232
- attachmentOptions: options === null || options === void 0 ? void 0 : options.attachmentOptions, localVideoTile: options === null || options === void 0 ? void 0 : options.localVideoTile, galleryOptions: options === null || options === void 0 ? void 0 : options.galleryOptions, logo: (_a = options === null || options === void 0 ? void 0 : options.branding) === null || _a === void 0 ? void 0 : _a.logo, backgroundImage: (_b = options === null || options === void 0 ? void 0 : options.branding) === null || _b === void 0 ? void 0 : _b.backgroundImage,
233
- /* @conditional-compile-remove(end-of-call-survey) */
234
- surveyOptions: options === null || options === void 0 ? void 0 : options.surveyOptions,
229
+ attachmentOptions: options === null || options === void 0 ? void 0 : options.attachmentOptions, localVideoTile: options === null || options === void 0 ? void 0 : options.localVideoTile, galleryOptions: options === null || options === void 0 ? void 0 : options.galleryOptions, logo: (_a = options === null || options === void 0 ? void 0 : options.branding) === null || _a === void 0 ? void 0 : _a.logo, backgroundImage: (_b = options === null || options === void 0 ? void 0 : options.branding) === null || _b === void 0 ? void 0 : _b.backgroundImage, surveyOptions: options === null || options === void 0 ? void 0 : options.surveyOptions,
235
230
  /* @conditional-compile-remove(spotlight) */
236
231
  spotlight: options === null || options === void 0 ? void 0 : options.spotlight }))));
237
232
  };