@azure/communication-react 1.3.3-alpha-202208280018.0 → 1.3.3-alpha-202209010016.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/communication-react.d.ts +25 -5
- package/dist/dist-cjs/communication-react/index.js +139 -80
- package/dist/dist-cjs/communication-react/index.js.map +1 -1
- package/dist/dist-esm/acs-ui-common/src/telemetryVersion.js +1 -1
- package/dist/dist-esm/acs-ui-common/src/telemetryVersion.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/Announcer.d.ts +2 -2
- package/dist/dist-esm/react-components/src/components/Announcer.js +1 -1
- package/dist/dist-esm/react-components/src/components/Announcer.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/Dialpad/Dialpad.d.ts +2 -0
- package/dist/dist-esm/react-components/src/components/Dialpad/Dialpad.js +4 -4
- package/dist/dist-esm/react-components/src/components/Dialpad/Dialpad.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/Drawer/DrawerMenuItem.js +1 -1
- package/dist/dist-esm/react-components/src/components/Drawer/DrawerMenuItem.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/index.d.ts +2 -0
- package/dist/dist-esm/react-components/src/components/index.js +1 -0
- package/dist/dist-esm/react-components/src/components/index.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/styles/Dialpad.styles.js +3 -0
- package/dist/dist-esm/react-components/src/components/styles/Dialpad.styles.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/utils/useLongPress.d.ts +1 -1
- package/dist/dist-esm/react-components/src/components/utils/useLongPress.js +8 -1
- package/dist/dist-esm/react-components/src/components/utils/useLongPress.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/Strings.d.ts +4 -0
- package/dist/dist-esm/react-composites/src/composites/CallComposite/Strings.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/components/CallArrangement.js +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/components/CallArrangement.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/components/CallControls.js +21 -18
- package/dist/dist-esm/react-composites/src/composites/CallComposite/components/CallControls.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/components/CallPane.d.ts +2 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/components/CallPane.js +3 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/components/CallPane.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/components/HoldPane.js +3 -6
- package/dist/dist-esm/react-composites/src/composites/CallComposite/components/HoldPane.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/styles/HoldPane.styles.js +8 -5
- package/dist/dist-esm/react-composites/src/composites/CallComposite/styles/HoldPane.styles.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/utils/Utils.d.ts +10 -0
- package/dist/dist-esm/react-composites/src/composites/CallComposite/utils/Utils.js +31 -4
- package/dist/dist-esm/react-composites/src/composites/CallComposite/utils/Utils.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/CallWithChatComposite.d.ts +15 -5
- package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/CallWithChatComposite.js +7 -4
- package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/CallWithChatComposite.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/CallWithChatControlBar.d.ts +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/CallWithChatControlBar.js +6 -5
- package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/CallWithChatControlBar.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/CallWithChatPane.d.ts +2 -0
- package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/CallWithChatPane.js +3 -1
- package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/CallWithChatPane.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/PreparedMoreDrawer.d.ts +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/PreparedMoreDrawer.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/Strings.d.ts +4 -0
- package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/Strings.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/components/MoreDrawer.js +10 -5
- package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/components/MoreDrawer.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/common/AddPeopleDropdown.d.ts +1 -0
- package/dist/dist-esm/react-composites/src/composites/common/AddPeopleDropdown.js +17 -6
- package/dist/dist-esm/react-composites/src/composites/common/AddPeopleDropdown.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/common/CallingDialpad.js +1 -1
- package/dist/dist-esm/react-composites/src/composites/common/CallingDialpad.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/common/CallingDialpad.styles.js +0 -1
- package/dist/dist-esm/react-composites/src/composites/common/CallingDialpad.styles.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/common/SendDtmfDialpad.js +7 -3
- package/dist/dist-esm/react-composites/src/composites/common/SendDtmfDialpad.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/common/TabHeader.d.ts +2 -0
- package/dist/dist-esm/react-composites/src/composites/common/TabHeader.js +2 -2
- package/dist/dist-esm/react-composites/src/composites/common/TabHeader.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/localization/locales/en-US/strings.json +7 -5
- package/package.json +8 -8
package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/CallWithChatComposite.js
CHANGED
@@ -133,6 +133,8 @@ const CallWithChatScreen = (props) => {
|
|
133
133
|
dialpadCloseModalButtonAriaLabel: callWithChatStrings.dialpadCloseModalButtonAriaLabel,
|
134
134
|
placeholderText: callWithChatStrings.dtmfDialpadPlaceHolderText
|
135
135
|
}), [callWithChatStrings]);
|
136
|
+
/* @conditional-compile-remove(PSTN-calls) */
|
137
|
+
const alternateCallerId = callAdapter.getState().alternateCallerId;
|
136
138
|
return (React.createElement("div", { ref: containerRef, className: mergeStyles(containerDivStyles) },
|
137
139
|
React.createElement(Stack, { verticalFill: true, grow: true, styles: compositeOuterContainerStyles, id: compositeParentDivId },
|
138
140
|
React.createElement(Stack, { horizontal: true, grow: true },
|
@@ -142,20 +144,20 @@ const CallWithChatScreen = (props) => {
|
|
142
144
|
React.createElement(CallComposite, Object.assign({}, props, { formFactor: formFactor, options: { callControls: false }, adapter: callAdapter, fluentTheme: fluentTheme }))),
|
143
145
|
chatProps.adapter && callAdapter && hasJoinedCall && (React.createElement(CallWithChatPane, { chatCompositeProps: chatProps, inviteLink: props.joinInvitationURL, onClose: closePane, chatAdapter: chatProps.adapter, callAdapter: callAdapter, onFetchAvatarPersonaData: props.onFetchAvatarPersonaData, onFetchParticipantMenuItems: props.onFetchParticipantMenuItems, onChatButtonClicked: showShowChatTabHeaderButton(props.callControls) ? selectChat : undefined, onPeopleButtonClicked: showShowPeopleTabHeaderButton(props.callControls) ? selectPeople : undefined, modalLayerHostId: modalLayerHostId, mobileView: mobileView, activePane: activePane,
|
144
146
|
/* @conditional-compile-remove(file-sharing) */
|
145
|
-
fileSharing: props.fileSharing, rtl: props.rtl }))),
|
147
|
+
fileSharing: props.fileSharing, rtl: props.rtl, callControls: typeof props.callControls !== 'boolean' ? props.callControls : undefined }))),
|
146
148
|
showControlBar && !isMobileWithActivePane && (React.createElement(ChatAdapterProvider, { adapter: chatProps.adapter },
|
147
149
|
React.createElement(Stack.Item, { styles: controlBarContainerStyles },
|
148
150
|
React.createElement(CallWithChatControlBar, { callAdapter: callAdapter, chatAdapter: chatProps.adapter, chatButtonChecked: activePane === 'chat', onChatButtonClicked: toggleChat, peopleButtonChecked: activePane === 'people', onPeopleButtonClicked: togglePeople, onMoreButtonClicked: onMoreButtonClicked, mobileView: mobileView, disableButtonsForLobbyPage: isInLobbyOrConnecting,
|
149
151
|
/* @conditional-compile-remove(PSTN-calls) */ /* @conditional-compile-remove(one-to-n-calling) */
|
150
152
|
disableButtonsForHoldScreen: isInLocalHold, callControls: props.callControls, containerHeight: containerHeight, containerWidth: containerWidth,
|
151
153
|
/* @conditional-compile-remove(PSTN-calls) */
|
152
|
-
onClickShowDialpad: onClickShowDialpad })))),
|
154
|
+
onClickShowDialpad: alternateCallerId ? onClickShowDialpad : undefined })))),
|
153
155
|
showControlBar && showDrawer && (React.createElement(ChatAdapterProvider, { adapter: chatProps.adapter },
|
154
156
|
React.createElement(CallAdapterProvider, { adapter: callAdapter },
|
155
157
|
React.createElement(Stack, { styles: drawerContainerStyles },
|
156
158
|
React.createElement(PreparedMoreDrawer, { callControls: props.callControls, onLightDismiss: closeDrawer, onPeopleButtonClicked: onMoreDrawerPeopleClicked,
|
157
159
|
/* @conditional-compile-remove(PSTN-calls) */
|
158
|
-
onClickShowDialpad: onClickShowDialpad,
|
160
|
+
onClickShowDialpad: alternateCallerId ? onClickShowDialpad : undefined,
|
159
161
|
/* @conditional-compile-remove(PSTN-calls) */ /* @conditional-compile-remove(one-to-n-calling) */
|
160
162
|
disableButtonsForHoldScreen: isInLocalHold }))))),
|
161
163
|
/* @conditional-compile-remove(PSTN-calls) */
|
@@ -182,7 +184,8 @@ export const CallWithChatComposite = (props) => {
|
|
182
184
|
};
|
183
185
|
const hasJoinedCallFn = (page, callStatus) => {
|
184
186
|
/* @conditional-compile-remove(one-to-n-calling) */ /* @conditional-compile-remove(one-to-n-calling) */
|
185
|
-
return (page === 'call' && callStatus === 'Connected'
|
187
|
+
return ((page === 'call' && (callStatus === 'Connected' || callStatus === 'RemoteHold')) ||
|
188
|
+
(page === 'hold' && callStatus === 'LocalHold'));
|
186
189
|
return page === 'call' && callStatus === 'Connected';
|
187
190
|
};
|
188
191
|
const showShowChatTabHeaderButton = (callControls) => {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"CallWithChatComposite.js","sourceR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,KAAK,WAAW,CAAC;AACvD,CAAC,CAAC;AAEF,MAAM,2BAA2B,GAAG,CAAC,YAAmD,EAAW,EAAE;IACnG,IAAI,YAAY,KAAK,SAAS,IAAI,YAAY,KAAK,IAAI,EAAE;QACvD,OAAO,IAAI,CAAC;KACb;IACD,IAAI,YAAY,KAAK,KAAK,EAAE;QAC1B,OAAO,KAAK,CAAC;KACd;IACD,OAAO,YAAY,CAAC,UAAU,KAAK,KAAK,CAAC;AAC3C,CAAC,CAAC;AAEF,MAAM,6BAA6B,GAAG,CAAC,YAAmD,EAAW,EAAE;IACrG,IAAI,YAAY,KAAK,SAAS,IAAI,YAAY,KAAK,IAAI,EAAE;QACvD,OAAO,IAAI,CAAC;KACb;IACD,IAAI,YAAY,KAAK,KAAK,EAAE;QAC1B,OAAO,KAAK,CAAC;KACd;IACD,OAAO,YAAY,CAAC,YAAY,KAAK,KAAK,CAAC;AAC7C,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport React, { useCallback, useState, useMemo, useEffect, useRef } from 'react';\nimport { LayerHost, mergeStyles, PartialTheme, Stack, Theme } from '@fluentui/react';\nimport { CallComposite, CallCompositePage, CallControlDisplayType } from '../CallComposite';\nimport { CallAdapterProvider } from '../CallComposite/adapter/CallAdapterProvider';\nimport { CallWithChatControlBar } from './CallWithChatControlBar';\nimport { CallState } from '@azure/communication-calling';\nimport {\n callCompositeContainerStyles,\n compositeOuterContainerStyles,\n controlBarContainerStyles,\n drawerContainerStyles\n} from './styles/CallWithChatCompositeStyles';\nimport { CallWithChatAdapter } from './adapter/CallWithChatAdapter';\nimport { CallWithChatBackedCallAdapter } from './adapter/CallWithChatBackedCallAdapter';\nimport { CallWithChatBackedChatAdapter } from './adapter/CallWithChatBackedChatAdapter';\nimport { CallAdapter } from '../CallComposite';\nimport { ChatCompositeProps } from '../ChatComposite';\nimport { BaseProvider, BaseCompositeProps } from '../common/BaseComposite';\nimport { CallWithChatCompositeIcons } from '../common/icons';\nimport { AvatarPersonaDataCallback } from '../common/AvatarPersona';\nimport { ChatAdapterProvider } from '../ChatComposite/adapter/ChatAdapterProvider';\nimport { CallWithChatAdapterState } from './state/CallWithChatAdapterState';\nimport { PreparedMoreDrawer } from './PreparedMoreDrawer';\nimport { ParticipantMenuItemsCallback, _useContainerHeight, _useContainerWidth } from '@internal/react-components';\nimport { useId } from '@fluentui/react-hooks';\nimport { CallWithChatPane, CallWithChatPaneOption } from './CallWithChatPane';\n/* @conditional-compile-remove(file-sharing) */\nimport { FileSharingOptions } from '../ChatComposite';\nimport { containerDivStyles } from '../common/ContainerRectProps';\n/* @conditional-compile-remove(control-bar-button-injection) */\nimport { CustomCallWithChatControlButtonCallback } from './CustomButton';\nimport { modalLayerHostStyle } from '../common/styles/ModalLocalAndRemotePIP.styles';\n/* @conditional-compile-remove(PSTN-calls) */\nimport { SendDtmfDialpad } from '../common/SendDtmfDialpad';\n/* @conditional-compile-remove(PSTN-calls) */\nimport { useCallWithChatCompositeStrings } from './hooks/useCallWithChatCompositeStrings';\n\n/**\n * Props required for the {@link CallWithChatComposite}\n *\n * @public\n */\nexport interface CallWithChatCompositeProps extends BaseCompositeProps<CallWithChatCompositeIcons> {\n adapter: CallWithChatAdapter;\n /**\n * Fluent theme for the composite.\n *\n * Defaults to a light theme if undefined.\n */\n fluentTheme?: PartialTheme | Theme;\n /**\n * Optimizes the composite form factor for either desktop or mobile.\n * @remarks `mobile` is currently only optimized for Portrait mode on mobile devices and does not support landscape.\n * @defaultValue 'desktop'\n */\n formFactor?: 'desktop' | 'mobile';\n /**\n * URL that can be used to copy a call-with-chat invite to the Users clipboard.\n */\n joinInvitationURL?: string;\n /**\n * Flags to enable/disable or customize UI elements of the {@link CallWithChatComposite}\n */\n options?: CallWithChatCompositeOptions;\n}\n\n/**\n * Optional features of the {@link CallWithChatComposite}.\n *\n * @public\n */\nexport type CallWithChatCompositeOptions = {\n /**\n * Call control options to change what buttons show on the call-with-chat composite control bar.\n * If using the boolean values, true will cause default behavior across the whole control bar. False hides the whole control bar.\n */\n callControls?: boolean | CallWithChatControlOptions;\n /* @conditional-compile-remove(file-sharing) */\n /**\n * Properties for configuring the File Sharing feature.\n * If undefined, file sharing feature will be disabled.\n * @beta\n */\n fileSharing?: FileSharingOptions;\n};\n\n/**\n * {@link CallWithChatComposite} Call controls to show or hide buttons on the calling control bar.\n *\n * @public\n */\nexport interface CallWithChatControlOptions {\n /**\n * {@link CallControlDisplayType} to change how the call controls are displayed.\n * `'compact'` display type will decreases the size of buttons and hide the labels.\n *\n * @remarks\n * If the composite `formFactor` is set to `'mobile'`, the control bar will always use compact view.\n *\n * @defaultValue 'default'\n */\n displayType?: CallControlDisplayType;\n /**\n * Show or Hide Microphone button during a call.\n * @defaultValue true\n */\n microphoneButton?: boolean;\n /**\n * Show or Hide Camera Button during a call\n * @defaultValue true\n */\n cameraButton?: boolean;\n /**\n * Show, Hide or Disable the screen share button during a call.\n * @defaultValue true\n */\n screenShareButton?: boolean | { disabled: boolean };\n /**\n * Show or Hide EndCall button during a call.\n * @defaultValue true\n */\n endCallButton?: boolean;\n /**\n * Show or hide the chat button in the call-with-chat composite control bar.\n * @defaultValue true\n */\n chatButton?: boolean;\n /**\n * Show or hide the people button in the call-with-chat composite control bar.\n * @defaultValue true\n */\n peopleButton?: boolean;\n /* @conditional-compile-remove(control-bar-button-injection) */\n /**\n * Inject custom buttons in the call controls.\n *\n * @beta\n */\n onFetchCustomButtonProps?: CustomCallWithChatControlButtonCallback[];\n /* @conditional-compile-remove(PSTN-calls) */ /* @conditional-compile-remove(one-to-n-calling) */\n /**\n * Show or hide the more button in the call-with-chat control bar.\n */\n moreButton?: boolean;\n /* @conditional-compile-remove(PSTN-calls) */ /* @conditional-compile-remove(one-to-n-calling) */\n /**\n * Show or hide the hold button in the bottom sheet drawer\n */\n holdButton?: boolean;\n}\n\ntype CallWithChatScreenProps = {\n callWithChatAdapter: CallWithChatAdapter;\n fluentTheme?: PartialTheme | Theme;\n formFactor?: 'desktop' | 'mobile';\n joinInvitationURL?: string;\n callControls?: boolean | CallWithChatControlOptions;\n onFetchAvatarPersonaData?: AvatarPersonaDataCallback;\n onFetchParticipantMenuItems?: ParticipantMenuItemsCallback;\n /* @conditional-compile-remove(file-sharing) */\n fileSharing?: FileSharingOptions;\n rtl?: boolean;\n};\n\nconst CallWithChatScreen = (props: CallWithChatScreenProps): JSX.Element => {\n const { callWithChatAdapter, fluentTheme, formFactor = 'desktop' } = props;\n const mobileView = formFactor === 'mobile';\n\n if (!callWithChatAdapter) {\n throw new Error('CallWithChatAdapter is undefined');\n }\n\n const callAdapter: CallAdapter = useMemo(\n () => new CallWithChatBackedCallAdapter(callWithChatAdapter),\n [callWithChatAdapter]\n );\n\n const [currentCallState, setCurrentCallState] = useState<CallState>();\n const [currentPage, setCurrentPage] = useState<CallCompositePage>();\n const [activePane, setActivePane] = useState<CallWithChatPaneOption>('none');\n\n const containerRef = useRef<HTMLDivElement>(null);\n const containerWidth = _useContainerWidth(containerRef);\n const containerHeight = _useContainerHeight(containerRef);\n\n useEffect(() => {\n const updateCallWithChatPage = (newState: CallWithChatAdapterState): void => {\n setCurrentPage(newState.page);\n setCurrentCallState(newState.call?.state);\n };\n callWithChatAdapter.onStateChange(updateCallWithChatPage);\n return () => {\n callWithChatAdapter.offStateChange(updateCallWithChatPage);\n };\n }, [callWithChatAdapter]);\n\n const closePane = useCallback(() => {\n setActivePane('none');\n }, [setActivePane]);\n\n const chatProps: ChatCompositeProps = useMemo(() => {\n return {\n adapter: new CallWithChatBackedChatAdapter(callWithChatAdapter)\n };\n }, [callWithChatAdapter]);\n\n const modalLayerHostId = useId('modalLayerhost');\n\n const isInLobbyOrConnecting = currentPage === 'lobby';\n /* @conditional-compile-remove(PSTN-calls) */ /* @conditional-compile-remove(one-to-n-calling) */\n const isInLocalHold = currentPage === 'hold';\n const hasJoinedCall = !!(currentPage && hasJoinedCallFn(currentPage, currentCallState ?? 'None'));\n const showControlBar = isInLobbyOrConnecting || hasJoinedCall;\n const isMobileWithActivePane = mobileView && activePane !== 'none';\n\n /** Constant setting of id for the parent stack of the composite */\n const compositeParentDivId = useId('callWithChatCompositeParentDiv-internal');\n\n const toggleChat = useCallback(() => {\n if (activePane === 'chat' || !hasJoinedCall) {\n setActivePane('none');\n } else {\n setActivePane('chat');\n // timeout is required to give the window time to render the sendbox so we have something to send focus to.\n // TODO: Selecting elements in the DOM via attributes is not stable. We should expose an API from ChatComposite to be able to focus on the sendbox.\n const chatFocusTimeout = setInterval(() => {\n const callWithChatCompositeRootDiv = document.querySelector(`[id=\"${compositeParentDivId}\"]`);\n const sendbox = callWithChatCompositeRootDiv?.querySelector(`[id=\"sendbox\"]`) as HTMLTextAreaElement;\n if (sendbox !== null) {\n sendbox.focus();\n clearInterval(chatFocusTimeout);\n }\n }, 3);\n setTimeout(() => {\n clearInterval(chatFocusTimeout);\n }, 300);\n }\n }, [activePane, setActivePane, compositeParentDivId, hasJoinedCall]);\n\n const togglePeople = useCallback(() => {\n if (activePane === 'people' || !hasJoinedCall) {\n setActivePane('none');\n } else {\n setActivePane('people');\n }\n }, [activePane, setActivePane, hasJoinedCall]);\n\n const selectChat = useCallback(() => {\n if (hasJoinedCall) {\n setActivePane('chat');\n }\n }, [setActivePane, hasJoinedCall]);\n\n const selectPeople = useCallback(() => {\n if (hasJoinedCall) {\n setActivePane('people');\n }\n }, [setActivePane, hasJoinedCall]);\n\n const [showDrawer, setShowDrawer] = useState(false);\n const onMoreButtonClicked = useCallback(() => {\n closePane();\n setShowDrawer(true);\n }, [closePane]);\n const closeDrawer = useCallback(() => {\n setShowDrawer(false);\n }, []);\n const onMoreDrawerPeopleClicked = useCallback(() => {\n setShowDrawer(false);\n togglePeople();\n }, [togglePeople]);\n\n const callCompositeContainerCSS = useMemo(() => {\n return { display: isMobileWithActivePane ? 'none' : 'flex' };\n }, [isMobileWithActivePane]);\n\n /* @conditional-compile-remove(PSTN-calls) */\n const [showDtmfDialpad, setShowDtmfDialpad] = useState(false);\n\n /* @conditional-compile-remove(PSTN-calls) */\n const onDismissDtmfDialpad = (): void => {\n setShowDtmfDialpad(false);\n };\n\n /* @conditional-compile-remove(PSTN-calls) */\n const onClickShowDialpad = (): void => {\n setShowDtmfDialpad(true);\n };\n\n /* @conditional-compile-remove(PSTN-calls) */\n const callWithChatStrings = useCallWithChatCompositeStrings();\n\n /* @conditional-compile-remove(PSTN-calls) */\n const dialpadStrings = useMemo(\n () => ({\n dialpadModalAriaLabel: callWithChatStrings.dialpadModalAriaLabel,\n dialpadCloseModalButtonAriaLabel: callWithChatStrings.dialpadCloseModalButtonAriaLabel,\n placeholderText: callWithChatStrings.dtmfDialpadPlaceHolderText\n }),\n [callWithChatStrings]\n );\n\n return (\n <div ref={containerRef} className={mergeStyles(containerDivStyles)}>\n <Stack verticalFill grow styles={compositeOuterContainerStyles} id={compositeParentDivId}>\n <Stack horizontal grow>\n <Stack.Item\n grow\n styles={callCompositeContainerStyles}\n // Perf: Instead of removing the video gallery from DOM, we hide it to prevent re-renders.\n style={callCompositeContainerCSS}\n >\n <CallComposite\n {...props}\n formFactor={formFactor}\n options={{ callControls: false }}\n adapter={callAdapter}\n fluentTheme={fluentTheme}\n />\n </Stack.Item>\n\n {chatProps.adapter && callAdapter && hasJoinedCall && (\n <CallWithChatPane\n chatCompositeProps={chatProps}\n inviteLink={props.joinInvitationURL}\n onClose={closePane}\n chatAdapter={chatProps.adapter}\n callAdapter={callAdapter}\n onFetchAvatarPersonaData={props.onFetchAvatarPersonaData}\n onFetchParticipantMenuItems={props.onFetchParticipantMenuItems}\n onChatButtonClicked={showShowChatTabHeaderButton(props.callControls) ? selectChat : undefined}\n onPeopleButtonClicked={showShowPeopleTabHeaderButton(props.callControls) ? selectPeople : undefined}\n modalLayerHostId={modalLayerHostId}\n mobileView={mobileView}\n activePane={activePane}\n /* @conditional-compile-remove(file-sharing) */\n fileSharing={props.fileSharing}\n rtl={props.rtl}\n />\n )}\n </Stack>\n {showControlBar && !isMobileWithActivePane && (\n <ChatAdapterProvider adapter={chatProps.adapter}>\n <Stack.Item styles={controlBarContainerStyles}>\n <CallWithChatControlBar\n callAdapter={callAdapter}\n chatAdapter={chatProps.adapter}\n chatButtonChecked={activePane === 'chat'}\n onChatButtonClicked={toggleChat}\n peopleButtonChecked={activePane === 'people'}\n onPeopleButtonClicked={togglePeople}\n onMoreButtonClicked={onMoreButtonClicked}\n mobileView={mobileView}\n disableButtonsForLobbyPage={isInLobbyOrConnecting}\n /* @conditional-compile-remove(PSTN-calls) */ /* @conditional-compile-remove(one-to-n-calling) */\n disableButtonsForHoldScreen={isInLocalHold}\n callControls={props.callControls}\n containerHeight={containerHeight}\n containerWidth={containerWidth}\n /* @conditional-compile-remove(PSTN-calls) */\n onClickShowDialpad={onClickShowDialpad}\n />\n </Stack.Item>\n </ChatAdapterProvider>\n )}\n {showControlBar && showDrawer && (\n <ChatAdapterProvider adapter={chatProps.adapter}>\n <CallAdapterProvider adapter={callAdapter}>\n <Stack styles={drawerContainerStyles}>\n <PreparedMoreDrawer\n callControls={props.callControls}\n onLightDismiss={closeDrawer}\n onPeopleButtonClicked={onMoreDrawerPeopleClicked}\n /* @conditional-compile-remove(PSTN-calls) */\n onClickShowDialpad={onClickShowDialpad}\n /* @conditional-compile-remove(PSTN-calls) */ /* @conditional-compile-remove(one-to-n-calling) */\n disableButtonsForHoldScreen={isInLocalHold}\n />\n </Stack>\n </CallAdapterProvider>\n </ChatAdapterProvider>\n )}\n\n {\n /* @conditional-compile-remove(PSTN-calls) */\n showControlBar && showDtmfDialpad && (\n <ChatAdapterProvider adapter={chatProps.adapter}>\n <CallAdapterProvider adapter={callAdapter}>\n <Stack styles={drawerContainerStyles}>\n <SendDtmfDialpad\n isMobile={mobileView}\n strings={dialpadStrings}\n showDialpad={showDtmfDialpad}\n onDismissDialpad={onDismissDtmfDialpad}\n />\n </Stack>\n </CallAdapterProvider>\n </ChatAdapterProvider>\n )\n }\n {\n // This layer host is for ModalLocalAndRemotePIP in CallWithChatPane. This LayerHost cannot be inside the CallWithChatPane\n // because when the CallWithChatPane is hidden, ie. style property display is 'none', it takes up no space. This causes problems when dragging\n // the Modal because the draggable bounds thinks it has no space and will always return to its initial position after dragging.\n mobileView && <LayerHost id={modalLayerHostId} className={mergeStyles(modalLayerHostStyle)} />\n }\n </Stack>\n </div>\n );\n};\n\n/**\n * CallWithChatComposite brings together key components to provide a full call with chat experience out of the box.\n *\n * @public\n */\nexport const CallWithChatComposite = (props: CallWithChatCompositeProps): JSX.Element => {\n const { adapter, fluentTheme, rtl, formFactor, joinInvitationURL, options } = props;\n return (\n <BaseProvider fluentTheme={fluentTheme} rtl={rtl} locale={props.locale} icons={props.icons}>\n <CallWithChatScreen\n {...props}\n callWithChatAdapter={adapter}\n formFactor={formFactor}\n callControls={options?.callControls}\n joinInvitationURL={joinInvitationURL}\n fluentTheme={fluentTheme}\n /* @conditional-compile-remove(file-sharing) */\n fileSharing={options?.fileSharing}\n />\n </BaseProvider>\n );\n};\n\nconst hasJoinedCallFn = (page: CallCompositePage, callStatus: CallState): boolean => {\n /* @conditional-compile-remove(one-to-n-calling) */ /* @conditional-compile-remove(one-to-n-calling) */\n return (page === 'call' && callStatus === 'Connected') || (page === 'hold' && callStatus === 'LocalHold');\n return page === 'call' && callStatus === 'Connected';\n};\n\nconst showShowChatTabHeaderButton = (callControls?: boolean | CallWithChatControlOptions): boolean => {\n if (callControls === undefined || callControls === true) {\n return true;\n }\n if (callControls === false) {\n return false;\n }\n return callControls.chatButton !== false;\n};\n\nconst showShowPeopleTabHeaderButton = (callControls?: boolean | CallWithChatControlOptions): boolean => {\n if (callControls === undefined || callControls === true) {\n return true;\n }\n if (callControls === false) {\n return false;\n }\n return callControls.peopleButton !== false;\n};\n\"../../../../react-components/src\""]}
|
1
|
+
{"version":3,"file":"CallWithChatComposite.js","sourceRoot":"","sources":["../../../../../../../react-composites/src/composites/CallWithChatComposite/CallWithChatComposite.tsx"],"names":[],"mappings":"AAAA,uCAAuC;AAC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AW,EAAE;IAClF,mDAAmD,CAAC,mDAAmD;IACvG,OAAO,CACL,CAAC,IAAI,KAAK,MAAM,IAAI,CAAC,UAAU,KAAK,WAAW,IAAI,UAAU,KAAK,YAAY,CAAC,CAAC;QAChF,CAAC,IAAI,KAAK,MAAM,IAAI,UAAU,KAAK,WAAW,CAAC,CAChD,CAAC;IACF,OAAO,IAAI,KAAK,MAAM,IAAI,UAAU,KAAK,WAAW,CAAC;AACvD,CAAC,CAAC;AAEF,MAAM,2BAA2B,GAAG,CAAC,YAAmD,EAAW,EAAE;IACnG,IAAI,YAAY,KAAK,SAAS,IAAI,YAAY,KAAK,IAAI,EAAE;QACvD,OAAO,IAAI,CAAC;KACb;IACD,IAAI,YAAY,KAAK,KAAK,EAAE;QAC1B,OAAO,KAAK,CAAC;KACd;IACD,OAAO,YAAY,CAAC,UAAU,KAAK,KAAK,CAAC;AAC3C,CAAC,CAAC;AAEF,MAAM,6BAA6B,GAAG,CAAC,YAAmD,EAAW,EAAE;IACrG,IAAI,YAAY,KAAK,SAAS,IAAI,YAAY,KAAK,IAAI,EAAE;QACvD,OAAO,IAAI,CAAC;KACb;IACD,IAAI,YAAY,KAAK,KAAK,EAAE;QAC1B,OAAO,KAAK,CAAC;KACd;IACD,OAAO,YAAY,CAAC,YAAY,KAAK,KAAK,CAAC;AAC7C,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport React, { useCallback, useState, useMemo, useEffect, useRef } from 'react';\nimport { LayerHost, mergeStyles, PartialTheme, Stack, Theme } from '@fluentui/react';\nimport { CallComposite, CallCompositePage, CallControlDisplayType } from '../CallComposite';\nimport { CallAdapterProvider } from '../CallComposite/adapter/CallAdapterProvider';\nimport { CallWithChatControlBar } from './CallWithChatControlBar';\nimport { CallState } from '@azure/communication-calling';\nimport {\n callCompositeContainerStyles,\n compositeOuterContainerStyles,\n controlBarContainerStyles,\n drawerContainerStyles\n} from './styles/CallWithChatCompositeStyles';\nimport { CallWithChatAdapter } from './adapter/CallWithChatAdapter';\nimport { CallWithChatBackedCallAdapter } from './adapter/CallWithChatBackedCallAdapter';\nimport { CallWithChatBackedChatAdapter } from './adapter/CallWithChatBackedChatAdapter';\nimport { CallAdapter } from '../CallComposite';\nimport { ChatCompositeProps } from '../ChatComposite';\nimport { BaseProvider, BaseCompositeProps } from '../common/BaseComposite';\nimport { CallWithChatCompositeIcons } from '../common/icons';\nimport { AvatarPersonaDataCallback } from '../common/AvatarPersona';\nimport { ChatAdapterProvider } from '../ChatComposite/adapter/ChatAdapterProvider';\nimport { CallWithChatAdapterState } from './state/CallWithChatAdapterState';\nimport { PreparedMoreDrawer } from './PreparedMoreDrawer';\nimport { ParticipantMenuItemsCallback, _useContainerHeight, _useContainerWidth } from '@internal/react-components';\nimport { useId } from '@fluentui/react-hooks';\nimport { CallWithChatPane, CallWithChatPaneOption } from './CallWithChatPane';\n/* @conditional-compile-remove(file-sharing) */\nimport { FileSharingOptions } from '../ChatComposite';\nimport { containerDivStyles } from '../common/ContainerRectProps';\n/* @conditional-compile-remove(control-bar-button-injection) */\nimport { CustomCallWithChatControlButtonCallback } from './CustomButton';\nimport { modalLayerHostStyle } from '../common/styles/ModalLocalAndRemotePIP.styles';\n/* @conditional-compile-remove(PSTN-calls) */\nimport { SendDtmfDialpad } from '../common/SendDtmfDialpad';\n/* @conditional-compile-remove(PSTN-calls) */\nimport { useCallWithChatCompositeStrings } from './hooks/useCallWithChatCompositeStrings';\n\n/**\n * Props required for the {@link CallWithChatComposite}\n *\n * @public\n */\nexport interface CallWithChatCompositeProps extends BaseCompositeProps<CallWithChatCompositeIcons> {\n adapter: CallWithChatAdapter;\n /**\n * Fluent theme for the composite.\n *\n * Defaults to a light theme if undefined.\n */\n fluentTheme?: PartialTheme | Theme;\n /**\n * Optimizes the composite form factor for either desktop or mobile.\n * @remarks `mobile` is currently only optimized for Portrait mode on mobile devices and does not support landscape.\n * @defaultValue 'desktop'\n */\n formFactor?: 'desktop' | 'mobile';\n /**\n * URL that can be used to copy a call-with-chat invite to the Users clipboard.\n */\n joinInvitationURL?: string;\n /**\n * Flags to enable/disable or customize UI elements of the {@link CallWithChatComposite}\n */\n options?: CallWithChatCompositeOptions;\n}\n\n/**\n * Optional features of the {@link CallWithChatComposite}.\n *\n * @public\n */\nexport type CallWithChatCompositeOptions = {\n /**\n * Call control options to change what buttons show on the call-with-chat composite control bar.\n * If using the boolean values, true will cause default behavior across the whole control bar. False hides the whole control bar.\n */\n callControls?: boolean | CallWithChatControlOptions;\n /* @conditional-compile-remove(file-sharing) */\n /**\n * Properties for configuring the File Sharing feature.\n * If undefined, file sharing feature will be disabled.\n * @beta\n */\n fileSharing?: FileSharingOptions;\n};\n\n/**\n * {@link CallWithChatComposite} Call controls to show or hide buttons on the calling control bar.\n *\n * @public\n */\nexport interface CallWithChatControlOptions {\n /**\n * {@link CallControlDisplayType} to change how the call controls are displayed.\n * `'compact'` display type will decreases the size of buttons and hide the labels.\n *\n * @remarks\n * If the composite `formFactor` is set to `'mobile'`, the control bar will always use compact view.\n *\n * @defaultValue 'default'\n */\n displayType?: CallControlDisplayType;\n /**\n * Show or Hide Microphone button during a call.\n * @defaultValue true\n */\n microphoneButton?: boolean | /* @conditional-compile-remove(PSTN-calls) */ { disabled: boolean };\n /**\n * Show or Hide Camera Button during a call\n * @defaultValue true\n */\n cameraButton?: boolean | /* @conditional-compile-remove(PSTN-calls) */ { disabled: boolean };\n /**\n * Show, Hide or Disable the screen share button during a call.\n * @defaultValue true\n */\n screenShareButton?: boolean | { disabled: boolean };\n /**\n * Show or Hide EndCall button during a call.\n * @defaultValue true\n */\n endCallButton?: boolean;\n /**\n * Show or hide the chat button in the call-with-chat composite control bar.\n * @defaultValue true\n */\n chatButton?: boolean | /* @conditional-compile-remove(PSTN-calls) */ { disabled: boolean };\n /**\n * Show or hide the people button in the call-with-chat composite control bar.\n * @defaultValue true\n */\n peopleButton?: boolean | /* @conditional-compile-remove(PSTN-calls) */ { disabled: boolean };\n /* @conditional-compile-remove(control-bar-button-injection) */\n /**\n * Inject custom buttons in the call controls.\n *\n * @beta\n */\n onFetchCustomButtonProps?: CustomCallWithChatControlButtonCallback[];\n /* @conditional-compile-remove(PSTN-calls) */ /* @conditional-compile-remove(one-to-n-calling) */\n /**\n * Show or hide the more button in the call-with-chat control bar.\n */\n moreButton?: boolean;\n /* @conditional-compile-remove(PSTN-calls) */ /* @conditional-compile-remove(one-to-n-calling) */\n /**\n * Show or hide the hold button in the bottom sheet drawer\n */\n holdButton?: boolean | { disabled: boolean };\n}\n\ntype CallWithChatScreenProps = {\n callWithChatAdapter: CallWithChatAdapter;\n fluentTheme?: PartialTheme | Theme;\n formFactor?: 'desktop' | 'mobile';\n joinInvitationURL?: string;\n callControls?: boolean | CallWithChatControlOptions;\n onFetchAvatarPersonaData?: AvatarPersonaDataCallback;\n onFetchParticipantMenuItems?: ParticipantMenuItemsCallback;\n /* @conditional-compile-remove(file-sharing) */\n fileSharing?: FileSharingOptions;\n rtl?: boolean;\n};\n\nconst CallWithChatScreen = (props: CallWithChatScreenProps): JSX.Element => {\n const { callWithChatAdapter, fluentTheme, formFactor = 'desktop' } = props;\n const mobileView = formFactor === 'mobile';\n\n if (!callWithChatAdapter) {\n throw new Error('CallWithChatAdapter is undefined');\n }\n\n const callAdapter: CallAdapter = useMemo(\n () => new CallWithChatBackedCallAdapter(callWithChatAdapter),\n [callWithChatAdapter]\n );\n\n const [currentCallState, setCurrentCallState] = useState<CallState>();\n const [currentPage, setCurrentPage] = useState<CallCompositePage>();\n const [activePane, setActivePane] = useState<CallWithChatPaneOption>('none');\n\n const containerRef = useRef<HTMLDivElement>(null);\n const containerWidth = _useContainerWidth(containerRef);\n const containerHeight = _useContainerHeight(containerRef);\n\n useEffect(() => {\n const updateCallWithChatPage = (newState: CallWithChatAdapterState): void => {\n setCurrentPage(newState.page);\n setCurrentCallState(newState.call?.state);\n };\n callWithChatAdapter.onStateChange(updateCallWithChatPage);\n return () => {\n callWithChatAdapter.offStateChange(updateCallWithChatPage);\n };\n }, [callWithChatAdapter]);\n\n const closePane = useCallback(() => {\n setActivePane('none');\n }, [setActivePane]);\n\n const chatProps: ChatCompositeProps = useMemo(() => {\n return {\n adapter: new CallWithChatBackedChatAdapter(callWithChatAdapter)\n };\n }, [callWithChatAdapter]);\n\n const modalLayerHostId = useId('modalLayerhost');\n\n const isInLobbyOrConnecting = currentPage === 'lobby';\n /* @conditional-compile-remove(PSTN-calls) */ /* @conditional-compile-remove(one-to-n-calling) */\n const isInLocalHold = currentPage === 'hold';\n const hasJoinedCall = !!(currentPage && hasJoinedCallFn(currentPage, currentCallState ?? 'None'));\n const showControlBar = isInLobbyOrConnecting || hasJoinedCall;\n const isMobileWithActivePane = mobileView && activePane !== 'none';\n\n /** Constant setting of id for the parent stack of the composite */\n const compositeParentDivId = useId('callWithChatCompositeParentDiv-internal');\n\n const toggleChat = useCallback(() => {\n if (activePane === 'chat' || !hasJoinedCall) {\n setActivePane('none');\n } else {\n setActivePane('chat');\n // timeout is required to give the window time to render the sendbox so we have something to send focus to.\n // TODO: Selecting elements in the DOM via attributes is not stable. We should expose an API from ChatComposite to be able to focus on the sendbox.\n const chatFocusTimeout = setInterval(() => {\n const callWithChatCompositeRootDiv = document.querySelector(`[id=\"${compositeParentDivId}\"]`);\n const sendbox = callWithChatCompositeRootDiv?.querySelector(`[id=\"sendbox\"]`) as HTMLTextAreaElement;\n if (sendbox !== null) {\n sendbox.focus();\n clearInterval(chatFocusTimeout);\n }\n }, 3);\n setTimeout(() => {\n clearInterval(chatFocusTimeout);\n }, 300);\n }\n }, [activePane, setActivePane, compositeParentDivId, hasJoinedCall]);\n\n const togglePeople = useCallback(() => {\n if (activePane === 'people' || !hasJoinedCall) {\n setActivePane('none');\n } else {\n setActivePane('people');\n }\n }, [activePane, setActivePane, hasJoinedCall]);\n\n const selectChat = useCallback(() => {\n if (hasJoinedCall) {\n setActivePane('chat');\n }\n }, [setActivePane, hasJoinedCall]);\n\n const selectPeople = useCallback(() => {\n if (hasJoinedCall) {\n setActivePane('people');\n }\n }, [setActivePane, hasJoinedCall]);\n\n const [showDrawer, setShowDrawer] = useState(false);\n const onMoreButtonClicked = useCallback(() => {\n closePane();\n setShowDrawer(true);\n }, [closePane]);\n const closeDrawer = useCallback(() => {\n setShowDrawer(false);\n }, []);\n const onMoreDrawerPeopleClicked = useCallback(() => {\n setShowDrawer(false);\n togglePeople();\n }, [togglePeople]);\n\n const callCompositeContainerCSS = useMemo(() => {\n return { display: isMobileWithActivePane ? 'none' : 'flex' };\n }, [isMobileWithActivePane]);\n\n /* @conditional-compile-remove(PSTN-calls) */\n const [showDtmfDialpad, setShowDtmfDialpad] = useState(false);\n\n /* @conditional-compile-remove(PSTN-calls) */\n const onDismissDtmfDialpad = (): void => {\n setShowDtmfDialpad(false);\n };\n\n /* @conditional-compile-remove(PSTN-calls) */\n const onClickShowDialpad = (): void => {\n setShowDtmfDialpad(true);\n };\n\n /* @conditional-compile-remove(PSTN-calls) */\n const callWithChatStrings = useCallWithChatCompositeStrings();\n\n /* @conditional-compile-remove(PSTN-calls) */\n const dialpadStrings = useMemo(\n () => ({\n dialpadModalAriaLabel: callWithChatStrings.dialpadModalAriaLabel,\n dialpadCloseModalButtonAriaLabel: callWithChatStrings.dialpadCloseModalButtonAriaLabel,\n placeholderText: callWithChatStrings.dtmfDialpadPlaceHolderText\n }),\n [callWithChatStrings]\n );\n\n /* @conditional-compile-remove(PSTN-calls) */\n const alternateCallerId = callAdapter.getState().alternateCallerId;\n\n return (\n <div ref={containerRef} className={mergeStyles(containerDivStyles)}>\n <Stack verticalFill grow styles={compositeOuterContainerStyles} id={compositeParentDivId}>\n <Stack horizontal grow>\n <Stack.Item\n grow\n styles={callCompositeContainerStyles}\n // Perf: Instead of removing the video gallery from DOM, we hide it to prevent re-renders.\n style={callCompositeContainerCSS}\n >\n <CallComposite\n {...props}\n formFactor={formFactor}\n options={{ callControls: false }}\n adapter={callAdapter}\n fluentTheme={fluentTheme}\n />\n </Stack.Item>\n\n {chatProps.adapter && callAdapter && hasJoinedCall && (\n <CallWithChatPane\n chatCompositeProps={chatProps}\n inviteLink={props.joinInvitationURL}\n onClose={closePane}\n chatAdapter={chatProps.adapter}\n callAdapter={callAdapter}\n onFetchAvatarPersonaData={props.onFetchAvatarPersonaData}\n onFetchParticipantMenuItems={props.onFetchParticipantMenuItems}\n onChatButtonClicked={showShowChatTabHeaderButton(props.callControls) ? selectChat : undefined}\n onPeopleButtonClicked={showShowPeopleTabHeaderButton(props.callControls) ? selectPeople : undefined}\n modalLayerHostId={modalLayerHostId}\n mobileView={mobileView}\n activePane={activePane}\n /* @conditional-compile-remove(file-sharing) */\n fileSharing={props.fileSharing}\n rtl={props.rtl}\n callControls={typeof props.callControls !== 'boolean' ? props.callControls : undefined}\n />\n )}\n </Stack>\n {showControlBar && !isMobileWithActivePane && (\n <ChatAdapterProvider adapter={chatProps.adapter}>\n <Stack.Item styles={controlBarContainerStyles}>\n <CallWithChatControlBar\n callAdapter={callAdapter}\n chatAdapter={chatProps.adapter}\n chatButtonChecked={activePane === 'chat'}\n onChatButtonClicked={toggleChat}\n peopleButtonChecked={activePane === 'people'}\n onPeopleButtonClicked={togglePeople}\n onMoreButtonClicked={onMoreButtonClicked}\n mobileView={mobileView}\n disableButtonsForLobbyPage={isInLobbyOrConnecting}\n /* @conditional-compile-remove(PSTN-calls) */ /* @conditional-compile-remove(one-to-n-calling) */\n disableButtonsForHoldScreen={isInLocalHold}\n callControls={props.callControls}\n containerHeight={containerHeight}\n containerWidth={containerWidth}\n /* @conditional-compile-remove(PSTN-calls) */\n onClickShowDialpad={alternateCallerId ? onClickShowDialpad : undefined}\n />\n </Stack.Item>\n </ChatAdapterProvider>\n )}\n {showControlBar && showDrawer && (\n <ChatAdapterProvider adapter={chatProps.adapter}>\n <CallAdapterProvider adapter={callAdapter}>\n <Stack styles={drawerContainerStyles}>\n <PreparedMoreDrawer\n callControls={props.callControls}\n onLightDismiss={closeDrawer}\n onPeopleButtonClicked={onMoreDrawerPeopleClicked}\n /* @conditional-compile-remove(PSTN-calls) */\n onClickShowDialpad={alternateCallerId ? onClickShowDialpad : undefined}\n /* @conditional-compile-remove(PSTN-calls) */ /* @conditional-compile-remove(one-to-n-calling) */\n disableButtonsForHoldScreen={isInLocalHold}\n />\n </Stack>\n </CallAdapterProvider>\n </ChatAdapterProvider>\n )}\n\n {\n /* @conditional-compile-remove(PSTN-calls) */\n showControlBar && showDtmfDialpad && (\n <ChatAdapterProvider adapter={chatProps.adapter}>\n <CallAdapterProvider adapter={callAdapter}>\n <Stack styles={drawerContainerStyles}>\n <SendDtmfDialpad\n isMobile={mobileView}\n strings={dialpadStrings}\n showDialpad={showDtmfDialpad}\n onDismissDialpad={onDismissDtmfDialpad}\n />\n </Stack>\n </CallAdapterProvider>\n </ChatAdapterProvider>\n )\n }\n {\n // This layer host is for ModalLocalAndRemotePIP in CallWithChatPane. This LayerHost cannot be inside the CallWithChatPane\n // because when the CallWithChatPane is hidden, ie. style property display is 'none', it takes up no space. This causes problems when dragging\n // the Modal because the draggable bounds thinks it has no space and will always return to its initial position after dragging.\n mobileView && <LayerHost id={modalLayerHostId} className={mergeStyles(modalLayerHostStyle)} />\n }\n </Stack>\n </div>\n );\n};\n\n/**\n * CallWithChatComposite brings together key components to provide a full call with chat experience out of the box.\n *\n * @public\n */\nexport const CallWithChatComposite = (props: CallWithChatCompositeProps): JSX.Element => {\n const { adapter, fluentTheme, rtl, formFactor, joinInvitationURL, options } = props;\n return (\n <BaseProvider fluentTheme={fluentTheme} rtl={rtl} locale={props.locale} icons={props.icons}>\n <CallWithChatScreen\n {...props}\n callWithChatAdapter={adapter}\n formFactor={formFactor}\n callControls={options?.callControls}\n joinInvitationURL={joinInvitationURL}\n fluentTheme={fluentTheme}\n /* @conditional-compile-remove(file-sharing) */\n fileSharing={options?.fileSharing}\n />\n </BaseProvider>\n );\n};\n\nconst hasJoinedCallFn = (page: CallCompositePage, callStatus: CallState): boolean => {\n /* @conditional-compile-remove(one-to-n-calling) */ /* @conditional-compile-remove(one-to-n-calling) */\n return (\n (page === 'call' && (callStatus === 'Connected' || callStatus === 'RemoteHold')) ||\n (page === 'hold' && callStatus === 'LocalHold')\n );\n return page === 'call' && callStatus === 'Connected';\n};\n\nconst showShowChatTabHeaderButton = (callControls?: boolean | CallWithChatControlOptions): boolean => {\n if (callControls === undefined || callControls === true) {\n return true;\n }\n if (callControls === false) {\n return false;\n }\n return callControls.chatButton !== false;\n};\n\nconst showShowPeopleTabHeaderButton = (callControls?: boolean | CallWithChatControlOptions): boolean => {\n if (callControls === undefined || callControls === true) {\n return true;\n }\n if (callControls === false) {\n return false;\n }\n return callControls.peopleButton !== false;\n};\n\"../../../../react-components/src\""]}
|
@@ -18,7 +18,7 @@ export interface CallWithChatControlBarProps {
|
|
18
18
|
callControls?: boolean | CallWithChatControlOptions;
|
19
19
|
chatAdapter: ChatAdapter;
|
20
20
|
disableButtonsForHoldScreen?: boolean;
|
21
|
-
onClickShowDialpad
|
21
|
+
onClickShowDialpad?: () => void;
|
22
22
|
}
|
23
23
|
/**
|
24
24
|
* @private
|
@@ -18,6 +18,7 @@ import { MoreButton } from '../common/MoreButton';
|
|
18
18
|
import { CUSTOM_BUTTON_OPTIONS, generateCustomCallWithChatControlBarButton, onFetchCustomButtonPropsTrampoline } from './CustomButton';
|
19
19
|
/*@conditional-compile-remove(PSTN-calls) */ /* @conditional-compile-remove(one-to-n-calling) */
|
20
20
|
import { DesktopMoreButton } from './components/DesktopMoreButton';
|
21
|
+
import { isDisabled } from '../CallComposite/utils';
|
21
22
|
const inferCallWithChatControlOptions = (mobileView, callWithChatControls) => {
|
22
23
|
if (callWithChatControls === false) {
|
23
24
|
return false;
|
@@ -74,7 +75,7 @@ export const CallWithChatControlBar = (props) => {
|
|
74
75
|
if (options === false) {
|
75
76
|
return React.createElement(React.Fragment, null);
|
76
77
|
}
|
77
|
-
const chatButton = (React.createElement(ChatButtonWithUnreadMessagesBadge, { chatAdapter: props.chatAdapter, checked: props.chatButtonChecked, showLabel: options.displayType !== 'compact', isChatPaneVisible: props.chatButtonChecked, onClick: props.onChatButtonClicked, disabled: props.disableButtonsForLobbyPage, strings: chatButtonStrings, styles: commonButtonStyles, newMessageLabel: callWithChatStrings.chatButtonNewMessageNotificationLabel }));
|
78
|
+
const chatButton = (React.createElement(ChatButtonWithUnreadMessagesBadge, { chatAdapter: props.chatAdapter, checked: props.chatButtonChecked, showLabel: options.displayType !== 'compact', isChatPaneVisible: props.chatButtonChecked, onClick: props.onChatButtonClicked, disabled: props.disableButtonsForLobbyPage || isDisabled(options.chatButton), strings: chatButtonStrings, styles: commonButtonStyles, newMessageLabel: callWithChatStrings.chatButtonNewMessageNotificationLabel }));
|
78
79
|
return (React.createElement(Stack, { horizontal: true, className: mergeStyles(callControlsContainerStyles, controlBarContainerStyles) },
|
79
80
|
React.createElement(Stack.Item, { grow: true },
|
80
81
|
React.createElement(CallAdapterProvider, { adapter: props.callAdapter },
|
@@ -83,14 +84,14 @@ export const CallWithChatControlBar = (props) => {
|
|
83
84
|
React.createElement(ControlBar, { layout: "horizontal", styles: centerContainerStyles },
|
84
85
|
isEnabled(options.microphoneButton) && (React.createElement(Microphone, { displayType: options.displayType, styles: commonButtonStyles, splitButtonsForDeviceSelection: !props.mobileView,
|
85
86
|
/* @conditional-compile-remove(PSTN-calls) */ /* @conditional-compile-remove(one-to-n-calling) */
|
86
|
-
disabled: props.disableButtonsForHoldScreen })),
|
87
|
+
disabled: props.disableButtonsForHoldScreen || isDisabled(options.microphoneButton) })),
|
87
88
|
isEnabled(options.cameraButton) && (React.createElement(Camera, { displayType: options.displayType, styles: commonButtonStyles, splitButtonsForDeviceSelection: !props.mobileView,
|
88
89
|
/* @conditional-compile-remove(PSTN-calls) */ /* @conditional-compile-remove(one-to-n-calling) */
|
89
|
-
disabled: props.disableButtonsForHoldScreen })),
|
90
|
+
disabled: props.disableButtonsForHoldScreen || isDisabled(options.cameraButton) })),
|
90
91
|
props.mobileView && isEnabled(options === null || options === void 0 ? void 0 : options.chatButton) && chatButton,
|
91
92
|
isEnabled(options.screenShareButton) && (React.createElement(ScreenShare, { option: options.screenShareButton, displayType: options.displayType, styles: screenShareButtonStyles,
|
92
93
|
/* @conditional-compile-remove(PSTN-calls) */ /* @conditional-compile-remove(one-to-n-calling) */
|
93
|
-
disabled: props.disableButtonsForHoldScreen })),
|
94
|
+
disabled: props.disableButtonsForHoldScreen || isDisabled(options.screenShareButton) })),
|
94
95
|
/* @conditional-compile-remove(control-bar-button-injection) */
|
95
96
|
(_a = customButtons['primary']) === null || _a === void 0 ? void 0 :
|
96
97
|
_a.props.children.slice(0, props.mobileView
|
@@ -109,7 +110,7 @@ export const CallWithChatControlBar = (props) => {
|
|
109
110
|
_b.props.children.slice(0, CUSTOM_BUTTON_OPTIONS.MAX_SECONDARY_DESKTOP_CUSTOM_BUTTONS).map((element) => {
|
110
111
|
return (React.createElement(element.type, Object.assign({}, element.props, { key: element.props.key, styles: commonButtonStyles, displayType: options.displayType, showLabel: options.displayType !== 'compact' })));
|
111
112
|
}),
|
112
|
-
isEnabled(options === null || options === void 0 ? void 0 : options.peopleButton) && (React.createElement(PeopleButton, { checked: props.peopleButtonChecked, showLabel: options.displayType !== 'compact', onClick: props.onPeopleButtonClicked, "data-ui-id": "call-with-chat-composite-people-button", disabled: props.disableButtonsForLobbyPage, strings: peopleButtonStrings, styles: commonButtonStyles })),
|
113
|
+
isEnabled(options === null || options === void 0 ? void 0 : options.peopleButton) && (React.createElement(PeopleButton, { checked: props.peopleButtonChecked, showLabel: options.displayType !== 'compact', onClick: props.onPeopleButtonClicked, "data-ui-id": "call-with-chat-composite-people-button", disabled: props.disableButtonsForLobbyPage || isDisabled(options.peopleButton), strings: peopleButtonStrings, styles: commonButtonStyles })),
|
113
114
|
isEnabled(options === null || options === void 0 ? void 0 : options.chatButton) && chatButton))));
|
114
115
|
};
|
115
116
|
const desktopButtonContainerStyle = {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"CallWithChatControlBar.js","sourceRoot":"","sources":["../../../../../../../react-composites/src/composites/CallWithChatComposite/CallWithChatControlBar.tsx"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,KAAK,EAAE,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,EAAE,mBAAmB,EAAE,MAAM,8CAA8C,CAAC;AAEnF,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,eAAe,EAAkB,WAAW,EAAE,cAAc,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAChH,OAAO,EAAE,yBAAyB,EAAE,MAAM,6CAA6C,CAAC;AACxF,OAAO,EAAE,2BAA2B,EAAE,MAAM,yCAAyC,CAAC;AACtF,OAAO,EAAE,+BAA+B,EAAE,MAAM,yCAAyC,CAAC;AAE1F,OAAO,EAAE,iCAAiC,EAAE,MAAM,qCAAqC,CAAC;AAExF,OAAO,EAAE,UAAU,EAAE,yCAAmC;AACxD,OAAO,EAAE,UAAU,EAAE,MAAM,gDAAgD,CAAC;AAC5E,OAAO,EAAE,MAAM,EAAE,MAAM,4CAA4C,CAAC;AACpE,OAAO,EAAE,WAAW,EAAE,MAAM,iDAAiD,CAAC;AAC9E,OAAO,EAAE,OAAO,EAAE,MAAM,6CAA6C,CAAC;AACtE,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAGlD,+DAA+D;AAC/D,OAAO,EACL,qBAAqB,EACrB,0CAA0C,EAC1C,kCAAkC,EACnC,MAAM,gBAAgB,CAAC;AACxB,4CAA4C,CAAC,mDAAmD;AAChG,OAAO,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAC;AAqBnE,MAAM,+BAA+B,GAAG,CACtC,UAAmB,EACnB,oBAA2D,EACvB,EAAE;IACtC,IAAI,oBAAoB,KAAK,KAAK,EAAE;QAClC,OAAO,KAAK,CAAC;KACd;IAED,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AC,MAAe,EAAW,EAAE,CAAC,MAAM,KAAK,KAAK,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport React, { useMemo } from 'react';\nimport { CallAdapterProvider } from '../CallComposite/adapter/CallAdapterProvider';\nimport { CallAdapter } from '../CallComposite';\nimport { PeopleButton } from './PeopleButton';\nimport { concatStyleSets, IStyle, ITheme, mergeStyles, mergeStyleSets, Stack, useTheme } from '@fluentui/react';\nimport { controlBarContainerStyles } from '../CallComposite/styles/CallControls.styles';\nimport { callControlsContainerStyles } from '../CallComposite/styles/CallPage.styles';\nimport { useCallWithChatCompositeStrings } from './hooks/useCallWithChatCompositeStrings';\nimport { ChatAdapter } from '../ChatComposite';\nimport { ChatButtonWithUnreadMessagesBadge } from './ChatButtonWithUnreadMessagesBadge';\nimport { BaseCustomStyles, ControlBarButtonStyles } from '@internal/react-components';\nimport { ControlBar } from '@internal/react-components';\nimport { Microphone } from '../CallComposite/components/buttons/Microphone';\nimport { Camera } from '../CallComposite/components/buttons/Camera';\nimport { ScreenShare } from '../CallComposite/components/buttons/ScreenShare';\nimport { EndCall } from '../CallComposite/components/buttons/EndCall';\nimport { MoreButton } from '../common/MoreButton';\nimport { CallWithChatControlOptions } from './CallWithChatComposite';\nimport { ContainerRectProps } from '../common/ContainerRectProps';\n/* @conditional-compile-remove(control-bar-button-injection) */\nimport {\n CUSTOM_BUTTON_OPTIONS,\n generateCustomCallWithChatControlBarButton,\n onFetchCustomButtonPropsTrampoline\n} from './CustomButton';\n/*@conditional-compile-remove(PSTN-calls) */ /* @conditional-compile-remove(one-to-n-calling) */\nimport { DesktopMoreButton } from './components/DesktopMoreButton';\n\n/**\n * @private\n */\nexport interface CallWithChatControlBarProps {\n callAdapter: CallAdapter;\n chatButtonChecked: boolean;\n peopleButtonChecked: boolean;\n onChatButtonClicked: () => void;\n onPeopleButtonClicked: () => void;\n onMoreButtonClicked: () => void;\n mobileView: boolean;\n disableButtonsForLobbyPage: boolean;\n callControls?: boolean | CallWithChatControlOptions;\n chatAdapter: ChatAdapter;\n disableButtonsForHoldScreen?: boolean;\n /* @conditional-compile-remove(PSTN-calls) */\n onClickShowDialpad: () => void;\n}\n\nconst inferCallWithChatControlOptions = (\n mobileView: boolean,\n callWithChatControls?: boolean | CallWithChatControlOptions\n): CallWithChatControlOptions | false => {\n if (callWithChatControls === false) {\n return false;\n }\n\n const options = callWithChatControls === true || callWithChatControls === undefined ? {} : callWithChatControls;\n if (mobileView) {\n // Set to compressed mode when composite is optimized for mobile\n options.displayType = 'compact';\n // Do not show screen share button when composite is optimized for mobile unless the developer\n // has explicitly opted in.\n if (options.screenShareButton !== true) {\n options.screenShareButton = false;\n }\n }\n return options;\n};\n\n/**\n * @private\n */\nexport const CallWithChatControlBar = (props: CallWithChatControlBarProps & ContainerRectProps): JSX.Element => {\n const theme = useTheme();\n const callWithChatStrings = useCallWithChatCompositeStrings();\n const options = inferCallWithChatControlOptions(props.mobileView, props.callControls);\n const chatButtonStrings = useMemo(\n () => ({\n label: callWithChatStrings.chatButtonLabel,\n tooltipOffContent: callWithChatStrings.chatButtonTooltipOpen,\n tooltipOnContent: callWithChatStrings.chatButtonTooltipClose\n }),\n [callWithChatStrings]\n );\n const peopleButtonStrings = useMemo(\n () => ({\n label: callWithChatStrings.peopleButtonLabel,\n tooltipOffContent: callWithChatStrings.peopleButtonTooltipOpen,\n tooltipOnContent: callWithChatStrings.peopleButtonTooltipClose\n }),\n [callWithChatStrings]\n );\n const moreButtonStrings = useMemo(\n () => ({\n label: callWithChatStrings.moreDrawerButtonLabel,\n tooltipContent: callWithChatStrings.moreDrawerButtonTooltip\n }),\n [callWithChatStrings]\n );\n\n const centerContainerStyles = useMemo(() => {\n const styles: BaseCustomStyles = !props.mobileView ? desktopControlBarStyles : {};\n return mergeStyleSets(styles, {\n root: {\n // Enforce a background color on control bar to ensure it matches the composite background color.\n background: theme.semanticColors.bodyBackground\n }\n });\n }, [props.mobileView, theme.semanticColors.bodyBackground]);\n const screenShareButtonStyles = useMemo(\n () => (!props.mobileView ? getDesktopScreenShareButtonStyles(theme) : undefined),\n [props.mobileView, theme]\n );\n const commonButtonStyles = useMemo(\n () => (!props.mobileView ? getDesktopCommonButtonStyles(theme) : undefined),\n [props.mobileView, theme]\n );\n const endCallButtonStyles = useMemo(\n () => (!props.mobileView ? getDesktopEndCallButtonStyles(theme) : undefined),\n [props.mobileView, theme]\n );\n /* @conditional-compile-remove(control-bar-button-injection) */\n const customButtons = useMemo(\n () =>\n generateCustomCallWithChatControlBarButton(\n onFetchCustomButtonPropsTrampoline(options !== false ? options : undefined),\n options !== false ? options?.displayType : undefined\n ),\n [options]\n );\n\n // when options is false then we want to hide the whole control bar.\n if (options === false) {\n return <></>;\n }\n\n const chatButton = (\n <ChatButtonWithUnreadMessagesBadge\n chatAdapter={props.chatAdapter}\n checked={props.chatButtonChecked}\n showLabel={options.displayType !== 'compact'}\n isChatPaneVisible={props.chatButtonChecked}\n onClick={props.onChatButtonClicked}\n disabled={props.disableButtonsForLobbyPage}\n strings={chatButtonStrings}\n styles={commonButtonStyles}\n newMessageLabel={callWithChatStrings.chatButtonNewMessageNotificationLabel}\n />\n );\n return (\n <Stack horizontal className={mergeStyles(callControlsContainerStyles, controlBarContainerStyles)}>\n <Stack.Item grow>\n <CallAdapterProvider adapter={props.callAdapter}>\n <Stack horizontalAlign=\"center\">\n <Stack.Item>\n {/*\n Note: We use the layout=\"horizontal\" instead of dockedBottom because of how we position the\n control bar. The control bar exists in a Stack below the MediaGallery. The MediaGallery is\n set to grow and fill the remaining space not taken up by the ControlBar. If we were to use\n dockedBottom it has position absolute and would therefore float on top of the media gallery,\n occluding some of its content.\n */}\n <ControlBar layout=\"horizontal\" styles={centerContainerStyles}>\n {isEnabled(options.microphoneButton) && (\n <Microphone\n displayType={options.displayType}\n styles={commonButtonStyles}\n splitButtonsForDeviceSelection={!props.mobileView}\n /* @conditional-compile-remove(PSTN-calls) */ /* @conditional-compile-remove(one-to-n-calling) */\n disabled={props.disableButtonsForHoldScreen}\n />\n )}\n {isEnabled(options.cameraButton) && (\n <Camera\n displayType={options.displayType}\n styles={commonButtonStyles}\n splitButtonsForDeviceSelection={!props.mobileView}\n /* @conditional-compile-remove(PSTN-calls) */ /* @conditional-compile-remove(one-to-n-calling) */\n disabled={props.disableButtonsForHoldScreen}\n />\n )}\n {props.mobileView && isEnabled(options?.chatButton) && chatButton}\n {isEnabled(options.screenShareButton) && (\n <ScreenShare\n option={options.screenShareButton}\n displayType={options.displayType}\n styles={screenShareButtonStyles}\n /* @conditional-compile-remove(PSTN-calls) */ /* @conditional-compile-remove(one-to-n-calling) */\n disabled={props.disableButtonsForHoldScreen}\n />\n )}\n {\n /* @conditional-compile-remove(control-bar-button-injection) */\n customButtons['primary']?.props.children\n .slice(\n 0,\n props.mobileView\n ? CUSTOM_BUTTON_OPTIONS.MAX_PRIMARY_MOBILE_CUSTOM_BUTTONS\n : CUSTOM_BUTTON_OPTIONS.MAX_PRIMARY_DESKTOP_CUSTOM_BUTTONS\n )\n .map((element) => {\n return (\n <element.type\n {...element.props}\n key={element.props.strings.label}\n styles={commonButtonStyles}\n displayType={options.displayType}\n showLabel={options.displayType !== 'compact'}\n />\n );\n })\n }\n {props.mobileView && (\n <MoreButton\n data-ui-id=\"call-with-chat-composite-more-button\"\n strings={moreButtonStrings}\n onClick={props.onMoreButtonClicked}\n disabled={props.disableButtonsForLobbyPage}\n />\n )}\n {\n /*@conditional-compile-remove(PSTN-calls) */ /* @conditional-compile-remove(one-to-n-calling) */ isEnabled(\n options?.moreButton\n ) &&\n /*@conditional-compile-remove(PSTN-calls) */ /* @conditional-compile-remove(one-to-n-calling) */ isEnabled(\n options?.holdButton\n ) &&\n !props.mobileView && (\n <DesktopMoreButton\n disableButtonsForHoldScreen={props.disableButtonsForHoldScreen}\n styles={commonButtonStyles}\n onClickShowDialpad={props.onClickShowDialpad}\n />\n )\n }\n <EndCall displayType=\"compact\" styles={endCallButtonStyles} />\n </ControlBar>\n </Stack.Item>\n </Stack>\n </CallAdapterProvider>\n </Stack.Item>\n {!props.mobileView && (\n <Stack horizontal className={!props.mobileView ? mergeStyles(desktopButtonContainerStyle) : undefined}>\n {\n /* @conditional-compile-remove(control-bar-button-injection) */\n customButtons['secondary']?.props.children\n .slice(0, CUSTOM_BUTTON_OPTIONS.MAX_SECONDARY_DESKTOP_CUSTOM_BUTTONS)\n .map((element) => {\n return (\n <element.type\n {...element.props}\n key={element.props.key}\n styles={commonButtonStyles}\n displayType={options.displayType}\n showLabel={options.displayType !== 'compact'}\n />\n );\n })\n }\n {isEnabled(options?.peopleButton) && (\n <PeopleButton\n checked={props.peopleButtonChecked}\n showLabel={options.displayType !== 'compact'}\n onClick={props.onPeopleButtonClicked}\n data-ui-id=\"call-with-chat-composite-people-button\"\n disabled={props.disableButtonsForLobbyPage}\n strings={peopleButtonStrings}\n styles={commonButtonStyles}\n />\n )}\n {isEnabled(options?.chatButton) && chatButton}\n </Stack>\n )}\n </Stack>\n );\n};\n\nconst desktopButtonContainerStyle: IStyle = {\n padding: '0.75rem',\n columnGap: '0.5rem'\n};\n\nconst desktopControlBarStyles: BaseCustomStyles = {\n root: desktopButtonContainerStyle\n};\n\nconst getDesktopCommonButtonStyles = (theme: ITheme): ControlBarButtonStyles => ({\n root: {\n border: `solid 1px ${theme.palette.neutralQuaternaryAlt}`,\n borderRadius: theme.effects.roundedCorner4,\n minHeight: '2.5rem',\n maxWidth: '12rem' // allot extra space than the regular ControlBarButton. This is to give extra room to have the icon beside the text.\n },\n flexContainer: {\n display: 'flex',\n flexFlow: 'row nowrap'\n },\n textContainer: {\n // Override the default so that label doesn't introduce a new block.\n display: 'inline',\n\n // Ensure width is set to permit child to show ellipsis when there is a label that is too long\n maxWidth: '100%'\n },\n label: {\n fontSize: theme.fonts.medium.fontSize,\n\n // Ensure there is enough space between the icon and text to allow for the unread messages badge in the chat button\n marginLeft: '0.625rem',\n\n // Ensure letters that go above and below the standard text line like 'g', 'y', 'j' are not clipped\n lineHeight: '1.5rem',\n\n // Do not allow very long button texts to ruin the control bar experience, instead ensure long text is truncated and shows ellipsis\n display: 'block',\n textOverflow: 'ellipsis',\n whiteSpace: 'nowrap',\n overflow: 'hidden'\n },\n splitButtonMenuButton: {\n border: `solid 1px ${theme.palette.neutralQuaternaryAlt}`,\n borderTopRightRadius: theme.effects.roundedCorner4,\n borderBottomRightRadius: theme.effects.roundedCorner4,\n borderTopLeftRadius: '0',\n borderBottomLeftRadius: '0'\n },\n splitButtonMenuButtonChecked: {\n // Default colors the menu half similarly for :hover and when button is checked.\n // To align with how the left-half is styled, override the checked style.\n background: 'none'\n }\n});\n\nconst getDesktopScreenShareButtonStyles = (theme: ITheme): ControlBarButtonStyles => {\n const overrideStyles = {\n border: 'none',\n background: theme.palette.themePrimary,\n color: theme.palette.white,\n '* > svg': { fill: theme.palette.white }\n };\n const overrides: ControlBarButtonStyles = {\n rootChecked: overrideStyles,\n rootCheckedHovered: overrideStyles\n };\n return concatStyleSets(getDesktopCommonButtonStyles(theme), overrides);\n};\n\nconst getDesktopEndCallButtonStyles = (theme: ITheme): ControlBarButtonStyles => {\n const overrides: ControlBarButtonStyles = {\n root: {\n // Suppress border around the dark-red button.\n border: 'none'\n }\n };\n return concatStyleSets(getDesktopCommonButtonStyles(theme), overrides);\n};\n\nconst isEnabled = (option: unknown): boolean => option !== false;\n\"../../../../react-components/src\""]}
|
1
|
+
{"version":3,"file":"CallWithChatControlBar.js","sourceRoot":"","sources":["../../../../../../../react-composites/src/composites/CallWithChatComposite/CallWithChatControlBar.tsx"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,KAAK,EAAE,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,EAAE,mBAAmB,EAAE,MAAM,8CAA8C,CAAC;AAEnF,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,eAAe,EAAkB,WAAW,EAAE,cAAc,EAAE,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MIT license.\n\nimport React, { useMemo } from 'react';\nimport { CallAdapterProvider } from '../CallComposite/adapter/CallAdapterProvider';\nimport { CallAdapter } from '../CallComposite';\nimport { PeopleButton } from './PeopleButton';\nimport { concatStyleSets, IStyle, ITheme, mergeStyles, mergeStyleSets, Stack, useTheme } from '@fluentui/react';\nimport { controlBarContainerStyles } from '../CallComposite/styles/CallControls.styles';\nimport { callControlsContainerStyles } from '../CallComposite/styles/CallPage.styles';\nimport { useCallWithChatCompositeStrings } from './hooks/useCallWithChatCompositeStrings';\nimport { ChatAdapter } from '../ChatComposite';\nimport { ChatButtonWithUnreadMessagesBadge } from './ChatButtonWithUnreadMessagesBadge';\nimport { BaseCustomStyles, ControlBarButtonStyles } from '@internal/react-components';\nimport { ControlBar } from '@internal/react-components';\nimport { Microphone } from '../CallComposite/components/buttons/Microphone';\nimport { Camera } from '../CallComposite/components/buttons/Camera';\nimport { ScreenShare } from '../CallComposite/components/buttons/ScreenShare';\nimport { EndCall } from '../CallComposite/components/buttons/EndCall';\nimport { MoreButton } from '../common/MoreButton';\nimport { CallWithChatControlOptions } from './CallWithChatComposite';\nimport { ContainerRectProps } from '../common/ContainerRectProps';\n/* @conditional-compile-remove(control-bar-button-injection) */\nimport {\n CUSTOM_BUTTON_OPTIONS,\n generateCustomCallWithChatControlBarButton,\n onFetchCustomButtonPropsTrampoline\n} from './CustomButton';\n/*@conditional-compile-remove(PSTN-calls) */ /* @conditional-compile-remove(one-to-n-calling) */\nimport { DesktopMoreButton } from './components/DesktopMoreButton';\nimport { isDisabled } from '../CallComposite/utils';\n\n/**\n * @private\n */\nexport interface CallWithChatControlBarProps {\n callAdapter: CallAdapter;\n chatButtonChecked: boolean;\n peopleButtonChecked: boolean;\n onChatButtonClicked: () => void;\n onPeopleButtonClicked: () => void;\n onMoreButtonClicked: () => void;\n mobileView: boolean;\n disableButtonsForLobbyPage: boolean;\n callControls?: boolean | CallWithChatControlOptions;\n chatAdapter: ChatAdapter;\n disableButtonsForHoldScreen?: boolean;\n /* @conditional-compile-remove(PSTN-calls) */\n onClickShowDialpad?: () => void;\n}\n\nconst inferCallWithChatControlOptions = (\n mobileView: boolean,\n callWithChatControls?: boolean | CallWithChatControlOptions\n): CallWithChatControlOptions | false => {\n if (callWithChatControls === false) {\n return false;\n }\n\n const options = callWithChatControls === true || callWithChatControls === undefined ? {} : callWithChatControls;\n if (mobileView) {\n // Set to compressed mode when composite is optimized for mobile\n options.displayType = 'compact';\n // Do not show screen share button when composite is optimized for mobile unless the developer\n // has explicitly opted in.\n if (options.screenShareButton !== true) {\n options.screenShareButton = false;\n }\n }\n return options;\n};\n\n/**\n * @private\n */\nexport const CallWithChatControlBar = (props: CallWithChatControlBarProps & ContainerRectProps): JSX.Element => {\n const theme = useTheme();\n const callWithChatStrings = useCallWithChatCompositeStrings();\n const options = inferCallWithChatControlOptions(props.mobileView, props.callControls);\n const chatButtonStrings = useMemo(\n () => ({\n label: callWithChatStrings.chatButtonLabel,\n tooltipOffContent: callWithChatStrings.chatButtonTooltipOpen,\n tooltipOnContent: callWithChatStrings.chatButtonTooltipClose\n }),\n [callWithChatStrings]\n );\n const peopleButtonStrings = useMemo(\n () => ({\n label: callWithChatStrings.peopleButtonLabel,\n tooltipOffContent: callWithChatStrings.peopleButtonTooltipOpen,\n tooltipOnContent: callWithChatStrings.peopleButtonTooltipClose\n }),\n [callWithChatStrings]\n );\n const moreButtonStrings = useMemo(\n () => ({\n label: callWithChatStrings.moreDrawerButtonLabel,\n tooltipContent: callWithChatStrings.moreDrawerButtonTooltip\n }),\n [callWithChatStrings]\n );\n\n const centerContainerStyles = useMemo(() => {\n const styles: BaseCustomStyles = !props.mobileView ? desktopControlBarStyles : {};\n return mergeStyleSets(styles, {\n root: {\n // Enforce a background color on control bar to ensure it matches the composite background color.\n background: theme.semanticColors.bodyBackground\n }\n });\n }, [props.mobileView, theme.semanticColors.bodyBackground]);\n const screenShareButtonStyles = useMemo(\n () => (!props.mobileView ? getDesktopScreenShareButtonStyles(theme) : undefined),\n [props.mobileView, theme]\n );\n const commonButtonStyles = useMemo(\n () => (!props.mobileView ? getDesktopCommonButtonStyles(theme) : undefined),\n [props.mobileView, theme]\n );\n const endCallButtonStyles = useMemo(\n () => (!props.mobileView ? getDesktopEndCallButtonStyles(theme) : undefined),\n [props.mobileView, theme]\n );\n /* @conditional-compile-remove(control-bar-button-injection) */\n const customButtons = useMemo(\n () =>\n generateCustomCallWithChatControlBarButton(\n onFetchCustomButtonPropsTrampoline(options !== false ? options : undefined),\n options !== false ? options?.displayType : undefined\n ),\n [options]\n );\n\n // when options is false then we want to hide the whole control bar.\n if (options === false) {\n return <></>;\n }\n\n const chatButton = (\n <ChatButtonWithUnreadMessagesBadge\n chatAdapter={props.chatAdapter}\n checked={props.chatButtonChecked}\n showLabel={options.displayType !== 'compact'}\n isChatPaneVisible={props.chatButtonChecked}\n onClick={props.onChatButtonClicked}\n disabled={props.disableButtonsForLobbyPage || isDisabled(options.chatButton)}\n strings={chatButtonStrings}\n styles={commonButtonStyles}\n newMessageLabel={callWithChatStrings.chatButtonNewMessageNotificationLabel}\n />\n );\n\n return (\n <Stack horizontal className={mergeStyles(callControlsContainerStyles, controlBarContainerStyles)}>\n <Stack.Item grow>\n <CallAdapterProvider adapter={props.callAdapter}>\n <Stack horizontalAlign=\"center\">\n <Stack.Item>\n {/*\n Note: We use the layout=\"horizontal\" instead of dockedBottom because of how we position the\n control bar. The control bar exists in a Stack below the MediaGallery. The MediaGallery is\n set to grow and fill the remaining space not taken up by the ControlBar. If we were to use\n dockedBottom it has position absolute and would therefore float on top of the media gallery,\n occluding some of its content.\n */}\n <ControlBar layout=\"horizontal\" styles={centerContainerStyles}>\n {isEnabled(options.microphoneButton) && (\n <Microphone\n displayType={options.displayType}\n styles={commonButtonStyles}\n splitButtonsForDeviceSelection={!props.mobileView}\n /* @conditional-compile-remove(PSTN-calls) */ /* @conditional-compile-remove(one-to-n-calling) */\n disabled={props.disableButtonsForHoldScreen || isDisabled(options.microphoneButton)}\n />\n )}\n {isEnabled(options.cameraButton) && (\n <Camera\n displayType={options.displayType}\n styles={commonButtonStyles}\n splitButtonsForDeviceSelection={!props.mobileView}\n /* @conditional-compile-remove(PSTN-calls) */ /* @conditional-compile-remove(one-to-n-calling) */\n disabled={props.disableButtonsForHoldScreen || isDisabled(options.cameraButton)}\n />\n )}\n {props.mobileView && isEnabled(options?.chatButton) && chatButton}\n {isEnabled(options.screenShareButton) && (\n <ScreenShare\n option={options.screenShareButton}\n displayType={options.displayType}\n styles={screenShareButtonStyles}\n /* @conditional-compile-remove(PSTN-calls) */ /* @conditional-compile-remove(one-to-n-calling) */\n disabled={props.disableButtonsForHoldScreen || isDisabled(options.screenShareButton)}\n />\n )}\n {\n /* @conditional-compile-remove(control-bar-button-injection) */\n customButtons['primary']?.props.children\n .slice(\n 0,\n props.mobileView\n ? CUSTOM_BUTTON_OPTIONS.MAX_PRIMARY_MOBILE_CUSTOM_BUTTONS\n : CUSTOM_BUTTON_OPTIONS.MAX_PRIMARY_DESKTOP_CUSTOM_BUTTONS\n )\n .map((element) => {\n return (\n <element.type\n {...element.props}\n key={element.props.strings.label}\n styles={commonButtonStyles}\n displayType={options.displayType}\n showLabel={options.displayType !== 'compact'}\n />\n );\n })\n }\n {props.mobileView && (\n <MoreButton\n data-ui-id=\"call-with-chat-composite-more-button\"\n strings={moreButtonStrings}\n onClick={props.onMoreButtonClicked}\n disabled={props.disableButtonsForLobbyPage}\n />\n )}\n {\n /*@conditional-compile-remove(PSTN-calls) */ /* @conditional-compile-remove(one-to-n-calling) */ isEnabled(\n options?.moreButton\n ) &&\n /*@conditional-compile-remove(PSTN-calls) */ /* @conditional-compile-remove(one-to-n-calling) */ isEnabled(\n options?.holdButton\n ) &&\n !props.mobileView && (\n <DesktopMoreButton\n disableButtonsForHoldScreen={props.disableButtonsForHoldScreen}\n styles={commonButtonStyles}\n onClickShowDialpad={props.onClickShowDialpad}\n />\n )\n }\n <EndCall displayType=\"compact\" styles={endCallButtonStyles} />\n </ControlBar>\n </Stack.Item>\n </Stack>\n </CallAdapterProvider>\n </Stack.Item>\n {!props.mobileView && (\n <Stack horizontal className={!props.mobileView ? mergeStyles(desktopButtonContainerStyle) : undefined}>\n {\n /* @conditional-compile-remove(control-bar-button-injection) */\n customButtons['secondary']?.props.children\n .slice(0, CUSTOM_BUTTON_OPTIONS.MAX_SECONDARY_DESKTOP_CUSTOM_BUTTONS)\n .map((element) => {\n return (\n <element.type\n {...element.props}\n key={element.props.key}\n styles={commonButtonStyles}\n displayType={options.displayType}\n showLabel={options.displayType !== 'compact'}\n />\n );\n })\n }\n {isEnabled(options?.peopleButton) && (\n <PeopleButton\n checked={props.peopleButtonChecked}\n showLabel={options.displayType !== 'compact'}\n onClick={props.onPeopleButtonClicked}\n data-ui-id=\"call-with-chat-composite-people-button\"\n disabled={props.disableButtonsForLobbyPage || isDisabled(options.peopleButton)}\n strings={peopleButtonStrings}\n styles={commonButtonStyles}\n />\n )}\n {isEnabled(options?.chatButton) && chatButton}\n </Stack>\n )}\n </Stack>\n );\n};\n\nconst desktopButtonContainerStyle: IStyle = {\n padding: '0.75rem',\n columnGap: '0.5rem'\n};\n\nconst desktopControlBarStyles: BaseCustomStyles = {\n root: desktopButtonContainerStyle\n};\n\nconst getDesktopCommonButtonStyles = (theme: ITheme): ControlBarButtonStyles => ({\n root: {\n border: `solid 1px ${theme.palette.neutralQuaternaryAlt}`,\n borderRadius: theme.effects.roundedCorner4,\n minHeight: '2.5rem',\n maxWidth: '12rem' // allot extra space than the regular ControlBarButton. This is to give extra room to have the icon beside the text.\n },\n flexContainer: {\n display: 'flex',\n flexFlow: 'row nowrap'\n },\n textContainer: {\n // Override the default so that label doesn't introduce a new block.\n display: 'inline',\n\n // Ensure width is set to permit child to show ellipsis when there is a label that is too long\n maxWidth: '100%'\n },\n label: {\n fontSize: theme.fonts.medium.fontSize,\n\n // Ensure there is enough space between the icon and text to allow for the unread messages badge in the chat button\n marginLeft: '0.625rem',\n\n // Ensure letters that go above and below the standard text line like 'g', 'y', 'j' are not clipped\n lineHeight: '1.5rem',\n\n // Do not allow very long button texts to ruin the control bar experience, instead ensure long text is truncated and shows ellipsis\n display: 'block',\n textOverflow: 'ellipsis',\n whiteSpace: 'nowrap',\n overflow: 'hidden'\n },\n splitButtonMenuButton: {\n border: `solid 1px ${theme.palette.neutralQuaternaryAlt}`,\n borderTopRightRadius: theme.effects.roundedCorner4,\n borderBottomRightRadius: theme.effects.roundedCorner4,\n borderTopLeftRadius: '0',\n borderBottomLeftRadius: '0'\n },\n splitButtonMenuButtonChecked: {\n // Default colors the menu half similarly for :hover and when button is checked.\n // To align with how the left-half is styled, override the checked style.\n background: 'none'\n }\n});\n\nconst getDesktopScreenShareButtonStyles = (theme: ITheme): ControlBarButtonStyles => {\n const overrideStyles = {\n border: 'none',\n background: theme.palette.themePrimary,\n color: theme.palette.white,\n '* > svg': { fill: theme.palette.white }\n };\n const overrides: ControlBarButtonStyles = {\n rootChecked: overrideStyles,\n rootCheckedHovered: overrideStyles\n };\n return concatStyleSets(getDesktopCommonButtonStyles(theme), overrides);\n};\n\nconst getDesktopEndCallButtonStyles = (theme: ITheme): ControlBarButtonStyles => {\n const overrides: ControlBarButtonStyles = {\n root: {\n // Suppress border around the dark-red button.\n border: 'none'\n }\n };\n return concatStyleSets(getDesktopCommonButtonStyles(theme), overrides);\n};\n\nconst isEnabled = (option: unknown): boolean => option !== false;\n\"../../../../react-components/src\""]}
|
package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/CallWithChatPane.d.ts
CHANGED
@@ -4,6 +4,7 @@ import { CallAdapter } from '../CallComposite';
|
|
4
4
|
import { ChatAdapter, ChatCompositeProps } from '../ChatComposite';
|
5
5
|
import { AvatarPersonaDataCallback } from '../common/AvatarPersona';
|
6
6
|
import { FileSharingOptions } from '../ChatComposite';
|
7
|
+
import { CallWithChatControlOptions } from './CallWithChatComposite';
|
7
8
|
/**
|
8
9
|
* Pane that is used to store chat and people for CallWithChat composite
|
9
10
|
* @private
|
@@ -23,6 +24,7 @@ export declare const CallWithChatPane: (props: {
|
|
23
24
|
inviteLink?: string;
|
24
25
|
fileSharing?: FileSharingOptions;
|
25
26
|
rtl?: boolean;
|
27
|
+
callControls?: CallWithChatControlOptions;
|
26
28
|
}) => JSX.Element;
|
27
29
|
/**
|
28
30
|
* Active tab option type for {@link CallWithChatPane} component
|
package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/CallWithChatPane.js
CHANGED
@@ -24,11 +24,13 @@ import { TabHeader } from '../common/TabHeader';
|
|
24
24
|
import { getPipStyles } from '../common/styles/ModalLocalAndRemotePIP.styles';
|
25
25
|
import { useMinMaxDragPosition } from '../common/utils';
|
26
26
|
import { availableSpaceStyles, hiddenStyles, sidePaneStyles, sidePaneTokens } from '../common/styles/Pane.styles';
|
27
|
+
import { isDisabled } from '../CallComposite/utils';
|
27
28
|
/**
|
28
29
|
* Pane that is used to store chat and people for CallWithChat composite
|
29
30
|
* @private
|
30
31
|
*/
|
31
32
|
export const CallWithChatPane = (props) => {
|
33
|
+
var _a, _b;
|
32
34
|
const [drawerMenuItems, setDrawerMenuItems] = useState([]);
|
33
35
|
const hidden = props.activePane === 'none';
|
34
36
|
const paneStyles = hidden ? hiddenStyles : props.mobileView ? availableSpaceStyles : sidePaneStyles;
|
@@ -36,7 +38,7 @@ export const CallWithChatPane = (props) => {
|
|
36
38
|
const theme = useTheme();
|
37
39
|
/* @conditional-compile-remove(PSTN-calls) */
|
38
40
|
const alternateCallerId = props.callAdapter.getState().alternateCallerId;
|
39
|
-
const header = props.activePane === 'none' ? null : props.mobileView ? (React.createElement(TabHeader, Object.assign({}, props, { strings: callWithChatStrings, activeTab: props.activePane }))) : (React.createElement(SidePaneHeader, Object.assign({}, props, { strings: callWithChatStrings, headingText: props.activePane === 'chat'
|
41
|
+
const header = props.activePane === 'none' ? null : props.mobileView ? (React.createElement(TabHeader, Object.assign({}, props, { strings: callWithChatStrings, activeTab: props.activePane, disableChatButton: isDisabled((_a = props.callControls) === null || _a === void 0 ? void 0 : _a.chatButton), disablePeopleButton: isDisabled((_b = props.callControls) === null || _b === void 0 ? void 0 : _b.peopleButton) }))) : (React.createElement(SidePaneHeader, Object.assign({}, props, { strings: callWithChatStrings, headingText: props.activePane === 'chat'
|
40
42
|
? callWithChatStrings.chatPaneTitle
|
41
43
|
: props.activePane === 'people'
|
42
44
|
? callWithChatStrings.peoplePaneTitle
|
package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/CallWithChatPane.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"CallWithChatPane.js","sourceRoot":"","sources":["../../../../../../../react-composites/src/composites/CallWithChatComposite/CallWithChatPane.tsx"],"names":[],"mappings":";;;;;;;;;AAAA,uCAAuC;AACvC,kCAAkC;AAClC,OAAO,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AACxC,OAAO,EACL,WAAW,EAKX,QAAQ,EACT,yCAAmC;AACpC,OAAO,KAAK,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAEjD,OAAO,EAAE,mBAAmB,EAAE,MAAM,8CAA8C,CAAC;AACnF,OAAO,EAAe,aAAa,EAAsB,MAAM,kBAAkB,CAAC;AAElF,OAAO,EACL,iBAAiB,EACjB,mBAAmB,EACnB,2BAA2B,EAC5B,MAAM,8CAA8C,CAAC;AACtD,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAC1D,OAAO,EAAE,+BAA+B,EAAE,MAAM,yCAAyC,CAAC;AAC1F,OAAO,EAAE,sBAAsB,EAAE,MAAM,kCAAkC,CAAC;AAC1E,OAAO,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAC;AAChE,OAAO,EAAE,qBAAqB,EAAE,MAAM,sCAAsC,CAAC;AAC7E,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAKhD,OAAO,EAAE,YAAY,EAAE,MAAM,gDAAgD,CAAC;AAC9E,OAAO,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C,KAAK,IAAC,MAAM,EAAE,qBAAqB;YAClC,oBAAC,WAAW,IAAC,cAAc,EAAE,GAAG,EAAE,CAAC,kBAAkB,CAAC,EAAE,CAAC,EAAE,KAAK,EAAE,eAAe,GAAI,CAC/E,CACT,CACK,CACT,CAAC;AACJ,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nimport { Stack } from '@fluentui/react';\nimport {\n _DrawerMenu,\n _DrawerMenuItemProps,\n _useContainerHeight,\n _useContainerWidth,\n ParticipantMenuItemsCallback,\n useTheme\n} from '@internal/react-components';\nimport React, { useMemo, useState } from 'react';\nimport { CallAdapter } from '../CallComposite';\nimport { CallAdapterProvider } from '../CallComposite/adapter/CallAdapterProvider';\nimport { ChatAdapter, ChatComposite, ChatCompositeProps } from '../ChatComposite';\nimport { AvatarPersonaDataCallback } from '../common/AvatarPersona';\nimport {\n paneBodyContainer,\n scrollableContainer,\n scrollableContainerContents\n} from '../common/styles/ParticipantContainer.styles';\nimport { SidePaneHeader } from '../common/SidePaneHeader';\nimport { useCallWithChatCompositeStrings } from './hooks/useCallWithChatCompositeStrings';\nimport { ModalLocalAndRemotePIP } from '../common/ModalLocalAndRemotePIP';\nimport { PeoplePaneContent } from '../common/PeoplePaneContent';\nimport { drawerContainerStyles } from './styles/CallWithChatCompositeStyles';\nimport { TabHeader } from '../common/TabHeader';\n/* @conditional-compile-remove(file-sharing) */\nimport { FileSharingOptions } from '../ChatComposite';\nimport { _ICoordinates } from '@internal/react-components';\nimport { _pxToRem } from '@internal/acs-ui-common';\nimport { getPipStyles } from '../common/styles/ModalLocalAndRemotePIP.styles';\nimport { useMinMaxDragPosition } from '../common/utils';\nimport { availableSpaceStyles, hiddenStyles, sidePaneStyles, sidePaneTokens } from '../common/styles/Pane.styles';\n/* @conditional-compile-remove(PSTN-calls) */\nimport { CommunicationIdentifier } from '@azure/communication-common';\n/* @conditional-compile-remove(PSTN-calls) */\nimport { AddPhoneNumberOptions } from '@azure/communication-calling';\n\n/**\n * Pane that is used to store chat and people for CallWithChat composite\n * @private\n */\nexport const CallWithChatPane = (props: {\n chatCompositeProps: Partial<ChatCompositeProps>;\n callAdapter: CallAdapter;\n chatAdapter: ChatAdapter;\n onClose: () => void;\n onFetchAvatarPersonaData?: AvatarPersonaDataCallback;\n onFetchParticipantMenuItems?: ParticipantMenuItemsCallback;\n onChatButtonClicked?: () => void;\n onPeopleButtonClicked?: () => void;\n modalLayerHostId: string;\n activePane: CallWithChatPaneOption;\n mobileView?: boolean;\n inviteLink?: string;\n /* @conditional-compile-remove(file-sharing) */\n fileSharing?: FileSharingOptions;\n rtl?: boolean;\n}): JSX.Element => {\n const [drawerMenuItems, setDrawerMenuItems] = useState<_DrawerMenuItemProps[]>([]);\n\n const hidden = props.activePane === 'none';\n const paneStyles = hidden ? hiddenStyles : props.mobileView ? availableSpaceStyles : sidePaneStyles;\n\n const callWithChatStrings = useCallWithChatCompositeStrings();\n const theme = useTheme();\n\n /* @conditional-compile-remove(PSTN-calls) */\n const alternateCallerId = props.callAdapter.getState().alternateCallerId;\n\n const header =\n props.activePane === 'none' ? null : props.mobileView ? (\n <TabHeader {...props} strings={callWithChatStrings} activeTab={props.activePane} />\n ) : (\n <SidePaneHeader\n {...props}\n strings={callWithChatStrings}\n headingText={\n props.activePane === 'chat'\n ? callWithChatStrings.chatPaneTitle\n : props.activePane === 'people'\n ? callWithChatStrings.peoplePaneTitle\n : ''\n }\n />\n );\n\n const chatContent = (\n <ChatComposite\n {...props.chatCompositeProps}\n adapter={props.chatAdapter}\n fluentTheme={theme}\n options={{\n topic: false,\n /* @conditional-compile-remove(chat-composite-participant-pane) */\n participantPane: false,\n /* @conditional-compile-remove(file-sharing) */\n fileSharing: props.fileSharing\n }}\n onFetchAvatarPersonaData={props.onFetchAvatarPersonaData}\n />\n );\n\n /**\n * In a CallWithChat when a participant is removed, we must remove them from both\n * the call and the chat thread.\n */\n const removeParticipantFromCallWithChat = async (participantId: string): Promise<void> => {\n await props.callAdapter.removeParticipant(participantId);\n await props.chatAdapter.removeParticipant(participantId);\n };\n\n /* @conditional-compile-remove(PSTN-calls) */\n const addParticipantToCall = async (\n participant: CommunicationIdentifier,\n options?: AddPhoneNumberOptions\n ): Promise<void> => {\n await props.callAdapter.addParticipant(participant, options);\n };\n\n const peopleContent = (\n <CallAdapterProvider adapter={props.callAdapter}>\n <PeoplePaneContent\n {...props}\n onRemoveParticipant={removeParticipantFromCallWithChat}\n setDrawerMenuItems={setDrawerMenuItems}\n strings={callWithChatStrings}\n /* @conditional-compile-remove(PSTN-calls) */\n onAddParticipant={addParticipantToCall}\n /* @conditional-compile-remove(PSTN-calls) */\n alternateCallerId={alternateCallerId}\n />\n </CallAdapterProvider>\n );\n\n const minMaxDragPosition = useMinMaxDragPosition(props.modalLayerHostId, props.rtl);\n\n const pipStyles = useMemo(() => getPipStyles(theme), [theme]);\n\n const dataUiId =\n props.activePane === 'chat'\n ? 'call-with-chat-composite-chat-pane'\n : props.activePane === 'people'\n ? 'call-with-chat-composite-people-pane'\n : '';\n\n return (\n <Stack verticalFill grow styles={paneStyles} data-ui-id={dataUiId} tokens={props.mobileView ? {} : sidePaneTokens}>\n {header}\n <Stack.Item verticalFill grow styles={paneBodyContainer}>\n <Stack horizontal styles={scrollableContainer}>\n <Stack.Item verticalFill styles={scrollableContainerContents}>\n <Stack styles={props.activePane === 'chat' ? availableSpaceStyles : hiddenStyles}>{chatContent}</Stack>\n <Stack styles={props.activePane === 'people' ? availableSpaceStyles : hiddenStyles}>{peopleContent}</Stack>\n </Stack.Item>\n </Stack>\n </Stack.Item>\n {props.mobileView && (\n <ModalLocalAndRemotePIP\n callAdapter={props.callAdapter}\n modalLayerHostId={props.modalLayerHostId}\n hidden={hidden}\n styles={pipStyles}\n minDragPosition={minMaxDragPosition.minDragPosition}\n maxDragPosition={minMaxDragPosition.maxDragPosition}\n />\n )}\n {drawerMenuItems.length > 0 && (\n <Stack styles={drawerContainerStyles}>\n <_DrawerMenu onLightDismiss={() => setDrawerMenuItems([])} items={drawerMenuItems} />\n </Stack>\n )}\n </Stack>\n );\n};\n\n/**\n * Active tab option type for {@link CallWithChatPane} component\n * @private\n */\nexport type CallWithChatPaneOption = 'none' | 'chat' | 'people';\n\"../../../../react-components/src\"\"../../../../acs-ui-common/src\""]}
|
1
|
+
{"version":3,"file":"CallWithChatPane.js","sourceRoot":"","sources":["../../../../../../../react-composites/src/composites/CallWithChatComposite/CallWithChatPane.tsx"],"names":[],"mappings":";;;;;;;;;AAAA,uCAAuC;AACvC,kCAAkC;AAClC,OAAO,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AACxC,OAAO,EACL,WAAW,EAKX,QAAQ,EACT,yCAAmC;AACpC,OAAO,KAAK,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAEjD,OAAO,EAAE,mBAAmB,EAAE,MAAM,8CAA8C,CAAC;AACnF,OAAO,EAAe,aAAa,EAAsB,MAAM,kBAAkB,CAAC;AAElF,OAAO,EACL,iBAAiB,EACjB,mBAAmB,EACnB,2BAA2B,EAC5B,MAAM,8CAA8C,CAAC;AACtD,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAC1D,OAAO,EAAE,+BAA+B,EAAE,MAAM,yCAAyC,CAAC;AAC1F,OAAO,EAAE,sBAAsB,EAAE,MAAM,kCAAkC,CAAC;AAC1E,OAAO,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAC;AAChE,OAAO,EAAE,qBAAqB,EAAE,MAAM,sCAAsC,CAAC;AAC7E,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAKhD,OAAO,EAAE,YAAY,EAAE,MAAM,gDAAgD,CAAC;AAC9E,OAAO,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAC;AACxD,OAAO,EAAE,oBAAoB,EAAE,YAAY,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAMlH,OAAO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GACnD,CACH;QACA,eAAe,CAAC,MAAM,GAAG,CAAC,IAAI,CAC7B,oBAAC,KAAK,IAAC,MAAM,EAAE,qBAAqB;YAClC,oBAAC,WAAW,IAAC,cAAc,EAAE,GAAG,EAAE,CAAC,kBAAkB,CAAC,EAAE,CAAC,EAAE,KAAK,EAAE,eAAe,GAAI,CAC/E,CACT,CACK,CACT,CAAC;AACJ,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nimport { Stack } from '@fluentui/react';\nimport {\n _DrawerMenu,\n _DrawerMenuItemProps,\n _useContainerHeight,\n _useContainerWidth,\n ParticipantMenuItemsCallback,\n useTheme\n} from '@internal/react-components';\nimport React, { useMemo, useState } from 'react';\nimport { CallAdapter } from '../CallComposite';\nimport { CallAdapterProvider } from '../CallComposite/adapter/CallAdapterProvider';\nimport { ChatAdapter, ChatComposite, ChatCompositeProps } from '../ChatComposite';\nimport { AvatarPersonaDataCallback } from '../common/AvatarPersona';\nimport {\n paneBodyContainer,\n scrollableContainer,\n scrollableContainerContents\n} from '../common/styles/ParticipantContainer.styles';\nimport { SidePaneHeader } from '../common/SidePaneHeader';\nimport { useCallWithChatCompositeStrings } from './hooks/useCallWithChatCompositeStrings';\nimport { ModalLocalAndRemotePIP } from '../common/ModalLocalAndRemotePIP';\nimport { PeoplePaneContent } from '../common/PeoplePaneContent';\nimport { drawerContainerStyles } from './styles/CallWithChatCompositeStyles';\nimport { TabHeader } from '../common/TabHeader';\n/* @conditional-compile-remove(file-sharing) */\nimport { FileSharingOptions } from '../ChatComposite';\nimport { _ICoordinates } from '@internal/react-components';\nimport { _pxToRem } from '@internal/acs-ui-common';\nimport { getPipStyles } from '../common/styles/ModalLocalAndRemotePIP.styles';\nimport { useMinMaxDragPosition } from '../common/utils';\nimport { availableSpaceStyles, hiddenStyles, sidePaneStyles, sidePaneTokens } from '../common/styles/Pane.styles';\n/* @conditional-compile-remove(PSTN-calls) */\nimport { CommunicationIdentifier } from '@azure/communication-common';\n/* @conditional-compile-remove(PSTN-calls) */\nimport { AddPhoneNumberOptions } from '@azure/communication-calling';\nimport { CallWithChatControlOptions } from './CallWithChatComposite';\nimport { isDisabled } from '../CallComposite/utils';\n\n/**\n * Pane that is used to store chat and people for CallWithChat composite\n * @private\n */\nexport const CallWithChatPane = (props: {\n chatCompositeProps: Partial<ChatCompositeProps>;\n callAdapter: CallAdapter;\n chatAdapter: ChatAdapter;\n onClose: () => void;\n onFetchAvatarPersonaData?: AvatarPersonaDataCallback;\n onFetchParticipantMenuItems?: ParticipantMenuItemsCallback;\n onChatButtonClicked?: () => void;\n onPeopleButtonClicked?: () => void;\n modalLayerHostId: string;\n activePane: CallWithChatPaneOption;\n mobileView?: boolean;\n inviteLink?: string;\n /* @conditional-compile-remove(file-sharing) */\n fileSharing?: FileSharingOptions;\n rtl?: boolean;\n callControls?: CallWithChatControlOptions;\n}): JSX.Element => {\n const [drawerMenuItems, setDrawerMenuItems] = useState<_DrawerMenuItemProps[]>([]);\n\n const hidden = props.activePane === 'none';\n const paneStyles = hidden ? hiddenStyles : props.mobileView ? availableSpaceStyles : sidePaneStyles;\n\n const callWithChatStrings = useCallWithChatCompositeStrings();\n const theme = useTheme();\n\n /* @conditional-compile-remove(PSTN-calls) */\n const alternateCallerId = props.callAdapter.getState().alternateCallerId;\n\n const header =\n props.activePane === 'none' ? null : props.mobileView ? (\n <TabHeader\n {...props}\n strings={callWithChatStrings}\n activeTab={props.activePane}\n disableChatButton={isDisabled(props.callControls?.chatButton)}\n disablePeopleButton={isDisabled(props.callControls?.peopleButton)}\n />\n ) : (\n <SidePaneHeader\n {...props}\n strings={callWithChatStrings}\n headingText={\n props.activePane === 'chat'\n ? callWithChatStrings.chatPaneTitle\n : props.activePane === 'people'\n ? callWithChatStrings.peoplePaneTitle\n : ''\n }\n />\n );\n\n const chatContent = (\n <ChatComposite\n {...props.chatCompositeProps}\n adapter={props.chatAdapter}\n fluentTheme={theme}\n options={{\n topic: false,\n /* @conditional-compile-remove(chat-composite-participant-pane) */\n participantPane: false,\n /* @conditional-compile-remove(file-sharing) */\n fileSharing: props.fileSharing\n }}\n onFetchAvatarPersonaData={props.onFetchAvatarPersonaData}\n />\n );\n\n /**\n * In a CallWithChat when a participant is removed, we must remove them from both\n * the call and the chat thread.\n */\n const removeParticipantFromCallWithChat = async (participantId: string): Promise<void> => {\n await props.callAdapter.removeParticipant(participantId);\n await props.chatAdapter.removeParticipant(participantId);\n };\n\n /* @conditional-compile-remove(PSTN-calls) */\n const addParticipantToCall = async (\n participant: CommunicationIdentifier,\n options?: AddPhoneNumberOptions\n ): Promise<void> => {\n await props.callAdapter.addParticipant(participant, options);\n };\n\n const peopleContent = (\n <CallAdapterProvider adapter={props.callAdapter}>\n <PeoplePaneContent\n {...props}\n onRemoveParticipant={removeParticipantFromCallWithChat}\n setDrawerMenuItems={setDrawerMenuItems}\n strings={callWithChatStrings}\n /* @conditional-compile-remove(PSTN-calls) */\n onAddParticipant={addParticipantToCall}\n /* @conditional-compile-remove(PSTN-calls) */\n alternateCallerId={alternateCallerId}\n />\n </CallAdapterProvider>\n );\n\n const minMaxDragPosition = useMinMaxDragPosition(props.modalLayerHostId, props.rtl);\n\n const pipStyles = useMemo(() => getPipStyles(theme), [theme]);\n\n const dataUiId =\n props.activePane === 'chat'\n ? 'call-with-chat-composite-chat-pane'\n : props.activePane === 'people'\n ? 'call-with-chat-composite-people-pane'\n : '';\n\n return (\n <Stack verticalFill grow styles={paneStyles} data-ui-id={dataUiId} tokens={props.mobileView ? {} : sidePaneTokens}>\n {header}\n <Stack.Item verticalFill grow styles={paneBodyContainer}>\n <Stack horizontal styles={scrollableContainer}>\n <Stack.Item verticalFill styles={scrollableContainerContents}>\n <Stack styles={props.activePane === 'chat' ? availableSpaceStyles : hiddenStyles}>{chatContent}</Stack>\n <Stack styles={props.activePane === 'people' ? availableSpaceStyles : hiddenStyles}>{peopleContent}</Stack>\n </Stack.Item>\n </Stack>\n </Stack.Item>\n {props.mobileView && (\n <ModalLocalAndRemotePIP\n callAdapter={props.callAdapter}\n modalLayerHostId={props.modalLayerHostId}\n hidden={hidden}\n styles={pipStyles}\n minDragPosition={minMaxDragPosition.minDragPosition}\n maxDragPosition={minMaxDragPosition.maxDragPosition}\n />\n )}\n {drawerMenuItems.length > 0 && (\n <Stack styles={drawerContainerStyles}>\n <_DrawerMenu onLightDismiss={() => setDrawerMenuItems([])} items={drawerMenuItems} />\n </Stack>\n )}\n </Stack>\n );\n};\n\n/**\n * Active tab option type for {@link CallWithChatPane} component\n * @private\n */\nexport type CallWithChatPaneOption = 'none' | 'chat' | 'people';\n\"../../../../react-components/src\"\"../../../../acs-ui-common/src\""]}
|
package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/PreparedMoreDrawer.d.ts
CHANGED
@@ -5,7 +5,7 @@ export interface PreparedMoreDrawerProps {
|
|
5
5
|
onLightDismiss: () => void;
|
6
6
|
onPeopleButtonClicked: () => void;
|
7
7
|
callControls?: boolean | CallWithChatControlOptions;
|
8
|
-
onClickShowDialpad
|
8
|
+
onClickShowDialpad?: () => void;
|
9
9
|
disableButtonsForHoldScreen?: boolean;
|
10
10
|
}
|
11
11
|
/** @private */
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"PreparedMoreDrawer.js","sourceRoot":"","sources":["../../../../../../../react-composites/src/composites/CallWithChatComposite/PreparedMoreDrawer.tsx"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,KAAK,EAAE,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,EAAE,+BAA+B,EAAE,MAAM,yCAAyC,CAAC;AAC1F,OAAO,EAAE,UAAU,EAAqB,MAAM,yBAAyB,CAAC;AACxE,OAAO,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AACpE,OAAO,EAAE,WAAW,EAAE,MAAM,oCAAoC,CAAC;AACjE,OAAO,EAAE,WAAW,EAAE,MAAM,oCAAoC,CAAC;AAajE,eAAe;AACf,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,KAA8B,EAAe,EAAE;IAChF,MAAM,OAAO,GAAG,+BAA+B,EAAE,CAAC;IAClD,MAAM,iBAAiB,GAAsB,OAAO,CAClD,GAAG,EAAE,CAAC,CAAC;QACL,iBAAiB,EAAE,OAAO,CAAC,iBAAiB;QAC5C,oBAAoB,EAAE,OAAO,CAAC,8BAA8B;QAC5D,mBAAmB,EAAE,OAAO,CAAC,6BAA6B;QAC1D,gBAAgB,EAAE,OAAO,CAAC,0BAA0B;KACrD,CAAC,EACF,CAAC,OAAO,CAAC,CACV,CAAC;IACF,MAAM,WAAW,GAAG,WAAW,CAAC,kBAAkB,CAAC,CAAC;IACpD,MAAM,YAAY,GAAG,WAAW,CAAC,UAAU,CAAC,CAAC;IAC7C,OAAO,oBAAC,UAAU,oBAAK,KAAK,EAAM,WAAW,EAAM,YAAY,IAAE,OAAO,EAAE,iBAAiB,IAAI,CAAC;AAClG,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport React, { useMemo } from 'react';\nimport { useCallWithChatCompositeStrings } from './hooks/useCallWithChatCompositeStrings';\nimport { MoreDrawer, MoreDrawerStrings } from './components/MoreDrawer';\nimport { moreDrawerSelector } from './selectors/moreDrawerSelector';\nimport { useSelector } from '../CallComposite/hooks/useSelector';\nimport { useHandlers } from '../CallComposite/hooks/useHandlers';\nimport { CallWithChatControlOptions } from './CallWithChatComposite';\n\n/** @private */\nexport interface PreparedMoreDrawerProps {\n onLightDismiss: () => void;\n onPeopleButtonClicked: () => void;\n callControls?: boolean | CallWithChatControlOptions;\n /* @conditional-compile-remove(PSTN-calls) */\n onClickShowDialpad
|
1
|
+
{"version":3,"file":"PreparedMoreDrawer.js","sourceRoot":"","sources":["../../../../../../../react-composites/src/composites/CallWithChatComposite/PreparedMoreDrawer.tsx"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,KAAK,EAAE,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,EAAE,+BAA+B,EAAE,MAAM,yCAAyC,CAAC;AAC1F,OAAO,EAAE,UAAU,EAAqB,MAAM,yBAAyB,CAAC;AACxE,OAAO,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AACpE,OAAO,EAAE,WAAW,EAAE,MAAM,oCAAoC,CAAC;AACjE,OAAO,EAAE,WAAW,EAAE,MAAM,oCAAoC,CAAC;AAajE,eAAe;AACf,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,KAA8B,EAAe,EAAE;IAChF,MAAM,OAAO,GAAG,+BAA+B,EAAE,CAAC;IAClD,MAAM,iBAAiB,GAAsB,OAAO,CAClD,GAAG,EAAE,CAAC,CAAC;QACL,iBAAiB,EAAE,OAAO,CAAC,iBAAiB;QAC5C,oBAAoB,EAAE,OAAO,CAAC,8BAA8B;QAC5D,mBAAmB,EAAE,OAAO,CAAC,6BAA6B;QAC1D,gBAAgB,EAAE,OAAO,CAAC,0BAA0B;KACrD,CAAC,EACF,CAAC,OAAO,CAAC,CACV,CAAC;IACF,MAAM,WAAW,GAAG,WAAW,CAAC,kBAAkB,CAAC,CAAC;IACpD,MAAM,YAAY,GAAG,WAAW,CAAC,UAAU,CAAC,CAAC;IAC7C,OAAO,oBAAC,UAAU,oBAAK,KAAK,EAAM,WAAW,EAAM,YAAY,IAAE,OAAO,EAAE,iBAAiB,IAAI,CAAC;AAClG,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport React, { useMemo } from 'react';\nimport { useCallWithChatCompositeStrings } from './hooks/useCallWithChatCompositeStrings';\nimport { MoreDrawer, MoreDrawerStrings } from './components/MoreDrawer';\nimport { moreDrawerSelector } from './selectors/moreDrawerSelector';\nimport { useSelector } from '../CallComposite/hooks/useSelector';\nimport { useHandlers } from '../CallComposite/hooks/useHandlers';\nimport { CallWithChatControlOptions } from './CallWithChatComposite';\n\n/** @private */\nexport interface PreparedMoreDrawerProps {\n onLightDismiss: () => void;\n onPeopleButtonClicked: () => void;\n callControls?: boolean | CallWithChatControlOptions;\n /* @conditional-compile-remove(PSTN-calls) */\n onClickShowDialpad?: () => void;\n disableButtonsForHoldScreen?: boolean;\n}\n\n/** @private */\nexport const PreparedMoreDrawer = (props: PreparedMoreDrawerProps): JSX.Element => {\n const strings = useCallWithChatCompositeStrings();\n const moreDrawerStrings: MoreDrawerStrings = useMemo(\n () => ({\n peopleButtonLabel: strings.peopleButtonLabel,\n audioDeviceMenuTitle: strings.moreDrawerAudioDeviceMenuTitle,\n microphoneMenuTitle: strings.moreDrawerMicrophoneMenuTitle,\n speakerMenuTitle: strings.moreDrawerSpeakerMenuTitle\n }),\n [strings]\n );\n const deviceProps = useSelector(moreDrawerSelector);\n const callHandlers = useHandlers(MoreDrawer);\n return <MoreDrawer {...props} {...deviceProps} {...callHandlers} strings={moreDrawerStrings} />;\n};\n"]}
|
@@ -136,5 +136,9 @@ export interface CallWithChatCompositeStrings {
|
|
136
136
|
* Label for the button to open dtmf dialpad
|
137
137
|
*/
|
138
138
|
openDtmfDialpadLabel: string;
|
139
|
+
/**
|
140
|
+
* aria label for when the invite link has been actioned
|
141
|
+
*/
|
142
|
+
copyInviteLinkActionedAriaLabel: string;
|
139
143
|
}
|
140
144
|
//# sourceMappingURL=Strings.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"Strings.js","sourceRoot":"","sources":["../../../../../../../react-composites/src/composites/CallWithChatComposite/Strings.tsx"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\n/**\n * Strings used by the {@link CallWithChatComposite} directly.\n *\n * This strings are in addition to those used by the components from the component library.\n *\n * @public\n */\nexport interface CallWithChatCompositeStrings {\n /**\n * {@link CallWithChatComposite} control bar People button label\n */\n peopleButtonLabel: string;\n /**\n * {@link CallWithChatComposite} control bar People button ToolTipContent\n */\n peopleButtonTooltipOpen: string;\n /**\n * {@link CallWithChatComposite} control bar People button ToolTipContent\n */\n peopleButtonTooltipClose: string;\n /**\n * {@link CallWithChatComposite} control bar Chat button label.\n */\n chatButtonLabel: string;\n /**\n * {@Link CallWithChatComposite} control bar Chat button ToolTipContent.\n */\n chatButtonTooltipOpen: string;\n /**\n * {@Link CallWithChatComposite} control bar Chat button ToolTipContent.\n */\n chatButtonTooltipClose: string;\n /**\n * {@link CallWithChatComposite} control bar Chat button enhanced tooltip string.\n */\n chatButtonTooltipClosedWithMessageCount: string;\n /**\n * Title for the audio device selection sub-menu in more button drawer.\n *\n * Only used with `mobileView` set to `true` and when no speakers are available.\n */\n moreDrawerAudioDeviceMenuTitle?: string;\n /**\n * Title for the microphone selection sub-menu in more button drawer.\n *\n * Only used with `mobileView` set to `true` and when speakers are available.\n */\n moreDrawerMicrophoneMenuTitle: string;\n /**\n * Title for the speaker selection sub-menu in more button drawer.\n *\n * Only used with `mobileView` set to `true`.\n */\n moreDrawerSpeakerMenuTitle: string;\n /**\n * {@Link CallWithChatComposite} control bar More button label\n */\n moreDrawerButtonLabel: string;\n /**\n * {@Link CallWithChatComposite} control bar More button tooltip content\n */\n moreDrawerButtonTooltip: string;\n /**\n * Side pane People section Title.\n */\n peoplePaneTitle: string;\n /**\n * Side pane People section subheader.\n */\n peoplePaneSubTitle: string;\n /**\n * Side pane Chat screen title.\n */\n chatPaneTitle: string;\n /**\n * New Message label for chat button with notification icon component.\n */\n chatButtonNewMessageNotificationLabel: string;\n /**\n * Aria label for the picture in picture in picture tile that.\n * This feature currently only shows on mobileView when the chat or people pane is expanded.\n * @remarks\n * This component displays the local and most-dominant remote participant and when clicked\n * returns the user to the call screen.\n */\n pictureInPictureTileAriaLabel: string;\n /**\n * Label for menu item to remove participant\n */\n removeMenuLabel: string;\n /**\n * Label for button to copy invite link\n */\n copyInviteLinkButtonLabel: string;\n /* @conditional-compile-remove(PSTN-calls) */\n /**\n * Label for button to open dialpad\n */\n openDialpadButtonLabel: string;\n /**\n * Label for SidePaneHeader dismiss button\n */\n dismissSidePaneButtonLabel?: string;\n /**\n * Aria Description string for return to call button\n */\n returnToCallButtonAriaDescription?: string;\n /**\n * Aria label string for return to call back button\n */\n returnToCallButtonAriaLabel?: string;\n\n /* @conditional-compile-remove(PSTN-calls) */\n /**\n * Label for add people dropdown\n */\n peoplePaneAddPeopleButtonLabel: string;\n /* @conditional-compile-remove(PSTN-calls) */\n /**\n * Label for button to start a call\n */\n dialpadStartCallButtonLabel: string;\n /* @conditional-compile-remove(PSTN-calls) */\n /**\n * Title for dialpad Modal\n */\n dialpadModalTitle: string;\n /* @conditional-compile-remove(PSTN-calls) */\n /**\n * Aria Label for dialpad Modal\n */\n dialpadModalAriaLabel: string;\n /* @conditional-compile-remove(PSTN-calls) */\n /**\n * Aria Label for dialpad Modal close button\n */\n dialpadCloseModalButtonAriaLabel: string;\n /**\n * Placeholder text for dtmf dialpad\n */\n dtmfDialpadPlaceHolderText: string;\n /* @conditional-compile-remove(PSTN-calls) */\n /**\n * Label for the button to open dtmf dialpad\n */\n openDtmfDialpadLabel: string;\n}\n"]}
|
1
|
+
{"version":3,"file":"Strings.js","sourceRoot":"","sources":["../../../../../../../react-composites/src/composites/CallWithChatComposite/Strings.tsx"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\n/**\n * Strings used by the {@link CallWithChatComposite} directly.\n *\n * This strings are in addition to those used by the components from the component library.\n *\n * @public\n */\nexport interface CallWithChatCompositeStrings {\n /**\n * {@link CallWithChatComposite} control bar People button label\n */\n peopleButtonLabel: string;\n /**\n * {@link CallWithChatComposite} control bar People button ToolTipContent\n */\n peopleButtonTooltipOpen: string;\n /**\n * {@link CallWithChatComposite} control bar People button ToolTipContent\n */\n peopleButtonTooltipClose: string;\n /**\n * {@link CallWithChatComposite} control bar Chat button label.\n */\n chatButtonLabel: string;\n /**\n * {@Link CallWithChatComposite} control bar Chat button ToolTipContent.\n */\n chatButtonTooltipOpen: string;\n /**\n * {@Link CallWithChatComposite} control bar Chat button ToolTipContent.\n */\n chatButtonTooltipClose: string;\n /**\n * {@link CallWithChatComposite} control bar Chat button enhanced tooltip string.\n */\n chatButtonTooltipClosedWithMessageCount: string;\n /**\n * Title for the audio device selection sub-menu in more button drawer.\n *\n * Only used with `mobileView` set to `true` and when no speakers are available.\n */\n moreDrawerAudioDeviceMenuTitle?: string;\n /**\n * Title for the microphone selection sub-menu in more button drawer.\n *\n * Only used with `mobileView` set to `true` and when speakers are available.\n */\n moreDrawerMicrophoneMenuTitle: string;\n /**\n * Title for the speaker selection sub-menu in more button drawer.\n *\n * Only used with `mobileView` set to `true`.\n */\n moreDrawerSpeakerMenuTitle: string;\n /**\n * {@Link CallWithChatComposite} control bar More button label\n */\n moreDrawerButtonLabel: string;\n /**\n * {@Link CallWithChatComposite} control bar More button tooltip content\n */\n moreDrawerButtonTooltip: string;\n /**\n * Side pane People section Title.\n */\n peoplePaneTitle: string;\n /**\n * Side pane People section subheader.\n */\n peoplePaneSubTitle: string;\n /**\n * Side pane Chat screen title.\n */\n chatPaneTitle: string;\n /**\n * New Message label for chat button with notification icon component.\n */\n chatButtonNewMessageNotificationLabel: string;\n /**\n * Aria label for the picture in picture in picture tile that.\n * This feature currently only shows on mobileView when the chat or people pane is expanded.\n * @remarks\n * This component displays the local and most-dominant remote participant and when clicked\n * returns the user to the call screen.\n */\n pictureInPictureTileAriaLabel: string;\n /**\n * Label for menu item to remove participant\n */\n removeMenuLabel: string;\n /**\n * Label for button to copy invite link\n */\n copyInviteLinkButtonLabel: string;\n /* @conditional-compile-remove(PSTN-calls) */\n /**\n * Label for button to open dialpad\n */\n openDialpadButtonLabel: string;\n /**\n * Label for SidePaneHeader dismiss button\n */\n dismissSidePaneButtonLabel?: string;\n /**\n * Aria Description string for return to call button\n */\n returnToCallButtonAriaDescription?: string;\n /**\n * Aria label string for return to call back button\n */\n returnToCallButtonAriaLabel?: string;\n\n /* @conditional-compile-remove(PSTN-calls) */\n /**\n * Label for add people dropdown\n */\n peoplePaneAddPeopleButtonLabel: string;\n /* @conditional-compile-remove(PSTN-calls) */\n /**\n * Label for button to start a call\n */\n dialpadStartCallButtonLabel: string;\n /* @conditional-compile-remove(PSTN-calls) */\n /**\n * Title for dialpad Modal\n */\n dialpadModalTitle: string;\n /* @conditional-compile-remove(PSTN-calls) */\n /**\n * Aria Label for dialpad Modal\n */\n dialpadModalAriaLabel: string;\n /* @conditional-compile-remove(PSTN-calls) */\n /**\n * Aria Label for dialpad Modal close button\n */\n dialpadCloseModalButtonAriaLabel: string;\n /**\n * Placeholder text for dtmf dialpad\n */\n dtmfDialpadPlaceHolderText: string;\n /* @conditional-compile-remove(PSTN-calls) */\n /**\n * Label for the button to open dtmf dialpad\n */\n openDtmfDialpadLabel: string;\n /**\n * aria label for when the invite link has been actioned\n */\n copyInviteLinkActionedAriaLabel: string;\n}\n"]}
|
package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/components/MoreDrawer.js
CHANGED
@@ -12,6 +12,7 @@ import { CUSTOM_BUTTON_OPTIONS, generateCustomCallWithChatDrawerButtons, onFetch
|
|
12
12
|
import { usePropsFor } from '../../CallComposite/hooks/usePropsFor';
|
13
13
|
/* @conditional-compile-remove(PSTN-calls) */ /* @conditional-compile-remove(one-to-n-calling) */
|
14
14
|
import { useLocale } from '../../localization';
|
15
|
+
import { isDisabled } from '../../CallComposite/utils';
|
15
16
|
const inferCallWithChatControlOptions = (callWithChatControls) => {
|
16
17
|
if (callWithChatControls === false) {
|
17
18
|
return false;
|
@@ -87,7 +88,8 @@ export const MoreDrawer = (props) => {
|
|
87
88
|
},
|
88
89
|
text: mic.name,
|
89
90
|
onItemClick: onMicrophoneItemClick,
|
90
|
-
secondaryIconProps: isDeviceSelected(mic, props.selectedMicrophone) ? { iconName: 'Accept' } : undefined
|
91
|
+
secondaryIconProps: isDeviceSelected(mic, props.selectedMicrophone) ? { iconName: 'Accept' } : undefined,
|
92
|
+
disabled: drawerSelectionOptions !== false ? isDisabled(drawerSelectionOptions.microphoneButton) : undefined
|
91
93
|
})),
|
92
94
|
secondaryText: (_b = props.selectedMicrophone) === null || _b === void 0 ? void 0 : _b.name
|
93
95
|
});
|
@@ -97,14 +99,16 @@ export const MoreDrawer = (props) => {
|
|
97
99
|
itemKey: 'people',
|
98
100
|
text: props.strings.peopleButtonLabel,
|
99
101
|
iconProps: { iconName: 'MoreDrawerPeople' },
|
100
|
-
onItemClick: props.onPeopleButtonClicked
|
102
|
+
onItemClick: props.onPeopleButtonClicked,
|
103
|
+
disabled: drawerSelectionOptions !== false ? isDisabled(drawerSelectionOptions.peopleButton) : undefined
|
101
104
|
});
|
102
105
|
}
|
103
106
|
/* @conditional-compile-remove(PSTN-calls) */ /* @conditional-compile-remove(one-to-n-calling) */
|
104
|
-
if (drawerSelectionOptions !== false && isEnabled(drawerSelectionOptions === null || drawerSelectionOptions === void 0 ? void 0 : drawerSelectionOptions.
|
107
|
+
if (drawerSelectionOptions !== false && isEnabled(drawerSelectionOptions === null || drawerSelectionOptions === void 0 ? void 0 : drawerSelectionOptions.holdButton)) {
|
105
108
|
drawerMenuItems.push({
|
106
109
|
itemKey: 'holdButtonKey',
|
107
|
-
disabled: props.disableButtonsForHoldScreen
|
110
|
+
disabled: props.disableButtonsForHoldScreen ||
|
111
|
+
(drawerSelectionOptions !== false ? isDisabled(drawerSelectionOptions.holdButton) : undefined),
|
108
112
|
text: localeStrings.component.strings.holdButton.tooltipOffContent,
|
109
113
|
onItemClick: () => {
|
110
114
|
holdButtonProps.onToggleHold();
|
@@ -113,7 +117,8 @@ export const MoreDrawer = (props) => {
|
|
113
117
|
});
|
114
118
|
}
|
115
119
|
/*@conditional-compile-remove(PSTN-calls) */
|
116
|
-
|
120
|
+
// dtmf tone sending only works for 1:1 PSTN call
|
121
|
+
if (drawerSelectionOptions !== false && props.onClickShowDialpad) {
|
117
122
|
drawerMenuItems.push({
|
118
123
|
itemKey: 'showDialpadKey',
|
119
124
|
disabled: props.disableButtonsForHoldScreen,
|