@azure/communication-react 1.24.0-beta.1 → 1.24.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/communication-react.d.ts +66 -2240
- package/dist/dist-cjs/communication-react/index.js +38012 -178
- package/dist/dist-cjs/communication-react/index.js.map +1 -1
- package/dist/dist-esm/acs-ui-common/src/common.d.ts +0 -13
- package/dist/dist-esm/acs-ui-common/src/common.js.map +1 -1
- package/dist/dist-esm/acs-ui-common/src/constants.d.ts +0 -5
- package/dist/dist-esm/acs-ui-common/src/constants.js +0 -5
- package/dist/dist-esm/acs-ui-common/src/constants.js.map +1 -1
- package/dist/dist-esm/acs-ui-common/src/index.d.ts +0 -4
- package/dist/dist-esm/acs-ui-common/src/index.js +0 -3
- package/dist/dist-esm/acs-ui-common/src/index.js.map +1 -1
- package/dist/dist-esm/acs-ui-common/src/telemetryVersion.js +1 -1
- package/dist/dist-esm/acs-ui-common/src/telemetryVersion.js.map +1 -1
- package/dist/dist-esm/calling-component-bindings/src/baseSelectors.d.ts +0 -14
- package/dist/dist-esm/calling-component-bindings/src/baseSelectors.js +8 -18
- package/dist/dist-esm/calling-component-bindings/src/baseSelectors.js.map +1 -1
- package/dist/dist-esm/calling-component-bindings/src/captionsSelector.d.ts +0 -8
- package/dist/dist-esm/calling-component-bindings/src/captionsSelector.js +2 -64
- package/dist/dist-esm/calling-component-bindings/src/captionsSelector.js.map +1 -1
- package/dist/dist-esm/calling-component-bindings/src/handlers/createCommonHandlers.d.ts +0 -28
- package/dist/dist-esm/calling-component-bindings/src/handlers/createCommonHandlers.js +1 -65
- package/dist/dist-esm/calling-component-bindings/src/handlers/createCommonHandlers.js.map +1 -1
- package/dist/dist-esm/calling-component-bindings/src/handlers/createHandlers.js +1 -5
- package/dist/dist-esm/calling-component-bindings/src/handlers/createHandlers.js.map +1 -1
- package/dist/dist-esm/calling-component-bindings/src/handlers/createTeamsCallHandlers.js +1 -30
- package/dist/dist-esm/calling-component-bindings/src/handlers/createTeamsCallHandlers.js.map +1 -1
- package/dist/dist-esm/calling-component-bindings/src/notificationStackSelector.js +6 -14
- package/dist/dist-esm/calling-component-bindings/src/notificationStackSelector.js.map +1 -1
- package/dist/dist-esm/calling-component-bindings/src/participantListSelector.d.ts +0 -1
- package/dist/dist-esm/calling-component-bindings/src/participantListSelector.js +1 -3
- package/dist/dist-esm/calling-component-bindings/src/participantListSelector.js.map +1 -1
- package/dist/dist-esm/calling-component-bindings/src/videoGallerySelector.d.ts +0 -5
- package/dist/dist-esm/calling-component-bindings/src/videoGallerySelector.js +3 -8
- package/dist/dist-esm/calling-component-bindings/src/videoGallerySelector.js.map +1 -1
- package/dist/dist-esm/calling-stateful-client/src/BreakoutRoomsSubscriber.js +43 -32
- package/dist/dist-esm/calling-stateful-client/src/BreakoutRoomsSubscriber.js.map +1 -1
- package/dist/dist-esm/calling-stateful-client/src/CallAgentDeclarativeCommon.js +0 -4
- package/dist/dist-esm/calling-stateful-client/src/CallAgentDeclarativeCommon.js.map +1 -1
- package/dist/dist-esm/calling-stateful-client/src/CallClientState.d.ts +6 -160
- package/dist/dist-esm/calling-stateful-client/src/CallClientState.js.map +1 -1
- package/dist/dist-esm/calling-stateful-client/src/CallContext.d.ts +6 -26
- package/dist/dist-esm/calling-stateful-client/src/CallContext.js +23 -251
- package/dist/dist-esm/calling-stateful-client/src/CallContext.js.map +1 -1
- package/dist/dist-esm/calling-stateful-client/src/CallSubscriber.d.ts +0 -6
- package/dist/dist-esm/calling-stateful-client/src/CallSubscriber.js +6 -31
- package/dist/dist-esm/calling-stateful-client/src/CallSubscriber.js.map +1 -1
- package/dist/dist-esm/calling-stateful-client/src/CapabilitiesSubscriber.js +4 -4
- package/dist/dist-esm/calling-stateful-client/src/CapabilitiesSubscriber.js.map +1 -1
- package/dist/dist-esm/calling-stateful-client/src/Converter.d.ts +0 -12
- package/dist/dist-esm/calling-stateful-client/src/Converter.js +0 -32
- package/dist/dist-esm/calling-stateful-client/src/Converter.js.map +1 -1
- package/dist/dist-esm/calling-stateful-client/src/InternalCallContext.d.ts +0 -9
- package/dist/dist-esm/calling-stateful-client/src/InternalCallContext.js +1 -45
- package/dist/dist-esm/calling-stateful-client/src/InternalCallContext.js.map +1 -1
- package/dist/dist-esm/calling-stateful-client/src/RecordingSubscriber.d.ts +0 -1
- package/dist/dist-esm/calling-stateful-client/src/RecordingSubscriber.js +1 -7
- package/dist/dist-esm/calling-stateful-client/src/RecordingSubscriber.js.map +1 -1
- package/dist/dist-esm/calling-stateful-client/src/StatefulCallClient.d.ts +2 -3
- package/dist/dist-esm/calling-stateful-client/src/StatefulCallClient.js +0 -7
- package/dist/dist-esm/calling-stateful-client/src/StatefulCallClient.js.map +1 -1
- package/dist/dist-esm/calling-stateful-client/src/StreamUtils.js +0 -8
- package/dist/dist-esm/calling-stateful-client/src/StreamUtils.js.map +1 -1
- package/dist/dist-esm/calling-stateful-client/src/TeamsCallDeclarative.js +0 -17
- package/dist/dist-esm/calling-stateful-client/src/TeamsCallDeclarative.js.map +1 -1
- package/dist/dist-esm/calling-stateful-client/src/index-public.d.ts +0 -3
- package/dist/dist-esm/calling-stateful-client/src/index-public.js.map +1 -1
- package/dist/dist-esm/chat-component-bindings/src/handlers/createHandlers.d.ts +2 -6
- package/dist/dist-esm/chat-component-bindings/src/handlers/createHandlers.js +2 -35
- package/dist/dist-esm/chat-component-bindings/src/handlers/createHandlers.js.map +1 -1
- package/dist/dist-esm/chat-component-bindings/src/hooks/usePropsFor.d.ts +1 -2
- package/dist/dist-esm/chat-component-bindings/src/hooks/usePropsFor.js +0 -3
- package/dist/dist-esm/chat-component-bindings/src/hooks/usePropsFor.js.map +1 -1
- package/dist/dist-esm/chat-component-bindings/src/messageThreadSelector.js +2 -25
- package/dist/dist-esm/chat-component-bindings/src/messageThreadSelector.js.map +1 -1
- package/dist/dist-esm/chat-component-bindings/src/utils/updateMessagesWithAttached.js +3 -3
- package/dist/dist-esm/chat-component-bindings/src/utils/updateMessagesWithAttached.js.map +1 -1
- package/dist/dist-esm/chat-stateful-client/src/ChatClientState.d.ts +1 -15
- package/dist/dist-esm/chat-stateful-client/src/ChatClientState.js.map +1 -1
- package/dist/dist-esm/chat-stateful-client/src/EventSubscriber.js +1 -2
- package/dist/dist-esm/chat-stateful-client/src/EventSubscriber.js.map +1 -1
- package/dist/dist-esm/chat-stateful-client/src/index.d.ts +0 -1
- package/dist/dist-esm/chat-stateful-client/src/index.js.map +1 -1
- package/dist/dist-esm/communication-react/src/index.d.ts +0 -35
- package/dist/dist-esm/communication-react/src/index.js +0 -9
- package/dist/dist-esm/communication-react/src/index.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/Attachment/AttachmentDownloadCards.d.ts +0 -2
- package/dist/dist-esm/react-components/src/components/Attachment/AttachmentDownloadCards.js +0 -1
- package/dist/dist-esm/react-components/src/components/Attachment/AttachmentDownloadCards.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/CaptionsBanner.d.ts +0 -101
- package/dist/dist-esm/react-components/src/components/CaptionsBanner.js +6 -83
- package/dist/dist-esm/react-components/src/components/CaptionsBanner.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/ChatMessage/ChatMessageComponentWrapper.d.ts +1 -13
- package/dist/dist-esm/react-components/src/components/ChatMessage/ChatMessageComponentWrapper.js +3 -9
- package/dist/dist-esm/react-components/src/components/ChatMessage/ChatMessageComponentWrapper.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/ChatMessage/ChatMessageContent.d.ts +0 -11
- package/dist/dist-esm/react-components/src/components/ChatMessage/ChatMessageContent.js +2 -32
- package/dist/dist-esm/react-components/src/components/ChatMessage/ChatMessageContent.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/ChatMessage/MessageComponents/ChatMessageComponentAsMessageBubble.d.ts +1 -8
- package/dist/dist-esm/react-components/src/components/ChatMessage/MessageComponents/ChatMessageComponentAsMessageBubble.js +5 -9
- package/dist/dist-esm/react-components/src/components/ChatMessage/MessageComponents/ChatMessageComponentAsMessageBubble.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/ChatMessage/MessageComponents/FluentChatMessageComponent.d.ts +1 -2
- package/dist/dist-esm/react-components/src/components/ChatMessage/MessageComponents/FluentChatMessageComponent.js +4 -4
- package/dist/dist-esm/react-components/src/components/ChatMessage/MessageComponents/FluentChatMessageComponent.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/ChatMessage/MyMessageComponents/ChatMessageComponentAsEditBox.d.ts +1 -4
- package/dist/dist-esm/react-components/src/components/ChatMessage/MyMessageComponents/ChatMessageComponentAsEditBox.js +6 -31
- package/dist/dist-esm/react-components/src/components/ChatMessage/MyMessageComponents/ChatMessageComponentAsEditBox.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/ChatMessage/MyMessageComponents/ChatMessageComponentAsEditBoxPicker.d.ts +1 -15
- package/dist/dist-esm/react-components/src/components/ChatMessage/MyMessageComponents/ChatMessageComponentAsEditBoxPicker.js +0 -9
- package/dist/dist-esm/react-components/src/components/ChatMessage/MyMessageComponents/ChatMessageComponentAsEditBoxPicker.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/ChatMessage/MyMessageComponents/ChatMyMessageComponent.d.ts +2 -23
- package/dist/dist-esm/react-components/src/components/ChatMessage/MyMessageComponents/ChatMyMessageComponent.js +6 -17
- package/dist/dist-esm/react-components/src/components/ChatMessage/MyMessageComponents/ChatMyMessageComponent.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/ChatMessage/MyMessageComponents/ChatMyMessageComponentAsMessageBubble.d.ts +1 -8
- package/dist/dist-esm/react-components/src/components/ChatMessage/MyMessageComponents/ChatMyMessageComponentAsMessageBubble.js +6 -10
- package/dist/dist-esm/react-components/src/components/ChatMessage/MyMessageComponents/ChatMyMessageComponentAsMessageBubble.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/ChatMessage/MyMessageComponents/FluentChatMyMessageComponent.js +5 -5
- package/dist/dist-esm/react-components/src/components/ChatMessage/MyMessageComponents/FluentChatMyMessageComponent.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/ImageOverlay.js +0 -2
- package/dist/dist-esm/react-components/src/components/ImageOverlay.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/InputBoxComponent.d.ts +0 -2
- package/dist/dist-esm/react-components/src/components/InputBoxComponent.js +0 -15
- package/dist/dist-esm/react-components/src/components/InputBoxComponent.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/MeetingReactionOverlay.d.ts +0 -2
- package/dist/dist-esm/react-components/src/components/MeetingReactionOverlay.js +1 -5
- package/dist/dist-esm/react-components/src/components/MeetingReactionOverlay.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/MessageThread.d.ts +5 -81
- package/dist/dist-esm/react-components/src/components/MessageThread.js +3 -13
- package/dist/dist-esm/react-components/src/components/MessageThread.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/NotificationStack.d.ts +5 -3
- package/dist/dist-esm/react-components/src/components/NotificationStack.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/ParticipantItem.js +7 -4
- package/dist/dist-esm/react-components/src/components/ParticipantItem.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/ParticipantList.d.ts +0 -15
- package/dist/dist-esm/react-components/src/components/ParticipantList.js +3 -12
- package/dist/dist-esm/react-components/src/components/ParticipantList.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/RaiseHandButton.js +2 -2
- package/dist/dist-esm/react-components/src/components/RaiseHandButton.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/ReactionButton.js +2 -2
- package/dist/dist-esm/react-components/src/components/ReactionButton.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/SendBox.d.ts +1 -47
- package/dist/dist-esm/react-components/src/components/SendBox.js +6 -57
- package/dist/dist-esm/react-components/src/components/SendBox.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/UnsupportedBrowser.js +0 -1
- package/dist/dist-esm/react-components/src/components/UnsupportedBrowser.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/UnsupportedBrowserVersion.js +0 -1
- package/dist/dist-esm/react-components/src/components/UnsupportedBrowserVersion.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/UnsupportedEnvironment.js +0 -19
- package/dist/dist-esm/react-components/src/components/UnsupportedEnvironment.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/UnsupportedOperatingSystem.js +0 -1
- package/dist/dist-esm/react-components/src/components/UnsupportedOperatingSystem.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/VideoGallery/Layout.d.ts +0 -5
- package/dist/dist-esm/react-components/src/components/VideoGallery/Layout.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/VideoGallery.d.ts +1 -34
- package/dist/dist-esm/react-components/src/components/VideoGallery.js +2 -13
- package/dist/dist-esm/react-components/src/components/VideoGallery.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/index.d.ts +0 -24
- package/dist/dist-esm/react-components/src/components/index.js +0 -11
- package/dist/dist-esm/react-components/src/components/index.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/styles/AttachmentCard.styles.d.ts +1 -1
- package/dist/dist-esm/react-components/src/components/styles/AttachmentCardGroup.styles.d.ts +1 -1
- package/dist/dist-esm/react-components/src/components/styles/Captions.style.d.ts +0 -21
- package/dist/dist-esm/react-components/src/components/styles/Captions.style.js +0 -53
- package/dist/dist-esm/react-components/src/components/styles/Captions.style.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/styles/MessageThread.styles.d.ts +3 -3
- package/dist/dist-esm/react-components/src/components/styles/MessageThread.styles.js +0 -8
- package/dist/dist-esm/react-components/src/components/styles/MessageThread.styles.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/utils/ChatMessageComponentAsEditBoxUtils.d.ts +1 -37
- package/dist/dist-esm/react-components/src/components/utils/ChatMessageComponentAsEditBoxUtils.js +3 -30
- package/dist/dist-esm/react-components/src/components/utils/ChatMessageComponentAsEditBoxUtils.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/utils/ChatMessageComponentUtils.d.ts +2 -4
- package/dist/dist-esm/react-components/src/components/utils/ChatMessageComponentUtils.js +2 -9
- package/dist/dist-esm/react-components/src/components/utils/ChatMessageComponentUtils.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/utils/SendBoxUtils.d.ts +1 -38
- package/dist/dist-esm/react-components/src/components/utils/SendBoxUtils.js +4 -131
- package/dist/dist-esm/react-components/src/components/utils/SendBoxUtils.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/utils/common.js +0 -2
- package/dist/dist-esm/react-components/src/components/utils/common.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/utils/getParticipantsWhoHaveReadMessage.d.ts +1 -2
- package/dist/dist-esm/react-components/src/components/utils/getParticipantsWhoHaveReadMessage.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/utils.js +2 -3
- package/dist/dist-esm/react-components/src/components/utils.js.map +1 -1
- package/dist/dist-esm/react-components/src/identifiers/IdentifierProvider.d.ts +0 -4
- package/dist/dist-esm/react-components/src/identifiers/IdentifierProvider.js +1 -3
- package/dist/dist-esm/react-components/src/identifiers/IdentifierProvider.js.map +1 -1
- package/dist/dist-esm/react-components/src/index.d.ts +0 -2
- package/dist/dist-esm/react-components/src/index.js.map +1 -1
- package/dist/dist-esm/react-components/src/localization/LocalizationProvider.d.ts +0 -63
- package/dist/dist-esm/react-components/src/localization/LocalizationProvider.js.map +1 -1
- package/dist/dist-esm/react-components/src/localization/locales/ar-SA/strings.json +5 -0
- package/dist/dist-esm/react-components/src/localization/locales/cs-CZ/strings.json +5 -0
- package/dist/dist-esm/react-components/src/localization/locales/cy-GB/strings.json +5 -0
- package/dist/dist-esm/react-components/src/localization/locales/de-DE/strings.json +5 -0
- package/dist/dist-esm/react-components/src/localization/locales/en-GB/strings.json +5 -0
- package/dist/dist-esm/react-components/src/localization/locales/en-US/strings.json +5 -0
- package/dist/dist-esm/react-components/src/localization/locales/es-ES/strings.json +5 -0
- package/dist/dist-esm/react-components/src/localization/locales/es-MX/strings.json +5 -0
- package/dist/dist-esm/react-components/src/localization/locales/fi-FI/strings.json +5 -0
- package/dist/dist-esm/react-components/src/localization/locales/fr-CA/strings.json +5 -0
- package/dist/dist-esm/react-components/src/localization/locales/fr-FR/strings.json +5 -0
- package/dist/dist-esm/react-components/src/localization/locales/he-IL/strings.json +5 -0
- package/dist/dist-esm/react-components/src/localization/locales/it-IT/strings.json +5 -0
- package/dist/dist-esm/react-components/src/localization/locales/ja-JP/strings.json +5 -0
- package/dist/dist-esm/react-components/src/localization/locales/ko-KR/strings.json +5 -0
- package/dist/dist-esm/react-components/src/localization/locales/nb-NO/strings.json +5 -0
- package/dist/dist-esm/react-components/src/localization/locales/nl-NL/strings.json +5 -0
- package/dist/dist-esm/react-components/src/localization/locales/pl-PL/strings.json +5 -0
- package/dist/dist-esm/react-components/src/localization/locales/pt-BR/strings.json +5 -0
- package/dist/dist-esm/react-components/src/localization/locales/ru-RU/strings.json +5 -0
- package/dist/dist-esm/react-components/src/localization/locales/sv-SE/strings.json +5 -0
- package/dist/dist-esm/react-components/src/localization/locales/tr-TR/strings.json +5 -0
- package/dist/dist-esm/react-components/src/localization/locales/zh-CN/strings.json +5 -0
- package/dist/dist-esm/react-components/src/localization/locales/zh-TW/strings.json +5 -0
- package/dist/dist-esm/react-components/src/theming/FluentThemeProvider.js +0 -1
- package/dist/dist-esm/react-components/src/theming/FluentThemeProvider.js.map +1 -1
- package/dist/dist-esm/react-components/src/theming/icons.d.ts +1 -29
- package/dist/dist-esm/react-components/src/theming/icons.js +2 -91
- package/dist/dist-esm/react-components/src/theming/icons.js.map +1 -1
- package/dist/dist-esm/react-components/src/theming/themes.d.ts +0 -6
- package/dist/dist-esm/react-components/src/theming/themes.js +0 -9
- package/dist/dist-esm/react-components/src/theming/themes.js.map +1 -1
- package/dist/dist-esm/react-components/src/types/Attachment.d.ts +0 -13
- package/dist/dist-esm/react-components/src/types/Attachment.js.map +1 -1
- package/dist/dist-esm/react-components/src/types/ChatMessage.d.ts +1 -20
- package/dist/dist-esm/react-components/src/types/ChatMessage.js.map +1 -1
- package/dist/dist-esm/react-components/src/types/index.d.ts +0 -1
- package/dist/dist-esm/react-components/src/types/index.js +0 -1
- package/dist/dist-esm/react-components/src/types/index.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/CallComposite.d.ts +0 -72
- package/dist/dist-esm/react-composites/src/composites/CallComposite/CallComposite.js +11 -21
- package/dist/dist-esm/react-composites/src/composites/CallComposite/CallComposite.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/Strings.d.ts +0 -64
- package/dist/dist-esm/react-composites/src/composites/CallComposite/Strings.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/AzureCommunicationCallAdapter.d.ts +5 -48
- package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/AzureCommunicationCallAdapter.js +29 -89
- package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/AzureCommunicationCallAdapter.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/CallAdapter.d.ts +1 -72
- package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/CallAdapter.js +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/CallAdapter.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/index.d.ts +0 -3
- package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/index.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/components/BreakoutRoomsBanner.js +6 -2
- package/dist/dist-esm/react-composites/src/composites/CallComposite/components/BreakoutRoomsBanner.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/components/CallArrangement.js +3 -7
- 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/ConfigurationPageCameraDropdown.d.ts +0 -2
- package/dist/dist-esm/react-composites/src/composites/CallComposite/components/ConfigurationPageCameraDropdown.js +0 -19
- package/dist/dist-esm/react-composites/src/composites/CallComposite/components/ConfigurationPageCameraDropdown.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/components/ConfigurationPageErrorBar.js +2 -10
- package/dist/dist-esm/react-composites/src/composites/CallComposite/components/ConfigurationPageErrorBar.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/components/ConfigurationPageMicDropdown.d.ts +0 -2
- package/dist/dist-esm/react-composites/src/composites/CallComposite/components/ConfigurationPageMicDropdown.js +0 -19
- package/dist/dist-esm/react-composites/src/composites/CallComposite/components/ConfigurationPageMicDropdown.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/components/LocalDeviceSettings.d.ts +0 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/components/LocalDeviceSettings.js +3 -5
- package/dist/dist-esm/react-composites/src/composites/CallComposite/components/LocalDeviceSettings.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/components/SidePane/usePeoplePane.js +9 -0
- package/dist/dist-esm/react-composites/src/composites/CallComposite/components/SidePane/usePeoplePane.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/hooks/useHandlers.js +1 -19
- package/dist/dist-esm/react-composites/src/composites/CallComposite/hooks/useHandlers.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/index.d.ts +0 -4
- package/dist/dist-esm/react-composites/src/composites/CallComposite/index.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/CallPage.js +26 -2
- package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/CallPage.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/ConfigurationPage.d.ts +0 -7
- package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/ConfigurationPage.js +24 -46
- package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/ConfigurationPage.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/HoldPage.js +2 -2
- package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/HoldPage.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/LobbyPage.js +2 -2
- package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/LobbyPage.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/TransferPage.js +2 -2
- package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/TransferPage.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/selectors/baseSelectors.d.ts +0 -24
- package/dist/dist-esm/react-composites/src/composites/CallComposite/selectors/baseSelectors.js +0 -24
- package/dist/dist-esm/react-composites/src/composites/CallComposite/selectors/baseSelectors.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/styles/CallComposite.styles.js +3 -3
- package/dist/dist-esm/react-composites/src/composites/CallComposite/styles/CallComposite.styles.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/styles/CallConfiguration.styles.d.ts +2 -2
- package/dist/dist-esm/react-composites/src/composites/CallComposite/styles/CallConfiguration.styles.js +12 -11
- package/dist/dist-esm/react-composites/src/composites/CallComposite/styles/CallConfiguration.styles.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/utils/Utils.d.ts +1 -12
- package/dist/dist-esm/react-composites/src/composites/CallComposite/utils/Utils.js +4 -60
- package/dist/dist-esm/react-composites/src/composites/CallComposite/utils/Utils.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/CallWithChatComposite.d.ts +0 -65
- package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/CallWithChatComposite.js +7 -13
- package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/CallWithChatComposite.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/AzureCommunicationCallWithChatAdapter.d.ts +3 -20
- package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/AzureCommunicationCallWithChatAdapter.js +23 -62
- package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/AzureCommunicationCallWithChatAdapter.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/CallWithChatAdapter.d.ts +3 -73
- package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/CallWithChatAdapter.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/CallWithChatBackedCallAdapter.d.ts +0 -7
- package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/CallWithChatBackedCallAdapter.js +0 -12
- package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/CallWithChatBackedCallAdapter.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/CallWithChatBackedChatAdapter.d.ts +4 -10
- package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/CallWithChatBackedChatAdapter.js +2 -14
- package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/CallWithChatBackedChatAdapter.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/state/CallWithChatAdapterState.d.ts +0 -8
- package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/state/CallWithChatAdapterState.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/ChatComposite/ChatComposite.d.ts +0 -27
- package/dist/dist-esm/react-composites/src/composites/ChatComposite/ChatComposite.js +1 -2
- package/dist/dist-esm/react-composites/src/composites/ChatComposite/ChatComposite.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/ChatComposite/ChatScreen.d.ts +0 -2
- package/dist/dist-esm/react-composites/src/composites/ChatComposite/ChatScreen.js +11 -189
- package/dist/dist-esm/react-composites/src/composites/ChatComposite/ChatScreen.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/ChatComposite/Strings.d.ts +0 -20
- package/dist/dist-esm/react-composites/src/composites/ChatComposite/Strings.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/ChatComposite/adapter/AzureCommunicationChatAdapter.d.ts +2 -6
- package/dist/dist-esm/react-composites/src/composites/ChatComposite/adapter/AzureCommunicationChatAdapter.js +0 -36
- package/dist/dist-esm/react-composites/src/composites/ChatComposite/adapter/AzureCommunicationChatAdapter.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/ChatComposite/adapter/ChatAdapter.d.ts +2 -12
- package/dist/dist-esm/react-composites/src/composites/ChatComposite/adapter/ChatAdapter.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/ChatComposite/hooks/useHandlers.js +2 -13
- package/dist/dist-esm/react-composites/src/composites/ChatComposite/hooks/useHandlers.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/ChatComposite/index.d.ts +0 -2
- package/dist/dist-esm/react-composites/src/composites/ChatComposite/index.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/ChatComposite/selectors/baseSelectors.d.ts +0 -4
- package/dist/dist-esm/react-composites/src/composites/ChatComposite/selectors/baseSelectors.js +0 -4
- package/dist/dist-esm/react-composites/src/composites/ChatComposite/selectors/baseSelectors.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/common/CallingCaptionsBanner.d.ts +0 -1
- package/dist/dist-esm/react-composites/src/composites/common/CallingCaptionsBanner.js +3 -13
- package/dist/dist-esm/react-composites/src/composites/common/CallingCaptionsBanner.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/common/ControlBar/CommonCallControlBar.d.ts +0 -2
- package/dist/dist-esm/react-composites/src/composites/common/ControlBar/CommonCallControlBar.js +6 -13
- package/dist/dist-esm/react-composites/src/composites/common/ControlBar/CommonCallControlBar.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/common/ControlBar/DesktopMoreButton.d.ts +0 -3
- package/dist/dist-esm/react-composites/src/composites/common/ControlBar/DesktopMoreButton.js +2 -85
- package/dist/dist-esm/react-composites/src/composites/common/ControlBar/DesktopMoreButton.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/common/ControlBar/PeopleButton.js +0 -1
- package/dist/dist-esm/react-composites/src/composites/common/ControlBar/PeopleButton.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/common/Drawer/MoreDrawer.d.ts +0 -3
- package/dist/dist-esm/react-composites/src/composites/common/Drawer/MoreDrawer.js +9 -70
- package/dist/dist-esm/react-composites/src/composites/common/Drawer/MoreDrawer.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/common/Drawer/PreparedMoreDrawer.d.ts +0 -3
- package/dist/dist-esm/react-composites/src/composites/common/Drawer/PreparedMoreDrawer.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/common/ParticipantContainer.js +1 -2
- package/dist/dist-esm/react-composites/src/composites/common/ParticipantContainer.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/common/PeoplePaneContent.js +1 -0
- package/dist/dist-esm/react-composites/src/composites/common/PeoplePaneContent.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/common/SendBoxPicker.d.ts +2 -41
- package/dist/dist-esm/react-composites/src/composites/common/SendBoxPicker.js +0 -21
- package/dist/dist-esm/react-composites/src/composites/common/SendBoxPicker.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/common/constants.d.ts +0 -5
- package/dist/dist-esm/react-composites/src/composites/common/constants.js +0 -5
- package/dist/dist-esm/react-composites/src/composites/common/constants.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/common/icons.d.ts +2 -33
- package/dist/dist-esm/react-composites/src/composites/common/icons.js +1 -5
- package/dist/dist-esm/react-composites/src/composites/common/icons.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/localization/locales/ar-SA/strings.json +1 -1
- package/dist/dist-esm/react-composites/src/composites/localization/locales/cs-CZ/strings.json +1 -1
- package/dist/dist-esm/react-composites/src/composites/localization/locales/cy-GB/strings.json +1 -1
- package/dist/dist-esm/react-composites/src/composites/localization/locales/de-DE/strings.json +1 -1
- package/dist/dist-esm/react-composites/src/composites/localization/locales/en-GB/strings.json +1 -1
- package/dist/dist-esm/react-composites/src/composites/localization/locales/en-US/strings.json +1 -1
- package/dist/dist-esm/react-composites/src/composites/localization/locales/es-ES/strings.json +1 -1
- package/dist/dist-esm/react-composites/src/composites/localization/locales/es-MX/strings.json +1 -1
- package/dist/dist-esm/react-composites/src/composites/localization/locales/fi-FI/strings.json +1 -1
- package/dist/dist-esm/react-composites/src/composites/localization/locales/fr-CA/strings.json +1 -1
- package/dist/dist-esm/react-composites/src/composites/localization/locales/fr-FR/strings.json +1 -1
- package/dist/dist-esm/react-composites/src/composites/localization/locales/he-IL/strings.json +1 -1
- package/dist/dist-esm/react-composites/src/composites/localization/locales/it-IT/strings.json +1 -1
- package/dist/dist-esm/react-composites/src/composites/localization/locales/ja-JP/strings.json +1 -1
- package/dist/dist-esm/react-composites/src/composites/localization/locales/ko-KR/strings.json +1 -1
- package/dist/dist-esm/react-composites/src/composites/localization/locales/nb-NO/strings.json +1 -1
- package/dist/dist-esm/react-composites/src/composites/localization/locales/nl-NL/strings.json +1 -1
- package/dist/dist-esm/react-composites/src/composites/localization/locales/pl-PL/strings.json +1 -1
- package/dist/dist-esm/react-composites/src/composites/localization/locales/pt-BR/strings.json +1 -1
- package/dist/dist-esm/react-composites/src/composites/localization/locales/ru-RU/strings.json +1 -1
- package/dist/dist-esm/react-composites/src/composites/localization/locales/sv-SE/strings.json +1 -1
- package/dist/dist-esm/react-composites/src/composites/localization/locales/tr-TR/strings.json +1 -1
- package/dist/dist-esm/react-composites/src/composites/localization/locales/zh-CN/strings.json +1 -1
- package/dist/dist-esm/react-composites/src/composites/localization/locales/zh-TW/strings.json +1 -1
- package/package.json +3 -3
- package/dist/dist-cjs/communication-react/ChatMessageComponentAsRichTextEditBox-ClQ2m7aI.js +0 -206
- package/dist/dist-cjs/communication-react/ChatMessageComponentAsRichTextEditBox-ClQ2m7aI.js.map +0 -1
- package/dist/dist-cjs/communication-react/RichTextSendBoxWrapper-Bhftq9li.js +0 -50
- package/dist/dist-cjs/communication-react/RichTextSendBoxWrapper-Bhftq9li.js.map +0 -1
- package/dist/dist-cjs/communication-react/index-CcIzeubJ.js +0 -45677
- package/dist/dist-cjs/communication-react/index-CcIzeubJ.js.map +0 -1
- package/dist/dist-esm/acs-ui-common/src/dataConversion.d.ts +0 -6
- package/dist/dist-esm/acs-ui-common/src/dataConversion.js +0 -20
- package/dist/dist-esm/acs-ui-common/src/dataConversion.js.map +0 -1
- package/dist/dist-esm/acs-ui-common/src/removeImageTags.d.ts +0 -7
- package/dist/dist-esm/acs-ui-common/src/removeImageTags.js +0 -18
- package/dist/dist-esm/acs-ui-common/src/removeImageTags.js.map +0 -1
- package/dist/dist-esm/calling-stateful-client/src/CallFeatureStreamUtils.d.ts +0 -14
- package/dist/dist-esm/calling-stateful-client/src/CallFeatureStreamUtils.js +0 -204
- package/dist/dist-esm/calling-stateful-client/src/CallFeatureStreamUtils.js.map +0 -1
- package/dist/dist-esm/calling-stateful-client/src/LocalRecordingSubscriber.d.ts +0 -17
- package/dist/dist-esm/calling-stateful-client/src/LocalRecordingSubscriber.js +0 -33
- package/dist/dist-esm/calling-stateful-client/src/LocalRecordingSubscriber.js.map +0 -1
- package/dist/dist-esm/calling-stateful-client/src/RealTimeTextSubscriber.d.ts +0 -16
- package/dist/dist-esm/calling-stateful-client/src/RealTimeTextSubscriber.js +0 -22
- package/dist/dist-esm/calling-stateful-client/src/RealTimeTextSubscriber.js.map +0 -1
- package/dist/dist-esm/calling-stateful-client/src/TogetherModeSubscriber.d.ts +0 -24
- package/dist/dist-esm/calling-stateful-client/src/TogetherModeSubscriber.js +0 -60
- package/dist/dist-esm/calling-stateful-client/src/TogetherModeSubscriber.js.map +0 -1
- package/dist/dist-esm/calling-stateful-client/src/TogetherModeVideoStreamSubscriber.d.ts +0 -18
- package/dist/dist-esm/calling-stateful-client/src/TogetherModeVideoStreamSubscriber.js +0 -31
- package/dist/dist-esm/calling-stateful-client/src/TogetherModeVideoStreamSubscriber.js.map +0 -1
- package/dist/dist-esm/chat-component-bindings/src/utils/getImageAttachmentsFromHTMLContent.d.ts +0 -6
- package/dist/dist-esm/chat-component-bindings/src/utils/getImageAttachmentsFromHTMLContent.js +0 -20
- package/dist/dist-esm/chat-component-bindings/src/utils/getImageAttachmentsFromHTMLContent.js.map +0 -1
- package/dist/dist-esm/react-components/src/components/ChatMessage/MentionRenderer.d.ts +0 -10
- package/dist/dist-esm/react-components/src/components/ChatMessage/MentionRenderer.js +0 -15
- package/dist/dist-esm/react-components/src/components/ChatMessage/MentionRenderer.js.map +0 -1
- package/dist/dist-esm/react-components/src/components/ChatMessage/MyMessageComponents/ChatMessageComponentAsRichTextEditBox.d.ts +0 -24
- package/dist/dist-esm/react-components/src/components/ChatMessage/MyMessageComponents/ChatMessageComponentAsRichTextEditBox.js +0 -196
- package/dist/dist-esm/react-components/src/components/ChatMessage/MyMessageComponents/ChatMessageComponentAsRichTextEditBox.js.map +0 -1
- package/dist/dist-esm/react-components/src/components/DevicePermissions/BrowserPermissionDenied.d.ts +0 -69
- package/dist/dist-esm/react-components/src/components/DevicePermissions/BrowserPermissionDenied.js +0 -36
- package/dist/dist-esm/react-components/src/components/DevicePermissions/BrowserPermissionDenied.js.map +0 -1
- package/dist/dist-esm/react-components/src/components/DevicePermissions/BrowserPermissionDeniedIOS.d.ts +0 -75
- package/dist/dist-esm/react-components/src/components/DevicePermissions/BrowserPermissionDeniedIOS.js +0 -67
- package/dist/dist-esm/react-components/src/components/DevicePermissions/BrowserPermissionDeniedIOS.js.map +0 -1
- package/dist/dist-esm/react-components/src/components/DevicePermissions/SitePermissions.d.ts +0 -105
- package/dist/dist-esm/react-components/src/components/DevicePermissions/SitePermissions.js +0 -51
- package/dist/dist-esm/react-components/src/components/DevicePermissions/SitePermissions.js.map +0 -1
- package/dist/dist-esm/react-components/src/components/DevicePermissions/SitePermissionsScaffolding.d.ts +0 -86
- package/dist/dist-esm/react-components/src/components/DevicePermissions/SitePermissionsScaffolding.js +0 -40
- package/dist/dist-esm/react-components/src/components/DevicePermissions/SitePermissionsScaffolding.js.map +0 -1
- package/dist/dist-esm/react-components/src/components/MentionPopover.d.ts +0 -121
- package/dist/dist-esm/react-components/src/components/MentionPopover.js +0 -119
- package/dist/dist-esm/react-components/src/components/MentionPopover.js.map +0 -1
- package/dist/dist-esm/react-components/src/components/RTTDisclosureBanner.d.ts +0 -28
- package/dist/dist-esm/react-components/src/components/RTTDisclosureBanner.js +0 -26
- package/dist/dist-esm/react-components/src/components/RTTDisclosureBanner.js.map +0 -1
- package/dist/dist-esm/react-components/src/components/RealTimeText.d.ts +0 -58
- package/dist/dist-esm/react-components/src/components/RealTimeText.js +0 -38
- package/dist/dist-esm/react-components/src/components/RealTimeText.js.map +0 -1
- package/dist/dist-esm/react-components/src/components/RealTimeTextModal.d.ts +0 -42
- package/dist/dist-esm/react-components/src/components/RealTimeTextModal.js +0 -53
- package/dist/dist-esm/react-components/src/components/RealTimeTextModal.js.map +0 -1
- package/dist/dist-esm/react-components/src/components/RichTextEditor/Plugins/ContextMenuPlugin.d.ts +0 -9
- package/dist/dist-esm/react-components/src/components/RichTextEditor/Plugins/ContextMenuPlugin.js +0 -29
- package/dist/dist-esm/react-components/src/components/RichTextEditor/Plugins/ContextMenuPlugin.js.map +0 -1
- package/dist/dist-esm/react-components/src/components/RichTextEditor/Plugins/CopyPastePlugin.d.ts +0 -30
- package/dist/dist-esm/react-components/src/components/RichTextEditor/Plugins/CopyPastePlugin.js +0 -98
- package/dist/dist-esm/react-components/src/components/RichTextEditor/Plugins/CopyPastePlugin.js.map +0 -1
- package/dist/dist-esm/react-components/src/components/RichTextEditor/Plugins/KeyboardInputPlugin.d.ts +0 -19
- package/dist/dist-esm/react-components/src/components/RichTextEditor/Plugins/KeyboardInputPlugin.js +0 -43
- package/dist/dist-esm/react-components/src/components/RichTextEditor/Plugins/KeyboardInputPlugin.js.map +0 -1
- package/dist/dist-esm/react-components/src/components/RichTextEditor/Plugins/PlaceholderPlugin.d.ts +0 -15
- package/dist/dist-esm/react-components/src/components/RichTextEditor/Plugins/PlaceholderPlugin.js +0 -42
- package/dist/dist-esm/react-components/src/components/RichTextEditor/Plugins/PlaceholderPlugin.js.map +0 -1
- package/dist/dist-esm/react-components/src/components/RichTextEditor/Plugins/RichTextToolbarPlugin.d.ts +0 -24
- package/dist/dist-esm/react-components/src/components/RichTextEditor/Plugins/RichTextToolbarPlugin.js +0 -64
- package/dist/dist-esm/react-components/src/components/RichTextEditor/Plugins/RichTextToolbarPlugin.js.map +0 -1
- package/dist/dist-esm/react-components/src/components/RichTextEditor/Plugins/TableEditContextMenuProvider.d.ts +0 -20
- package/dist/dist-esm/react-components/src/components/RichTextEditor/Plugins/TableEditContextMenuProvider.js +0 -45
- package/dist/dist-esm/react-components/src/components/RichTextEditor/Plugins/TableEditContextMenuProvider.js.map +0 -1
- package/dist/dist-esm/react-components/src/components/RichTextEditor/Plugins/UndoRedoPlugin.d.ts +0 -14
- package/dist/dist-esm/react-components/src/components/RichTextEditor/Plugins/UndoRedoPlugin.js +0 -42
- package/dist/dist-esm/react-components/src/components/RichTextEditor/Plugins/UndoRedoPlugin.js.map +0 -1
- package/dist/dist-esm/react-components/src/components/RichTextEditor/Plugins/UpdateContentPlugin.d.ts +0 -30
- package/dist/dist-esm/react-components/src/components/RichTextEditor/Plugins/UpdateContentPlugin.js +0 -99
- package/dist/dist-esm/react-components/src/components/RichTextEditor/Plugins/UpdateContentPlugin.js.map +0 -1
- package/dist/dist-esm/react-components/src/components/RichTextEditor/RichTextEditor.d.ts +0 -59
- package/dist/dist-esm/react-components/src/components/RichTextEditor/RichTextEditor.js +0 -336
- package/dist/dist-esm/react-components/src/components/RichTextEditor/RichTextEditor.js.map +0 -1
- package/dist/dist-esm/react-components/src/components/RichTextEditor/RichTextInputBoxComponent.d.ts +0 -37
- package/dist/dist-esm/react-components/src/components/RichTextEditor/RichTextInputBoxComponent.js +0 -78
- package/dist/dist-esm/react-components/src/components/RichTextEditor/RichTextInputBoxComponent.js.map +0 -1
- package/dist/dist-esm/react-components/src/components/RichTextEditor/RichTextSendBox.d.ts +0 -215
- package/dist/dist-esm/react-components/src/components/RichTextEditor/RichTextSendBox.js +0 -173
- package/dist/dist-esm/react-components/src/components/RichTextEditor/RichTextSendBox.js.map +0 -1
- package/dist/dist-esm/react-components/src/components/RichTextEditor/RichTextSendBoxErrors.d.ts +0 -16
- package/dist/dist-esm/react-components/src/components/RichTextEditor/RichTextSendBoxErrors.js +0 -75
- package/dist/dist-esm/react-components/src/components/RichTextEditor/RichTextSendBoxErrors.js.map +0 -1
- package/dist/dist-esm/react-components/src/components/RichTextEditor/Toolbar/RichTextToolbar.d.ts +0 -19
- package/dist/dist-esm/react-components/src/components/RichTextEditor/Toolbar/RichTextToolbar.js +0 -221
- package/dist/dist-esm/react-components/src/components/RichTextEditor/Toolbar/RichTextToolbar.js.map +0 -1
- package/dist/dist-esm/react-components/src/components/RichTextEditor/Toolbar/Table/RichTextInsertTableCommandBarItem.d.ts +0 -7
- package/dist/dist-esm/react-components/src/components/RichTextEditor/Toolbar/Table/RichTextInsertTableCommandBarItem.js +0 -51
- package/dist/dist-esm/react-components/src/components/RichTextEditor/Toolbar/Table/RichTextInsertTableCommandBarItem.js.map +0 -1
- package/dist/dist-esm/react-components/src/components/RichTextEditor/Toolbar/Table/RichTextInsertTablePane.d.ts +0 -15
- package/dist/dist-esm/react-components/src/components/RichTextEditor/Toolbar/Table/RichTextInsertTablePane.js +0 -64
- package/dist/dist-esm/react-components/src/components/RichTextEditor/Toolbar/Table/RichTextInsertTablePane.js.map +0 -1
- package/dist/dist-esm/react-components/src/components/RichTextEditor/Toolbar/Table/RichTextToolbarTableIcon.d.ts +0 -6
- package/dist/dist-esm/react-components/src/components/RichTextEditor/Toolbar/Table/RichTextToolbarTableIcon.js +0 -13
- package/dist/dist-esm/react-components/src/components/RichTextEditor/Toolbar/Table/RichTextToolbarTableIcon.js.map +0 -1
- package/dist/dist-esm/react-components/src/components/SendBoxErrorBar.d.ts +0 -56
- package/dist/dist-esm/react-components/src/components/SendBoxErrorBar.js +0 -75
- package/dist/dist-esm/react-components/src/components/SendBoxErrorBar.js.map +0 -1
- package/dist/dist-esm/react-components/src/components/SendBoxErrors.d.ts +0 -14
- package/dist/dist-esm/react-components/src/components/SendBoxErrors.js +0 -18
- package/dist/dist-esm/react-components/src/components/SendBoxErrors.js.map +0 -1
- package/dist/dist-esm/react-components/src/components/StartRealTimeTextButton.d.ts +0 -48
- package/dist/dist-esm/react-components/src/components/StartRealTimeTextButton.js +0 -25
- package/dist/dist-esm/react-components/src/components/StartRealTimeTextButton.js.map +0 -1
- package/dist/dist-esm/react-components/src/components/TextFieldWithMention/TextFieldWithMention.d.ts +0 -24
- package/dist/dist-esm/react-components/src/components/TextFieldWithMention/TextFieldWithMention.js +0 -550
- package/dist/dist-esm/react-components/src/components/TextFieldWithMention/TextFieldWithMention.js.map +0 -1
- package/dist/dist-esm/react-components/src/components/TextFieldWithMention/mentionTagUtils.d.ts +0 -152
- package/dist/dist-esm/react-components/src/components/TextFieldWithMention/mentionTagUtils.js +0 -819
- package/dist/dist-esm/react-components/src/components/TextFieldWithMention/mentionTagUtils.js.map +0 -1
- package/dist/dist-esm/react-components/src/components/TogetherModeOverlay.d.ts +0 -15
- package/dist/dist-esm/react-components/src/components/TogetherModeOverlay.js +0 -91
- package/dist/dist-esm/react-components/src/components/TogetherModeOverlay.js.map +0 -1
- package/dist/dist-esm/react-components/src/components/VideoGallery/TogetherModeLayout.d.ts +0 -10
- package/dist/dist-esm/react-components/src/components/VideoGallery/TogetherModeLayout.js +0 -14
- package/dist/dist-esm/react-components/src/components/VideoGallery/TogetherModeLayout.js.map +0 -1
- package/dist/dist-esm/react-components/src/components/VideoGallery/TogetherModeStream.d.ts +0 -23
- package/dist/dist-esm/react-components/src/components/VideoGallery/TogetherModeStream.js +0 -47
- package/dist/dist-esm/react-components/src/components/VideoGallery/TogetherModeStream.js.map +0 -1
- package/dist/dist-esm/react-components/src/components/styles/BrowserPermissionDenied.styles.d.ts +0 -58
- package/dist/dist-esm/react-components/src/components/styles/BrowserPermissionDenied.styles.js +0 -144
- package/dist/dist-esm/react-components/src/components/styles/BrowserPermissionDenied.styles.js.map +0 -1
- package/dist/dist-esm/react-components/src/components/styles/MentionPopover.style.d.ts +0 -26
- package/dist/dist-esm/react-components/src/components/styles/MentionPopover.style.js +0 -69
- package/dist/dist-esm/react-components/src/components/styles/MentionPopover.style.js.map +0 -1
- package/dist/dist-esm/react-components/src/components/styles/RTTDisclosureBanner.styles.d.ts +0 -10
- package/dist/dist-esm/react-components/src/components/styles/RTTDisclosureBanner.styles.js +0 -23
- package/dist/dist-esm/react-components/src/components/styles/RTTDisclosureBanner.styles.js.map +0 -1
- package/dist/dist-esm/react-components/src/components/styles/RichTextEditor.styles.d.ts +0 -82
- package/dist/dist-esm/react-components/src/components/styles/RichTextEditor.styles.js +0 -320
- package/dist/dist-esm/react-components/src/components/styles/RichTextEditor.styles.js.map +0 -1
- package/dist/dist-esm/react-components/src/components/styles/RichTextInputBoxComponent.styles.d.ts +0 -21
- package/dist/dist-esm/react-components/src/components/styles/RichTextInputBoxComponent.styles.js +0 -38
- package/dist/dist-esm/react-components/src/components/styles/RichTextInputBoxComponent.styles.js.map +0 -1
- package/dist/dist-esm/react-components/src/components/styles/SitePermissions.styles.d.ts +0 -38
- package/dist/dist-esm/react-components/src/components/styles/SitePermissions.styles.js +0 -99
- package/dist/dist-esm/react-components/src/components/styles/SitePermissions.styles.js.map +0 -1
- package/dist/dist-esm/react-components/src/components/styles/Stack.style.d.ts +0 -5
- package/dist/dist-esm/react-components/src/components/styles/Stack.style.js +0 -32
- package/dist/dist-esm/react-components/src/components/styles/Stack.style.js.map +0 -1
- package/dist/dist-esm/react-components/src/components/styles/TogetherMode.styles.d.ts +0 -98
- package/dist/dist-esm/react-components/src/components/styles/TogetherMode.styles.js +0 -181
- package/dist/dist-esm/react-components/src/components/styles/TogetherMode.styles.js.map +0 -1
- package/dist/dist-esm/react-components/src/components/styles/UnsupportedEnvironment.styles.d.ts +0 -26
- package/dist/dist-esm/react-components/src/components/styles/UnsupportedEnvironment.styles.js +0 -69
- package/dist/dist-esm/react-components/src/components/styles/UnsupportedEnvironment.styles.js.map +0 -1
- package/dist/dist-esm/react-components/src/components/utils/RichTextEditorUtils.d.ts +0 -73
- package/dist/dist-esm/react-components/src/components/utils/RichTextEditorUtils.js +0 -178
- package/dist/dist-esm/react-components/src/components/utils/RichTextEditorUtils.js.map +0 -1
- package/dist/dist-esm/react-components/src/components/utils/RichTextTableUtils.d.ts +0 -33
- package/dist/dist-esm/react-components/src/components/utils/RichTextTableUtils.js +0 -119
- package/dist/dist-esm/react-components/src/components/utils/RichTextTableUtils.js.map +0 -1
- package/dist/dist-esm/react-components/src/components/utils/merge.d.ts +0 -7
- package/dist/dist-esm/react-components/src/components/utils/merge.js +0 -16
- package/dist/dist-esm/react-components/src/components/utils/merge.js.map +0 -1
- package/dist/dist-esm/react-components/src/components/utils/sortCaptionsAndRealTimeTexts.d.ts +0 -8
- package/dist/dist-esm/react-components/src/components/utils/sortCaptionsAndRealTimeTexts.js +0 -17
- package/dist/dist-esm/react-components/src/components/utils/sortCaptionsAndRealTimeTexts.js.map +0 -1
- package/dist/dist-esm/react-components/src/theming/icons.styles.d.ts +0 -6
- package/dist/dist-esm/react-components/src/theming/icons.styles.js +0 -25
- package/dist/dist-esm/react-components/src/theming/icons.styles.js.map +0 -1
- package/dist/dist-esm/react-components/src/types/TogetherModeTypes.d.ts +0 -38
- package/dist/dist-esm/react-components/src/types/TogetherModeTypes.js +0 -2
- package/dist/dist-esm/react-components/src/types/TogetherModeTypes.js.map +0 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/components/CallReadinessModal.d.ts +0 -49
- package/dist/dist-esm/react-composites/src/composites/CallComposite/components/CallReadinessModal.js +0 -203
- package/dist/dist-esm/react-composites/src/composites/CallComposite/components/CallReadinessModal.js.map +0 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/UnsupportedBrowser.d.ts +0 -15
- package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/UnsupportedBrowser.js +0 -41
- package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/UnsupportedBrowser.js.map +0 -1
- package/dist/dist-esm/react-composites/src/composites/ChatComposite/AttachmentDownloadErrorBar.d.ts +0 -15
- package/dist/dist-esm/react-composites/src/composites/ChatComposite/AttachmentDownloadErrorBar.js +0 -23
- package/dist/dist-esm/react-composites/src/composites/ChatComposite/AttachmentDownloadErrorBar.js.map +0 -1
- package/dist/dist-esm/react-composites/src/composites/ChatComposite/ChatScreenPeoplePane.d.ts +0 -18
- package/dist/dist-esm/react-composites/src/composites/ChatComposite/ChatScreenPeoplePane.js +0 -18
- package/dist/dist-esm/react-composites/src/composites/ChatComposite/ChatScreenPeoplePane.js.map +0 -1
- package/dist/dist-esm/react-composites/src/composites/ChatComposite/ImageUpload/ImageUploadReducer.d.ts +0 -49
- package/dist/dist-esm/react-composites/src/composites/ChatComposite/ImageUpload/ImageUploadReducer.js +0 -44
- package/dist/dist-esm/react-composites/src/composites/ChatComposite/ImageUpload/ImageUploadReducer.js.map +0 -1
- package/dist/dist-esm/react-composites/src/composites/ChatComposite/ImageUpload/ImageUploadUtils.d.ts +0 -39
- package/dist/dist-esm/react-composites/src/composites/ChatComposite/ImageUpload/ImageUploadUtils.js +0 -265
- package/dist/dist-esm/react-composites/src/composites/ChatComposite/ImageUpload/ImageUploadUtils.js.map +0 -1
- package/dist/dist-esm/react-composites/src/composites/ChatComposite/file-sharing/AttachmentUpload.d.ts +0 -80
- package/dist/dist-esm/react-composites/src/composites/ChatComposite/file-sharing/AttachmentUpload.js +0 -36
- package/dist/dist-esm/react-composites/src/composites/ChatComposite/file-sharing/AttachmentUpload.js.map +0 -1
- package/dist/dist-esm/react-composites/src/composites/ChatComposite/file-sharing/AttachmentUploadButton.d.ts +0 -38
- package/dist/dist-esm/react-composites/src/composites/ChatComposite/file-sharing/AttachmentUploadButton.js +0 -67
- package/dist/dist-esm/react-composites/src/composites/ChatComposite/file-sharing/AttachmentUploadButton.js.map +0 -1
- package/dist/dist-esm/react-composites/src/composites/ChatComposite/file-sharing/index.d.ts +0 -5
- package/dist/dist-esm/react-composites/src/composites/ChatComposite/file-sharing/index.js +0 -5
- package/dist/dist-esm/react-composites/src/composites/ChatComposite/file-sharing/index.js.map +0 -1
- package/dist/dist-esm/react-composites/src/composites/common/CallingRealTimeTextModal.d.ts +0 -12
- package/dist/dist-esm/react-composites/src/composites/common/CallingRealTimeTextModal.js +0 -19
- package/dist/dist-esm/react-composites/src/composites/common/CallingRealTimeTextModal.js.map +0 -1
- package/dist/dist-esm/react-composites/src/composites/common/RichTextSendBoxWrapper.d.ts +0 -10
- package/dist/dist-esm/react-composites/src/composites/common/RichTextSendBoxWrapper.js +0 -16
- package/dist/dist-esm/react-composites/src/composites/common/RichTextSendBoxWrapper.js.map +0 -1
@@ -1,336 +0,0 @@
|
|
1
|
-
// Copyright (c) Microsoft Corporation.
|
2
|
-
// Licensed under the MIT License.
|
3
|
-
import React, { useCallback, useEffect, useImperativeHandle, useMemo, useRef, useState } from 'react';
|
4
|
-
import { richTextEditorWrapperStyle, richTextEditorStyle } from '../styles/RichTextEditor.styles';
|
5
|
-
import { useTheme } from '../../theming';
|
6
|
-
import { isDarkThemed } from '../../theming/themeUtils';
|
7
|
-
import CopyPastePlugin from './Plugins/CopyPastePlugin';
|
8
|
-
import { createModelFromHtml, Editor, exportContent } from 'roosterjs-content-model-core';
|
9
|
-
import { createBr, createEmptyModel, createParagraph, createSelectionMarker, setSelection } from 'roosterjs-content-model-dom';
|
10
|
-
import { KeyboardInputPlugin } from './Plugins/KeyboardInputPlugin';
|
11
|
-
import { AutoFormatPlugin, EditPlugin, PastePlugin, ShortcutPlugin, DefaultSanitizers } from 'roosterjs-content-model-plugins';
|
12
|
-
import { UpdateContentPlugin, UpdateEvent } from './Plugins/UpdateContentPlugin';
|
13
|
-
import { RichTextToolbar } from './Toolbar/RichTextToolbar';
|
14
|
-
import { RichTextToolbarPlugin } from './Plugins/RichTextToolbarPlugin';
|
15
|
-
import { ContextMenuPlugin } from './Plugins/ContextMenuPlugin';
|
16
|
-
import { TableEditContextMenuProvider } from './Plugins/TableEditContextMenuProvider';
|
17
|
-
import { borderApplier, dataSetApplier } from '../utils/RichTextEditorUtils';
|
18
|
-
import { getPreviousInlineImages, getRemovedInlineImages, removeLocalBlobs, cleanAllLocalBlobs } from '../utils/RichTextEditorUtils';
|
19
|
-
import { ContextualMenu } from '@fluentui/react';
|
20
|
-
import { PlaceholderPlugin } from './Plugins/PlaceholderPlugin';
|
21
|
-
import { getFormatState, setDirection } from 'roosterjs-content-model-api';
|
22
|
-
import UndoRedoPlugin from './Plugins/UndoRedoPlugin';
|
23
|
-
/**
|
24
|
-
* A component to wrap RoosterJS Rich Text Editor.
|
25
|
-
*
|
26
|
-
* @beta
|
27
|
-
*/
|
28
|
-
export const RichTextEditor = React.forwardRef((props, ref) => {
|
29
|
-
const { initialContent, onChange, placeholderText, strings, showRichTextEditorFormatting, autoFocus, onKeyDown, onCompositionUpdate, onContentModelUpdate, contentModel, onPaste, onInsertInlineImage } = props;
|
30
|
-
const editor = useRef(null);
|
31
|
-
const editorDiv = useRef(null);
|
32
|
-
const toolbarRef = useRef(null);
|
33
|
-
const theme = useTheme();
|
34
|
-
const [contextMenuProps, setContextMenuProps] = useState(null);
|
35
|
-
const previousThemeDirection = useRef(themeDirection(theme)); // This will be set when the editor is initialized and when the content is updated.
|
36
|
-
const [previousInlineImages, setPreviousInlineImages] = useState([]);
|
37
|
-
const [inlineImageLocalBlobs, setInlineImageLocalBlobs] = useState({});
|
38
|
-
useEffect(() => {
|
39
|
-
return () => {
|
40
|
-
// Cleanup Local Blob URLs when the component is unmounted
|
41
|
-
cleanAllLocalBlobs(inlineImageLocalBlobs);
|
42
|
-
};
|
43
|
-
// This effect should only run once when the component is unmounted, so we don't need to add any dependencies
|
44
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
45
|
-
}, []);
|
46
|
-
useEffect(() => {
|
47
|
-
var _a, _b;
|
48
|
-
if (editor.current) {
|
49
|
-
if (showRichTextEditorFormatting) {
|
50
|
-
(_a = toolbarRef.current) === null || _a === void 0 ? void 0 : _a.focus();
|
51
|
-
}
|
52
|
-
else {
|
53
|
-
(_b = editor.current) === null || _b === void 0 ? void 0 : _b.focus();
|
54
|
-
}
|
55
|
-
}
|
56
|
-
}, [showRichTextEditorFormatting]);
|
57
|
-
useImperativeHandle(ref, () => {
|
58
|
-
return {
|
59
|
-
focus() {
|
60
|
-
if (editor.current) {
|
61
|
-
editor.current.focus();
|
62
|
-
}
|
63
|
-
},
|
64
|
-
setEmptyContent() {
|
65
|
-
setPreviousInlineImages([]);
|
66
|
-
cleanAllLocalBlobs(inlineImageLocalBlobs);
|
67
|
-
if (editor.current) {
|
68
|
-
// remove all content from the editor and update the model
|
69
|
-
// ContentChanged event will be sent by RoosterJS automatically
|
70
|
-
editor.current.formatContentModel((model) => {
|
71
|
-
// Create a new empty paragraph with selection marker
|
72
|
-
// this is needed for correct processing of images after the content is deleted
|
73
|
-
const newModel = createEmptyModel();
|
74
|
-
model.blocks = newModel.blocks;
|
75
|
-
return true;
|
76
|
-
});
|
77
|
-
//reset content model
|
78
|
-
onContentModelUpdate && onContentModelUpdate(editor.current.getContentModelCopy('disconnected'));
|
79
|
-
}
|
80
|
-
},
|
81
|
-
getPlainContent() {
|
82
|
-
if (editor.current) {
|
83
|
-
return exportContent(editor.current, 'PlainTextFast');
|
84
|
-
}
|
85
|
-
else {
|
86
|
-
return undefined;
|
87
|
-
}
|
88
|
-
}
|
89
|
-
};
|
90
|
-
}, [inlineImageLocalBlobs, onContentModelUpdate]);
|
91
|
-
const toolbarPlugin = React.useMemo(() => {
|
92
|
-
return new RichTextToolbarPlugin();
|
93
|
-
}, []);
|
94
|
-
const placeholderPlugin = useMemo(() => {
|
95
|
-
var _a;
|
96
|
-
const textColor = (_a = theme.palette) === null || _a === void 0 ? void 0 : _a.neutralSecondary;
|
97
|
-
return new PlaceholderPlugin('', textColor ? {
|
98
|
-
textColor: textColor
|
99
|
-
} : undefined);
|
100
|
-
}, [theme]);
|
101
|
-
useEffect(() => {
|
102
|
-
if (placeholderText !== undefined) {
|
103
|
-
placeholderPlugin.updatePlaceholder(placeholderText);
|
104
|
-
}
|
105
|
-
}, [placeholderPlugin, placeholderText]);
|
106
|
-
const toolbar = useMemo(() => {
|
107
|
-
return React.createElement(RichTextToolbar, { plugin: toolbarPlugin, strings: strings });
|
108
|
-
}, [strings, toolbarPlugin]);
|
109
|
-
const updatePlugin = useMemo(() => {
|
110
|
-
return new UpdateContentPlugin();
|
111
|
-
}, []);
|
112
|
-
const copyPastePlugin = useMemo(() => {
|
113
|
-
return new CopyPastePlugin();
|
114
|
-
}, []);
|
115
|
-
const onChangeContent = useCallback((shouldUpdateInlineImages) => {
|
116
|
-
if (editor.current === null) {
|
117
|
-
return;
|
118
|
-
}
|
119
|
-
const content = exportContent(editor.current);
|
120
|
-
let removedInlineImages = [];
|
121
|
-
if (shouldUpdateInlineImages) {
|
122
|
-
removedInlineImages = getRemovedInlineImages(content, previousInlineImages);
|
123
|
-
}
|
124
|
-
onChange && onChange(content, removedInlineImages);
|
125
|
-
setPreviousInlineImages(getPreviousInlineImages(content));
|
126
|
-
}, [onChange, previousInlineImages]);
|
127
|
-
useEffect(() => {
|
128
|
-
// don't set callback in plugin constructor to update callback without plugin recreation
|
129
|
-
updatePlugin.onUpdate = (event, shouldRemoveInlineImages) => {
|
130
|
-
if (editor.current === null) {
|
131
|
-
return;
|
132
|
-
}
|
133
|
-
if (event === UpdateEvent.Blur || event === UpdateEvent.Dispose) {
|
134
|
-
onContentModelUpdate && onContentModelUpdate(editor.current.getContentModelCopy('disconnected'));
|
135
|
-
}
|
136
|
-
else {
|
137
|
-
const content = exportContent(editor.current);
|
138
|
-
let removedInlineImages = [];
|
139
|
-
if (shouldRemoveInlineImages) {
|
140
|
-
removedInlineImages = getRemovedInlineImages(content, previousInlineImages);
|
141
|
-
if (removedInlineImages.length > 0) {
|
142
|
-
removeLocalBlobs(inlineImageLocalBlobs, removedInlineImages);
|
143
|
-
}
|
144
|
-
}
|
145
|
-
onChange && onChange(content, removedInlineImages);
|
146
|
-
setPreviousInlineImages(getPreviousInlineImages(content));
|
147
|
-
}
|
148
|
-
};
|
149
|
-
}, [onChange, onContentModelUpdate, updatePlugin, previousInlineImages, inlineImageLocalBlobs]);
|
150
|
-
const undoRedoPlugin = useMemo(() => {
|
151
|
-
return new UndoRedoPlugin();
|
152
|
-
}, []);
|
153
|
-
useEffect(() => {
|
154
|
-
if (onInsertInlineImage) {
|
155
|
-
copyPastePlugin.onInsertInlineImage = (imageAttributes) => {
|
156
|
-
const { id, src } = imageAttributes;
|
157
|
-
setInlineImageLocalBlobs(prev => {
|
158
|
-
if (!id || !src) {
|
159
|
-
return prev;
|
160
|
-
}
|
161
|
-
return Object.assign(Object.assign({}, prev), { [id]: src });
|
162
|
-
});
|
163
|
-
onInsertInlineImage(imageAttributes);
|
164
|
-
};
|
165
|
-
}
|
166
|
-
else {
|
167
|
-
copyPastePlugin.onInsertInlineImage = undefined;
|
168
|
-
}
|
169
|
-
undoRedoPlugin.onInsertInlineImage = onInsertInlineImage;
|
170
|
-
}, [copyPastePlugin, onInsertInlineImage, undoRedoPlugin]);
|
171
|
-
useEffect(() => {
|
172
|
-
undoRedoPlugin.onUpdateContent = () => {
|
173
|
-
onChangeContent(true);
|
174
|
-
};
|
175
|
-
}, [onChangeContent, undoRedoPlugin]);
|
176
|
-
const keyboardInputPlugin = useMemo(() => {
|
177
|
-
return new KeyboardInputPlugin();
|
178
|
-
}, []);
|
179
|
-
useEffect(() => {
|
180
|
-
// don't set callback in plugin constructor to update callback without plugin recreation
|
181
|
-
keyboardInputPlugin.onKeyDown = onKeyDown;
|
182
|
-
}, [keyboardInputPlugin, onKeyDown]);
|
183
|
-
useEffect(() => {
|
184
|
-
// don't set callback in plugin constructor to update callback without plugin recreation
|
185
|
-
keyboardInputPlugin.onCompositionUpdate = onCompositionUpdate;
|
186
|
-
}, [keyboardInputPlugin, onCompositionUpdate]);
|
187
|
-
const tableContextMenuPlugin = useMemo(() => {
|
188
|
-
return new TableEditContextMenuProvider();
|
189
|
-
}, []);
|
190
|
-
useEffect(() => {
|
191
|
-
tableContextMenuPlugin.updateStrings(strings);
|
192
|
-
}, [tableContextMenuPlugin, strings]);
|
193
|
-
const onContextMenuRender = useCallback((container, items, onDismiss) => {
|
194
|
-
setContextMenuProps({
|
195
|
-
items: items,
|
196
|
-
target: container,
|
197
|
-
onDismiss: onDismiss
|
198
|
-
});
|
199
|
-
}, []);
|
200
|
-
const onContextMenuDismiss = useCallback(() => {
|
201
|
-
setContextMenuProps(null);
|
202
|
-
}, []);
|
203
|
-
useEffect(() => {
|
204
|
-
copyPastePlugin.onPaste = onPaste;
|
205
|
-
}, [copyPastePlugin, onPaste]);
|
206
|
-
const plugins = useMemo(() => {
|
207
|
-
const contentEdit = new EditPlugin({
|
208
|
-
handleTabKey: false
|
209
|
-
});
|
210
|
-
// AutoFormatPlugin previously was a part of the edit plugin
|
211
|
-
const autoFormatPlugin = new AutoFormatPlugin({
|
212
|
-
autoBullet: true,
|
213
|
-
autoNumbering: true,
|
214
|
-
autoLink: true
|
215
|
-
});
|
216
|
-
const roosterPastePlugin = new PastePlugin(false, {
|
217
|
-
additionalDisallowedTags: ['head', '!doctype', '!cdata', '#comment'],
|
218
|
-
additionalAllowedTags: [],
|
219
|
-
styleSanitizers: DefaultSanitizers,
|
220
|
-
attributeSanitizers: {}
|
221
|
-
});
|
222
|
-
const shortcutPlugin = new ShortcutPlugin();
|
223
|
-
const contextMenuPlugin = new ContextMenuPlugin(onContextMenuRender, onContextMenuDismiss);
|
224
|
-
return [placeholderPlugin, keyboardInputPlugin, contentEdit, autoFormatPlugin, updatePlugin, copyPastePlugin, roosterPastePlugin, toolbarPlugin, shortcutPlugin,
|
225
|
-
// contextPlugin and tableEditMenuProvider allow to show insert/delete menu for the table
|
226
|
-
contextMenuPlugin, tableContextMenuPlugin, undoRedoPlugin];
|
227
|
-
}, [onContextMenuRender, onContextMenuDismiss, placeholderPlugin, keyboardInputPlugin, updatePlugin, copyPastePlugin, toolbarPlugin, tableContextMenuPlugin, undoRedoPlugin]);
|
228
|
-
const announcerStringGetter = useCallback((key) => {
|
229
|
-
var _a, _b;
|
230
|
-
switch (key) {
|
231
|
-
case 'announceListItemBullet':
|
232
|
-
return (_a = strings.richTextNewBulletedListItemAnnouncement) !== null && _a !== void 0 ? _a : '';
|
233
|
-
case 'announceListItemNumbering':
|
234
|
-
return (_b = strings.richTextNewNumberedListItemAnnouncement) !== null && _b !== void 0 ? _b : '';
|
235
|
-
case 'announceOnFocusLastCell':
|
236
|
-
return '';
|
237
|
-
}
|
238
|
-
}, [strings.richTextNewBulletedListItemAnnouncement, strings.richTextNewNumberedListItemAnnouncement]);
|
239
|
-
useEffect(() => {
|
240
|
-
var _a;
|
241
|
-
const prevInlineImage = getPreviousInlineImages(initialContent);
|
242
|
-
setPreviousInlineImages(prevInlineImage);
|
243
|
-
const initialModel = createEditorInitialModel(initialContent, contentModel);
|
244
|
-
if (editorDiv.current) {
|
245
|
-
editor.current = new Editor(editorDiv.current, {
|
246
|
-
inDarkMode: isDarkThemed(theme),
|
247
|
-
// doNotAdjustEditorColor is used to disable default color and background color for Rooster component
|
248
|
-
doNotAdjustEditorColor: true,
|
249
|
-
imageSelectionBorderColor: theme.palette.themePrimary,
|
250
|
-
tableCellSelectionBackgroundColor: theme.palette.neutralLight,
|
251
|
-
plugins: plugins,
|
252
|
-
initialModel: initialModel,
|
253
|
-
defaultModelToDomOptions: {
|
254
|
-
formatApplierOverride: {
|
255
|
-
// apply border and dataset formats for table
|
256
|
-
border: borderApplier,
|
257
|
-
dataset: dataSetApplier
|
258
|
-
}
|
259
|
-
},
|
260
|
-
announcerStringGetter: announcerStringGetter
|
261
|
-
});
|
262
|
-
}
|
263
|
-
if (autoFocus === 'sendBoxTextField') {
|
264
|
-
(_a = editor.current) === null || _a === void 0 ? void 0 : _a.focus();
|
265
|
-
}
|
266
|
-
return () => {
|
267
|
-
if (editor.current) {
|
268
|
-
editor.current.dispose();
|
269
|
-
editor.current = null;
|
270
|
-
}
|
271
|
-
};
|
272
|
-
// don't update the editor on deps update as everything is handled in separate hooks or plugins
|
273
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
274
|
-
}, [theme, plugins, announcerStringGetter]);
|
275
|
-
useEffect(() => {
|
276
|
-
const themeDirectionValue = themeDirection(theme);
|
277
|
-
// check that editor exists and theme was actually changed
|
278
|
-
// as format.direction will be undefined if setDirection is not called
|
279
|
-
if (editor.current && previousThemeDirection.current !== themeDirectionValue) {
|
280
|
-
const format = getFormatState(editor.current);
|
281
|
-
if (format.direction !== themeDirectionValue) {
|
282
|
-
// should be set after the hook where editor is created as the editor might be null
|
283
|
-
// setDirection will cause the focus change back to the editor and this might not be what we want to do (autoFocus prop)
|
284
|
-
// that's why it's not part of the create editor hook
|
285
|
-
setDirection(editor.current, theme.rtl ? 'rtl' : 'ltr');
|
286
|
-
}
|
287
|
-
previousThemeDirection.current = themeDirectionValue;
|
288
|
-
}
|
289
|
-
}, [theme]);
|
290
|
-
return React.createElement("div", { "data-testid": 'rich-text-editor-wrapper' },
|
291
|
-
React.createElement("div", { ref: toolbarRef }, showRichTextEditorFormatting && toolbar),
|
292
|
-
React.createElement("div", { className: richTextEditorWrapperStyle(theme) },
|
293
|
-
React.createElement("div", { id: "richTextSendBox", ref: editorDiv, tabIndex: 0, role: "textbox", "aria-multiline": "true", "data-testid": 'rooster-rich-text-editor', className: richTextEditorStyle(props.styles), "aria-label": placeholderText })),
|
294
|
-
contextMenuProps && React.createElement(ContextualMenu, Object.assign({}, contextMenuProps, { calloutProps: {
|
295
|
-
isBeakVisible: false
|
296
|
-
} })));
|
297
|
-
});
|
298
|
-
const createEditorInitialModel = (initialContent, contentModel) => {
|
299
|
-
if (contentModel) {
|
300
|
-
// contentModel is the current content of the editor
|
301
|
-
return contentModel;
|
302
|
-
}
|
303
|
-
else {
|
304
|
-
const initialContentValue = initialContent;
|
305
|
-
const initialModel = initialContentValue && initialContentValue.length > 0 ? createModelFromHtml(initialContentValue) : undefined;
|
306
|
-
if (initialModel && initialModel.blocks.length > 0) {
|
307
|
-
// lastBlock should have blockType = paragraph, otherwise add a new paragraph
|
308
|
-
// to set focus to the end of the content
|
309
|
-
const lastBlock = initialModel.blocks[initialModel.blocks.length - 1];
|
310
|
-
if ((lastBlock === null || lastBlock === void 0 ? void 0 : lastBlock.blockType) === 'Paragraph') {
|
311
|
-
// now lastBlock is paragraph
|
312
|
-
setSelectionAfterLastSegment(initialModel, lastBlock);
|
313
|
-
}
|
314
|
-
else {
|
315
|
-
const block = createParagraph(false);
|
316
|
-
initialModel.blocks.push(block);
|
317
|
-
setSelectionAfterLastSegment(initialModel, block);
|
318
|
-
// add content to the paragraph, otherwise height might be calculated incorrectly
|
319
|
-
block.segments.push(createBr());
|
320
|
-
}
|
321
|
-
}
|
322
|
-
return initialModel;
|
323
|
-
}
|
324
|
-
};
|
325
|
-
const setSelectionAfterLastSegment = (model, block) => {
|
326
|
-
var _a;
|
327
|
-
//selection marker should have the same format as the last segment if any
|
328
|
-
const format = block.segments.length > 0 ? (_a = block.segments[block.segments.length - 1]) === null || _a === void 0 ? void 0 : _a.format : undefined;
|
329
|
-
const marker = createSelectionMarker(format);
|
330
|
-
block.segments.push(marker);
|
331
|
-
setSelection(model, marker);
|
332
|
-
};
|
333
|
-
const themeDirection = (theme) => {
|
334
|
-
return theme.rtl ? 'rtl' : 'ltr';
|
335
|
-
};
|
336
|
-
//# sourceMappingURL=RichTextEditor.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"RichTextEditor.js","sourceRoot":"","sources":["../../../../../../preprocess-dist/react-components/src/components/RichTextEditor/RichTextEditor.tsx"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAClC,OA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MAAM,CAAC,CAAC;IAC7C,KAAK,CAAC,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IAC5B,YAAY,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;AAC9B,CAAC,CAAC;AACF,MAAM,cAAc,GAAG,CAAC,KAAY,EAAiB,EAAE;IACrD,OAAO,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC;AACnC,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\nimport React, { useCallback, useEffect, useImperativeHandle, useMemo, useRef, useState } from 'react';\nimport { richTextEditorWrapperStyle, richTextEditorStyle } from '../styles/RichTextEditor.styles';\nimport { useTheme } from '../../theming';\nimport { RichTextStrings } from './RichTextSendBox';\nimport { isDarkThemed } from '../../theming/themeUtils';\nimport CopyPastePlugin from './Plugins/CopyPastePlugin';\nimport type { ContentModelDocument, ContentModelParagraph, EditorPlugin, IEditor, ReadonlyContentModelBlockGroup, ShallowMutableContentModelDocument, KnownAnnounceStrings } from 'roosterjs-content-model-types';\nimport { createModelFromHtml, Editor, exportContent } from 'roosterjs-content-model-core';\nimport { createBr, createEmptyModel, createParagraph, createSelectionMarker, setSelection } from 'roosterjs-content-model-dom';\nimport { KeyboardInputPlugin } from './Plugins/KeyboardInputPlugin';\nimport { AutoFormatPlugin, EditPlugin, PastePlugin, ShortcutPlugin, DefaultSanitizers } from 'roosterjs-content-model-plugins';\nimport { UpdateContentPlugin, UpdateEvent } from './Plugins/UpdateContentPlugin';\nimport { RichTextToolbar } from './Toolbar/RichTextToolbar';\nimport { RichTextToolbarPlugin } from './Plugins/RichTextToolbarPlugin';\nimport { ContextMenuPlugin } from './Plugins/ContextMenuPlugin';\nimport { TableEditContextMenuProvider } from './Plugins/TableEditContextMenuProvider';\nimport { borderApplier, dataSetApplier } from '../utils/RichTextEditorUtils';\nimport { getPreviousInlineImages, getRemovedInlineImages, removeLocalBlobs, cleanAllLocalBlobs } from '../utils/RichTextEditorUtils';\nimport { ContextualMenu, IContextualMenuItem, IContextualMenuProps, Theme } from '@fluentui/react';\nimport { PlaceholderPlugin } from './Plugins/PlaceholderPlugin';\nimport { getFormatState, setDirection } from 'roosterjs-content-model-api';\nimport UndoRedoPlugin from './Plugins/UndoRedoPlugin';\n\n/**\n * Style props for {@link RichTextEditor}.\n *\n * @private\n */\nexport interface RichTextEditorStyleProps {\n minHeight: string;\n maxHeight: string;\n}\n\n/**\n * Props for {@link RichTextEditor}.\n *\n * @private\n */\nexport interface RichTextEditorProps {\n // the initial content of editor that is set when editor is created (e.g. when editing a message)\n initialContent?: string;\n onChange: (newValue?: string, removedInlineImages?: Record<string, string>[]) => void;\n onKeyDown?: (ev: KeyboardEvent) => void;\n // OnKeyDown aren't called for composition events, so we need to handle them separately\n onCompositionUpdate?: () => void;\n // update the current content of the rich text editor\n onContentModelUpdate?: (contentModel: ContentModelDocument | undefined) => void;\n contentModel?: ContentModelDocument | undefined;\n placeholderText?: string;\n strings: Partial<RichTextStrings>;\n showRichTextEditorFormatting: boolean;\n styles: RichTextEditorStyleProps;\n autoFocus?: 'sendBoxTextField';\n onPaste?: (event: {\n content: DocumentFragment;\n }) => void;\n onInsertInlineImage?: (imageAttributes: Record<string, string>) => void;\n}\n\n/**\n * Represents a reference to the RichTextEditor component.\n */\nexport interface RichTextEditorComponentRef {\n /**\n * Sets focus on the RichTextEditor component.\n */\n focus: () => void;\n\n /**\n * Sets the content of the RichTextEditor component to an empty string.\n */\n setEmptyContent: () => void;\n\n /**\n * Retrieves the plain text content of the RichTextEditor component.\n * @returns The plain text content of the RichTextEditor component, or undefined if the editor isn't available.\n */\n getPlainContent: () => string | undefined;\n}\n\n/**\n * A component to wrap RoosterJS Rich Text Editor.\n *\n * @beta\n */\nexport const RichTextEditor = React.forwardRef<RichTextEditorComponentRef, RichTextEditorProps>((props, ref) => {\n const {\n initialContent,\n onChange,\n placeholderText,\n strings,\n showRichTextEditorFormatting,\n autoFocus,\n onKeyDown,\n onCompositionUpdate,\n onContentModelUpdate,\n contentModel,\n onPaste,\n onInsertInlineImage\n } = props;\n const editor = useRef<IEditor | null>(null);\n const editorDiv = useRef<HTMLDivElement>(null);\n const toolbarRef = useRef<HTMLDivElement>(null);\n const theme = useTheme();\n const [contextMenuProps, setContextMenuProps] = useState<IContextualMenuProps | null>(null);\n const previousThemeDirection = useRef(themeDirection(theme)); // This will be set when the editor is initialized and when the content is updated.\n const [previousInlineImages, setPreviousInlineImages] = useState<Record<string, string>[]>([]);\n const [inlineImageLocalBlobs, setInlineImageLocalBlobs] = useState<Record<string, string>>({});\n useEffect(() => {\n return () => {\n // Cleanup Local Blob URLs when the component is unmounted\n cleanAllLocalBlobs(inlineImageLocalBlobs);\n };\n // This effect should only run once when the component is unmounted, so we don't need to add any dependencies\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n useEffect(() => {\n if (editor.current) {\n if (showRichTextEditorFormatting) {\n toolbarRef.current?.focus();\n } else {\n editor.current?.focus();\n }\n }\n }, [showRichTextEditorFormatting]);\n useImperativeHandle(ref, () => {\n return {\n focus() {\n if (editor.current) {\n editor.current.focus();\n }\n },\n setEmptyContent() {\n setPreviousInlineImages([]);\n cleanAllLocalBlobs(inlineImageLocalBlobs);\n if (editor.current) {\n // remove all content from the editor and update the model\n // ContentChanged event will be sent by RoosterJS automatically\n editor.current.formatContentModel((model: ShallowMutableContentModelDocument): boolean => {\n // Create a new empty paragraph with selection marker\n // this is needed for correct processing of images after the content is deleted\n const newModel = createEmptyModel();\n model.blocks = newModel.blocks;\n return true;\n });\n //reset content model\n onContentModelUpdate && onContentModelUpdate(editor.current.getContentModelCopy('disconnected'));\n }\n },\n getPlainContent() {\n if (editor.current) {\n return exportContent(editor.current, 'PlainTextFast');\n } else {\n return undefined;\n }\n }\n };\n }, [inlineImageLocalBlobs, onContentModelUpdate]);\n const toolbarPlugin = React.useMemo(() => {\n return new RichTextToolbarPlugin();\n }, []);\n const placeholderPlugin = useMemo(() => {\n const textColor = theme.palette?.neutralSecondary;\n return new PlaceholderPlugin('', textColor ? {\n textColor: textColor\n } : undefined);\n }, [theme]);\n useEffect(() => {\n if (placeholderText !== undefined) {\n placeholderPlugin.updatePlaceholder(placeholderText);\n }\n }, [placeholderPlugin, placeholderText]);\n const toolbar = useMemo(() => {\n return <RichTextToolbar plugin={toolbarPlugin} strings={strings} />;\n }, [strings, toolbarPlugin]);\n const updatePlugin = useMemo(() => {\n return new UpdateContentPlugin();\n }, []);\n const copyPastePlugin = useMemo(() => {\n return new CopyPastePlugin();\n }, []);\n const onChangeContent = useCallback((shouldUpdateInlineImages?: boolean) => {\n if (editor.current === null) {\n return;\n }\n const content = exportContent(editor.current);\n let removedInlineImages: Record<string, string>[] = [];\n if (shouldUpdateInlineImages) {\n removedInlineImages = getRemovedInlineImages(content, previousInlineImages);\n }\n onChange && onChange(content, removedInlineImages);\n setPreviousInlineImages(getPreviousInlineImages(content));\n }, [onChange, previousInlineImages]);\n useEffect(() => {\n // don't set callback in plugin constructor to update callback without plugin recreation\n updatePlugin.onUpdate = (event: string, shouldRemoveInlineImages?: boolean) => {\n if (editor.current === null) {\n return;\n }\n if (event === UpdateEvent.Blur || event === UpdateEvent.Dispose) {\n onContentModelUpdate && onContentModelUpdate(editor.current.getContentModelCopy('disconnected'));\n } else {\n const content = exportContent(editor.current);\n let removedInlineImages: Record<string, string>[] = [];\n if (shouldRemoveInlineImages) {\n removedInlineImages = getRemovedInlineImages(content, previousInlineImages);\n if (removedInlineImages.length > 0) {\n removeLocalBlobs(inlineImageLocalBlobs, removedInlineImages);\n }\n }\n onChange && onChange(content, removedInlineImages);\n setPreviousInlineImages(getPreviousInlineImages(content));\n }\n };\n }, [onChange, onContentModelUpdate, updatePlugin, previousInlineImages, inlineImageLocalBlobs]);\n const undoRedoPlugin = useMemo(() => {\n return new UndoRedoPlugin();\n }, []);\n useEffect(() => {\n if (onInsertInlineImage) {\n copyPastePlugin.onInsertInlineImage = (imageAttributes: Record<string, string>) => {\n const {\n id,\n src\n } = imageAttributes;\n setInlineImageLocalBlobs(prev => {\n if (!id || !src) {\n return prev;\n }\n return {\n ...prev,\n [id]: src\n };\n });\n onInsertInlineImage(imageAttributes);\n };\n } else {\n copyPastePlugin.onInsertInlineImage = undefined;\n }\n undoRedoPlugin.onInsertInlineImage = onInsertInlineImage;\n }, [copyPastePlugin, onInsertInlineImage, undoRedoPlugin]);\n useEffect(() => {\n undoRedoPlugin.onUpdateContent = () => {\n onChangeContent(true);\n };\n }, [onChangeContent, undoRedoPlugin]);\n const keyboardInputPlugin = useMemo(() => {\n return new KeyboardInputPlugin();\n }, []);\n useEffect(() => {\n // don't set callback in plugin constructor to update callback without plugin recreation\n keyboardInputPlugin.onKeyDown = onKeyDown;\n }, [keyboardInputPlugin, onKeyDown]);\n useEffect(() => {\n // don't set callback in plugin constructor to update callback without plugin recreation\n keyboardInputPlugin.onCompositionUpdate = onCompositionUpdate;\n }, [keyboardInputPlugin, onCompositionUpdate]);\n const tableContextMenuPlugin = useMemo(() => {\n return new TableEditContextMenuProvider();\n }, []);\n useEffect(() => {\n tableContextMenuPlugin.updateStrings(strings);\n }, [tableContextMenuPlugin, strings]);\n const onContextMenuRender = useCallback((container: HTMLElement, items: IContextualMenuItem[], onDismiss: () => void): void => {\n setContextMenuProps({\n items: items,\n target: container,\n onDismiss: onDismiss\n });\n }, []);\n const onContextMenuDismiss = useCallback((): void => {\n setContextMenuProps(null);\n }, []);\n useEffect(() => {\n copyPastePlugin.onPaste = onPaste;\n }, [copyPastePlugin, onPaste]);\n const plugins: EditorPlugin[] = useMemo(() => {\n const contentEdit = new EditPlugin({\n handleTabKey: false\n });\n // AutoFormatPlugin previously was a part of the edit plugin\n const autoFormatPlugin = new AutoFormatPlugin({\n autoBullet: true,\n autoNumbering: true,\n autoLink: true\n });\n const roosterPastePlugin = new PastePlugin(false, {\n additionalDisallowedTags: ['head', '!doctype', '!cdata', '#comment'],\n additionalAllowedTags: [],\n styleSanitizers: DefaultSanitizers,\n attributeSanitizers: {}\n });\n const shortcutPlugin = new ShortcutPlugin();\n const contextMenuPlugin = new ContextMenuPlugin(onContextMenuRender, onContextMenuDismiss);\n return [placeholderPlugin, keyboardInputPlugin, contentEdit, autoFormatPlugin, updatePlugin, copyPastePlugin, roosterPastePlugin, toolbarPlugin, shortcutPlugin,\n // contextPlugin and tableEditMenuProvider allow to show insert/delete menu for the table\n contextMenuPlugin, tableContextMenuPlugin, undoRedoPlugin];\n }, [onContextMenuRender, onContextMenuDismiss, placeholderPlugin, keyboardInputPlugin, updatePlugin, copyPastePlugin, toolbarPlugin, tableContextMenuPlugin, undoRedoPlugin]);\n const announcerStringGetter = useCallback((key: KnownAnnounceStrings): string => {\n switch (key) {\n case 'announceListItemBullet':\n return strings.richTextNewBulletedListItemAnnouncement ?? '';\n case 'announceListItemNumbering':\n return strings.richTextNewNumberedListItemAnnouncement ?? '';\n case 'announceOnFocusLastCell':\n return '';\n }\n }, [strings.richTextNewBulletedListItemAnnouncement, strings.richTextNewNumberedListItemAnnouncement]);\n useEffect(() => {\n const prevInlineImage = getPreviousInlineImages(initialContent);\n setPreviousInlineImages(prevInlineImage);\n const initialModel = createEditorInitialModel(initialContent, contentModel);\n if (editorDiv.current) {\n editor.current = new Editor(editorDiv.current, {\n inDarkMode: isDarkThemed(theme),\n // doNotAdjustEditorColor is used to disable default color and background color for Rooster component\n doNotAdjustEditorColor: true,\n imageSelectionBorderColor: theme.palette.themePrimary,\n tableCellSelectionBackgroundColor: theme.palette.neutralLight,\n plugins: plugins,\n initialModel: initialModel,\n defaultModelToDomOptions: {\n formatApplierOverride: {\n // apply border and dataset formats for table\n border: borderApplier,\n dataset: dataSetApplier\n }\n },\n announcerStringGetter: announcerStringGetter\n });\n }\n if (autoFocus === 'sendBoxTextField') {\n editor.current?.focus();\n }\n return () => {\n if (editor.current) {\n editor.current.dispose();\n editor.current = null;\n }\n };\n // don't update the editor on deps update as everything is handled in separate hooks or plugins\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [theme, plugins, announcerStringGetter]);\n useEffect(() => {\n const themeDirectionValue = themeDirection(theme);\n // check that editor exists and theme was actually changed\n // as format.direction will be undefined if setDirection is not called\n if (editor.current && previousThemeDirection.current !== themeDirectionValue) {\n const format = getFormatState(editor.current);\n if (format.direction !== themeDirectionValue) {\n // should be set after the hook where editor is created as the editor might be null\n // setDirection will cause the focus change back to the editor and this might not be what we want to do (autoFocus prop)\n // that's why it's not part of the create editor hook\n setDirection(editor.current, theme.rtl ? 'rtl' : 'ltr');\n }\n previousThemeDirection.current = themeDirectionValue;\n }\n }, [theme]);\n return <div data-testid={'rich-text-editor-wrapper'}>\n <div ref={toolbarRef}>{showRichTextEditorFormatting && toolbar}</div>\n <div className={richTextEditorWrapperStyle(theme)}>\n {/* div that is used by Rooster JS as a parent of the editor */}\n <div id=\"richTextSendBox\" ref={editorDiv} tabIndex={0} role=\"textbox\" aria-multiline=\"true\" data-testid={'rooster-rich-text-editor'} className={richTextEditorStyle(props.styles)} aria-label={placeholderText} />\n </div>\n {contextMenuProps && <ContextualMenu {...contextMenuProps} calloutProps={{\n isBeakVisible: false\n }} />}\n </div>;\n});\nconst createEditorInitialModel = (initialContent?: string, contentModel?: ContentModelDocument): ContentModelDocument | undefined => {\n if (contentModel) {\n // contentModel is the current content of the editor\n return contentModel;\n } else {\n const initialContentValue = initialContent;\n const initialModel = initialContentValue && initialContentValue.length > 0 ? createModelFromHtml(initialContentValue) : undefined;\n if (initialModel && initialModel.blocks.length > 0) {\n // lastBlock should have blockType = paragraph, otherwise add a new paragraph\n // to set focus to the end of the content\n const lastBlock = initialModel.blocks[initialModel.blocks.length - 1];\n if (lastBlock?.blockType === 'Paragraph') {\n // now lastBlock is paragraph\n setSelectionAfterLastSegment(initialModel, lastBlock);\n } else {\n const block = createParagraph(false);\n initialModel.blocks.push(block);\n setSelectionAfterLastSegment(initialModel, block);\n // add content to the paragraph, otherwise height might be calculated incorrectly\n block.segments.push(createBr());\n }\n }\n return initialModel;\n }\n};\nconst setSelectionAfterLastSegment = (model: ReadonlyContentModelBlockGroup, block: ContentModelParagraph): void => {\n //selection marker should have the same format as the last segment if any\n const format = block.segments.length > 0 ? block.segments[block.segments.length - 1]?.format : undefined;\n const marker = createSelectionMarker(format);\n block.segments.push(marker);\n setSelection(model, marker);\n};\nconst themeDirection = (theme: Theme): 'rtl' | 'ltr' => {\n return theme.rtl ? 'rtl' : 'ltr';\n};"]}
|
package/dist/dist-esm/react-components/src/components/RichTextEditor/RichTextInputBoxComponent.d.ts
DELETED
@@ -1,37 +0,0 @@
|
|
1
|
-
import React, { ReactNode } from 'react';
|
2
|
-
import { BaseCustomStyles } from '../../types';
|
3
|
-
import { RichTextEditorComponentRef, RichTextEditorStyleProps } from './RichTextEditor';
|
4
|
-
import { RichTextSendBoxStrings } from './RichTextSendBox';
|
5
|
-
/**
|
6
|
-
* @private
|
7
|
-
*/
|
8
|
-
export interface RichTextInputBoxComponentStylesProps extends BaseCustomStyles {
|
9
|
-
}
|
10
|
-
/**
|
11
|
-
* @private
|
12
|
-
*/
|
13
|
-
export interface RichTextInputBoxComponentProps {
|
14
|
-
placeholderText?: string;
|
15
|
-
initialContent?: string;
|
16
|
-
onChange: (newValue?: string, removedInlineImages?: Record<string, string>[]) => void;
|
17
|
-
onEnterKeyDown?: () => void;
|
18
|
-
editorComponentRef: React.RefObject<RichTextEditorComponentRef>;
|
19
|
-
strings: Partial<RichTextSendBoxStrings>;
|
20
|
-
disabled: boolean;
|
21
|
-
actionComponents: ReactNode;
|
22
|
-
onRenderAttachmentUploads?: () => JSX.Element;
|
23
|
-
hasAttachments?: boolean;
|
24
|
-
richTextEditorStyleProps: (isExpanded: boolean) => RichTextEditorStyleProps;
|
25
|
-
isHorizontalLayoutDisabled?: boolean;
|
26
|
-
autoFocus?: 'sendBoxTextField';
|
27
|
-
onTyping?: () => Promise<void>;
|
28
|
-
onPaste?: (event: {
|
29
|
-
content: DocumentFragment;
|
30
|
-
}) => void;
|
31
|
-
onInsertInlineImage?: (imageAttributes: Record<string, string>) => void;
|
32
|
-
}
|
33
|
-
/**
|
34
|
-
* @private
|
35
|
-
*/
|
36
|
-
export declare const RichTextInputBoxComponent: (props: RichTextInputBoxComponentProps) => JSX.Element;
|
37
|
-
//# sourceMappingURL=RichTextInputBoxComponent.d.ts.map
|
package/dist/dist-esm/react-components/src/components/RichTextEditor/RichTextInputBoxComponent.js
DELETED
@@ -1,78 +0,0 @@
|
|
1
|
-
// Copyright (c) Microsoft Corporation.
|
2
|
-
// Licensed under the MIT License.
|
3
|
-
import React, { useCallback, useMemo, useState } from 'react';
|
4
|
-
import { RichTextEditor } from './RichTextEditor';
|
5
|
-
import { useTheme } from '../../theming';
|
6
|
-
import { Icon, Stack } from '@fluentui/react';
|
7
|
-
import { InputBoxButton } from '../InputBoxButton';
|
8
|
-
import { isEnterKeyEventFromCompositionSession } from '../utils';
|
9
|
-
import { richTextActionButtonsDividerStyle, richTextActionButtonsStackStyle, richTextActionButtonsStyle, richTextFormatButtonIconStyle } from '../styles/RichTextEditor.styles';
|
10
|
-
import { inputBoxContentStackStyle, inputBoxRichTextStackItemStyle, inputBoxRichTextStackStyle, richTextBorderBoxStyle } from '../styles/RichTextInputBoxComponent.styles';
|
11
|
-
/**
|
12
|
-
* @private
|
13
|
-
*/
|
14
|
-
export const RichTextInputBoxComponent = (props) => {
|
15
|
-
const { placeholderText, initialContent, onChange, onEnterKeyDown, editorComponentRef, disabled, strings, actionComponents, onRenderAttachmentUploads, hasAttachments, richTextEditorStyleProps, isHorizontalLayoutDisabled = false, autoFocus, onTyping, onInsertInlineImage } = props;
|
16
|
-
const theme = useTheme();
|
17
|
-
// undefined is used to indicate that the rich text editor toolbar state wasn't changed yet
|
18
|
-
const [showRichTextEditorFormatting, setShowRichTextEditorFormatting] = useState(undefined);
|
19
|
-
const [contentModel, setContentModel] = useState(undefined);
|
20
|
-
const onRenderRichTextEditorIcon = useCallback((isHover) => {
|
21
|
-
const isRichTextEditorToolbarShown = showRichTextEditorFormatting === true;
|
22
|
-
return React.createElement(Icon, { iconName: isHover || isRichTextEditorToolbarShown ? 'RichTextEditorButtonIconFilled' : 'RichTextEditorButtonIcon', className: richTextFormatButtonIconStyle(theme, !disabled && (isHover || isRichTextEditorToolbarShown)) });
|
23
|
-
}, [disabled, showRichTextEditorFormatting, theme]);
|
24
|
-
const actionButtons = useMemo(() => {
|
25
|
-
return React.createElement(Stack.Item, { align: "end", className: richTextActionButtonsStackStyle },
|
26
|
-
React.createElement(Stack, { horizontal: true },
|
27
|
-
React.createElement(InputBoxButton, { onRenderIcon: onRenderRichTextEditorIcon, onClick: e => {
|
28
|
-
const isRichTextEditorToolbarShown = showRichTextEditorFormatting === true;
|
29
|
-
setShowRichTextEditorFormatting(!isRichTextEditorToolbarShown);
|
30
|
-
e.stopPropagation(); // Prevents the click from bubbling up and triggering a focus event on the chat.
|
31
|
-
}, ariaLabel: strings.richTextFormatButtonTooltip, tooltipContent: strings.richTextFormatButtonTooltip, className: richTextActionButtonsStyle, "data-testId": 'rich-text-input-box-format-button', ariaExpanded: showRichTextEditorFormatting }),
|
32
|
-
React.createElement(Icon, { iconName: "RichTextDividerIcon", className: richTextActionButtonsDividerStyle(theme) }),
|
33
|
-
actionComponents));
|
34
|
-
}, [actionComponents, onRenderRichTextEditorIcon, showRichTextEditorFormatting, strings.richTextFormatButtonTooltip, theme]);
|
35
|
-
const richTextEditorStyle = useMemo(() => {
|
36
|
-
return richTextEditorStyleProps(showRichTextEditorFormatting === true);
|
37
|
-
}, [richTextEditorStyleProps, showRichTextEditorFormatting]);
|
38
|
-
const onKeyDown = useCallback((ev) => {
|
39
|
-
if (isEnterKeyEventFromCompositionSession(ev)) {
|
40
|
-
return;
|
41
|
-
}
|
42
|
-
const isRichTextEditorToolbarShown = showRichTextEditorFormatting === true;
|
43
|
-
if (ev.key === 'Enter' && ev.shiftKey === false && !isRichTextEditorToolbarShown) {
|
44
|
-
ev.preventDefault();
|
45
|
-
onEnterKeyDown && onEnterKeyDown();
|
46
|
-
}
|
47
|
-
else {
|
48
|
-
onTyping === null || onTyping === void 0 ? void 0 : onTyping();
|
49
|
-
}
|
50
|
-
}, [onEnterKeyDown, showRichTextEditorFormatting, onTyping]);
|
51
|
-
const onCompositionUpdate = useCallback(() => {
|
52
|
-
onTyping === null || onTyping === void 0 ? void 0 : onTyping();
|
53
|
-
}, [onTyping]);
|
54
|
-
const useHorizontalLayout = useMemo(() => {
|
55
|
-
const isRichTextEditorToolbarShown = showRichTextEditorFormatting === true;
|
56
|
-
return !isHorizontalLayoutDisabled && !isRichTextEditorToolbarShown && !hasAttachments;
|
57
|
-
}, [isHorizontalLayoutDisabled, showRichTextEditorFormatting, hasAttachments]);
|
58
|
-
const onContentModelUpdate = useCallback((contentModel) => {
|
59
|
-
setContentModel(contentModel);
|
60
|
-
}, []);
|
61
|
-
return React.createElement("div", { className: richTextBorderBoxStyle({
|
62
|
-
theme: theme,
|
63
|
-
disabled: !!disabled
|
64
|
-
}) },
|
65
|
-
React.createElement("div", { className: inputBoxContentStackStyle, style: {
|
66
|
-
display: 'flex',
|
67
|
-
flexGrow: 1,
|
68
|
-
flexDirection: useHorizontalLayout ? 'row' : 'column',
|
69
|
-
justifyContent: useHorizontalLayout ? 'flex-end' : 'space-between',
|
70
|
-
flexWrap: useHorizontalLayout ? 'wrap' : 'nowrap'
|
71
|
-
} },
|
72
|
-
React.createElement(Stack, { grow: true, className: inputBoxRichTextStackStyle },
|
73
|
-
React.createElement(Stack.Item, { className: inputBoxRichTextStackItemStyle },
|
74
|
-
React.createElement(RichTextEditor, { contentModel: contentModel, initialContent: initialContent, placeholderText: placeholderText, onChange: onChange, onKeyDown: onKeyDown, onCompositionUpdate: onCompositionUpdate, ref: editorComponentRef, strings: strings, showRichTextEditorFormatting: showRichTextEditorFormatting === true, styles: richTextEditorStyle, autoFocus: autoFocus, onContentModelUpdate: onContentModelUpdate, onPaste: props.onPaste, onInsertInlineImage: onInsertInlineImage })),
|
75
|
-
onRenderAttachmentUploads && onRenderAttachmentUploads()),
|
76
|
-
actionButtons));
|
77
|
-
};
|
78
|
-
//# sourceMappingURL=RichTextInputBoxComponent.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"RichTextInputBoxComponent.js","sourceRoot":"","sources":["../../../../../../preprocess-dist/react-components/src/components/RichTextEditor/RichTextInputBoxComponent.tsx"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,KAAK,EAAE,EAAa,WAAW,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAEzE,OAAO,EAAE,cAAc,EAAwD,MAAM,kBAAkB,CAAC;AAExG,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AAC9C,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACnD,OAAO,EAAE,qCAAqC,EAAE,MAAM,UAAU,CAAC;AACjE,OAAO,EAAE,iCAAiC,EAAE,+BAA+B,EAAE,0BAA0B,EAAE,6BAA6B,EAAE,MAAM,iCAAiC,CAAC;AAChL,OAAO,EAAE,yBAAyB,EAAE,8BAA8B,EAAE,0BAA0B,EAAE,sBAAsB,EAAE,MAAM,4CAA4C,CAAC;AAoC3K;;GAEG;AACH,MAAM,CAAC,MAAM,yBAAyB,GAAG,CAAC,KAAqC,EAAe,EAAE;IAC9F,MAAM,EACJ,eAAe,EACf,cAAc,EACd,QAAQ,EACR,cAAc,EACd,kBAAkB,EAClB,QAAQ,EACR,OAAO,EACP,gBAAgB,EAChB,yBAAyB,EACzB,cAAc,EACd,wBAAwB,EACxB,0BAA0B,GAAG,KAAK,EAClC,SAAS,EACT,QAAQ,EACR,mBAAmB,EACpB,GAAG,KAAK,CAAC;IACV,MAAM,KAAK,GAAG,QAAQ,EAAE,CAAC;IACzB,2FAA2F;IAC3F,MAAM,CAAC,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aAAa,CACV,CACF,CAAC;AACX,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport React, { ReactNode, useCallback, useMemo, useState } from 'react';\nimport { BaseCustomStyles } from '../../types';\nimport { RichTextEditor, RichTextEditorComponentRef, RichTextEditorStyleProps } from './RichTextEditor';\nimport { RichTextSendBoxStrings } from './RichTextSendBox';\nimport { useTheme } from '../../theming';\nimport { Icon, Stack } from '@fluentui/react';\nimport { InputBoxButton } from '../InputBoxButton';\nimport { isEnterKeyEventFromCompositionSession } from '../utils';\nimport { richTextActionButtonsDividerStyle, richTextActionButtonsStackStyle, richTextActionButtonsStyle, richTextFormatButtonIconStyle } from '../styles/RichTextEditor.styles';\nimport { inputBoxContentStackStyle, inputBoxRichTextStackItemStyle, inputBoxRichTextStackStyle, richTextBorderBoxStyle } from '../styles/RichTextInputBoxComponent.styles';\nimport type { ContentModelDocument } from 'roosterjs-content-model-types';\n\n/**\n * @private\n */\nexport interface RichTextInputBoxComponentStylesProps extends BaseCustomStyles {}\n\n/**\n * @private\n */\nexport interface RichTextInputBoxComponentProps {\n placeholderText?: string;\n // the initial content of editor that is set when editor is created (e.g. when editing a message)\n initialContent?: string;\n onChange: (newValue?: string, removedInlineImages?: Record<string, string>[]) => void;\n onEnterKeyDown?: () => void;\n editorComponentRef: React.RefObject<RichTextEditorComponentRef>;\n // Partial needs to be removed when the rich text editor feature goes to GA\n strings: Partial<RichTextSendBoxStrings>;\n disabled: boolean;\n actionComponents: ReactNode;\n onRenderAttachmentUploads?: () => JSX.Element;\n hasAttachments?: boolean;\n // props for min and max height for the rich text editor\n // otherwise the editor will grow to fit the content\n richTextEditorStyleProps: (isExpanded: boolean) => RichTextEditorStyleProps;\n isHorizontalLayoutDisabled?: boolean;\n autoFocus?: 'sendBoxTextField';\n onTyping?: () => Promise<void>;\n onPaste?: (event: {\n content: DocumentFragment;\n }) => void;\n onInsertInlineImage?: (imageAttributes: Record<string, string>) => void;\n}\n\n/**\n * @private\n */\nexport const RichTextInputBoxComponent = (props: RichTextInputBoxComponentProps): JSX.Element => {\n const {\n placeholderText,\n initialContent,\n onChange,\n onEnterKeyDown,\n editorComponentRef,\n disabled,\n strings,\n actionComponents,\n onRenderAttachmentUploads,\n hasAttachments,\n richTextEditorStyleProps,\n isHorizontalLayoutDisabled = false,\n autoFocus,\n onTyping,\n onInsertInlineImage\n } = props;\n const theme = useTheme();\n // undefined is used to indicate that the rich text editor toolbar state wasn't changed yet\n const [showRichTextEditorFormatting, setShowRichTextEditorFormatting] = useState<boolean | undefined>(undefined);\n const [contentModel, setContentModel] = useState<ContentModelDocument | undefined>(undefined);\n const onRenderRichTextEditorIcon = useCallback((isHover: boolean) => {\n const isRichTextEditorToolbarShown = showRichTextEditorFormatting === true;\n return <Icon iconName={isHover || isRichTextEditorToolbarShown ? 'RichTextEditorButtonIconFilled' : 'RichTextEditorButtonIcon'} className={richTextFormatButtonIconStyle(theme, !disabled && (isHover || isRichTextEditorToolbarShown))} />;\n }, [disabled, showRichTextEditorFormatting, theme]);\n const actionButtons = useMemo(() => {\n return <Stack.Item align=\"end\" className={richTextActionButtonsStackStyle}>\n <Stack horizontal>\n <InputBoxButton onRenderIcon={onRenderRichTextEditorIcon} onClick={e => {\n const isRichTextEditorToolbarShown = showRichTextEditorFormatting === true;\n setShowRichTextEditorFormatting(!isRichTextEditorToolbarShown);\n e.stopPropagation(); // Prevents the click from bubbling up and triggering a focus event on the chat.\n }} ariaLabel={strings.richTextFormatButtonTooltip} tooltipContent={strings.richTextFormatButtonTooltip} className={richTextActionButtonsStyle} data-testId={'rich-text-input-box-format-button'} ariaExpanded={showRichTextEditorFormatting} />\n <Icon iconName=\"RichTextDividerIcon\" className={richTextActionButtonsDividerStyle(theme)} />\n {actionComponents}\n </Stack>\n </Stack.Item>;\n }, [actionComponents, onRenderRichTextEditorIcon, showRichTextEditorFormatting, strings.richTextFormatButtonTooltip, theme]);\n const richTextEditorStyle = useMemo(() => {\n return richTextEditorStyleProps(showRichTextEditorFormatting === true);\n }, [richTextEditorStyleProps, showRichTextEditorFormatting]);\n const onKeyDown = useCallback((ev: KeyboardEvent) => {\n if (isEnterKeyEventFromCompositionSession(ev)) {\n return;\n }\n const isRichTextEditorToolbarShown = showRichTextEditorFormatting === true;\n if (ev.key === 'Enter' && ev.shiftKey === false && !isRichTextEditorToolbarShown) {\n ev.preventDefault();\n onEnterKeyDown && onEnterKeyDown();\n } else {\n onTyping?.();\n }\n }, [onEnterKeyDown, showRichTextEditorFormatting, onTyping]);\n const onCompositionUpdate = useCallback(() => {\n onTyping?.();\n }, [onTyping]);\n const useHorizontalLayout = useMemo(() => {\n const isRichTextEditorToolbarShown = showRichTextEditorFormatting === true;\n return !isHorizontalLayoutDisabled && !isRichTextEditorToolbarShown && !hasAttachments;\n }, [isHorizontalLayoutDisabled, showRichTextEditorFormatting, hasAttachments]);\n const onContentModelUpdate = useCallback((contentModel: ContentModelDocument | undefined) => {\n setContentModel(contentModel);\n }, []);\n return <div className={richTextBorderBoxStyle({\n theme: theme,\n disabled: !!disabled\n })}>\n {/* This layout is used for the compact view when formatting options are not shown */}\n {/* We don't use a stack here as there is a bug in Fluent Stack that causes remount of children when using wrap */}\n <div className={inputBoxContentStackStyle} style={{\n display: 'flex',\n flexGrow: 1,\n flexDirection: useHorizontalLayout ? 'row' : 'column',\n justifyContent: useHorizontalLayout ? 'flex-end' : 'space-between',\n flexWrap: useHorizontalLayout ? 'wrap' : 'nowrap'\n }}>\n {/* Fixes the issue when flex box can grow to be bigger than parent */}\n <Stack grow className={inputBoxRichTextStackStyle}>\n <Stack.Item className={inputBoxRichTextStackItemStyle}>\n <RichTextEditor contentModel={contentModel} initialContent={initialContent} placeholderText={placeholderText} onChange={onChange} onKeyDown={onKeyDown} onCompositionUpdate={onCompositionUpdate} ref={editorComponentRef} strings={strings} showRichTextEditorFormatting={showRichTextEditorFormatting === true} styles={richTextEditorStyle} autoFocus={autoFocus} onContentModelUpdate={onContentModelUpdate} onPaste={props.onPaste} onInsertInlineImage={onInsertInlineImage} />\n </Stack.Item>\n {onRenderAttachmentUploads && onRenderAttachmentUploads()}\n </Stack>\n {actionButtons}\n </div>\n </div>;\n};"]}
|