@azure/communication-react 1.20.0-alpha-202410080015 → 1.20.0-alpha-202410100016
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/dist/dist-cjs/communication-react/{ChatMessageComponentAsRichTextEditBox-BwIa2hTH.js → ChatMessageComponentAsRichTextEditBox-Dk_okMwX.js} +2 -2
- package/dist/dist-cjs/communication-react/{ChatMessageComponentAsRichTextEditBox-BwIa2hTH.js.map → ChatMessageComponentAsRichTextEditBox-Dk_okMwX.js.map} +1 -1
- package/dist/dist-cjs/communication-react/{RichTextSendBoxWrapper-CMAkkxJl.js → RichTextSendBoxWrapper-C36s6eLH.js} +2 -2
- package/dist/dist-cjs/communication-react/{RichTextSendBoxWrapper-CMAkkxJl.js.map → RichTextSendBoxWrapper-C36s6eLH.js.map} +1 -1
- package/dist/dist-cjs/communication-react/{index-Bj4O6YVq.js → index-C548hWR1.js} +202 -181
- package/dist/dist-cjs/communication-react/index-C548hWR1.js.map +1 -0
- package/dist/dist-cjs/communication-react/index.js +1 -1
- package/dist/dist-esm/acs-ui-common/src/telemetryVersion.js +1 -1
- package/dist/dist-esm/acs-ui-common/src/telemetryVersion.js.map +1 -1
- package/dist/dist-esm/calling-component-bindings/src/baseSelectors.js +0 -1
- package/dist/dist-esm/calling-component-bindings/src/baseSelectors.js.map +1 -1
- package/dist/dist-esm/calling-stateful-client/src/CallClientState.js.map +1 -1
- package/dist/dist-esm/calling-stateful-client/src/CallContext.js +0 -3
- package/dist/dist-esm/calling-stateful-client/src/CallContext.js.map +1 -1
- package/dist/dist-esm/calling-stateful-client/src/CallDeclarativeCommon.js +0 -2
- package/dist/dist-esm/calling-stateful-client/src/CallDeclarativeCommon.js.map +1 -1
- package/dist/dist-esm/calling-stateful-client/src/CaptionsSubscriber.js +0 -7
- package/dist/dist-esm/calling-stateful-client/src/CaptionsSubscriber.js.map +1 -1
- package/dist/dist-esm/calling-stateful-client/src/Converter.js +0 -3
- package/dist/dist-esm/calling-stateful-client/src/Converter.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/Attachment/AttachmentCard.js +3 -2
- package/dist/dist-esm/react-components/src/components/Attachment/AttachmentCard.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/ChatMessage/ChatMessageContent.js +6 -3
- package/dist/dist-esm/react-components/src/components/ChatMessage/ChatMessageContent.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/Dialpad/Dialpad.js +6 -4
- package/dist/dist-esm/react-components/src/components/Dialpad/Dialpad.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/GridLayout.js +3 -0
- package/dist/dist-esm/react-components/src/components/GridLayout.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/HorizontalGallery.js +4 -5
- package/dist/dist-esm/react-components/src/components/HorizontalGallery.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/LocalVideoCameraButton.js +3 -0
- package/dist/dist-esm/react-components/src/components/LocalVideoCameraButton.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/MeetingConferencePhoneInfo.js +2 -1
- package/dist/dist-esm/react-components/src/components/MeetingConferencePhoneInfo.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/MessageThread.js +3 -3
- package/dist/dist-esm/react-components/src/components/MessageThread.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/ModalClone/ModalClone.js +2 -1
- package/dist/dist-esm/react-components/src/components/ModalClone/ModalClone.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/ParticipantItem.js +1 -1
- package/dist/dist-esm/react-components/src/components/ParticipantItem.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/ReactionButton.js +27 -35
- package/dist/dist-esm/react-components/src/components/ReactionButton.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/RichTextEditor/RichTextEditor.js +9 -3
- package/dist/dist-esm/react-components/src/components/RichTextEditor/RichTextEditor.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/TextFieldWithMention/TextFieldWithMention.js +1 -1
- package/dist/dist-esm/react-components/src/components/TextFieldWithMention/TextFieldWithMention.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/TextFieldWithMention/mentionTagUtils.js +10 -11
- package/dist/dist-esm/react-components/src/components/TextFieldWithMention/mentionTagUtils.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/VerticalGallery.js +2 -1
- package/dist/dist-esm/react-components/src/components/VerticalGallery.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/VideoEffects/VideoBackgroundEffectsPicker.js +3 -3
- package/dist/dist-esm/react-components/src/components/VideoEffects/VideoBackgroundEffectsPicker.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/VideoGallery/RemoteContentShareReactionOverlay.js +5 -4
- package/dist/dist-esm/react-components/src/components/VideoGallery/RemoteContentShareReactionOverlay.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/VideoGallery/utils/videoGalleryLayoutUtils.js +15 -18
- package/dist/dist-esm/react-components/src/components/VideoGallery/utils/videoGalleryLayoutUtils.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/VideoTile.js +3 -0
- package/dist/dist-esm/react-components/src/components/VideoTile.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/styles/ReactionButton.styles.d.ts +13 -6
- package/dist/dist-esm/react-components/src/components/styles/ReactionButton.styles.js +47 -19
- package/dist/dist-esm/react-components/src/components/styles/ReactionButton.styles.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/styles/ReactionOverlay.style.d.ts +0 -6
- package/dist/dist-esm/react-components/src/components/styles/ReactionOverlay.style.js +6 -41
- package/dist/dist-esm/react-components/src/components/styles/ReactionOverlay.style.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/utils/RichTextEditorUtils.js +4 -1
- package/dist/dist-esm/react-components/src/components/utils/RichTextEditorUtils.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/utils/RichTextTableUtils.js +3 -0
- package/dist/dist-esm/react-components/src/components/utils/RichTextTableUtils.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/utils/responsive.js +6 -0
- package/dist/dist-esm/react-components/src/components/utils/responsive.js.map +1 -1
- package/dist/dist-esm/react-components/src/gallery/dominantSpeaker.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/AzureCommunicationCallAdapter.js +0 -12
- package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/AzureCommunicationCallAdapter.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/components/CallArrangement.js +16 -22
- package/dist/dist-esm/react-composites/src/composites/CallComposite/components/CallArrangement.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/components/MediaGallery.js +9 -2
- package/dist/dist-esm/react-composites/src/composites/CallComposite/components/MediaGallery.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/selectors/baseSelectors.js +0 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/selectors/baseSelectors.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/common/ControlBar/CommonCallControlBar.js +1 -2
- package/dist/dist-esm/react-composites/src/composites/common/ControlBar/CommonCallControlBar.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/common/Drawer/MoreDrawer.js +1 -3
- package/dist/dist-esm/react-composites/src/composites/common/Drawer/MoreDrawer.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/common/types/CommonCallControlOptions.js.map +1 -1
- package/package.json +1 -1
- package/dist/dist-cjs/communication-react/index-Bj4O6YVq.js.map +0 -1
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"RichTextEditorUtils.js","sourceRoot":"","sources":["../../../../../../../react-components/src/components/utils/RichTextEditorUtils.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAIlC;;;GAGG;AACH,MAAM,CAAN,IAAY,eAWX;AAXD,WAAY,eAAe;IACzB,8CAA2B,CAAA;IAC3B,kDAA+B,CAAA;IAC/B,oDAAiC,CAAA;IACjC,wDAAqC,CAAA;IACrC,kCAAe,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C,CAAC;IACtD,CAAC,CAAC,CAAC;AACL,CAAC,CAAC;AAEF,gEAAgE;AAChE,MAAM,qBAAqB,GAAG,CAAC,mBAA2C,EAAE,OAAe,EAAQ,EAAE;IACnG,MAAM,OAAO,GAAG,mBAAmB,CAAC,OAAO,CAAC,CAAC;IAC7C,IAAI,OAAO,EAAE,CAAC;QACZ,GAAG,CAAC,eAAe,CAAC,OAAO,CAAC,CAAC;QAC7B,OAAO,mBAAmB,CAAC,OAAO,CAAC,CAAC;IACtC,CAAC;AACH,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { BorderFormat, DatasetFormat, ModelToDomContext } from 'roosterjs-content-model-types';\n\n/**\n * Plugin event type for RoosterJS plugins\n * @private\n */\nexport enum PluginEventType {\n EditorReady = 'editorReady',\n BeforeDispose = 'beforeDispose',\n ContentChanged = 'contentChanged',\n BeforeSetContent = 'beforeSetContent',\n Input = 'input',\n KeyDown = 'keyDown',\n BeforeCutCopy = 'beforeCutCopy',\n BeforePaste = 'beforePaste',\n ZoomChanged = 'zoomChanged',\n MouseUp = 'mouseUp'\n}\n\n/**\n * ContentChanged event source for RoosterJS\n * @private\n */\nexport enum ContentChangedEventSource {\n Paste = 'Paste'\n}\n\n/**\n * Applies the border format to the specified element.\n * If the element is an HTMLTableCellElement, it skips setting editing info\n * and to use classes instead of inline styles.\n * For all other cases, the default format applier is used.\n */\nexport const borderApplier = (format: BorderFormat, element: HTMLElement, context: ModelToDomContext): void => {\n if (element instanceof HTMLTableCellElement) {\n // don't set format for table cell\n // as it will set inline styles for them\n // we want to use classes instead\n } else if (context.defaultFormatAppliers.border) {\n // apply default formats for all other cases\n context.defaultFormatAppliers.border(format, element, context);\n }\n};\n\n/**\n * Applies the dataset format to the given HTML element.\n * If the element is an HTMLTableElement, it skips setting editing info\n * and to use classes instead of inline styles.\n * For all other cases, it applies the default formats.\n */\nexport const dataSetApplier = (format: DatasetFormat, element: HTMLElement, context: ModelToDomContext): void => {\n if (element instanceof HTMLTableElement) {\n // don't set editing info for tables\n // as it will set inline styles for them\n // we want to use classes instead\n } else if (context.defaultFormatAppliers.dataset) {\n // apply default formats for all other cases\n context.defaultFormatAppliers.dataset(format, element, context);\n }\n};\n\n/* @conditional-compile-remove(rich-text-editor-image-upload) */\n/**\n * @internal\n */\nexport const getPreviousInlineImages = (content?: string): Record<string, string>[] => {\n if (!content) {\n return [];\n }\n const previousInlineImages: Record<string, string>[] = [];\n const document = new DOMParser().parseFromString(content ?? '', 'text/html');\n document.querySelectorAll('img').forEach((img) => {\n const imageAttributes = getInlineImageAttributes(img);\n previousInlineImages.push(imageAttributes);\n });\n return previousInlineImages;\n};\n\n/* @conditional-compile-remove(rich-text-editor-image-upload) */\n/**\n * @internal\n */\nexport const getRemovedInlineImages = (\n content: string,\n previousInlineImages: Record<string, string>[]\n): Record<string, string>[] => {\n const document = new DOMParser().parseFromString(content ?? '', 'text/html');\n const currentContentIds = Array.from(document.querySelectorAll('img')).map((img) => img.id);\n previousInlineImages = previousInlineImages?.filter((img) => !currentContentIds?.includes(img.id));\n\n const removedInlineImages = [...previousInlineImages];\n return removedInlineImages;\n};\n\n/* @conditional-compile-remove(rich-text-editor-image-upload) */\n/**\n * @internal\n */\nexport const getInsertedInlineImages = (\n content: string,\n previousInlineImages: NodeListOf<HTMLImageElement>\n): HTMLImageElement[] => {\n const document = new DOMParser().parseFromString(content ?? '', 'text/html');\n const currentContentInlineImages = Array.from(document.querySelectorAll('img'));\n const previousContentIds = Array.from(previousInlineImages).map((img) => img.id);\n // if check is updated, also update getRemovedInlineImages\n const insertedInlineImages = currentContentInlineImages.filter((img) => !previousContentIds.includes(img.id));\n return insertedInlineImages;\n};\n\n/* @conditional-compile-remove(rich-text-editor-image-upload) */\n/**\n * @internal\n */\nexport const getInlineImageAttributes = (image: HTMLImageElement): Record<string, string> => {\n const imageAttributes: Record<string, string> = {};\n image.getAttributeNames().forEach((attrName) => {\n const attrValue = image.getAttribute(attrName);\n if (attrValue) {\n imageAttributes[attrName] = attrValue;\n }\n });\n return imageAttributes;\n};\n\n/* @conditional-compile-remove(rich-text-editor) */\n/**\n * @internal\n */\n/**\n * Update the scroll position of the editor to ensure the content is visible.\n */\nexport const scrollToBottomRichTextEditor = (): void => {\n // Get the current selection in the document\n const selection = document.getSelection();\n\n // Check if a selection exists and it has at least one range\n if (!selection || selection.rangeCount <= 0) {\n // If no selection or range, exit the function\n return;\n }\n\n // Get the first range of the selection\n // A user can normally only select one range at a time, so the rangeCount will usually be 1\n const range = selection.getRangeAt(0);\n\n // If the common ancestor container of the range is the document itself,\n // it might mean that the editable element is getting removed from the DOM\n // In such cases, especially in Safari, trying to modify the range might throw a HierarchyRequest error\n if (range.commonAncestorContainer === document) {\n return;\n }\n\n // Create a temporary span element to use as an anchor for scrolling\n // We can't use the anchor node directly because if it's a Text node, calling scrollIntoView() on it will throw an error\n const tempElement = document.createElement('span');\n // Collapse the range to its end point\n // This means the start and end points of the range will be the same, and it will not contain any content\n range.collapse(false);\n // Insert the temporary element at the cursor's position at the end of the range\n range.insertNode(tempElement);\n // Scroll the temporary element into view\n // the element will be aligned at the center of the scroll container, otherwise, text and images may be positioned incorrectly\n tempElement.scrollIntoView({\n block: 'center'\n });\n tempElement.remove();\n};\n\n/* @conditional-compile-remove(rich-text-editor-image-upload) */\n/**\n * Revoke the blob urls in the removedInlineImages and remove them from the currentLocalBlobMap\n * @internal\n */\nexport const removeLocalBlobs = (\n currentLocalBlobMap: Record<string, string>,\n removedInlineImages: Record<string, string>[]\n): void => {\n removedInlineImages.forEach((image) => {\n removeSingleLocalBlob(currentLocalBlobMap, image.id);\n });\n};\n\n/* @conditional-compile-remove(rich-text-editor-image-upload) */\n/**\n * Revoke all the blob urls in the currentLocalBlobMap and clean up the currentLocalBlobMap\n * @internal\n */\nexport const cleanAllLocalBlobs = (currentLocalBlobMap: Record<string, string>): void => {\n Object.keys(currentLocalBlobMap).forEach((imageId) => {\n removeSingleLocalBlob(currentLocalBlobMap, imageId);\n });\n};\n\n/* @conditional-compile-remove(rich-text-editor-image-upload) */\nconst removeSingleLocalBlob = (currentLocalBlobMap: Record<string, string>, imageId: string): void => {\n const blobUrl = currentLocalBlobMap[imageId];\n if (blobUrl) {\n URL.revokeObjectURL(blobUrl);\n delete currentLocalBlobMap[imageId];\n }\n};\n"]}
|
1
|
+
{"version":3,"file":"RichTextEditorUtils.js","sourceRoot":"","sources":["../../../../../../../react-components/src/components/utils/RichTextEditorUtils.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAIlC;;;GAGG;AACH,MAAM,CAAN,IAAY,eAWX;AAXD,WAAY,eAAe;IACzB,8CAA2B,CAAA;IAC3B,kDAA+B,CAAA;IAC/B,oDAAiC,CAAA;IACjC,wDAAqC,CAAA;IACrC,kCAAe,CAAA;IACf,sCAAmB,CAAA;IACnB,kDAA+B,CAAA;IAC/B,8CAA2B,CAAA;IAC3B,8CAA2B,CAAA;IAC3B,sCAAmB,CAAA;AACrB,CAAC,EAXW,eAAe,KAAf,eAAe,QAW1B;AAED;;;GAGG;AACH,MAAM,CAAN,IAAY,yBAEX;AAFD,WAAY,yBAAyB;IACnC,4CAAe,CAAA;AACjB,CAAC,EAFW,yBAAyB,KAAzB,yBAAyB,QAEpC;AAED;;;;;GAKG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,MAAoB,EAAE,OAAoB,EAAE,OAA0B,EAAQ,EAAE;IAC5G,IAAI,OAAO,YAAY,oBAAoB,EAAE,CAAC;QAC5C,kCAAkC;QAClC,wCAAwC;QACxC,iCAAiC;IACnC,CAAC;SAAM,IAAI,OAAO,CAAC,qBAAqB,CAAC,MAAM,EAAE,CAAC;QAChD,4CAA4C;QAC5C,OAAO,CAAC,qBAAqB,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;IACjE,CAAC;AACH,CAAC,CAAC;AAEF;;;;;GAKG;AACH,MAAM,CAAC,MAA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C;IACH,WAAW,CAAC,MAAM,EAAE,CAAC;AACvB,CAAC,CAAC;AAEF,gEAAgE;AAChE;;;GAGG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAC9B,mBAA2C,EAC3C,mBAA6C,EACvC,EAAE;IACR,mBAAmB,CAAC,OAAO,CAAC,CAAC,KAAK,EAAE,EAAE;QACpC,IAAI,CAAC,KAAK,CAAC,EAAE,EAAE,CAAC;YACd,OAAO;QACT,CAAC;QACD,qBAAqB,CAAC,mBAAmB,EAAE,KAAK,CAAC,EAAE,CAAC,CAAC;IACvD,CAAC,CAAC,CAAC;AACL,CAAC,CAAC;AAEF,gEAAgE;AAChE;;;GAGG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,mBAA2C,EAAQ,EAAE;IACtF,MAAM,CAAC,IAAI,CAAC,mBAAmB,CAAC,CAAC,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE;QACnD,qBAAqB,CAAC,mBAAmB,EAAE,OAAO,CAAC,CAAC;IACtD,CAAC,CAAC,CAAC;AACL,CAAC,CAAC;AAEF,gEAAgE;AAChE,MAAM,qBAAqB,GAAG,CAAC,mBAA2C,EAAE,OAAe,EAAQ,EAAE;IACnG,MAAM,OAAO,GAAG,mBAAmB,CAAC,OAAO,CAAC,CAAC;IAC7C,IAAI,OAAO,EAAE,CAAC;QACZ,GAAG,CAAC,eAAe,CAAC,OAAO,CAAC,CAAC;QAC7B,OAAO,mBAAmB,CAAC,OAAO,CAAC,CAAC;IACtC,CAAC;AACH,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { BorderFormat, DatasetFormat, ModelToDomContext } from 'roosterjs-content-model-types';\n\n/**\n * Plugin event type for RoosterJS plugins\n * @private\n */\nexport enum PluginEventType {\n EditorReady = 'editorReady',\n BeforeDispose = 'beforeDispose',\n ContentChanged = 'contentChanged',\n BeforeSetContent = 'beforeSetContent',\n Input = 'input',\n KeyDown = 'keyDown',\n BeforeCutCopy = 'beforeCutCopy',\n BeforePaste = 'beforePaste',\n ZoomChanged = 'zoomChanged',\n MouseUp = 'mouseUp'\n}\n\n/**\n * ContentChanged event source for RoosterJS\n * @private\n */\nexport enum ContentChangedEventSource {\n Paste = 'Paste'\n}\n\n/**\n * Applies the border format to the specified element.\n * If the element is an HTMLTableCellElement, it skips setting editing info\n * and to use classes instead of inline styles.\n * For all other cases, the default format applier is used.\n */\nexport const borderApplier = (format: BorderFormat, element: HTMLElement, context: ModelToDomContext): void => {\n if (element instanceof HTMLTableCellElement) {\n // don't set format for table cell\n // as it will set inline styles for them\n // we want to use classes instead\n } else if (context.defaultFormatAppliers.border) {\n // apply default formats for all other cases\n context.defaultFormatAppliers.border(format, element, context);\n }\n};\n\n/**\n * Applies the dataset format to the given HTML element.\n * If the element is an HTMLTableElement, it skips setting editing info\n * and to use classes instead of inline styles.\n * For all other cases, it applies the default formats.\n */\nexport const dataSetApplier = (format: DatasetFormat, element: HTMLElement, context: ModelToDomContext): void => {\n if (element instanceof HTMLTableElement) {\n // don't set editing info for tables\n // as it will set inline styles for them\n // we want to use classes instead\n } else if (context.defaultFormatAppliers.dataset) {\n // apply default formats for all other cases\n context.defaultFormatAppliers.dataset(format, element, context);\n }\n};\n\n/* @conditional-compile-remove(rich-text-editor-image-upload) */\n/**\n * @internal\n */\nexport const getPreviousInlineImages = (content?: string): Record<string, string>[] => {\n if (!content) {\n return [];\n }\n const previousInlineImages: Record<string, string>[] = [];\n const document = new DOMParser().parseFromString(content ?? '', 'text/html');\n document.querySelectorAll('img').forEach((img) => {\n const imageAttributes = getInlineImageAttributes(img);\n previousInlineImages.push(imageAttributes);\n });\n return previousInlineImages;\n};\n\n/* @conditional-compile-remove(rich-text-editor-image-upload) */\n/**\n * @internal\n */\nexport const getRemovedInlineImages = (\n content: string,\n previousInlineImages: Record<string, string>[]\n): Record<string, string>[] => {\n const document = new DOMParser().parseFromString(content ?? '', 'text/html');\n const currentContentIds = Array.from(document.querySelectorAll('img')).map((img) => img.id);\n previousInlineImages = previousInlineImages?.filter((img) => !!img.id && !currentContentIds?.includes(img.id));\n\n const removedInlineImages = [...previousInlineImages];\n return removedInlineImages;\n};\n\n/* @conditional-compile-remove(rich-text-editor-image-upload) */\n/**\n * @internal\n */\nexport const getInsertedInlineImages = (\n content: string,\n previousInlineImages: NodeListOf<HTMLImageElement>\n): HTMLImageElement[] => {\n const document = new DOMParser().parseFromString(content ?? '', 'text/html');\n const currentContentInlineImages = Array.from(document.querySelectorAll('img'));\n const previousContentIds = Array.from(previousInlineImages).map((img) => img.id);\n // if check is updated, also update getRemovedInlineImages\n const insertedInlineImages = currentContentInlineImages.filter((img) => !previousContentIds.includes(img.id));\n return insertedInlineImages;\n};\n\n/* @conditional-compile-remove(rich-text-editor-image-upload) */\n/**\n * @internal\n */\nexport const getInlineImageAttributes = (image: HTMLImageElement): Record<string, string> => {\n const imageAttributes: Record<string, string> = {};\n image.getAttributeNames().forEach((attrName) => {\n const attrValue = image.getAttribute(attrName);\n if (attrValue) {\n imageAttributes[attrName] = attrValue;\n }\n });\n return imageAttributes;\n};\n\n/* @conditional-compile-remove(rich-text-editor) */\n/**\n * @internal\n */\n/**\n * Update the scroll position of the editor to ensure the content is visible.\n */\nexport const scrollToBottomRichTextEditor = (): void => {\n // Get the current selection in the document\n const selection = document.getSelection();\n\n // Check if a selection exists and it has at least one range\n if (!selection || selection.rangeCount <= 0) {\n // If no selection or range, exit the function\n return;\n }\n\n // Get the first range of the selection\n // A user can normally only select one range at a time, so the rangeCount will usually be 1\n const range = selection.getRangeAt(0);\n\n // If the common ancestor container of the range is the document itself,\n // it might mean that the editable element is getting removed from the DOM\n // In such cases, especially in Safari, trying to modify the range might throw a HierarchyRequest error\n if (range.commonAncestorContainer === document) {\n return;\n }\n\n // Create a temporary span element to use as an anchor for scrolling\n // We can't use the anchor node directly because if it's a Text node, calling scrollIntoView() on it will throw an error\n const tempElement = document.createElement('span');\n // Collapse the range to its end point\n // This means the start and end points of the range will be the same, and it will not contain any content\n range.collapse(false);\n // Insert the temporary element at the cursor's position at the end of the range\n range.insertNode(tempElement);\n // Scroll the temporary element into view\n // the element will be aligned at the center of the scroll container, otherwise, text and images may be positioned incorrectly\n tempElement.scrollIntoView({\n block: 'center'\n });\n tempElement.remove();\n};\n\n/* @conditional-compile-remove(rich-text-editor-image-upload) */\n/**\n * Revoke the blob urls in the removedInlineImages and remove them from the currentLocalBlobMap\n * @internal\n */\nexport const removeLocalBlobs = (\n currentLocalBlobMap: Record<string, string>,\n removedInlineImages: Record<string, string>[]\n): void => {\n removedInlineImages.forEach((image) => {\n if (!image.id) {\n return;\n }\n removeSingleLocalBlob(currentLocalBlobMap, image.id);\n });\n};\n\n/* @conditional-compile-remove(rich-text-editor-image-upload) */\n/**\n * Revoke all the blob urls in the currentLocalBlobMap and clean up the currentLocalBlobMap\n * @internal\n */\nexport const cleanAllLocalBlobs = (currentLocalBlobMap: Record<string, string>): void => {\n Object.keys(currentLocalBlobMap).forEach((imageId) => {\n removeSingleLocalBlob(currentLocalBlobMap, imageId);\n });\n};\n\n/* @conditional-compile-remove(rich-text-editor-image-upload) */\nconst removeSingleLocalBlob = (currentLocalBlobMap: Record<string, string>, imageId: string): void => {\n const blobUrl = currentLocalBlobMap[imageId];\n if (blobUrl) {\n URL.revokeObjectURL(blobUrl);\n delete currentLocalBlobMap[imageId];\n }\n};\n"]}
|
@@ -23,6 +23,9 @@ export function createKey(row, column) {
|
|
23
23
|
*/
|
24
24
|
export function parseKey(key) {
|
25
25
|
const [row, column] = key.split(',');
|
26
|
+
if (row === undefined || column === undefined) {
|
27
|
+
throw new Error('Invalid key format');
|
28
|
+
}
|
26
29
|
return {
|
27
30
|
row: parseInt(row),
|
28
31
|
column: parseInt(column)
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"RichTextTableUtils.js","sourceRoot":"","sources":["../../../../../../../react-components/src/components/utils/RichTextTableUtils.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EAAE,SAAS,EAAE,MAAM,6BAA6B,CAAC;AACxD,OAAO,EAAE,0BAA0B,EAAE,MAAM,iCAAiC,CAAC;AAK7E;;;;GAIG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAG,kBAAkB,CAAC;AAEzD;;;;GAIG;AACH,MAAM,UAAU,SAAS,CAAC,GAAW,EAAE,MAAc;IACnD,OAAO,GAAG,GAAG,IAAI,MAAM,EAAE,CAAC;AAC5B,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,QAAQ,CAAC,GAAW;IAClC,MAAM,CAAC,GAAG,EAAE,MAAM,CAAC,GAAG,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;
|
1
|
+
{"version":3,"file":"RichTextTableUtils.js","sourceRoot":"","sources":["../../../../../../../react-components/src/components/utils/RichTextTableUtils.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EAAE,SAAS,EAAE,MAAM,6BAA6B,CAAC;AACxD,OAAO,EAAE,0BAA0B,EAAE,MAAM,iCAAiC,CAAC;AAK7E;;;;GAIG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAG,kBAAkB,CAAC;AAEzD;;;;GAIG;AACH,MAAM,UAAU,SAAS,CAAC,GAAW,EAAE,MAAc;IACnD,OAAO,GAAG,GAAG,IAAI,MAAM,EAAE,CAAC;AAC5B,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,QAAQ,CAAC,GAAW;IAClC,MAAM,CAAC,GAAG,EAAE,MAAM,CAAC,GAAG,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IAErC,IAAI,GAAG,KAAK,SAAS,IAAI,MAAM,KAAK,SAAS,EAAE,CAAC;QAC9C,MAAM,IAAI,KAAK,CAAC,oBAAoB,CAAC,CAAC;IACxC,CAAC;IAED,OAAO;QACL,GAAG,EAAE,QAAQ,CAAC,GAAG,CAAC;QAClB,MAAM,EAAE,QAAQ,CA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C,CAAC;qBACF;iBACF;aACF;SACF;QACD;YACE,GAAG,EAAE,kCAAkC;YACvC,IAAI,EAAE,OAAO,CAAC,6BAA6B;YAC3C,SAAS,EAAE,OAAO,CAAC,6BAA6B;YAChD,SAAS,EAAE;gBACT,QAAQ,EAAE,6BAA6B;gBACvC,MAAM,EAAE,EAAE,IAAI,EAAE,0BAA0B,EAAE;aAC7C;YACD,YAAY,EAAE;gBACZ,KAAK,EAAE;oBACL;wBACE,GAAG,EAAE,qCAAqC;wBAC1C,IAAI,EAAE,OAAO,CAAC,qBAAqB;wBACnC,SAAS,EAAE,OAAO,CAAC,qBAAqB;wBACxC,OAAO,EAAE,GAAG,EAAE;4BACZ,SAAS,CAAC,MAAM,EAAE,WAAW,CAAC,CAAC;wBACjC,CAAC;qBACF;oBACD;wBACE,GAAG,EAAE,wCAAwC;wBAC7C,IAAI,EAAE,OAAO,CAAC,wBAAwB;wBACtC,SAAS,EAAE,OAAO,CAAC,wBAAwB;wBAC3C,OAAO,EAAE,GAAG,EAAE;4BACZ,SAAS,CAAC,MAAM,EAAE,cAAc,CAAC,CAAC;wBACpC,CAAC;qBACF;oBACD;wBACE,GAAG,EAAE,uCAAuC;wBAC5C,IAAI,EAAE,OAAO,CAAC,uBAAuB;wBACrC,SAAS,EAAE,OAAO,CAAC,uBAAuB;wBAC1C,OAAO,EAAE,GAAG,EAAE;4BACZ,SAAS,CAAC,MAAM,EAAE,aAAa,CAAC,CAAC;wBACnC,CAAC;qBACF;iBACF;aACF;SACF;KACF,CAAC;AACJ,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { editTable } from 'roosterjs-content-model-api';\nimport { tableContextMenuIconStyles } from '../styles/RichTextEditor.styles';\nimport { RichTextStrings } from '../RichTextEditor/RichTextSendBox';\nimport { IEditor } from 'roosterjs-content-model-types';\nimport { IContextualMenuItem } from '@fluentui/react';\n\n/**\n * @private\n *\n * String to be replaces by actual values of row and column.\n */\nexport const ColumnRowReplaceString = '{column} x {row}';\n\n/**\n * @private\n *\n * Function to create key pair for the selected table size.\n */\nexport function createKey(row: number, column: number): string {\n return `${row},${column}`;\n}\n\n/**\n * @private\n *\n * Function to parse key to the selected table size valules.\n */\nexport function parseKey(key: string): { row: number; column: number } {\n const [row, column] = key.split(',');\n\n if (row === undefined || column === undefined) {\n throw new Error('Invalid key format');\n }\n\n return {\n row: parseInt(row),\n column: parseInt(column)\n };\n}\n\n/**\n * Returns an array of context menu items for editing a rich text table.\n *\n * @param editor - The editor instance.\n * @param strings - An object containing localized strings for the context menu items.\n * @returns An array of context menu items.\n */\nexport const getTableEditContextMenuItems = (\n editor: IEditor,\n strings: Partial<RichTextStrings>\n): IContextualMenuItem[] => {\n return [\n {\n key: 'RichTextTableEditMenuTableInsert',\n text: strings.richTextInsertRowOrColumnMenu,\n ariaLabel: strings.richTextInsertRowOrColumnMenu,\n iconProps: {\n iconName: 'RichTextTableInsertMenuIcon',\n styles: { root: tableContextMenuIconStyles }\n },\n subMenuProps: {\n items: [\n {\n key: 'RichTextTableEditMenuTableInsertRowAbove',\n text: strings.richTextInsertRowAboveMenu,\n ariaLabel: strings.richTextInsertRowAboveMenu,\n onClick: () => {\n editTable(editor, 'insertAbove');\n }\n },\n {\n key: 'RichTextTableEditMenuTableInsertRowBelow',\n text: strings.richTextInsertRowBelowMenu,\n ariaLabel: strings.richTextInsertRowBelowMenu,\n onClick: () => {\n editTable(editor, 'insertBelow');\n }\n },\n {\n key: 'RichTextTableEditMenuTableInsertColumnLeft',\n text: strings.richTextInsertColumnLeftMenu,\n ariaLabel: strings.richTextInsertColumnLeftMenu,\n onClick: () => {\n editTable(editor, 'insertLeft');\n }\n },\n {\n key: 'RichTextTableEditMenuTableInsertColumnRight',\n text: strings.richTextInsertColumnRightMenu,\n ariaLabel: strings.richTextInsertColumnRightMenu,\n onClick: () => {\n editTable(editor, 'insertRight');\n }\n }\n ]\n }\n },\n {\n key: 'RichTextTableEditMenuTableDelete',\n text: strings.richTextDeleteRowOrColumnMenu,\n ariaLabel: strings.richTextDeleteRowOrColumnMenu,\n iconProps: {\n iconName: 'RichTextTableDeleteMenuIcon',\n styles: { root: tableContextMenuIconStyles }\n },\n subMenuProps: {\n items: [\n {\n key: 'RichTextTableEditMenuTableDeleteRow',\n text: strings.richTextDeleteRowMenu,\n ariaLabel: strings.richTextDeleteRowMenu,\n onClick: () => {\n editTable(editor, 'deleteRow');\n }\n },\n {\n key: 'RichTextTableEditMenuTableDeleteColumn',\n text: strings.richTextDeleteColumnMenu,\n ariaLabel: strings.richTextDeleteColumnMenu,\n onClick: () => {\n editTable(editor, 'deleteColumn');\n }\n },\n {\n key: 'RichTextTableEditMenuTableDeleteTable',\n text: strings.richTextDeleteTableMenu,\n ariaLabel: strings.richTextDeleteTableMenu,\n onClick: () => {\n editTable(editor, 'deleteTable');\n }\n }\n ]\n }\n }\n ];\n};\n"]}
|
@@ -11,6 +11,9 @@ import { _convertRemToPx as convertRemToPx } from "../../../../acs-ui-common/src
|
|
11
11
|
export const _useContainerWidth = (containerRef) => {
|
12
12
|
const [width, setWidth] = useState(undefined);
|
13
13
|
const observer = useRef(new ResizeObserver((entries) => {
|
14
|
+
if (!entries[0]) {
|
15
|
+
return;
|
16
|
+
}
|
14
17
|
const { width } = entries[0].contentRect;
|
15
18
|
if (Number.isNaN(width)) {
|
16
19
|
setWidth(0);
|
@@ -39,6 +42,9 @@ export const _useContainerWidth = (containerRef) => {
|
|
39
42
|
export const _useContainerHeight = (containerRef) => {
|
40
43
|
const [height, setHeight] = useState(undefined);
|
41
44
|
const observer = useRef(new ResizeObserver((entries) => {
|
45
|
+
if (!entries[0]) {
|
46
|
+
return;
|
47
|
+
}
|
42
48
|
const { height } = entries[0].contentRect;
|
43
49
|
if (Number.isNaN(height)) {
|
44
50
|
setHeight(0);
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"responsive.js","sourceRoot":"","sources":["../../../../../../../react-components/src/components/utils/responsive.ts"],"names":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IAEpE,MAAM,QAAQ,GAAG,MAAM,CACrB,IAAI,cAAc,CAAC,CAAC,OAAO,EAAE,EAAE;QAC7B,MAAM,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC,WAAW,CAAC;QAC1C,IAAI,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,EAAE,CAAC;YACzB,SAAS,CAAC,CAAC,CAAC,CAAC;QACf,CAAC;aAAM,CAAC;YACN,SAAS,CAAC,MAAM,CAAC,CAAC;QACpB,CAAC;IACH,CAAC,CAAC,CACH,CAAC;IAEF,SAAS,CAAC,GAAG,EAAE;QACb,IAAI,YAAY,CAAC,OAAO,EAAE,CAAC;YACzB,QAAQ,CAAC,OAAO,CAAC,OAAO,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC;QACjD,CAAC;QAED,MAAM,eAAe,GAAG,QAAQ,CAAC,OAAO,CAAC;QACzC,OAAO,GAAG,EAAE;YACV,eAAe,CAAC,UAAU,EAAE,CAAC;QAC/B,CAAC,CAAC;IACJ,CAAC,EAAE,CAAC,YAAY,EAAE,QAAQ,CAAC,CAAC,CAAC;IAE7B,OAAO,MAAM,CAAC;AAChB,CAAC,CAAC;AAEF,MAAM,gBAAgB,GAAG,EAAE,CAAC;AAE5B,MAAM,gBAAgB,GAAG,KAAK,CAAC;AAE/B;;;;GAIG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,iBAAyB,EAAW,EAAE,CAClE,iBAAiB,IAAI,cAAc,CAAC,gBAAgB,CAAC,CAAC;AAExD;;;;GAIG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,kBAA0B,EAAW,EAAE,CACnE,kBAAkB,IAAI,cAAc,CAAC,gBAAgB,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { RefObject, useEffect, useState, useRef } from 'react';\nimport { _convertRemToPx as convertRemToPx } from '@internal/acs-ui-common';\n\n/**\n * A utility hook for providing the width of a parent element.\n * Returns updated width if parent/window resizes.\n * @param containerRef - Ref of a parent element whose width will be returned.\n * @internal\n */\nexport const _useContainerWidth = (containerRef: RefObject<HTMLElement>): number | undefined => {\n const [width, setWidth] = useState<number | undefined>(undefined);\n\n const observer = useRef(\n new ResizeObserver((entries) => {\n const { width } = entries[0].contentRect;\n if (Number.isNaN(width)) {\n setWidth(0);\n } else {\n setWidth(width);\n }\n })\n );\n\n useEffect(() => {\n if (containerRef.current) {\n observer.current.observe(containerRef.current);\n }\n\n const currentObserver = observer.current;\n return () => {\n currentObserver.disconnect();\n };\n }, [containerRef, observer]);\n\n return width;\n};\n\n/**\n * A utility hook for providing the height of a parent element.\n * Returns updated height if parent/window resizes.\n * @param containerRef - Ref of a parent element whose height will be returned.\n * @internal\n */\nexport const _useContainerHeight = (containerRef: RefObject<HTMLElement>): number | undefined => {\n const [height, setHeight] = useState<number | undefined>(undefined);\n\n const observer = useRef(\n new ResizeObserver((entries) => {\n const { height } = entries[0].contentRect;\n if (Number.isNaN(height)) {\n setHeight(0);\n } else {\n setHeight(height);\n }\n })\n );\n\n useEffect(() => {\n if (containerRef.current) {\n observer.current.observe(containerRef.current);\n }\n\n const currentObserver = observer.current;\n return () => {\n currentObserver.disconnect();\n };\n }, [containerRef, observer]);\n\n return height;\n};\n\nconst NARROW_WIDTH_REM = 30;\n\nconst SHORT_HEIGHT_REM = 23.75;\n\n/**\n * Utility function to determine if container width is narrow\n * @param containerWidthRem container width in rem\n * @returns boolean\n */\nexport const isNarrowWidth = (containerWidthRem: number): boolean =>\n containerWidthRem <= convertRemToPx(NARROW_WIDTH_REM);\n\n/**\n * Utility function to determine if container width is short\n * @param containerWidthRem container height in rem\n * @returns boolean\n */\nexport const isShortHeight = (containerHeightRem: number): boolean =>\n containerHeightRem <= convertRemToPx(SHORT_HEIGHT_REM);\n"]}
|
1
|
+
{"version":3,"file":"responsive.js","sourceRoot":"","sources":["../../../../../../../react-components/src/components/utils/responsive.ts"],"names":[],"mappings":"AA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Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { RefObject, useEffect, useState, useRef } from 'react';\nimport { _convertRemToPx as convertRemToPx } from '@internal/acs-ui-common';\n\n/**\n * A utility hook for providing the width of a parent element.\n * Returns updated width if parent/window resizes.\n * @param containerRef - Ref of a parent element whose width will be returned.\n * @internal\n */\nexport const _useContainerWidth = (containerRef: RefObject<HTMLElement>): number | undefined => {\n const [width, setWidth] = useState<number | undefined>(undefined);\n\n const observer = useRef(\n new ResizeObserver((entries) => {\n if (!entries[0]) {\n return;\n }\n const { width } = entries[0].contentRect;\n if (Number.isNaN(width)) {\n setWidth(0);\n } else {\n setWidth(width);\n }\n })\n );\n\n useEffect(() => {\n if (containerRef.current) {\n observer.current.observe(containerRef.current);\n }\n\n const currentObserver = observer.current;\n return () => {\n currentObserver.disconnect();\n };\n }, [containerRef, observer]);\n\n return width;\n};\n\n/**\n * A utility hook for providing the height of a parent element.\n * Returns updated height if parent/window resizes.\n * @param containerRef - Ref of a parent element whose height will be returned.\n * @internal\n */\nexport const _useContainerHeight = (containerRef: RefObject<HTMLElement>): number | undefined => {\n const [height, setHeight] = useState<number | undefined>(undefined);\n\n const observer = useRef(\n new ResizeObserver((entries) => {\n if (!entries[0]) {\n return;\n }\n const { height } = entries[0].contentRect;\n if (Number.isNaN(height)) {\n setHeight(0);\n } else {\n setHeight(height);\n }\n })\n );\n\n useEffect(() => {\n if (containerRef.current) {\n observer.current.observe(containerRef.current);\n }\n\n const currentObserver = observer.current;\n return () => {\n currentObserver.disconnect();\n };\n }, [containerRef, observer]);\n\n return height;\n};\n\nconst NARROW_WIDTH_REM = 30;\n\nconst SHORT_HEIGHT_REM = 23.75;\n\n/**\n * Utility function to determine if container width is narrow\n * @param containerWidthRem container width in rem\n * @returns boolean\n */\nexport const isNarrowWidth = (containerWidthRem: number): boolean =>\n containerWidthRem <= convertRemToPx(NARROW_WIDTH_REM);\n\n/**\n * Utility function to determine if container width is short\n * @param containerWidthRem container height in rem\n * @returns boolean\n */\nexport const isShortHeight = (containerHeightRem: number): boolean =>\n containerHeightRem <= convertRemToPx(SHORT_HEIGHT_REM);\n"]}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"dominantSpeaker.js","sourceRoot":"","sources":["../../../../../../react-components/src/gallery/dominantSpeaker.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAwBlC;;;;;GAKG;AACH,MAAM,CAAC,MAAM,gCAAgC,GAAG,CAC9C,IAA0C,EACT,EAAE;IACnC,MAAM,EAAE,YAAY,EAAE,gBAAgB,GAAG,EAAE,EAAE,mBAAmB,GAAG,EAAE,EAAE,mBAAmB,EAAE,GAAG,IAAI,CAAC;IAEpG,6FAA6F;IAC7F,IAAI,YAAY,CAAC,MAAM,IAAI,mBAAmB,EAAE,CAAC;QAC/C,OAAO,YAAY,CAAC;IACtB,CAAC;IAED,MAAM,eAAe,GAAG,gBAAgB,CAAC,YAAY,CAAC,CAAC;IAEvD,wEAAwE;IACxE,MAAM,kBAAkB,GAAG,gBAAgB,CAAC,MAAM,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC,CAAC,eAAe,CAAC,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,mBAAmB,CAAC,CAAC;IAEhH,MAAM,wBAAwB,GAAG,mBAAmB,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,mBAAmB,CAAC,CAAC;IACxG,MAAM,qBAAqB,GAAG,kBAAkB,CAAC,MAAM,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC,wBAAwB,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,CAAC;IAExG,+FAA+F;IAC/F,KAAK,IAAI,KAAK,GAAG,CAAC,EAAE,KAAK,GAAG,mBAAmB,EAAE,KAAK,EAAE,EAAE,CAAC;QACzD,MAAM,uBAAuB,GAAG,wBAAwB,CAAC,KAAK,CAAC,CAAC;QAChE,IAAI,uBAAuB,KAAK,SAAS,IAAI,CAAC,kBAAkB,CAAC,QAAQ,CAAC,uBAAuB,CAAC,EAAE,CAAC;YACnG,MAAM,WAAW,GAAG,qBAAqB,CAAC,KAAK,EAAE,CAAC;YAClD,IAAI,CAAC,WAAW,EAAE,CAAC;gBACjB,MAAM;YACR,CAAC;YACD,wBAAwB,CAAC,KAAK,CAAC,GAAG,WAAW,CAAC;QAChD,CAAC;IACH,CAAC;IAED,IAAI,sBAAsB,GAAG,wBAAwB;SAClD,GAAG,CAAC,CAAC,aAAa,EAAE,EAAE,CAAC,eAAe,CAAC,aAAa,CAAC,CAAC;SACtD,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,KAAK,SAAS,
|
1
|
+
{"version":3,"file":"dominantSpeaker.js","sourceRoot":"","sources":["../../../../../../react-components/src/gallery/dominantSpeaker.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAwBlC;;;;;GAKG;AACH,MAAM,CAAC,MAAM,gCAAgC,GAAG,CAC9C,IAA0C,EACT,EAAE;IACnC,MAAM,EAAE,YAAY,EAAE,gBAAgB,GAAG,EAAE,EAAE,mBAAmB,GAAG,EAAE,EAAE,mBAAmB,EAAE,GAAG,IAAI,CAAC;IAEpG,6FAA6F;IAC7F,IAAI,YAAY,CAAC,MAAM,IAAI,mBAAmB,EAAE,CAAC;QAC/C,OAAO,YAAY,CAAC;IACtB,CAAC;IAED,MAAM,eAAe,GAAG,gBAAgB,CAAC,YAAY,CAAC,CAAC;IAEvD,wEAAwE;IACxE,MAAM,kBAAkB,GAAG,gBAAgB,CAAC,MAAM,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC,CAAC,eAAe,CAAC,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,mBAAmB,CAAC,CAAC;IAEhH,MAAM,wBAAwB,GAAG,mBAAmB,CAAC,GAAG,CAAC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G;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAC9B,YAA6C,EACK,EAAE;IACpD,MAAM,QAAQ,GAAqD,EAAE,CAAC;IACtE,YAAY,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;IACtD,OAAO,QAAQ,CAAC;AAClB,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { VideoGalleryRemoteParticipant } from '../types';\n\ntype SmartDominantSpeakerParticipantsArgs = {\n /**\n * Array containing all participants of a call. {@link @azure/communication-react#VideoGalleryRemoteParticipant}\n */\n participants: VideoGalleryRemoteParticipant[];\n /**\n * An array containing the userId of dominant speakers\n * in a call in the order of their dominance. 0th index is the most dominant, 1st is the second most etc\n */\n dominantSpeakers?: string[];\n /**\n * Array containing the current participants in the call. {@link @azure/communication-react#VideoGalleryRemoteParticipant}\n */\n currentParticipants?: VideoGalleryRemoteParticipant[];\n /**\n * Maximum number of dominant speaker positions to move participants in.\n */\n maxDominantSpeakers: number;\n};\n\n/**\n * Calculates the participants that should be rendered based on the list of dominant\n * speakers and currently rendered participants in a call.\n * @param args - SmartDominantSpeakerParticipantsArgs\n * @returns VideoGalleryRemoteParticipant[] {@link @azure/communication-react#VideoGalleryRemoteParticipant}\n */\nexport const smartDominantSpeakerParticipants = (\n args: SmartDominantSpeakerParticipantsArgs\n): VideoGalleryRemoteParticipant[] => {\n const { participants, dominantSpeakers = [], currentParticipants = [], maxDominantSpeakers } = args;\n\n // Don't apply any logic if total number of video streams is less than max dominant speakers.\n if (participants.length <= maxDominantSpeakers) {\n return participants;\n }\n\n const participantsMap = participantsById(participants);\n\n // Only use the Max allowed dominant speakers that exist in participants\n const dominantSpeakerIds = dominantSpeakers.filter((id) => !!participantsMap[id]).slice(0, maxDominantSpeakers);\n\n const newVisibleParticipantIds = currentParticipants.map((p) => p.userId).slice(0, maxDominantSpeakers);\n const newDominantSpeakerIds = dominantSpeakerIds.filter((id) => !newVisibleParticipantIds.includes(id));\n\n // Remove participants that are no longer dominant and replace them with new dominant speakers.\n for (let index = 0; index < maxDominantSpeakers; index++) {\n const newVisibleParticipantId = newVisibleParticipantIds[index];\n if (newVisibleParticipantId === undefined || !dominantSpeakerIds.includes(newVisibleParticipantId)) {\n const replacement = newDominantSpeakerIds.shift();\n if (!replacement) {\n break;\n }\n newVisibleParticipantIds[index] = replacement;\n }\n }\n\n let newVisibleParticipants = newVisibleParticipantIds\n .map((participantId) => participantsMap[participantId])\n .filter((p) => p !== undefined) as VideoGalleryRemoteParticipant[];\n\n const newVisibleParticipantIdsSet = new Set(newVisibleParticipantIds);\n const remainingParticipants = participants.filter((p) => !newVisibleParticipantIdsSet.has(p.userId));\n\n newVisibleParticipants = newVisibleParticipants.concat(remainingParticipants);\n\n return newVisibleParticipants;\n};\n\n/**\n * maps the participants array to an object with userId as key\n * @private\n */\nexport const participantsById = (\n participants: VideoGalleryRemoteParticipant[]\n): { [key: string]: VideoGalleryRemoteParticipant } => {\n const response: { [key: string]: VideoGalleryRemoteParticipant } = {};\n participants.forEach((p) => (response[p.userId] = p));\n return response;\n};\n"]}
|
@@ -947,15 +947,10 @@ export class AzureCommunicationCallAdapter {
|
|
947
947
|
teamsCaptionsFeature.on('SpokenLanguageChanged', this.isSpokenLanguageChanged.bind(this));
|
948
948
|
}
|
949
949
|
else {
|
950
|
-
/* @conditional-compile-remove(acs-close-captions) */
|
951
950
|
const acsCaptionsFeature = captionsFeature === null || captionsFeature === void 0 ? void 0 : captionsFeature.captions;
|
952
|
-
/* @conditional-compile-remove(acs-close-captions) */
|
953
951
|
acsCaptionsFeature.on('CaptionsReceived', this.captionsReceived.bind(this));
|
954
|
-
/* @conditional-compile-remove(acs-close-captions) */
|
955
952
|
acsCaptionsFeature.on('CaptionsActiveChanged', this.isCaptionsActiveChanged.bind(this));
|
956
|
-
/* @conditional-compile-remove(acs-close-captions) */
|
957
953
|
acsCaptionsFeature.on('SpokenLanguageChanged', this.isSpokenLanguageChanged.bind(this));
|
958
|
-
/* @conditional-compile-remove(acs-close-captions) */
|
959
954
|
captionsFeature === null || captionsFeature === void 0 ? void 0 : captionsFeature.on('CaptionsKindChanged', this.captionsKindChanged.bind(this));
|
960
955
|
}
|
961
956
|
}
|
@@ -971,15 +966,10 @@ export class AzureCommunicationCallAdapter {
|
|
971
966
|
teamsCaptionsFeature.off('SpokenLanguageChanged', this.isSpokenLanguageChanged.bind(this));
|
972
967
|
}
|
973
968
|
else {
|
974
|
-
/* @conditional-compile-remove(acs-close-captions) */
|
975
969
|
const acsCaptionsFeature = captionsFeature === null || captionsFeature === void 0 ? void 0 : captionsFeature.captions;
|
976
|
-
/* @conditional-compile-remove(acs-close-captions) */
|
977
970
|
acsCaptionsFeature.off('CaptionsReceived', this.captionsReceived.bind(this));
|
978
|
-
/* @conditional-compile-remove(acs-close-captions) */
|
979
971
|
acsCaptionsFeature.off('CaptionsActiveChanged', this.isCaptionsActiveChanged.bind(this));
|
980
|
-
/* @conditional-compile-remove(acs-close-captions) */
|
981
972
|
acsCaptionsFeature.off('SpokenLanguageChanged', this.isSpokenLanguageChanged.bind(this));
|
982
|
-
/* @conditional-compile-remove(acs-close-captions) */
|
983
973
|
captionsFeature === null || captionsFeature === void 0 ? void 0 : captionsFeature.off('CaptionsKindChanged', this.captionsKindChanged.bind(this));
|
984
974
|
}
|
985
975
|
}
|
@@ -1026,7 +1016,6 @@ export class AzureCommunicationCallAdapter {
|
|
1026
1016
|
breakoutRoomsFeature.off('breakoutRoomsUpdated', this.breakoutRoomsUpdated.bind(this));
|
1027
1017
|
}
|
1028
1018
|
}
|
1029
|
-
/* @conditional-compile-remove(acs-close-captions) */
|
1030
1019
|
captionsKindChanged() {
|
1031
1020
|
var _a;
|
1032
1021
|
const captionsFeature = (_a = this.call) === null || _a === void 0 ? void 0 : _a.feature(Features.Captions);
|
@@ -1059,7 +1048,6 @@ export class AzureCommunicationCallAdapter {
|
|
1059
1048
|
teamsCaptionsReceived(captionsInfo) {
|
1060
1049
|
this.emitter.emit('captionsReceived', { captionsInfo });
|
1061
1050
|
}
|
1062
|
-
/* @conditional-compile-remove(acs-close-captions) */
|
1063
1051
|
captionsReceived(captionsInfo) {
|
1064
1052
|
this.emitter.emit('captionsReceived', { captionsInfo });
|
1065
1053
|
}
|