@azure/communication-react 1.14.0-alpha-202403020011 → 1.14.0-alpha-202403050012

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 (54) hide show
  1. package/dist/communication-react.d.ts +23 -0
  2. package/dist/dist-cjs/communication-react/index.js +199 -83
  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/calling-component-bindings/src/handlers/createCommonHandlers.d.ts +1 -0
  7. package/dist/dist-esm/calling-component-bindings/src/handlers/createCommonHandlers.js +6 -0
  8. package/dist/dist-esm/calling-component-bindings/src/handlers/createCommonHandlers.js.map +1 -1
  9. package/dist/dist-esm/react-components/src/components/Survey/TagsSurvey/TagsSurvey.js +6 -10
  10. package/dist/dist-esm/react-components/src/components/Survey/TagsSurvey/TagsSurvey.js.map +1 -1
  11. package/dist/dist-esm/react-composites/src/composites/CallComposite/Strings.d.ts +8 -0
  12. package/dist/dist-esm/react-composites/src/composites/CallComposite/Strings.js.map +1 -1
  13. package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/AzureCommunicationCallAdapter.d.ts +1 -0
  14. package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/AzureCommunicationCallAdapter.js +8 -0
  15. package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/AzureCommunicationCallAdapter.js.map +1 -1
  16. package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/CallAdapter.d.ts +4 -0
  17. package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/CallAdapter.js.map +1 -1
  18. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/CallArrangement.js +72 -23
  19. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/CallArrangement.js.map +1 -1
  20. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/SidePane/SidePane.d.ts +1 -0
  21. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/SidePane/SidePane.js +2 -1
  22. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/SidePane/SidePane.js.map +1 -1
  23. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/SidePane/usePeoplePane.d.ts +1 -0
  24. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/SidePane/usePeoplePane.js +25 -1
  25. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/SidePane/usePeoplePane.js.map +1 -1
  26. package/dist/dist-esm/react-composites/src/composites/CallComposite/hooks/useHandlers.js +4 -0
  27. package/dist/dist-esm/react-composites/src/composites/CallComposite/hooks/useHandlers.js.map +1 -1
  28. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/AzureCommunicationCallWithChatAdapter.d.ts +1 -0
  29. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/AzureCommunicationCallWithChatAdapter.js +6 -0
  30. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/AzureCommunicationCallWithChatAdapter.js.map +1 -1
  31. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/CallWithChatAdapter.d.ts +4 -0
  32. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/CallWithChatAdapter.js.map +1 -1
  33. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/CallWithChatBackedCallAdapter.d.ts +2 -1
  34. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/CallWithChatBackedCallAdapter.js +6 -0
  35. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/CallWithChatBackedCallAdapter.js.map +1 -1
  36. package/dist/dist-esm/react-composites/src/composites/ChatComposite/ChatScreen.js +37 -40
  37. package/dist/dist-esm/react-composites/src/composites/ChatComposite/ChatScreen.js.map +1 -1
  38. package/dist/dist-esm/react-composites/src/composites/ChatComposite/adapter/AzureCommunicationChatAdapter.js +1 -1
  39. package/dist/dist-esm/react-composites/src/composites/ChatComposite/adapter/AzureCommunicationChatAdapter.js.map +1 -1
  40. package/dist/dist-esm/react-composites/src/composites/common/ExitSpotlightButton.js +1 -1
  41. package/dist/dist-esm/react-composites/src/composites/common/ExitSpotlightButton.js.map +1 -1
  42. package/dist/dist-esm/react-composites/src/composites/common/SidePaneHeader.d.ts +3 -0
  43. package/dist/dist-esm/react-composites/src/composites/common/SidePaneHeader.js +6 -1
  44. package/dist/dist-esm/react-composites/src/composites/common/SidePaneHeader.js.map +1 -1
  45. package/dist/dist-esm/react-composites/src/composites/common/TabHeader.d.ts +1 -0
  46. package/dist/dist-esm/react-composites/src/composites/common/TabHeader.js +5 -1
  47. package/dist/dist-esm/react-composites/src/composites/common/TabHeader.js.map +1 -1
  48. package/dist/dist-esm/react-composites/src/composites/common/icons.d.ts +6 -0
  49. package/dist/dist-esm/react-composites/src/composites/common/icons.js +6 -2
  50. package/dist/dist-esm/react-composites/src/composites/common/icons.js.map +1 -1
  51. package/dist/dist-esm/react-composites/src/composites/common/styles/Pane.styles.js +8 -1
  52. package/dist/dist-esm/react-composites/src/composites/common/styles/Pane.styles.js.map +1 -1
  53. package/dist/dist-esm/react-composites/src/composites/localization/locales/en-US/strings.json +2 -0
  54. package/package.json +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"SidePane.js","sourceRoot":"","sources":["../../../../../../../../../react-composites/src/composites/CallComposite/components/SidePane/SidePane.tsx"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,KAAK,EAAE,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AACpD,OAAO,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AACxC,OAAO,EACL,sBAAsB,EACtB,iBAAiB,EACjB,mBAAmB,EACnB,2BAA2B,EAC5B,MAAM,oDAAoD,CAAC;AAC5D,OAAO,EAAE,oBAAoB,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,oCAAoC,CAAC;AAC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G,CACd;gBACA,qBAAqB,IAAI,CACxB,oBAAC,KAAK,CAAC,IAAI,IACT,YAAY,QACZ,MAAM,EACJ,CAAC,CAAA,gBAAgB,aAAhB,gBAAgB,uBAAhB,gBAAgB,CAAE,QAAQ,CAAA,KAAI,gBAAgB,aAAhB,gBAAgB,uBAAhB,gBAAgB,CAAE,0BAA0B,CAAA;wBACzE,CAAC,CAAC,YAAY;wBACd,CAAC,CAAC,2BAA2B;oBAGjC,oBAAC,KAAK,IAAC,MAAM,EAAE,sBAAsB;wBACnC,oBAAC,qBAAqB,OAAG,CACnB,CACG,CACd,CACK,CACG,CACP,CACT,CAAC;AACJ,CAAC,CAAC;AAEF,gEAAgE;AAChE,MAAM,IAAI,GAAG,GAAS,EAAE,GAAE,CAAC,CAAC;AAC5B,MAAM,YAAY,GAAG,GAAgB,EAAE,CAAC,yCAAK,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport React, { useCallback, useMemo } from 'react';\nimport { Stack } from '@fluentui/react';\nimport {\n containerContextStyles,\n paneBodyContainer,\n scrollableContainer,\n scrollableContainerContents\n} from '../../../common/styles/ParticipantContainer.styles';\nimport { availableSpaceStyles, sidePaneStyles, sidePaneTokens } from '../../../common/styles/Pane.styles';\nimport { SidePaneRenderer, useSidePaneContext } from './SidePaneProvider';\nimport { PeopleAndChatHeader } from '../../../common/TabHeader';\nimport { hiddenStyles } from '../../../common/styles/Pane.styles';\n\n/** @private */\nexport interface SidePaneProps {\n updateSidePaneRenderer: (renderer: SidePaneRenderer | undefined) => void;\n mobileView?: boolean;\n maxWidth?: string;\n minWidth?: string;\n\n // legacy arguments to be removed in breaking change\n disablePeopleButton?: boolean;\n disableChatButton?: boolean;\n onChatButtonClicked?: () => void;\n onPeopleButtonClicked?: () => void;\n}\n\n/** @private */\nexport const SidePane = (props: SidePaneProps): JSX.Element => {\n const { sidePaneRenderer, overrideSidePane } = useSidePaneContext();\n const renderingHiddenOverrideContent =\n overrideSidePane?.renderer.contentRenderer &&\n overrideSidePane.persistRenderingWhenClosed &&\n !overrideSidePane.isActive;\n const renderingOnlyHiddenContent = renderingHiddenOverrideContent && !sidePaneRenderer;\n\n const widthConstrainedStyles = useMemo(\n () => sidePaneStyles(props.maxWidth, props.minWidth),\n [props.maxWidth, props.minWidth]\n );\n const paneStyles = renderingOnlyHiddenContent\n ? hiddenStyles\n : props.mobileView\n ? availableSpaceStyles\n : widthConstrainedStyles;\n\n const Header =\n (overrideSidePane?.isActive ? overrideSidePane.renderer.headerRenderer : sidePaneRenderer?.headerRenderer) ??\n EmptyElement;\n\n /**\n * Legacy code to support old behavior of showing chat and people tab headers on mobile side pane.\n * To be removed in breaking change.\n */\n const overrideSidePaneId = overrideSidePane?.isActive ? overrideSidePane.renderer.id : undefined;\n const { updateSidePaneRenderer } = props;\n const closePane = useCallback(() => {\n updateSidePaneRenderer(undefined);\n }, [updateSidePaneRenderer]);\n\n const LegacyHeader = useMemo((): JSX.Element => {\n return (\n <PeopleAndChatHeader\n onClose={overrideSidePaneId === 'chat' ? props.onChatButtonClicked ?? noop : closePane}\n activeTab={sidePaneRenderer?.id === 'people' ? 'people' : 'chat'}\n // legacy arguments to be removed in breaking change:\n disablePeopleButton={props.disablePeopleButton}\n disableChatButton={props.disableChatButton}\n onPeopleButtonClicked={sidePaneRenderer?.id === 'people' ? noop : props.onPeopleButtonClicked}\n onChatButtonClicked={overrideSidePaneId === 'chat' ? noop : props.onChatButtonClicked}\n />\n );\n }, [\n overrideSidePaneId,\n props.onChatButtonClicked,\n props.onPeopleButtonClicked,\n props.disablePeopleButton,\n props.disableChatButton,\n sidePaneRenderer?.id,\n closePane\n ]);\n\n const HeaderToRender =\n props.mobileView && (overrideSidePaneId === 'chat' || sidePaneRenderer?.id === 'people') ? LegacyHeader : Header();\n\n const ContentRender = overrideSidePane?.isActive ? undefined : sidePaneRenderer?.contentRenderer;\n const OverrideContentRender =\n overrideSidePane?.isActive || overrideSidePane?.persistRenderingWhenClosed\n ? overrideSidePane.renderer.contentRenderer\n : undefined;\n\n if (!ContentRender && !OverrideContentRender) {\n return <EmptyElement />;\n }\n\n return (\n <Stack verticalFill grow styles={paneStyles} data-ui-id=\"SidePane\" tokens={props.mobileView ? {} : sidePaneTokens}>\n {HeaderToRender}\n <Stack.Item verticalFill grow styles={paneBodyContainer}>\n <Stack verticalFill styles={scrollableContainer}>\n {ContentRender && (\n <Stack.Item verticalFill styles={scrollableContainerContents}>\n <Stack styles={containerContextStyles}>\n <ContentRender />\n </Stack>\n </Stack.Item>\n )}\n {OverrideContentRender && (\n <Stack.Item\n verticalFill\n styles={\n !overrideSidePane?.isActive && overrideSidePane?.persistRenderingWhenClosed\n ? hiddenStyles\n : scrollableContainerContents\n }\n >\n <Stack styles={containerContextStyles}>\n <OverrideContentRender />\n </Stack>\n </Stack.Item>\n )}\n </Stack>\n </Stack.Item>\n </Stack>\n );\n};\n\n// eslint-disable-next-line @typescript-eslint/no-empty-function\nconst noop = (): void => {};\nconst EmptyElement = (): JSX.Element => <></>;\n"]}
1
+ {"version":3,"file":"SidePane.js","sourceRoot":"","sources":["../../../../../../../../../react-composites/src/composites/CallComposite/components/SidePane/SidePane.tsx"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,KAAK,EAAE,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AACpD,OAAO,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AACxC,OAAO,EACL,sBAAsB,EACtB,iBAAiB,EACjB,mBAAmB,EACnB,2BAA2B,EAC5B,MAAM,oDAAoD,CAAC;AAC5D,OAAO,EAAE,oBAAoB,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,oCAAoC,CAAC;AAC1G,OAAO,EAAoB,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAC1E,OAAO,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAChE,OAAO,EAAE,YAAY,EAAE,MAAM,oCAAo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M,EACJ,CAAC,CAAA,gBAAgB,aAAhB,gBAAgB,uBAAhB,gBAAgB,CAAE,QAAQ,CAAA,KAAI,gBAAgB,aAAhB,gBAAgB,uBAAhB,gBAAgB,CAAE,0BAA0B,CAAA;wBACzE,CAAC,CAAC,YAAY;wBACd,CAAC,CAAC,2BAA2B;oBAGjC,oBAAC,KAAK,IAAC,MAAM,EAAE,sBAAsB;wBACnC,oBAAC,qBAAqB,OAAG,CACnB,CACG,CACd,CACK,CACG,CACP,CACT,CAAC;AACJ,CAAC,CAAC;AAEF,gEAAgE;AAChE,MAAM,IAAI,GAAG,GAAS,EAAE,GAAE,CAAC,CAAC;AAC5B,MAAM,YAAY,GAAG,GAAgB,EAAE,CAAC,yCAAK,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport React, { useCallback, useMemo } from 'react';\nimport { Stack } from '@fluentui/react';\nimport {\n containerContextStyles,\n paneBodyContainer,\n scrollableContainer,\n scrollableContainerContents\n} from '../../../common/styles/ParticipantContainer.styles';\nimport { availableSpaceStyles, sidePaneStyles, sidePaneTokens } from '../../../common/styles/Pane.styles';\nimport { SidePaneRenderer, useSidePaneContext } from './SidePaneProvider';\nimport { PeopleAndChatHeader } from '../../../common/TabHeader';\nimport { hiddenStyles } from '../../../common/styles/Pane.styles';\n\n/** @private */\nexport interface SidePaneProps {\n updateSidePaneRenderer: (renderer: SidePaneRenderer | undefined) => void;\n mobileView?: boolean;\n maxWidth?: string;\n minWidth?: string;\n\n // legacy arguments to be removed in breaking change\n disablePeopleButton?: boolean;\n disableChatButton?: boolean;\n onChatButtonClicked?: () => void;\n onPeopleButtonClicked?: () => void;\n onHeaderMenuClick?: () => void;\n}\n\n/** @private */\nexport const SidePane = (props: SidePaneProps): JSX.Element => {\n const { sidePaneRenderer, overrideSidePane } = useSidePaneContext();\n const renderingHiddenOverrideContent =\n overrideSidePane?.renderer.contentRenderer &&\n overrideSidePane.persistRenderingWhenClosed &&\n !overrideSidePane.isActive;\n const renderingOnlyHiddenContent = renderingHiddenOverrideContent && !sidePaneRenderer;\n\n const widthConstrainedStyles = useMemo(\n () => sidePaneStyles(props.maxWidth, props.minWidth),\n [props.maxWidth, props.minWidth]\n );\n const paneStyles = renderingOnlyHiddenContent\n ? hiddenStyles\n : props.mobileView\n ? availableSpaceStyles\n : widthConstrainedStyles;\n\n const Header =\n (overrideSidePane?.isActive ? overrideSidePane.renderer.headerRenderer : sidePaneRenderer?.headerRenderer) ??\n EmptyElement;\n\n /**\n * Legacy code to support old behavior of showing chat and people tab headers on mobile side pane.\n * To be removed in breaking change.\n */\n const overrideSidePaneId = overrideSidePane?.isActive ? overrideSidePane.renderer.id : undefined;\n const { updateSidePaneRenderer } = props;\n const closePane = useCallback(() => {\n updateSidePaneRenderer(undefined);\n }, [updateSidePaneRenderer]);\n\n const LegacyHeader = useMemo((): JSX.Element => {\n return (\n <PeopleAndChatHeader\n onClose={overrideSidePaneId === 'chat' ? props.onChatButtonClicked ?? noop : closePane}\n activeTab={sidePaneRenderer?.id === 'people' ? 'people' : 'chat'}\n // legacy arguments to be removed in breaking change:\n disablePeopleButton={props.disablePeopleButton}\n disableChatButton={props.disableChatButton}\n onPeopleButtonClicked={sidePaneRenderer?.id === 'people' ? noop : props.onPeopleButtonClicked}\n onChatButtonClicked={overrideSidePaneId === 'chat' ? noop : props.onChatButtonClicked}\n onHeaderMenuClick={props.onHeaderMenuClick}\n />\n );\n }, [\n overrideSidePaneId,\n props.onChatButtonClicked,\n props.onPeopleButtonClicked,\n props.disablePeopleButton,\n props.disableChatButton,\n props.onHeaderMenuClick,\n sidePaneRenderer?.id,\n closePane\n ]);\n\n const HeaderToRender =\n props.mobileView && (overrideSidePaneId === 'chat' || sidePaneRenderer?.id === 'people') ? LegacyHeader : Header();\n\n const ContentRender = overrideSidePane?.isActive ? undefined : sidePaneRenderer?.contentRenderer;\n const OverrideContentRender =\n overrideSidePane?.isActive || overrideSidePane?.persistRenderingWhenClosed\n ? overrideSidePane.renderer.contentRenderer\n : undefined;\n\n if (!ContentRender && !OverrideContentRender) {\n return <EmptyElement />;\n }\n\n return (\n <Stack verticalFill grow styles={paneStyles} data-ui-id=\"SidePane\" tokens={props.mobileView ? {} : sidePaneTokens}>\n {HeaderToRender}\n <Stack.Item verticalFill grow styles={paneBodyContainer}>\n <Stack verticalFill styles={scrollableContainer}>\n {ContentRender && (\n <Stack.Item verticalFill styles={scrollableContainerContents}>\n <Stack styles={containerContextStyles}>\n <ContentRender />\n </Stack>\n </Stack.Item>\n )}\n {OverrideContentRender && (\n <Stack.Item\n verticalFill\n styles={\n !overrideSidePane?.isActive && overrideSidePane?.persistRenderingWhenClosed\n ? hiddenStyles\n : scrollableContainerContents\n }\n >\n <Stack styles={containerContextStyles}>\n <OverrideContentRender />\n </Stack>\n </Stack.Item>\n )}\n </Stack>\n </Stack.Item>\n </Stack>\n );\n};\n\n// eslint-disable-next-line @typescript-eslint/no-empty-function\nconst noop = (): void => {};\nconst EmptyElement = (): JSX.Element => <></>;\n"]}
@@ -17,6 +17,7 @@ export declare const usePeoplePane: (props: {
17
17
  onStopLocalSpotlight?: (() => Promise<void>) | undefined;
18
18
  onStartRemoteSpotlight?: ((userIds?: string[]) => Promise<void>) | undefined;
19
19
  onStopRemoteSpotlight?: ((userIds?: string[]) => Promise<void>) | undefined;
20
+ onStopAllSpotlight?: (() => Promise<void>) | undefined;
20
21
  maxParticipantsToSpotlight?: number | undefined;
21
22
  }) => {
22
23
  openPeoplePane: () => void;
@@ -20,6 +20,8 @@ export const usePeoplePane = (props) => {
20
20
  /* @conditional-compile-remove(spotlight) */
21
21
  onStopRemoteSpotlight,
22
22
  /* @conditional-compile-remove(spotlight) */
23
+ onStopAllSpotlight,
24
+ /* @conditional-compile-remove(spotlight) */
23
25
  maxParticipantsToSpotlight } = props;
24
26
  const closePane = useCallback(() => {
25
27
  var _a;
@@ -27,7 +29,29 @@ export const usePeoplePane = (props) => {
27
29
  (_a = peopleButtonRef === null || peopleButtonRef === void 0 ? void 0 : peopleButtonRef.current) === null || _a === void 0 ? void 0 : _a.focus();
28
30
  }, [peopleButtonRef, updateSidePaneRenderer]);
29
31
  const localeStrings = useLocale().strings.call;
30
- 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]);
32
+ /* @conditional-compile-remove(spotlight) */
33
+ const sidePaneHeaderMenuProps = useMemo(() => {
34
+ const menuItems = [];
35
+ if (onStopAllSpotlight && spotlightedParticipantUserIds && spotlightedParticipantUserIds.length > 0) {
36
+ menuItems.push({
37
+ key: 'stopAllSpotlightKey',
38
+ text: localeStrings.stopAllSpotlightMenuLabel,
39
+ iconProps: { iconName: 'StopAllSpotlightMenuButton', styles: { root: { lineHeight: 0 } } },
40
+ onClick: () => {
41
+ onStopAllSpotlight();
42
+ },
43
+ ariaLabel: localeStrings.stopAllSpotlightMenuLabel
44
+ });
45
+ }
46
+ return {
47
+ items: menuItems
48
+ };
49
+ }, [onStopAllSpotlight, spotlightedParticipantUserIds, localeStrings.stopAllSpotlightMenuLabel]);
50
+ const onRenderHeader = useCallback(() => (React.createElement(SidePaneHeader, { onClose: closePane, headingText: localeStrings.peoplePaneTitle, dismissSidePaneButtonAriaLabel: localeStrings.dismissSidePaneButtonLabel, mobileView: mobileView !== null && mobileView !== void 0 ? mobileView : false,
51
+ /* @conditional-compile-remove(spotlight) */
52
+ moreSidePaneButtonAriaLabel: localeStrings.peoplePaneMoreButtonAriaLabel,
53
+ /* @conditional-compile-remove(spotlight) */
54
+ menuProps: sidePaneHeaderMenuProps })), [mobileView, closePane, localeStrings, /* @conditional-compile-remove(spotlight) */ sidePaneHeaderMenuProps]);
31
55
  /* @conditional-compile-remove(spotlight) */
32
56
  const onFetchParticipantMenuItemsForCallComposite = useCallback((participantId, myUserId, defaultMenuItems) => {
33
57
  const _defaultMenuItems = defaultMenuItems !== null && defaultMenuItems !== void 0 ? defaultMenuItems : [];
@@ -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,KAoB7B,EAIC,EAAE;IACF,MAAM,EACJ,sBAAsB,EACtB,UAAU,EACV,wBAAwB,EACxB,2BAA2B,EAC3B,kBAAkB,EAClB,UAAU,EACV,eAAe;IACf,4CAA4C;IAC5C,6BAA6B;IAC7B,4CAA4C;IAC5C,qBAAqB;IACrB,4CAA4C;IAC5C,oBAAoB;IACpB,4CAA4C;IAC5C,sBAAsB;IACtB,4CAA4C;IAC5C,qBAAqB;IACrB,4CAA4C;IAC5C,0BAA0B,EAC3B,GAAG,KAAK,CAAC;IAEV,MAAM,SAAS,GAAG,WAAW,CAAC,GAAG,EAAE;;QACjC,sBAAsB,CAAC,SAAS,CAAC,CAAC;QAClC,MAAA,eAAe,aAAf,eAAe,uBAAf,eAAe,CAAE,OAAO,0CAAE,KAAK,EAAE,CAAC;IACpC,CAAC,EAAE,CAAC,eAAe,EAAE,sBAAsB,CAAC,CAAC,CAAC;IAE9C,MAAM,aAAa,GAAG,SAAS,EAAE,CAAC,OAA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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 } 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 /* @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 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 /* @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 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 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.stopSpotlightOnSelfParticipantListMenuLabel\n : localeStrings.stopSpotlightParticipantListMenuLabel;\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.addSpotlightParticipantListMenuLabel\n : localeStrings.startSpotlightParticipantListMenuLabel;\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\n ? localeStrings.spotlightLimitReachedParticipantListMenuTitle\n : 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.stopSpotlightParticipantListMenuLabel,\n localeStrings.stopSpotlightOnSelfParticipantListMenuLabel,\n localeStrings.addSpotlightParticipantListMenuLabel,\n localeStrings.startSpotlightParticipantListMenuLabel,\n localeStrings.spotlightLimitReachedParticipantListMenuTitle,\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 />\n );\n }, [inviteLink, mobileView, onFetchAvatarPersonaData, _onFetchParticipantMenuItems, setDrawerMenuItems]);\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;AAC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AqB,OAAO,CAChD,GAAG,EAAE,CAAC,CAAC;QACL,cAAc,EAAE,cAAc;QAC9B,eAAe,EAAE,eAAe;QAChC,EAAE,EAAE,mBAAmB;KACxB,CAAC,EACF,CAAC,eAAe,EAAE,cAAc,CAAC,CAClC,CAAC;IAEF,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 /* @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 /* @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 /* @conditional-compile-remove(spotlight) */\n moreSidePaneButtonAriaLabel={localeStrings.peoplePaneMoreButtonAriaLabel}\n /* @conditional-compile-remove(spotlight) */\n menuProps={sidePaneHeaderMenuProps}\n />\n ),\n [mobileView, closePane, localeStrings, /* @conditional-compile-remove(spotlight) */ sidePaneHeaderMenuProps]\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.stopSpotlightOnSelfParticipantListMenuLabel\n : localeStrings.stopSpotlightParticipantListMenuLabel;\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.addSpotlightParticipantListMenuLabel\n : localeStrings.startSpotlightParticipantListMenuLabel;\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\n ? localeStrings.spotlightLimitReachedParticipantListMenuTitle\n : 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.stopSpotlightParticipantListMenuLabel,\n localeStrings.stopSpotlightOnSelfParticipantListMenuLabel,\n localeStrings.addSpotlightParticipantListMenuLabel,\n localeStrings.startSpotlightParticipantListMenuLabel,\n localeStrings.spotlightLimitReachedParticipantListMenuTitle,\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 />\n );\n }, [inviteLink, mobileView, onFetchAvatarPersonaData, _onFetchParticipantMenuItems, setDrawerMenuItems]);\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"]}
@@ -186,6 +186,10 @@ const createCompositeHandlers = memoizeOne((adapter) => {
186
186
  yield adapter.stopSpotlight(userIds);
187
187
  }),
188
188
  /* @conditional-compile-remove(spotlight) */
189
+ onStopAllSpotlight: () => __awaiter(void 0, void 0, void 0, function* () {
190
+ yield adapter.stopAllSpotlight();
191
+ }),
192
+ /* @conditional-compile-remove(spotlight) */
189
193
  onStartLocalSpotlight: () => __awaiter(void 0, void 0, void 0, function* () {
190
194
  yield adapter.startSpotlight();
191
195
  }),
@@ -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,aA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AAC,CAAC;QAC7C,CAAC,CAAA;QACD,qDAAqD;QACrD,cAAc,EAAE,CAAO,MAAkB,EAA2C,EAAE;YACpF,OAAO,MAAM,OAAO,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC;QAC5C,CAAC,CAAA;QACD,4CAA4C;QAC5C,gBAAgB,EAAE,CAAO,OAAkB,EAAiB,EAAE;YAC5D,MAAM,OAAO,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC;QACxC,CAAC,CAAA;QACD,4CAA4C;QAC5C,eAAe,EAAE,CAAO,OAAkB,EAAiB,EAAE;YAC3D,MAAM,OAAO,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC;QACvC,CAAC,CAAA;QACD,4CAA4C;QAC5C,qBAAqB,EAAE,GAAwB,EAAE;YAC/C,MAAM,OAAO,CAAC,cAAc,EAAE,CAAC;QACjC,CAAC,CAAA;QACD,4CAA4C;QAC5C,oBAAoB,EAAE,GAAwB,EAAE;YAC9C,MAAM,OAAO,CAAC,aAAa,EAAE,CAAC;QAChC,CAAC,CAAA;QACD,4CAA4C;QAC5C,sBAAsB,EAAE,CAAO,OAAkB,EAAiB,EAAE;YAClE,MAAM,OAAO,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC;QACxC,CAAC,CAAA;QACD,4CAA4C;QAC5C,qBAAqB,EAAE,CAAO,OAAkB,EAAiB,EAAE;YACjE,MAAM,OAAO,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC;QACvC,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) */\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/* @conditional-compile-remove(video-background-effects) */\nimport { VideoBackgroundBlurEffect, VideoBackgroundReplacementEffect } from '..';\nimport { useAdapter } from '../adapter/CallAdapterProvider';\nimport { isCameraOn } from '../utils';\n/* @conditional-compile-remove(PSTN-calls) */ /* @conditional-compile-remove(dtmf-dialer) */\nimport { DtmfTone } from '@azure/communication-calling';\n/* @conditional-compile-remove(PSTN-calls) */\nimport { AddPhoneNumberOptions } from '@azure/communication-calling';\n/* @conditional-compile-remove(reaction) */\nimport { Reaction } from '@azure/communication-calling';\n/* @conditional-compile-remove(video-background-effects) */\nimport type { BackgroundReplacementConfig, BackgroundBlurConfig } 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 compositeHandlers = createCompositeHandlers(adapter);\n /* @conditional-compile-remove(spotlight) */\n const canSpotlight = adapter.getState().call?.capabilitiesFeature?.capabilities.spotlightParticipant.isPresent;\n /* @conditional-compile-remove(spotlight) */\n return {\n ...compositeHandlers,\n ...(canSpotlight\n ? {}\n : { onStartLocalSpotlight: undefined, onStartRemoteSpotlight: undefined, onStopRemoteSpotlight: undefined })\n };\n return compositeHandlers;\n};\n\nconst createCompositeHandlers = memoizeOne(\n (\n adapter: CommonCallAdapter\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 /* @conditional-compile-remove(PSTN-calls) */ /* @conditional-compile-remove(dtmf-dialer) */\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 /* @conditional-compile-remove(raise-hand) */\n onRaiseHand: async () => {\n await adapter.raiseHand();\n },\n /* @conditional-compile-remove(raise-hand) */\n onLowerHand: async () => {\n await adapter.lowerHand();\n },\n /* @conditional-compile-remove(raise-hand) */\n onToggleRaiseHand: async () => {\n adapter.getState().call?.raiseHand.localParticipantRaisedHand\n ? await adapter.lowerHand()\n : await adapter.raiseHand();\n },\n /* @conditional-compile-remove(reaction) */\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 /* @conditional-compile-remove(video-background-effects) */\n onRemoveVideoBackgroundEffects: async () => {\n return await adapter.stopVideoBackgroundEffects();\n },\n /* @conditional-compile-remove(video-background-effects) */\n onBlurVideoBackground: async (backgroundBlurConfig?: BackgroundBlurConfig) => {\n const blurConfig: VideoBackgroundBlurEffect = {\n effectName: 'blur',\n ...backgroundBlurConfig\n };\n return await adapter.startVideoBackgroundEffect(blurConfig);\n },\n /* @conditional-compile-remove(video-background-effects) */\n onReplaceVideoBackground: async (backgroundReplacementConfig: BackgroundReplacementConfig) => {\n const replacementConfig: VideoBackgroundReplacementEffect = {\n effectName: 'replacement',\n ...backgroundReplacementConfig\n };\n return await adapter.startVideoBackgroundEffect(replacementConfig);\n },\n /* @conditional-compile-remove(close-captions) */\n onStartCaptions: async (options) => {\n await adapter.startCaptions(options);\n },\n /* @conditional-compile-remove(close-captions) */\n onStopCaptions: async () => {\n await adapter.stopCaptions();\n },\n /* @conditional-compile-remove(close-captions) */\n onSetSpokenLanguage: async (language) => {\n await adapter.setSpokenLanguage(language);\n },\n /* @conditional-compile-remove(close-captions) */\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 onStartLocalSpotlight: async (): Promise<void> => {\n await adapter.startSpotlight();\n },\n /* @conditional-compile-remove(spotlight) */\n onStopLocalSpotlight: async (): Promise<void> => {\n await adapter.stopSpotlight();\n },\n /* @conditional-compile-remove(spotlight) */\n onStartRemoteSpotlight: async (userIds?: string[]): Promise<void> => {\n await adapter.startSpotlight(userIds);\n },\n /* @conditional-compile-remove(spotlight) */\n onStopRemoteSpotlight: async (userIds?: string[]): Promise<void> => {\n await adapter.stopSpotlight(userIds);\n }\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;A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AC,kBAAkB,CAAC,QAAQ,CAAC,CAAC;QAC7C,CAAC,CAAA;QACD,qDAAqD;QACrD,cAAc,EAAE,CAAO,MAAkB,EAA2C,EAAE;YACpF,OAAO,MAAM,OAAO,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC;QAC5C,CAAC,CAAA;QACD,4CAA4C;QAC5C,gBAAgB,EAAE,CAAO,OAAkB,EAAiB,EAAE;YAC5D,MAAM,OAAO,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC;QACxC,CAAC,CAAA;QACD,4CAA4C;QAC5C,eAAe,EAAE,CAAO,OAAkB,EAAiB,EAAE;YAC3D,MAAM,OAAO,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC;QACvC,CAAC,CAAA;QACD,4CAA4C;QAC5C,kBAAkB,EAAE,GAAwB,EAAE;YAC5C,MAAM,OAAO,CAAC,gBAAgB,EAAE,CAAC;QACnC,CAAC,CAAA;QACD,4CAA4C;QAC5C,qBAAqB,EAAE,GAAwB,EAAE;YAC/C,MAAM,OAAO,CAAC,cAAc,EAAE,CAAC;QACjC,CAAC,CAAA;QACD,4CAA4C;QAC5C,oBAAoB,EAAE,GAAwB,EAAE;YAC9C,MAAM,OAAO,CAAC,aAAa,EAAE,CAAC;QAChC,CAAC,CAAA;QACD,4CAA4C;QAC5C,sBAAsB,EAAE,CAAO,OAAkB,EAAiB,EAAE;YAClE,MAAM,OAAO,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC;QACxC,CAAC,CAAA;QACD,4CAA4C;QAC5C,qBAAqB,EAAE,CAAO,OAAkB,EAAiB,EAAE;YACjE,MAAM,OAAO,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC;QACvC,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) */\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/* @conditional-compile-remove(video-background-effects) */\nimport { VideoBackgroundBlurEffect, VideoBackgroundReplacementEffect } from '..';\nimport { useAdapter } from '../adapter/CallAdapterProvider';\nimport { isCameraOn } from '../utils';\n/* @conditional-compile-remove(PSTN-calls) */ /* @conditional-compile-remove(dtmf-dialer) */\nimport { DtmfTone } from '@azure/communication-calling';\n/* @conditional-compile-remove(PSTN-calls) */\nimport { AddPhoneNumberOptions } from '@azure/communication-calling';\n/* @conditional-compile-remove(reaction) */\nimport { Reaction } from '@azure/communication-calling';\n/* @conditional-compile-remove(video-background-effects) */\nimport type { BackgroundReplacementConfig, BackgroundBlurConfig } 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 compositeHandlers = createCompositeHandlers(adapter);\n /* @conditional-compile-remove(spotlight) */\n const canSpotlight = adapter.getState().call?.capabilitiesFeature?.capabilities.spotlightParticipant.isPresent;\n /* @conditional-compile-remove(spotlight) */\n return {\n ...compositeHandlers,\n ...(canSpotlight\n ? {}\n : { onStartLocalSpotlight: undefined, onStartRemoteSpotlight: undefined, onStopRemoteSpotlight: undefined })\n };\n return compositeHandlers;\n};\n\nconst createCompositeHandlers = memoizeOne(\n (\n adapter: CommonCallAdapter\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 /* @conditional-compile-remove(PSTN-calls) */ /* @conditional-compile-remove(dtmf-dialer) */\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 /* @conditional-compile-remove(raise-hand) */\n onRaiseHand: async () => {\n await adapter.raiseHand();\n },\n /* @conditional-compile-remove(raise-hand) */\n onLowerHand: async () => {\n await adapter.lowerHand();\n },\n /* @conditional-compile-remove(raise-hand) */\n onToggleRaiseHand: async () => {\n adapter.getState().call?.raiseHand.localParticipantRaisedHand\n ? await adapter.lowerHand()\n : await adapter.raiseHand();\n },\n /* @conditional-compile-remove(reaction) */\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 /* @conditional-compile-remove(video-background-effects) */\n onRemoveVideoBackgroundEffects: async () => {\n return await adapter.stopVideoBackgroundEffects();\n },\n /* @conditional-compile-remove(video-background-effects) */\n onBlurVideoBackground: async (backgroundBlurConfig?: BackgroundBlurConfig) => {\n const blurConfig: VideoBackgroundBlurEffect = {\n effectName: 'blur',\n ...backgroundBlurConfig\n };\n return await adapter.startVideoBackgroundEffect(blurConfig);\n },\n /* @conditional-compile-remove(video-background-effects) */\n onReplaceVideoBackground: async (backgroundReplacementConfig: BackgroundReplacementConfig) => {\n const replacementConfig: VideoBackgroundReplacementEffect = {\n effectName: 'replacement',\n ...backgroundReplacementConfig\n };\n return await adapter.startVideoBackgroundEffect(replacementConfig);\n },\n /* @conditional-compile-remove(close-captions) */\n onStartCaptions: async (options) => {\n await adapter.startCaptions(options);\n },\n /* @conditional-compile-remove(close-captions) */\n onStopCaptions: async () => {\n await adapter.stopCaptions();\n },\n /* @conditional-compile-remove(close-captions) */\n onSetSpokenLanguage: async (language) => {\n await adapter.setSpokenLanguage(language);\n },\n /* @conditional-compile-remove(close-captions) */\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: async (): Promise<void> => {\n await adapter.startSpotlight();\n },\n /* @conditional-compile-remove(spotlight) */\n onStopLocalSpotlight: async (): Promise<void> => {\n await adapter.stopSpotlight();\n },\n /* @conditional-compile-remove(spotlight) */\n onStartRemoteSpotlight: async (userIds?: string[]): Promise<void> => {\n await adapter.startSpotlight(userIds);\n },\n /* @conditional-compile-remove(spotlight) */\n onStopRemoteSpotlight: async (userIds?: string[]): Promise<void> => {\n await adapter.stopSpotlight(userIds);\n }\n };\n }\n);\n"]}
@@ -143,6 +143,7 @@ export declare class AzureCommunicationCallWithChatAdapter implements CallWithCh
143
143
  submitSurvey(survey: CallSurvey): Promise<CallSurveyResponse | undefined>;
144
144
  startSpotlight(userIds?: string[]): Promise<void>;
145
145
  stopSpotlight(userIds?: string[]): Promise<void>;
146
+ stopAllSpotlight(): Promise<void>;
146
147
  on(event: 'callParticipantsJoined', listener: ParticipantsJoinedListener): void;
147
148
  on(event: 'callParticipantsLeft', listener: ParticipantsLeftListener): void;
148
149
  on(event: 'callEnded', listener: CallEndedListener): void;
@@ -515,6 +515,12 @@ export class AzureCommunicationCallWithChatAdapter {
515
515
  return this.callAdapter.stopSpotlight(userIds);
516
516
  });
517
517
  }
518
+ /* @conditional-compile-remove(spotlight) */
519
+ stopAllSpotlight() {
520
+ return __awaiter(this, void 0, void 0, function* () {
521
+ return this.callAdapter.stopAllSpotlight();
522
+ });
523
+ }
518
524
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
519
525
  on(event, listener) {
520
526
  switch (event) {