@azure/communication-react 1.5.1-alpha-202305310014 → 1.5.1-alpha-202306010016
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 +34 -0
- package/dist/dist-cjs/communication-react/index.js +113 -34
- 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 +32 -0
- package/dist/dist-esm/calling-stateful-client/src/CallClientState.js.map +1 -1
- package/dist/dist-esm/calling-stateful-client/src/CallContext.d.ts +2 -0
- package/dist/dist-esm/calling-stateful-client/src/CallContext.js +9 -0
- package/dist/dist-esm/calling-stateful-client/src/CallContext.js.map +1 -1
- package/dist/dist-esm/calling-stateful-client/src/CallDeclarativeCommon.js +41 -0
- package/dist/dist-esm/calling-stateful-client/src/CallDeclarativeCommon.js.map +1 -1
- package/dist/dist-esm/calling-stateful-client/src/Converter.js +4 -0
- package/dist/dist-esm/calling-stateful-client/src/Converter.js.map +1 -1
- package/dist/dist-esm/calling-stateful-client/src/index-public.d.ts +1 -0
- package/dist/dist-esm/calling-stateful-client/src/index-public.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/ChatMessage/ChatMessageContent.js +4 -2
- package/dist/dist-esm/react-components/src/components/ChatMessage/ChatMessageContent.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/InputBoxComponent.js +30 -6
- package/dist/dist-esm/react-components/src/components/InputBoxComponent.js.map +1 -1
- package/package.json +10 -8
@@ -102,6 +102,22 @@ import { VideoEffectName } from '@azure/communication-calling';
|
|
102
102
|
import { VideoStreamRenderer } from '@azure/communication-calling';
|
103
103
|
import { VideoStreamRendererView } from '@azure/communication-calling';
|
104
104
|
|
105
|
+
/**
|
106
|
+
* Transfer feature state
|
107
|
+
*
|
108
|
+
* @beta
|
109
|
+
*/
|
110
|
+
export declare interface AcceptedTransfer {
|
111
|
+
/**
|
112
|
+
* Stores call id of accepted transfer
|
113
|
+
*/
|
114
|
+
callId: string;
|
115
|
+
/**
|
116
|
+
* Stores timestamp when transfer was accepted
|
117
|
+
*/
|
118
|
+
timestamp: Date;
|
119
|
+
}
|
120
|
+
|
105
121
|
/**
|
106
122
|
* Active error messages to be shown via {@link ErrorBar}.
|
107
123
|
*
|
@@ -2164,6 +2180,10 @@ export declare interface CallState {
|
|
2164
2180
|
* Proxy of {@link @azure/communication-calling#Call.totalParticipantCount}.
|
2165
2181
|
*/
|
2166
2182
|
totalParticipantCount?: number;
|
2183
|
+
/**
|
2184
|
+
* Transfer state of call
|
2185
|
+
*/
|
2186
|
+
transferFeature: TransferFeature;
|
2167
2187
|
}
|
2168
2188
|
|
2169
2189
|
/**
|
@@ -8451,6 +8471,20 @@ export declare interface TranscriptionCallFeature {
|
|
8451
8471
|
isTranscriptionActive: boolean;
|
8452
8472
|
}
|
8453
8473
|
|
8474
|
+
/**
|
8475
|
+
* Transfer feature state
|
8476
|
+
*
|
8477
|
+
* @beta
|
8478
|
+
*/
|
8479
|
+
export declare interface TransferFeature {
|
8480
|
+
/**
|
8481
|
+
* Accepted transfer requests
|
8482
|
+
*/
|
8483
|
+
acceptedTransfers: {
|
8484
|
+
[key: string]: AcceptedTransfer;
|
8485
|
+
};
|
8486
|
+
}
|
8487
|
+
|
8454
8488
|
/**
|
8455
8489
|
* Component to notify local user when one or more participants in the chat thread are typing.
|
8456
8490
|
*
|
@@ -20,6 +20,7 @@ var reactFileTypeIcons = require('@fluentui/react-file-type-icons');
|
|
20
20
|
var uuid = require('uuid');
|
21
21
|
var htmlToReact = require('html-to-react');
|
22
22
|
var Linkify = require('react-linkify');
|
23
|
+
var DOMPurify = require('dompurify');
|
23
24
|
var reactUseDraggableScroll = require('react-use-draggable-scroll');
|
24
25
|
var reactHooks = require('@fluentui/react-hooks');
|
25
26
|
var reactWindowProvider = require('@fluentui/react-window-provider');
|
@@ -57,6 +58,7 @@ var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
57
58
|
var React__namespace = /*#__PURE__*/_interopNamespace(React);
|
58
59
|
var r__namespace = /*#__PURE__*/_interopNamespace(r);
|
59
60
|
var Linkify__default = /*#__PURE__*/_interopDefaultLegacy(Linkify);
|
61
|
+
var DOMPurify__default = /*#__PURE__*/_interopDefaultLegacy(DOMPurify);
|
60
62
|
var copy__default = /*#__PURE__*/_interopDefaultLegacy(copy);
|
61
63
|
|
62
64
|
// Copyright (c) Microsoft Corporation.
|
@@ -165,7 +167,7 @@ const _toCommunicationIdentifier = (id) => {
|
|
165
167
|
// Copyright (c) Microsoft Corporation.
|
166
168
|
// Licensed under the MIT license.
|
167
169
|
// GENERATED FILE. DO NOT EDIT MANUALLY.
|
168
|
-
var telemetryVersion = '1.5.1-alpha-
|
170
|
+
var telemetryVersion = '1.5.1-alpha-202306010016';
|
169
171
|
|
170
172
|
// Copyright (c) Microsoft Corporation.
|
171
173
|
/**
|
@@ -1457,6 +1459,10 @@ function convertSdkCallToDeclarativeCall(call) {
|
|
1457
1459
|
currentSpokenLanguage: '',
|
1458
1460
|
isCaptionsFeatureActive: false,
|
1459
1461
|
startCaptionsInProgress: false
|
1462
|
+
},
|
1463
|
+
/* @conditional-compile-remove(call-transfer) */
|
1464
|
+
transferFeature: {
|
1465
|
+
acceptedTransfers: {}
|
1460
1466
|
}
|
1461
1467
|
};
|
1462
1468
|
}
|
@@ -2153,6 +2159,15 @@ class CallContext$2 {
|
|
2153
2159
|
}
|
2154
2160
|
});
|
2155
2161
|
}
|
2162
|
+
/* @conditional-compile-remove(call-transfer) */
|
2163
|
+
setAcceptedTransfer(callId, acceptedTransfer) {
|
2164
|
+
this.modifyState((draft) => {
|
2165
|
+
const call = draft.calls[this._callIdHistory.latestCallId(callId)];
|
2166
|
+
if (call) {
|
2167
|
+
call.transferFeature.acceptedTransfers[acceptedTransfer.callId] = acceptedTransfer;
|
2168
|
+
}
|
2169
|
+
});
|
2170
|
+
}
|
2156
2171
|
/**
|
2157
2172
|
* Tees any errors encountered in an async function to the state.
|
2158
2173
|
*
|
@@ -3685,6 +3700,12 @@ class ProxyCallCommon {
|
|
3685
3700
|
const proxyFeature = new ProxyTeamsCaptionsFeature(this._context, target);
|
3686
3701
|
return new Proxy(captionsFeature, proxyFeature);
|
3687
3702
|
}
|
3703
|
+
/* @conditional-compile-remove(call-transfer) */
|
3704
|
+
if (args[0] === communicationCalling.Features.Transfer) {
|
3705
|
+
const transferFeature = target.feature(communicationCalling.Features.Transfer);
|
3706
|
+
const proxyFeature = new ProxyTransferCallFeature(this._context, target);
|
3707
|
+
return new Proxy(transferFeature, proxyFeature);
|
3708
|
+
}
|
3688
3709
|
return target.feature(...args);
|
3689
3710
|
}, 'Call.feature');
|
3690
3711
|
}
|
@@ -3736,6 +3757,41 @@ class ProxyTeamsCaptionsFeature {
|
|
3736
3757
|
}
|
3737
3758
|
}
|
3738
3759
|
}
|
3760
|
+
/* @conditional-compile-remove(call-transfer) */
|
3761
|
+
/**
|
3762
|
+
* @private
|
3763
|
+
*/
|
3764
|
+
class ProxyTransferCallFeature {
|
3765
|
+
constructor(context, call) {
|
3766
|
+
this._context = context;
|
3767
|
+
this._call = call;
|
3768
|
+
}
|
3769
|
+
get(target, prop) {
|
3770
|
+
switch (prop) {
|
3771
|
+
case 'on':
|
3772
|
+
return (...args) => {
|
3773
|
+
const isTransferRequested = args[0] === 'transferRequested';
|
3774
|
+
if (isTransferRequested) {
|
3775
|
+
const listener = args[1];
|
3776
|
+
const newListener = (args) => {
|
3777
|
+
const newArgs = Object.assign(Object.assign({}, args), { accept: (acceptOptions) => {
|
3778
|
+
const acceptedTransferCall = args.accept(acceptOptions);
|
3779
|
+
this._context.setAcceptedTransfer(this._call.id, {
|
3780
|
+
callId: acceptedTransferCall.id,
|
3781
|
+
timestamp: new Date()
|
3782
|
+
});
|
3783
|
+
return acceptedTransferCall;
|
3784
|
+
} });
|
3785
|
+
listener(newArgs);
|
3786
|
+
};
|
3787
|
+
return target.on('transferRequested', newListener);
|
3788
|
+
}
|
3789
|
+
};
|
3790
|
+
default:
|
3791
|
+
return Reflect.get(target, prop);
|
3792
|
+
}
|
3793
|
+
}
|
3794
|
+
}
|
3739
3795
|
|
3740
3796
|
// Copyright (c) Microsoft Corporation.
|
3741
3797
|
// Licensed under the MIT license.
|
@@ -5730,6 +5786,32 @@ const DEFAULT_COMPONENT_ICONS = {
|
|
5730
5786
|
ChangeSpokenLanguageIcon: React__default['default'].createElement(reactIcons.PersonVoice20Regular, null)
|
5731
5787
|
};
|
5732
5788
|
|
5789
|
+
// Copyright (c) Microsoft Corporation.
|
5790
|
+
/**
|
5791
|
+
* @internal
|
5792
|
+
* Announcer component to maker aria announcements on actions
|
5793
|
+
*/
|
5794
|
+
const Announcer$1 = (props) => {
|
5795
|
+
const { announcementString, ariaLive } = props;
|
5796
|
+
return React__default['default'].createElement(react.Stack, { "aria-label": announcementString, "aria-live": ariaLive, styles: announcerStyles });
|
5797
|
+
};
|
5798
|
+
/**
|
5799
|
+
* Styles to hide the announcer from view but still existing on the DOM tree it so that narration can happen.
|
5800
|
+
*/
|
5801
|
+
const announcerStyles = {
|
5802
|
+
root: {
|
5803
|
+
position: 'absolute',
|
5804
|
+
width: '1px',
|
5805
|
+
height: '1px',
|
5806
|
+
padding: 0,
|
5807
|
+
margin: '-1px',
|
5808
|
+
overflow: 'hidden',
|
5809
|
+
clip: 'rect(0,0,0,0)',
|
5810
|
+
whiteSpace: 'nowrap',
|
5811
|
+
border: 0
|
5812
|
+
}
|
5813
|
+
};
|
5814
|
+
|
5733
5815
|
// Copyright (c) Microsoft Corporation.
|
5734
5816
|
/**
|
5735
5817
|
* @private
|
@@ -6119,7 +6201,7 @@ const InputBoxComponent = (props) => {
|
|
6119
6201
|
updateMentionSuggestions([]);
|
6120
6202
|
}, [textValue, mentionLookupOptions === null || mentionLookupOptions === void 0 ? void 0 : mentionLookupOptions.trigger, updateMentionSuggestions]);
|
6121
6203
|
const mergedRootStyle = react.mergeStyles(inputBoxWrapperStyle, styles === null || styles === void 0 ? void 0 : styles.root);
|
6122
|
-
const
|
6204
|
+
const mergedInputFieldStyle = react.mergeStyles(inputBoxStyle, inputClassName, props.inlineChildren ? {} : inputBoxNewLineSpaceAffordance);
|
6123
6205
|
/* @conditional-compile-remove(mention) */
|
6124
6206
|
React.useEffect(() => {
|
6125
6207
|
var _a;
|
@@ -6215,9 +6297,9 @@ const InputBoxComponent = (props) => {
|
|
6215
6297
|
return;
|
6216
6298
|
}
|
6217
6299
|
if (ev.key === 'ArrowUp') {
|
6218
|
-
ev.preventDefault();
|
6219
6300
|
/* @conditional-compile-remove(mention) */
|
6220
6301
|
if (mentionSuggestions.length > 0) {
|
6302
|
+
ev.preventDefault();
|
6221
6303
|
const newActiveIndex = activeSuggestionIndex === undefined
|
6222
6304
|
? mentionSuggestions.length - 1
|
6223
6305
|
: Math.max(activeSuggestionIndex - 1, 0);
|
@@ -6225,15 +6307,21 @@ const InputBoxComponent = (props) => {
|
|
6225
6307
|
}
|
6226
6308
|
}
|
6227
6309
|
else if (ev.key === 'ArrowDown') {
|
6228
|
-
ev.preventDefault();
|
6229
6310
|
/* @conditional-compile-remove(mention) */
|
6230
6311
|
if (mentionSuggestions.length > 0) {
|
6312
|
+
ev.preventDefault();
|
6231
6313
|
const newActiveIndex = activeSuggestionIndex === undefined
|
6232
6314
|
? 0
|
6233
6315
|
: Math.min(activeSuggestionIndex + 1, mentionSuggestions.length - 1);
|
6234
6316
|
setActiveSuggestionIndex(newActiveIndex);
|
6235
6317
|
}
|
6236
6318
|
}
|
6319
|
+
else if (ev.key === 'Escape') {
|
6320
|
+
/* @conditional-compile-remove(mention) */
|
6321
|
+
if (mentionSuggestions.length > 0) {
|
6322
|
+
updateMentionSuggestions([]);
|
6323
|
+
}
|
6324
|
+
}
|
6237
6325
|
if (ev.key === 'Enter' && (ev.shiftKey === false || !supportNewline)) {
|
6238
6326
|
ev.preventDefault();
|
6239
6327
|
// If we are looking up a mention, select the focused suggestion
|
@@ -6257,7 +6345,9 @@ const InputBoxComponent = (props) => {
|
|
6257
6345
|
/* @conditional-compile-remove(mention) */
|
6258
6346
|
activeSuggestionIndex,
|
6259
6347
|
/* @conditional-compile-remove(mention) */
|
6260
|
-
onSuggestionSelected
|
6348
|
+
onSuggestionSelected,
|
6349
|
+
/* @conditional-compile-remove(mention) */
|
6350
|
+
updateMentionSuggestions
|
6261
6351
|
]);
|
6262
6352
|
const onRenderChildren = () => {
|
6263
6353
|
return (React__default['default'].createElement(react.Stack, { horizontal: true, className: mergedChildrenStyle }, children));
|
@@ -6270,6 +6360,7 @@ const InputBoxComponent = (props) => {
|
|
6270
6360
|
setActiveSuggestionIndex(undefined);
|
6271
6361
|
}
|
6272
6362
|
else if (activeSuggestionIndex === undefined) {
|
6363
|
+
// Set the active to the first, if it's not already set
|
6273
6364
|
setActiveSuggestionIndex(0);
|
6274
6365
|
}
|
6275
6366
|
updateMentionSuggestions(suggestions);
|
@@ -6547,12 +6638,23 @@ const InputBoxComponent = (props) => {
|
|
6547
6638
|
}
|
6548
6639
|
}
|
6549
6640
|
}, [setTargetSelection, targetSelection, setShouldHandleOnMouseDownDuringSelect, interactionStartPoint, tagsValue]);
|
6641
|
+
/* @conditional-compile-remove(mention) */
|
6642
|
+
const announcerText = React.useMemo(() => {
|
6643
|
+
if (activeSuggestionIndex === undefined) {
|
6644
|
+
return undefined;
|
6645
|
+
}
|
6646
|
+
const currentMention = mentionSuggestions[activeSuggestionIndex !== null && activeSuggestionIndex !== void 0 ? activeSuggestionIndex : 0];
|
6647
|
+
return (currentMention === null || currentMention === void 0 ? void 0 : currentMention.displayText.length) > 0
|
6648
|
+
? currentMention === null || currentMention === void 0 ? void 0 : currentMention.displayText
|
6649
|
+
: localeStrings.participantItem.displayNamePlaceholder;
|
6650
|
+
}, [activeSuggestionIndex, mentionSuggestions, localeStrings.participantItem.displayNamePlaceholder]);
|
6550
6651
|
return (React__default['default'].createElement(react.Stack, { className: mergedRootStyle },
|
6551
6652
|
React__default['default'].createElement("div", { className: mergedTextContainerStyle },
|
6552
6653
|
/* @conditional-compile-remove(mention) */ mentionSuggestions.length > 0 && (React__default['default'].createElement(_MentionPopover, { suggestions: mentionSuggestions, activeSuggestionIndex: activeSuggestionIndex, target: inputBoxRef, targetPositionOffset: caretPosition, onRenderSuggestionItem: mentionLookupOptions === null || mentionLookupOptions === void 0 ? void 0 : mentionLookupOptions.onRenderSuggestionItem, onSuggestionSelected: onSuggestionSelected, onDismiss: () => {
|
6553
6654
|
updateMentionSuggestions([]);
|
6554
6655
|
} })),
|
6555
|
-
React__default['default'].createElement(
|
6656
|
+
/* @conditional-compile-remove(mention) */ announcerText !== undefined && (React__default['default'].createElement(Announcer$1, { announcementString: announcerText, ariaLive: 'polite' })),
|
6657
|
+
React__default['default'].createElement(react.TextField, { autoFocus: props.autoFocus === 'sendBoxTextField', "data-ui-id": dataUiId, multiline: true, autoAdjustHeight: true, multiple: false, resizable: false, componentRef: textFieldRef, id: id, inputClassName: mergedInputFieldStyle, placeholder: placeholderText, value: getInputFieldTextValue(), onChange: (e, newValue) => {
|
6556
6658
|
// Remove when switching to react 17+, currently needed because of https://legacy.reactjs.org/docs/legacy-event-pooling.html
|
6557
6659
|
/* @conditional-compile-remove(mention) */
|
6558
6660
|
// Prevents React from resetting event's properties
|
@@ -6615,6 +6717,8 @@ const InputBoxComponent = (props) => {
|
|
6615
6717
|
setCaretIndex(undefined);
|
6616
6718
|
setSelectionStartValue(null);
|
6617
6719
|
setSelectionEndValue(null);
|
6720
|
+
// Dismiss the suggestions on blur
|
6721
|
+
setMentionSuggestions([]);
|
6618
6722
|
}, autoComplete: "off", onKeyDown: onTextFieldKeyDown, styles: mergedTextFieldStyle, disabled: disabled, errorMessage: errorMessage, onRenderSuffix: onRenderChildren, elementRef: inputBoxRef }))));
|
6619
6723
|
};
|
6620
6724
|
/**
|
@@ -7427,32 +7531,6 @@ const addTag = (tag, parseStack, tags) => {
|
|
7427
7531
|
}
|
7428
7532
|
};
|
7429
7533
|
|
7430
|
-
// Copyright (c) Microsoft Corporation.
|
7431
|
-
/**
|
7432
|
-
* @internal
|
7433
|
-
* Announcer component to maker aria announcements on actions
|
7434
|
-
*/
|
7435
|
-
const Announcer$1 = (props) => {
|
7436
|
-
const { announcementString, ariaLive } = props;
|
7437
|
-
return React__default['default'].createElement(react.Stack, { "aria-label": announcementString, "aria-live": ariaLive, styles: announcerStyles });
|
7438
|
-
};
|
7439
|
-
/**
|
7440
|
-
* Styles to hide the announcer from view but still existing on the DOM tree it so that narration can happen.
|
7441
|
-
*/
|
7442
|
-
const announcerStyles = {
|
7443
|
-
root: {
|
7444
|
-
position: 'absolute',
|
7445
|
-
width: '1px',
|
7446
|
-
height: '1px',
|
7447
|
-
padding: 0,
|
7448
|
-
margin: '-1px',
|
7449
|
-
overflow: 'hidden',
|
7450
|
-
clip: 'rect(0,0,0,0)',
|
7451
|
-
whiteSpace: 'nowrap',
|
7452
|
-
border: 0
|
7453
|
-
}
|
7454
|
-
};
|
7455
|
-
|
7456
7534
|
// Copyright (c) Microsoft Corporation.
|
7457
7535
|
/**
|
7458
7536
|
* @private
|
@@ -8761,14 +8839,15 @@ const extractContent = (s) => {
|
|
8761
8839
|
return span.textContent || span.innerText;
|
8762
8840
|
};
|
8763
8841
|
const messageContentAriaText = (props) => {
|
8842
|
+
// Strip all html tags from the content for aria.
|
8764
8843
|
return props.message.content
|
8765
8844
|
? props.message.mine
|
8766
8845
|
? _formatString(props.strings.messageContentMineAriaText, {
|
8767
|
-
message: props.message.content
|
8846
|
+
message: DOMPurify__default['default'].sanitize(props.message.content, { ALLOWED_TAGS: [] })
|
8768
8847
|
})
|
8769
8848
|
: _formatString(props.strings.messageContentAriaText, {
|
8770
8849
|
author: `${props.message.senderDisplayName}`,
|
8771
|
-
message: props.message.content
|
8850
|
+
message: DOMPurify__default['default'].sanitize(props.message.content, { ALLOWED_TAGS: [] })
|
8772
8851
|
})
|
8773
8852
|
: undefined;
|
8774
8853
|
};
|