@azure/communication-react 1.7.0-alpha-202307130015 → 1.7.0-alpha-202307140015
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/dist-cjs/communication-react/index.js +26 -7
- 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/react-components/src/components/TextFieldWithMention/TextFieldWithMention.js +23 -5
- package/dist/dist-esm/react-components/src/components/TextFieldWithMention/TextFieldWithMention.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/styles/MentionPopover.style.js +2 -1
- package/dist/dist-esm/react-components/src/components/styles/MentionPopover.style.js.map +1 -1
- package/package.json +8 -8
@@ -178,7 +178,7 @@ const _isValidIdentifier = (identifier) => {
|
|
178
178
|
// Copyright (c) Microsoft Corporation.
|
179
179
|
// Licensed under the MIT license.
|
180
180
|
// GENERATED FILE. DO NOT EDIT MANUALLY.
|
181
|
-
var telemetryVersion = '1.7.0-alpha-
|
181
|
+
var telemetryVersion = '1.7.0-alpha-202307140015';
|
182
182
|
|
183
183
|
// Copyright (c) Microsoft Corporation.
|
184
184
|
/**
|
@@ -6992,7 +6992,8 @@ react.mergeStyles({
|
|
6992
6992
|
*/
|
6993
6993
|
const suggestionListStyle = react.mergeStyles({
|
6994
6994
|
padding: '0.25rem 0rem 0',
|
6995
|
-
overflow: 'visible'
|
6995
|
+
overflow: 'visible',
|
6996
|
+
overflowY: 'scroll'
|
6996
6997
|
});
|
6997
6998
|
/**
|
6998
6999
|
* @private
|
@@ -7397,7 +7398,14 @@ const TextFieldWithMention = (props) => {
|
|
7397
7398
|
}, [setSelectionStartValue, setSelectionEndValue]);
|
7398
7399
|
const handleOnSelect = React.useCallback(({ event, inputTextValue, tags, shouldHandleOnMouseDownDuringSelect, selectionStartValue, selectionEndValue, interactionStartSelection }) => {
|
7399
7400
|
var _a;
|
7400
|
-
if (
|
7401
|
+
if (event.currentTarget.selectionStart === 0 && event.currentTarget.selectionEnd === inputTextValue.length) {
|
7402
|
+
// entire text is selected, no need to change anything
|
7403
|
+
setSelectionStartValue(event.currentTarget.selectionStart);
|
7404
|
+
setSelectionEndValue(event.currentTarget.selectionEnd);
|
7405
|
+
setInteractionStartSelection(undefined);
|
7406
|
+
setShouldHandleOnMouseDownDuringSelect(false);
|
7407
|
+
}
|
7408
|
+
else if (shouldHandleOnMouseDownDuringSelect) {
|
7401
7409
|
if (interactionStartSelection !== undefined &&
|
7402
7410
|
(interactionStartSelection.start !== event.currentTarget.selectionStart ||
|
7403
7411
|
interactionStartSelection.end !== event.currentTarget.selectionEnd)) {
|
@@ -7424,15 +7432,27 @@ const TextFieldWithMention = (props) => {
|
|
7424
7432
|
setInteractionStartSelection(undefined);
|
7425
7433
|
setShouldHandleOnMouseDownDuringSelect(false);
|
7426
7434
|
}
|
7427
|
-
else if (event.currentTarget.selectionStart !== null) {
|
7435
|
+
else if (event.currentTarget.selectionStart !== null && event.currentTarget.selectionEnd !== null) {
|
7428
7436
|
// on select was triggered by mouse down/up with no movement
|
7429
7437
|
const mentionTag = findMentionTagForSelection(tags, event.currentTarget.selectionStart);
|
7430
7438
|
if (mentionTag !== undefined && mentionTag.plainTextBeginIndex !== undefined) {
|
7431
7439
|
// handle mention click by selecting the whole mention
|
7432
7440
|
// if the selection is not on the bounds of the mention
|
7433
|
-
const mentionEndIndex = (_a = mentionTag.plainTextEndIndex) !== null && _a !== void 0 ? _a : mentionTag.plainTextBeginIndex;
|
7434
7441
|
// disable selection for clicks on mention bounds
|
7435
|
-
|
7442
|
+
const mentionEndIndex = (_a = mentionTag.plainTextEndIndex) !== null && _a !== void 0 ? _a : mentionTag.plainTextBeginIndex;
|
7443
|
+
if (event.currentTarget.selectionStart !== event.currentTarget.selectionEnd &&
|
7444
|
+
event.currentTarget.selectionEnd > mentionEndIndex) {
|
7445
|
+
// handle triple click when the text starts from mention
|
7446
|
+
if (event.currentTarget.selectionDirection === null) {
|
7447
|
+
event.currentTarget.setSelectionRange(mentionTag.plainTextBeginIndex, event.currentTarget.selectionEnd);
|
7448
|
+
}
|
7449
|
+
else {
|
7450
|
+
event.currentTarget.setSelectionRange(mentionTag.plainTextBeginIndex, event.currentTarget.selectionEnd, event.currentTarget.selectionDirection);
|
7451
|
+
}
|
7452
|
+
setSelectionStartValue(mentionTag.plainTextBeginIndex);
|
7453
|
+
setSelectionEndValue(event.currentTarget.selectionEnd);
|
7454
|
+
}
|
7455
|
+
else if (event.currentTarget.selectionStart !== event.currentTarget.selectionEnd ||
|
7436
7456
|
(event.currentTarget.selectionStart !== mentionTag.plainTextBeginIndex &&
|
7437
7457
|
event.currentTarget.selectionStart !== mentionEndIndex)) {
|
7438
7458
|
if (event.currentTarget.selectionDirection === null) {
|
@@ -7456,7 +7476,6 @@ const TextFieldWithMention = (props) => {
|
|
7456
7476
|
setSelectionEndValue(nullToUndefined(event.currentTarget.selectionEnd));
|
7457
7477
|
}
|
7458
7478
|
setInteractionStartSelection(undefined);
|
7459
|
-
setShouldHandleOnMouseDownDuringSelect(false);
|
7460
7479
|
}
|
7461
7480
|
}
|
7462
7481
|
else {
|