@azure/communication-react 1.27.0-alpha-202505130018 → 1.27.0-alpha-202505160018
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 +106 -14
- package/dist/dist-cjs/communication-react/{ChatMessageComponentAsRichTextEditBox-lebdeYFI.js → ChatMessageComponentAsRichTextEditBox-C20qxl6E.js} +2 -2
- package/dist/dist-cjs/communication-react/{ChatMessageComponentAsRichTextEditBox-lebdeYFI.js.map → ChatMessageComponentAsRichTextEditBox-C20qxl6E.js.map} +1 -1
- package/dist/dist-cjs/communication-react/{RichTextSendBoxWrapper-BG5TP-SA.js → RichTextSendBoxWrapper-D22PKCuE.js} +2 -2
- package/dist/dist-cjs/communication-react/{RichTextSendBoxWrapper-BG5TP-SA.js.map → RichTextSendBoxWrapper-D22PKCuE.js.map} +1 -1
- package/dist/dist-cjs/communication-react/{index-BHKNAQgT.js → index-BvHrAaZO.js} +31 -12
- package/dist/dist-cjs/communication-react/index-BvHrAaZO.js.map +1 -0
- package/dist/dist-cjs/communication-react/index.js +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/acs-ui-javascript-loaders/src/callCompositeLoader.d.ts +25 -3
- package/dist/dist-esm/acs-ui-javascript-loaders/src/callCompositeLoader.js +12 -2
- package/dist/dist-esm/acs-ui-javascript-loaders/src/callCompositeLoader.js.map +1 -1
- package/dist/dist-esm/acs-ui-javascript-loaders/src/callWithChatCompositeLoader.d.ts +29 -3
- package/dist/dist-esm/acs-ui-javascript-loaders/src/callWithChatCompositeLoader.js +12 -2
- package/dist/dist-esm/acs-ui-javascript-loaders/src/callWithChatCompositeLoader.js.map +1 -1
- package/dist/dist-esm/acs-ui-javascript-loaders/src/chatCompositeLoader.d.ts +21 -3
- package/dist/dist-esm/acs-ui-javascript-loaders/src/chatCompositeLoader.js +11 -2
- package/dist/dist-esm/acs-ui-javascript-loaders/src/chatCompositeLoader.js.map +1 -1
- package/dist/dist-esm/acs-ui-javascript-loaders/src/outboundCallCompositeLoader.d.ts +28 -3
- package/dist/dist-esm/acs-ui-javascript-loaders/src/outboundCallCompositeLoader.js.map +1 -1
- package/dist/dist-esm/calling-component-bindings/src/handlers/createTeamsCallHandlers.js +9 -1
- package/dist/dist-esm/calling-component-bindings/src/handlers/createTeamsCallHandlers.js.map +1 -1
- package/dist/dist-esm/calling-stateful-client/src/CallClientState.d.ts +1 -1
- package/dist/dist-esm/calling-stateful-client/src/CallClientState.js.map +1 -1
- package/dist/dist-esm/calling-stateful-client/src/StatefulCallClient.js +10 -0
- package/dist/dist-esm/calling-stateful-client/src/StatefulCallClient.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/CaptionsBanner.js +5 -7
- package/dist/dist-esm/react-components/src/components/CaptionsBanner.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/AzureCommunicationCallAdapter.d.ts +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/AzureCommunicationCallAdapter.js +2 -0
- package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/AzureCommunicationCallAdapter.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/CallWithChatAdapter.d.ts +2 -1
- package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/CallWithChatAdapter.js.map +1 -1
- package/dist/tsdoc-metadata.json +1 -1
- package/package.json +6 -6
- package/dist/dist-cjs/communication-react/index-BHKNAQgT.js.map +0 -1
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"telemetryVersion.js","sourceRoot":"","sources":["../../../../../acs-ui-common/src/telemetryVersion.js"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;AAElC,wCAAwC;AAExC,MAAM,CAAC,OAAO,GAAG,2BAA2B,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\n// GENERATED FILE. DO NOT EDIT MANUALLY.\n\nmodule.exports = '1.27.0-alpha-
|
1
|
+
{"version":3,"file":"telemetryVersion.js","sourceRoot":"","sources":["../../../../../acs-ui-common/src/telemetryVersion.js"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;AAElC,wCAAwC;AAExC,MAAM,CAAC,OAAO,GAAG,2BAA2B,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\n// GENERATED FILE. DO NOT EDIT MANUALLY.\n\nmodule.exports = '1.27.0-alpha-202505160018';\n"]}
|
@@ -9,16 +9,38 @@ import { AzureCommunicationCallAdapterOptions, CallAdapter, CallAdapterLocator,
|
|
9
9
|
*
|
10
10
|
* @public
|
11
11
|
*/
|
12
|
-
export
|
12
|
+
export interface CallCompositeLoaderProps extends Partial<BaseCompositeProps<CallCompositeIcons>> {
|
13
|
+
/**
|
14
|
+
* UserId for the local user.
|
15
|
+
*/
|
13
16
|
userId: CommunicationUserIdentifier;
|
17
|
+
/**
|
18
|
+
* CommunicationTokenCredential for the local user.
|
19
|
+
*/
|
14
20
|
credential: CommunicationTokenCredential;
|
21
|
+
/**
|
22
|
+
* Display name for the local user.
|
23
|
+
*/
|
15
24
|
displayName: string;
|
25
|
+
/**
|
26
|
+
* locator for the call
|
27
|
+
*/
|
16
28
|
locator: CallAdapterLocator;
|
29
|
+
/**
|
30
|
+
* Options for the {@link AzureCommunicationCallAdapter}
|
31
|
+
* This is used to configure the call adapter.
|
32
|
+
*/
|
17
33
|
callAdapterOptions?: AzureCommunicationCallAdapterOptions;
|
34
|
+
/**
|
35
|
+
* Options for the {@link CallComposite} {@link CallCompositeOptions}
|
36
|
+
* This is used to configure the call composite.
|
37
|
+
*/
|
18
38
|
callCompositeOptions?: CallCompositeOptions;
|
19
|
-
|
39
|
+
/**
|
40
|
+
* Device form factor for the composite.
|
41
|
+
*/
|
20
42
|
formFactor?: 'mobile' | 'desktop';
|
21
|
-
}
|
43
|
+
}
|
22
44
|
/**
|
23
45
|
* Loader function for the CallComposite that you can use in your application. This
|
24
46
|
* function will load the CallComposite into the provided HTML element. The best use case for this
|
@@ -26,7 +26,7 @@ import { initializeIcons } from '@fluentui/react';
|
|
26
26
|
export const loadCallComposite = function (loaderArgs, htmlElement) {
|
27
27
|
return __awaiter(this, void 0, void 0, function* () {
|
28
28
|
initializeIcons();
|
29
|
-
const { userId, credential, displayName, locator, callAdapterOptions, callCompositeOptions,
|
29
|
+
const { userId, credential, displayName, locator, callAdapterOptions, callCompositeOptions, formFactor, fluentTheme, icons, onFetchAvatarPersonaData, onFetchParticipantMenuItems, rtl, locale } = loaderArgs;
|
30
30
|
const adapter = yield createAzureCommunicationCallAdapter({
|
31
31
|
userId,
|
32
32
|
displayName: displayName !== null && displayName !== void 0 ? displayName : 'anonymous',
|
@@ -37,7 +37,17 @@ export const loadCallComposite = function (loaderArgs, htmlElement) {
|
|
37
37
|
if (!htmlElement) {
|
38
38
|
throw new Error('Failed to find the root element');
|
39
39
|
}
|
40
|
-
createRoot(htmlElement).render(React.createElement(CallComposite,
|
40
|
+
createRoot(htmlElement).render(React.createElement(CallComposite, {
|
41
|
+
options: callCompositeOptions,
|
42
|
+
adapter,
|
43
|
+
formFactor,
|
44
|
+
fluentTheme,
|
45
|
+
icons,
|
46
|
+
locale,
|
47
|
+
onFetchAvatarPersonaData,
|
48
|
+
onFetchParticipantMenuItems,
|
49
|
+
rtl
|
50
|
+
}, null));
|
41
51
|
return adapter;
|
42
52
|
});
|
43
53
|
};
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"callCompositeLoader.js","sourceRoot":"","sources":["../../../../../acs-ui-javascript-loaders/src/callCompositeLoader.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;;;;;;;;;;AAElC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAE5C,MAAM,YAAY,GAAG,KAAK,CAAC,OAAO,CAAC;AACnC,iBAAiB,CAAC,YAAY,CAAC,CAAC;AAEhC,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAE9C,OAAO,EACL,aAAa,EACb,mCAAmC,EAOpC,gDAAmC;AACpC,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;
|
1
|
+
{"version":3,"file":"callCompositeLoader.js","sourceRoot":"","sources":["../../../../../acs-ui-javascript-loaders/src/callCompositeLoader.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;;;;;;;;;;AAElC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAE5C,MAAM,YAAY,GAAG,KAAK,CAAC,OAAO,CAAC;AACnC,iBAAiB,CAAC,YAAY,CAAC,CAAC;AAEhC,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAE9C,OAAO,EACL,aAAa,EACb,mCAAmC,EAOpC,gDAAmC;AACpC,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AA4ClD;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG,UAC/B,UAAoC,EACpC,WAAwB;;QAExB,eAAe,EAAE,CAAC;QAClB,MAAM,EACJ,MAAM,EACN,UAAU,EACV,WAAW,EACX,OAAO,EACP,kBAAkB,EAClB,oBAAoB,EACpB,UAAU,EACV,WAAW,EACX,KAAK,EACL,wBAAwB,EACxB,2BAA2B,EAC3B,GAAG,EACH,MAAM,EACP,GAAG,UAAU,CAAC;QACf,MAAM,OAAO,GAAG,MAAM,mCAAmC,CAAC;YACxD,MAAM;YACN,WAAW,EAAE,WAAW,aAAX,WAAW,cAAX,WAAW,GAAI,WAAW;YACvC,UAAU;YACV,OAAO;YACP,OAAO,EAAE,kBAAkB;SAC5B,CAAC,CAAC;QAEH,IAAI,CAAC,WAAW,EAAE,CAAC;YACjB,MAAM,IAAI,KAAK,CAAC,iCAAiC,CAAC,CAAC;QACrD,CAAC;QAED,UAAU,CAAC,WAAW,CAAC,CAAC,MAAM,CAC5B,KAAK,CAAC,aAAa,CACjB,aAAa,EACb;YACE,OAAO,EAAE,oBAAoB;YAC7B,OAAO;YACP,UAAU;YACV,WAAW;YACX,KAAK;YACL,MAAM;YACN,wBAAwB;YACxB,2BAA2B;YAC3B,GAAG;SACJ,EACD,IAAI,CACL,CACF,CAAC;QACF,OAAO,OAAO,CAAC;IACjB,CAAC;CAAA,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport React from 'react';\nimport { parseReactVersion } from './utils';\n\nconst reactVersion = React.version;\nparseReactVersion(reactVersion);\n\nimport { createRoot } from 'react-dom/client';\nimport { CommunicationTokenCredential, CommunicationUserIdentifier } from '@azure/communication-common';\nimport {\n CallComposite,\n createAzureCommunicationCallAdapter,\n AzureCommunicationCallAdapterOptions,\n CallAdapter,\n CallAdapterLocator,\n CallCompositeOptions,\n BaseCompositeProps,\n CallCompositeIcons\n} from '@internal/react-composites';\nimport { initializeIcons } from '@fluentui/react';\n\n/**\n * Props for the OutboundCallComposite that you can use in your application.\n *\n * Contains two options bags:\n * - adapterOptions: Options for the {@link AzureCommunicationCallAdapter}\n * - callCompositeOptions: Options for the {@link CallComposite} {@link CallCompositeOptions}\n *\n * @public\n */\nexport interface CallCompositeLoaderProps extends Partial<BaseCompositeProps<CallCompositeIcons>> {\n /**\n * UserId for the local user.\n */\n userId: CommunicationUserIdentifier;\n /**\n * CommunicationTokenCredential for the local user.\n */\n credential: CommunicationTokenCredential;\n /**\n * Display name for the local user.\n */\n displayName: string;\n /**\n * locator for the call\n */\n locator: CallAdapterLocator;\n /**\n * Options for the {@link AzureCommunicationCallAdapter}\n * This is used to configure the call adapter.\n */\n callAdapterOptions?: AzureCommunicationCallAdapterOptions;\n /**\n * Options for the {@link CallComposite} {@link CallCompositeOptions}\n * This is used to configure the call composite.\n */\n callCompositeOptions?: CallCompositeOptions;\n /**\n * Device form factor for the composite.\n */\n formFactor?: 'mobile' | 'desktop';\n}\n\n/**\n * Loader function for the CallComposite that you can use in your application. This\n * function will load the CallComposite into the provided HTML element. The best use case for this\n * is in a Node ui framework that is not React based.\n *\n * @public\n */\nexport const loadCallComposite = async function (\n loaderArgs: CallCompositeLoaderProps,\n htmlElement: HTMLElement\n): Promise<CallAdapter | undefined> {\n initializeIcons();\n const {\n userId,\n credential,\n displayName,\n locator,\n callAdapterOptions,\n callCompositeOptions,\n formFactor,\n fluentTheme,\n icons,\n onFetchAvatarPersonaData,\n onFetchParticipantMenuItems,\n rtl,\n locale\n } = loaderArgs;\n const adapter = await createAzureCommunicationCallAdapter({\n userId,\n displayName: displayName ?? 'anonymous',\n credential,\n locator,\n options: callAdapterOptions\n });\n\n if (!htmlElement) {\n throw new Error('Failed to find the root element');\n }\n\n createRoot(htmlElement).render(\n React.createElement(\n CallComposite,\n {\n options: callCompositeOptions,\n adapter,\n formFactor,\n fluentTheme,\n icons,\n locale,\n onFetchAvatarPersonaData,\n onFetchParticipantMenuItems,\n rtl\n },\n null\n )\n );\n return adapter;\n};\n"]}
|
@@ -8,17 +8,43 @@ import { CallWithChatAdapter, CallAndChatLocator, CallWithChatCompositeOptions,
|
|
8
8
|
* - callCompositeOptions: Options for the {@link CallWithChatComposite} {@link CallWithChatCompositeOptions}
|
9
9
|
* @public
|
10
10
|
*/
|
11
|
-
export
|
11
|
+
export interface CallWithChatCompositeLoaderProps extends Partial<BaseCompositeProps<CallWithChatCompositeIcons>> {
|
12
|
+
/**
|
13
|
+
* UserId for the local user.
|
14
|
+
*/
|
12
15
|
userId: CommunicationUserIdentifier;
|
16
|
+
/**
|
17
|
+
* CommunicationTokenCredential for the local user.
|
18
|
+
*/
|
13
19
|
credential: CommunicationTokenCredential;
|
20
|
+
/**
|
21
|
+
* Display name for the local user.
|
22
|
+
*/
|
14
23
|
displayName: string;
|
24
|
+
/**
|
25
|
+
* Azure communication service endpoint. This used for the token and joining the chat thread.
|
26
|
+
*/
|
15
27
|
endpoint: string;
|
28
|
+
/**
|
29
|
+
* Locator for the call and the chat thread.
|
30
|
+
* This is used to join the call and the chat thread.
|
31
|
+
*/
|
16
32
|
locator: CallAndChatLocator;
|
33
|
+
/**
|
34
|
+
* Options for the {@link AzureCommunicationCallAdapterOptions}
|
35
|
+
* This is used to configure the call adapter.
|
36
|
+
*/
|
17
37
|
callAdapterOptions?: AzureCommunicationCallAdapterOptions;
|
38
|
+
/**
|
39
|
+
* Options for the {@link CallWithChatComposite} {@link CallWithChatCompositeOptions}
|
40
|
+
* This is used to configure the call composite.
|
41
|
+
*/
|
18
42
|
callWithChatCompositeOptions?: CallWithChatCompositeOptions;
|
19
|
-
|
43
|
+
/**
|
44
|
+
* Device form factor for the composite.
|
45
|
+
*/
|
20
46
|
formFactor?: 'mobile' | 'desktop';
|
21
|
-
}
|
47
|
+
}
|
22
48
|
/**
|
23
49
|
* Props for the CallWithChatComposite that you can use in your application. This
|
24
50
|
* function will load the CallWithChatComposite into the provided HTML element.
|
@@ -26,7 +26,7 @@ import { initializeIcons } from '@fluentui/react';
|
|
26
26
|
export const loadCallWithChatComposite = function (loaderArgs, htmlElement) {
|
27
27
|
return __awaiter(this, void 0, void 0, function* () {
|
28
28
|
initializeIcons();
|
29
|
-
const { userId, credential, displayName, endpoint, locator, callAdapterOptions, callWithChatCompositeOptions,
|
29
|
+
const { userId, credential, displayName, endpoint, locator, callAdapterOptions, callWithChatCompositeOptions, formFactor, fluentTheme, locale, icons, onFetchAvatarPersonaData, onFetchParticipantMenuItems, rtl } = loaderArgs;
|
30
30
|
const adapter = yield createAzureCommunicationCallWithChatAdapter({
|
31
31
|
userId,
|
32
32
|
displayName: displayName !== null && displayName !== void 0 ? displayName : 'anonymous',
|
@@ -38,7 +38,17 @@ export const loadCallWithChatComposite = function (loaderArgs, htmlElement) {
|
|
38
38
|
if (!htmlElement) {
|
39
39
|
throw new Error('Failed to find the root element');
|
40
40
|
}
|
41
|
-
createRoot(htmlElement).render(React.createElement(CallWithChatComposite,
|
41
|
+
createRoot(htmlElement).render(React.createElement(CallWithChatComposite, {
|
42
|
+
options: callWithChatCompositeOptions,
|
43
|
+
adapter,
|
44
|
+
formFactor,
|
45
|
+
fluentTheme,
|
46
|
+
icons,
|
47
|
+
locale,
|
48
|
+
onFetchAvatarPersonaData,
|
49
|
+
onFetchParticipantMenuItems,
|
50
|
+
rtl
|
51
|
+
}, null));
|
42
52
|
return adapter;
|
43
53
|
});
|
44
54
|
};
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"callWithChatCompositeLoader.js","sourceRoot":"","sources":["../../../../../acs-ui-javascript-loaders/src/callWithChatCompositeLoader.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;;;;;;;;;;AAElC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAE5C,MAAM,YAAY,GAAG,KAAK,CAAC,OAAO,CAAC;AACnC,iBAAiB,CAAC,YAAY,CAAC,CAAC;AAEhC,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAE9C,OAAO,EAIL,2CAA2C,EAC3C,qBAAqB,EAItB,gDAAmC;AACpC,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;
|
1
|
+
{"version":3,"file":"callWithChatCompositeLoader.js","sourceRoot":"","sources":["../../../../../acs-ui-javascript-loaders/src/callWithChatCompositeLoader.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;;;;;;;;;;AAElC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAE5C,MAAM,YAAY,GAAG,KAAK,CAAC,OAAO,CAAC;AACnC,iBAAiB,CAAC,YAAY,CAAC,CAAC;AAEhC,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAE9C,OAAO,EAIL,2CAA2C,EAC3C,qBAAqB,EAItB,gDAAmC;AACpC,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAgDlD;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,yBAAyB,GAAG,UACvC,UAA4C,EAC5C,WAAwB;;QAExB,eAAe,EAAE,CAAC;QAClB,MAAM,EACJ,MAAM,EACN,UAAU,EACV,WAAW,EACX,QAAQ,EACR,OAAO,EACP,kBAAkB,EAClB,4BAA4B,EAC5B,UAAU,EACV,WAAW,EACX,MAAM,EACN,KAAK,EACL,wBAAwB,EACxB,2BAA2B,EAC3B,GAAG,EACJ,GAAG,UAAU,CAAC;QACf,MAAM,OAAO,GAAG,MAAM,2CAA2C,CAAC;YAChE,MAAM;YACN,WAAW,EAAE,WAAW,aAAX,WAAW,cAAX,WAAW,GAAI,WAAW;YACvC,UAAU;YACV,QAAQ,EAAE,QAAQ;YAClB,OAAO,EAAE,OAAO;YAChB,kBAAkB;SACnB,CAAC,CAAC;QAEH,IAAI,CAAC,WAAW,EAAE,CAAC;YACjB,MAAM,IAAI,KAAK,CAAC,iCAAiC,CAAC,CAAC;QACrD,CAAC;QAED,UAAU,CAAC,WAAW,CAAC,CAAC,MAAM,CAC5B,KAAK,CAAC,aAAa,CACjB,qBAAqB,EACrB;YACE,OAAO,EAAE,4BAA4B;YACrC,OAAO;YACP,UAAU;YACV,WAAW;YACX,KAAK;YACL,MAAM;YACN,wBAAwB;YACxB,2BAA2B;YAC3B,GAAG;SACJ,EACD,IAAI,CACL,CACF,CAAC;QACF,OAAO,OAAO,CAAC;IACjB,CAAC;CAAA,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport React from 'react';\nimport { parseReactVersion } from './utils';\n\nconst reactVersion = React.version;\nparseReactVersion(reactVersion);\n\nimport { createRoot } from 'react-dom/client';\nimport { CommunicationTokenCredential, CommunicationUserIdentifier } from '@azure/communication-common';\nimport {\n CallWithChatAdapter,\n CallAndChatLocator,\n CallWithChatCompositeOptions,\n createAzureCommunicationCallWithChatAdapter,\n CallWithChatComposite,\n AzureCommunicationCallAdapterOptions,\n BaseCompositeProps,\n CallWithChatCompositeIcons\n} from '@internal/react-composites';\nimport { initializeIcons } from '@fluentui/react';\n\n/**\n * Props for the CallWithChatComposite that you can use in your application.\n *\n * Contains two options bags:\n * - adapterOptions: Options for the {@link AzureCommunicationCallAdapterOptions}\n * - callCompositeOptions: Options for the {@link CallWithChatComposite} {@link CallWithChatCompositeOptions}\n * @public\n */\nexport interface CallWithChatCompositeLoaderProps extends Partial<BaseCompositeProps<CallWithChatCompositeIcons>> {\n /**\n * UserId for the local user.\n */\n userId: CommunicationUserIdentifier;\n /**\n * CommunicationTokenCredential for the local user.\n */\n credential: CommunicationTokenCredential;\n /**\n * Display name for the local user.\n */\n displayName: string;\n /**\n * Azure communication service endpoint. This used for the token and joining the chat thread.\n */\n endpoint: string;\n /**\n * Locator for the call and the chat thread.\n * This is used to join the call and the chat thread.\n */\n locator: CallAndChatLocator;\n /**\n * Options for the {@link AzureCommunicationCallAdapterOptions}\n * This is used to configure the call adapter.\n */\n callAdapterOptions?: AzureCommunicationCallAdapterOptions;\n /**\n * Options for the {@link CallWithChatComposite} {@link CallWithChatCompositeOptions}\n * This is used to configure the call composite.\n */\n callWithChatCompositeOptions?: CallWithChatCompositeOptions;\n /**\n * Device form factor for the composite.\n */\n formFactor?: 'mobile' | 'desktop';\n}\n\n/**\n * Props for the CallWithChatComposite that you can use in your application. This\n * function will load the CallWithChatComposite into the provided HTML element.\n * The best use case for this is in a Node UI framework that is not React based.\n *\n * @public\n */\nexport const loadCallWithChatComposite = async function (\n loaderArgs: CallWithChatCompositeLoaderProps,\n htmlElement: HTMLElement\n): Promise<CallWithChatAdapter | undefined> {\n initializeIcons();\n const {\n userId,\n credential,\n displayName,\n endpoint,\n locator,\n callAdapterOptions,\n callWithChatCompositeOptions,\n formFactor,\n fluentTheme,\n locale,\n icons,\n onFetchAvatarPersonaData,\n onFetchParticipantMenuItems,\n rtl\n } = loaderArgs;\n const adapter = await createAzureCommunicationCallWithChatAdapter({\n userId,\n displayName: displayName ?? 'anonymous',\n credential,\n endpoint: endpoint,\n locator: locator,\n callAdapterOptions\n });\n\n if (!htmlElement) {\n throw new Error('Failed to find the root element');\n }\n\n createRoot(htmlElement).render(\n React.createElement(\n CallWithChatComposite,\n {\n options: callWithChatCompositeOptions,\n adapter,\n formFactor,\n fluentTheme,\n icons,\n locale,\n onFetchAvatarPersonaData,\n onFetchParticipantMenuItems,\n rtl\n },\n null\n )\n );\n return adapter;\n};\n"]}
|
@@ -5,15 +5,33 @@ import { BaseCompositeProps, ChatAdapter, ChatCompositeIcons, ChatCompositeOptio
|
|
5
5
|
* options for the {@link ChatComposite} {@link ChatCompositeOptions}.
|
6
6
|
* @public
|
7
7
|
*/
|
8
|
-
export
|
8
|
+
export interface ChatCompositeLoaderProps extends Partial<BaseCompositeProps<ChatCompositeIcons>> {
|
9
|
+
/**
|
10
|
+
* UserId for the local user.
|
11
|
+
*/
|
9
12
|
userId: CommunicationUserIdentifier;
|
13
|
+
/**
|
14
|
+
* CommunicationTokenCredential for the local user.
|
15
|
+
*/
|
10
16
|
credential: CommunicationTokenCredential;
|
17
|
+
/**
|
18
|
+
* Display name for the local user.
|
19
|
+
*/
|
11
20
|
displayName?: string;
|
21
|
+
/**
|
22
|
+
* Communication service endpoint. This is used for the token and joining the chat thread.
|
23
|
+
*/
|
12
24
|
endpoint: string;
|
25
|
+
/**
|
26
|
+
* Communication threadId for the chat thread.
|
27
|
+
*/
|
13
28
|
threadId: string;
|
29
|
+
/**
|
30
|
+
* Options for the {@link AzureCommunicationChatAdapter}
|
31
|
+
* This is used to configure the chat adapter.
|
32
|
+
*/
|
14
33
|
chatCompositeOptions?: ChatCompositeOptions;
|
15
|
-
|
16
|
-
};
|
34
|
+
}
|
17
35
|
/**
|
18
36
|
* Loader function for the ChatComposite that you can use in your application. This
|
19
37
|
* function will load the ChatComposite into the provided HTML element.
|
@@ -26,7 +26,7 @@ import { initializeIcons } from '@fluentui/react';
|
|
26
26
|
export const loadChatComposite = function (loaderArgs, htmlElement) {
|
27
27
|
return __awaiter(this, void 0, void 0, function* () {
|
28
28
|
initializeIcons();
|
29
|
-
const { userId, credential, endpoint, threadId, displayName, chatCompositeOptions,
|
29
|
+
const { userId, credential, endpoint, threadId, displayName, chatCompositeOptions, fluentTheme, locale, icons, onFetchAvatarPersonaData, onFetchParticipantMenuItems, rtl } = loaderArgs;
|
30
30
|
const adapter = yield createAzureCommunicationChatAdapter({
|
31
31
|
endpoint,
|
32
32
|
userId,
|
@@ -37,7 +37,16 @@ export const loadChatComposite = function (loaderArgs, htmlElement) {
|
|
37
37
|
if (!htmlElement) {
|
38
38
|
throw new Error('Failed to find the root element');
|
39
39
|
}
|
40
|
-
createRoot(htmlElement).render(React.createElement(ChatComposite,
|
40
|
+
createRoot(htmlElement).render(React.createElement(ChatComposite, {
|
41
|
+
options: chatCompositeOptions,
|
42
|
+
adapter,
|
43
|
+
fluentTheme,
|
44
|
+
icons,
|
45
|
+
locale,
|
46
|
+
onFetchAvatarPersonaData,
|
47
|
+
onFetchParticipantMenuItems,
|
48
|
+
rtl
|
49
|
+
}, null));
|
41
50
|
return adapter;
|
42
51
|
});
|
43
52
|
};
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"chatCompositeLoader.js","sourceRoot":"","sources":["../../../../../acs-ui-javascript-loaders/src/chatCompositeLoader.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;;;;;;;;;;AAElC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAE5C,MAAM,YAAY,GAAG,KAAK,CAAC,OAAO,CAAC;AACnC,iBAAiB,CAAC,YAAY,CAAC,CAAC;AAEhC,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAE9C,OAAO,EAGL,aAAa,EAGb,mCAAmC,EACpC,gDAAmC;AACpC,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;
|
1
|
+
{"version":3,"file":"chatCompositeLoader.js","sourceRoot":"","sources":["../../../../../acs-ui-javascript-loaders/src/chatCompositeLoader.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;;;;;;;;;;AAElC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAE5C,MAAM,YAAY,GAAG,KAAK,CAAC,OAAO,CAAC;AACnC,iBAAiB,CAAC,YAAY,CAAC,CAAC;AAEhC,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAE9C,OAAO,EAGL,aAAa,EAGb,mCAAmC,EACpC,gDAAmC;AACpC,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAmClD;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG,UAC/B,UAAoC,EACpC,WAAwB;;QAExB,eAAe,EAAE,CAAC;QAClB,MAAM,EACJ,MAAM,EACN,UAAU,EACV,QAAQ,EACR,QAAQ,EACR,WAAW,EACX,oBAAoB,EACpB,WAAW,EACX,MAAM,EACN,KAAK,EACL,wBAAwB,EACxB,2BAA2B,EAC3B,GAAG,EACJ,GAAG,UAAU,CAAC;QACf,MAAM,OAAO,GAAG,MAAM,mCAAmC,CAAC;YACxD,QAAQ;YACR,MAAM;YACN,WAAW,EAAE,WAAW,aAAX,WAAW,cAAX,WAAW,GAAI,WAAW;YACvC,UAAU;YACV,QAAQ;SACT,CAAC,CAAC;QAEH,IAAI,CAAC,WAAW,EAAE,CAAC;YACjB,MAAM,IAAI,KAAK,CAAC,iCAAiC,CAAC,CAAC;QACrD,CAAC;QAED,UAAU,CAAC,WAAW,CAAC,CAAC,MAAM,CAC5B,KAAK,CAAC,aAAa,CACjB,aAAa,EACb;YACE,OAAO,EAAE,oBAAoB;YAC7B,OAAO;YACP,WAAW;YACX,KAAK;YACL,MAAM;YACN,wBAAwB;YACxB,2BAA2B;YAC3B,GAAG;SACJ,EACD,IAAI,CACL,CACF,CAAC;QACF,OAAO,OAAO,CAAC;IACjB,CAAC;CAAA,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport React from 'react';\nimport { parseReactVersion } from './utils';\n\nconst reactVersion = React.version;\nparseReactVersion(reactVersion);\n\nimport { createRoot } from 'react-dom/client';\nimport { CommunicationTokenCredential, CommunicationUserIdentifier } from '@azure/communication-common';\nimport {\n BaseCompositeProps,\n ChatAdapter,\n ChatComposite,\n ChatCompositeIcons,\n ChatCompositeOptions,\n createAzureCommunicationChatAdapter\n} from '@internal/react-composites';\nimport { initializeIcons } from '@fluentui/react';\n\n/**\n * Props for the ChatComposite that you can use in your application. Contains the\n * options for the {@link ChatComposite} {@link ChatCompositeOptions}.\n * @public\n */\nexport interface ChatCompositeLoaderProps extends Partial<BaseCompositeProps<ChatCompositeIcons>> {\n /**\n * UserId for the local user.\n */\n userId: CommunicationUserIdentifier;\n /**\n * CommunicationTokenCredential for the local user.\n */\n credential: CommunicationTokenCredential;\n /**\n * Display name for the local user.\n */\n displayName?: string;\n /**\n * Communication service endpoint. This is used for the token and joining the chat thread.\n */\n endpoint: string;\n /**\n * Communication threadId for the chat thread.\n */\n threadId: string;\n /**\n * Options for the {@link AzureCommunicationChatAdapter}\n * This is used to configure the chat adapter.\n */\n chatCompositeOptions?: ChatCompositeOptions;\n}\n\n/**\n * Loader function for the ChatComposite that you can use in your application. This\n * function will load the ChatComposite into the provided HTML element.\n * The best use case for this is in a Node UI framework that is not React based.\n *\n * @public\n */\nexport const loadChatComposite = async function (\n loaderArgs: ChatCompositeLoaderProps,\n htmlElement: HTMLElement\n): Promise<ChatAdapter | undefined> {\n initializeIcons();\n const {\n userId,\n credential,\n endpoint,\n threadId,\n displayName,\n chatCompositeOptions,\n fluentTheme,\n locale,\n icons,\n onFetchAvatarPersonaData,\n onFetchParticipantMenuItems,\n rtl\n } = loaderArgs;\n const adapter = await createAzureCommunicationChatAdapter({\n endpoint,\n userId,\n displayName: displayName ?? 'anonymous',\n credential,\n threadId\n });\n\n if (!htmlElement) {\n throw new Error('Failed to find the root element');\n }\n\n createRoot(htmlElement).render(\n React.createElement(\n ChatComposite,\n {\n options: chatCompositeOptions,\n adapter,\n fluentTheme,\n icons,\n locale,\n onFetchAvatarPersonaData,\n onFetchParticipantMenuItems,\n rtl\n },\n null\n )\n );\n return adapter;\n};\n"]}
|
@@ -9,15 +9,40 @@ import { CallCompositeOptions, StartCallIdentifier, AzureCommunicationCallAdapte
|
|
9
9
|
*
|
10
10
|
* @public
|
11
11
|
*/
|
12
|
-
export
|
12
|
+
export interface OutboundCallCompositeLoaderProps extends Partial<BaseCompositeProps<CallCompositeIcons>> {
|
13
|
+
/**
|
14
|
+
* UserId for the local user.
|
15
|
+
*/
|
13
16
|
userId: CommunicationUserIdentifier;
|
17
|
+
/**
|
18
|
+
* CommunicationTokenCredential for the local user.
|
19
|
+
*/
|
14
20
|
credential: CommunicationTokenCredential;
|
21
|
+
/**
|
22
|
+
* Display name for the local user.
|
23
|
+
*/
|
15
24
|
displayName: string;
|
25
|
+
/**
|
26
|
+
* Participants that will be called.
|
27
|
+
* This can be a list of either {@link CommunicationUserIdentifier} or string identifiers.
|
28
|
+
*/
|
16
29
|
targetCallees: string[] | StartCallIdentifier[];
|
30
|
+
/**
|
31
|
+
* Options for the {@link AzureCommunicationCallAdapter}
|
32
|
+
* This is used to configure the call adapter.
|
33
|
+
*/
|
17
34
|
callAdapterOptions?: AzureCommunicationCallAdapterOptions;
|
18
|
-
|
35
|
+
/**
|
36
|
+
* Options for the {@link CallComposite} {@link CallCompositeOptions}
|
37
|
+
* This is used to configure the call composite.
|
38
|
+
*/
|
19
39
|
callCompositeOptions?: CallCompositeOptions;
|
20
|
-
|
40
|
+
/**
|
41
|
+
* Device form factor for the composite.
|
42
|
+
* This is used to configure the call composite.
|
43
|
+
*/
|
44
|
+
formFactor?: 'mobile' | 'desktop';
|
45
|
+
}
|
21
46
|
/**
|
22
47
|
* Loader function for the OutboundCallComposite that you can use in your application. This
|
23
48
|
* function will load the CallComposite into the provided HTML element to make outbound calls.
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"outboundCallCompositeLoader.js","sourceRoot":"","sources":["../../../../../acs-ui-javascript-loaders/src/outboundCallCompositeLoader.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;;;;;;;;;;AAElC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAE5C,MAAM,YAAY,GAAG,KAAK,CAAC,OAAO,CAAC;AACnC,iBAAiB,CAAC,YAAY,CAAC,CAAC;AAEhC,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAE9C,OAAO,EAAE,+BAA+B,EAAE,gCAAgC;AAC1E,OAAO,EACL,aAAa,EACb,mCAAmC,EAOpC,gDAAmC;AACpC,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;
|
1
|
+
{"version":3,"file":"outboundCallCompositeLoader.js","sourceRoot":"","sources":["../../../../../acs-ui-javascript-loaders/src/outboundCallCompositeLoader.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;;;;;;;;;;AAElC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAE5C,MAAM,YAAY,GAAG,KAAK,CAAC,OAAO,CAAC;AACnC,iBAAiB,CAAC,YAAY,CAAC,CAAC;AAEhC,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAE9C,OAAO,EAAE,+BAA+B,EAAE,gCAAgC;AAC1E,OAAO,EACL,aAAa,EACb,mCAAmC,EAOpC,gDAAmC;AACpC,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AA8ClD;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,yBAAyB,GAAG,UACvC,UAA4C,EAC5C,WAAwB;;;QAExB,eAAe,EAAE,CAAC;QAClB,MAAM,EAAE,MAAM,EAAE,UAAU,EAAE,WAAW,EAAE,aAAa,EAAE,kBAAkB,EAAE,oBAAoB,EAAE,GAAG,UAAU,CAAC;QAChH,MAAM,sBAAsB,GAC1B,OAAO,aAAa,CAAC,CAAC,CAAC,KAAK,QAAQ;YAClC,CAAC,CAAE,aAA0B,CAAC,GAAG,CAAC,CAAC,MAAc,EAAE,EAAE;gBACjD,OAAO,+BAA+B,CAAC,MAAM,CAAC,CAAC;YACjD,CAAC,CAAC;YACJ,CAAC,CAAC,SAAS,CAAC;QAEhB,MAAM,OAAO,GAAG,MAAM,mCAAmC,CAAC;YACxD,MAAM;YACN,WAAW,EAAE,WAAW,aAAX,WAAW,cAAX,WAAW,GAAI,WAAW;YACvC,UAAU;YACV,aAAa,EAAE,MAAC,sBAAgD,mCAAK,aAAuC;YAC5G,OAAO,EAAE,kBAAkB;SAC5B,CAAC,CAAC;QAEH,IAAI,CAAC,WAAW,EAAE,CAAC;YACjB,MAAM,IAAI,KAAK,CAAC,iCAAiC,CAAC,CAAC;QACrD,CAAC;QAED,UAAU,CAAC,WAAW,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,aAAa,CAAC,aAAa,EAAE,EAAE,OAAO,EAAE,oBAAoB,EAAE,OAAO,EAAE,EAAE,IAAI,CAAC,CAAC,CAAC;QACrH,OAAO,OAAO,CAAC;IACjB,CAAC;CAAA,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport React from 'react';\nimport { parseReactVersion } from './utils';\n\nconst reactVersion = React.version;\nparseReactVersion(reactVersion);\n\nimport { createRoot } from 'react-dom/client';\nimport { CommunicationTokenCredential, CommunicationUserIdentifier } from '@azure/communication-common';\nimport { fromFlatCommunicationIdentifier } from '@internal/acs-ui-common';\nimport {\n CallComposite,\n createAzureCommunicationCallAdapter,\n CallCompositeOptions,\n StartCallIdentifier,\n AzureCommunicationCallAdapterOptions,\n CallAdapter,\n BaseCompositeProps,\n CallCompositeIcons\n} from '@internal/react-composites';\nimport { initializeIcons } from '@fluentui/react';\n\n/**\n * Props for the OutboundCallComposite that you can use in your application.\n *\n * Contains two options bags:\n * - adapterOptions: Options for the {@link AzureCommunicationCallAdapter}\n * - callCompositeOptions: Options for the {@link CallComposite} {@link CallCompositeOptions}\n *\n * @public\n */\nexport interface OutboundCallCompositeLoaderProps extends Partial<BaseCompositeProps<CallCompositeIcons>> {\n /**\n * UserId for the local user.\n */\n userId: CommunicationUserIdentifier;\n /**\n * CommunicationTokenCredential for the local user.\n */\n credential: CommunicationTokenCredential;\n /**\n * Display name for the local user.\n */\n displayName: string;\n /**\n * Participants that will be called.\n * This can be a list of either {@link CommunicationUserIdentifier} or string identifiers.\n */\n targetCallees: string[] | StartCallIdentifier[];\n /**\n * Options for the {@link AzureCommunicationCallAdapter}\n * This is used to configure the call adapter.\n */\n callAdapterOptions?: AzureCommunicationCallAdapterOptions;\n /**\n * Options for the {@link CallComposite} {@link CallCompositeOptions}\n * This is used to configure the call composite.\n */\n callCompositeOptions?: CallCompositeOptions;\n /**\n * Device form factor for the composite.\n * This is used to configure the call composite.\n */\n formFactor?: 'mobile' | 'desktop';\n}\n\n/**\n * Loader function for the OutboundCallComposite that you can use in your application. This\n * function will load the CallComposite into the provided HTML element to make outbound calls.\n * The best use case for this is in a Node UI framework that is not React based.\n *\n * @public\n */\nexport const loadOutboundCallComposite = async function (\n loaderArgs: OutboundCallCompositeLoaderProps,\n htmlElement: HTMLElement\n): Promise<CallAdapter | undefined> {\n initializeIcons();\n const { userId, credential, displayName, targetCallees, callAdapterOptions, callCompositeOptions } = loaderArgs;\n const formattedTargetCallees =\n typeof targetCallees[0] === 'string'\n ? (targetCallees as string[]).map((callee: string) => {\n return fromFlatCommunicationIdentifier(callee);\n })\n : undefined;\n\n const adapter = await createAzureCommunicationCallAdapter({\n userId,\n displayName: displayName ?? 'anonymous',\n credential,\n targetCallees: (formattedTargetCallees as StartCallIdentifier[]) ?? (targetCallees as StartCallIdentifier[]),\n options: callAdapterOptions\n });\n\n if (!htmlElement) {\n throw new Error('Failed to find the root element');\n }\n\n createRoot(htmlElement).render(React.createElement(CallComposite, { options: callCompositeOptions, adapter }, null));\n return adapter;\n};\n"]}
|
@@ -13,7 +13,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
13
13
|
import { Features } from '@azure/communication-calling';
|
14
14
|
import { isCommunicationUserIdentifier, isMicrosoftTeamsAppIdentifier } from '@azure/communication-common';
|
15
15
|
/* @conditional-compile-remove(teams-identity-support-beta) */
|
16
|
-
import { isPhoneNumberIdentifier } from '@azure/communication-common';
|
16
|
+
import { isPhoneNumberIdentifier, isTeamsExtensionUserIdentifier } from '@azure/communication-common';
|
17
17
|
import { _toCommunicationIdentifier } from "../../../acs-ui-common/src";
|
18
18
|
import memoizeOne from 'memoize-one';
|
19
19
|
import { isTeamsCallParticipants } from '../utils/callUtils';
|
@@ -55,6 +55,10 @@ export const createDefaultTeamsCallingHandlers = memoizeOne((callClient, callAge
|
|
55
55
|
if (isPhoneNumberIdentifier(participant)) {
|
56
56
|
call === null || call === void 0 ? void 0 : call.addParticipant(participant, threadId ? { threadId } : undefined);
|
57
57
|
}
|
58
|
+
/* @conditional-compile-remove(teams-identity-support-beta) */
|
59
|
+
if (isTeamsExtensionUserIdentifier(participant)) {
|
60
|
+
throw new Error('Adding Microsoft Teams extension identifier is not supported!');
|
61
|
+
}
|
58
62
|
call === null || call === void 0 ? void 0 : call.addParticipant(participant);
|
59
63
|
}), onRemoveParticipant: (userId) => __awaiter(void 0, void 0, void 0, function* () {
|
60
64
|
const participant = _toCommunicationIdentifier(userId);
|
@@ -64,6 +68,10 @@ export const createDefaultTeamsCallingHandlers = memoizeOne((callClient, callAge
|
|
64
68
|
if (isMicrosoftTeamsAppIdentifier(participant)) {
|
65
69
|
throw new Error('Removing Microsoft Teams app identifier is not supported!');
|
66
70
|
}
|
71
|
+
/* @conditional-compile-remove(teams-identity-support-beta) */
|
72
|
+
if (isTeamsExtensionUserIdentifier(participant)) {
|
73
|
+
throw new Error('Removing Microsoft Teams extension identifier is not supported!');
|
74
|
+
}
|
67
75
|
yield (call === null || call === void 0 ? void 0 : call.removeParticipant(participant));
|
68
76
|
}), onAcceptCall: (incomingCallId, useVideo) => __awaiter(void 0, void 0, void 0, function* () {
|
69
77
|
const localVideoStream = useVideo ? yield createLocalVideoStream(callClient) : undefined;
|
package/dist/dist-esm/calling-component-bindings/src/handlers/createTeamsCallHandlers.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"createTeamsCallHandlers.js","sourceRoot":"","sources":["../../../../../../calling-component-bindings/src/handlers/createTeamsCallHandlers.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;;;;;;;;;;AAGlC,gDAAgD;AAChD,OAAO,EAAE,QAAQ,EAAE,MAAM,8BAA8B,CAAC;AAKxD,OAAO,EAEL,6BAA6B,EAC7B,6BAA6B,EAC9B,MAAM,6BAA6B,CAAC;AACrC,8DAA8D;AAC9D,OAAO,EAAE,uBAAuB,EAAE,MAAM,6BAA6B,CAAC;AACtE,OAAO,EAAU,0BAA0B,EAAE,mCAAgC;AAG7E,OAAO,UAAU,MAAM,aAAa,CAAC;AAErC,OAAO,EAAE,uBAAuB,EAAE,MAAM,oBAAoB,CAAC;AAC7D,OAAO,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAC;AAC5D,OAAO,EACL,kCAAkC,EAInC,MAAM,wBAAwB,CAAC;AAahC;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,iCAAiC,GAAG,UAAU,CACzD,CACE,UAA8B,EAC9B,SAA0B,EAC1B,aAAqC,EACrC,IAAgB,EAChB,OAGC,EACqB,EAAE;IACxB,uCACK,kCAAkC,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AY,CAAC,CAAC,CAAQ,EAAE,OAAO,CAAC,CAAC;IAC9D,CAAC;AACH,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { StartCallOptions } from '@azure/communication-calling';\n/* @conditional-compile-remove(together-mode) */\nimport { Features } from '@azure/communication-calling';\nimport { IncomingCallCommon } from '@azure/communication-calling';\n/* @conditional-compile-remove(teams-identity-support-beta) */\nimport { AddPhoneNumberOptions } from '@azure/communication-calling';\nimport { TeamsCall, TeamsCallAgent, TeamsCallAgentOptions } from '@azure/communication-calling';\nimport {\n CommunicationIdentifier,\n isCommunicationUserIdentifier,\n isMicrosoftTeamsAppIdentifier\n} from '@azure/communication-common';\n/* @conditional-compile-remove(teams-identity-support-beta) */\nimport { isPhoneNumberIdentifier } from '@azure/communication-common';\nimport { Common, _toCommunicationIdentifier } from '@internal/acs-ui-common';\nimport { StatefulCallClient, StatefulDeviceManager } from '@internal/calling-stateful-client';\nimport { DeclarativeTeamsCallAgent } from '@internal/calling-stateful-client';\nimport memoizeOne from 'memoize-one';\nimport { ReactElement } from 'react';\nimport { isTeamsCallParticipants } from '../utils/callUtils';\nimport { createLocalVideoStream } from '../utils/callUtils';\nimport {\n createDefaultCommonCallingHandlers,\n CommonCallingHandlers,\n DeepNoiseSuppressionEffectDependency,\n VideoBackgroundEffectsDependency\n} from './createCommonHandlers';\n/**\n * Object containing all the teams call handlers required for calling components.\n *\n * Calling related components from this package are able to pick out relevant handlers from this object.\n * See {@link useHandlers} and {@link usePropsFor}.\n *\n * @public\n */\nexport interface TeamsCallingHandlers extends CommonCallingHandlers {\n onStartCall: (participants: CommunicationIdentifier[], options?: StartCallOptions) => undefined | TeamsCall;\n}\n\n/**\n * Create the default implementation of {@link TeamsCallingHandlers} for teams call.\n *\n * Useful when implementing a custom component that utilizes the providers\n * exported from this library.\n *\n * @public\n */\nexport const createDefaultTeamsCallingHandlers = memoizeOne(\n (\n callClient: StatefulCallClient,\n callAgent?: TeamsCallAgent,\n deviceManager?: StatefulDeviceManager,\n call?: TeamsCall,\n options?: {\n onResolveVideoBackgroundEffectsDependency?: () => Promise<VideoBackgroundEffectsDependency>;\n onResolveDeepNoiseSuppressionDependency?: () => Promise<DeepNoiseSuppressionEffectDependency>;\n }\n ): TeamsCallingHandlers => {\n return {\n ...createDefaultCommonCallingHandlers(callClient, deviceManager, call, options),\n onStartCall: (participants, options) => {\n /* @conditional-compile-remove(teams-identity-support-beta) */\n const threadId = options?.threadId;\n if (!isTeamsCallParticipants(participants)) {\n throw new Error('CommunicationIdentifier in Teams call is not supported!');\n }\n if (callAgent) {\n /* @conditional-compile-remove(teams-identity-support-beta) */\n return callAgent.startCall(participants, threadId ? { threadId, ...options } : undefined);\n // Remove when teams identity in stable support multiple participants\n return teamsSingleParticipantTrampoline(callAgent as TeamsCallAgent, participants, options);\n }\n return undefined;\n },\n /* @conditional-compile-remove(teams-identity-support-beta) */\n onAddParticipant: async (\n userId: string | CommunicationIdentifier,\n options?: AddPhoneNumberOptions\n ): Promise<void> => {\n const participant = _toCommunicationIdentifier(userId);\n\n const threadId = options?.threadId;\n if (isCommunicationUserIdentifier(participant)) {\n throw new Error('CommunicationIdentifier in Teams call is not supported!');\n }\n\n if (isMicrosoftTeamsAppIdentifier(participant)) {\n throw new Error('Adding Microsoft Teams app identifier is not supported!');\n }\n\n if (isPhoneNumberIdentifier(participant)) {\n call?.addParticipant(participant, threadId ? { threadId } : undefined);\n }\n\n call?.addParticipant(participant);\n },\n onRemoveParticipant: async (userId: string | CommunicationIdentifier): Promise<void> => {\n const participant = _toCommunicationIdentifier(userId);\n if (isCommunicationUserIdentifier(participant)) {\n throw new Error('CommunicationIdentifier in Teams call is not supported!');\n }\n\n if (isMicrosoftTeamsAppIdentifier(participant)) {\n throw new Error('Removing Microsoft Teams app identifier is not supported!');\n }\n\n await call?.removeParticipant(participant);\n },\n onAcceptCall: async (incomingCallId: string, useVideo?: boolean): Promise<void> => {\n const localVideoStream = useVideo ? await createLocalVideoStream(callClient) : undefined;\n const incomingCall = (callAgent as DeclarativeTeamsCallAgent)?.incomingCalls.find(\n (incomingCall: IncomingCallCommon) => incomingCall.id === incomingCallId\n );\n if (incomingCall) {\n await incomingCall.accept(\n localVideoStream ? { videoOptions: { localVideoStreams: [localVideoStream] } } : undefined\n );\n }\n },\n onRejectCall: async (incomingCallId: string): Promise<void> => {\n const incomingCall = (callAgent as DeclarativeTeamsCallAgent)?.incomingCalls.find(\n (incomingCall: IncomingCallCommon) => incomingCall.id === incomingCallId\n );\n if (incomingCall) {\n await incomingCall.reject();\n }\n },\n /* @conditional-compile-remove(together-mode) */\n onStartTogetherMode: async (): Promise<void> => {\n if (!call) {\n return;\n }\n const callState = callClient.getState().calls[call.id];\n if (!callState) {\n return;\n }\n const togetherModeFeature = call?.feature(Features.TogetherMode);\n await togetherModeFeature?.start();\n }\n };\n }\n);\n\n/**\n * Create a set of default handlers for given component. Memoization is applied to the result. Multiple invocations with\n * the same arguments will return the same handler instances. DeclarativeCallAgent, DeclarativeDeviceManager, and\n * DeclarativeCall may be undefined. If undefined, their associated handlers will not be created and returned.\n *\n * @param callClient - StatefulCallClient returned from\n * {@link @azure/communication-react#createStatefulCallClient}.\n * @param callAgent - Instance of {@link @azure/communication-calling#TeamsCallClient}.\n * @param deviceManager - Instance of {@link @azure/communication-calling#DeviceManager}.\n * @param call - Instance of {@link @azure/communication-calling#TeamsCall}.\n * @param _ - React component that you want to generate handlers for.\n *\n * @public\n */\nexport const createTeamsCallingHandlersForComponent = <Props>(\n callClient: StatefulCallClient,\n callAgent: undefined | TeamsCallAgent,\n deviceManager: StatefulDeviceManager | undefined,\n call: undefined | TeamsCall,\n _Component: (props: Props) => ReactElement | null\n): Common<TeamsCallingHandlers, Props> => {\n return createDefaultTeamsCallingHandlers(callClient, callAgent, deviceManager, call);\n};\n\nconst teamsSingleParticipantTrampoline = (\n callAgent: TeamsCallAgent,\n participants: CommunicationIdentifier[],\n options?: TeamsCallAgentOptions\n): TeamsCall => {\n if (participants.length !== 1) {\n throw new Error('Only one participant is supported in Teams call!');\n } else {\n return callAgent.startCall(participants[0] as any, options);\n }\n};\n"]}
|
1
|
+
{"version":3,"file":"createTeamsCallHandlers.js","sourceRoot":"","sources":["../../../../../../calling-component-bindings/src/handlers/createTeamsCallHandlers.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;;;;;;;;;;AAGlC,gDAAgD;AAChD,OAAO,EAAE,QAAQ,EAAE,MAAM,8BAA8B,CAAC;AAKxD,OAAO,EAEL,6BAA6B,EAC7B,6BAA6B,EAC9B,MAAM,6BAA6B,CAAC;AACrC,8DAA8D;AAC9D,OAAO,EAAE,uBAAuB,EAAE,8BAA8B,EAAE,MAAM,6BAA6B,CAAC;AACtG,OAAO,EAAU,0BAA0B,EAAE,mCAAgC;AAG7E,OAAO,UAAU,MAAM,aAAa,CAAC;AAErC,OAAO,EAAE,uBAAuB,EAAE,MAAM,oBAAoB,CAAC;AAC7D,OAAO,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAC;AAC5D,OAAO,EACL,kCAAkC,EAInC,MAAM,wBAAwB,CAAC;AAahC;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,iCAAiC,GAAG,UAAU,CACzD,CACE,UAA8B,EAC9B,SAA0B,EAC1B,aAAqC,EACrC,IAAgB,EAChB,OAGC,EACqB,EAAE;IACxB,uCACK,kCAAkC,CAAC,UAAU,EAAE,aAAa,EAAE,IAAI,EAAE,OAAO,CAAC,KAC/E,WAAW,EAAE,CAAC,YAAY,EAAE,OAAO,EAAE,EAAE;YACrC,8DAA8D;YAC9D,MAAM,QAAQ,GAAG,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,QAAQ,CAAC;YACnC,IAAI,CAAC,uBAAuB,CAAC,YAAY,CAAC,EAAE,CAAC;gBAC3C,MAAM,IAAI,KAAK,CAAC,yDAAyD,CAAC,CAAC;YAC7E,CAAC;YACD,IAAI,SAAS,EAAE,CAAC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c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { StartCallOptions } from '@azure/communication-calling';\n/* @conditional-compile-remove(together-mode) */\nimport { Features } from '@azure/communication-calling';\nimport { IncomingCallCommon } from '@azure/communication-calling';\n/* @conditional-compile-remove(teams-identity-support-beta) */\nimport { AddPhoneNumberOptions } from '@azure/communication-calling';\nimport { TeamsCall, TeamsCallAgent, TeamsCallAgentOptions } from '@azure/communication-calling';\nimport {\n CommunicationIdentifier,\n isCommunicationUserIdentifier,\n isMicrosoftTeamsAppIdentifier\n} from '@azure/communication-common';\n/* @conditional-compile-remove(teams-identity-support-beta) */\nimport { isPhoneNumberIdentifier, isTeamsExtensionUserIdentifier } from '@azure/communication-common';\nimport { Common, _toCommunicationIdentifier } from '@internal/acs-ui-common';\nimport { StatefulCallClient, StatefulDeviceManager } from '@internal/calling-stateful-client';\nimport { DeclarativeTeamsCallAgent } from '@internal/calling-stateful-client';\nimport memoizeOne from 'memoize-one';\nimport { ReactElement } from 'react';\nimport { isTeamsCallParticipants } from '../utils/callUtils';\nimport { createLocalVideoStream } from '../utils/callUtils';\nimport {\n createDefaultCommonCallingHandlers,\n CommonCallingHandlers,\n DeepNoiseSuppressionEffectDependency,\n VideoBackgroundEffectsDependency\n} from './createCommonHandlers';\n/**\n * Object containing all the teams call handlers required for calling components.\n *\n * Calling related components from this package are able to pick out relevant handlers from this object.\n * See {@link useHandlers} and {@link usePropsFor}.\n *\n * @public\n */\nexport interface TeamsCallingHandlers extends CommonCallingHandlers {\n onStartCall: (participants: CommunicationIdentifier[], options?: StartCallOptions) => undefined | TeamsCall;\n}\n\n/**\n * Create the default implementation of {@link TeamsCallingHandlers} for teams call.\n *\n * Useful when implementing a custom component that utilizes the providers\n * exported from this library.\n *\n * @public\n */\nexport const createDefaultTeamsCallingHandlers = memoizeOne(\n (\n callClient: StatefulCallClient,\n callAgent?: TeamsCallAgent,\n deviceManager?: StatefulDeviceManager,\n call?: TeamsCall,\n options?: {\n onResolveVideoBackgroundEffectsDependency?: () => Promise<VideoBackgroundEffectsDependency>;\n onResolveDeepNoiseSuppressionDependency?: () => Promise<DeepNoiseSuppressionEffectDependency>;\n }\n ): TeamsCallingHandlers => {\n return {\n ...createDefaultCommonCallingHandlers(callClient, deviceManager, call, options),\n onStartCall: (participants, options) => {\n /* @conditional-compile-remove(teams-identity-support-beta) */\n const threadId = options?.threadId;\n if (!isTeamsCallParticipants(participants)) {\n throw new Error('CommunicationIdentifier in Teams call is not supported!');\n }\n if (callAgent) {\n /* @conditional-compile-remove(teams-identity-support-beta) */\n return callAgent.startCall(participants, threadId ? { threadId, ...options } : undefined);\n // Remove when teams identity in stable support multiple participants\n return teamsSingleParticipantTrampoline(callAgent as TeamsCallAgent, participants, options);\n }\n return undefined;\n },\n /* @conditional-compile-remove(teams-identity-support-beta) */\n onAddParticipant: async (\n userId: string | CommunicationIdentifier,\n options?: AddPhoneNumberOptions\n ): Promise<void> => {\n const participant = _toCommunicationIdentifier(userId);\n\n const threadId = options?.threadId;\n if (isCommunicationUserIdentifier(participant)) {\n throw new Error('CommunicationIdentifier in Teams call is not supported!');\n }\n\n if (isMicrosoftTeamsAppIdentifier(participant)) {\n throw new Error('Adding Microsoft Teams app identifier is not supported!');\n }\n\n if (isPhoneNumberIdentifier(participant)) {\n call?.addParticipant(participant, threadId ? { threadId } : undefined);\n }\n\n /* @conditional-compile-remove(teams-identity-support-beta) */\n if (isTeamsExtensionUserIdentifier(participant)) {\n throw new Error('Adding Microsoft Teams extension identifier is not supported!');\n }\n\n call?.addParticipant(participant);\n },\n onRemoveParticipant: async (userId: string | CommunicationIdentifier): Promise<void> => {\n const participant = _toCommunicationIdentifier(userId);\n if (isCommunicationUserIdentifier(participant)) {\n throw new Error('CommunicationIdentifier in Teams call is not supported!');\n }\n\n if (isMicrosoftTeamsAppIdentifier(participant)) {\n throw new Error('Removing Microsoft Teams app identifier is not supported!');\n }\n\n /* @conditional-compile-remove(teams-identity-support-beta) */\n if (isTeamsExtensionUserIdentifier(participant)) {\n throw new Error('Removing Microsoft Teams extension identifier is not supported!');\n }\n\n await call?.removeParticipant(participant);\n },\n onAcceptCall: async (incomingCallId: string, useVideo?: boolean): Promise<void> => {\n const localVideoStream = useVideo ? await createLocalVideoStream(callClient) : undefined;\n const incomingCall = (callAgent as DeclarativeTeamsCallAgent)?.incomingCalls.find(\n (incomingCall: IncomingCallCommon) => incomingCall.id === incomingCallId\n );\n if (incomingCall) {\n await incomingCall.accept(\n localVideoStream ? { videoOptions: { localVideoStreams: [localVideoStream] } } : undefined\n );\n }\n },\n onRejectCall: async (incomingCallId: string): Promise<void> => {\n const incomingCall = (callAgent as DeclarativeTeamsCallAgent)?.incomingCalls.find(\n (incomingCall: IncomingCallCommon) => incomingCall.id === incomingCallId\n );\n if (incomingCall) {\n await incomingCall.reject();\n }\n },\n /* @conditional-compile-remove(together-mode) */\n onStartTogetherMode: async (): Promise<void> => {\n if (!call) {\n return;\n }\n const callState = callClient.getState().calls[call.id];\n if (!callState) {\n return;\n }\n const togetherModeFeature = call?.feature(Features.TogetherMode);\n await togetherModeFeature?.start();\n }\n };\n }\n);\n\n/**\n * Create a set of default handlers for given component. Memoization is applied to the result. Multiple invocations with\n * the same arguments will return the same handler instances. DeclarativeCallAgent, DeclarativeDeviceManager, and\n * DeclarativeCall may be undefined. If undefined, their associated handlers will not be created and returned.\n *\n * @param callClient - StatefulCallClient returned from\n * {@link @azure/communication-react#createStatefulCallClient}.\n * @param callAgent - Instance of {@link @azure/communication-calling#TeamsCallClient}.\n * @param deviceManager - Instance of {@link @azure/communication-calling#DeviceManager}.\n * @param call - Instance of {@link @azure/communication-calling#TeamsCall}.\n * @param _ - React component that you want to generate handlers for.\n *\n * @public\n */\nexport const createTeamsCallingHandlersForComponent = <Props>(\n callClient: StatefulCallClient,\n callAgent: undefined | TeamsCallAgent,\n deviceManager: StatefulDeviceManager | undefined,\n call: undefined | TeamsCall,\n _Component: (props: Props) => ReactElement | null\n): Common<TeamsCallingHandlers, Props> => {\n return createDefaultTeamsCallingHandlers(callClient, callAgent, deviceManager, call);\n};\n\nconst teamsSingleParticipantTrampoline = (\n callAgent: TeamsCallAgent,\n participants: CommunicationIdentifier[],\n options?: TeamsCallAgentOptions\n): TeamsCall => {\n if (participants.length !== 1) {\n throw new Error('Only one participant is supported in Teams call!');\n } else {\n return callAgent.startCall(participants[0] as any, options);\n }\n};\n"]}
|
@@ -1072,7 +1072,7 @@ export declare class CallError extends Error {
|
|
1072
1072
|
*
|
1073
1073
|
* @public
|
1074
1074
|
*/
|
1075
|
-
export type CallErrorTarget = 'Call.addParticipant' | 'Call.dispose' | 'Call.feature' | 'Call.hangUp' | 'Call.hold' | 'Call.mute' | 'Call.muteIncomingAudio' | 'Call.off' | 'Call.on' | 'Call.removeParticipant' | 'Call.resume' | 'Call.sendDtmf' | 'Call.startAudio' | 'Call.startScreenSharing' | 'Call.startVideo' | 'Call.stopScreenSharing' | 'Call.stopAudio' | 'Call.stopVideo' | 'Call.unmute' | 'Call.unmuteIncomingAudio' | 'CallAgent.dispose' | 'CallAgent.feature' | 'CallAgent.join' | 'CallAgent.off' | 'CallAgent.on' | 'CallAgent.startCall' | 'CallClient.createCallAgent' | 'CallClient.createTeamsCallAgent' | 'CallClient.feature' | 'CallClient.getDeviceManager' | 'CallClient.getEnvironmentInfo' | 'DeviceManager.askDevicePermission' | 'DeviceManager.getCameras' | 'DeviceManager.getMicrophones' | 'DeviceManager.getSpeakers' | 'DeviceManager.off' | 'DeviceManager.on' | 'DeviceManager.selectMicrophone' | 'DeviceManager.selectSpeaker' | 'DeviceManager.startPreheatDevices' | 'DeviceManager.stopPreheatDevices' | 'IncomingCall.accept' | 'IncomingCall.reject' | 'TeamsCall.addParticipant' | 'VideoEffectsFeature.startEffects' | 'CallAgent.handlePushNotification' | /* @conditional-compile-remove(calling-beta-sdk) */ 'Call.admit' | /* @conditional-compile-remove(calling-beta-sdk) */ 'Call.rejectParticipant' | /* @conditional-compile-remove(calling-beta-sdk) */ 'Call.admitAll' | 'Call.mutedByOthers' | 'Call.muteAllRemoteParticipants' | 'Call.setConstraints';
|
1075
|
+
export type CallErrorTarget = 'Call.addParticipant' | 'Call.dispose' | 'Call.feature' | 'Call.hangUp' | 'Call.hold' | 'Call.mute' | 'Call.muteIncomingAudio' | 'Call.off' | 'Call.on' | 'Call.removeParticipant' | 'Call.resume' | 'Call.sendDtmf' | 'Call.startAudio' | 'Call.startScreenSharing' | 'Call.startVideo' | 'Call.stopScreenSharing' | 'Call.stopAudio' | 'Call.stopVideo' | 'Call.unmute' | 'Call.unmuteIncomingAudio' | 'CallAgent.dispose' | 'CallAgent.feature' | 'CallAgent.join' | 'CallAgent.off' | 'CallAgent.on' | 'CallAgent.startCall' | 'CallClient.createCallAgent' | 'CallClient.createTeamsCallAgent' | /* @conditional-compile-remove(calling-beta-sdk) */ 'CallClient.dispose' | 'CallClient.feature' | 'CallClient.getDeviceManager' | 'CallClient.getEnvironmentInfo' | 'DeviceManager.askDevicePermission' | 'DeviceManager.getCameras' | 'DeviceManager.getMicrophones' | 'DeviceManager.getSpeakers' | 'DeviceManager.off' | 'DeviceManager.on' | 'DeviceManager.selectMicrophone' | 'DeviceManager.selectSpeaker' | 'DeviceManager.startPreheatDevices' | 'DeviceManager.stopPreheatDevices' | 'IncomingCall.accept' | 'IncomingCall.reject' | 'TeamsCall.addParticipant' | 'VideoEffectsFeature.startEffects' | 'CallAgent.handlePushNotification' | /* @conditional-compile-remove(calling-beta-sdk) */ 'Call.admit' | /* @conditional-compile-remove(calling-beta-sdk) */ 'Call.rejectParticipant' | /* @conditional-compile-remove(calling-beta-sdk) */ 'Call.admitAll' | 'Call.mutedByOthers' | 'Call.muteAllRemoteParticipants' | 'Call.setConstraints';
|
1076
1076
|
/**
|
1077
1077
|
* @public
|
1078
1078
|
*/
|