@azure/communication-react 1.14.1-alpha-202403270012 → 1.14.1-alpha-202403290012
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 +203 -63
- package/dist/dist-cjs/communication-react/{RichTextSendBoxWrapper-Yty3fOoA.js → RichTextSendBoxWrapper-CH6WvEGZ.js} +7 -4
- package/dist/dist-cjs/communication-react/{RichTextSendBoxWrapper-Yty3fOoA.js.map → RichTextSendBoxWrapper-CH6WvEGZ.js.map} +1 -1
- package/dist/dist-cjs/communication-react/{index-BEomNZbT.js → index-qxnuqL7s.js} +1017 -321
- package/dist/dist-cjs/communication-react/index-qxnuqL7s.js.map +1 -0
- package/dist/dist-cjs/communication-react/index.js +6 -3
- package/dist/dist-cjs/communication-react/index.js.map +1 -1
- package/dist/dist-esm/acs-ui-common/src/telemetryVersion.js +1 -1
- package/dist/dist-esm/acs-ui-common/src/telemetryVersion.js.map +1 -1
- package/dist/dist-esm/calling-stateful-client/src/CallClientState.d.ts +5 -0
- package/dist/dist-esm/calling-stateful-client/src/CallClientState.js.map +1 -1
- package/dist/dist-esm/calling-stateful-client/src/CallContext.js +2 -0
- package/dist/dist-esm/calling-stateful-client/src/CallContext.js.map +1 -1
- package/dist/dist-esm/calling-stateful-client/src/Converter.js +6 -2
- package/dist/dist-esm/calling-stateful-client/src/Converter.js.map +1 -1
- package/dist/dist-esm/chat-component-bindings/src/messageThreadSelector.js +1 -2
- package/dist/dist-esm/chat-component-bindings/src/messageThreadSelector.js.map +1 -1
- package/dist/dist-esm/communication-react/src/index.d.ts +1 -1
- package/dist/dist-esm/communication-react/src/index.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/AttachmentCard.d.ts +11 -15
- package/dist/dist-esm/react-components/src/components/AttachmentCard.js +25 -41
- package/dist/dist-esm/react-components/src/components/AttachmentCard.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/AttachmentDownloadCards.d.ts +18 -11
- package/dist/dist-esm/react-components/src/components/AttachmentDownloadCards.js +74 -62
- package/dist/dist-esm/react-components/src/components/AttachmentDownloadCards.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/AttachmentUploadCards.js +37 -4
- package/dist/dist-esm/react-components/src/components/AttachmentUploadCards.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/ChatMessage/ChatMessageComponentWrapper.d.ts +6 -3
- package/dist/dist-esm/react-components/src/components/ChatMessage/ChatMessageComponentWrapper.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/ChatMessage/MessageComponents/ChatMessageComponentAsMessageBubble.d.ts +5 -5
- package/dist/dist-esm/react-components/src/components/ChatMessage/MessageComponents/ChatMessageComponentAsMessageBubble.js +7 -7
- package/dist/dist-esm/react-components/src/components/ChatMessage/MessageComponents/ChatMessageComponentAsMessageBubble.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/ChatMessage/MessageComponents/FluentChatMessageComponent.js +13 -18
- package/dist/dist-esm/react-components/src/components/ChatMessage/MessageComponents/FluentChatMessageComponent.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/ChatMessage/MyMessageComponents/ChatMyMessageComponent.d.ts +9 -9
- package/dist/dist-esm/react-components/src/components/ChatMessage/MyMessageComponents/ChatMyMessageComponent.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/ChatMessage/MyMessageComponents/ChatMyMessageComponentAsMessageBubble.d.ts +9 -9
- package/dist/dist-esm/react-components/src/components/ChatMessage/MyMessageComponents/ChatMyMessageComponentAsMessageBubble.js +10 -10
- package/dist/dist-esm/react-components/src/components/ChatMessage/MyMessageComponents/ChatMyMessageComponentAsMessageBubble.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/ChatMessage/MyMessageComponents/FluentChatMyMessageComponent.js +12 -10
- package/dist/dist-esm/react-components/src/components/ChatMessage/MyMessageComponents/FluentChatMyMessageComponent.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/Dialpad/Dialpad.d.ts +4 -0
- package/dist/dist-esm/react-components/src/components/Dialpad/Dialpad.js +2 -2
- package/dist/dist-esm/react-components/src/components/Dialpad/Dialpad.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/MessageStatusIcon.js +1 -1
- package/dist/dist-esm/react-components/src/components/MessageStatusIcon.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/MessageThread.d.ts +10 -9
- package/dist/dist-esm/react-components/src/components/MessageThread.js +17 -13
- package/dist/dist-esm/react-components/src/components/MessageThread.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/RichTextEditor/Buttons/RichTextRibbonButtons.d.ts +7 -0
- package/dist/dist-esm/react-components/src/components/RichTextEditor/{RichTextRibbonButtons.js → Buttons/RichTextRibbonButtons.js} +16 -20
- package/dist/dist-esm/react-components/src/components/RichTextEditor/Buttons/RichTextRibbonButtons.js.map +1 -0
- package/dist/dist-esm/react-components/src/components/RichTextEditor/Buttons/Table/RichTextInsertTableButton.d.ts +7 -0
- package/dist/dist-esm/react-components/src/components/RichTextEditor/Buttons/Table/RichTextInsertTableButton.js +56 -0
- package/dist/dist-esm/react-components/src/components/RichTextEditor/Buttons/Table/RichTextInsertTableButton.js.map +1 -0
- package/dist/dist-esm/react-components/src/components/RichTextEditor/Buttons/Table/RichTextInsertTablePane.d.ts +16 -0
- package/dist/dist-esm/react-components/src/components/RichTextEditor/Buttons/Table/RichTextInsertTablePane.js +62 -0
- package/dist/dist-esm/react-components/src/components/RichTextEditor/Buttons/Table/RichTextInsertTablePane.js.map +1 -0
- package/dist/dist-esm/react-components/src/components/RichTextEditor/Buttons/Table/RichTextTableContextMenu.d.ts +8 -0
- package/dist/dist-esm/react-components/src/components/RichTextEditor/Buttons/Table/RichTextTableContextMenu.js +57 -0
- package/dist/dist-esm/react-components/src/components/RichTextEditor/Buttons/Table/RichTextTableContextMenu.js.map +1 -0
- package/dist/dist-esm/react-components/src/components/RichTextEditor/Buttons/Table/insertTableAction.d.ts +9 -0
- package/dist/dist-esm/react-components/src/components/RichTextEditor/Buttons/Table/insertTableAction.js +34 -0
- package/dist/dist-esm/react-components/src/components/RichTextEditor/Buttons/Table/insertTableAction.js.map +1 -0
- package/dist/dist-esm/react-components/src/components/RichTextEditor/RichTextEditor.js +23 -11
- package/dist/dist-esm/react-components/src/components/RichTextEditor/RichTextEditor.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/RichTextEditor/RichTextSendBox.d.ts +44 -0
- package/dist/dist-esm/react-components/src/components/RichTextEditor/RichTextSendBox.js +16 -6
- package/dist/dist-esm/react-components/src/components/RichTextEditor/RichTextSendBox.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/VideoGallery/DefaultLayout.js +2 -2
- package/dist/dist-esm/react-components/src/components/VideoGallery/DefaultLayout.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/VideoGallery/LargeGalleryLayout.js +5 -3
- package/dist/dist-esm/react-components/src/components/VideoGallery/LargeGalleryLayout.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/index.d.ts +2 -2
- package/dist/dist-esm/react-components/src/components/index.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/styles/AttachmentCard.styles.d.ts +1 -1
- package/dist/dist-esm/react-components/src/components/styles/AttachmentCard.styles.js +1 -1
- package/dist/dist-esm/react-components/src/components/styles/AttachmentCard.styles.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/styles/RichTextEditor.styles.d.ts +25 -1
- package/dist/dist-esm/react-components/src/components/styles/RichTextEditor.styles.js +132 -2
- package/dist/dist-esm/react-components/src/components/styles/RichTextEditor.styles.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/utils/ChatMessageComponentUtils.d.ts +10 -2
- package/dist/dist-esm/react-components/src/components/utils/ChatMessageComponentUtils.js +20 -14
- package/dist/dist-esm/react-components/src/components/utils/ChatMessageComponentUtils.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/utils/RichTextEditorStringsUtils.d.ts +15 -0
- package/dist/dist-esm/react-components/src/components/utils/RichTextEditorStringsUtils.js +39 -0
- package/dist/dist-esm/react-components/src/components/utils/RichTextEditorStringsUtils.js.map +1 -0
- package/dist/dist-esm/react-components/src/components/utils/RichTextTableUtils.d.ts +22 -0
- package/dist/dist-esm/react-components/src/components/utils/RichTextTableUtils.js +29 -0
- package/dist/dist-esm/react-components/src/components/utils/RichTextTableUtils.js.map +1 -0
- package/dist/dist-esm/react-components/src/localization/locales/en-US/strings.json +13 -1
- package/dist/dist-esm/react-components/src/theming/icons.d.ts +7 -2
- package/dist/dist-esm/react-components/src/theming/icons.js +15 -5
- package/dist/dist-esm/react-components/src/theming/icons.js.map +1 -1
- package/dist/dist-esm/react-components/src/types/Attachment.d.ts +97 -37
- package/dist/dist-esm/react-components/src/types/Attachment.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/CallComposite.js +2 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/CallComposite.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/Strings.d.ts +4 -0
- package/dist/dist-esm/react-composites/src/composites/CallComposite/Strings.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/AzureCommunicationCallAdapter.d.ts +2 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/AzureCommunicationCallAdapter.js +22 -4
- package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/AzureCommunicationCallAdapter.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/components/LocalDeviceSettings.js +3 -3
- 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/LocalPreview.js +2 -2
- package/dist/dist-esm/react-composites/src/composites/CallComposite/components/LocalPreview.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/CallPage.d.ts +1 -0
- package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/CallPage.js +2 -2
- package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/CallPage.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/DtmfDialpadPage.d.ts +1 -0
- package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/DtmfDialpadPage.js +2 -2
- package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/DtmfDialpadPage.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/styles/CallConfiguration.styles.d.ts +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/styles/CallConfiguration.styles.js +32 -17
- package/dist/dist-esm/react-composites/src/composites/CallComposite/styles/CallConfiguration.styles.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/styles/LocalDeviceSettings.styles.d.ts +5 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/styles/LocalDeviceSettings.styles.js +12 -0
- package/dist/dist-esm/react-composites/src/composites/CallComposite/styles/LocalDeviceSettings.styles.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/styles/LocalPreview.styles.d.ts +2 -14
- package/dist/dist-esm/react-composites/src/composites/CallComposite/styles/LocalPreview.styles.js +14 -10
- package/dist/dist-esm/react-composites/src/composites/CallComposite/styles/LocalPreview.styles.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/utils/Utils.js +13 -1
- 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 +53 -3
- package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/AzureCommunicationCallWithChatAdapter.js +196 -57
- package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/AzureCommunicationCallWithChatAdapter.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/state/CallWithChatAdapterState.d.ts +2 -2
- package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/state/CallWithChatAdapterState.js +4 -5
- package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/state/CallWithChatAdapterState.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/ChatComposite/AttachmentDownloadErrorBar.d.ts +15 -0
- package/dist/dist-esm/react-composites/src/composites/ChatComposite/{FileDownloadErrorBar.js → AttachmentDownloadErrorBar.js} +5 -5
- package/dist/dist-esm/react-composites/src/composites/ChatComposite/AttachmentDownloadErrorBar.js.map +1 -0
- package/dist/dist-esm/react-composites/src/composites/ChatComposite/ChatScreen.d.ts +4 -5
- package/dist/dist-esm/react-composites/src/composites/ChatComposite/ChatScreen.js +10 -7
- package/dist/dist-esm/react-composites/src/composites/ChatComposite/ChatScreen.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/ChatComposite/adapter/AzureCommunicationChatAdapter.d.ts +6 -0
- package/dist/dist-esm/react-composites/src/composites/ChatComposite/adapter/AzureCommunicationChatAdapter.js +22 -0
- package/dist/dist-esm/react-composites/src/composites/ChatComposite/adapter/AzureCommunicationChatAdapter.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/ChatComposite/file-sharing/FileUploadButton.js +1 -1
- package/dist/dist-esm/react-composites/src/composites/ChatComposite/file-sharing/FileUploadButton.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/ChatComposite/file-sharing/index.d.ts +2 -0
- package/dist/dist-esm/react-composites/src/composites/ChatComposite/file-sharing/index.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/ChatComposite/index.d.ts +1 -1
- package/dist/dist-esm/react-composites/src/composites/ChatComposite/index.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/common/PeoplePaneContent.js +11 -2
- package/dist/dist-esm/react-composites/src/composites/common/PeoplePaneContent.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/common/icons.d.ts +7 -2
- package/dist/dist-esm/react-composites/src/composites/localization/locales/en-US/strings.json +2 -1
- package/package.json +2 -1
- package/dist/dist-cjs/communication-react/index-BEomNZbT.js.map +0 -1
- package/dist/dist-esm/react-components/src/components/RichTextEditor/RichTextRibbonButtons.d.ts +0 -12
- package/dist/dist-esm/react-components/src/components/RichTextEditor/RichTextRibbonButtons.js.map +0 -1
- package/dist/dist-esm/react-composites/src/composites/ChatComposite/FileDownloadErrorBar.d.ts +0 -15
- package/dist/dist-esm/react-composites/src/composites/ChatComposite/FileDownloadErrorBar.js.map +0 -1
@@ -10,7 +10,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
10
10
|
});
|
11
11
|
};
|
12
12
|
import { callWithChatAdapterStateFromBackingStates, mergeCallAdapterStateIntoCallWithChatAdapterState, mergeChatAdapterStateIntoCallWithChatAdapterState } from '../state/CallWithChatAdapterState';
|
13
|
-
import {
|
13
|
+
import { _createLazyAzureCommunicationChatAdapterInner, createAzureCommunicationChatAdapterFromClient } from '../../ChatComposite/adapter/AzureCommunicationChatAdapter';
|
14
14
|
import { EventEmitter } from 'events';
|
15
15
|
/* @conditional-compile-remove(PSTN-calls) */
|
16
16
|
import { isCommunicationUserIdentifier } from '@azure/communication-common';
|
@@ -54,44 +54,61 @@ class CallWithChatContext {
|
|
54
54
|
* Created for easy use with the {@link CallWithChatComposite}.
|
55
55
|
*/
|
56
56
|
export class AzureCommunicationCallWithChatAdapter {
|
57
|
-
constructor(callAdapter,
|
57
|
+
constructor(callAdapter, chatAdapterPromise) {
|
58
58
|
/* @conditional-compile-remove(attachment-download) @conditional-compile-remove(attachment-upload) */
|
59
59
|
this.registerActiveFileUploads = (files) => {
|
60
|
-
|
60
|
+
var _a, _b;
|
61
|
+
return (_b = (_a = this.chatAdapter) === null || _a === void 0 ? void 0 : _a.registerActiveFileUploads(files)) !== null && _b !== void 0 ? _b : [];
|
61
62
|
};
|
62
63
|
/* @conditional-compile-remove(attachment-download) @conditional-compile-remove(attachment-upload) */
|
63
64
|
this.registerCompletedFileUploads = (metadata) => {
|
64
|
-
|
65
|
+
var _a, _b;
|
66
|
+
return (_b = (_a = this.chatAdapter) === null || _a === void 0 ? void 0 : _a.registerCompletedFileUploads(metadata)) !== null && _b !== void 0 ? _b : [];
|
65
67
|
};
|
66
68
|
/* @conditional-compile-remove(attachment-download) @conditional-compile-remove(attachment-upload) */
|
67
69
|
this.clearFileUploads = () => {
|
68
|
-
this.
|
70
|
+
this.chatAdapterPromise.then((adapter) => {
|
71
|
+
adapter.clearFileUploads();
|
72
|
+
});
|
69
73
|
};
|
70
74
|
/* @conditional-compile-remove(attachment-download) @conditional-compile-remove(attachment-upload) */
|
71
75
|
this.cancelFileUpload = (id) => {
|
72
|
-
this.
|
76
|
+
this.chatAdapterPromise.then((adapter) => {
|
77
|
+
adapter.cancelFileUpload(id);
|
78
|
+
});
|
73
79
|
};
|
74
80
|
/* @conditional-compile-remove(attachment-download) @conditional-compile-remove(attachment-upload) */
|
75
81
|
this.updateFileUploadProgress = (id, progress) => {
|
76
|
-
this.
|
82
|
+
this.chatAdapterPromise.then((adapter) => {
|
83
|
+
adapter.updateFileUploadProgress(id, progress);
|
84
|
+
});
|
77
85
|
};
|
78
86
|
/* @conditional-compile-remove(attachment-download) @conditional-compile-remove(attachment-upload) */
|
79
87
|
this.updateFileUploadErrorMessage = (id, errorMessage) => {
|
80
|
-
this.
|
88
|
+
this.chatAdapterPromise.then((adapter) => {
|
89
|
+
adapter.updateFileUploadErrorMessage(id, errorMessage);
|
90
|
+
});
|
81
91
|
};
|
82
92
|
/* @conditional-compile-remove(attachment-download) @conditional-compile-remove(attachment-upload) */
|
83
93
|
this.updateFileUploadMetadata = (id, metadata) => {
|
84
|
-
this.
|
94
|
+
this.chatAdapterPromise.then((adapter) => {
|
95
|
+
adapter.updateFileUploadMetadata(id, metadata);
|
96
|
+
});
|
85
97
|
};
|
86
98
|
this.bindPublicMethods();
|
87
99
|
this.callAdapter = callAdapter;
|
88
|
-
this.
|
89
|
-
this.context = new CallWithChatContext(callWithChatAdapterStateFromBackingStates(callAdapter, chatAdapter));
|
100
|
+
this.context = new CallWithChatContext(callWithChatAdapterStateFromBackingStates(callAdapter));
|
90
101
|
const onChatStateChange = (newChatAdapterState) => {
|
91
102
|
this.context.updateClientStateWithChatState(newChatAdapterState);
|
92
103
|
};
|
93
|
-
this.chatAdapter.onStateChange(onChatStateChange);
|
94
104
|
this.onChatStateChange = onChatStateChange;
|
105
|
+
this.chatAdapterPromise = chatAdapterPromise;
|
106
|
+
this.chatAdapterPromise.then((chatAdapter) => {
|
107
|
+
chatAdapter.onStateChange(this.onChatStateChange);
|
108
|
+
/* @conditional-compile-remove(attachment-download) @conditional-compile-remove(attachment-upload) */
|
109
|
+
this.chatAdapter = chatAdapter;
|
110
|
+
this.context.updateClientStateWithChatState(chatAdapter.getState());
|
111
|
+
});
|
95
112
|
const onCallStateChange = (newCallAdapterState) => {
|
96
113
|
this.context.updateClientStateWithCallState(newCallAdapterState);
|
97
114
|
};
|
@@ -219,10 +236,16 @@ export class AzureCommunicationCallWithChatAdapter {
|
|
219
236
|
}
|
220
237
|
/** Dispose of the current CallWithChatAdapter. */
|
221
238
|
dispose() {
|
222
|
-
this
|
223
|
-
|
224
|
-
|
225
|
-
|
239
|
+
return __awaiter(this, void 0, void 0, function* () {
|
240
|
+
this.chatAdapterPromise.then((adapter) => {
|
241
|
+
adapter.offStateChange(this.onChatStateChange);
|
242
|
+
});
|
243
|
+
this.callAdapter.offStateChange(this.onCallStateChange);
|
244
|
+
yield this.chatAdapterPromise.then((adapter) => {
|
245
|
+
adapter.dispose();
|
246
|
+
});
|
247
|
+
this.callAdapter.dispose();
|
248
|
+
});
|
226
249
|
}
|
227
250
|
/** Remove a participant from the Call only. */
|
228
251
|
removeParticipant(userId) {
|
@@ -360,53 +383,71 @@ export class AzureCommunicationCallWithChatAdapter {
|
|
360
383
|
/** Fetch initial Call and Chat data such as chat messages. */
|
361
384
|
fetchInitialData() {
|
362
385
|
return __awaiter(this, void 0, void 0, function* () {
|
363
|
-
yield this.
|
386
|
+
return yield this.chatAdapterPromise.then((adapter) => {
|
387
|
+
return adapter.fetchInitialData();
|
388
|
+
});
|
364
389
|
});
|
365
390
|
}
|
366
391
|
/** Send a chat message. */
|
367
392
|
sendMessage(content) {
|
368
393
|
return __awaiter(this, void 0, void 0, function* () {
|
369
|
-
yield this.
|
394
|
+
return yield this.chatAdapterPromise.then((adapter) => {
|
395
|
+
return adapter.sendMessage(content);
|
396
|
+
});
|
370
397
|
});
|
371
398
|
}
|
372
399
|
/** Send a chat read receipt. */
|
373
400
|
sendReadReceipt(chatMessageId) {
|
374
401
|
return __awaiter(this, void 0, void 0, function* () {
|
375
|
-
yield this.
|
402
|
+
return yield this.chatAdapterPromise.then((adapter) => {
|
403
|
+
return adapter.sendReadReceipt(chatMessageId);
|
404
|
+
});
|
376
405
|
});
|
377
406
|
}
|
378
407
|
/** Send an isTyping indicator. */
|
379
408
|
sendTypingIndicator() {
|
380
409
|
return __awaiter(this, void 0, void 0, function* () {
|
381
|
-
yield this.
|
410
|
+
return yield this.chatAdapterPromise.then((adapter) => {
|
411
|
+
return adapter.sendTypingIndicator();
|
412
|
+
});
|
382
413
|
});
|
383
414
|
}
|
384
415
|
/** Load previous Chat messages. */
|
385
416
|
loadPreviousChatMessages(messagesToLoad) {
|
386
417
|
return __awaiter(this, void 0, void 0, function* () {
|
387
|
-
return yield this.
|
418
|
+
return yield this.chatAdapterPromise.then((adapter) => {
|
419
|
+
return adapter.loadPreviousChatMessages(messagesToLoad);
|
420
|
+
});
|
388
421
|
});
|
389
422
|
}
|
390
423
|
/** Update an existing message. */
|
391
424
|
updateMessage(messageId, content, metadata, options) {
|
392
425
|
return __awaiter(this, void 0, void 0, function* () {
|
393
|
-
return
|
394
|
-
|
426
|
+
return this.chatAdapterPromise.then((adapter) => {
|
427
|
+
return adapter.updateMessage(messageId, content, metadata,
|
428
|
+
/* @conditional-compile-remove(attachment-download) @conditional-compile-remove(attachment-upload) */ options);
|
429
|
+
});
|
395
430
|
});
|
396
431
|
}
|
397
432
|
/** Delete an existing message. */
|
398
433
|
deleteMessage(messageId) {
|
399
434
|
return __awaiter(this, void 0, void 0, function* () {
|
400
|
-
return yield this.
|
435
|
+
return yield this.chatAdapterPromise.then((adapter) => {
|
436
|
+
return adapter.deleteMessage(messageId);
|
437
|
+
});
|
401
438
|
});
|
402
439
|
}
|
403
440
|
downloadResourceToCache(resourceDetails) {
|
404
441
|
return __awaiter(this, void 0, void 0, function* () {
|
405
|
-
this.
|
442
|
+
this.chatAdapterPromise.then((adapter) => {
|
443
|
+
adapter.downloadResourceToCache(resourceDetails);
|
444
|
+
});
|
406
445
|
});
|
407
446
|
}
|
408
447
|
removeResourceFromCache(resourceDetails) {
|
409
|
-
this.
|
448
|
+
this.chatAdapterPromise.then((adapter) => {
|
449
|
+
adapter.removeResourceFromCache(resourceDetails);
|
450
|
+
});
|
410
451
|
}
|
411
452
|
/* @conditional-compile-remove(PSTN-calls) */
|
412
453
|
holdCall() {
|
@@ -554,31 +595,47 @@ export class AzureCommunicationCallWithChatAdapter {
|
|
554
595
|
this.callAdapter.on('isSpokenLanguageChanged', listener);
|
555
596
|
break;
|
556
597
|
case 'messageReceived':
|
557
|
-
this.
|
598
|
+
this.chatAdapterPromise.then((adapter) => {
|
599
|
+
adapter.on('messageReceived', listener);
|
600
|
+
});
|
558
601
|
break;
|
559
602
|
case 'messageEdited':
|
560
|
-
this.
|
603
|
+
this.chatAdapterPromise.then((adapter) => {
|
604
|
+
adapter.on('messageEdited', listener);
|
605
|
+
});
|
561
606
|
break;
|
562
607
|
case 'messageDeleted':
|
563
|
-
this.
|
608
|
+
this.chatAdapterPromise.then((adapter) => {
|
609
|
+
adapter.on('messageDeleted', listener);
|
610
|
+
});
|
564
611
|
break;
|
565
612
|
case 'messageSent':
|
566
|
-
this.
|
613
|
+
this.chatAdapterPromise.then((adapter) => {
|
614
|
+
adapter.on('messageSent', listener);
|
615
|
+
});
|
567
616
|
break;
|
568
617
|
case 'messageRead':
|
569
|
-
this.
|
618
|
+
this.chatAdapterPromise.then((adapter) => {
|
619
|
+
adapter.on('messageRead', listener);
|
620
|
+
});
|
570
621
|
break;
|
571
622
|
case 'chatParticipantsAdded':
|
572
|
-
this.
|
623
|
+
this.chatAdapterPromise.then((adapter) => {
|
624
|
+
adapter.on('participantsAdded', listener);
|
625
|
+
});
|
573
626
|
break;
|
574
627
|
case 'chatParticipantsRemoved':
|
575
|
-
this.
|
628
|
+
this.chatAdapterPromise.then((adapter) => {
|
629
|
+
adapter.on('participantsRemoved', listener);
|
630
|
+
});
|
576
631
|
break;
|
577
632
|
case 'callError':
|
578
633
|
this.callAdapter.on('error', listener);
|
579
634
|
break;
|
580
635
|
case 'chatError':
|
581
|
-
this.
|
636
|
+
this.chatAdapterPromise.then((adapter) => {
|
637
|
+
adapter.on('error', listener);
|
638
|
+
});
|
582
639
|
break;
|
583
640
|
default:
|
584
641
|
throw `Unknown AzureCommunicationCallWithChatAdapter Event: ${event}`;
|
@@ -634,37 +691,113 @@ export class AzureCommunicationCallWithChatAdapter {
|
|
634
691
|
this.callAdapter.off('isSpokenLanguageChanged', listener);
|
635
692
|
break;
|
636
693
|
case 'messageReceived':
|
637
|
-
this.
|
694
|
+
this.chatAdapterPromise.then((adapter) => {
|
695
|
+
adapter.off('messageReceived', listener);
|
696
|
+
});
|
638
697
|
break;
|
639
698
|
case 'messageEdited':
|
640
|
-
this.
|
699
|
+
this.chatAdapterPromise.then((adapter) => {
|
700
|
+
adapter.off('messageEdited', listener);
|
701
|
+
});
|
641
702
|
break;
|
642
703
|
case 'messageDeleted':
|
643
|
-
this.
|
704
|
+
this.chatAdapterPromise.then((adapter) => {
|
705
|
+
adapter.off('messageDeleted', listener);
|
706
|
+
});
|
644
707
|
break;
|
645
708
|
case 'messageSent':
|
646
|
-
this.
|
709
|
+
this.chatAdapterPromise.then((adapter) => {
|
710
|
+
adapter.off('messageSent', listener);
|
711
|
+
});
|
647
712
|
break;
|
648
713
|
case 'messageRead':
|
649
|
-
this.
|
714
|
+
this.chatAdapterPromise.then((adapter) => {
|
715
|
+
adapter.off('messageRead', listener);
|
716
|
+
});
|
650
717
|
break;
|
651
718
|
case 'chatParticipantsAdded':
|
652
|
-
this.
|
719
|
+
this.chatAdapterPromise.then((adapter) => {
|
720
|
+
adapter.off('participantsAdded', listener);
|
721
|
+
});
|
653
722
|
break;
|
654
723
|
case 'chatParticipantsRemoved':
|
655
|
-
this.
|
724
|
+
this.chatAdapterPromise.then((adapter) => {
|
725
|
+
adapter.off('participantsRemoved', listener);
|
726
|
+
});
|
656
727
|
break;
|
657
728
|
case 'callError':
|
658
729
|
this.callAdapter.off('error', listener);
|
659
730
|
break;
|
660
731
|
case 'chatError':
|
661
|
-
this.
|
732
|
+
this.chatAdapterPromise.then((adapter) => {
|
733
|
+
adapter.off('error', listener);
|
734
|
+
});
|
662
735
|
break;
|
663
736
|
default:
|
664
737
|
throw `Unknown AzureCommunicationCallWithChatAdapter Event: ${event}`;
|
665
738
|
}
|
666
739
|
}
|
667
740
|
}
|
741
|
+
/**
|
742
|
+
* Arguments for use in {@link createAzureCommunicationCallWithChatAdapter} to join a Group Call with an associated Chat thread.
|
743
|
+
* @public
|
744
|
+
*/
|
745
|
+
export class CallAndChatProvider {
|
746
|
+
constructor(locator) {
|
747
|
+
this.locator = locator;
|
748
|
+
}
|
749
|
+
getChatThread() {
|
750
|
+
return __awaiter(this, void 0, void 0, function* () {
|
751
|
+
return this.locator.chatThreadId;
|
752
|
+
});
|
753
|
+
}
|
754
|
+
}
|
755
|
+
/**
|
756
|
+
* Arguments for use in {@link createAzureCommunicationCallWithChatAdapter} to join a Teams meeting with an associated Chat thread.
|
757
|
+
*
|
758
|
+
* @public
|
759
|
+
*/
|
760
|
+
export class TeamsMeetingLinkProvider {
|
761
|
+
constructor(locator) {
|
762
|
+
this.locator = locator;
|
763
|
+
}
|
764
|
+
getChatThread() {
|
765
|
+
return __awaiter(this, void 0, void 0, function* () {
|
766
|
+
return getChatThreadFromTeamsLink(this.locator.meetingLink);
|
767
|
+
});
|
768
|
+
}
|
769
|
+
}
|
770
|
+
/** @conditional-compile-remove(meeting-id) */
|
771
|
+
/**
|
772
|
+
* Arguments for use in {@link createAzureCommunicationCallWithChatAdapter} to join a Teams meeting using meeting id.
|
773
|
+
*
|
774
|
+
* @public
|
775
|
+
*/
|
776
|
+
export class TeamsMeetingIdProvider {
|
777
|
+
constructor(locator, callAdapter) {
|
778
|
+
this.locator = locator;
|
779
|
+
this.callAdapter = callAdapter;
|
780
|
+
}
|
781
|
+
/**
|
782
|
+
* Wait call to be connected to get thread ID.
|
783
|
+
* @returns the chat thread ID for the given meeting ID.
|
784
|
+
*/
|
785
|
+
getChatThread() {
|
786
|
+
return __awaiter(this, void 0, void 0, function* () {
|
787
|
+
return new Promise((resolve) => {
|
788
|
+
const stateChangeListener = (state) => {
|
789
|
+
var _a, _b, _c;
|
790
|
+
if (((_a = state.call) === null || _a === void 0 ? void 0 : _a.state) === 'Connected' && ((_b = state.call.info) === null || _b === void 0 ? void 0 : _b.threadId)) {
|
791
|
+
resolve((_c = state.call.info) === null || _c === void 0 ? void 0 : _c.threadId);
|
792
|
+
}
|
793
|
+
};
|
794
|
+
this.callAdapter.then((adapter) => {
|
795
|
+
adapter.onStateChange(stateChangeListener);
|
796
|
+
});
|
797
|
+
});
|
798
|
+
});
|
799
|
+
}
|
800
|
+
}
|
668
801
|
/**
|
669
802
|
* Create a CallWithChatAdapter backed by Azure Communication services
|
670
803
|
* to plug into the {@link CallWithChatComposite}.
|
@@ -673,8 +806,8 @@ export class AzureCommunicationCallWithChatAdapter {
|
|
673
806
|
*/
|
674
807
|
export const createAzureCommunicationCallWithChatAdapter = (_a) => __awaiter(void 0, [_a], void 0, function* ({ userId, displayName, credential, endpoint, locator,
|
675
808
|
/* @conditional-compile-remove(PSTN-calls) */ alternateCallerId, callAdapterOptions }) {
|
676
|
-
const callAdapterLocator =
|
677
|
-
const
|
809
|
+
const callAdapterLocator = isTeamsMeetingLocator(locator) ? locator : locator.callLocator;
|
810
|
+
const callAdapter = _createAzureCommunicationCallAdapterInner({
|
678
811
|
userId,
|
679
812
|
displayName,
|
680
813
|
credential,
|
@@ -683,12 +816,9 @@ export const createAzureCommunicationCallWithChatAdapter = (_a) => __awaiter(voi
|
|
683
816
|
options: callAdapterOptions,
|
684
817
|
telemetryImplementationHint: 'CallWithChat'
|
685
818
|
});
|
686
|
-
const
|
687
|
-
|
688
|
-
|
689
|
-
const createChatAdapterPromise = _createAzureCommunicationChatAdapterInner(endpoint, userId, displayName, credential, threadId, 'CallWithChat');
|
690
|
-
const [callAdapter, chatAdapter] = yield Promise.all([createCallAdapterPromise, createChatAdapterPromise]);
|
691
|
-
return new AzureCommunicationCallWithChatAdapter(callAdapter, chatAdapter);
|
819
|
+
const chatThreadAdapter = _createChatThreadAdapterInner(locator, callAdapter);
|
820
|
+
const chatAdapter = _createLazyAzureCommunicationChatAdapterInner(endpoint, userId, displayName, credential, chatThreadAdapter.getChatThread(), 'CallWithChat');
|
821
|
+
return new AzureCommunicationCallWithChatAdapter(yield callAdapter, chatAdapter);
|
692
822
|
});
|
693
823
|
/**
|
694
824
|
* A custom React hook to simplify the creation of {@link CallWithChatAdapter}.
|
@@ -816,10 +946,9 @@ beforeDispose) => {
|
|
816
946
|
* @public
|
817
947
|
*/
|
818
948
|
export const createAzureCommunicationCallWithChatAdapterFromClients = (_b) => __awaiter(void 0, [_b], void 0, function* ({ callClient, callAgent, callLocator, chatClient, chatThreadClient, callAdapterOptions }) {
|
819
|
-
const
|
820
|
-
const
|
821
|
-
|
822
|
-
return new AzureCommunicationCallWithChatAdapter(callAdapter, chatAdapter);
|
949
|
+
const callAdapter = yield createAzureCommunicationCallAdapterFromClient(callClient, callAgent, callLocator, callAdapterOptions);
|
950
|
+
const chatAdapterPromise = createAzureCommunicationChatAdapterFromClient(chatClient, chatThreadClient);
|
951
|
+
return new AzureCommunicationCallWithChatAdapter(callAdapter, chatAdapterPromise);
|
823
952
|
});
|
824
953
|
/**
|
825
954
|
* Create a {@link CallWithChatAdapter} from the underlying adapters.
|
@@ -828,8 +957,18 @@ export const createAzureCommunicationCallWithChatAdapterFromClients = (_b) => __
|
|
828
957
|
*
|
829
958
|
* @internal
|
830
959
|
*/
|
831
|
-
export const _createAzureCommunicationCallWithChatAdapterFromAdapters = (callAdapter, chatAdapter) => new AzureCommunicationCallWithChatAdapter(callAdapter, chatAdapter);
|
832
|
-
const
|
833
|
-
return 'meetingLink' in locator;
|
960
|
+
export const _createAzureCommunicationCallWithChatAdapterFromAdapters = (callAdapter, chatAdapter) => new AzureCommunicationCallWithChatAdapter(callAdapter, new Promise((resolve) => resolve(chatAdapter)));
|
961
|
+
const isTeamsMeetingLocator = (locator) => {
|
962
|
+
return 'meetingLink' in locator || 'meetingId' in locator;
|
963
|
+
};
|
964
|
+
const _createChatThreadAdapterInner = (locator, adapter) => {
|
965
|
+
if ('meetingLink' in locator) {
|
966
|
+
return new TeamsMeetingLinkProvider(locator);
|
967
|
+
}
|
968
|
+
/** @conditional-compile-remove(meeting-id) */
|
969
|
+
if ('meetingId' in locator) {
|
970
|
+
return new TeamsMeetingIdProvider(locator, adapter);
|
971
|
+
}
|
972
|
+
return new CallAndChatProvider(locator);
|
834
973
|
};
|
835
974
|
//# sourceMappingURL=AzureCommunicationCallWithChatAdapter.js.map
|