@azure/communication-react 1.9.0-alpha-202310201708 → 1.9.0-alpha-202310250012

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (21) hide show
  1. package/dist/communication-react.d.ts +1 -60
  2. package/dist/dist-cjs/communication-react/index.js +291 -545
  3. package/dist/dist-cjs/communication-react/index.js.map +1 -1
  4. package/dist/dist-esm/acs-ui-common/src/telemetryVersion.js +1 -1
  5. package/dist/dist-esm/acs-ui-common/src/telemetryVersion.js.map +1 -1
  6. package/dist/dist-esm/calling-component-bindings/src/handlers/createCommonHandlers.d.ts +2 -2
  7. package/dist/dist-esm/calling-component-bindings/src/handlers/createCommonHandlers.js.map +1 -1
  8. package/dist/dist-esm/react-components/src/components/FileDownloadCards.js +6 -5
  9. package/dist/dist-esm/react-components/src/components/FileDownloadCards.js.map +1 -1
  10. package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/AzureCommunicationCallAdapter.d.ts +2 -1
  11. package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/AzureCommunicationCallAdapter.js +7 -12
  12. package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/AzureCommunicationCallAdapter.js.map +1 -1
  13. package/dist/dist-esm/react-composites/src/composites/CallComposite/index.d.ts +0 -1
  14. package/dist/dist-esm/react-composites/src/composites/CallComposite/index.js +0 -1
  15. package/dist/dist-esm/react-composites/src/composites/CallComposite/index.js.map +1 -1
  16. package/dist/dist-esm/react-composites/src/composites/common/PeoplePaneContent.js +5 -1
  17. package/dist/dist-esm/react-composites/src/composites/common/PeoplePaneContent.js.map +1 -1
  18. package/package.json +2 -70
  19. package/dist/dist-esm/react-composites/src/composites/CallComposite/MockCallAdapter.d.ts +0 -61
  20. package/dist/dist-esm/react-composites/src/composites/CallComposite/MockCallAdapter.js +0 -255
  21. package/dist/dist-esm/react-composites/src/composites/CallComposite/MockCallAdapter.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"Pe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AAwC;IACxC,OAAO,CAAA,MAAA,OAAO,CAAC,QAAQ,EAAE,CAAC,IAAI,0CAAE,IAAI,MAAK,WAAW,CAAC;IACrD,yBAAyB;IACzB,OAAO,IAAI,CAAC;AACd,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { IContextualMenuItem, Stack } from '@fluentui/react';\nimport {\n ParticipantList,\n ParticipantListParticipant,\n ParticipantListProps,\n ParticipantMenuItemsCallback,\n _DrawerMenuItemProps\n} from '@internal/react-components';\nimport React, { useCallback, useMemo } from 'react';\nimport { CallWithChatCompositeStrings } from '../CallWithChatComposite';\nimport { usePropsFor } from '../CallComposite/hooks/usePropsFor';\nimport { AvatarPersonaDataCallback } from '../common/AvatarPersona';\nimport { ParticipantListWithHeading } from '../common/ParticipantContainer';\nimport { peoplePaneContainerTokens } from '../common/styles/ParticipantContainer.styles';\nimport { participantListContainerStyles, peoplePaneContainerStyle } from './styles/PeoplePaneContent.styles';\nimport { convertContextualMenuItemToDrawerMenuItem } from './ConvertContextualMenuItemToDrawerMenuItem';\n/* @conditional-compile-remove(one-to-n-calling) @conditional-compile-remove(PSTN-calls) */\nimport { CallCompositeStrings } from '../CallComposite';\nimport { CommonCallAdapter } from '../CallComposite';\nimport { AddPeopleButton } from './AddPeopleButton';\n/* @conditional-compile-remove(PSTN-calls) */\nimport { PhoneNumberIdentifier } from '@azure/communication-common';\n/* @conditional-compile-remove(PSTN-calls) */\nimport { AddPhoneNumberOptions } from '@azure/communication-calling';\nimport { useAdapter } from '../CallComposite/adapter/CallAdapterProvider';\nimport { useLocale } from '../localization';\n\n/**\n * @private\n */\nexport const PeoplePaneContent = (props: {\n inviteLink?: string;\n onFetchAvatarPersonaData?: AvatarPersonaDataCallback;\n onFetchParticipantMenuItems?: ParticipantMenuItemsCallback;\n setDrawerMenuItems: (_DrawerMenuItemProps) => void;\n mobileView?: boolean;\n}): JSX.Element => {\n const { inviteLink, onFetchParticipantMenuItems, setDrawerMenuItems } = props;\n const adapter = useAdapter();\n const localeStrings = useLocale();\n\n // eslint-disable-next-line @typescript-eslint/explicit-function-return-type\n const getStrings = () => {\n /* @conditional-compile-remove(one-to-n-calling) @conditional-compile-remove(PSTN-calls) */\n return localeStrings.strings.call;\n\n return localeStrings.strings.callWithChat;\n };\n const strings = getStrings();\n\n const removeParticipantFromCall = useCallback(\n async (participantId: string): Promise<void> => {\n await adapter.removeParticipant(participantId);\n },\n [adapter]\n );\n\n /* @conditional-compile-remove(PSTN-calls) */\n const addParticipantToCall = useCallback(\n async (participant: PhoneNumberIdentifier, options?: AddPhoneNumberOptions): Promise<void> => {\n await adapter.addParticipant(participant, options);\n },\n [adapter]\n );\n\n /* @conditional-compile-remove(PSTN-calls) */\n const alternateCallerId = adapter.getState().alternateCallerId;\n\n const participantListDefaultProps = usePropsFor(ParticipantList);\n const removeButtonAllowed = hasRemoveParticipantsPermissionTrampoline(adapter);\n const setDrawerMenuItemsForParticipant: (participant?: ParticipantListParticipant) => void = useMemo(() => {\n return (participant?: ParticipantListParticipant) => {\n if (participant) {\n let contextualMenuItems: IContextualMenuItem[] = createDefaultContextualMenuItems(\n participant,\n strings,\n removeButtonAllowed && participant.isRemovable ? participantListDefaultProps.onRemoveParticipant : undefined,\n participantListDefaultProps.myUserId\n );\n if (onFetchParticipantMenuItems) {\n contextualMenuItems = onFetchParticipantMenuItems(\n participant.userId,\n participantListDefaultProps.myUserId,\n contextualMenuItems\n );\n }\n const drawerMenuItems = contextualMenuItems.map((contextualMenu: IContextualMenuItem) =>\n convertContextualMenuItemToDrawerMenuItem(contextualMenu, () => setDrawerMenuItems([]))\n );\n setDrawerMenuItems(drawerMenuItems);\n }\n };\n }, [\n strings,\n participantListDefaultProps.onRemoveParticipant,\n participantListDefaultProps.myUserId,\n removeButtonAllowed,\n onFetchParticipantMenuItems,\n setDrawerMenuItems\n ]);\n\n const participantListProps: ParticipantListProps = useMemo(() => {\n const onRemoveAParticipant = async (participantId: string): Promise<void> =>\n removeParticipantFromCall(participantId);\n return {\n ...participantListDefaultProps,\n // Passing undefined callback for mobile to avoid context menus for participants in ParticipantList are clicked\n onRemoveParticipant: props.mobileView ? undefined : onRemoveAParticipant,\n // We want the drawer menu items to appear when participants in ParticipantList are clicked\n onParticipantClick: props.mobileView ? setDrawerMenuItemsForParticipant : undefined\n };\n }, [participantListDefaultProps, props.mobileView, setDrawerMenuItemsForParticipant, removeParticipantFromCall]);\n\n const participantList = (\n <ParticipantListWithHeading\n isMobile={props.mobileView}\n participantListProps={participantListProps}\n onFetchAvatarPersonaData={props.onFetchAvatarPersonaData}\n onFetchParticipantMenuItems={props.mobileView ? undefined : props.onFetchParticipantMenuItems}\n title={strings.peoplePaneSubTitle}\n />\n );\n\n if (props.mobileView) {\n return (\n <Stack\n verticalFill\n styles={peoplePaneContainerStyle}\n tokens={peoplePaneContainerTokens}\n data-ui-id=\"people-pane-content\"\n >\n <Stack.Item grow styles={participantListContainerStyles}>\n {participantList}\n </Stack.Item>\n\n <AddPeopleButton\n inviteLink={inviteLink}\n mobileView={props.mobileView}\n participantList={participantList}\n strings={strings}\n /* @conditional-compile-remove(PSTN-calls) */\n onAddParticipant={addParticipantToCall}\n /* @conditional-compile-remove(PSTN-calls) */\n alternateCallerId={alternateCallerId}\n />\n </Stack>\n );\n }\n\n return (\n <AddPeopleButton\n inviteLink={inviteLink}\n mobileView={props.mobileView}\n participantList={participantList}\n strings={strings}\n /* @conditional-compile-remove(PSTN-calls) */\n onAddParticipant={addParticipantToCall}\n /* @conditional-compile-remove(PSTN-calls) */\n alternateCallerId={alternateCallerId}\n />\n );\n};\n\n/**\n * Create default contextual menu items for particant\n * @param participant - participant to create contextual menu items for\n * @param strings - localized strings for menu item text\n * @param onRemoveParticipant - callback to remove participant\n * @param localParticipantUserId - Local participant user id\n * @returns - IContextualMenuItem[]\n */\nconst createDefaultContextualMenuItems = (\n participant: ParticipantListParticipant,\n strings:\n | CallWithChatCompositeStrings\n | /* @conditional-compile-remove(one-to-n-calling) @conditional-compile-remove(PSTN-calls) */ CallCompositeStrings,\n onRemoveParticipant?: (userId: string) => Promise<void>,\n localParticipantUserId?: string\n): IContextualMenuItem[] => {\n const menuItems: IContextualMenuItem[] = [];\n if (onRemoveParticipant && participant?.userId !== localParticipantUserId) {\n menuItems.push({\n key: 'remove',\n text: strings.removeMenuLabel,\n onClick: () => {\n if (participant?.userId) {\n onRemoveParticipant?.(participant?.userId);\n }\n },\n iconProps: {\n iconName: 'UserRemove'\n }\n });\n }\n return menuItems;\n};\n\n/**\n * @private\n */\nconst hasRemoveParticipantsPermissionTrampoline = (adapter: CommonCallAdapter): boolean => {\n /* @conditional-compile-remove(rooms) */\n return adapter.getState().call?.role === 'Presenter';\n // Return true if stable.\n return true;\n};\n\"../../../../react-components/src\""]}
