@azure/communication-react 1.5.1-alpha-202306130014 → 1.5.1-alpha-202306150014

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.
Files changed (51) hide show
  1. package/dist/communication-react.d.ts +75 -11
  2. package/dist/dist-cjs/communication-react/index.js +161 -29
  3. package/dist/dist-cjs/communication-react/index.js.map +1 -1
  4. package/dist/dist-esm/acs-ui-common/src/telemetryVersion.js +1 -1
  5. package/dist/dist-esm/acs-ui-common/src/telemetryVersion.js.map +1 -1
  6. package/dist/dist-esm/calling-component-bindings/src/handlers/createCommonHandlers.d.ts +5 -0
  7. package/dist/dist-esm/calling-component-bindings/src/handlers/createCommonHandlers.js +36 -0
  8. package/dist/dist-esm/calling-component-bindings/src/handlers/createCommonHandlers.js.map +1 -1
  9. package/dist/dist-esm/calling-stateful-client/src/CallDeclarativeCommon.js +1 -1
  10. package/dist/dist-esm/calling-stateful-client/src/CallDeclarativeCommon.js.map +1 -1
  11. package/dist/dist-esm/react-components/src/components/InputBoxComponent.js +1 -1
  12. package/dist/dist-esm/react-components/src/components/InputBoxComponent.js.map +1 -1
  13. package/dist/dist-esm/react-components/src/components/TextFieldWithMention/TextFieldWithMention.js +8 -2
  14. package/dist/dist-esm/react-components/src/components/TextFieldWithMention/TextFieldWithMention.js.map +1 -1
  15. package/dist/dist-esm/react-components/src/components/VideoGallery.d.ts +9 -1
  16. package/dist/dist-esm/react-components/src/components/VideoGallery.js +4 -4
  17. package/dist/dist-esm/react-components/src/components/VideoGallery.js.map +1 -1
  18. package/dist/dist-esm/react-components/src/components/VideoTile.js +7 -3
  19. package/dist/dist-esm/react-components/src/components/VideoTile.js.map +1 -1
  20. package/dist/dist-esm/react-components/src/components/styles/SendBox.styles.js +2 -3
  21. package/dist/dist-esm/react-components/src/components/styles/SendBox.styles.js.map +1 -1
  22. package/dist/dist-esm/react-composites/src/Logger.d.ts +5 -0
  23. package/dist/dist-esm/react-composites/src/Logger.js +8 -0
  24. package/dist/dist-esm/react-composites/src/Logger.js.map +1 -0
  25. package/dist/dist-esm/react-composites/src/composites/CallComposite/CallComposite.js +0 -3
  26. package/dist/dist-esm/react-composites/src/composites/CallComposite/CallComposite.js.map +1 -1
  27. package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/AzureCommunicationCallAdapter.d.ts +11 -9
  28. package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/AzureCommunicationCallAdapter.js +52 -4
  29. package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/AzureCommunicationCallAdapter.js.map +1 -1
  30. package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/CallAdapter.d.ts +28 -1
  31. package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/CallAdapter.js.map +1 -1
  32. package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/OnFetchProfileCallback.js +1 -1
  33. package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/OnFetchProfileCallback.js.map +1 -1
  34. package/dist/dist-esm/react-composites/src/composites/CallComposite/hooks/useHandlers.js +7 -1
  35. package/dist/dist-esm/react-composites/src/composites/CallComposite/hooks/useHandlers.js.map +1 -1
  36. package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/CallPage.js +1 -1
  37. package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/CallPage.js.map +1 -1
  38. package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/TransferPage.js +7 -8
  39. package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/TransferPage.js.map +1 -1
  40. package/dist/dist-esm/react-composites/src/composites/CallComposite/styles/TransferPage.styles.d.ts +4 -0
  41. package/dist/dist-esm/react-composites/src/composites/CallComposite/styles/TransferPage.styles.js +4 -0
  42. package/dist/dist-esm/react-composites/src/composites/CallComposite/styles/TransferPage.styles.js.map +1 -1
  43. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/AzureCommunicationCallWithChatAdapter.d.ts +6 -0
  44. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/AzureCommunicationCallWithChatAdapter.js +19 -0
  45. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/AzureCommunicationCallWithChatAdapter.js.map +1 -1
  46. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/CallWithChatAdapter.d.ts +25 -0
  47. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/CallWithChatAdapter.js.map +1 -1
  48. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/CallWithChatBackedCallAdapter.d.ts +3 -0
  49. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/CallWithChatBackedCallAdapter.js +9 -0
  50. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/CallWithChatBackedCallAdapter.js.map +1 -1
  51. package/package.json +8 -8
