@azure/communication-react 1.20.0-alpha-202410130017 → 1.20.0-alpha-202410170016
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 +10 -10
- package/dist/dist-cjs/communication-react/{ChatMessageComponentAsRichTextEditBox-Cfp-l5FZ.js → ChatMessageComponentAsRichTextEditBox-Dg2BkrN6.js} +2 -2
- package/dist/dist-cjs/communication-react/{ChatMessageComponentAsRichTextEditBox-Cfp-l5FZ.js.map → ChatMessageComponentAsRichTextEditBox-Dg2BkrN6.js.map} +1 -1
- package/dist/dist-cjs/communication-react/{RichTextSendBoxWrapper-4qfX6tfT.js → RichTextSendBoxWrapper-D4pLWFtj.js} +2 -2
- package/dist/dist-cjs/communication-react/{RichTextSendBoxWrapper-4qfX6tfT.js.map → RichTextSendBoxWrapper-D4pLWFtj.js.map} +1 -1
- package/dist/dist-cjs/communication-react/{index-BzKaW_nR.js → index-BlNmEm_b.js} +225 -163
- package/dist/dist-cjs/communication-react/{index-BzKaW_nR.js.map → index-BlNmEm_b.js.map} +1 -1
- 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 +3 -2
- package/dist/dist-esm/acs-ui-javascript-loaders/src/callCompositeLoader.js +3 -5
- 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 +3 -2
- package/dist/dist-esm/acs-ui-javascript-loaders/src/callWithChatCompositeLoader.js +3 -5
- 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 +3 -2
- package/dist/dist-esm/acs-ui-javascript-loaders/src/chatCompositeLoader.js +3 -5
- 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 +3 -2
- package/dist/dist-esm/acs-ui-javascript-loaders/src/outboundCallCompositeLoader.js +3 -4
- package/dist/dist-esm/acs-ui-javascript-loaders/src/outboundCallCompositeLoader.js.map +1 -1
- package/dist/dist-esm/chat-component-bindings/src/chatParticipantListSelector.js +10 -14
- package/dist/dist-esm/chat-component-bindings/src/chatParticipantListSelector.js.map +1 -1
- package/dist/dist-esm/chat-component-bindings/src/hooks/usePropsFor.js +2 -2
- package/dist/dist-esm/chat-component-bindings/src/hooks/usePropsFor.js.map +1 -1
- package/dist/dist-esm/chat-component-bindings/src/typingIndicatorSelector.js +2 -2
- package/dist/dist-esm/chat-component-bindings/src/typingIndicatorSelector.js.map +1 -1
- package/dist/dist-esm/chat-stateful-client/src/ChatContext.js +6 -8
- package/dist/dist-esm/chat-stateful-client/src/ChatContext.js.map +1 -1
- package/dist/dist-esm/chat-stateful-client/src/ResourceDownloadQueue.js +4 -3
- package/dist/dist-esm/chat-stateful-client/src/ResourceDownloadQueue.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/VideoGallery/styles/FloatingLocalVideo.styles.js +1 -1
- package/dist/dist-esm/react-components/src/components/VideoGallery/styles/FloatingLocalVideo.styles.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/CallComposite.js +14 -5
- package/dist/dist-esm/react-composites/src/composites/CallComposite/CallComposite.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/AzureCommunicationCallAdapter.d.ts +2 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/AzureCommunicationCallAdapter.js +39 -26
- package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/AzureCommunicationCallAdapter.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/CallAdapter.d.ts +2 -2
- package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/CallAdapter.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/CallingSoundSubscriber.d.ts +2 -2
- package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/CallingSoundSubscriber.js +8 -9
- package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/CallingSoundSubscriber.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/OnFetchProfileCallback.js +9 -4
- package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/OnFetchProfileCallback.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/components/CallReadinessModal.js +4 -4
- package/dist/dist-esm/react-composites/src/composites/CallComposite/components/CallReadinessModal.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/components/LocalDeviceSettings.js +27 -8
- package/dist/dist-esm/react-composites/src/composites/CallComposite/components/LocalDeviceSettings.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/components/NetworkReconnectTile.js +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/components/NetworkReconnectTile.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/components/SidePane/usePeoplePane.js +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/components/SidePane/usePeoplePane.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/hooks/useHandlers.js +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/hooks/useHandlers.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/TransferPage.js +3 -0
- package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/TransferPage.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/selectors/dominantRemoteParticipantSelector.js +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/selectors/dominantRemoteParticipantSelector.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/selectors/localPreviewSelector.js +2 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/selectors/localPreviewSelector.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/utils/MediaGalleryUtils.js +10 -11
- package/dist/dist-esm/react-composites/src/composites/CallComposite/utils/MediaGalleryUtils.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/utils/Utils.js +12 -8
- package/dist/dist-esm/react-composites/src/composites/CallComposite/utils/Utils.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/AzureCommunicationCallWithChatAdapter.d.ts +2 -2
- package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/AzureCommunicationCallWithChatAdapter.js +1 -4
- package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/AzureCommunicationCallWithChatAdapter.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/CallWithChatAdapter.d.ts +2 -2
- package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/CallWithChatAdapter.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/CallWithChatBackedCallAdapter.d.ts +2 -2
- package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/CallWithChatBackedCallAdapter.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/ChatComposite/ChatScreen.js +18 -19
- package/dist/dist-esm/react-composites/src/composites/ChatComposite/ChatScreen.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/ChatComposite/ImageUpload/ImageUploadUtils.js +17 -5
- package/dist/dist-esm/react-composites/src/composites/ChatComposite/ImageUpload/ImageUploadUtils.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/common/MeetingPhoneInfoPaneContent.js +1 -1
- package/dist/dist-esm/react-composites/src/composites/common/MeetingPhoneInfoPaneContent.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/common/ModalLocalAndRemotePIP.js +5 -1
- package/dist/dist-esm/react-composites/src/composites/common/ModalLocalAndRemotePIP.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/localization/locales/ar-SA/strings.json +2 -1
- package/dist/dist-esm/react-composites/src/composites/localization/locales/cs-CZ/strings.json +2 -1
- package/dist/dist-esm/react-composites/src/composites/localization/locales/cy-GB/strings.json +2 -1
- package/dist/dist-esm/react-composites/src/composites/localization/locales/de-DE/strings.json +2 -1
- package/dist/dist-esm/react-composites/src/composites/localization/locales/en-GB/strings.json +2 -1
- package/dist/dist-esm/react-composites/src/composites/localization/locales/es-ES/strings.json +2 -1
- package/dist/dist-esm/react-composites/src/composites/localization/locales/fi-FI/strings.json +2 -1
- package/dist/dist-esm/react-composites/src/composites/localization/locales/fr-FR/strings.json +2 -1
- package/dist/dist-esm/react-composites/src/composites/localization/locales/he-IL/strings.json +2 -1
- package/dist/dist-esm/react-composites/src/composites/localization/locales/it-IT/strings.json +2 -1
- package/dist/dist-esm/react-composites/src/composites/localization/locales/ja-JP/strings.json +2 -1
- package/dist/dist-esm/react-composites/src/composites/localization/locales/ko-KR/strings.json +1 -0
- package/dist/dist-esm/react-composites/src/composites/localization/locales/nb-NO/strings.json +2 -1
- package/dist/dist-esm/react-composites/src/composites/localization/locales/nl-NL/strings.json +2 -1
- package/dist/dist-esm/react-composites/src/composites/localization/locales/pl-PL/strings.json +2 -1
- package/dist/dist-esm/react-composites/src/composites/localization/locales/pt-BR/strings.json +2 -1
- package/dist/dist-esm/react-composites/src/composites/localization/locales/ru-RU/strings.json +2 -1
- package/dist/dist-esm/react-composites/src/composites/localization/locales/sv-SE/strings.json +2 -1
- package/dist/dist-esm/react-composites/src/composites/localization/locales/tr-TR/strings.json +2 -1
- package/dist/dist-esm/react-composites/src/composites/localization/locales/zh-CN/strings.json +2 -1
- package/dist/dist-esm/react-composites/src/composites/localization/locales/zh-TW/strings.json +2 -1
- package/package.json +2 -2
- package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/parseTeamsUrl.d.ts +0 -8
- package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/parseTeamsUrl.js +0 -25
- package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/parseTeamsUrl.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.20.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.20.0-alpha-202410170016';\n"]}
|
@@ -1,3 +1,4 @@
|
|
1
|
+
import { CommunicationTokenCredential, CommunicationUserIdentifier } from '@azure/communication-common';
|
1
2
|
import { AzureCommunicationCallAdapterOptions, CallAdapter, CallAdapterLocator, CallCompositeOptions } from "../../react-composites/src/index-public";
|
2
3
|
/**
|
3
4
|
* Props for the OutboundCallComposite that you can use in your application.
|
@@ -9,8 +10,8 @@ import { AzureCommunicationCallAdapterOptions, CallAdapter, CallAdapterLocator,
|
|
9
10
|
* @public
|
10
11
|
*/
|
11
12
|
export type CallCompositeLoaderProps = {
|
12
|
-
userId:
|
13
|
-
|
13
|
+
userId: CommunicationUserIdentifier;
|
14
|
+
credential: CommunicationTokenCredential;
|
14
15
|
displayName: string;
|
15
16
|
locator: CallAdapterLocator;
|
16
17
|
callAdapterOptions?: AzureCommunicationCallAdapterOptions;
|
@@ -14,8 +14,6 @@ import { parseReactVersion } from './utils';
|
|
14
14
|
const reactVersion = React.version;
|
15
15
|
parseReactVersion(reactVersion);
|
16
16
|
import { createRoot } from 'react-dom/client';
|
17
|
-
import { AzureCommunicationTokenCredential } from '@azure/communication-common';
|
18
|
-
import { fromFlatCommunicationIdentifier } from "../../acs-ui-common/src";
|
19
17
|
import { CallComposite, createAzureCommunicationCallAdapter } from "../../react-composites/src/index-public";
|
20
18
|
import { initializeIcons } from '@fluentui/react';
|
21
19
|
/**
|
@@ -28,11 +26,11 @@ import { initializeIcons } from '@fluentui/react';
|
|
28
26
|
export const loadCallComposite = function (loaderArgs, htmlElement) {
|
29
27
|
return __awaiter(this, void 0, void 0, function* () {
|
30
28
|
initializeIcons();
|
31
|
-
const { userId,
|
29
|
+
const { userId, credential, displayName, locator, callAdapterOptions, callCompositeOptions } = loaderArgs;
|
32
30
|
const adapter = yield createAzureCommunicationCallAdapter({
|
33
|
-
userId
|
31
|
+
userId,
|
34
32
|
displayName: displayName !== null && displayName !== void 0 ? displayName : 'anonymous',
|
35
|
-
credential
|
33
|
+
credential,
|
36
34
|
locator,
|
37
35
|
options: callAdapterOptions
|
38
36
|
});
|
@@ -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;
|
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,EAKpC,gDAAmC;AACpC,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAoBlD;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG,UAC/B,UAAoC,EACpC,WAAwB;;QAExB,eAAe,EAAE,CAAC;QAClB,MAAM,EAAE,MAAM,EAAE,UAAU,EAAE,WAAW,EAAE,OAAO,EAAE,kBAAkB,EAAE,oBAAoB,EAAE,GAAG,UAAU,CAAC;QAC1G,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,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 {\n CallComposite,\n createAzureCommunicationCallAdapter,\n AzureCommunicationCallAdapterOptions,\n CallAdapter,\n CallAdapterLocator,\n CallCompositeOptions\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 type CallCompositeLoaderProps = {\n userId: CommunicationUserIdentifier;\n credential: CommunicationTokenCredential;\n displayName: string;\n locator: CallAdapterLocator;\n callAdapterOptions?: AzureCommunicationCallAdapterOptions;\n callCompositeOptions?: CallCompositeOptions;\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 { userId, credential, displayName, locator, callAdapterOptions, callCompositeOptions } = 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(React.createElement(CallComposite, { options: callCompositeOptions, adapter }, null));\n return adapter;\n};\n"]}
|
@@ -1,3 +1,4 @@
|
|
1
|
+
import { CommunicationTokenCredential, CommunicationUserIdentifier } from '@azure/communication-common';
|
1
2
|
import { CallWithChatAdapter, CallAndChatLocator, CallWithChatCompositeOptions, AzureCommunicationCallAdapterOptions } from "../../react-composites/src/index-public";
|
2
3
|
/**
|
3
4
|
* Props for the CallWithChatComposite that you can use in your application.
|
@@ -8,8 +9,8 @@ import { CallWithChatAdapter, CallAndChatLocator, CallWithChatCompositeOptions,
|
|
8
9
|
* @public
|
9
10
|
*/
|
10
11
|
export type CallWithChatCompositeLoaderProps = {
|
11
|
-
userId:
|
12
|
-
|
12
|
+
userId: CommunicationUserIdentifier;
|
13
|
+
credential: CommunicationTokenCredential;
|
13
14
|
displayName: string;
|
14
15
|
endpoint: string;
|
15
16
|
locator: CallAndChatLocator;
|
@@ -14,8 +14,6 @@ import { parseReactVersion } from './utils';
|
|
14
14
|
const reactVersion = React.version;
|
15
15
|
parseReactVersion(reactVersion);
|
16
16
|
import { createRoot } from 'react-dom/client';
|
17
|
-
import { AzureCommunicationTokenCredential } from '@azure/communication-common';
|
18
|
-
import { fromFlatCommunicationIdentifier } from "../../acs-ui-common/src";
|
19
17
|
import { createAzureCommunicationCallWithChatAdapter, CallWithChatComposite } from "../../react-composites/src/index-public";
|
20
18
|
import { initializeIcons } from '@fluentui/react';
|
21
19
|
/**
|
@@ -28,11 +26,11 @@ import { initializeIcons } from '@fluentui/react';
|
|
28
26
|
export const loadCallWithChatComposite = function (loaderArgs, htmlElement) {
|
29
27
|
return __awaiter(this, void 0, void 0, function* () {
|
30
28
|
initializeIcons();
|
31
|
-
const { userId,
|
29
|
+
const { userId, credential, displayName, endpoint, locator, callAdapterOptions, callWithChatCompositeOptions } = loaderArgs;
|
32
30
|
const adapter = yield createAzureCommunicationCallWithChatAdapter({
|
33
|
-
userId
|
31
|
+
userId,
|
34
32
|
displayName: displayName !== null && displayName !== void 0 ? displayName : 'anonymous',
|
35
|
-
credential
|
33
|
+
credential,
|
36
34
|
endpoint: endpoint,
|
37
35
|
locator: locator,
|
38
36
|
callAdapterOptions
|
@@ -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;
|
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,EAEtB,gDAAmC;AACpC,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAoBlD;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,yBAAyB,GAAG,UACvC,UAA4C,EAC5C,WAAwB;;QAExB,eAAe,EAAE,CAAC;QAClB,MAAM,EAAE,MAAM,EAAE,UAAU,EAAE,WAAW,EAAE,QAAQ,EAAE,OAAO,EAAE,kBAAkB,EAAE,4BAA4B,EAAE,GAC5G,UAAU,CAAC;QACb,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,CAAC,qBAAqB,EAAE,EAAE,OAAO,EAAE,4BAA4B,EAAE,OAAO,EAAE,EAAE,IAAI,CAAC,CACrG,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} 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 type CallWithChatCompositeLoaderProps = {\n userId: CommunicationUserIdentifier;\n credential: CommunicationTokenCredential;\n displayName: string;\n endpoint: string;\n locator: CallAndChatLocator;\n callAdapterOptions?: AzureCommunicationCallAdapterOptions;\n callWithChatCompositeOptions?: CallWithChatCompositeOptions;\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 { userId, credential, displayName, endpoint, locator, callAdapterOptions, callWithChatCompositeOptions } =\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(CallWithChatComposite, { options: callWithChatCompositeOptions, adapter }, null)\n );\n return adapter;\n};\n"]}
|
@@ -1,3 +1,4 @@
|
|
1
|
+
import { CommunicationTokenCredential, CommunicationUserIdentifier } from '@azure/communication-common';
|
1
2
|
import { ChatAdapter, ChatCompositeOptions } from "../../react-composites/src/index-public";
|
2
3
|
/**
|
3
4
|
* Props for the ChatComposite that you can use in your application. Contains the
|
@@ -5,8 +6,8 @@ import { ChatAdapter, ChatCompositeOptions } from "../../react-composites/src/in
|
|
5
6
|
* @public
|
6
7
|
*/
|
7
8
|
export type ChatCompositeLoaderProps = {
|
8
|
-
userId:
|
9
|
-
|
9
|
+
userId: CommunicationUserIdentifier;
|
10
|
+
credential: CommunicationTokenCredential;
|
10
11
|
displayName?: string;
|
11
12
|
endpoint: string;
|
12
13
|
threadId: string;
|
@@ -14,9 +14,7 @@ import { parseReactVersion } from './utils';
|
|
14
14
|
const reactVersion = React.version;
|
15
15
|
parseReactVersion(reactVersion);
|
16
16
|
import { createRoot } from 'react-dom/client';
|
17
|
-
import { AzureCommunicationTokenCredential } from '@azure/communication-common';
|
18
17
|
import { ChatComposite, createAzureCommunicationChatAdapter } from "../../react-composites/src/index-public";
|
19
|
-
import { fromFlatCommunicationIdentifier } from "../../acs-ui-common/src";
|
20
18
|
import { initializeIcons } from '@fluentui/react';
|
21
19
|
/**
|
22
20
|
* Loader function for the ChatComposite that you can use in your application. This
|
@@ -28,12 +26,12 @@ import { initializeIcons } from '@fluentui/react';
|
|
28
26
|
export const loadChatComposite = function (loaderArgs, htmlElement) {
|
29
27
|
return __awaiter(this, void 0, void 0, function* () {
|
30
28
|
initializeIcons();
|
31
|
-
const { userId,
|
29
|
+
const { userId, credential, endpoint, threadId, displayName, chatCompositeOptions } = loaderArgs;
|
32
30
|
const adapter = yield createAzureCommunicationChatAdapter({
|
33
31
|
endpoint,
|
34
|
-
userId
|
32
|
+
userId,
|
35
33
|
displayName: displayName !== null && displayName !== void 0 ? displayName : 'anonymous',
|
36
|
-
credential
|
34
|
+
credential,
|
37
35
|
threadId
|
38
36
|
});
|
39
37
|
if (!htmlElement) {
|
@@ -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;
|
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,EAEL,aAAa,EAEb,mCAAmC,EACpC,gDAAmC;AACpC,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAgBlD;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG,UAC/B,UAAoC,EACpC,WAAwB;;QAExB,eAAe,EAAE,CAAC;QAClB,MAAM,EAAE,MAAM,EAAE,UAAU,EAAE,QAAQ,EAAE,QAAQ,EAAE,WAAW,EAAE,oBAAoB,EAAE,GAAG,UAAU,CAAC;QACjG,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,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 {\n ChatAdapter,\n ChatComposite,\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 type ChatCompositeLoaderProps = {\n userId: CommunicationUserIdentifier;\n credential: CommunicationTokenCredential;\n displayName?: string;\n endpoint: string;\n threadId: string;\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 { userId, credential, endpoint, threadId, displayName, chatCompositeOptions } = 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(React.createElement(ChatComposite, { options: chatCompositeOptions, adapter }, null));\n return adapter;\n};\n"]}
|
@@ -1,3 +1,4 @@
|
|
1
|
+
import { CommunicationTokenCredential, CommunicationUserIdentifier } from '@azure/communication-common';
|
1
2
|
import { CallCompositeOptions, StartCallIdentifier, AzureCommunicationCallAdapterOptions, CallAdapter } from "../../react-composites/src/index-public";
|
2
3
|
/**
|
3
4
|
* Props for the OutboundCallComposite that you can use in your application.
|
@@ -9,8 +10,8 @@ import { CallCompositeOptions, StartCallIdentifier, AzureCommunicationCallAdapte
|
|
9
10
|
* @public
|
10
11
|
*/
|
11
12
|
export type OutboundCallCompositeLoaderProps = {
|
12
|
-
userId:
|
13
|
-
|
13
|
+
userId: CommunicationUserIdentifier;
|
14
|
+
credential: CommunicationTokenCredential;
|
14
15
|
displayName: string;
|
15
16
|
targetCallees: string[] | StartCallIdentifier[];
|
16
17
|
callAdapterOptions?: AzureCommunicationCallAdapterOptions;
|
@@ -14,7 +14,6 @@ import { parseReactVersion } from './utils';
|
|
14
14
|
const reactVersion = React.version;
|
15
15
|
parseReactVersion(reactVersion);
|
16
16
|
import { createRoot } from 'react-dom/client';
|
17
|
-
import { AzureCommunicationTokenCredential } from '@azure/communication-common';
|
18
17
|
import { fromFlatCommunicationIdentifier } from "../../acs-ui-common/src";
|
19
18
|
import { CallComposite, createAzureCommunicationCallAdapter } from "../../react-composites/src/index-public";
|
20
19
|
import { initializeIcons } from '@fluentui/react';
|
@@ -29,16 +28,16 @@ export const loadOutboundCallComposite = function (loaderArgs, htmlElement) {
|
|
29
28
|
return __awaiter(this, void 0, void 0, function* () {
|
30
29
|
var _a;
|
31
30
|
initializeIcons();
|
32
|
-
const { userId,
|
31
|
+
const { userId, credential, displayName, targetCallees, callAdapterOptions, callCompositeOptions } = loaderArgs;
|
33
32
|
const formattedTargetCallees = typeof targetCallees[0] === 'string'
|
34
33
|
? targetCallees.map((callee) => {
|
35
34
|
return fromFlatCommunicationIdentifier(callee);
|
36
35
|
})
|
37
36
|
: undefined;
|
38
37
|
const adapter = yield createAzureCommunicationCallAdapter({
|
39
|
-
userId
|
38
|
+
userId,
|
40
39
|
displayName: displayName !== null && displayName !== void 0 ? displayName : 'anonymous',
|
41
|
-
credential
|
40
|
+
credential,
|
42
41
|
targetCallees: (_a = formattedTargetCallees) !== null && _a !== void 0 ? _a : targetCallees,
|
43
42
|
options: callAdapterOptions
|
44
43
|
});
|
@@ -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;
|
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,GAA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;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} 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 type OutboundCallCompositeLoaderProps = {\n userId: CommunicationUserIdentifier;\n credential: CommunicationTokenCredential;\n displayName: string;\n targetCallees: string[] | StartCallIdentifier[];\n callAdapterOptions?: AzureCommunicationCallAdapterOptions;\n callCompositeOptions?: CallCompositeOptions;\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"]}
|
@@ -16,10 +16,10 @@ const convertChatParticipantsToCommunicationParticipants = (chatParticipants) =>
|
|
16
16
|
});
|
17
17
|
};
|
18
18
|
/**
|
19
|
-
* get the
|
19
|
+
* get the moderator to help updating its display name if they are the local user or removing them from list of participants otherwise
|
20
20
|
*/
|
21
|
-
const
|
22
|
-
return participants.
|
21
|
+
const getModerator = (participants) => {
|
22
|
+
return participants.find((p) => p.displayName === undefined);
|
23
23
|
};
|
24
24
|
/**
|
25
25
|
* Selector for {@link ParticipantList} component.
|
@@ -28,17 +28,13 @@ const moderatorIndex = (participants) => {
|
|
28
28
|
*/
|
29
29
|
export const chatParticipantListSelector = reselect.createSelector([getUserId, getParticipants, getDisplayName], (userId, chatParticipants, displayName) => {
|
30
30
|
let participants = convertChatParticipantsToCommunicationParticipants(Object.values(chatParticipants));
|
31
|
-
if
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
else {
|
39
|
-
participants = participants.filter((p) => p.displayName);
|
40
|
-
}
|
41
|
-
}
|
31
|
+
// Update the moderator display name if they are the local user, otherwise remove them from list of participants
|
32
|
+
const moderator = getModerator(participants);
|
33
|
+
if ((moderator === null || moderator === void 0 ? void 0 : moderator.userId) === userId) {
|
34
|
+
moderator.displayName = displayName;
|
35
|
+
}
|
36
|
+
else {
|
37
|
+
participants = participants.filter((p) => p.displayName);
|
42
38
|
}
|
43
39
|
return {
|
44
40
|
myUserId: userId,
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"chatParticipantListSelector.js","sourceRoot":"","sources":["../../../../../chat-component-bindings/src/chatParticipantListSelector.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,eAAe,EAAyB,MAAM,iBAAiB,CAAC;AACpG,OAAO,KAAK,QAAQ,MAAM,UAAU,CAAC;AACrC,OAAO,EAAE,6BAA6B,EAAE,gCAAgC;AAIxE,OAAO,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAC;AAEhE,MAAM,kDAAkD,GAAG,CACzD,gBAAmC,EACL,EAAE;IAChC,OAAO,gBAAgB,CAAC,GAAG,CAAC,CAAC,WAA4B,EAAE,EAAE;QAC3D,OAAO;YACL,MAAM,EAAE,6BAA6B,CAAC,WAAW,CAAC,EAAE,CAAC;YACrD,WAAW,EAAE,WAAW,CAAC,WAAW;YACpC,wCAAwC;YACxC,iEAAiE;YACjE,WAAW,EAAE,iBAAiB,CAAC,WAAW,CAAC,EAAE,CAAC,CAAC,IAAI,KAAK,mBAAmB;SAC5E,CAAC;IACJ,CAAC,CAAC,CAAC;AACL,CAAC,CAAC;AAEF;;GAEG;AACH,MAAM,
|
1
|
+
{"version":3,"file":"chatParticipantListSelector.js","sourceRoot":"","sources":["../../../../../chat-component-bindings/src/chatParticipantListSelector.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,eAAe,EAAyB,MAAM,iBAAiB,CAAC;AACpG,OAAO,KAAK,QAAQ,MAAM,UAAU,CAAC;AACrC,OAAO,EAAE,6BAA6B,EAAE,gCAAgC;AAIxE,OAAO,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAC;AAEhE,MAAM,kDAAkD,GAAG,CACzD,gBAAmC,EACL,EAAE;IAChC,OAAO,gBAAgB,CAAC,GAAG,CAAC,CAAC,WAA4B,EAAE,EAAE;QAC3D,OAAO;YACL,MAAM,EAAE,6BAA6B,CAAC,WAAW,CAAC,EAAE,CAAC;YACrD,WAAW,EAAE,WAAW,CAAC,WAAW;YACpC,wCAAwC;YACxC,iEAAiE;YACjE,WAAW,EAAE,iBAAiB,CAAC,WAAW,CAAC,EAAE,CAAC,CAAC,IAAI,KAAK,mBAAmB;SAC5E,CAAC;IACJ,CAAC,CAAC,CAAC;AACL,CAAC,CAAC;AAEF;;GAEG;AACH,MAAM,YAAY,GAAG,CAAC,YAA0C,EAA0C,EAAE;IAC1G,OAAO,YAAY,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,WAAW,KAAK,SAAS,CAAC,CAAC;AAC/D,CAAC,CAAC;AAeF;;;;GAIG;AACH,MAAM,CAAC,MAAM,2BAA2B,GAAgC,QAAQ,CAAC,cAAc,CAC7F,CAAC,SAAS,EAAE,eAAe,EAAE,cAAc,CAAC,EAC5C,CAAC,MAAM,EAAE,gBAAoD,EAAE,WAAW,EAAE,EAAE;IAC5E,IAAI,YAAY,GAAG,kDAAkD,CAAC,MAAM,CAAC,MAAM,CAAC,gBAAgB,CAAC,CAAC,CAAC;IAEvG,gHAAgH;IAChH,MAAM,SAAS,GAAG,YAAY,CAAC,YAAY,CAAC,CAAC;IAC7C,IAAI,CAAA,SAAS,aAAT,SAAS,uBAAT,SAAS,CAAE,MAAM,MAAK,MAAM,EAAE,CAAC;QACjC,SAAS,CAAC,WAAW,GAAG,WAAW,CAAC;IACtC,CAAC;SAAM,CAAC;QACN,YAAY,GAAG,YAAY,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC;IAC3D,CAAC;IAED,OAAO;QACL,QAAQ,EAAE,MAAM;QAChB,YAAY,EAAE,YAAY;KAC3B,CAAC;AACJ,CAAC,CACF,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { getUserId, getDisplayName, getParticipants, ChatBaseSelectorProps } from './baseSelectors';\nimport * as reselect from 'reselect';\nimport { toFlatCommunicationIdentifier } from '@internal/acs-ui-common';\nimport { ChatParticipant } from '@azure/communication-chat';\nimport { ParticipantListParticipant } from '@internal/react-components';\nimport { ChatClientState } from '@internal/chat-stateful-client';\nimport { getIdentifierKind } from '@azure/communication-common';\n\nconst convertChatParticipantsToCommunicationParticipants = (\n chatParticipants: ChatParticipant[]\n): ParticipantListParticipant[] => {\n return chatParticipants.map((participant: ChatParticipant) => {\n return {\n userId: toFlatCommunicationIdentifier(participant.id),\n displayName: participant.displayName,\n // ACS users can not remove Teams users.\n // Removing phone numbers or unknown types of users is undefined.\n isRemovable: getIdentifierKind(participant.id).kind === 'communicationUser'\n };\n });\n};\n\n/**\n * get the moderator to help updating its display name if they are the local user or removing them from list of participants otherwise\n */\nconst getModerator = (participants: ParticipantListParticipant[]): ParticipantListParticipant | undefined => {\n return participants.find((p) => p.displayName === undefined);\n};\n\n/**\n * Selector type for {@link ParticipantList} component.\n *\n * @public\n */\nexport type ChatParticipantListSelector = (\n state: ChatClientState,\n props: ChatBaseSelectorProps\n) => {\n myUserId: string;\n participants: ParticipantListParticipant[];\n};\n\n/**\n * Selector for {@link ParticipantList} component.\n *\n * @public\n */\nexport const chatParticipantListSelector: ChatParticipantListSelector = reselect.createSelector(\n [getUserId, getParticipants, getDisplayName],\n (userId, chatParticipants: { [key: string]: ChatParticipant }, displayName) => {\n let participants = convertChatParticipantsToCommunicationParticipants(Object.values(chatParticipants));\n\n // Update the moderator display name if they are the local user, otherwise remove them from list of participants\n const moderator = getModerator(participants);\n if (moderator?.userId === userId) {\n moderator.displayName = displayName;\n } else {\n participants = participants.filter((p) => p.displayName);\n }\n\n return {\n myUserId: userId,\n participants: participants\n };\n }\n);\n"]}
|
@@ -58,8 +58,8 @@ const findSelector = (component) => {
|
|
58
58
|
const threadId = (_b = (_a = useContext(ChatThreadClientContext)) === null || _a === void 0 ? void 0 : _a.threadId) !== null && _b !== void 0 ? _b : 'default-id-when-not-in-provider';
|
59
59
|
let messageThreadSelectorImpl = messageThreadSelectorsByThread[threadId];
|
60
60
|
if (!messageThreadSelectorImpl) {
|
61
|
-
|
62
|
-
|
61
|
+
messageThreadSelectorImpl = messageThreadSelectorWithThread();
|
62
|
+
messageThreadSelectorsByThread[threadId] = messageThreadSelectorImpl;
|
63
63
|
}
|
64
64
|
return messageThreadSelectorImpl;
|
65
65
|
};
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"usePropsFor.js","sourceRoot":"","sources":["../../../../../../chat-component-bindings/src/hooks/usePropsFor.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAClC,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,eAAe,EAAE,OAAO,EAAE,eAAe,EAAE,sCAAmC;AAKhH,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAmB,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACtE,OAAO,EAAyB,+BAA+B,EAAE,MAAM,0BAA0B,CAAC;AAClG,OAAO,EAA2B,uBAAuB,EAAE,MAAM,4BAA4B,CAAC;AAG9F,OAAO,EAA+B,2BAA2B,EAAE,MAAM,gCAAgC,CAAC;AAC1G,OAAO,EAAoB,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AACzE,OAAO,EAAE,uBAAuB,EAAE,MAAM,uCAAuC,CAAC;AAChF,OAAO,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAEnC;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,CAAC,MAAM,WAAW,GAAG,CACzB,SAAoB,EAGR,EAAE;IACd,MAAM,QAAQ,GAAG,WAAW,CAAC,SAAS,CAAC,CAAC;IACxC,MAAM,KAAK,GAAG,WAAW,CAAC,QAAQ,CAAC,CAAC;IACpC,MAAM,QAAQ,GAAG,WAAW,CAA2B,SAAS,CAAC,CAAC;IAClE,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;QACxB,OAAO,gCAAK,KAAK,GAAK,QAAQ,CAAS,CAAC;IAC1C,CAAC;IACD,OAAO,SAAgB,CAAC;AAC1B,CAAC,CAAC;AAsBF;;;;;;;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YACV,OAAO,eAAe,CAAC;QACzB,KAAK,aAAa;YAChB,OAAO,wBAAwB,EAAE,CAAC;QACpC,KAAK,eAAe;YAClB,OAAO,uBAAuB,CAAC;QACjC,KAAK,eAAe;YAClB,OAAO,2BAA2B,CAAC;QACrC,KAAK,QAAQ;YACX,OAAO,gBAAgB,CAAC;IAC5B,CAAC;IACD,OAAO,SAAS,CAAC;AACnB,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\nimport { ErrorBar, MessageThread, ParticipantList, SendBox, TypingIndicator } from '@internal/react-components';\n\n/* @conditional-compile-remove(rich-text-editor) */\nimport type { RichTextSendBox } from '@internal/react-components';\n\nimport { useHandlers } from './useHandlers';\nimport { useSelector } from './useSelector';\nimport { SendBoxSelector, sendBoxSelector } from '../sendBoxSelector';\nimport { MessageThreadSelector, messageThreadSelectorWithThread } from '../messageThreadSelector';\nimport { TypingIndicatorSelector, typingIndicatorSelector } from '../typingIndicatorSelector';\nimport { Common, AreEqual } from '@internal/acs-ui-common';\nimport { ChatHandlers } from '../handlers/createHandlers';\nimport { ChatParticipantListSelector, chatParticipantListSelector } from '../chatParticipantListSelector';\nimport { ErrorBarSelector, errorBarSelector } from '../errorBarSelector';\nimport { ChatThreadClientContext } from '../providers/ChatThreadClientProvider';\nimport { useContext } from 'react';\n\n/**\n * Primary hook to get all hooks necessary for a chat Component.\n *\n * Most straightforward usage of chat components looks like:\n *\n * @example\n * ```\n * import { ParticipantList, usePropsFor } from '@azure/communication-react';\n *\n * const App = (): JSX.Element => {\n * // ... code to setup Providers ...\n *\n * return <ParticipantList {...usePropsFor(ParticipantList)}/>\n * }\n * ```\n *\n * @public\n */\nexport const usePropsFor = <Component extends (props: any) => JSX.Element>(\n component: Component\n): GetSelector<Component> extends (props: any) => any\n ? ReturnType<GetSelector<Component>> & Common<ChatHandlers, Parameters<Component>[0]>\n : undefined => {\n const selector = getSelector(component);\n const props = useSelector(selector);\n const handlers = useHandlers<Parameters<Component>[0]>(component);\n if (props !== undefined) {\n return { ...props, ...handlers } as any;\n }\n return undefined as any;\n};\n\n/**\n * Specific type of the selector applicable to a given Component.\n *\n * @public\n */\nexport type GetSelector<Component extends (props: any) => JSX.Element | undefined> =\n AreEqual<Component, typeof SendBox> extends true\n ? SendBoxSelector\n : AreEqual<Component, typeof RichTextSendBox> extends true\n ? /* @conditional-compile-remove(rich-text-editor) */ SendBoxSelector\n : AreEqual<Component, typeof MessageThread> extends true\n ? MessageThreadSelector\n : AreEqual<Component, typeof TypingIndicator> extends true\n ? TypingIndicatorSelector\n : AreEqual<Component, typeof ParticipantList> extends true\n ? ChatParticipantListSelector\n : AreEqual<Component, typeof ErrorBar> extends true\n ? ErrorBarSelector\n : undefined;\n\n/**\n * Get the selector for a specified component.\n *\n * Useful when implementing a custom component that utilizes the providers\n * exported from this library.\n *\n * @public\n */\nexport const getSelector = <Component extends (props: any) => JSX.Element | undefined>(\n component: Component\n): GetSelector<Component> => {\n return findSelector(component);\n};\n\nconst messageThreadSelectorsByThread: { [key: string]: MessageThreadSelector } = {};\n\nconst findSelector = (component: (props: any) => JSX.Element | undefined): any => {\n // For the message thread selector we need to create a new one for each thread\n // If we have just one for the entire app, then we will have updates when not expecting due to\n // the arguments changing\n const getMessageThreadSelector: () => MessageThreadSelector = () => {\n const threadId = useContext(ChatThreadClientContext)?.threadId ?? 'default-id-when-not-in-provider';\n let messageThreadSelectorImpl = messageThreadSelectorsByThread[threadId];\n if (!messageThreadSelectorImpl) {\n messageThreadSelectorImpl = messageThreadSelectorWithThread();\n messageThreadSelectorsByThread[threadId] = messageThreadSelectorImpl;\n }\n return messageThreadSelectorImpl;\n };\n /* @conditional-compile-remove(rich-text-editor) */\n if (typeof component === 'function' && component.name === 'RichTextSendBox') {\n return sendBoxSelector;\n }\n switch (component) {\n case SendBox:\n return sendBoxSelector;\n case MessageThread:\n return getMessageThreadSelector();\n case TypingIndicator:\n return typingIndicatorSelector;\n case ParticipantList:\n return chatParticipantListSelector;\n case ErrorBar:\n return errorBarSelector;\n }\n return undefined;\n};\n"]}
|
@@ -8,8 +8,8 @@ const filterTypingIndicators = (typingIndicators, userId) => {
|
|
8
8
|
const filteredTypingIndicators = [];
|
9
9
|
const seen = new Set();
|
10
10
|
const date8SecondsAgo = new Date(Date.now() - MINIMUM_TYPING_INTERVAL_IN_MILLISECONDS);
|
11
|
-
|
12
|
-
|
11
|
+
const reversedTypingIndicators = typingIndicators.toReversed();
|
12
|
+
for (const typingIndicator of reversedTypingIndicators) {
|
13
13
|
if (toFlatCommunicationIdentifier(typingIndicator.sender) === userId) {
|
14
14
|
continue;
|
15
15
|
}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"typingIndicatorSelector.js","sourceRoot":"","sources":["../../../../../chat-component-bindings/src/typingIndicatorSelector.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EAAE,mBAAmB,EAAE,eAAe,EAAE,SAAS,EAAyB,MAAM,iBAAiB,CAAC;AACzG,OAAO,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAG1C,OAAO,EAAE,6BAA6B,EAAE,gCAAgC;AAExE,OAAO,EAAE,uCAAuC,EAAE,sBAAsB,EAAE,MAAM,mBAAmB,CAAC;AAGpG,MAAM,sBAAsB,GAAG,CAC7B,gBAAgD,EAChD,MAAc,EACkB,EAAE;IAClC,MAAM,wBAAwB,GAAmC,EAAE,CAAC;IACpE,MAAM,IAAI,GAAG,IAAI,GAAG,EAAE,CAAC;IACvB,MAAM,eAAe,GAAG,IAAI,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,GAAG,uCAAuC,CAAC,CAAC;IACvF,
|
1
|
+
{"version":3,"file":"typingIndicatorSelector.js","sourceRoot":"","sources":["../../../../../chat-component-bindings/src/typingIndicatorSelector.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EAAE,mBAAmB,EAAE,eAAe,EAAE,SAAS,EAAyB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AAE,MAAA,YAAY,CAAC,6BAA6B,CAAC,eAAe,CAAC,MAAM,CAAC,CAAC,0CAAE,WAAW;SAC9F,CAAC,CAAA;KAAA,CAAC,CAAC;AACN,CAAC,CAAC;AAcF;;;;GAIG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAA4B,cAAc,CAC5E,CAAC,mBAAmB,EAAE,eAAe,EAAE,SAAS,CAAC,EACjD,CACE,gBAAgD,EAChD,YAAgD,EAChD,MAAc,EACd,EAAE;IACF,4EAA4E;IAC5E,IAAI,MAAM,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC,MAAM,IAAI,sBAAsB,EAAE,CAAC;QACjE,OAAO,EAAE,WAAW,EAAE,EAAE,EAAE,CAAC;IAC7B,CAAC;IAED,qIAAqI;IACrI,MAAM,wBAAwB,GAAG,sBAAsB,CAAC,gBAAgB,EAAE,MAAM,CAAC,CAAC;IAElF,MAAM,WAAW,GAA+B,qDAAqD,CACnG,wBAAwB,EACxB,YAAY,CACb,CAAC;IAEF,OAAO,EAAE,WAAW,EAAE,CAAC;AACzB,CAAC,CACF,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { getTypingIndicators, getParticipants, getUserId, ChatBaseSelectorProps } from './baseSelectors';\nimport { createSelector } from 'reselect';\nimport { ChatParticipant } from '@azure/communication-chat';\nimport { TypingIndicatorReceivedEvent } from '@azure/communication-chat';\nimport { toFlatCommunicationIdentifier } from '@internal/acs-ui-common';\nimport { CommunicationParticipant } from '@internal/react-components';\nimport { MINIMUM_TYPING_INTERVAL_IN_MILLISECONDS, PARTICIPANTS_THRESHOLD } from './utils/constants';\nimport { ChatClientState } from '@internal/chat-stateful-client';\n\nconst filterTypingIndicators = (\n typingIndicators: TypingIndicatorReceivedEvent[],\n userId: string\n): TypingIndicatorReceivedEvent[] => {\n const filteredTypingIndicators: TypingIndicatorReceivedEvent[] = [];\n const seen = new Set();\n const date8SecondsAgo = new Date(Date.now() - MINIMUM_TYPING_INTERVAL_IN_MILLISECONDS);\n const reversedTypingIndicators = typingIndicators.toReversed();\n for (const typingIndicator of reversedTypingIndicators) {\n if (toFlatCommunicationIdentifier(typingIndicator.sender) === userId) {\n continue;\n }\n if (typingIndicator.receivedOn < date8SecondsAgo) {\n continue;\n }\n if (seen.has(toFlatCommunicationIdentifier(typingIndicator.sender))) {\n continue;\n }\n seen.add(toFlatCommunicationIdentifier(typingIndicator.sender));\n filteredTypingIndicators.push(typingIndicator);\n }\n return filteredTypingIndicators;\n};\n\nconst convertSdkTypingIndicatorsToCommunicationParticipants = (\n typingIndicators: TypingIndicatorReceivedEvent[],\n participants: { [key: string]: ChatParticipant }\n): CommunicationParticipant[] => {\n return typingIndicators.map((typingIndicator) => ({\n userId: toFlatCommunicationIdentifier(typingIndicator.sender),\n displayName: participants[toFlatCommunicationIdentifier(typingIndicator.sender)]?.displayName\n }));\n};\n\n/**\n * Selector type for {@link TypingIndicator} component.\n *\n * @public\n */\nexport type TypingIndicatorSelector = (\n state: ChatClientState,\n props: ChatBaseSelectorProps\n) => {\n typingUsers: CommunicationParticipant[];\n};\n\n/**\n * Selector for {@link TypingIndicator} component.\n *\n * @public\n */\nexport const typingIndicatorSelector: TypingIndicatorSelector = createSelector(\n [getTypingIndicators, getParticipants, getUserId],\n (\n typingIndicators: TypingIndicatorReceivedEvent[],\n participants: { [key: string]: ChatParticipant },\n userId: string\n ) => {\n // if the participant size reaches the threshold then return no typing users\n if (Object.values(participants).length >= PARTICIPANTS_THRESHOLD) {\n return { typingUsers: [] };\n }\n\n // filter typing indicators to remove those that are from the duplicate users or current user as well as those older than a threshold\n const filteredTypingIndicators = filterTypingIndicators(typingIndicators, userId);\n\n const typingUsers: CommunicationParticipant[] = convertSdkTypingIndicatorsToCommunicationParticipants(\n filteredTypingIndicators,\n participants\n );\n\n return { typingUsers };\n }\n);\n"]}
|
@@ -65,19 +65,17 @@ export class ChatContext {
|
|
65
65
|
var _a, _b;
|
66
66
|
(_a = this._inlineImageQueue) === null || _a === void 0 ? void 0 : _a.cancelAllRequests();
|
67
67
|
(_b = this._fullsizeImageQueue) === null || _b === void 0 ? void 0 : _b.cancelAllRequests();
|
68
|
-
Object.
|
69
|
-
|
70
|
-
|
71
|
-
const cache = thread.chatMessages[messageId].resourceCache;
|
68
|
+
Object.values(draft.threads).forEach((thread) => {
|
69
|
+
Object.values(thread.chatMessages).forEach((message) => {
|
70
|
+
const cache = message.resourceCache;
|
72
71
|
if (cache) {
|
73
|
-
Object.
|
74
|
-
const resource = cache[resourceUrl];
|
72
|
+
Object.values(cache).forEach((resource) => {
|
75
73
|
if (resource.sourceUrl) {
|
76
74
|
URL.revokeObjectURL(resource.sourceUrl);
|
77
75
|
}
|
78
76
|
});
|
79
77
|
}
|
80
|
-
|
78
|
+
message.resourceCache = undefined;
|
81
79
|
});
|
82
80
|
});
|
83
81
|
});
|
@@ -113,7 +111,7 @@ export class ChatContext {
|
|
113
111
|
}
|
114
112
|
if (message && message.resourceCache && message.resourceCache[resourceUrl]) {
|
115
113
|
const resource = message.resourceCache[resourceUrl];
|
116
|
-
if (resource.sourceUrl) {
|
114
|
+
if (resource === null || resource === void 0 ? void 0 : resource.sourceUrl) {
|
117
115
|
URL.revokeObjectURL(resource.sourceUrl);
|
118
116
|
}
|
119
117
|
delete message.resourceCache[resourceUrl];
|