1
+ {"version":3,"file":"PeoplePaneContent.js","sourceRoot":"","sources":["../../../../../../../react-composites/src/composites/common/PeoplePaneContent.tsx"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;;;;;;;;;;AAElC,OAAO,EAAuB,KAAK,EAAE,MAAM,iBAAiB,CAAC;AAC7D,OAAO,EACL,eAAe,EAKhB,yCAAmC;AACpC,OAAO,KAAK,EAAE,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAEpD,OAAO,EAAE,WAAW,EAAE,MAAM,oCAAoC,CAAC;AAEjE,OAAO,EAAE,0BAA0B,EAAE,MAAM,gCAAgC,CAAC;AAC5E,OAAO,EAAE,yBAAyB,EAAE,MAAM,8CAA8C,CAAC;AACzF,OAAO,EAAE,8BAA8B,EAAE,wBAAwB,EAAE,MAAM,mCAAmC,CAAC;AAC7G,OAAO,EAAE,yCAAyC,EAAE,MAAM,6CAA6C,CAAC;AAIxG,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAKpD,OAAO,EAAE,UAAU,EAAE,MAAM,8CAA8C,CAAC;AAC1E,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,C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AK,sBAAsB,EAAE;QACzE,SAAS,CAAC,IAAI,CAAC;YACb,GAAG,EAAE,QAAQ;YACb,IAAI,EAAE,OAAO,CAAC,eAAe;YAC7B,OAAO,EAAE,GAAG,EAAE;gBACZ,IAAI,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAE,MAAM,EAAE;oBACvB,mBAAmB,aAAnB,mBAAmB,uBAAnB,mBAAmB,CAAG,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAE,MAAM,CAAC,CAAC;iBAC5C;YACH,CAAC;YACD,SAAS,EAAE;gBACT,QAAQ,EAAE,YAAY;aACvB;SACF,CAAC,CAAC;KACJ;IACD,OAAO,SAAS,CAAC;AACnB,CAAC,CAAC;AAEF;;GAEG;AACH,MAAM,yCAAyC,GAAG,CAAC,OAA0B,EAAW,EAAE;;IACxF,wCAAwC;IACxC,MAAM,IAAI,GAAG,MAAA,OAAO,CAAC,QAAQ,EAAE,CAAC,IAAI,0CAAE,IAAI,CAAC;IAC3C,wCAAwC;IACxC,MAAM,SAAS,GAAG,IAAI,KAAK,WAAW,IAAI,IAAI,KAAK,SAAS,IAAI,IAAI,KAAK,SAAS,CAAC;IACnF,wCAAwC;IACxC,OAAO,SAAS,CAAC;IACjB,yBAAyB;IACzB,OAAO,IAAI,CAAC;AACd,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { IContextualMenuItem, Stack } from '@fluentui/react';\nimport {\n ParticipantList,\n ParticipantListParticipant,\n ParticipantListProps,\n ParticipantMenuItemsCallback,\n _DrawerMenuItemProps\n} from '@internal/react-components';\nimport React, { useCallback, useMemo } from 'react';\nimport { CallWithChatCompositeStrings } from '../CallWithChatComposite';\nimport { usePropsFor } from '../CallComposite/hooks/usePropsFor';\nimport { AvatarPersonaDataCallback } from '../common/AvatarPersona';\nimport { ParticipantListWithHeading } from '../common/ParticipantContainer';\nimport { peoplePaneContainerTokens } from '../common/styles/ParticipantContainer.styles';\nimport { participantListContainerStyles, peoplePaneContainerStyle } from './styles/PeoplePaneContent.styles';\nimport { convertContextualMenuItemToDrawerMenuItem } from './ConvertContextualMenuItemToDrawerMenuItem';\n/* @conditional-compile-remove(one-to-n-calling) @conditional-compile-remove(PSTN-calls) */\nimport { CallCompositeStrings } from '../CallComposite';\nimport { CommonCallAdapter } from '../CallComposite';\nimport { AddPeopleButton } from './AddPeopleButton';\n/* @conditional-compile-remove(PSTN-calls) */\nimport { PhoneNumberIdentifier } from '@azure/communication-common';\n/* @conditional-compile-remove(PSTN-calls) */\nimport { AddPhoneNumberOptions } from '@azure/communication-calling';\nimport { useAdapter } from '../CallComposite/adapter/CallAdapterProvider';\nimport { useLocale } from '../localization';\n\n/**\n * @private\n */\nexport const PeoplePaneContent = (props: {\n inviteLink?: string;\n onFetchAvatarPersonaData?: AvatarPersonaDataCallback;\n onFetchParticipantMenuItems?: ParticipantMenuItemsCallback;\n setDrawerMenuItems: (_DrawerMenuItemProps) => void;\n mobileView?: boolean;\n}): JSX.Element => {\n const { inviteLink, onFetchParticipantMenuItems, setDrawerMenuItems } = props;\n const adapter = useAdapter();\n const localeStrings = useLocale();\n\n // eslint-disable-next-line @typescript-eslint/explicit-function-return-type\n const getStrings = () => {\n /* @conditional-compile-remove(one-to-n-calling) @conditional-compile-remove(PSTN-calls) */\n return localeStrings.strings.call;\n\n return localeStrings.strings.callWithChat;\n };\n const strings = getStrings();\n\n const removeParticipantFromCall = useCallback(\n async (participantId: string): Promise<void> => {\n await adapter.removeParticipant(participantId);\n },\n [adapter]\n );\n\n /* @conditional-compile-remove(PSTN-calls) */\n const addParticipantToCall = useCallback(\n async (participant: PhoneNumberIdentifier, options?: AddPhoneNumberOptions): Promise<void> => {\n await adapter.addParticipant(participant, options);\n },\n [adapter]\n );\n\n /* @conditional-compile-remove(PSTN-calls) */\n const alternateCallerId = adapter.getState().alternateCallerId;\n\n const participantListDefaultProps = usePropsFor(ParticipantList);\n const removeButtonAllowed = hasRemoveParticipantsPermissionTrampoline(adapter);\n const setDrawerMenuItemsForParticipant: (participant?: ParticipantListParticipant) => void = useMemo(() => {\n return (participant?: ParticipantListParticipant) => {\n if (participant) {\n let contextualMenuItems: IContextualMenuItem[] = createDefaultContextualMenuItems(\n participant,\n strings,\n removeButtonAllowed && participant.isRemovable ? participantListDefaultProps.onRemoveParticipant : undefined,\n participantListDefaultProps.myUserId\n );\n if (onFetchParticipantMenuItems) {\n contextualMenuItems = onFetchParticipantMenuItems(\n participant.userId,\n participantListDefaultProps.myUserId,\n contextualMenuItems\n );\n }\n const drawerMenuItems = contextualMenuItems.map((contextualMenu: IContextualMenuItem) =>\n convertContextualMenuItemToDrawerMenuItem(contextualMenu, () => setDrawerMenuItems([]))\n );\n setDrawerMenuItems(drawerMenuItems);\n }\n };\n }, [\n strings,\n participantListDefaultProps.onRemoveParticipant,\n participantListDefaultProps.myUserId,\n removeButtonAllowed,\n onFetchParticipantMenuItems,\n setDrawerMenuItems\n ]);\n\n const participantListProps: ParticipantListProps = useMemo(() => {\n const onRemoveAParticipant = async (participantId: string): Promise<void> =>\n removeParticipantFromCall(participantId);\n return {\n ...participantListDefaultProps,\n // Passing undefined callback for mobile to avoid context menus for participants in ParticipantList are clicked\n onRemoveParticipant: props.mobileView ? undefined : onRemoveAParticipant,\n // We want the drawer menu items to appear when participants in ParticipantList are clicked\n onParticipantClick: props.mobileView ? setDrawerMenuItemsForParticipant : undefined\n };\n }, [participantListDefaultProps, props.mobileView, setDrawerMenuItemsForParticipant, removeParticipantFromCall]);\n\n const participantList = (\n <ParticipantListWithHeading\n isMobile={props.mobileView}\n participantListProps={participantListProps}\n onFetchAvatarPersonaData={props.onFetchAvatarPersonaData}\n onFetchParticipantMenuItems={props.mobileView ? undefined : props.onFetchParticipantMenuItems}\n title={strings.peoplePaneSubTitle}\n />\n );\n\n if (props.mobileView) {\n return (\n <Stack\n verticalFill\n styles={peoplePaneContainerStyle}\n tokens={peoplePaneContainerTokens}\n data-ui-id=\"people-pane-content\"\n >\n <Stack.Item grow styles={participantListContainerStyles}>\n {participantList}\n </Stack.Item>\n\n <AddPeopleButton\n inviteLink={inviteLink}\n mobileView={props.mobileView}\n participantList={participantList}\n strings={strings}\n /* @conditional-compile-remove(PSTN-calls) */\n onAddParticipant={addParticipantToCall}\n /* @conditional-compile-remove(PSTN-calls) */\n alternateCallerId={alternateCallerId}\n />\n </Stack>\n );\n }\n\n return (\n <AddPeopleButton\n inviteLink={inviteLink}\n mobileView={props.mobileView}\n participantList={participantList}\n strings={strings}\n /* @conditional-compile-remove(PSTN-calls) */\n onAddParticipant={addParticipantToCall}\n /* @conditional-compile-remove(PSTN-calls) */\n alternateCallerId={alternateCallerId}\n />\n );\n};\n\n/**\n * Create default contextual menu items for particant\n * @param participant - participant to create contextual menu items for\n * @param strings - localized strings for menu item text\n * @param onRemoveParticipant - callback to remove participant\n * @param localParticipantUserId - Local participant user id\n * @returns - IContextualMenuItem[]\n */\nconst createDefaultContextualMenuItems = (\n participant: ParticipantListParticipant,\n strings:\n | CallWithChatCompositeStrings\n | /* @conditional-compile-remove(one-to-n-calling) @conditional-compile-remove(PSTN-calls) */ CallCompositeStrings,\n onRemoveParticipant?: (userId: string) => Promise<void>,\n localParticipantUserId?: string\n): IContextualMenuItem[] => {\n const menuItems: IContextualMenuItem[] = [];\n if (onRemoveParticipant && participant?.userId !== localParticipantUserId) {\n menuItems.push({\n key: 'remove',\n text: strings.removeMenuLabel,\n onClick: () => {\n if (participant?.userId) {\n onRemoveParticipant?.(participant?.userId);\n }\n },\n iconProps: {\n iconName: 'UserRemove'\n }\n });\n }\n return menuItems;\n};\n\n/**\n * @private\n */\nconst hasRemoveParticipantsPermissionTrampoline = (adapter: CommonCallAdapter): boolean => {\n /* @conditional-compile-remove(rooms) */\n const role = adapter.getState().call?.role;\n /* @conditional-compile-remove(rooms) */\n const canRemove = role === 'Presenter' || role === 'Unknown' || role === undefined;\n /* @conditional-compile-remove(rooms) */\n return canRemove;\n // Return true if stable.\n return true;\n};\n\"../../../../react-components/src\""]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@azure/communication-react",
3
- "version": "1.9.0-alpha-202310201708",
3
+ "version": "1.9.0-alpha-202310250012",
4
4
  "sideEffects": false,
5
5
  "description": "React library for building modern communication user experiences utilizing Azure Communication Services",
6
6
  "keywords": [
@@ -67,7 +67,7 @@
67
67
  "copy-preprocess": "cpx \"../*/preprocessed/**\" ./preprocess-dist && renamer --find preprocessed --replace src ./preprocess-dist/**/*",
68
68
  "build": "rushx check-deps && rushx _by-flavor \"rushx _build:by-flavor\"",
69
69
  "build:cjs": "rollup -c --silent",
70
- "build:esm": "rushx _if-preprocess && rushx copy-original && rushx preprocess && rushx copy-preprocess && ttsc -project tsconfig.preprocess.json || (if-env COMMUNICATION_REACT_FLAVOR=beta && ttsc)",
70
+ "build:esm": "npm run _if-preprocess && rushx copy-original && rushx preprocess && rushx copy-preprocess && ttsc -project tsconfig.preprocess.json || (if-env COMMUNICATION_REACT_FLAVOR=beta && ttsc)",
71
71
  "build:watch": "",
72
72
  "clean": "rimraf dist && rimraf ../**/preprocessed && rimraf ../**/preprocess-dist",
73
73
  "test": "",
@@ -90,73 +90,5 @@
90
90
  "_build:by-flavor": "rushx clean && rushx build:esm && rushx build:cjs && rushx _api-extractor:by-flavor",
91
91
  "_current-flavor": "echo You are running under COMMUNICATION_REACT_FLAVOR: && env-cmd -f ../../common/config/env/.env node -p process.env.COMMUNICATION_REACT_FLAVOR",
92
92
  "_by-flavor": "rushx _current-flavor && env-cmd -f ../../common/config/env/.env --use-shell"
93
- },
94
- "devDependencies": {
95
- "@azure/communication-calling": "1.18.2-beta.1",
96
- "@azure/communication-calling-effects": "1.0.1",
97
- "@azure/communication-chat": "1.4.0-beta.2",
98
- "@azure/core-auth": "^1.4.0",
99
- "@babel/cli": "^7.16.0",
100
- "@babel/core": "^7.16.0",
101
- "@internal/calling-component-bindings": "1.9.0-alpha-202310201708",
102
- "@internal/calling-stateful-client": "1.9.0-alpha-202310201708",
103
- "@internal/chat-component-bindings": "1.9.0-alpha-202310201708",
104
- "@internal/chat-stateful-client": "1.9.0-alpha-202310201708",
105
- "@internal/fake-backends": "1.9.0-alpha-202310201708",
106
- "@internal/react-components": "1.9.0-alpha-202310201708",
107
- "@internal/react-composites": "1.9.0-alpha-202310201708",
108
- "@microsoft/api-documenter": "~7.23.9",
109
- "@microsoft/api-extractor": "~7.38.0",
110
- "@rollup/plugin-json": "^4.1.0",
111
- "@testing-library/jest-dom": "^5.16.5",
112
- "@testing-library/react": "^14.0.0",
113
- "@types/dompurify": "^3.0.2",
114
- "@types/jest": "^29.5.2",
115
- "@types/json-stringify-safe": "^5.0.0",
116
- "@types/node": "^16.11.7",
117
- "@types/react-dom": "18.2.14",
118
- "@types/react-linkify": "^1.0.0",
119
- "@types/react": "18.2.29",
120
- "@types/uuid": "^9.0.6",
121
- "@typescript-eslint/eslint-plugin": "^4.12.0",
122
- "@typescript-eslint/parser": "^4.12.0",
123
- "@zerollup/ts-transform-paths": "^1.7.18",
124
- "ajv": "^8.12.0",
125
- "copyfiles": "^2.4.1",
126
- "cpx": "^1.5.0",
127
- "cross-env": "^7.0.3",
128
- "env-cmd": "^10.1.0",
129
- "eslint-config-prettier": "^6.12.0",
130
- "eslint-plugin-header": "^3.1.0",
131
- "eslint-plugin-import": "^2.22.1",
132
- "eslint-plugin-jsx-a11y": "^6.3.1",
133
- "eslint-plugin-prettier": "^3.1.4",
134
- "eslint-plugin-react-hooks": "^4.1.2",
135
- "eslint-plugin-react": "^7.18.3",
136
- "eslint": "^7.7.0",
137
- "if-env": "^1.0.4",
138
- "jest": "29.7.0",
139
- "json-stringify-safe": "^5.0.1",
140
- "node-forge": ">=1.0.0",
141
- "prettier": "2.3.1",
142
- "pretty-quick": "^3.1.0",
143
- "react-dom": "18.2.0",
144
- "react-is": "^17.0.1",
145
- "react": "18.2.0",
146
- "regenerator-runtime": "^0.14.0",
147
- "renamer": "^4.0.0",
148
- "rimraf": "^2.6.2",
149
- "rollup": "^2.42.4",
150
- "scheduler": "^0.23.0",
151
- "source-map-explorer": "^2.5.0",
152
- "styled-components": "^5.2.1",
153
- "ts-jest": "^29.1.0",
154
- "ts-node": "^10.9.1",
155
- "ttypescript": "^1.5.12",
156
- "type-fest": "^2.5.4",
157
- "typescript": "4.3.5"
158
- },
159
- "beachball": {
160
- "shouldPublish": false
161
93
  }
162
94
  }
@@ -1,61 +0,0 @@
1
- import { AudioDeviceInfo, Call, DtmfTone, ParticipantRole, PermissionConstraints, VideoDeviceInfo } from '@azure/communication-calling';
2
- import { EnvironmentInfo } from '@azure/communication-calling';
3
- import type { CallAdapter, CallAdapterState } from './adapter';
4
- /**
5
- * Temporary copy of the packages/react-composites/tests/browser/call/app/mocks/MockCallAdapter.ts
6
- * @internal
7
- */
8
- export declare class _MockCallAdapter implements CallAdapter {
9
- constructor(testState: {
10
- askDevicePermission?: (constrain: PermissionConstraints) => Promise<void>;
11
- localParticipantRole?: ParticipantRole;
12
- });
13
- state: CallAdapterState;
14
- private emitter;
15
- setState(state: CallAdapterState): void;
16
- addParticipant(): Promise<void>;
17
- onStateChange(handler: (state: CallAdapterState) => void): void;
18
- offStateChange(handler: (state: CallAdapterState) => void): void;
19
- allowUnsupportedBrowserVersion(): void;
20
- getState(): CallAdapterState;
21
- dispose(): void;
22
- joinCall(): Call | undefined;
23
- leaveCall(): Promise<void>;
24
- startCamera(): Promise<void>;
25
- stopCamera(): Promise<void>;
26
- mute(): Promise<void>;
27
- unmute(): Promise<void>;
28
- startCall(): Call | undefined;
29
- holdCall(): Promise<void>;
30
- resumeCall(): Promise<void>;
31
- startScreenShare(): Promise<void>;
32
- stopScreenShare(): Promise<void>;
33
- raiseHand(): Promise<void>;
34
- lowerHand(): Promise<void>;
35
- removeParticipant(): Promise<void>;
36
- createStreamView(): Promise<void>;
37
- disposeStreamView(): Promise<void>;
38
- disposeScreenShareStreamView(): Promise<void>;
39
- disposeLocalVideoStreamView(): Promise<void>;
40
- disposeRemoteVideoStreamView(): Promise<void>;
41
- askDevicePermission(constrain: PermissionConstraints): Promise<void>;
42
- queryCameras(): Promise<VideoDeviceInfo[]>;
43
- queryMicrophones(): Promise<AudioDeviceInfo[]>;
44
- querySpeakers(): Promise<AudioDeviceInfo[]>;
45
- setCamera(): Promise<void>;
46
- setMicrophone(): Promise<void>;
47
- setSpeaker(): Promise<void>;
48
- sendDtmfTone(dtmfTone: DtmfTone): Promise<void>;
49
- on(): void;
50
- off(): void;
51
- getEnvironmentInfo(): Promise<EnvironmentInfo>;
52
- startCaptions(): Promise<void>;
53
- setCaptionLanguage(): Promise<void>;
54
- setSpokenLanguage(): Promise<void>;
55
- stopCaptions(): Promise<void>;
56
- startVideoBackgroundEffect(): Promise<void>;
57
- stopVideoBackgroundEffects(): Promise<void>;
58
- updateBackgroundPickerImages(): void;
59
- updateSelectedVideoBackgroundEffect(): void;
60
- }
61
- //# sourceMappingURL=MockCallAdapter.d.ts.map
@@ -1,255 +0,0 @@
1
- // Copyright (c) Microsoft Corporation.
2
- // Licensed under the MIT License.
3
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
4
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
5
- return new (P || (P = Promise))(function (resolve, reject) {
6
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
7
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
8
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
9
- step((generator = generator.apply(thisArg, _arguments || [])).next());
10
- });
11
- };
12
- /* @conditional-compile-remove(teams-identity-support) */
13
- import { CallKind } from '@azure/communication-calling';
14
- import { EventEmitter } from 'events';
15
- /**
16
- * Temporary copy of the packages/react-composites/tests/browser/call/app/mocks/MockCallAdapter.ts
17
- * @internal
18
- */
19
- // TODO: Remove this simplified copy of the MockCallAdapter when the original MockCallAdapter is moved to fake-backends package and can be imported
20
- export class _MockCallAdapter {
21
- constructor(testState) {
22
- this.emitter = new EventEmitter();
23
- this.state = Object.assign({}, createDefaultCallAdapterState(/* @conditional-compile-remove(rooms) */ testState.localParticipantRole));
24
- if (testState.askDevicePermission) {
25
- this.askDevicePermission = testState.askDevicePermission;
26
- }
27
- }
28
- setState(state) {
29
- this.state = state;
30
- this.emitter.emit('stateChanged', state);
31
- }
32
- addParticipant() {
33
- throw Error('addParticipant not implemented');
34
- }
35
- onStateChange(handler) {
36
- this.emitter.addListener('stateChanged', handler);
37
- }
38
- offStateChange(handler) {
39
- this.emitter.removeListener('stateChanged', handler);
40
- }
41
- allowUnsupportedBrowserVersion() {
42
- throw Error('allowWithUnsupportedBrowserVersion not implemented');
43
- }
44
- getState() {
45
- return this.state;
46
- }
47
- dispose() {
48
- throw Error('dispose not implemented');
49
- }
50
- joinCall() {
51
- throw Error('joinCall not implemented');
52
- }
53
- leaveCall() {
54
- throw Error('leaveCall not implemented');
55
- }
56
- startCamera() {
57
- throw Error('leaveCall not implemented');
58
- }
59
- stopCamera() {
60
- throw Error('stopCamera not implemented');
61
- }
62
- mute() {
63
- throw Error('mute not implemented');
64
- }
65
- unmute() {
66
- throw Error('unmute not implemented');
67
- }
68
- startCall() {
69
- throw Error('startCall not implemented');
70
- }
71
- holdCall() {
72
- return Promise.resolve();
73
- }
74
- resumeCall() {
75
- return Promise.resolve();
76
- }
77
- startScreenShare() {
78
- throw Error('startScreenShare not implemented');
79
- }
80
- stopScreenShare() {
81
- throw Error('stopScreenShare not implemented');
82
- }
83
- /* @conditional-compile-remove(raise-hand) */
84
- raiseHand() {
85
- throw Error('raiseHand not implemented');
86
- }
87
- /* @conditional-compile-remove(raise-hand) */
88
- lowerHand() {
89
- throw Error('lowerHand not implemented');
90
- }
91
- removeParticipant() {
92
- throw Error('removeParticipant not implemented');
93
- }
94
- createStreamView() {
95
- throw Error('createStreamView not implemented');
96
- }
97
- disposeStreamView() {
98
- return Promise.resolve();
99
- }
100
- disposeScreenShareStreamView() {
101
- return Promise.resolve();
102
- }
103
- disposeLocalVideoStreamView() {
104
- return Promise.resolve();
105
- }
106
- disposeRemoteVideoStreamView() {
107
- return Promise.resolve();
108
- }
109
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
110
- askDevicePermission(constrain) {
111
- throw Error('askDevicePermission not implemented');
112
- }
113
- queryCameras() {
114
- return __awaiter(this, void 0, void 0, function* () {
115
- return [];
116
- });
117
- }
118
- queryMicrophones() {
119
- return __awaiter(this, void 0, void 0, function* () {
120
- return [];
121
- });
122
- }
123
- querySpeakers() {
124
- return __awaiter(this, void 0, void 0, function* () {
125
- return [];
126
- });
127
- }
128
- setCamera() {
129
- throw Error('setCamera not implemented');
130
- }
131
- setMicrophone() {
132
- throw Error('setMicrophone not implemented');
133
- }
134
- setSpeaker() {
135
- throw Error('setSpeaker not implemented');
136
- }
137
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
138
- sendDtmfTone(dtmfTone) {
139
- throw Error('sendDtmfTone not implemented');
140
- }
141
- on() {
142
- throw Error('on not implemented');
143
- }
144
- off() {
145
- throw Error('off not implemented');
146
- }
147
- /* @conditional-compile-remove(PSTN-calls) */
148
- getEnvironmentInfo() {
149
- throw Error('getEnvironmentInfo not implemented');
150
- }
151
- /* @conditional-compile-remove(close-captions) */
152
- startCaptions() {
153
- throw Error('start captions not implemented');
154
- }
155
- /* @conditional-compile-remove(close-captions) */
156
- setCaptionLanguage() {
157
- throw Error('setCaptionLanguage not implemented');
158
- }
159
- /* @conditional-compile-remove(close-captions) */
160
- setSpokenLanguage() {
161
- throw Error('setSpokenLanguage not implemented');
162
- }
163
- /* @conditional-compile-remove(close-captions) */
164
- stopCaptions() {
165
- throw Error('stopCaptions not implemented');
166
- }
167
- /* @conditional-compile-remove(video-background-effects) */
168
- startVideoBackgroundEffect() {
169
- throw new Error('startVideoBackgroundEffect not implemented.');
170
- }
171
- /* @conditional-compile-remove(video-background-effects) */
172
- stopVideoBackgroundEffects() {
173
- throw new Error('stopVideoBackgroundEffects not implemented.');
174
- }
175
- /* @conditional-compile-remove(video-background-effects) */
176
- updateBackgroundPickerImages() {
177
- throw new Error('updateBackgroundPickerImages not implemented.');
178
- }
179
- /* @conditional-compile-remove(video-background-effects) */
180
- updateSelectedVideoBackgroundEffect() {
181
- throw new Error('updateSelectedVideoBackgroundEffect not implemented.');
182
- }
183
- }
184
- /**
185
- * Default call adapter state that the {@link _MockCallAdapter} class is initialized with an optional role.
186
- */
187
- const createDefaultCallAdapterState = (role) => {
188
- return {
189
- displayName: 'Agnes Thompson',
190
- isLocalPreviewMicrophoneEnabled: true,
191
- page: 'call',
192
- call: {
193
- id: 'call1',
194
- /* @conditional-compile-remove(teams-identity-support) */
195
- kind: CallKind.Call,
196
- callerInfo: { displayName: 'caller', identifier: { kind: 'communicationUser', communicationUserId: '1' } },
197
- direction: 'Incoming',
198
- transcription: { isTranscriptionActive: false },
199
- recording: { isRecordingActive: false },
200
- startTime: new Date(500000000000),
201
- endTime: new Date(500000000000),
202
- diagnostics: { network: { latest: {} }, media: { latest: {} } },
203
- state: 'Connected',
204
- localVideoStreams: [],
205
- isMuted: false,
206
- isScreenSharingOn: false,
207
- remoteParticipants: {},
208
- remoteParticipantsEnded: {},
209
- /* @conditional-compile-remove(raise-hand) */
210
- raiseHand: { raisedHands: [] },
211
- /* @conditional-compile-remove(rooms) */
212
- role,
213
- /* @conditional-compile-remove(close-captions) */
214
- captionsFeature: {
215
- captions: [],
216
- supportedSpokenLanguages: [],
217
- supportedCaptionLanguages: [],
218
- currentCaptionLanguage: '',
219
- currentSpokenLanguage: '',
220
- isCaptionsFeatureActive: false,
221
- startCaptionsInProgress: false
222
- },
223
- /* @conditional-compile-remove(call-transfer) */
224
- transfer: {
225
- acceptedTransfers: {}
226
- },
227
- /* @conditional-compile-remove(optimal-video-count) */
228
- optimalVideoCount: {
229
- maxRemoteVideoStreams: 4
230
- }
231
- },
232
- userId: { kind: 'communicationUser', communicationUserId: '1' },
233
- devices: {
234
- isSpeakerSelectionAvailable: true,
235
- selectedCamera: { id: 'camera1', name: '1st Camera', deviceType: 'UsbCamera' },
236
- cameras: [{ id: 'camera1', name: '1st Camera', deviceType: 'UsbCamera' }],
237
- selectedMicrophone: {
238
- id: 'microphone1',
239
- name: '1st Microphone',
240
- deviceType: 'Microphone',
241
- isSystemDefault: true
242
- },
243
- microphones: [{ id: 'microphone1', name: '1st Microphone', deviceType: 'Microphone', isSystemDefault: true }],
244
- selectedSpeaker: { id: 'speaker1', name: '1st Speaker', deviceType: 'Speaker', isSystemDefault: true },
245
- speakers: [{ id: 'speaker1', name: '1st Speaker', deviceType: 'Speaker', isSystemDefault: true }],
246
- unparentedViews: [],
247
- deviceAccess: { video: true, audio: true }
248
- },
249
- isTeamsCall: false,
250
- /* @conditional-compile-remove(rooms) */
251
- isRoomsCall: false,
252
- latestErrors: {}
253
- };
254
- };
255
- //# sourceMappingURL=MockCallAdapter.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"MockCallAdapter.js","sourceRoot":"","sources":["../../../../../../../react-composites/src/composites/CallComposite/MockCallAdapter.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;;;;;;;;;;AAUlC,yDAAyD;AACzD,OAAO,EAAE,QAAQ,EAAE,MAAM,8BAA8B,CAAC;AAGxD,OAAO,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAC;AAGtC;;;GAGG;AACH,mJAAmJ;AACnJ,MAAM,OAAO,gBAAgB;IAC3B,YAAY,SAGX;QAYO,YAAO,GAAG,IAAI,YAAY,EAAE,CAAC;QAXnC,IAAI,CAAC,KAAK,qBACL,6BAA6B,CAAC,wCAAwC,CAAC,SAAS,CAAC,oBAAoB,CAAC,CAC1G,CAAC;QAEF,IAAI,SAAS,CAAC,mBAAmB,EAAE;YACjC,IAAI,CAAC,mBAAmB,GAAG,SAAS,CAAC,mBAAmB,CAAC;SAC1D;IACH,CAAC;IAMD,QAAQ,CAAC,KAAuB;QAC9B,IAAI,CAAC,KAAK,GAAG,KAA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AC9E,OAAO,EAAE,CAAC,EAAE,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,YAAY,EAAE,UAAU,EAAE,WAAW,EAAE,CAAC;YACzE,kBAAkB,EAAE;gBAClB,EAAE,EAAE,aAAa;gBACjB,IAAI,EAAE,gBAAgB;gBACtB,UAAU,EAAE,YAAY;gBACxB,eAAe,EAAE,IAAI;aACtB;YACD,WAAW,EAAE,CAAC,EAAE,EAAE,EAAE,aAAa,EAAE,IAAI,EAAE,gBAAgB,EAAE,UAAU,EAAE,YAAY,EAAE,eAAe,EAAE,IAAI,EAAE,CAAC;YAC7G,eAAe,EAAE,EAAE,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,aAAa,EAAE,UAAU,EAAE,SAAS,EAAE,eAAe,EAAE,IAAI,EAAE;YACtG,QAAQ,EAAE,CAAC,EAAE,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,aAAa,EAAE,UAAU,EAAE,SAAS,EAAE,eAAe,EAAE,IAAI,EAAE,CAAC;YACjG,eAAe,EAAE,EAAE;YACnB,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE;SAC3C;QACD,WAAW,EAAE,KAAK;QAClB,wCAAwC;QACxC,WAAW,EAAE,KAAK;QAClB,YAAY,EAAE,EAAE;KACjB,CAAC;AACJ,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport {\n AudioDeviceInfo,\n Call,\n DtmfTone,\n ParticipantRole,\n PermissionConstraints,\n VideoDeviceInfo\n} from '@azure/communication-calling';\n/* @conditional-compile-remove(teams-identity-support) */\nimport { CallKind } from '@azure/communication-calling';\n/* @conditional-compile-remove(PSTN-calls) */\nimport { EnvironmentInfo } from '@azure/communication-calling';\nimport { EventEmitter } from 'events';\nimport type { CallAdapter, CallAdapterState } from './adapter';\n\n/**\n * Temporary copy of the packages/react-composites/tests/browser/call/app/mocks/MockCallAdapter.ts\n * @internal\n */\n// TODO: Remove this simplified copy of the MockCallAdapter when the original MockCallAdapter is moved to fake-backends package and can be imported\nexport class _MockCallAdapter implements CallAdapter {\n constructor(testState: {\n askDevicePermission?: (constrain: PermissionConstraints) => Promise<void>;\n localParticipantRole?: ParticipantRole;\n }) {\n this.state = {\n ...createDefaultCallAdapterState(/* @conditional-compile-remove(rooms) */ testState.localParticipantRole)\n };\n\n if (testState.askDevicePermission) {\n this.askDevicePermission = testState.askDevicePermission;\n }\n }\n\n state: CallAdapterState;\n\n private emitter = new EventEmitter();\n\n setState(state: CallAdapterState): void {\n this.state = state;\n this.emitter.emit('stateChanged', state);\n }\n\n addParticipant(): Promise<void> {\n throw Error('addParticipant not implemented');\n }\n onStateChange(handler: (state: CallAdapterState) => void): void {\n this.emitter.addListener('stateChanged', handler);\n }\n offStateChange(handler: (state: CallAdapterState) => void): void {\n this.emitter.removeListener('stateChanged', handler);\n }\n allowUnsupportedBrowserVersion(): void {\n throw Error('allowWithUnsupportedBrowserVersion not implemented');\n }\n getState(): CallAdapterState {\n return this.state;\n }\n dispose(): void {\n throw Error('dispose not implemented');\n }\n joinCall(): Call | undefined {\n throw Error('joinCall not implemented');\n }\n leaveCall(): Promise<void> {\n throw Error('leaveCall not implemented');\n }\n startCamera(): Promise<void> {\n throw Error('leaveCall not implemented');\n }\n stopCamera(): Promise<void> {\n throw Error('stopCamera not implemented');\n }\n mute(): Promise<void> {\n throw Error('mute not implemented');\n }\n unmute(): Promise<void> {\n throw Error('unmute not implemented');\n }\n startCall(): Call | undefined {\n throw Error('startCall not implemented');\n }\n holdCall(): Promise<void> {\n return Promise.resolve();\n }\n resumeCall(): Promise<void> {\n return Promise.resolve();\n }\n startScreenShare(): Promise<void> {\n throw Error('startScreenShare not implemented');\n }\n stopScreenShare(): Promise<void> {\n throw Error('stopScreenShare not implemented');\n }\n /* @conditional-compile-remove(raise-hand) */\n raiseHand(): Promise<void> {\n throw Error('raiseHand not implemented');\n }\n /* @conditional-compile-remove(raise-hand) */\n lowerHand(): Promise<void> {\n throw Error('lowerHand not implemented');\n }\n removeParticipant(): Promise<void> {\n throw Error('removeParticipant not implemented');\n }\n createStreamView(): Promise<void> {\n throw Error('createStreamView not implemented');\n }\n disposeStreamView(): Promise<void> {\n return Promise.resolve();\n }\n disposeScreenShareStreamView(): Promise<void> {\n return Promise.resolve();\n }\n disposeLocalVideoStreamView(): Promise<void> {\n return Promise.resolve();\n }\n disposeRemoteVideoStreamView(): Promise<void> {\n return Promise.resolve();\n }\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n askDevicePermission(constrain: PermissionConstraints): Promise<void> {\n throw Error('askDevicePermission not implemented');\n }\n async queryCameras(): Promise<VideoDeviceInfo[]> {\n return [];\n }\n async queryMicrophones(): Promise<AudioDeviceInfo[]> {\n return [];\n }\n async querySpeakers(): Promise<AudioDeviceInfo[]> {\n return [];\n }\n setCamera(): Promise<void> {\n throw Error('setCamera not implemented');\n }\n setMicrophone(): Promise<void> {\n throw Error('setMicrophone not implemented');\n }\n setSpeaker(): Promise<void> {\n throw Error('setSpeaker not implemented');\n }\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n sendDtmfTone(dtmfTone: DtmfTone): Promise<void> {\n throw Error('sendDtmfTone not implemented');\n }\n on(): void {\n throw Error('on not implemented');\n }\n off(): void {\n throw Error('off not implemented');\n }\n /* @conditional-compile-remove(PSTN-calls) */\n getEnvironmentInfo(): Promise<EnvironmentInfo> {\n throw Error('getEnvironmentInfo not implemented');\n }\n\n /* @conditional-compile-remove(close-captions) */\n startCaptions(): Promise<void> {\n throw Error('start captions not implemented');\n }\n\n /* @conditional-compile-remove(close-captions) */\n setCaptionLanguage(): Promise<void> {\n throw Error('setCaptionLanguage not implemented');\n }\n\n /* @conditional-compile-remove(close-captions) */\n setSpokenLanguage(): Promise<void> {\n throw Error('setSpokenLanguage not implemented');\n }\n\n /* @conditional-compile-remove(close-captions) */\n stopCaptions(): Promise<void> {\n throw Error('stopCaptions not implemented');\n }\n /* @conditional-compile-remove(video-background-effects) */\n startVideoBackgroundEffect(): Promise<void> {\n throw new Error('startVideoBackgroundEffect not implemented.');\n }\n\n /* @conditional-compile-remove(video-background-effects) */\n stopVideoBackgroundEffects(): Promise<void> {\n throw new Error('stopVideoBackgroundEffects not implemented.');\n }\n /* @conditional-compile-remove(video-background-effects) */\n updateBackgroundPickerImages(): void {\n throw new Error('updateBackgroundPickerImages not implemented.');\n }\n /* @conditional-compile-remove(video-background-effects) */\n public updateSelectedVideoBackgroundEffect(): void {\n throw new Error('updateSelectedVideoBackgroundEffect not implemented.');\n }\n}\n\n/**\n * Default call adapter state that the {@link _MockCallAdapter} class is initialized with an optional role.\n */\nconst createDefaultCallAdapterState = (role?: ParticipantRole): CallAdapterState => {\n return {\n displayName: 'Agnes Thompson',\n isLocalPreviewMicrophoneEnabled: true,\n page: 'call',\n call: {\n id: 'call1',\n /* @conditional-compile-remove(teams-identity-support) */\n kind: CallKind.Call,\n callerInfo: { displayName: 'caller', identifier: { kind: 'communicationUser', communicationUserId: '1' } },\n direction: 'Incoming',\n transcription: { isTranscriptionActive: false },\n recording: { isRecordingActive: false },\n startTime: new Date(500000000000),\n endTime: new Date(500000000000),\n diagnostics: { network: { latest: {} }, media: { latest: {} } },\n state: 'Connected',\n localVideoStreams: [],\n isMuted: false,\n isScreenSharingOn: false,\n remoteParticipants: {},\n remoteParticipantsEnded: {},\n /* @conditional-compile-remove(raise-hand) */\n raiseHand: { raisedHands: [] },\n /* @conditional-compile-remove(rooms) */\n role,\n /* @conditional-compile-remove(close-captions) */\n captionsFeature: {\n captions: [],\n supportedSpokenLanguages: [],\n supportedCaptionLanguages: [],\n currentCaptionLanguage: '',\n currentSpokenLanguage: '',\n isCaptionsFeatureActive: false,\n startCaptionsInProgress: false\n },\n /* @conditional-compile-remove(call-transfer) */\n transfer: {\n acceptedTransfers: {}\n },\n /* @conditional-compile-remove(optimal-video-count) */\n optimalVideoCount: {\n maxRemoteVideoStreams: 4\n }\n },\n userId: { kind: 'communicationUser', communicationUserId: '1' },\n devices: {\n isSpeakerSelectionAvailable: true,\n selectedCamera: { id: 'camera1', name: '1st Camera', deviceType: 'UsbCamera' },\n cameras: [{ id: 'camera1', name: '1st Camera', deviceType: 'UsbCamera' }],\n selectedMicrophone: {\n id: 'microphone1',\n name: '1st Microphone',\n deviceType: 'Microphone',\n isSystemDefault: true\n },\n microphones: [{ id: 'microphone1', name: '1st Microphone', deviceType: 'Microphone', isSystemDefault: true }],\n selectedSpeaker: { id: 'speaker1', name: '1st Speaker', deviceType: 'Speaker', isSystemDefault: true },\n speakers: [{ id: 'speaker1', name: '1st Speaker', deviceType: 'Speaker', isSystemDefault: true }],\n unparentedViews: [],\n deviceAccess: { video: true, audio: true }\n },\n isTeamsCall: false,\n /* @conditional-compile-remove(rooms) */\n isRoomsCall: false,\n latestErrors: {}\n };\n};\n"]}