@@ -1 +1 @@
1
- {"version":3,"file":"TextFieldWithMention.js","sourceRoot":"","sources":["../../../../../../../react-components/src/components/TextFieldWithMention/TextFieldWithMention.tsx"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;;;;;;;;;;AAElC,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAa,WAAW,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AACxE,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAC3C,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAC/C,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EACL,KAAK,EACL,SAAS,EACT,WAAW,EAEX,UAAU,EACV,WAAW,EAGZ,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EAAE,qCAAqC,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAClF,OAAO,EAEL,0BAA0B,EAC1B,+BAA+B,EAC/B,sBAAsB,EACtB,kCAAkC,EAClC,wBAAwB,EACxB,8BAA8B,EAC9B,eAAe,EACf,UAAU,EACX,MAAM,mBAAmB,C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,IAAI,EAAE,EAAE,OAAO,EAAE,CAAC,EAAE,EAAE,WAAW,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE,EAAE,CAAC;IAElH,uDAAuD;IACvD,MAAM,YAAY,GAAG;QACnB,QAAQ,EAAE,CAAC;QACX,MAAM,EAAE,YAAY;QACpB,eAAe,EAAE,YAAY,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,cAAc,CAAC,CAAC,CAAC,EAAE;KACzE,CAAC;IACF,OAAO,CACL,oBAAC,WAAW,IAAC,aAAa,EAAE,uBAAuB,EAAE,OAAO,EAAE,cAAc,EAAE,YAAY,oBAAO,YAAY;QAC3G,oBAAC,UAAU,IACT,SAAS,EAAE,iBAAiB,EAC5B,SAAS,EAAE,SAAS,EACpB,OAAO,EAAE,OAAO,EAChB,EAAE,EAAE,EAAE,EACN,YAAY,EAAE,GAAG,EAAE;gBACjB,UAAU,CAAC,IAAI,CAAC,CAAC;YACnB,CAAC,EACD,YAAY,EAAE,GAAG,EAAE;gBACjB,UAAU,CAAC,KAAK,CAAC,CAAC;YACpB,CAAC;YACD,yJAAyJ;YACzJ,YAAY,EAAE,GAAG,EAAE,CAAC,oBAAC,KAAK,IAAC,SAAS,EAAE,gBAAgB,IAAG,YAAY,CAAC,OAAO,CAAC,CAAS,GACvF,CACU,CACf,CAAC;AACJ,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport React, { useState, FormEvent, useCallback, useRef } from 'react';\nimport { useEffect, useMemo } from 'react';\nimport { useLocale } from '../../localization';\nimport { Announcer } from '../Announcer';\nimport {\n Stack,\n TextField,\n mergeStyles,\n ITextField,\n IconButton,\n TooltipHost,\n ICalloutContentStyles,\n ITextFieldProps\n} from '@fluentui/react';\n\nimport { isEnterKeyEventFromCompositionSession, nullToUndefined } from '../utils';\nimport {\n TagData,\n findMentionTagForSelection,\n findNewSelectionIndexForMention,\n findStringsDiffIndexes,\n getDisplayNameForMentionSuggestion,\n getValidatedIndexInRange,\n htmlStringForMentionSuggestion,\n textToTagParser,\n updateHTML\n} from './mentionTagUtils';\nimport { inputButtonStyle, inputButtonTooltipStyle, iconWrapperStyle } from '../styles/InputBoxComponent.style';\n\nimport { Caret } from 'textarea-caret-ts';\nimport { isDarkThemed } from '../../theming/themeUtils';\nimport { useTheme } from '../../theming';\n\nimport { MentionLookupOptions, _MentionPopover, Mention } from '../MentionPopover';\n\nimport { useDebouncedCallback } from 'use-debounce';\n\nconst DEFAULT_MENTION_TRIGGER = '@';\n\n/**\n * Props for the TextFieldWithMention component.\n *\n * @private\n */\nexport interface TextFieldWithMentionProps {\n textFieldProps: ITextFieldProps;\n dataUiId?: string;\n textValue: string; // This could be plain text or HTML.\n onChange: (event?: FormEvent<HTMLInputElement | HTMLTextAreaElement>, newValue?: string) => void;\n onKeyDown?: (ev: React.KeyboardEvent<HTMLInputElement | HTMLTextAreaElement>) => void;\n onEnterKeyDown?: () => void;\n textFieldRef?: React.RefObject<ITextField>;\n supportNewline?: boolean;\n mentionLookupOptions?: MentionLookupOptions;\n}\n\n/**\n * @private\n */\nexport const TextFieldWithMention = (props: TextFieldWithMentionProps): JSX.Element => {\n const {\n textFieldProps,\n dataUiId,\n textValue,\n onChange,\n textFieldRef,\n onKeyDown,\n onEnterKeyDown,\n supportNewline,\n mentionLookupOptions\n } = props;\n const inputBoxRef = useRef<HTMLDivElement>(null);\n\n // Current suggestion list, provided by the callback\n const [mentionSuggestions, setMentionSuggestions] = useState<Mention[]>([]);\n\n // Current suggestion list, provided by the callback\n const [activeSuggestionIndex, setActiveSuggestionIndex] = useState<number | undefined>(undefined);\n\n // Index of the current trigger character in the text field\n const [currentTriggerStartIndex, setCurrentTriggerStartIndex] = useState<number>(-1);\n\n const [inputTextValue, setInputTextValue] = useState<string>('');\n\n const [tagsValue, setTagsValue] = useState<TagData[]>([]);\n\n // Index of the previous selection start in the text field\n const [selectionStartValue, setSelectionStartValue] = useState<number | undefined>();\n\n // Index of the previous selection end in the text field\n const [selectionEndValue, setSelectionEndValue] = useState<number | undefined>();\n\n // Boolean value to check if onMouseDown event should be handled during select as selection range\n // for onMouseDown event is not updated yet and the selection range for mouse click/taps will be\n // updated in onSelect event if needed.\n const [shouldHandleOnMouseDownDuringSelect, setShouldHandleOnMouseDownDuringSelect] = useState<boolean>(true);\n\n // Boolean flag to check if mouse/touch move event should be handled\n const [shouldHandleMoveEvent, setShouldHandleMoveEvent] = useState<boolean>(false);\n\n // Indexes of start of touch/mouse selection\n const [interactionStartSelection, setInteractionStartSelection] = useState<\n { start: number | undefined; end: number | undefined } | undefined\n >();\n\n // Caret position in the text field\n const [caretPosition, setCaretPosition] = useState<Caret.Position | undefined>(undefined);\n\n // Index of where the caret is in the text field\n const [caretIndex, setCaretIndex] = useState<number | undefined>(undefined);\n\n const localeStrings = useLocale().strings;\n\n // Set mention suggestions\n const updateMentionSuggestions = useCallback(\n (suggestions: Mention[]) => {\n setMentionSuggestions(suggestions);\n },\n [setMentionSuggestions]\n );\n\n // Parse the text and get the plain text version to display in the input box\n useEffect(() => {\n const trigger = mentionLookupOptions?.trigger || DEFAULT_MENTION_TRIGGER;\n const parsedHTMLData = textToTagParser(textValue, trigger);\n setInputTextValue(parsedHTMLData.plainText);\n setTagsValue(parsedHTMLData.tags);\n updateMentionSuggestions([]);\n }, [textValue, mentionLookupOptions?.trigger, updateMentionSuggestions]);\n\n useEffect(() => {\n // effect for caret index update\n if (caretIndex === undefined || textFieldRef === undefined || textFieldRef?.current === undefined) {\n return;\n }\n // get validated caret index between 0 and inputTextValue.length otherwise caret will be set to incorrect index\n const updatedCaretIndex = getValidatedIndexInRange({\n min: 0,\n max: inputTextValue.length,\n currentValue: caretIndex\n });\n textFieldRef?.current?.setSelectionRange(updatedCaretIndex, updatedCaretIndex);\n setSelectionStartValue(updatedCaretIndex);\n setSelectionEndValue(updatedCaretIndex);\n }, [caretIndex, inputTextValue.length, textFieldRef, setSelectionStartValue, setSelectionEndValue]);\n\n const onSuggestionSelected = useCallback(\n (suggestion: Mention) => {\n let selectionEnd = textFieldRef?.current?.selectionEnd || -1;\n if (selectionEnd < 0) {\n selectionEnd = 0;\n } else if (selectionEnd > inputTextValue.length) {\n selectionEnd = inputTextValue.length;\n }\n const oldPlainText = inputTextValue;\n const mention = htmlStringForMentionSuggestion(suggestion, localeStrings);\n\n // update plain text with the mention html text\n const newPlainText =\n inputTextValue.substring(0, currentTriggerStartIndex) + mention + inputTextValue.substring(selectionEnd);\n const triggerText = mentionLookupOptions?.trigger ?? DEFAULT_MENTION_TRIGGER;\n // update html text with updated plain text\n const updatedContent = updateHTML({\n htmlText: textValue,\n oldPlainText,\n newPlainText,\n tags: tagsValue,\n startIndex: currentTriggerStartIndex,\n oldPlainTextEndIndex: selectionEnd,\n change: mention,\n mentionTrigger: triggerText\n });\n const displayName = getDisplayNameForMentionSuggestion(suggestion, localeStrings);\n const newCaretIndex = currentTriggerStartIndex + displayName.length + triggerText.length;\n // move the caret in the text field to the end of the mention plain text\n setCaretIndex(newCaretIndex);\n setSelectionEndValue(newCaretIndex);\n setSelectionStartValue(newCaretIndex);\n setCurrentTriggerStartIndex(-1);\n updateMentionSuggestions([]);\n // set focus back to text field\n textFieldRef?.current?.focus();\n setActiveSuggestionIndex(undefined);\n onChange && onChange(undefined, updatedContent.updatedHTML);\n },\n [\n textFieldRef,\n inputTextValue,\n currentTriggerStartIndex,\n mentionLookupOptions?.trigger,\n onChange,\n textValue,\n tagsValue,\n updateMentionSuggestions,\n localeStrings\n ]\n );\n\n const onTextFieldKeyDown = useCallback(\n (ev: React.KeyboardEvent<HTMLInputElement | HTMLTextAreaElement>) => {\n // caretIndex should be set to undefined when the user is typing\n setCaretIndex(undefined);\n // shouldHandleOnMouseDownDuringSelect should be set to false after the last mouse down event.\n // it shouldn't be updated in onMouseUp\n // as onMouseUp can be triggered before or after onSelect event\n // because its order depends on mouse events not selection.\n setShouldHandleOnMouseDownDuringSelect(false);\n\n if (isEnterKeyEventFromCompositionSession(ev)) {\n return;\n }\n\n if (mentionSuggestions.length > 0) {\n if (ev.key === 'ArrowUp') {\n ev.preventDefault();\n const newActiveIndex =\n activeSuggestionIndex === undefined\n ? mentionSuggestions.length - 1\n : Math.max(activeSuggestionIndex - 1, 0);\n setActiveSuggestionIndex(newActiveIndex);\n } else if (ev.key === 'ArrowDown') {\n ev.preventDefault();\n const newActiveIndex =\n activeSuggestionIndex === undefined\n ? 0\n : Math.min(activeSuggestionIndex + 1, mentionSuggestions.length - 1);\n setActiveSuggestionIndex(newActiveIndex);\n } else if (ev.key === 'Escape') {\n updateMentionSuggestions([]);\n }\n }\n if (ev.key === 'Enter' && (ev.shiftKey === false || !supportNewline)) {\n ev.preventDefault();\n\n // If we are looking up a mention, select the focused suggestion\n if (mentionSuggestions.length > 0 && activeSuggestionIndex !== undefined) {\n const selectedMention = mentionSuggestions[activeSuggestionIndex];\n if (selectedMention) {\n onSuggestionSelected(selectedMention);\n return;\n }\n }\n\n onEnterKeyDown && onEnterKeyDown();\n }\n onKeyDown && onKeyDown(ev);\n },\n [\n onEnterKeyDown,\n onKeyDown,\n supportNewline,\n mentionSuggestions,\n activeSuggestionIndex,\n onSuggestionSelected,\n updateMentionSuggestions\n ]\n );\n\n const debouncedQueryUpdate = useDebouncedCallback(async (query: string) => {\n const suggestions = (await mentionLookupOptions?.onQueryUpdated(query)) ?? [];\n if (suggestions.length === 0) {\n setActiveSuggestionIndex(undefined);\n } else if (activeSuggestionIndex === undefined) {\n // Set the active to the first, if it's not already set\n setActiveSuggestionIndex(0);\n }\n updateMentionSuggestions(suggestions);\n }, 500);\n\n // Update selections index in mention to navigate by words\n const updateSelectionIndexesWithMentionIfNeeded = useCallback(\n ({\n event,\n inputTextValue,\n selectionEndValue,\n selectionStartValue,\n tagsValue\n }: {\n event: FormEvent<HTMLInputElement | HTMLTextAreaElement>;\n inputTextValue: string;\n selectionEndValue?: number;\n selectionStartValue?: number;\n tagsValue: TagData[];\n }): void => {\n let updatedStartIndex = event.currentTarget.selectionStart;\n let updatedEndIndex = event.currentTarget.selectionEnd;\n if (\n event.currentTarget.selectionStart === event.currentTarget.selectionEnd &&\n event.currentTarget.selectionStart !== null &&\n event.currentTarget.selectionStart !== -1\n ) {\n // just a caret movement/usual typing or deleting\n const mentionTag = findMentionTagForSelection(tagsValue, event.currentTarget.selectionStart);\n // don't include boundary cases to show correct selection, otherwise it will show selection at mention boundaries\n if (\n mentionTag !== undefined &&\n mentionTag.plainTextBeginIndex !== undefined &&\n event.currentTarget.selectionStart > mentionTag.plainTextBeginIndex &&\n event.currentTarget.selectionStart < (mentionTag.plainTextEndIndex ?? mentionTag.plainTextBeginIndex)\n ) {\n // get updated selection index\n const newSelectionIndex = findNewSelectionIndexForMention({\n tag: mentionTag,\n textValue: inputTextValue,\n currentSelectionIndex: event.currentTarget.selectionStart,\n previousSelectionIndex: selectionStartValue ?? inputTextValue.length\n });\n updatedStartIndex = newSelectionIndex;\n updatedEndIndex = newSelectionIndex;\n }\n } else if (event.currentTarget.selectionStart !== event.currentTarget.selectionEnd) {\n // Both e.currentTarget.selectionStart !== selectionStartValue and e.currentTarget.selectionEnd !== selectionEndValue can be true when a user selects a text by double click\n if (event.currentTarget.selectionStart !== null && event.currentTarget.selectionStart !== selectionStartValue) {\n // the selection start is changed\n const mentionTag = findMentionTagForSelection(tagsValue, event.currentTarget.selectionStart);\n // don't include boundary cases to show correct selection, otherwise it will show selection at mention boundaries\n if (\n mentionTag !== undefined &&\n mentionTag.plainTextBeginIndex !== undefined &&\n event.currentTarget.selectionStart > mentionTag.plainTextBeginIndex &&\n event.currentTarget.selectionStart < (mentionTag.plainTextEndIndex ?? mentionTag.plainTextBeginIndex)\n ) {\n updatedStartIndex = findNewSelectionIndexForMention({\n tag: mentionTag,\n textValue: inputTextValue,\n currentSelectionIndex: event.currentTarget.selectionStart,\n previousSelectionIndex: selectionStartValue ?? inputTextValue.length\n });\n }\n }\n if (event.currentTarget.selectionEnd !== null && event.currentTarget.selectionEnd !== selectionEndValue) {\n // the selection end is changed\n const mentionTag = findMentionTagForSelection(tagsValue, event.currentTarget.selectionEnd);\n // don't include boundary cases to show correct selection, otherwise it will show selection at mention boundaries\n if (\n mentionTag !== undefined &&\n mentionTag.plainTextBeginIndex !== undefined &&\n event.currentTarget.selectionEnd > mentionTag.plainTextBeginIndex &&\n event.currentTarget.selectionEnd < (mentionTag.plainTextEndIndex ?? mentionTag.plainTextBeginIndex)\n ) {\n updatedEndIndex = findNewSelectionIndexForMention({\n tag: mentionTag,\n textValue: inputTextValue,\n currentSelectionIndex: event.currentTarget.selectionEnd,\n previousSelectionIndex: selectionEndValue ?? inputTextValue.length\n });\n }\n }\n }\n // e.currentTarget.selectionDirection should be set to handle shift + arrow keys\n if (event.currentTarget.selectionDirection === null) {\n event.currentTarget.setSelectionRange(updatedStartIndex, updatedEndIndex);\n } else {\n event.currentTarget.setSelectionRange(\n updatedStartIndex,\n updatedEndIndex,\n event.currentTarget.selectionDirection\n );\n }\n setSelectionStartValue(nullToUndefined(updatedStartIndex));\n setSelectionEndValue(nullToUndefined(updatedEndIndex));\n },\n [setSelectionStartValue, setSelectionEndValue]\n );\n\n const handleOnSelect = useCallback(\n ({\n event,\n inputTextValue,\n tags,\n shouldHandleOnMouseDownDuringSelect,\n selectionStartValue,\n selectionEndValue,\n interactionStartSelection\n }: {\n event: React.FormEvent<HTMLInputElement | HTMLTextAreaElement>;\n inputTextValue: string;\n tags: TagData[];\n shouldHandleOnMouseDownDuringSelect: boolean;\n selectionStartValue?: number;\n selectionEndValue?: number;\n interactionStartSelection?: { start: number | undefined; end: number | undefined };\n }): void => {\n if (shouldHandleOnMouseDownDuringSelect) {\n if (\n interactionStartSelection !== undefined &&\n (interactionStartSelection.start !== event.currentTarget.selectionStart ||\n interactionStartSelection.end !== event.currentTarget.selectionEnd)\n ) {\n // selection was changed by mouse\n // for mouse selection only, it's possible to start selection in the middle of a word in a mention\n // because of this when event.currentTarget.selectionStart === mouseMoveStartPoint.start\n // selectionStartValue for updateSelectionIndexesWithMentionIfNeeded should be set\n // to the end of the input to mimic selection from right to left for the left selection index\n const updatedSelectionStartValue =\n event.currentTarget.selectionStart === interactionStartSelection.start\n ? inputTextValue.length\n : interactionStartSelection.start;\n // selectionStart is always less than selectionEnd so sometimes selectionEnd is user's start of the selection\n // so when event.currentTarget.selectionEnd === mouseMoveStartPoint.end\n // selectionEndValue for updateSelectionIndexesWithMentionIfNeeded should be set\n // to the beginning of the input to mimic selection from left to right for the right selection index\n const updatedSelectionEndValue =\n event.currentTarget.selectionEnd === interactionStartSelection.end ? 0 : interactionStartSelection.end;\n updateSelectionIndexesWithMentionIfNeeded({\n event,\n inputTextValue,\n selectionStartValue: updatedSelectionStartValue,\n selectionEndValue: updatedSelectionEndValue,\n tagsValue: tags\n });\n setInteractionStartSelection(undefined);\n setShouldHandleOnMouseDownDuringSelect(false);\n } else if (event.currentTarget.selectionStart !== null) {\n // on select was triggered by mouse down/up with no movement\n const mentionTag = findMentionTagForSelection(tags, event.currentTarget.selectionStart);\n if (mentionTag !== undefined && mentionTag.plainTextBeginIndex !== undefined) {\n // handle mention click by selecting the whole mention\n // if the selection is not on the bounds of the mention\n const mentionEndIndex = mentionTag.plainTextEndIndex ?? mentionTag.plainTextBeginIndex;\n // disable selection for clicks on mention bounds\n if (\n event.currentTarget.selectionStart !== event.currentTarget.selectionEnd ||\n (event.currentTarget.selectionStart !== mentionTag.plainTextBeginIndex &&\n event.currentTarget.selectionStart !== mentionEndIndex)\n ) {\n if (event.currentTarget.selectionDirection === null) {\n event.currentTarget.setSelectionRange(mentionTag.plainTextBeginIndex, mentionEndIndex);\n } else {\n event.currentTarget.setSelectionRange(\n mentionTag.plainTextBeginIndex,\n mentionEndIndex,\n event.currentTarget.selectionDirection\n );\n }\n }\n setSelectionStartValue(mentionTag.plainTextBeginIndex);\n setSelectionEndValue(mentionEndIndex);\n } else {\n setSelectionStartValue(event.currentTarget.selectionStart);\n setSelectionEndValue(nullToUndefined(event.currentTarget.selectionEnd));\n }\n setInteractionStartSelection(undefined);\n setShouldHandleOnMouseDownDuringSelect(false);\n }\n } else {\n // selection was changed by keyboard\n updateSelectionIndexesWithMentionIfNeeded({\n event,\n inputTextValue,\n selectionStartValue,\n selectionEndValue,\n tagsValue: tags\n });\n }\n },\n [updateSelectionIndexesWithMentionIfNeeded, setSelectionStartValue, setSelectionEndValue]\n );\n\n type HandleOnChangeProps = {\n currentSelectionEnd?: number;\n currentSelectionStart?: number;\n currentTriggerStartIndex: number;\n event: React.FormEvent<HTMLInputElement | HTMLTextAreaElement>;\n htmlTextValue: string;\n inputTextValue: string;\n previousSelectionEnd?: number;\n previousSelectionStart?: number;\n tagsValue: TagData[];\n updatedValue?: string;\n };\n\n const handleOnChange = useCallback(\n async ({\n currentSelectionEnd,\n currentSelectionStart,\n currentTriggerStartIndex,\n event,\n htmlTextValue,\n inputTextValue,\n previousSelectionEnd,\n previousSelectionStart,\n tagsValue,\n updatedValue\n }: HandleOnChangeProps): Promise<void> => {\n debouncedQueryUpdate.cancel();\n if (event.currentTarget === null) {\n return;\n }\n // handle backspace change\n // onSelect is not called for backspace as selection is not changed and local caret index is outdated\n setCaretIndex(undefined);\n const newValue = updatedValue ?? '';\n const triggerText = mentionLookupOptions?.trigger ?? DEFAULT_MENTION_TRIGGER;\n\n const newTextLength = newValue.length;\n // updating indexes to set between 0 and text length, otherwise selectionRange won't be set correctly\n const currentSelectionEndValue = getValidatedIndexInRange({\n min: 0,\n max: newTextLength,\n currentValue: currentSelectionEnd\n });\n const currentSelectionStartValue = getValidatedIndexInRange({\n min: 0,\n max: newTextLength,\n currentValue: currentSelectionStart\n });\n const previousSelectionStartValue = getValidatedIndexInRange({\n min: 0,\n max: inputTextValue.length,\n currentValue: previousSelectionStart\n });\n const previousSelectionEndValue = getValidatedIndexInRange({\n min: 0,\n max: inputTextValue.length,\n currentValue: previousSelectionEnd\n });\n\n // If we are enabled for lookups,\n if (mentionLookupOptions !== undefined) {\n // Look at the range of the change for a trigger character\n const triggerPriorIndex = newValue.lastIndexOf(triggerText, currentSelectionEndValue - 1);\n // Update the caret position, used for positioning the suggestions popover\n const textField = event.currentTarget;\n const relativePosition = Caret.getRelativePosition(textField);\n const adjustOffset = Math.max(0, textField.scrollHeight - textField.clientHeight);\n relativePosition.top -= adjustOffset;\n setCaretPosition(relativePosition);\n\n if (triggerPriorIndex !== undefined) {\n // trigger is found\n const isSpaceBeforeTrigger = newValue.substring(triggerPriorIndex - 1, triggerPriorIndex) === ' ';\n const wordAtSelection = newValue.substring(triggerPriorIndex, currentSelectionEndValue);\n let tagIndex = currentTriggerStartIndex;\n if (!isSpaceBeforeTrigger && triggerPriorIndex !== 0) {\n //no space before the trigger <- continuation of the previous word\n tagIndex = -1;\n setCurrentTriggerStartIndex(tagIndex);\n } else if (wordAtSelection === triggerText) {\n // start of the mention\n tagIndex = currentSelectionEndValue - triggerText.length;\n if (tagIndex < 0) {\n tagIndex = 0;\n }\n setCurrentTriggerStartIndex(tagIndex);\n }\n if (tagIndex === -1) {\n updateMentionSuggestions([]);\n } else {\n // In the middle of a @mention lookup\n if (tagIndex > -1) {\n const query = wordAtSelection.substring(triggerText.length, wordAtSelection.length);\n if (query !== undefined) {\n await debouncedQueryUpdate(query);\n }\n }\n }\n }\n }\n let result = '';\n if (tagsValue.length === 0) {\n // no tags in the string and newValue should be used as a result string\n result = newValue;\n } else {\n // there are tags in the text value and htmlTextValue is html string\n // find diff between old and new text\n const { changeStart, oldChangeEnd, newChangeEnd } = findStringsDiffIndexes({\n oldText: inputTextValue,\n newText: newValue,\n previousSelectionStart: previousSelectionStartValue,\n previousSelectionEnd: previousSelectionEndValue,\n currentSelectionStart: currentSelectionStartValue,\n currentSelectionEnd: currentSelectionEndValue\n });\n const change = newValue.substring(changeStart, newChangeEnd);\n // get updated html string\n const updatedContent = updateHTML({\n htmlText: htmlTextValue,\n oldPlainText: inputTextValue,\n newPlainText: newValue,\n tags: tagsValue,\n startIndex: changeStart,\n oldPlainTextEndIndex: oldChangeEnd,\n change,\n mentionTrigger: triggerText\n });\n result = updatedContent.updatedHTML;\n // update caret index if needed\n if (updatedContent.updatedSelectionIndex !== undefined) {\n setCaretIndex(updatedContent.updatedSelectionIndex);\n setSelectionEndValue(updatedContent.updatedSelectionIndex);\n setSelectionStartValue(updatedContent.updatedSelectionIndex);\n }\n }\n\n onChange && onChange(event, result);\n },\n [onChange, mentionLookupOptions, setCaretIndex, setCaretPosition, updateMentionSuggestions, debouncedQueryUpdate]\n );\n\n // Adjust the selection range based on a mouse / touch interaction\n const handleOnMove = useCallback(\n ({\n event,\n selectionStartValue,\n selectionEndValue,\n interactionStartSelection,\n shouldHandleMoveEvent\n }: {\n event: React.UIEvent<HTMLInputElement | HTMLTextAreaElement>;\n selectionStartValue: number | undefined;\n selectionEndValue: number | undefined;\n interactionStartSelection: { start: number | undefined; end: number | undefined } | undefined;\n shouldHandleMoveEvent: boolean;\n }) => {\n if (\n shouldHandleMoveEvent &&\n interactionStartSelection === undefined &&\n (event.currentTarget.selectionStart !== selectionStartValue ||\n event.currentTarget.selectionEnd !== selectionEndValue)\n ) {\n setInteractionStartSelection({\n start: nullToUndefined(event.currentTarget.selectionStart),\n end: nullToUndefined(event.currentTarget.selectionEnd)\n });\n }\n },\n []\n );\n\n // Adjust the selection range based on a mouse / touch interaction\n const handleOnInteractionStarted = useCallback(() => {\n setInteractionStartSelection(undefined);\n setShouldHandleMoveEvent(true);\n setShouldHandleOnMouseDownDuringSelect(true);\n }, []);\n\n // Adjust the selection range based on a mouse / touch interaction\n const handleOnInteractionCompleted = useCallback(() => {\n setShouldHandleMoveEvent(false);\n }, []);\n\n const announcerText = useMemo(() => {\n if (activeSuggestionIndex === undefined) {\n return undefined;\n }\n const currentMention = mentionSuggestions[activeSuggestionIndex ?? 0];\n return currentMention?.displayText.length > 0\n ? currentMention?.displayText\n : localeStrings.participantItem.displayNamePlaceholder;\n }, [activeSuggestionIndex, mentionSuggestions, localeStrings.participantItem.displayNamePlaceholder]);\n\n return (\n <>\n {mentionSuggestions.length > 0 && (\n <_MentionPopover\n suggestions={mentionSuggestions}\n activeSuggestionIndex={activeSuggestionIndex}\n target={inputBoxRef}\n targetPositionOffset={caretPosition}\n onRenderSuggestionItem={mentionLookupOptions?.onRenderSuggestionItem}\n onSuggestionSelected={onSuggestionSelected}\n onDismiss={() => {\n updateMentionSuggestions([]);\n }}\n />\n )}\n {announcerText !== undefined && <Announcer announcementString={announcerText} ariaLive={'polite'} />}\n <TextField\n {...textFieldProps}\n data-ui-id={dataUiId}\n value={inputTextValue}\n onChange={(e, newValue) => {\n // Remove when switching to react 17+, currently needed because of https://legacy.reactjs.org/docs/legacy-event-pooling.html\n // Prevents React from resetting event's properties\n e.persist();\n setInputTextValue(newValue ?? '');\n handleOnChange({\n event: e,\n tagsValue,\n htmlTextValue: textValue,\n inputTextValue,\n currentTriggerStartIndex,\n previousSelectionStart: nullToUndefined(selectionStartValue),\n previousSelectionEnd: nullToUndefined(selectionEndValue),\n currentSelectionStart: nullToUndefined(e.currentTarget.selectionStart),\n currentSelectionEnd: nullToUndefined(e.currentTarget.selectionEnd),\n updatedValue: newValue\n });\n }}\n onSelect={(e) => {\n handleOnSelect({\n event: e,\n inputTextValue,\n shouldHandleOnMouseDownDuringSelect,\n selectionEndValue,\n selectionStartValue,\n tags: tagsValue,\n interactionStartSelection\n });\n }}\n onMouseDown={() => {\n // as events order is onMouseDown -> onMouseMove -> onMouseUp -> onSelect -> onClick\n // onClick and onMouseDown can't handle clicking on mention event because\n // onMouseDown doesn't have correct selectionRange yet and\n // onClick already has wrong range as it's called after onSelect that updates the selection range\n // so we need to handle onMouseDown to prevent onSelect default behavior\n handleOnInteractionStarted();\n }}\n onMouseMove={(event) => {\n handleOnMove({\n event,\n selectionStartValue,\n selectionEndValue,\n interactionStartSelection,\n shouldHandleMoveEvent\n });\n }}\n onMouseUp={() => {\n handleOnInteractionCompleted();\n }}\n onTouchStart={() => {\n handleOnInteractionStarted();\n }}\n onTouchMove={(event) => {\n handleOnMove({\n event,\n selectionStartValue,\n selectionEndValue,\n interactionStartSelection,\n shouldHandleMoveEvent\n });\n }}\n onTouchEnd={() => {\n handleOnInteractionCompleted;\n }}\n onBlur={() => {\n // setup all flags to default values when text field loses focus\n setShouldHandleOnMouseDownDuringSelect(false);\n setCaretIndex(undefined);\n setSelectionStartValue(undefined);\n setSelectionEndValue(undefined);\n }}\n onKeyDown={onTextFieldKeyDown}\n elementRef={inputBoxRef}\n />\n </>\n );\n};\n\n/**\n * Props for displaying a send button besides the text input area.\n *\n * @private\n */\nexport type InputBoxButtonProps = {\n onRenderIcon: (isHover: boolean) => JSX.Element;\n onClick: (e: React.MouseEvent<HTMLDivElement, MouseEvent>) => void;\n className?: string;\n id?: string;\n ariaLabel?: string;\n tooltipContent?: string;\n};\n\n/**\n * @private\n */\nexport const InputBoxButton = (props: InputBoxButtonProps): JSX.Element => {\n const { onRenderIcon, onClick, ariaLabel, className, id, tooltipContent } = props;\n const [isHover, setIsHover] = useState(false);\n const mergedButtonStyle = mergeStyles(inputButtonStyle, className);\n\n const theme = useTheme();\n const calloutStyle: Partial<ICalloutContentStyles> = { root: { padding: 0 }, calloutMain: { padding: '0.5rem' } };\n\n // Place callout with no gap between it and the button.\n const calloutProps = {\n gapSpace: 0,\n styles: calloutStyle,\n backgroundColor: isDarkThemed(theme) ? theme.palette.neutralLighter : ''\n };\n return (\n <TooltipHost hostClassName={inputButtonTooltipStyle} content={tooltipContent} calloutProps={{ ...calloutProps }}>\n <IconButton\n className={mergedButtonStyle}\n ariaLabel={ariaLabel}\n onClick={onClick}\n id={id}\n onMouseEnter={() => {\n setIsHover(true);\n }}\n onMouseLeave={() => {\n setIsHover(false);\n }}\n // VoiceOver fix: Avoid icon from stealing focus when IconButton is double-tapped to send message by wrapping with Stack with pointerEvents style to none\n onRenderIcon={() => <Stack className={iconWrapperStyle}>{onRenderIcon(isHover)}</Stack>}\n />\n </TooltipHost>\n );\n};\n"]}
1
+ {"version":3,"file":"TextFieldWithMention.js","sourceRoot":"","sources":["../../../../../../../react-components/src/components/TextFieldWithMention/TextFieldWithMention.tsx"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;;;;;;;;;;AAElC,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAa,WAAW,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AACxE,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAC3C,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAC/C,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EACL,KAAK,EACL,SAAS,EACT,WAAW,EAEX,UAAU,EACV,WAAW,EAGZ,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EAAE,qCAAqC,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAClF,OAAO,EAEL,0BAA0B,EAC1B,+BAA+B,EAC/B,sBAAsB,EACtB,kCAAkC,EAClC,wBAAwB,EACxB,8BAA8B,EAC9B,eAAe,EACf,UAAU,EACX,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,gBAAgB,EAAE,uBAAuB,EAAE,gBAAgB,EAAE,MAAM,mCAAmC,CAAC;AAEhH,OAAO,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAC1C,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AACxD,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAEzC,OAAO,EAAwB,eAAe,EAAW,MAAM,mBAAmB,CAAC;AAEnF,OAAO,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC;AAEpD,MAAM,uBAAuB,GAAG,GAAG,CAAC;AAmBpC;;GAEG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,KAAgC,EAAe,EAAE;IACpF,MAAM,EACJ,cAAc,EACd,QAAQ,EACR,SAAS,EACT,QAAQ,EACR,YAAY,EACZ,SAAS,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,EAAE,OAAO,EAAE,cAAc,EAAE,YAAY,oBAAO,YAAY;QAC3G,oBAAC,UAAU,IACT,SAAS,EAAE,iBAAiB,EAC5B,SAAS,EAAE,SAAS,EACpB,OAAO,EAAE,OAAO,EAChB,EAAE,EAAE,EAAE,EACN,YAAY,EAAE,GAAG,EAAE;gBACjB,UAAU,CAAC,IAAI,CAAC,CAAC;YACnB,CAAC,EACD,YAAY,EAAE,GAAG,EAAE;gBACjB,UAAU,CAAC,KAAK,CAAC,CAAC;YACpB,CAAC;YACD,yJAAyJ;YACzJ,YAAY,EAAE,GAAG,EAAE,CAAC,oBAAC,KAAK,IAAC,SAAS,EAAE,gBAAgB,IAAG,YAAY,CAAC,OAAO,CAAC,CAAS,GACvF,CACU,CACf,CAAC;AACJ,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport React, { useState, FormEvent, useCallback, useRef } from 'react';\nimport { useEffect, useMemo } from 'react';\nimport { useLocale } from '../../localization';\nimport { Announcer } from '../Announcer';\nimport {\n Stack,\n TextField,\n mergeStyles,\n ITextField,\n IconButton,\n TooltipHost,\n ICalloutContentStyles,\n ITextFieldProps\n} from '@fluentui/react';\n\nimport { isEnterKeyEventFromCompositionSession, nullToUndefined } from '../utils';\nimport {\n TagData,\n findMentionTagForSelection,\n findNewSelectionIndexForMention,\n findStringsDiffIndexes,\n getDisplayNameForMentionSuggestion,\n getValidatedIndexInRange,\n htmlStringForMentionSuggestion,\n textToTagParser,\n updateHTML\n} from './mentionTagUtils';\nimport { inputButtonStyle, inputButtonTooltipStyle, iconWrapperStyle } from '../styles/InputBoxComponent.style';\n\nimport { Caret } from 'textarea-caret-ts';\nimport { isDarkThemed } from '../../theming/themeUtils';\nimport { useTheme } from '../../theming';\n\nimport { MentionLookupOptions, _MentionPopover, Mention } from '../MentionPopover';\n\nimport { useDebouncedCallback } from 'use-debounce';\n\nconst DEFAULT_MENTION_TRIGGER = '@';\n\n/**\n * Props for the TextFieldWithMention component.\n *\n * @private\n */\nexport interface TextFieldWithMentionProps {\n textFieldProps: ITextFieldProps;\n dataUiId?: string;\n textValue: string; // This could be plain text or HTML.\n onChange: (event?: FormEvent<HTMLInputElement | HTMLTextAreaElement>, newValue?: string) => void;\n onKeyDown?: (ev: React.KeyboardEvent<HTMLInputElement | HTMLTextAreaElement>) => void;\n onEnterKeyDown?: () => void;\n textFieldRef?: React.RefObject<ITextField>;\n supportNewline?: boolean;\n mentionLookupOptions?: MentionLookupOptions;\n}\n\n/**\n * @private\n */\nexport const TextFieldWithMention = (props: TextFieldWithMentionProps): JSX.Element => {\n const {\n textFieldProps,\n dataUiId,\n textValue,\n onChange,\n textFieldRef,\n onKeyDown,\n onEnterKeyDown,\n supportNewline,\n mentionLookupOptions\n } = props;\n const inputBoxRef = useRef<HTMLDivElement>(null);\n\n // Current suggestion list, provided by the callback\n const [mentionSuggestions, setMentionSuggestions] = useState<Mention[]>([]);\n\n // Current suggestion list, provided by the callback\n const [activeSuggestionIndex, setActiveSuggestionIndex] = useState<number | undefined>(undefined);\n\n // Index of the current trigger character in the text field\n const [currentTriggerStartIndex, setCurrentTriggerStartIndex] = useState<number>(-1);\n\n const [inputTextValue, setInputTextValue] = useState<string>('');\n\n const [tagsValue, setTagsValue] = useState<TagData[]>([]);\n\n // Index of the previous selection start in the text field\n const [selectionStartValue, setSelectionStartValue] = useState<number | undefined>();\n\n // Index of the previous selection end in the text field\n const [selectionEndValue, setSelectionEndValue] = useState<number | undefined>();\n\n // Boolean value to check if onMouseDown event should be handled during select as selection range\n // for onMouseDown event is not updated yet and the selection range for mouse click/taps will be\n // updated in onSelect event if needed.\n const [shouldHandleOnMouseDownDuringSelect, setShouldHandleOnMouseDownDuringSelect] = useState<boolean>(true);\n\n // Boolean flag to check if mouse/touch move event should be handled\n const [shouldHandleMoveEvent, setShouldHandleMoveEvent] = useState<boolean>(false);\n\n // Indexes of start of touch/mouse selection\n const [interactionStartSelection, setInteractionStartSelection] = useState<\n { start: number | undefined; end: number | undefined } | undefined\n >();\n\n // Caret position in the text field\n const [caretPosition, setCaretPosition] = useState<Caret.Position | undefined>(undefined);\n\n // Index of where the caret is in the text field\n const [caretIndex, setCaretIndex] = useState<number | undefined>(undefined);\n\n const localeStrings = useLocale().strings;\n\n // Set mention suggestions\n const updateMentionSuggestions = useCallback(\n (suggestions: Mention[]) => {\n setMentionSuggestions(suggestions);\n },\n [setMentionSuggestions]\n );\n\n // Parse the text and get the plain text version to display in the input box\n useEffect(() => {\n const trigger = mentionLookupOptions?.trigger || DEFAULT_MENTION_TRIGGER;\n const parsedHTMLData = textToTagParser(textValue, trigger);\n setInputTextValue(parsedHTMLData.plainText);\n setTagsValue(parsedHTMLData.tags);\n updateMentionSuggestions([]);\n }, [textValue, mentionLookupOptions?.trigger, updateMentionSuggestions]);\n\n useEffect(() => {\n // effect for caret index update\n if (caretIndex === undefined || textFieldRef === undefined || textFieldRef?.current === undefined) {\n return;\n }\n // get validated caret index between 0 and inputTextValue.length otherwise caret will be set to incorrect index\n const updatedCaretIndex = getValidatedIndexInRange({\n min: 0,\n max: inputTextValue.length,\n currentValue: caretIndex\n });\n textFieldRef?.current?.setSelectionRange(updatedCaretIndex, updatedCaretIndex);\n setSelectionStartValue(updatedCaretIndex);\n setSelectionEndValue(updatedCaretIndex);\n }, [caretIndex, inputTextValue.length, textFieldRef, setSelectionStartValue, setSelectionEndValue]);\n\n const onSuggestionSelected = useCallback(\n (suggestion: Mention) => {\n let selectionEnd = textFieldRef?.current?.selectionEnd || -1;\n if (selectionEnd < 0) {\n selectionEnd = 0;\n } else if (selectionEnd > inputTextValue.length) {\n selectionEnd = inputTextValue.length;\n }\n const oldPlainText = inputTextValue;\n const mention = htmlStringForMentionSuggestion(suggestion, localeStrings);\n\n // update plain text with the mention html text\n const newPlainText =\n inputTextValue.substring(0, currentTriggerStartIndex) + mention + inputTextValue.substring(selectionEnd);\n const triggerText = mentionLookupOptions?.trigger ?? DEFAULT_MENTION_TRIGGER;\n // update html text with updated plain text\n const updatedContent = updateHTML({\n htmlText: textValue,\n oldPlainText,\n newPlainText,\n tags: tagsValue,\n startIndex: currentTriggerStartIndex,\n oldPlainTextEndIndex: selectionEnd,\n change: mention,\n mentionTrigger: triggerText\n });\n const displayName = getDisplayNameForMentionSuggestion(suggestion, localeStrings);\n const newCaretIndex = currentTriggerStartIndex + displayName.length + triggerText.length;\n // move the caret in the text field to the end of the mention plain text\n setCaretIndex(newCaretIndex);\n setSelectionEndValue(newCaretIndex);\n setSelectionStartValue(newCaretIndex);\n setCurrentTriggerStartIndex(-1);\n updateMentionSuggestions([]);\n // set focus back to text field\n textFieldRef?.current?.focus();\n setActiveSuggestionIndex(undefined);\n onChange && onChange(undefined, updatedContent.updatedHTML);\n },\n [\n textFieldRef,\n inputTextValue,\n currentTriggerStartIndex,\n mentionLookupOptions?.trigger,\n onChange,\n textValue,\n tagsValue,\n updateMentionSuggestions,\n localeStrings\n ]\n );\n\n const onTextFieldKeyDown = useCallback(\n (ev: React.KeyboardEvent<HTMLInputElement | HTMLTextAreaElement>) => {\n // caretIndex should be set to undefined when the user is typing\n setCaretIndex(undefined);\n // shouldHandleOnMouseDownDuringSelect should be set to false after the last mouse down event.\n // it shouldn't be updated in onMouseUp\n // as onMouseUp can be triggered before or after onSelect event\n // because its order depends on mouse events not selection.\n setShouldHandleOnMouseDownDuringSelect(false);\n\n if (isEnterKeyEventFromCompositionSession(ev)) {\n return;\n }\n\n if (mentionSuggestions.length > 0) {\n if (ev.key === 'ArrowUp') {\n ev.preventDefault();\n const newActiveIndex =\n activeSuggestionIndex === undefined\n ? mentionSuggestions.length - 1\n : Math.max(activeSuggestionIndex - 1, 0);\n setActiveSuggestionIndex(newActiveIndex);\n } else if (ev.key === 'ArrowDown') {\n ev.preventDefault();\n const newActiveIndex =\n activeSuggestionIndex === undefined\n ? 0\n : Math.min(activeSuggestionIndex + 1, mentionSuggestions.length - 1);\n setActiveSuggestionIndex(newActiveIndex);\n } else if (ev.key === 'Escape') {\n updateMentionSuggestions([]);\n }\n }\n if (ev.key === 'Enter' && (ev.shiftKey === false || !supportNewline)) {\n ev.preventDefault();\n\n // If we are looking up a mention, select the focused suggestion\n if (mentionSuggestions.length > 0 && activeSuggestionIndex !== undefined) {\n const selectedMention = mentionSuggestions[activeSuggestionIndex];\n if (selectedMention) {\n onSuggestionSelected(selectedMention);\n return;\n }\n }\n\n onEnterKeyDown && onEnterKeyDown();\n }\n onKeyDown && onKeyDown(ev);\n },\n [\n onEnterKeyDown,\n onKeyDown,\n supportNewline,\n mentionSuggestions,\n activeSuggestionIndex,\n onSuggestionSelected,\n updateMentionSuggestions\n ]\n );\n\n const debouncedQueryUpdate = useDebouncedCallback(async (query: string) => {\n const suggestions = (await mentionLookupOptions?.onQueryUpdated(query)) ?? [];\n if (suggestions.length === 0) {\n setActiveSuggestionIndex(undefined);\n } else if (activeSuggestionIndex === undefined) {\n // Set the active to the first, if it's not already set\n setActiveSuggestionIndex(0);\n }\n updateMentionSuggestions(suggestions);\n }, 500);\n\n // Update selections index in mention to navigate by words\n const updateSelectionIndexesWithMentionIfNeeded = useCallback(\n ({\n event,\n inputTextValue,\n selectionEndValue,\n selectionStartValue,\n tagsValue\n }: {\n event: FormEvent<HTMLInputElement | HTMLTextAreaElement>;\n inputTextValue: string;\n selectionEndValue?: number;\n selectionStartValue?: number;\n tagsValue: TagData[];\n }): void => {\n let updatedStartIndex = event.currentTarget.selectionStart;\n let updatedEndIndex = event.currentTarget.selectionEnd;\n if (\n event.currentTarget.selectionStart === event.currentTarget.selectionEnd &&\n event.currentTarget.selectionStart !== null &&\n event.currentTarget.selectionStart !== -1\n ) {\n // just a caret movement/usual typing or deleting\n const mentionTag = findMentionTagForSelection(tagsValue, event.currentTarget.selectionStart);\n // don't include boundary cases to show correct selection, otherwise it will show selection at mention boundaries\n if (\n mentionTag !== undefined &&\n mentionTag.plainTextBeginIndex !== undefined &&\n event.currentTarget.selectionStart > mentionTag.plainTextBeginIndex &&\n event.currentTarget.selectionStart < (mentionTag.plainTextEndIndex ?? mentionTag.plainTextBeginIndex)\n ) {\n // get updated selection index\n const newSelectionIndex = findNewSelectionIndexForMention({\n tag: mentionTag,\n textValue: inputTextValue,\n currentSelectionIndex: event.currentTarget.selectionStart,\n previousSelectionIndex: selectionStartValue ?? inputTextValue.length\n });\n updatedStartIndex = newSelectionIndex;\n updatedEndIndex = newSelectionIndex;\n }\n } else if (event.currentTarget.selectionStart !== event.currentTarget.selectionEnd) {\n // Both e.currentTarget.selectionStart !== selectionStartValue and e.currentTarget.selectionEnd !== selectionEndValue can be true when a user selects a text by double click\n if (event.currentTarget.selectionStart !== null && event.currentTarget.selectionStart !== selectionStartValue) {\n // the selection start is changed\n const mentionTag = findMentionTagForSelection(tagsValue, event.currentTarget.selectionStart);\n // don't include boundary cases to show correct selection, otherwise it will show selection at mention boundaries\n if (\n mentionTag !== undefined &&\n mentionTag.plainTextBeginIndex !== undefined &&\n event.currentTarget.selectionStart > mentionTag.plainTextBeginIndex &&\n event.currentTarget.selectionStart < (mentionTag.plainTextEndIndex ?? mentionTag.plainTextBeginIndex)\n ) {\n updatedStartIndex = findNewSelectionIndexForMention({\n tag: mentionTag,\n textValue: inputTextValue,\n currentSelectionIndex: event.currentTarget.selectionStart,\n previousSelectionIndex: selectionStartValue ?? inputTextValue.length\n });\n }\n }\n if (event.currentTarget.selectionEnd !== null && event.currentTarget.selectionEnd !== selectionEndValue) {\n // the selection end is changed\n const mentionTag = findMentionTagForSelection(tagsValue, event.currentTarget.selectionEnd);\n // don't include boundary cases to show correct selection, otherwise it will show selection at mention boundaries\n if (\n mentionTag !== undefined &&\n mentionTag.plainTextBeginIndex !== undefined &&\n event.currentTarget.selectionEnd > mentionTag.plainTextBeginIndex &&\n event.currentTarget.selectionEnd < (mentionTag.plainTextEndIndex ?? mentionTag.plainTextBeginIndex)\n ) {\n updatedEndIndex = findNewSelectionIndexForMention({\n tag: mentionTag,\n textValue: inputTextValue,\n currentSelectionIndex: event.currentTarget.selectionEnd,\n previousSelectionIndex: selectionEndValue ?? inputTextValue.length\n });\n }\n }\n }\n // e.currentTarget.selectionDirection should be set to handle shift + arrow keys\n if (event.currentTarget.selectionDirection === null) {\n event.currentTarget.setSelectionRange(updatedStartIndex, updatedEndIndex);\n } else {\n event.currentTarget.setSelectionRange(\n updatedStartIndex,\n updatedEndIndex,\n event.currentTarget.selectionDirection\n );\n }\n setSelectionStartValue(nullToUndefined(updatedStartIndex));\n setSelectionEndValue(nullToUndefined(updatedEndIndex));\n },\n [setSelectionStartValue, setSelectionEndValue]\n );\n\n const handleOnSelect = useCallback(\n ({\n event,\n inputTextValue,\n tags,\n shouldHandleOnMouseDownDuringSelect,\n selectionStartValue,\n selectionEndValue,\n interactionStartSelection\n }: {\n event: React.FormEvent<HTMLInputElement | HTMLTextAreaElement>;\n inputTextValue: string;\n tags: TagData[];\n shouldHandleOnMouseDownDuringSelect: boolean;\n selectionStartValue?: number;\n selectionEndValue?: number;\n interactionStartSelection?: { start: number | undefined; end: number | undefined };\n }): void => {\n if (shouldHandleOnMouseDownDuringSelect) {\n if (\n interactionStartSelection !== undefined &&\n (interactionStartSelection.start !== event.currentTarget.selectionStart ||\n interactionStartSelection.end !== event.currentTarget.selectionEnd)\n ) {\n // selection was changed by mouse\n // for mouse selection only, it's possible to start selection in the middle of a word in a mention\n // because of this when event.currentTarget.selectionStart === mouseMoveStartPoint.start\n // selectionStartValue for updateSelectionIndexesWithMentionIfNeeded should be set\n // to the end of the input to mimic selection from right to left for the left selection index\n const updatedSelectionStartValue =\n event.currentTarget.selectionStart === interactionStartSelection.start\n ? inputTextValue.length\n : interactionStartSelection.start;\n // selectionStart is always less than selectionEnd so sometimes selectionEnd is user's start of the selection\n // so when event.currentTarget.selectionEnd === mouseMoveStartPoint.end\n // selectionEndValue for updateSelectionIndexesWithMentionIfNeeded should be set\n // to the beginning of the input to mimic selection from left to right for the right selection index\n const updatedSelectionEndValue =\n event.currentTarget.selectionEnd === interactionStartSelection.end ? 0 : interactionStartSelection.end;\n updateSelectionIndexesWithMentionIfNeeded({\n event,\n inputTextValue,\n selectionStartValue: updatedSelectionStartValue,\n selectionEndValue: updatedSelectionEndValue,\n tagsValue: tags\n });\n setInteractionStartSelection(undefined);\n setShouldHandleOnMouseDownDuringSelect(false);\n } else if (event.currentTarget.selectionStart !== null) {\n // on select was triggered by mouse down/up with no movement\n const mentionTag = findMentionTagForSelection(tags, event.currentTarget.selectionStart);\n if (mentionTag !== undefined && mentionTag.plainTextBeginIndex !== undefined) {\n // handle mention click by selecting the whole mention\n // if the selection is not on the bounds of the mention\n const mentionEndIndex = mentionTag.plainTextEndIndex ?? mentionTag.plainTextBeginIndex;\n // disable selection for clicks on mention bounds\n if (\n event.currentTarget.selectionStart !== event.currentTarget.selectionEnd ||\n (event.currentTarget.selectionStart !== mentionTag.plainTextBeginIndex &&\n event.currentTarget.selectionStart !== mentionEndIndex)\n ) {\n if (event.currentTarget.selectionDirection === null) {\n event.currentTarget.setSelectionRange(mentionTag.plainTextBeginIndex, mentionEndIndex);\n } else {\n event.currentTarget.setSelectionRange(\n mentionTag.plainTextBeginIndex,\n mentionEndIndex,\n event.currentTarget.selectionDirection\n );\n }\n setSelectionStartValue(mentionTag.plainTextBeginIndex);\n setSelectionEndValue(mentionEndIndex);\n } else {\n // bounds of the mention were selected\n setSelectionStartValue(event.currentTarget.selectionStart);\n setSelectionEndValue(event.currentTarget.selectionEnd);\n }\n } else {\n // not a mention tag\n setSelectionStartValue(event.currentTarget.selectionStart);\n setSelectionEndValue(nullToUndefined(event.currentTarget.selectionEnd));\n }\n setInteractionStartSelection(undefined);\n setShouldHandleOnMouseDownDuringSelect(false);\n }\n } else {\n // selection was changed by keyboard\n updateSelectionIndexesWithMentionIfNeeded({\n event,\n inputTextValue,\n selectionStartValue,\n selectionEndValue,\n tagsValue: tags\n });\n }\n },\n [updateSelectionIndexesWithMentionIfNeeded, setSelectionStartValue, setSelectionEndValue]\n );\n\n type HandleOnChangeProps = {\n currentSelectionEnd?: number;\n currentSelectionStart?: number;\n currentTriggerStartIndex: number;\n event: React.FormEvent<HTMLInputElement | HTMLTextAreaElement>;\n htmlTextValue: string;\n inputTextValue: string;\n previousSelectionEnd?: number;\n previousSelectionStart?: number;\n tagsValue: TagData[];\n updatedValue?: string;\n };\n\n const handleOnChange = useCallback(\n async ({\n currentSelectionEnd,\n currentSelectionStart,\n currentTriggerStartIndex,\n event,\n htmlTextValue,\n inputTextValue,\n previousSelectionEnd,\n previousSelectionStart,\n tagsValue,\n updatedValue\n }: HandleOnChangeProps): Promise<void> => {\n debouncedQueryUpdate.cancel();\n if (event.currentTarget === null) {\n return;\n }\n // handle backspace change\n // onSelect is not called for backspace as selection is not changed and local caret index is outdated\n setCaretIndex(undefined);\n const newValue = updatedValue ?? '';\n const triggerText = mentionLookupOptions?.trigger ?? DEFAULT_MENTION_TRIGGER;\n\n const newTextLength = newValue.length;\n // updating indexes to set between 0 and text length, otherwise selectionRange won't be set correctly\n const currentSelectionEndValue = getValidatedIndexInRange({\n min: 0,\n max: newTextLength,\n currentValue: currentSelectionEnd\n });\n const currentSelectionStartValue = getValidatedIndexInRange({\n min: 0,\n max: newTextLength,\n currentValue: currentSelectionStart\n });\n const previousSelectionStartValue = getValidatedIndexInRange({\n min: 0,\n max: inputTextValue.length,\n currentValue: previousSelectionStart\n });\n const previousSelectionEndValue = getValidatedIndexInRange({\n min: 0,\n max: inputTextValue.length,\n currentValue: previousSelectionEnd\n });\n\n // If we are enabled for lookups,\n if (mentionLookupOptions !== undefined) {\n // Look at the range of the change for a trigger character\n const triggerPriorIndex = newValue.lastIndexOf(triggerText, currentSelectionEndValue - 1);\n // Update the caret position, used for positioning the suggestions popover\n const textField = event.currentTarget;\n const relativePosition = Caret.getRelativePosition(textField);\n const adjustOffset = Math.max(0, textField.scrollHeight - textField.clientHeight);\n relativePosition.top -= adjustOffset;\n setCaretPosition(relativePosition);\n\n if (triggerPriorIndex !== undefined) {\n // trigger is found\n const isSpaceBeforeTrigger = newValue.substring(triggerPriorIndex - 1, triggerPriorIndex) === ' ';\n const wordAtSelection = newValue.substring(triggerPriorIndex, currentSelectionEndValue);\n let tagIndex = currentTriggerStartIndex;\n if (!isSpaceBeforeTrigger && triggerPriorIndex !== 0) {\n //no space before the trigger <- continuation of the previous word\n tagIndex = -1;\n setCurrentTriggerStartIndex(tagIndex);\n } else if (wordAtSelection === triggerText) {\n // start of the mention\n tagIndex = currentSelectionEndValue - triggerText.length;\n if (tagIndex < 0) {\n tagIndex = 0;\n }\n setCurrentTriggerStartIndex(tagIndex);\n }\n if (tagIndex === -1) {\n updateMentionSuggestions([]);\n } else {\n // In the middle of a @mention lookup\n if (tagIndex > -1) {\n const query = wordAtSelection.substring(triggerText.length, wordAtSelection.length);\n if (query !== undefined) {\n await debouncedQueryUpdate(query);\n }\n }\n }\n }\n }\n let result = '';\n if (tagsValue.length === 0) {\n // no tags in the string and newValue should be used as a result string\n result = newValue;\n } else {\n // there are tags in the text value and htmlTextValue is html string\n // find diff between old and new text\n const { changeStart, oldChangeEnd, newChangeEnd } = findStringsDiffIndexes({\n oldText: inputTextValue,\n newText: newValue,\n previousSelectionStart: previousSelectionStartValue,\n previousSelectionEnd: previousSelectionEndValue,\n currentSelectionStart: currentSelectionStartValue,\n currentSelectionEnd: currentSelectionEndValue\n });\n const change = newValue.substring(changeStart, newChangeEnd);\n // get updated html string\n const updatedContent = updateHTML({\n htmlText: htmlTextValue,\n oldPlainText: inputTextValue,\n newPlainText: newValue,\n tags: tagsValue,\n startIndex: changeStart,\n oldPlainTextEndIndex: oldChangeEnd,\n change,\n mentionTrigger: triggerText\n });\n result = updatedContent.updatedHTML;\n // update caret index if needed\n if (updatedContent.updatedSelectionIndex !== undefined) {\n setCaretIndex(updatedContent.updatedSelectionIndex);\n setSelectionEndValue(updatedContent.updatedSelectionIndex);\n setSelectionStartValue(updatedContent.updatedSelectionIndex);\n }\n }\n\n onChange && onChange(event, result);\n },\n [onChange, mentionLookupOptions, setCaretIndex, setCaretPosition, updateMentionSuggestions, debouncedQueryUpdate]\n );\n\n // Adjust the selection range based on a mouse / touch interaction\n const handleOnMove = useCallback(\n ({\n event,\n selectionStartValue,\n selectionEndValue,\n interactionStartSelection,\n shouldHandleMoveEvent\n }: {\n event: React.UIEvent<HTMLInputElement | HTMLTextAreaElement>;\n selectionStartValue: number | undefined;\n selectionEndValue: number | undefined;\n interactionStartSelection: { start: number | undefined; end: number | undefined } | undefined;\n shouldHandleMoveEvent: boolean;\n }) => {\n if (\n shouldHandleMoveEvent &&\n interactionStartSelection === undefined &&\n (event.currentTarget.selectionStart !== selectionStartValue ||\n event.currentTarget.selectionEnd !== selectionEndValue)\n ) {\n setInteractionStartSelection({\n start: nullToUndefined(event.currentTarget.selectionStart),\n end: nullToUndefined(event.currentTarget.selectionEnd)\n });\n }\n },\n []\n );\n\n // Adjust the selection range based on a mouse / touch interaction\n const handleOnInteractionStarted = useCallback(() => {\n setInteractionStartSelection(undefined);\n setShouldHandleMoveEvent(true);\n setShouldHandleOnMouseDownDuringSelect(true);\n }, []);\n\n // Adjust the selection range based on a mouse / touch interaction\n const handleOnInteractionCompleted = useCallback(() => {\n setShouldHandleMoveEvent(false);\n }, []);\n\n const announcerText = useMemo(() => {\n if (activeSuggestionIndex === undefined) {\n return undefined;\n }\n const currentMention = mentionSuggestions[activeSuggestionIndex ?? 0];\n return currentMention?.displayText.length > 0\n ? currentMention?.displayText\n : localeStrings.participantItem.displayNamePlaceholder;\n }, [activeSuggestionIndex, mentionSuggestions, localeStrings.participantItem.displayNamePlaceholder]);\n\n return (\n <>\n {mentionSuggestions.length > 0 && (\n <_MentionPopover\n suggestions={mentionSuggestions}\n activeSuggestionIndex={activeSuggestionIndex}\n target={inputBoxRef}\n targetPositionOffset={caretPosition}\n onRenderSuggestionItem={mentionLookupOptions?.onRenderSuggestionItem}\n onSuggestionSelected={onSuggestionSelected}\n onDismiss={() => {\n updateMentionSuggestions([]);\n }}\n />\n )}\n {announcerText !== undefined && <Announcer announcementString={announcerText} ariaLive={'polite'} />}\n <TextField\n {...textFieldProps}\n data-ui-id={dataUiId}\n value={inputTextValue}\n onChange={(e, newValue) => {\n // Remove when switching to react 17+, currently needed because of https://legacy.reactjs.org/docs/legacy-event-pooling.html\n // Prevents React from resetting event's properties\n e.persist();\n setInputTextValue(newValue ?? '');\n handleOnChange({\n event: e,\n tagsValue,\n htmlTextValue: textValue,\n inputTextValue,\n currentTriggerStartIndex,\n previousSelectionStart: nullToUndefined(selectionStartValue),\n previousSelectionEnd: nullToUndefined(selectionEndValue),\n currentSelectionStart: nullToUndefined(e.currentTarget.selectionStart),\n currentSelectionEnd: nullToUndefined(e.currentTarget.selectionEnd),\n updatedValue: newValue\n });\n }}\n onSelect={(e) => {\n handleOnSelect({\n event: e,\n inputTextValue,\n shouldHandleOnMouseDownDuringSelect,\n selectionEndValue,\n selectionStartValue,\n tags: tagsValue,\n interactionStartSelection\n });\n }}\n onMouseDown={() => {\n // as events order is onMouseDown -> onMouseMove -> onMouseUp -> onSelect -> onClick\n // onClick and onMouseDown can't handle clicking on mention event because\n // onMouseDown doesn't have correct selectionRange yet and\n // onClick already has wrong range as it's called after onSelect that updates the selection range\n // so we need to handle onMouseDown to prevent onSelect default behavior\n handleOnInteractionStarted();\n }}\n onMouseMove={(event) => {\n handleOnMove({\n event,\n selectionStartValue,\n selectionEndValue,\n interactionStartSelection,\n shouldHandleMoveEvent\n });\n }}\n onMouseUp={() => {\n handleOnInteractionCompleted();\n }}\n onTouchStart={() => {\n handleOnInteractionStarted();\n }}\n onTouchMove={(event) => {\n handleOnMove({\n event,\n selectionStartValue,\n selectionEndValue,\n interactionStartSelection,\n shouldHandleMoveEvent\n });\n }}\n onTouchEnd={() => {\n handleOnInteractionCompleted;\n }}\n onBlur={() => {\n // setup all flags to default values when text field loses focus\n setShouldHandleOnMouseDownDuringSelect(false);\n setCaretIndex(undefined);\n setSelectionStartValue(undefined);\n setSelectionEndValue(undefined);\n }}\n onKeyDown={onTextFieldKeyDown}\n elementRef={inputBoxRef}\n />\n </>\n );\n};\n\n/**\n * Props for displaying a send button besides the text input area.\n *\n * @private\n */\nexport type InputBoxButtonProps = {\n onRenderIcon: (isHover: boolean) => JSX.Element;\n onClick: (e: React.MouseEvent<HTMLDivElement, MouseEvent>) => void;\n className?: string;\n id?: string;\n ariaLabel?: string;\n tooltipContent?: string;\n};\n\n/**\n * @private\n */\nexport const InputBoxButton = (props: InputBoxButtonProps): JSX.Element => {\n const { onRenderIcon, onClick, ariaLabel, className, id, tooltipContent } = props;\n const [isHover, setIsHover] = useState(false);\n const mergedButtonStyle = mergeStyles(inputButtonStyle, className);\n\n const theme = useTheme();\n const calloutStyle: Partial<ICalloutContentStyles> = { root: { padding: 0 }, calloutMain: { padding: '0.5rem' } };\n\n // Place callout with no gap between it and the button.\n const calloutProps = {\n gapSpace: 0,\n styles: calloutStyle,\n backgroundColor: isDarkThemed(theme) ? theme.palette.neutralLighter : ''\n };\n return (\n <TooltipHost hostClassName={inputButtonTooltipStyle} content={tooltipContent} calloutProps={{ ...calloutProps }}>\n <IconButton\n className={mergedButtonStyle}\n ariaLabel={ariaLabel}\n onClick={onClick}\n id={id}\n onMouseEnter={() => {\n setIsHover(true);\n }}\n onMouseLeave={() => {\n setIsHover(false);\n }}\n // VoiceOver fix: Avoid icon from stealing focus when IconButton is double-tapped to send message by wrapping with Stack with pointerEvents style to none\n onRenderIcon={() => <Stack className={iconWrapperStyle}>{onRenderIcon(isHover)}</Stack>}\n />\n </TooltipHost>\n );\n};\n"]}
@@ -142,8 +142,16 @@ export interface VideoGalleryProps {
142
142
  onCreateRemoteStreamView?: (userId: string, options?: VideoStreamOptions) => Promise<void | CreateVideoStreamViewResult>;
143
143
  /** Callback to render a remote video tile */
144
144
  onRenderRemoteVideoTile?: (remoteParticipant: VideoGalleryRemoteParticipant) => JSX.Element;
145
- /** Callback to dispose a remote video stream view */
145
+ /**
146
+ * @deprecated use {@link onDisposeRemoteVideoStreamView} and {@link onDisposeRemoteScreenShareStreamView} instead
147
+ *
148
+ * Callback to dispose a remote video stream view
149
+ */
146
150
  onDisposeRemoteStreamView?: (userId: string) => Promise<void>;
151
+ /** Callback to dispose a remote video stream view */
152
+ onDisposeRemoteVideoStreamView?: (userId: string) => Promise<void>;
153
+ /** Callback to dispose a remote screen share stream view */
154
+ onDisposeRemoteScreenShareStreamView?: (userId: string) => Promise<void>;
147
155
  /** Callback to render a particpant avatar */
148
156
  onRenderAvatar?: OnRenderAvatarCallback;
149
157
  /**
@@ -64,7 +64,7 @@ export const MAX_PINNED_REMOTE_VIDEO_TILES = 4;
64
64
  */
65
65
  export const VideoGallery = (props) => {
66
66
  var _a, _b, _c;
67
- const { localParticipant, remoteParticipants = [], localVideoViewOptions, remoteVideoViewOptions, dominantSpeakers, onRenderLocalVideoTile, onRenderRemoteVideoTile, onCreateLocalStreamView, onDisposeLocalStreamView, onCreateRemoteStreamView, onDisposeRemoteStreamView, styles, layout, onRenderAvatar, showMuteIndicator, maxRemoteVideoStreams = DEFAULT_MAX_REMOTE_VIDEO_STREAMS, showCameraSwitcherInLocalPreview, localVideoCameraCycleButtonProps,
67
+ const { localParticipant, remoteParticipants = [], localVideoViewOptions, remoteVideoViewOptions, dominantSpeakers, onRenderLocalVideoTile, onRenderRemoteVideoTile, onCreateLocalStreamView, onDisposeLocalStreamView, onCreateRemoteStreamView, onDisposeRemoteScreenShareStreamView, onDisposeRemoteVideoStreamView, styles, layout, onRenderAvatar, showMuteIndicator, maxRemoteVideoStreams = DEFAULT_MAX_REMOTE_VIDEO_STREAMS, showCameraSwitcherInLocalPreview, localVideoCameraCycleButtonProps,
68
68
  /* @conditional-compile-remove(pinned-participants) */
69
69
  onPinParticipant: onPinParticipantHandler,
70
70
  /* @conditional-compile-remove(pinned-participants) */
@@ -182,7 +182,7 @@ export const VideoGallery = (props) => {
182
182
  const remoteVideoStream = participant.videoStream;
183
183
  /* @conditional-compile-remove(pinned-participants) */
184
184
  const isPinned = pinnedParticipants === null || pinnedParticipants === void 0 ? void 0 : pinnedParticipants.includes(participant.userId);
185
- return (React.createElement(_RemoteVideoTile, { key: participant.userId, userId: participant.userId, remoteParticipant: participant, onCreateRemoteStreamView: isVideoParticipant ? onCreateRemoteStreamView : undefined, onDisposeRemoteStreamView: isVideoParticipant ? onDisposeRemoteStreamView : undefined, isAvailable: isVideoParticipant ? remoteVideoStream === null || remoteVideoStream === void 0 ? void 0 : remoteVideoStream.isAvailable : false, isReceiving: isVideoParticipant ? remoteVideoStream === null || remoteVideoStream === void 0 ? void 0 : remoteVideoStream.isReceiving : false, renderElement: isVideoParticipant ? remoteVideoStream === null || remoteVideoStream === void 0 ? void 0 : remoteVideoStream.renderElement : undefined, remoteVideoViewOptions: isVideoParticipant ? remoteVideoViewOptions : undefined, onRenderAvatar: onRenderAvatar, showMuteIndicator: showMuteIndicator, strings: strings,
185
+ return (React.createElement(_RemoteVideoTile, { key: participant.userId, userId: participant.userId, remoteParticipant: participant, onCreateRemoteStreamView: isVideoParticipant ? onCreateRemoteStreamView : undefined, onDisposeRemoteStreamView: isVideoParticipant ? onDisposeRemoteVideoStreamView : undefined, isAvailable: isVideoParticipant ? remoteVideoStream === null || remoteVideoStream === void 0 ? void 0 : remoteVideoStream.isAvailable : false, isReceiving: isVideoParticipant ? remoteVideoStream === null || remoteVideoStream === void 0 ? void 0 : remoteVideoStream.isReceiving : false, renderElement: isVideoParticipant ? remoteVideoStream === null || remoteVideoStream === void 0 ? void 0 : remoteVideoStream.renderElement : undefined, remoteVideoViewOptions: isVideoParticipant ? remoteVideoViewOptions : undefined, onRenderAvatar: onRenderAvatar, showMuteIndicator: showMuteIndicator, strings: strings,
186
186
  /* @conditional-compile-remove(PSTN-calls) */
187
187
  participantState: participant.state,
188
188
  /* @conditional-compile-remove(pinned-participants) */
@@ -205,7 +205,7 @@ export const VideoGallery = (props) => {
205
205
  toggleAnnouncerString: toggleAnnouncerString }));
206
206
  }, [
207
207
  onCreateRemoteStreamView,
208
- onDisposeRemoteStreamView,
208
+ onDisposeRemoteVideoStreamView,
209
209
  remoteVideoViewOptions,
210
210
  onRenderAvatar,
211
211
  showMuteIndicator,
@@ -219,7 +219,7 @@ export const VideoGallery = (props) => {
219
219
  ]);
220
220
  const screenShareParticipant = remoteParticipants.find((participant) => { var _a; return (_a = participant.screenShareStream) === null || _a === void 0 ? void 0 : _a.isAvailable; });
221
221
  const localScreenShareStreamComponent = React.createElement(LocalScreenShare, { localParticipant: localParticipant });
222
- const remoteScreenShareComponent = screenShareParticipant && (React.createElement(RemoteScreenShare, Object.assign({}, screenShareParticipant, { renderElement: (_b = screenShareParticipant.screenShareStream) === null || _b === void 0 ? void 0 : _b.renderElement, onCreateRemoteStreamView: onCreateRemoteStreamView, onDisposeRemoteStreamView: onDisposeRemoteStreamView, isReceiving: (_c = screenShareParticipant.screenShareStream) === null || _c === void 0 ? void 0 : _c.isReceiving })));
222
+ const remoteScreenShareComponent = screenShareParticipant && (React.createElement(RemoteScreenShare, Object.assign({}, screenShareParticipant, { renderElement: (_b = screenShareParticipant.screenShareStream) === null || _b === void 0 ? void 0 : _b.renderElement, onCreateRemoteStreamView: onCreateRemoteStreamView, onDisposeRemoteStreamView: onDisposeRemoteScreenShareStreamView, isReceiving: (_c = screenShareParticipant.screenShareStream) === null || _c === void 0 ? void 0 : _c.isReceiving })));
223
223
  const screenShareComponent = remoteScreenShareComponent
224
224
  ? remoteScreenShareComponent
225
225
  : localParticipant.isScreenSharingOn
@@ -1 +1 @@
1
- {"version":3,"file":"VideoGallery.js","sourceRoot":"","sources":["../../../../../../react-components/src/components/VideoGallery.tsx"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EAAE,eAAe,EAAU,WAAW,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AAC9E,OAAO,KAAK,EAAE,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAE5D,sDAAsD;AACtD,OAAO,EAAE,SAAS,EAAE,MA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,kBAAkB;KACpE,CAAC,EACF;QACE,kBAAkB;QAClB,oBAAoB;QACpB,gCAAgC;QAChC,qBAAqB;QACrB,gBAAgB;QAChB,MAAM;QACN,cAAc;QACd,cAAc;QACd,eAAe;QACf,uBAAuB;QACvB,wBAAwB;QACxB,sDAAsD,CAAC,kBAAkB;QACzE,mDAAmD,CAAC,uBAAuB;QAC3E,gDAAgD,CAAC,kBAAkB;KACpE,CACF,CAAC;IAEF,MAAM,kBAAkB,GAAG,OAAO,CAAC,GAAG,EAAE;QACtC,IAAI,MAAM,KAAK,oBAAoB,EAAE;YACnC,OAAO,oBAAC,wBAAwB,oBAAK,WAAW,EAAI,CAAC;SACtD;QACD,OAAO,oBAAC,aAAa,oBAAK,WAAW,EAAI,CAAC;IAC5C,CAAC,EAAE,CAAC,MAAM,EAAE,WAAW,CAAC,CAAC,CAAC;IAE1B,OAAO,CACL;QACE,sDAAsD;QACtD,4GAA4G;QAC5G,EAAE,EAAE,wBAAwB,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,gBAAgB,gBAC/C,GAAG,CAAC,YAAY,EAC5B,GAAG,EAAE,YAAY,EACjB,SAAS,EAAE,WAAW,CAAC,yBAAyB,EAAE,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,IAAI,EAAE,YAAY,CAAC;QAE5E,kBAAkB;QAEjB,sDAAsD;QACtD,oBAAC,SAAS,IAAC,kBAAkB,EAAE,kBAAkB,EAAE,QAAQ,EAAC,QAAQ,GAAG,CAErE,CACP,CAAC;AACJ,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { concatStyleSets, IStyle, mergeStyles, Stack } from '@fluentui/react';\nimport React, { useCallback, useMemo, useRef } from 'react';\nimport { GridLayoutStyles } from '.';\n/* @conditional-compile-remove(pinned-participants) */\nimport { Announcer } from './Announcer';\n/* @conditional-compile-remove(pinned-participants) */\nimport { useEffect } from 'react';\nimport { useLocale } from '../localization';\nimport { useTheme } from '../theming';\nimport {\n BaseCustomStyles,\n OnRenderAvatarCallback,\n VideoGalleryLocalParticipant,\n VideoGalleryRemoteParticipant,\n VideoStreamOptions,\n CreateVideoStreamViewResult\n} from '../types';\nimport { HorizontalGalleryStyles } from './HorizontalGallery';\nimport { _RemoteVideoTile } from './RemoteVideoTile';\nimport { isNarrowWidth, _useContainerHeight, _useContainerWidth } from './utils/responsive';\nimport { LocalScreenShare } from './VideoGallery/LocalScreenShare';\nimport { RemoteScreenShare } from './VideoGallery/RemoteScreenShare';\nimport { LocalVideoCameraCycleButtonProps } from './LocalVideoCameraButton';\nimport { _ICoordinates, _ModalClone } from './ModalClone/ModalClone';\nimport { _formatString } from '@internal/acs-ui-common';\nimport { _LocalVideoTile } from './LocalVideoTile';\n/* @conditional-compile-remove(rooms) */\nimport { _usePermissions } from '../permissions';\nimport { DefaultLayout } from './VideoGallery/DefaultLayout';\nimport { FloatingLocalVideoLayout } from './VideoGallery/FloatingLocalVideoLayout';\nimport { useIdentifiers } from '../identifiers';\nimport { videoGalleryOuterDivStyle } from './styles/VideoGallery.styles';\nimport { floatingLocalVideoTileStyle } from './VideoGallery/styles/FloatingLocalVideo.styles';\n/* @conditional-compile-remove(pinned-participants) */\nimport { useId } from '@fluentui/react-hooks';\n/* @conditional-compile-remove(vertical-gallery) */\nimport { VerticalGalleryStyles } from './VerticalGallery';\n\n/**\n * @private\n * Currently the Calling JS SDK supports up to 4 remote video streams\n */\nexport const DEFAULT_MAX_REMOTE_VIDEO_STREAMS = 4;\n\n/**\n * @private\n * Styles to disable the selectivity of a text in video gallery\n */\nexport const unselectable = {\n '-webkit-user-select': 'none',\n '-webkit-touch-callout': 'none',\n '-moz-user-select': 'none',\n '-ms-user-select': 'none',\n 'user-select': 'none'\n};\n/**\n * @private\n * Set aside only 6 dominant speakers for remaining audio participants\n */\nexport const MAX_AUDIO_DOMINANT_SPEAKERS = 6;\n/**\n * @private\n * Default remote video tile menu options\n */\nexport const DEFAULT_REMOTE_VIDEO_TILE_MENU_OPTIONS = {\n kind: 'contextual'\n};\n\n/* @conditional-compile-remove(pinned-participants) */\n/**\n * @private\n * Maximum number of remote video tiles that can be pinned\n */\nexport const MAX_PINNED_REMOTE_VIDEO_TILES = 4;\n\n/**\n * All strings that may be shown on the UI in the {@link VideoGallery}.\n *\n * @public\n */\nexport interface VideoGalleryStrings {\n /** String to notify that local user is sharing their screen */\n screenIsBeingSharedMessage: string;\n /** String to show when remote screen share stream is loading */\n screenShareLoadingMessage: string;\n /** String for local video label. Default is \"You\" */\n localVideoLabel: string;\n /** String for local video camera switcher */\n localVideoCameraSwitcherLabel: string;\n /** String for announcing the local video tile can be moved by keyboard controls */\n localVideoMovementLabel: string;\n /** String for announcing the selected camera */\n localVideoSelectedDescription: string;\n /** placeholder text for participants who does not have a display name*/\n displayNamePlaceholder: string;\n /* @conditional-compile-remove(pinned-participants) */\n /** Menu text shown in Video Tile contextual menu for setting a remote participants video to fit in frame */\n fitRemoteParticipantToFrame: string;\n /* @conditional-compile-remove(pinned-participants) */\n /** Menu text shown in Video Tile contextual menu for setting a remote participants video to fill the frame */\n fillRemoteParticipantFrame: string;\n /* @conditional-compile-remove(pinned-participants) */\n /** Menu text shown in Video Tile contextual menu for pinning a remote participant's video tile */\n pinParticipantForMe: string;\n /* @conditional-compile-remove(pinned-participants) */\n /** Menu text shown in Video Tile contextual menu for setting a remote participant's video tile */\n unpinParticipantForMe: string;\n /* @conditional-compile-remove(pinned-participants) */\n /** Aria label for pin participant menu item of remote participant's video tile */\n pinParticipantMenuItemAriaLabel: string;\n /* @conditional-compile-remove(pinned-participants) */\n /** Aria label for unpin participant menu item of remote participant's video tile */\n unpinParticipantMenuItemAriaLabel: string;\n /* @conditional-compile-remove(pinned-participants) */\n /** Aria label to announce when remote participant's video tile is pinned */\n pinnedParticipantAnnouncementAriaLabel: string;\n /* @conditional-compile-remove(pinned-participants) */\n /** Aria label to announce when remote participant's video tile is unpinned */\n unpinnedParticipantAnnouncementAriaLabel: string;\n}\n\n/**\n * @public\n */\nexport type VideoGalleryLayout = 'default' | 'floatingLocalVideo';\n\n/**\n * {@link VideoGallery} Component Styles.\n * @public\n */\nexport interface VideoGalleryStyles extends BaseCustomStyles {\n /** Styles for the grid layout */\n gridLayout?: GridLayoutStyles;\n /** Styles for the horizontal gallery */\n horizontalGallery?: HorizontalGalleryStyles;\n /** Styles for the local video */\n localVideo?: IStyle;\n /* @conditional-compile-remove(vertical-gallery) */\n /** Styles for the vertical gallery */\n verticalGallery?: VerticalGalleryStyles;\n}\n\n/* @conditional-compile-remove(vertical-gallery) */\n/**\n * Different modes and positions of the overflow gallery in the VideoGallery\n *\n * @beta\n */\nexport type OverflowGalleryPosition = 'HorizontalBottom' | 'VerticalRight';\n\n/* @conditional-compile-remove(click-to-call) */\n/**\n * different modes of the local video tile\n *\n * @beta\n */\nexport type LocalVideoTileSize = '9:16' | '16:9' | 'hidden' | 'followDeviceOrientation';\n\n/**\n * Props for {@link VideoGallery}.\n *\n * @public\n */\nexport interface VideoGalleryProps {\n /**\n * Allows users to pass an object containing custom CSS styles for the gallery container.\n *\n * @Example\n * ```\n * <VideoGallery styles={{ root: { border: 'solid 1px red' } }} />\n * ```\n */\n styles?: VideoGalleryStyles;\n /** Layout of the video tiles. */\n layout?: VideoGalleryLayout;\n /** Local video particpant */\n localParticipant: VideoGalleryLocalParticipant;\n /** List of remote video particpants */\n remoteParticipants?: VideoGalleryRemoteParticipant[];\n /** List of dominant speaker userIds in the order of their dominance. 0th index is the most dominant. */\n dominantSpeakers?: string[];\n /** Local video view options */\n localVideoViewOptions?: VideoStreamOptions;\n /** Remote videos view options */\n remoteVideoViewOptions?: VideoStreamOptions;\n /** Callback to create the local video stream view */\n onCreateLocalStreamView?: (options?: VideoStreamOptions) => Promise<void | CreateVideoStreamViewResult>;\n /** Callback to dispose of the local video stream view */\n onDisposeLocalStreamView?: () => void;\n /** Callback to render the local video tile*/\n onRenderLocalVideoTile?: (localParticipant: VideoGalleryLocalParticipant) => JSX.Element;\n /** Callback to create a remote video stream view */\n onCreateRemoteStreamView?: (\n userId: string,\n options?: VideoStreamOptions\n ) => Promise<void | CreateVideoStreamViewResult>;\n /** Callback to render a remote video tile */\n onRenderRemoteVideoTile?: (remoteParticipant: VideoGalleryRemoteParticipant) => JSX.Element;\n /** Callback to dispose a remote video stream view */\n onDisposeRemoteStreamView?: (userId: string) => Promise<void>;\n /** Callback to render a particpant avatar */\n onRenderAvatar?: OnRenderAvatarCallback;\n /**\n * Whether to display the local video camera switcher button\n */\n showCameraSwitcherInLocalPreview?: boolean;\n /**\n * Whether to display a mute icon beside the user's display name.\n * @defaultValue `true`\n */\n showMuteIndicator?: boolean;\n /** Optional strings to override in component */\n strings?: Partial<VideoGalleryStrings>;\n /**\n * Maximum number of participant remote video streams that is rendered.\n * @defaultValue 4\n */\n maxRemoteVideoStreams?: number;\n /**\n * Camera control information for button to switch cameras.\n */\n localVideoCameraCycleButtonProps?: LocalVideoCameraCycleButtonProps;\n /* @conditional-compile-remove(pinned-participants) */\n /**\n * List of pinned participant userIds.\n */\n pinnedParticipants?: string[];\n /* @conditional-compile-remove(pinned-participants) */\n /**\n * This callback will be called when a participant video tile is pinned.\n */\n onPinParticipant?: (userId: string) => void;\n /* @conditional-compile-remove(pinned-participants) */\n /**\n * This callback will be called when a participant video tile is un-pinned.\n */\n onUnpinParticipant?: (userId: string) => void;\n /* @conditional-compile-remove(pinned-participants) */\n /**\n * Options for showing the remote video tile menu.\n *\n * @defaultValue \\{ kind: 'contextual' \\}\n */\n remoteVideoTileMenuOptions?: false | VideoTileContextualMenuProps | VideoTileDrawerMenuProps;\n /* @conditional-compile-remove(vertical-gallery) */\n /**\n * Determines the layout of the overflowGallery inside the VideoGallery.\n * @defaultValue 'HorizontalBottom'\n */\n overflowGalleryPosition?: OverflowGalleryPosition;\n /* @conditional-compile-remove(click-to-call) */\n /**\n * Determines the aspect ratio of local video tile in the video gallery.\n * @remarks 'followDeviceOrientation' will be responsive to the screen orientation and will change between 9:16 (portrait) and\n * 16:9 (landscape) aspect ratios.\n * @defaultValue 'followDeviceOrientation'\n */\n localVideoTileSize?: LocalVideoTileSize;\n}\n\n/* @conditional-compile-remove(pinned-participants) */\n/**\n * Properties for showing contextual menu for remote {@link VideoTile} components in {@link VideoGallery}.\n *\n * @beta\n */\nexport interface VideoTileContextualMenuProps {\n /**\n * The menu property kind\n */\n kind: 'contextual';\n}\n\n/* @conditional-compile-remove(pinned-participants) */\n/**\n * Properties for showing drawer menu on remote {@link VideoTile} long touch in {@link VideoGallery}.\n *\n * @beta\n */\nexport interface VideoTileDrawerMenuProps {\n /**\n * The menu property kind\n */\n kind: 'drawer';\n /**\n * The optional id property provided on an element that the drawer menu should render within when a\n * remote participant video tile Drawer is shown. If an id is not provided, then a drawer menu will\n * render within the VideoGallery component.\n */\n hostId?: string;\n}\n/**\n * VideoGallery represents a layout of video tiles for a specific call.\n * It displays a {@link VideoTile} for the local user as well as for each remote participant who has joined the call.\n *\n * @public\n */\nexport const VideoGallery = (props: VideoGalleryProps): JSX.Element => {\n const {\n localParticipant,\n remoteParticipants = [],\n localVideoViewOptions,\n remoteVideoViewOptions,\n dominantSpeakers,\n onRenderLocalVideoTile,\n onRenderRemoteVideoTile,\n onCreateLocalStreamView,\n onDisposeLocalStreamView,\n onCreateRemoteStreamView,\n onDisposeRemoteStreamView,\n styles,\n layout,\n onRenderAvatar,\n showMuteIndicator,\n maxRemoteVideoStreams = DEFAULT_MAX_REMOTE_VIDEO_STREAMS,\n showCameraSwitcherInLocalPreview,\n localVideoCameraCycleButtonProps,\n /* @conditional-compile-remove(pinned-participants) */\n onPinParticipant: onPinParticipantHandler,\n /* @conditional-compile-remove(pinned-participants) */\n onUnpinParticipant: onUnpinParticipantHandler,\n /* @conditional-compile-remove(pinned-participants) */\n remoteVideoTileMenuOptions = DEFAULT_REMOTE_VIDEO_TILE_MENU_OPTIONS,\n /* @conditional-compile-remove(vertical-gallery) */\n overflowGalleryPosition = 'HorizontalBottom',\n /* @conditional-compile-remove(click-to-call) */\n localVideoTileSize = 'followDeviceOrientation'\n } = props;\n\n const ids = useIdentifiers();\n const theme = useTheme();\n const localeStrings = useLocale().strings.videoGallery;\n const strings = useMemo(() => ({ ...localeStrings, ...props.strings }), [localeStrings, props.strings]);\n\n /* @conditional-compile-remove(pinned-participants) */\n const drawerMenuHostIdFromProp =\n remoteVideoTileMenuOptions && remoteVideoTileMenuOptions.kind === 'drawer'\n ? (remoteVideoTileMenuOptions as VideoTileDrawerMenuProps).hostId\n : undefined;\n /* @conditional-compile-remove(pinned-participants) */\n const drawerMenuHostId = useId('drawerMenuHost', drawerMenuHostIdFromProp);\n\n const shouldFloatLocalVideo = !!(layout === 'floatingLocalVideo' && remoteParticipants.length > 0);\n\n const containerRef = useRef<HTMLDivElement>(null);\n const containerWidth = _useContainerWidth(containerRef);\n const containerHeight = _useContainerHeight(containerRef);\n const isNarrow = containerWidth ? isNarrowWidth(containerWidth) : false;\n\n /* @conditional-compile-remove(pinned-participants) */\n const [pinnedParticipantsState, setPinnedParticipantsState] = React.useState<string[]>([]);\n /* @conditional-compile-remove(pinned-participants) */\n useEffect(() => {\n props.pinnedParticipants?.forEach((pinParticipant) => {\n if (!props.remoteParticipants?.find((t) => t.userId === pinParticipant)) {\n // warning will be logged in the console when invalid participant id is passed in pinned participants\n console.warn('Invalid pinned participant UserId :' + pinParticipant);\n }\n });\n }, [props.pinnedParticipants, props.remoteParticipants]);\n /* @conditional-compile-remove(pinned-participants) */\n // Use pinnedParticipants from props but if it is not defined use the maintained state of pinned participants\n const pinnedParticipants = props.pinnedParticipants ?? pinnedParticipantsState;\n\n /* @conditional-compile-remove(rooms) */\n const permissions = _usePermissions();\n\n /**\n * Utility function for memoized rendering of LocalParticipant.\n */\n const localVideoTile = useMemo((): JSX.Element /* @conditional-compile-remove(rooms) */ | undefined => {\n /* @conditional-compile-remove(rooms) */\n if (!permissions.cameraButton || /* @conditional-compile-remove(click-to-call) */ localVideoTileSize === 'hidden') {\n return undefined;\n }\n if (onRenderLocalVideoTile) {\n return onRenderLocalVideoTile(localParticipant);\n }\n\n const localVideoTileStyles = concatStyleSets(\n shouldFloatLocalVideo ? floatingLocalVideoTileStyle : {},\n {\n root: { borderRadius: theme.effects.roundedCorner4 }\n },\n styles?.localVideo\n );\n\n const initialsName = !localParticipant.displayName ? '' : localParticipant.displayName;\n\n return (\n <Stack key=\"local-video-tile-key\" tabIndex={0} aria-label={strings.localVideoMovementLabel} role={'dialog'}>\n <_LocalVideoTile\n userId={localParticipant.userId}\n onCreateLocalStreamView={onCreateLocalStreamView}\n onDisposeLocalStreamView={onDisposeLocalStreamView}\n isAvailable={localParticipant?.videoStream?.isAvailable}\n isMuted={localParticipant.isMuted}\n renderElement={localParticipant?.videoStream?.renderElement}\n displayName={isNarrow ? '' : strings.localVideoLabel}\n initialsName={initialsName}\n localVideoViewOptions={localVideoViewOptions}\n onRenderAvatar={onRenderAvatar}\n showLabel={\n !(\n (shouldFloatLocalVideo && isNarrow) ||\n /*@conditional-compile-remove(click-to-call) */ localVideoTileSize === '9:16'\n )\n }\n showMuteIndicator={showMuteIndicator}\n showCameraSwitcherInLocalPreview={showCameraSwitcherInLocalPreview}\n localVideoCameraCycleButtonProps={localVideoCameraCycleButtonProps}\n localVideoCameraSwitcherLabel={strings.localVideoCameraSwitcherLabel}\n localVideoSelectedDescription={strings.localVideoSelectedDescription}\n styles={localVideoTileStyles}\n />\n </Stack>\n );\n }, [\n isNarrow,\n localParticipant,\n localVideoCameraCycleButtonProps,\n localVideoViewOptions,\n onCreateLocalStreamView,\n onDisposeLocalStreamView,\n onRenderAvatar,\n onRenderLocalVideoTile,\n shouldFloatLocalVideo,\n showCameraSwitcherInLocalPreview,\n showMuteIndicator,\n strings.localVideoCameraSwitcherLabel,\n strings.localVideoLabel,\n strings.localVideoMovementLabel,\n strings.localVideoSelectedDescription,\n styles?.localVideo,\n theme.effects.roundedCorner4,\n /* @conditional-compile-remove(rooms) */ permissions.cameraButton,\n /* @conditional-compile-remove(click-to-call) */ localVideoTileSize\n ]);\n\n /* @conditional-compile-remove(pinned-participants) */\n const onPinParticipant = useCallback(\n (userId: string) => {\n if (pinnedParticipants.length >= MAX_PINNED_REMOTE_VIDEO_TILES) {\n return;\n }\n if (!pinnedParticipantsState.includes(userId)) {\n setPinnedParticipantsState(pinnedParticipantsState.concat(userId));\n }\n onPinParticipantHandler?.(userId);\n },\n [pinnedParticipants.length, pinnedParticipantsState, setPinnedParticipantsState, onPinParticipantHandler]\n );\n /* @conditional-compile-remove(pinned-participants) */\n const onUnpinParticipant = useCallback(\n (userId: string) => {\n setPinnedParticipantsState(pinnedParticipantsState.filter((p) => p !== userId));\n onUnpinParticipantHandler?.(userId);\n },\n [pinnedParticipantsState, setPinnedParticipantsState, onUnpinParticipantHandler]\n );\n\n /* @conditional-compile-remove(pinned-participants) */\n const [announcementString, setAnnouncementString] = React.useState<string>('');\n /* @conditional-compile-remove(pinned-participants) */\n /**\n * sets the announcement string for VideoGallery actions so that the screenreader will trigger\n */\n const toggleAnnouncerString = useCallback(\n (announcement) => {\n setAnnouncementString(announcement);\n /**\n * Clears the announcer string after VideoGallery action allowing it to be re-announced.\n */\n setTimeout(() => {\n setAnnouncementString('');\n }, 3000);\n },\n [setAnnouncementString]\n );\n\n const defaultOnRenderVideoTile = useCallback(\n (participant: VideoGalleryRemoteParticipant, isVideoParticipant?: boolean) => {\n const remoteVideoStream = participant.videoStream;\n\n /* @conditional-compile-remove(pinned-participants) */\n const isPinned = pinnedParticipants?.includes(participant.userId);\n\n return (\n <_RemoteVideoTile\n key={participant.userId}\n userId={participant.userId}\n remoteParticipant={participant}\n onCreateRemoteStreamView={isVideoParticipant ? onCreateRemoteStreamView : undefined}\n onDisposeRemoteStreamView={isVideoParticipant ? onDisposeRemoteStreamView : undefined}\n isAvailable={isVideoParticipant ? remoteVideoStream?.isAvailable : false}\n isReceiving={isVideoParticipant ? remoteVideoStream?.isReceiving : false}\n renderElement={isVideoParticipant ? remoteVideoStream?.renderElement : undefined}\n remoteVideoViewOptions={isVideoParticipant ? remoteVideoViewOptions : undefined}\n onRenderAvatar={onRenderAvatar}\n showMuteIndicator={showMuteIndicator}\n strings={strings}\n /* @conditional-compile-remove(PSTN-calls) */\n participantState={participant.state}\n /* @conditional-compile-remove(pinned-participants) */\n menuKind={\n remoteVideoTileMenuOptions\n ? remoteVideoTileMenuOptions.kind === 'drawer'\n ? 'drawer'\n : 'contextual'\n : undefined\n }\n /* @conditional-compile-remove(pinned-participants) */\n drawerMenuHostId={drawerMenuHostId}\n /* @conditional-compile-remove(pinned-participants) */\n onPinParticipant={onPinParticipant}\n /* @conditional-compile-remove(pinned-participants) */\n onUnpinParticipant={onUnpinParticipant}\n /* @conditional-compile-remove(pinned-participants) */\n isPinned={isPinned}\n /* @conditional-compile-remove(pinned-participants) */\n disablePinMenuItem={pinnedParticipants.length >= MAX_PINNED_REMOTE_VIDEO_TILES}\n /* @conditional-compile-remove(pinned-participants) */\n toggleAnnouncerString={toggleAnnouncerString}\n />\n );\n },\n [\n onCreateRemoteStreamView,\n onDisposeRemoteStreamView,\n remoteVideoViewOptions,\n onRenderAvatar,\n showMuteIndicator,\n strings,\n /* @conditional-compile-remove(pinned-participants) */ drawerMenuHostId,\n /* @conditional-compile-remove(pinned-participants) */ remoteVideoTileMenuOptions,\n /* @conditional-compile-remove(pinned-participants) */ pinnedParticipants,\n /* @conditional-compile-remove(pinned-participants) */ onPinParticipant,\n /* @conditional-compile-remove(pinned-participants) */ onUnpinParticipant,\n /* @conditional-compile-remove(pinned-participants) */ toggleAnnouncerString\n ]\n );\n\n const screenShareParticipant = remoteParticipants.find((participant) => participant.screenShareStream?.isAvailable);\n\n const localScreenShareStreamComponent = <LocalScreenShare localParticipant={localParticipant} />;\n\n const remoteScreenShareComponent = screenShareParticipant && (\n <RemoteScreenShare\n {...screenShareParticipant}\n renderElement={screenShareParticipant.screenShareStream?.renderElement}\n onCreateRemoteStreamView={onCreateRemoteStreamView}\n onDisposeRemoteStreamView={onDisposeRemoteStreamView}\n isReceiving={screenShareParticipant.screenShareStream?.isReceiving}\n />\n );\n\n const screenShareComponent = remoteScreenShareComponent\n ? remoteScreenShareComponent\n : localParticipant.isScreenSharingOn\n ? localScreenShareStreamComponent\n : undefined;\n\n const layoutProps = useMemo(\n () => ({\n remoteParticipants,\n screenShareComponent,\n showCameraSwitcherInLocalPreview,\n maxRemoteVideoStreams,\n dominantSpeakers,\n styles,\n onRenderRemoteParticipant: onRenderRemoteVideoTile ?? defaultOnRenderVideoTile,\n localVideoComponent: localVideoTile,\n parentWidth: containerWidth,\n parentHeight: containerHeight,\n /* @conditional-compile-remove(pinned-participants) */ pinnedParticipantUserIds: pinnedParticipants,\n /* @conditional-compile-remove(vertical-gallery) */ overflowGalleryPosition,\n /* @conditional-compile-remove(click-to-call) */ localVideoTileSize\n }),\n [\n remoteParticipants,\n screenShareComponent,\n showCameraSwitcherInLocalPreview,\n maxRemoteVideoStreams,\n dominantSpeakers,\n styles,\n localVideoTile,\n containerWidth,\n containerHeight,\n onRenderRemoteVideoTile,\n defaultOnRenderVideoTile,\n /* @conditional-compile-remove(pinned-participants) */ pinnedParticipants,\n /* @conditional-compile-remove(vertical-gallery) */ overflowGalleryPosition,\n /* @conditional-compile-remove(click-to-call) */ localVideoTileSize\n ]\n );\n\n const videoGalleryLayout = useMemo(() => {\n if (layout === 'floatingLocalVideo') {\n return <FloatingLocalVideoLayout {...layoutProps} />;\n }\n return <DefaultLayout {...layoutProps} />;\n }, [layout, layoutProps]);\n\n return (\n <div\n /* @conditional-compile-remove(pinned-participants) */\n // We don't assign an drawer menu host id to the VideoGallery when a drawerMenuHostId is assigned from props\n id={drawerMenuHostIdFromProp ? undefined : drawerMenuHostId}\n data-ui-id={ids.videoGallery}\n ref={containerRef}\n className={mergeStyles(videoGalleryOuterDivStyle, styles?.root, unselectable)}\n >\n {videoGalleryLayout}\n {\n /* @conditional-compile-remove(pinned-participants) */\n <Announcer announcementString={announcementString} ariaLive=\"polite\" />\n }\n </div>\n );\n};\n\"../../../acs-ui-common/src\""]}
1
+ {"version":3,"file":"VideoGallery.js","sourceRoot":"","sources":["../../../../../../react-components/src/components/VideoGallery.tsx"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EAAE,eAAe,EAAU,WAAW,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AAC9E,OAAO,KAAK,EAAE,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAE5D,sDAAsD;AACtD,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,sDAAsD;AACtD,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAClC,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAUtC,OAAO,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AACrD,OAAO,EAAE,aAAa,EAAE,mBAAmB,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAC5F,OAAO,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AACnE,OAAO,EAAE,iBAAiB,EAAE,MAAM,kCAAkC,CAAC;AAIrE,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AACnD,wCAAwC;AACxC,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AACjD,OAAO,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAC7D,OAAO,EAAE,wBAAwB,EAAE,MAAM,yCAAyC,CAAC;AACnF,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAChD,OAAO,EAAE,yBAAyB,EAAE,MAAM,8BAA8B,CAAC;AACzE,OAAO,EAAE,2BAA2B,EAAE,MAAM,iDAAiD,CAAC;AAC9F,sDAAsD;AACtD,OAAO,EAAE,KAAK,EAAE,MAAM,uBAAuB,C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AAsD;QACtD,oBAAC,SAAS,IAAC,kBAAkB,EAAE,kBAAkB,EAAE,QAAQ,EAAC,QAAQ,GAAG,CAErE,CACP,CAAC;AACJ,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { concatStyleSets, IStyle, mergeStyles, Stack } from '@fluentui/react';\nimport React, { useCallback, useMemo, useRef } from 'react';\nimport { GridLayoutStyles } from '.';\n/* @conditional-compile-remove(pinned-participants) */\nimport { Announcer } from './Announcer';\n/* @conditional-compile-remove(pinned-participants) */\nimport { useEffect } from 'react';\nimport { useLocale } from '../localization';\nimport { useTheme } from '../theming';\nimport {\n BaseCustomStyles,\n OnRenderAvatarCallback,\n VideoGalleryLocalParticipant,\n VideoGalleryRemoteParticipant,\n VideoStreamOptions,\n CreateVideoStreamViewResult\n} from '../types';\nimport { HorizontalGalleryStyles } from './HorizontalGallery';\nimport { _RemoteVideoTile } from './RemoteVideoTile';\nimport { isNarrowWidth, _useContainerHeight, _useContainerWidth } from './utils/responsive';\nimport { LocalScreenShare } from './VideoGallery/LocalScreenShare';\nimport { RemoteScreenShare } from './VideoGallery/RemoteScreenShare';\nimport { LocalVideoCameraCycleButtonProps } from './LocalVideoCameraButton';\nimport { _ICoordinates, _ModalClone } from './ModalClone/ModalClone';\nimport { _formatString } from '@internal/acs-ui-common';\nimport { _LocalVideoTile } from './LocalVideoTile';\n/* @conditional-compile-remove(rooms) */\nimport { _usePermissions } from '../permissions';\nimport { DefaultLayout } from './VideoGallery/DefaultLayout';\nimport { FloatingLocalVideoLayout } from './VideoGallery/FloatingLocalVideoLayout';\nimport { useIdentifiers } from '../identifiers';\nimport { videoGalleryOuterDivStyle } from './styles/VideoGallery.styles';\nimport { floatingLocalVideoTileStyle } from './VideoGallery/styles/FloatingLocalVideo.styles';\n/* @conditional-compile-remove(pinned-participants) */\nimport { useId } from '@fluentui/react-hooks';\n/* @conditional-compile-remove(vertical-gallery) */\nimport { VerticalGalleryStyles } from './VerticalGallery';\n\n/**\n * @private\n * Currently the Calling JS SDK supports up to 4 remote video streams\n */\nexport const DEFAULT_MAX_REMOTE_VIDEO_STREAMS = 4;\n\n/**\n * @private\n * Styles to disable the selectivity of a text in video gallery\n */\nexport const unselectable = {\n '-webkit-user-select': 'none',\n '-webkit-touch-callout': 'none',\n '-moz-user-select': 'none',\n '-ms-user-select': 'none',\n 'user-select': 'none'\n};\n/**\n * @private\n * Set aside only 6 dominant speakers for remaining audio participants\n */\nexport const MAX_AUDIO_DOMINANT_SPEAKERS = 6;\n/**\n * @private\n * Default remote video tile menu options\n */\nexport const DEFAULT_REMOTE_VIDEO_TILE_MENU_OPTIONS = {\n kind: 'contextual'\n};\n\n/* @conditional-compile-remove(pinned-participants) */\n/**\n * @private\n * Maximum number of remote video tiles that can be pinned\n */\nexport const MAX_PINNED_REMOTE_VIDEO_TILES = 4;\n\n/**\n * All strings that may be shown on the UI in the {@link VideoGallery}.\n *\n * @public\n */\nexport interface VideoGalleryStrings {\n /** String to notify that local user is sharing their screen */\n screenIsBeingSharedMessage: string;\n /** String to show when remote screen share stream is loading */\n screenShareLoadingMessage: string;\n /** String for local video label. Default is \"You\" */\n localVideoLabel: string;\n /** String for local video camera switcher */\n localVideoCameraSwitcherLabel: string;\n /** String for announcing the local video tile can be moved by keyboard controls */\n localVideoMovementLabel: string;\n /** String for announcing the selected camera */\n localVideoSelectedDescription: string;\n /** placeholder text for participants who does not have a display name*/\n displayNamePlaceholder: string;\n /* @conditional-compile-remove(pinned-participants) */\n /** Menu text shown in Video Tile contextual menu for setting a remote participants video to fit in frame */\n fitRemoteParticipantToFrame: string;\n /* @conditional-compile-remove(pinned-participants) */\n /** Menu text shown in Video Tile contextual menu for setting a remote participants video to fill the frame */\n fillRemoteParticipantFrame: string;\n /* @conditional-compile-remove(pinned-participants) */\n /** Menu text shown in Video Tile contextual menu for pinning a remote participant's video tile */\n pinParticipantForMe: string;\n /* @conditional-compile-remove(pinned-participants) */\n /** Menu text shown in Video Tile contextual menu for setting a remote participant's video tile */\n unpinParticipantForMe: string;\n /* @conditional-compile-remove(pinned-participants) */\n /** Aria label for pin participant menu item of remote participant's video tile */\n pinParticipantMenuItemAriaLabel: string;\n /* @conditional-compile-remove(pinned-participants) */\n /** Aria label for unpin participant menu item of remote participant's video tile */\n unpinParticipantMenuItemAriaLabel: string;\n /* @conditional-compile-remove(pinned-participants) */\n /** Aria label to announce when remote participant's video tile is pinned */\n pinnedParticipantAnnouncementAriaLabel: string;\n /* @conditional-compile-remove(pinned-participants) */\n /** Aria label to announce when remote participant's video tile is unpinned */\n unpinnedParticipantAnnouncementAriaLabel: string;\n}\n\n/**\n * @public\n */\nexport type VideoGalleryLayout = 'default' | 'floatingLocalVideo';\n\n/**\n * {@link VideoGallery} Component Styles.\n * @public\n */\nexport interface VideoGalleryStyles extends BaseCustomStyles {\n /** Styles for the grid layout */\n gridLayout?: GridLayoutStyles;\n /** Styles for the horizontal gallery */\n horizontalGallery?: HorizontalGalleryStyles;\n /** Styles for the local video */\n localVideo?: IStyle;\n /* @conditional-compile-remove(vertical-gallery) */\n /** Styles for the vertical gallery */\n verticalGallery?: VerticalGalleryStyles;\n}\n\n/* @conditional-compile-remove(vertical-gallery) */\n/**\n * Different modes and positions of the overflow gallery in the VideoGallery\n *\n * @beta\n */\nexport type OverflowGalleryPosition = 'HorizontalBottom' | 'VerticalRight';\n\n/* @conditional-compile-remove(click-to-call) */\n/**\n * different modes of the local video tile\n *\n * @beta\n */\nexport type LocalVideoTileSize = '9:16' | '16:9' | 'hidden' | 'followDeviceOrientation';\n\n/**\n * Props for {@link VideoGallery}.\n *\n * @public\n */\nexport interface VideoGalleryProps {\n /**\n * Allows users to pass an object containing custom CSS styles for the gallery container.\n *\n * @Example\n * ```\n * <VideoGallery styles={{ root: { border: 'solid 1px red' } }} />\n * ```\n */\n styles?: VideoGalleryStyles;\n /** Layout of the video tiles. */\n layout?: VideoGalleryLayout;\n /** Local video particpant */\n localParticipant: VideoGalleryLocalParticipant;\n /** List of remote video particpants */\n remoteParticipants?: VideoGalleryRemoteParticipant[];\n /** List of dominant speaker userIds in the order of their dominance. 0th index is the most dominant. */\n dominantSpeakers?: string[];\n /** Local video view options */\n localVideoViewOptions?: VideoStreamOptions;\n /** Remote videos view options */\n remoteVideoViewOptions?: VideoStreamOptions;\n /** Callback to create the local video stream view */\n onCreateLocalStreamView?: (options?: VideoStreamOptions) => Promise<void | CreateVideoStreamViewResult>;\n /** Callback to dispose of the local video stream view */\n onDisposeLocalStreamView?: () => void;\n /** Callback to render the local video tile*/\n onRenderLocalVideoTile?: (localParticipant: VideoGalleryLocalParticipant) => JSX.Element;\n /** Callback to create a remote video stream view */\n onCreateRemoteStreamView?: (\n userId: string,\n options?: VideoStreamOptions\n ) => Promise<void | CreateVideoStreamViewResult>;\n /** Callback to render a remote video tile */\n onRenderRemoteVideoTile?: (remoteParticipant: VideoGalleryRemoteParticipant) => JSX.Element;\n /**\n * @deprecated use {@link onDisposeRemoteVideoStreamView} and {@link onDisposeRemoteScreenShareStreamView} instead\n *\n * Callback to dispose a remote video stream view\n */\n onDisposeRemoteStreamView?: (userId: string) => Promise<void>;\n /** Callback to dispose a remote video stream view */\n onDisposeRemoteVideoStreamView?: (userId: string) => Promise<void>;\n /** Callback to dispose a remote screen share stream view */\n onDisposeRemoteScreenShareStreamView?: (userId: string) => Promise<void>;\n /** Callback to render a particpant avatar */\n onRenderAvatar?: OnRenderAvatarCallback;\n /**\n * Whether to display the local video camera switcher button\n */\n showCameraSwitcherInLocalPreview?: boolean;\n /**\n * Whether to display a mute icon beside the user's display name.\n * @defaultValue `true`\n */\n showMuteIndicator?: boolean;\n /** Optional strings to override in component */\n strings?: Partial<VideoGalleryStrings>;\n /**\n * Maximum number of participant remote video streams that is rendered.\n * @defaultValue 4\n */\n maxRemoteVideoStreams?: number;\n /**\n * Camera control information for button to switch cameras.\n */\n localVideoCameraCycleButtonProps?: LocalVideoCameraCycleButtonProps;\n /* @conditional-compile-remove(pinned-participants) */\n /**\n * List of pinned participant userIds.\n */\n pinnedParticipants?: string[];\n /* @conditional-compile-remove(pinned-participants) */\n /**\n * This callback will be called when a participant video tile is pinned.\n */\n onPinParticipant?: (userId: string) => void;\n /* @conditional-compile-remove(pinned-participants) */\n /**\n * This callback will be called when a participant video tile is un-pinned.\n */\n onUnpinParticipant?: (userId: string) => void;\n /* @conditional-compile-remove(pinned-participants) */\n /**\n * Options for showing the remote video tile menu.\n *\n * @defaultValue \\{ kind: 'contextual' \\}\n */\n remoteVideoTileMenuOptions?: false | VideoTileContextualMenuProps | VideoTileDrawerMenuProps;\n /* @conditional-compile-remove(vertical-gallery) */\n /**\n * Determines the layout of the overflowGallery inside the VideoGallery.\n * @defaultValue 'HorizontalBottom'\n */\n overflowGalleryPosition?: OverflowGalleryPosition;\n /* @conditional-compile-remove(click-to-call) */\n /**\n * Determines the aspect ratio of local video tile in the video gallery.\n * @remarks 'followDeviceOrientation' will be responsive to the screen orientation and will change between 9:16 (portrait) and\n * 16:9 (landscape) aspect ratios.\n * @defaultValue 'followDeviceOrientation'\n */\n localVideoTileSize?: LocalVideoTileSize;\n}\n\n/* @conditional-compile-remove(pinned-participants) */\n/**\n * Properties for showing contextual menu for remote {@link VideoTile} components in {@link VideoGallery}.\n *\n * @beta\n */\nexport interface VideoTileContextualMenuProps {\n /**\n * The menu property kind\n */\n kind: 'contextual';\n}\n\n/* @conditional-compile-remove(pinned-participants) */\n/**\n * Properties for showing drawer menu on remote {@link VideoTile} long touch in {@link VideoGallery}.\n *\n * @beta\n */\nexport interface VideoTileDrawerMenuProps {\n /**\n * The menu property kind\n */\n kind: 'drawer';\n /**\n * The optional id property provided on an element that the drawer menu should render within when a\n * remote participant video tile Drawer is shown. If an id is not provided, then a drawer menu will\n * render within the VideoGallery component.\n */\n hostId?: string;\n}\n/**\n * VideoGallery represents a layout of video tiles for a specific call.\n * It displays a {@link VideoTile} for the local user as well as for each remote participant who has joined the call.\n *\n * @public\n */\nexport const VideoGallery = (props: VideoGalleryProps): JSX.Element => {\n const {\n localParticipant,\n remoteParticipants = [],\n localVideoViewOptions,\n remoteVideoViewOptions,\n dominantSpeakers,\n onRenderLocalVideoTile,\n onRenderRemoteVideoTile,\n onCreateLocalStreamView,\n onDisposeLocalStreamView,\n onCreateRemoteStreamView,\n onDisposeRemoteScreenShareStreamView,\n onDisposeRemoteVideoStreamView,\n styles,\n layout,\n onRenderAvatar,\n showMuteIndicator,\n maxRemoteVideoStreams = DEFAULT_MAX_REMOTE_VIDEO_STREAMS,\n showCameraSwitcherInLocalPreview,\n localVideoCameraCycleButtonProps,\n /* @conditional-compile-remove(pinned-participants) */\n onPinParticipant: onPinParticipantHandler,\n /* @conditional-compile-remove(pinned-participants) */\n onUnpinParticipant: onUnpinParticipantHandler,\n /* @conditional-compile-remove(pinned-participants) */\n remoteVideoTileMenuOptions = DEFAULT_REMOTE_VIDEO_TILE_MENU_OPTIONS,\n /* @conditional-compile-remove(vertical-gallery) */\n overflowGalleryPosition = 'HorizontalBottom',\n /* @conditional-compile-remove(click-to-call) */\n localVideoTileSize = 'followDeviceOrientation'\n } = props;\n\n const ids = useIdentifiers();\n const theme = useTheme();\n const localeStrings = useLocale().strings.videoGallery;\n const strings = useMemo(() => ({ ...localeStrings, ...props.strings }), [localeStrings, props.strings]);\n\n /* @conditional-compile-remove(pinned-participants) */\n const drawerMenuHostIdFromProp =\n remoteVideoTileMenuOptions && remoteVideoTileMenuOptions.kind === 'drawer'\n ? (remoteVideoTileMenuOptions as VideoTileDrawerMenuProps).hostId\n : undefined;\n /* @conditional-compile-remove(pinned-participants) */\n const drawerMenuHostId = useId('drawerMenuHost', drawerMenuHostIdFromProp);\n\n const shouldFloatLocalVideo = !!(layout === 'floatingLocalVideo' && remoteParticipants.length > 0);\n\n const containerRef = useRef<HTMLDivElement>(null);\n const containerWidth = _useContainerWidth(containerRef);\n const containerHeight = _useContainerHeight(containerRef);\n const isNarrow = containerWidth ? isNarrowWidth(containerWidth) : false;\n\n /* @conditional-compile-remove(pinned-participants) */\n const [pinnedParticipantsState, setPinnedParticipantsState] = React.useState<string[]>([]);\n /* @conditional-compile-remove(pinned-participants) */\n useEffect(() => {\n props.pinnedParticipants?.forEach((pinParticipant) => {\n if (!props.remoteParticipants?.find((t) => t.userId === pinParticipant)) {\n // warning will be logged in the console when invalid participant id is passed in pinned participants\n console.warn('Invalid pinned participant UserId :' + pinParticipant);\n }\n });\n }, [props.pinnedParticipants, props.remoteParticipants]);\n /* @conditional-compile-remove(pinned-participants) */\n // Use pinnedParticipants from props but if it is not defined use the maintained state of pinned participants\n const pinnedParticipants = props.pinnedParticipants ?? pinnedParticipantsState;\n\n /* @conditional-compile-remove(rooms) */\n const permissions = _usePermissions();\n\n /**\n * Utility function for memoized rendering of LocalParticipant.\n */\n const localVideoTile = useMemo((): JSX.Element /* @conditional-compile-remove(rooms) */ | undefined => {\n /* @conditional-compile-remove(rooms) */\n if (!permissions.cameraButton || /* @conditional-compile-remove(click-to-call) */ localVideoTileSize === 'hidden') {\n return undefined;\n }\n if (onRenderLocalVideoTile) {\n return onRenderLocalVideoTile(localParticipant);\n }\n\n const localVideoTileStyles = concatStyleSets(\n shouldFloatLocalVideo ? floatingLocalVideoTileStyle : {},\n {\n root: { borderRadius: theme.effects.roundedCorner4 }\n },\n styles?.localVideo\n );\n\n const initialsName = !localParticipant.displayName ? '' : localParticipant.displayName;\n\n return (\n <Stack key=\"local-video-tile-key\" tabIndex={0} aria-label={strings.localVideoMovementLabel} role={'dialog'}>\n <_LocalVideoTile\n userId={localParticipant.userId}\n onCreateLocalStreamView={onCreateLocalStreamView}\n onDisposeLocalStreamView={onDisposeLocalStreamView}\n isAvailable={localParticipant?.videoStream?.isAvailable}\n isMuted={localParticipant.isMuted}\n renderElement={localParticipant?.videoStream?.renderElement}\n displayName={isNarrow ? '' : strings.localVideoLabel}\n initialsName={initialsName}\n localVideoViewOptions={localVideoViewOptions}\n onRenderAvatar={onRenderAvatar}\n showLabel={\n !(\n (shouldFloatLocalVideo && isNarrow) ||\n /*@conditional-compile-remove(click-to-call) */ localVideoTileSize === '9:16'\n )\n }\n showMuteIndicator={showMuteIndicator}\n showCameraSwitcherInLocalPreview={showCameraSwitcherInLocalPreview}\n localVideoCameraCycleButtonProps={localVideoCameraCycleButtonProps}\n localVideoCameraSwitcherLabel={strings.localVideoCameraSwitcherLabel}\n localVideoSelectedDescription={strings.localVideoSelectedDescription}\n styles={localVideoTileStyles}\n />\n </Stack>\n );\n }, [\n isNarrow,\n localParticipant,\n localVideoCameraCycleButtonProps,\n localVideoViewOptions,\n onCreateLocalStreamView,\n onDisposeLocalStreamView,\n onRenderAvatar,\n onRenderLocalVideoTile,\n shouldFloatLocalVideo,\n showCameraSwitcherInLocalPreview,\n showMuteIndicator,\n strings.localVideoCameraSwitcherLabel,\n strings.localVideoLabel,\n strings.localVideoMovementLabel,\n strings.localVideoSelectedDescription,\n styles?.localVideo,\n theme.effects.roundedCorner4,\n /* @conditional-compile-remove(rooms) */ permissions.cameraButton,\n /* @conditional-compile-remove(click-to-call) */ localVideoTileSize\n ]);\n\n /* @conditional-compile-remove(pinned-participants) */\n const onPinParticipant = useCallback(\n (userId: string) => {\n if (pinnedParticipants.length >= MAX_PINNED_REMOTE_VIDEO_TILES) {\n return;\n }\n if (!pinnedParticipantsState.includes(userId)) {\n setPinnedParticipantsState(pinnedParticipantsState.concat(userId));\n }\n onPinParticipantHandler?.(userId);\n },\n [pinnedParticipants.length, pinnedParticipantsState, setPinnedParticipantsState, onPinParticipantHandler]\n );\n /* @conditional-compile-remove(pinned-participants) */\n const onUnpinParticipant = useCallback(\n (userId: string) => {\n setPinnedParticipantsState(pinnedParticipantsState.filter((p) => p !== userId));\n onUnpinParticipantHandler?.(userId);\n },\n [pinnedParticipantsState, setPinnedParticipantsState, onUnpinParticipantHandler]\n );\n\n /* @conditional-compile-remove(pinned-participants) */\n const [announcementString, setAnnouncementString] = React.useState<string>('');\n /* @conditional-compile-remove(pinned-participants) */\n /**\n * sets the announcement string for VideoGallery actions so that the screenreader will trigger\n */\n const toggleAnnouncerString = useCallback(\n (announcement) => {\n setAnnouncementString(announcement);\n /**\n * Clears the announcer string after VideoGallery action allowing it to be re-announced.\n */\n setTimeout(() => {\n setAnnouncementString('');\n }, 3000);\n },\n [setAnnouncementString]\n );\n\n const defaultOnRenderVideoTile = useCallback(\n (participant: VideoGalleryRemoteParticipant, isVideoParticipant?: boolean) => {\n const remoteVideoStream = participant.videoStream;\n\n /* @conditional-compile-remove(pinned-participants) */\n const isPinned = pinnedParticipants?.includes(participant.userId);\n\n return (\n <_RemoteVideoTile\n key={participant.userId}\n userId={participant.userId}\n remoteParticipant={participant}\n onCreateRemoteStreamView={isVideoParticipant ? onCreateRemoteStreamView : undefined}\n onDisposeRemoteStreamView={isVideoParticipant ? onDisposeRemoteVideoStreamView : undefined}\n isAvailable={isVideoParticipant ? remoteVideoStream?.isAvailable : false}\n isReceiving={isVideoParticipant ? remoteVideoStream?.isReceiving : false}\n renderElement={isVideoParticipant ? remoteVideoStream?.renderElement : undefined}\n remoteVideoViewOptions={isVideoParticipant ? remoteVideoViewOptions : undefined}\n onRenderAvatar={onRenderAvatar}\n showMuteIndicator={showMuteIndicator}\n strings={strings}\n /* @conditional-compile-remove(PSTN-calls) */\n participantState={participant.state}\n /* @conditional-compile-remove(pinned-participants) */\n menuKind={\n remoteVideoTileMenuOptions\n ? remoteVideoTileMenuOptions.kind === 'drawer'\n ? 'drawer'\n : 'contextual'\n : undefined\n }\n /* @conditional-compile-remove(pinned-participants) */\n drawerMenuHostId={drawerMenuHostId}\n /* @conditional-compile-remove(pinned-participants) */\n onPinParticipant={onPinParticipant}\n /* @conditional-compile-remove(pinned-participants) */\n onUnpinParticipant={onUnpinParticipant}\n /* @conditional-compile-remove(pinned-participants) */\n isPinned={isPinned}\n /* @conditional-compile-remove(pinned-participants) */\n disablePinMenuItem={pinnedParticipants.length >= MAX_PINNED_REMOTE_VIDEO_TILES}\n /* @conditional-compile-remove(pinned-participants) */\n toggleAnnouncerString={toggleAnnouncerString}\n />\n );\n },\n [\n onCreateRemoteStreamView,\n onDisposeRemoteVideoStreamView,\n remoteVideoViewOptions,\n onRenderAvatar,\n showMuteIndicator,\n strings,\n /* @conditional-compile-remove(pinned-participants) */ drawerMenuHostId,\n /* @conditional-compile-remove(pinned-participants) */ remoteVideoTileMenuOptions,\n /* @conditional-compile-remove(pinned-participants) */ pinnedParticipants,\n /* @conditional-compile-remove(pinned-participants) */ onPinParticipant,\n /* @conditional-compile-remove(pinned-participants) */ onUnpinParticipant,\n /* @conditional-compile-remove(pinned-participants) */ toggleAnnouncerString\n ]\n );\n\n const screenShareParticipant = remoteParticipants.find((participant) => participant.screenShareStream?.isAvailable);\n\n const localScreenShareStreamComponent = <LocalScreenShare localParticipant={localParticipant} />;\n\n const remoteScreenShareComponent = screenShareParticipant && (\n <RemoteScreenShare\n {...screenShareParticipant}\n renderElement={screenShareParticipant.screenShareStream?.renderElement}\n onCreateRemoteStreamView={onCreateRemoteStreamView}\n onDisposeRemoteStreamView={onDisposeRemoteScreenShareStreamView}\n isReceiving={screenShareParticipant.screenShareStream?.isReceiving}\n />\n );\n\n const screenShareComponent = remoteScreenShareComponent\n ? remoteScreenShareComponent\n : localParticipant.isScreenSharingOn\n ? localScreenShareStreamComponent\n : undefined;\n\n const layoutProps = useMemo(\n () => ({\n remoteParticipants,\n screenShareComponent,\n showCameraSwitcherInLocalPreview,\n maxRemoteVideoStreams,\n dominantSpeakers,\n styles,\n onRenderRemoteParticipant: onRenderRemoteVideoTile ?? defaultOnRenderVideoTile,\n localVideoComponent: localVideoTile,\n parentWidth: containerWidth,\n parentHeight: containerHeight,\n /* @conditional-compile-remove(pinned-participants) */ pinnedParticipantUserIds: pinnedParticipants,\n /* @conditional-compile-remove(vertical-gallery) */ overflowGalleryPosition,\n /* @conditional-compile-remove(click-to-call) */ localVideoTileSize\n }),\n [\n remoteParticipants,\n screenShareComponent,\n showCameraSwitcherInLocalPreview,\n maxRemoteVideoStreams,\n dominantSpeakers,\n styles,\n localVideoTile,\n containerWidth,\n containerHeight,\n onRenderRemoteVideoTile,\n defaultOnRenderVideoTile,\n /* @conditional-compile-remove(pinned-participants) */ pinnedParticipants,\n /* @conditional-compile-remove(vertical-gallery) */ overflowGalleryPosition,\n /* @conditional-compile-remove(click-to-call) */ localVideoTileSize\n ]\n );\n\n const videoGalleryLayout = useMemo(() => {\n if (layout === 'floatingLocalVideo') {\n return <FloatingLocalVideoLayout {...layoutProps} />;\n }\n return <DefaultLayout {...layoutProps} />;\n }, [layout, layoutProps]);\n\n return (\n <div\n /* @conditional-compile-remove(pinned-participants) */\n // We don't assign an drawer menu host id to the VideoGallery when a drawerMenuHostId is assigned from props\n id={drawerMenuHostIdFromProp ? undefined : drawerMenuHostId}\n data-ui-id={ids.videoGallery}\n ref={containerRef}\n className={mergeStyles(videoGalleryOuterDivStyle, styles?.root, unselectable)}\n >\n {videoGalleryLayout}\n {\n /* @conditional-compile-remove(pinned-participants) */\n <Announcer announcementString={announcementString} ariaLive=\"polite\" />\n }\n </div>\n );\n};\n\"../../../acs-ui-common/src\""]}
@@ -61,15 +61,19 @@ export const VideoTile = (props) => {
61
61
  const [isHovered, setIsHovered] = useState(false);
62
62
  /* @conditional-compile-remove(pinned-participants) */
63
63
  const [isFocused, setIsFocused] = useState(false);
64
- const [personaSize, setPersonaSize] = useState();
64
+ // need to set a default otherwise the resizeObserver will get stuck in an infinite loop.
65
+ const [personaSize, setPersonaSize] = useState(1);
65
66
  const videoTileRef = useRef(null);
66
67
  const locale = useLocale();
67
68
  const theme = useTheme();
68
69
  const isVideoRendered = !!renderElement;
69
70
  const observer = useRef(new ResizeObserver((entries) => {
70
71
  const { width, height } = entries[0].contentRect;
71
- const personaSize = Math.min(width, height) / 3;
72
- setPersonaSize(Math.max(Math.min(personaSize, personaMaxSize), personaMinSize));
72
+ const personaCalcSize = Math.min(width, height) / 3;
73
+ // we only want to set the persona size if it has changed
74
+ if (personaCalcSize !== personaSize) {
75
+ setPersonaSize(Math.max(Math.min(personaCalcSize, personaMaxSize), personaMinSize));
76
+ }
73
77
  }));
74
78
  useLayoutEffect(() => {
75
79
  if (videoTileRef.current) {