@azure/communication-react 1.21.0-alpha-202410240016 → 1.21.0-alpha-202410260016
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 +197 -4
- package/dist/dist-cjs/communication-react/{ChatMessageComponentAsRichTextEditBox-DMypxgeJ.js → ChatMessageComponentAsRichTextEditBox-DKtnUkjs.js} +2 -2
- package/dist/dist-cjs/communication-react/{ChatMessageComponentAsRichTextEditBox-DMypxgeJ.js.map → ChatMessageComponentAsRichTextEditBox-DKtnUkjs.js.map} +1 -1
- package/dist/dist-cjs/communication-react/{RichTextSendBoxWrapper-CKSPOu5D.js → RichTextSendBoxWrapper-4oy8pNfs.js} +2 -2
- package/dist/dist-cjs/communication-react/{RichTextSendBoxWrapper-CKSPOu5D.js.map → RichTextSendBoxWrapper-4oy8pNfs.js.map} +1 -1
- package/dist/dist-cjs/communication-react/{index-B2OZ_HmN.js → index-DIlQv9vm.js} +437 -234
- package/dist/dist-cjs/communication-react/index-DIlQv9vm.js.map +1 -0
- package/dist/dist-cjs/communication-react/index.js +4 -1
- package/dist/dist-cjs/communication-react/index.js.map +1 -1
- package/dist/dist-esm/acs-ui-common/src/telemetryVersion.js +1 -1
- package/dist/dist-esm/acs-ui-common/src/telemetryVersion.js.map +1 -1
- package/dist/dist-esm/calling-component-bindings/src/handlers/createCommonHandlers.js +21 -17
- package/dist/dist-esm/calling-component-bindings/src/handlers/createCommonHandlers.js.map +1 -1
- package/dist/dist-esm/calling-component-bindings/src/utils/callUtils.d.ts +7 -2
- package/dist/dist-esm/calling-component-bindings/src/utils/callUtils.js +17 -3
- package/dist/dist-esm/calling-component-bindings/src/utils/callUtils.js.map +1 -1
- package/dist/dist-esm/calling-stateful-client/src/CallClientState.d.ts +8 -2
- package/dist/dist-esm/calling-stateful-client/src/CallClientState.js.map +1 -1
- package/dist/dist-esm/calling-stateful-client/src/UserFacingDiagnosticsSubscriber.js +2 -1
- package/dist/dist-esm/calling-stateful-client/src/UserFacingDiagnosticsSubscriber.js.map +1 -1
- package/dist/dist-esm/calling-stateful-client/src/index-public.d.ts +1 -1
- package/dist/dist-esm/calling-stateful-client/src/index-public.js.map +1 -1
- package/dist/dist-esm/communication-react/src/index.d.ts +7 -1
- package/dist/dist-esm/communication-react/src/index.js +6 -0
- package/dist/dist-esm/communication-react/src/index.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/Notification.d.ts +49 -2
- package/dist/dist-esm/react-components/src/components/Notification.js +14 -10
- package/dist/dist-esm/react-components/src/components/Notification.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/RTTDisclosureBanner.d.ts +28 -0
- package/dist/dist-esm/react-components/src/components/RTTDisclosureBanner.js +28 -0
- package/dist/dist-esm/react-components/src/components/RTTDisclosureBanner.js.map +1 -0
- package/dist/dist-esm/react-components/src/components/RTTModal.d.ts +39 -0
- package/dist/dist-esm/react-components/src/components/RTTModal.js +55 -0
- package/dist/dist-esm/react-components/src/components/RTTModal.js.map +1 -0
- package/dist/dist-esm/react-components/src/components/RealTimeText.d.ts +54 -0
- package/dist/dist-esm/react-components/src/components/RealTimeText.js +43 -0
- package/dist/dist-esm/react-components/src/components/RealTimeText.js.map +1 -0
- package/dist/dist-esm/react-components/src/components/RichTextEditor/RichTextEditor.js +13 -1
- package/dist/dist-esm/react-components/src/components/RichTextEditor/RichTextEditor.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/RichTextEditor/RichTextInputBoxComponent.js +8 -11
- package/dist/dist-esm/react-components/src/components/RichTextEditor/RichTextInputBoxComponent.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/RichTextEditor/RichTextSendBox.d.ts +4 -0
- package/dist/dist-esm/react-components/src/components/RichTextEditor/RichTextSendBox.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/RichTextEditor/Toolbar/RichTextToolbar.js +1 -1
- package/dist/dist-esm/react-components/src/components/RichTextEditor/Toolbar/RichTextToolbar.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/StreamMedia.js +13 -4
- package/dist/dist-esm/react-components/src/components/StreamMedia.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/Survey/TagsSurvey/TagsSurvey.js +3 -4
- package/dist/dist-esm/react-components/src/components/Survey/TagsSurvey/TagsSurvey.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/VideoGallery/useVideoStreamLifecycleMaintainer.js +4 -0
- package/dist/dist-esm/react-components/src/components/VideoGallery/useVideoStreamLifecycleMaintainer.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/VideoGallery/useVideoTileContextualMenuProps.js +1 -1
- package/dist/dist-esm/react-components/src/components/VideoGallery/useVideoTileContextualMenuProps.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/VideoTile.d.ts +2 -0
- package/dist/dist-esm/react-components/src/components/VideoTile.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/index.d.ts +3 -0
- package/dist/dist-esm/react-components/src/components/index.js +6 -0
- package/dist/dist-esm/react-components/src/components/index.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/styles/Captions.style.d.ts +8 -0
- package/dist/dist-esm/react-components/src/components/styles/Captions.style.js +26 -0
- package/dist/dist-esm/react-components/src/components/styles/Captions.style.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/styles/Notification.styles.d.ts +9 -5
- package/dist/dist-esm/react-components/src/components/styles/Notification.styles.js +43 -24
- package/dist/dist-esm/react-components/src/components/styles/Notification.styles.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/styles/RTTDisclosureBanner.styles.d.ts +6 -0
- package/dist/dist-esm/react-components/src/components/styles/RTTDisclosureBanner.styles.js +17 -0
- package/dist/dist-esm/react-components/src/components/styles/RTTDisclosureBanner.styles.js.map +1 -0
- package/dist/dist-esm/react-components/src/components/styles/StreamMedia.styles.d.ts +2 -2
- package/dist/dist-esm/react-components/src/components/styles/StreamMedia.styles.js +6 -15
- package/dist/dist-esm/react-components/src/components/styles/StreamMedia.styles.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/utils/Logger.d.ts +5 -0
- package/dist/dist-esm/react-components/src/components/utils/Logger.js +8 -0
- package/dist/dist-esm/react-components/src/components/utils/Logger.js.map +1 -0
- package/dist/dist-esm/react-components/src/localization/LocalizationProvider.d.ts +9 -0
- package/dist/dist-esm/react-components/src/localization/LocalizationProvider.js.map +1 -1
- package/dist/dist-esm/react-components/src/localization/locales/en-US/strings.json +18 -0
- package/dist/dist-esm/react-components/src/theming/icons.d.ts +1 -0
- package/dist/dist-esm/react-components/src/theming/icons.js +5 -1
- package/dist/dist-esm/react-components/src/theming/icons.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/CallAdapter.d.ts +2 -3
- package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/CallAdapter.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/components/BreakoutRoomsBanner.d.ts +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/components/BreakoutRoomsBanner.js +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/components/BreakoutRoomsBanner.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/styles/CallConfiguration.styles.js +2 -1
- 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 -1
- package/dist/dist-esm/react-composites/src/composites/common/ControlBar/DesktopMoreButton.js +1 -0
- package/dist/dist-esm/react-composites/src/composites/common/ControlBar/DesktopMoreButton.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/common/icons.d.ts +1 -0
- package/package.json +1 -1
- package/dist/dist-cjs/communication-react/index-B2OZ_HmN.js.map +0 -1
@@ -0,0 +1,28 @@
|
|
1
|
+
/// <reference types="react" />
|
2
|
+
/**
|
3
|
+
* @beta
|
4
|
+
* strings for rtt modal
|
5
|
+
*/
|
6
|
+
export interface RTTDisclosureBannerStrings {
|
7
|
+
bannerTitle: string;
|
8
|
+
bannerContent: string;
|
9
|
+
bannerLinkLabel?: string;
|
10
|
+
}
|
11
|
+
/**
|
12
|
+
* @beta
|
13
|
+
* Props for RTT Banner
|
14
|
+
*/
|
15
|
+
export interface RTTDisclosureBannerProps {
|
16
|
+
/**
|
17
|
+
* Optional callback to supply users with further troubleshooting steps or more information for the Real Time Text feature.
|
18
|
+
*/
|
19
|
+
onClickLink?: () => void;
|
20
|
+
/** RTT Banner strings */
|
21
|
+
strings?: RTTDisclosureBannerStrings;
|
22
|
+
}
|
23
|
+
/**
|
24
|
+
* @beta
|
25
|
+
* Banner to disclose that RTT is enabled for all participants for the entire duration of the meeting.
|
26
|
+
*/
|
27
|
+
export declare const RTTDisclosureBanner: (props: RTTDisclosureBannerProps) => JSX.Element;
|
28
|
+
//# sourceMappingURL=RTTDisclosureBanner.d.ts.map
|
@@ -0,0 +1,28 @@
|
|
1
|
+
// Copyright (c) Microsoft Corporation.
|
2
|
+
// Licensed under the MIT License.
|
3
|
+
/* @conditional-compile-remove(rtt) */
|
4
|
+
import React from 'react';
|
5
|
+
/* @conditional-compile-remove(rtt) */
|
6
|
+
import { useLocale } from '../localization';
|
7
|
+
/* @conditional-compile-remove(rtt) */
|
8
|
+
import { Notification } from './Notification';
|
9
|
+
/* @conditional-compile-remove(rtt) */
|
10
|
+
import { useTheme } from '@fluentui/react';
|
11
|
+
/* @conditional-compile-remove(rtt) */
|
12
|
+
import { rttContainerStyles } from './styles/RTTDisclosureBanner.styles';
|
13
|
+
/* @conditional-compile-remove(rtt) */
|
14
|
+
/**
|
15
|
+
* @beta
|
16
|
+
* Banner to disclose that RTT is enabled for all participants for the entire duration of the meeting.
|
17
|
+
*/
|
18
|
+
export const RTTDisclosureBanner = (props) => {
|
19
|
+
const localeStrings = useLocale().strings.rttDisclosureBanner;
|
20
|
+
const strings = Object.assign(Object.assign({}, localeStrings), props.strings);
|
21
|
+
const theme = useTheme();
|
22
|
+
return (React.createElement(Notification, { notificationStrings: {
|
23
|
+
title: strings.bannerTitle,
|
24
|
+
message: strings.bannerContent,
|
25
|
+
linkLabel: strings.bannerLinkLabel
|
26
|
+
}, notificationIconProps: { iconName: 'RTTIcon' }, onClickLink: props.onClickLink, styles: { root: rttContainerStyles(theme) } }));
|
27
|
+
};
|
28
|
+
//# sourceMappingURL=RTTDisclosureBanner.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"RTTDisclosureBanner.js","sourceRoot":"","sources":["../../../../../../react-components/src/components/RTTDisclosureBanner.tsx"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,sCAAsC;AACtC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,sCAAsC;AACtC,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,sCAAsC;AACtC,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,sCAAsC;AACtC,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAC3C,sCAAsC;AACtC,OAAO,EAAE,kBAAkB,EAAE,MAAM,qCAAqC,CAAC;AA2BzE,sCAAsC;AACtC;;;GAGG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,KAA+B,EAAe,EAAE;IAClF,MAAM,aAAa,GAAG,SAAS,EAAE,CAAC,OAAO,CAAC,mBAAmB,CAAC;IAC9D,MAAM,OAAO,mCAAQ,aAAa,GAAK,KAAK,CAAC,OAAO,CAAE,CAAC;IACvD,MAAM,KAAK,GAAG,QAAQ,EAAE,CAAC;IAEzB,OAAO,CACL,oBAAC,YAAY,IACX,mBAAmB,EAAE;YACnB,KAAK,EAAE,OAAO,CAAC,WAAW;YAC1B,OAAO,EAAE,OAAO,CAAC,aAAa;YAC9B,SAAS,EAAE,OAAO,CAAC,eAAe;SACnC,EACD,qBAAqB,EAAE,EAAE,QAAQ,EAAE,SAAS,EAAE,EAC9C,WAAW,EAAE,KAAK,CAAC,WAAW,EAC9B,MAAM,EAAE,EAAE,IAAI,EAAE,kBAAkB,CAAC,KAAK,CAAC,EAAE,GAC3C,CACH,CAAC;AACJ,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\n/* @conditional-compile-remove(rtt) */\nimport React from 'react';\n/* @conditional-compile-remove(rtt) */\nimport { useLocale } from '../localization';\n/* @conditional-compile-remove(rtt) */\nimport { Notification } from './Notification';\n/* @conditional-compile-remove(rtt) */\nimport { useTheme } from '@fluentui/react';\n/* @conditional-compile-remove(rtt) */\nimport { rttContainerStyles } from './styles/RTTDisclosureBanner.styles';\n\n/* @conditional-compile-remove(rtt) */\n/**\n * @beta\n * strings for rtt modal\n */\nexport interface RTTDisclosureBannerStrings {\n bannerTitle: string;\n bannerContent: string;\n bannerLinkLabel?: string;\n}\n\n/* @conditional-compile-remove(rtt) */\n/**\n * @beta\n * Props for RTT Banner\n */\nexport interface RTTDisclosureBannerProps {\n /**\n * Optional callback to supply users with further troubleshooting steps or more information for the Real Time Text feature.\n */\n onClickLink?: () => void;\n /** RTT Banner strings */\n strings?: RTTDisclosureBannerStrings;\n}\n\n/* @conditional-compile-remove(rtt) */\n/**\n * @beta\n * Banner to disclose that RTT is enabled for all participants for the entire duration of the meeting.\n */\nexport const RTTDisclosureBanner = (props: RTTDisclosureBannerProps): JSX.Element => {\n const localeStrings = useLocale().strings.rttDisclosureBanner;\n const strings = { ...localeStrings, ...props.strings };\n const theme = useTheme();\n\n return (\n <Notification\n notificationStrings={{\n title: strings.bannerTitle,\n message: strings.bannerContent,\n linkLabel: strings.bannerLinkLabel\n }}\n notificationIconProps={{ iconName: 'RTTIcon' }}\n onClickLink={props.onClickLink}\n styles={{ root: rttContainerStyles(theme) }}\n />\n );\n};\n"]}
|
@@ -0,0 +1,39 @@
|
|
1
|
+
/// <reference types="react" />
|
2
|
+
/**
|
3
|
+
* @beta
|
4
|
+
* strings for rtt modal
|
5
|
+
*/
|
6
|
+
export interface RTTModalStrings {
|
7
|
+
/** The title of the RTT modal */
|
8
|
+
rttModalTitle?: string;
|
9
|
+
/** The text of the RTT modal */
|
10
|
+
rttModalText?: string;
|
11
|
+
/** The label for the confirm button */
|
12
|
+
rttConfirmButtonLabel?: string;
|
13
|
+
/** The label for the cancel button */
|
14
|
+
rttCancelButtonLabel?: string;
|
15
|
+
/** The aria label for the modal */
|
16
|
+
rttModalAriaLabel?: string;
|
17
|
+
/** The aria label for the close button */
|
18
|
+
rttCloseModalButtonAriaLabel?: string;
|
19
|
+
}
|
20
|
+
/**
|
21
|
+
* @beta
|
22
|
+
* RTTModal Component Props.
|
23
|
+
*/
|
24
|
+
export interface RTTModalProps {
|
25
|
+
/** The strings for the RTT modal */
|
26
|
+
strings?: RTTModalStrings;
|
27
|
+
/** The flag to show the modal */
|
28
|
+
showModal?: boolean;
|
29
|
+
/** The function to dismiss the modal */
|
30
|
+
onDismissModal?: () => void;
|
31
|
+
/** The function to start RTT */
|
32
|
+
onStartRTT?: () => Promise<void>;
|
33
|
+
}
|
34
|
+
/**
|
35
|
+
* @beta
|
36
|
+
* a component for rtt modal
|
37
|
+
*/
|
38
|
+
export declare const RTTModal: (props: RTTModalProps) => JSX.Element;
|
39
|
+
//# sourceMappingURL=RTTModal.d.ts.map
|
@@ -0,0 +1,55 @@
|
|
1
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
2
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
3
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
4
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
5
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
6
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
7
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
8
|
+
});
|
9
|
+
};
|
10
|
+
// Copyright (c) Microsoft Corporation.
|
11
|
+
// Licensed under the MIT License.
|
12
|
+
/* @conditional-compile-remove(rtt) */
|
13
|
+
import React, { useCallback } from 'react';
|
14
|
+
/* @conditional-compile-remove(rtt) */
|
15
|
+
import { useMemo } from 'react';
|
16
|
+
/* @conditional-compile-remove(rtt) */
|
17
|
+
import { Modal, Stack, useTheme, Text, IconButton, DefaultButton, PrimaryButton } from '@fluentui/react';
|
18
|
+
/* @conditional-compile-remove(rtt) */
|
19
|
+
import { buttonsContainerClassName, buttonStyles, themedCaptionsSettingsModalStyle, titleClassName, titleContainerClassName } from './styles/CaptionsSettingsModal.styles';
|
20
|
+
/* @conditional-compile-remove(rtt) */
|
21
|
+
import { useLocale } from '../localization';
|
22
|
+
/* @conditional-compile-remove(rtt) */
|
23
|
+
/**
|
24
|
+
* @beta
|
25
|
+
* a component for rtt modal
|
26
|
+
*/
|
27
|
+
export const RTTModal = (props) => {
|
28
|
+
const { showModal, onDismissModal, onStartRTT } = props;
|
29
|
+
const localeStrings = useLocale().strings.rttModal;
|
30
|
+
const strings = Object.assign(Object.assign({}, localeStrings), props.strings);
|
31
|
+
const theme = useTheme();
|
32
|
+
const onDismiss = useCallback(() => {
|
33
|
+
if (onDismissModal) {
|
34
|
+
onDismissModal();
|
35
|
+
}
|
36
|
+
}, [onDismissModal]);
|
37
|
+
const onConfirm = useCallback(() => __awaiter(void 0, void 0, void 0, function* () {
|
38
|
+
if (onStartRTT) {
|
39
|
+
yield onStartRTT();
|
40
|
+
}
|
41
|
+
onDismiss();
|
42
|
+
}), [onDismiss, onStartRTT]);
|
43
|
+
const RTTModalStyle = useMemo(() => themedCaptionsSettingsModalStyle(theme), [theme]);
|
44
|
+
return (React.createElement(React.Fragment, null, React.createElement(Modal, { titleAriaId: strings === null || strings === void 0 ? void 0 : strings.rttModalAriaLabel, isOpen: showModal, onDismiss: onDismiss, isBlocking: true, styles: RTTModalStyle },
|
45
|
+
React.createElement(Stack, { horizontal: true, horizontalAlign: "space-between", verticalAlign: "center", className: titleContainerClassName },
|
46
|
+
React.createElement(Text, { className: titleClassName }, strings === null || strings === void 0 ? void 0 : strings.rttModalTitle),
|
47
|
+
React.createElement(IconButton, { iconProps: { iconName: 'Cancel' }, ariaLabel: strings === null || strings === void 0 ? void 0 : strings.rttCloseModalButtonAriaLabel, onClick: onDismiss, style: { color: theme.palette.black } })),
|
48
|
+
React.createElement(Text, null, strings === null || strings === void 0 ? void 0 : strings.rttModalText),
|
49
|
+
React.createElement(Stack, { horizontal: true, horizontalAlign: "end", className: buttonsContainerClassName },
|
50
|
+
React.createElement(PrimaryButton, { styles: buttonStyles(theme), onClick: onConfirm },
|
51
|
+
React.createElement("span", null, strings === null || strings === void 0 ? void 0 : strings.rttConfirmButtonLabel)),
|
52
|
+
React.createElement(DefaultButton, { onClick: onDismiss, styles: buttonStyles(theme) },
|
53
|
+
React.createElement("span", null, strings === null || strings === void 0 ? void 0 : strings.rttCancelButtonLabel))))));
|
54
|
+
};
|
55
|
+
//# sourceMappingURL=RTTModal.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"RTTModal.js","sourceRoot":"","sources":["../../../../../../react-components/src/components/RTTModal.tsx"],"names":[],"mappings":";;;;;;;;;AAAA,uCAAuC;AACvC,kCAAkC;AAClC,sCAAsC;AACtC,OAAO,KAAK,EAAE,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AAC3C,sCAAsC;AACtC,OAAO,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAChC,sCAAsC;AACtC,OAAO,EAAgB,KAAK,EAAE,KAAK,EAAE,QAAQ,EAAE,IAAI,EAAE,UAAU,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAKvH,sCAAsC;AACtC,OAAO,EACL,yBAAyB,EACzB,YAAY,EACZ,gCAAgC,EAChC,cAAc,EACd,uBAAuB,EACxB,MAAM,uCAAuC,CAAC;AAC/C,sCAAsC;AACtC,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;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a,CAAQ;YAChE,oBAAC,UAAU,IACT,SAAS,EAAE,EAAE,QAAQ,EAAE,QAAQ,EAAE,EACjC,SAAS,EAAE,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,4BAA4B,EAChD,OAAO,EAAE,SAAS,EAClB,KAAK,EAAE,EAAE,KAAK,EAAE,KAAK,CAAC,OAAO,CAAC,KAAK,EAAE,GACrC,CACI;QACR,oBAAC,IAAI,QAAE,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,YAAY,CAAQ;QAEpC,oBAAC,KAAK,IAAC,UAAU,QAAC,eAAe,EAAC,KAAK,EAAC,SAAS,EAAE,yBAAyB;YAC1E,oBAAC,aAAa,IAAC,MAAM,EAAE,YAAY,CAAC,KAAK,CAAC,EAAE,OAAO,EAAE,SAAS;gBAC5D,kCAAO,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,qBAAqB,CAAQ,CAC/B;YAChB,oBAAC,aAAa,IAAC,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,YAAY,CAAC,KAAK,CAAC;gBAC5D,kCAAO,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,oBAAoB,CAAQ,CAC9B,CACV,CACF,CAET,CACJ,CAAC;AACJ,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n/* @conditional-compile-remove(rtt) */\nimport React, { useCallback } from 'react';\n/* @conditional-compile-remove(rtt) */\nimport { useMemo } from 'react';\n/* @conditional-compile-remove(rtt) */\nimport { IModalStyles, Modal, Stack, useTheme, Text, IconButton, DefaultButton, PrimaryButton } from '@fluentui/react';\n/* @conditional-compile-remove(rtt) */\nimport { _captionsOptions } from './StartCaptionsButton';\n/* @conditional-compile-remove(rtt) */\nimport { _preventDismissOnEvent } from '@internal/acs-ui-common';\n/* @conditional-compile-remove(rtt) */\nimport {\n buttonsContainerClassName,\n buttonStyles,\n themedCaptionsSettingsModalStyle,\n titleClassName,\n titleContainerClassName\n} from './styles/CaptionsSettingsModal.styles';\n/* @conditional-compile-remove(rtt) */\nimport { useLocale } from '../localization';\n\n/* @conditional-compile-remove(rtt) */\n/**\n * @beta\n * strings for rtt modal\n */\nexport interface RTTModalStrings {\n /** The title of the RTT modal */\n rttModalTitle?: string;\n /** The text of the RTT modal */\n rttModalText?: string;\n /** The label for the confirm button */\n rttConfirmButtonLabel?: string;\n /** The label for the cancel button */\n rttCancelButtonLabel?: string;\n /** The aria label for the modal */\n rttModalAriaLabel?: string;\n /** The aria label for the close button */\n rttCloseModalButtonAriaLabel?: string;\n}\n/* @conditional-compile-remove(rtt) */\n/**\n * @beta\n * RTTModal Component Props.\n */\nexport interface RTTModalProps {\n /** The strings for the RTT modal */\n strings?: RTTModalStrings;\n /** The flag to show the modal */\n showModal?: boolean;\n /** The function to dismiss the modal */\n onDismissModal?: () => void;\n /** The function to start RTT */\n onStartRTT?: () => Promise<void>;\n}\n/* @conditional-compile-remove(rtt) */\n/**\n * @beta\n * a component for rtt modal\n */\nexport const RTTModal = (props: RTTModalProps): JSX.Element => {\n const { showModal, onDismissModal, onStartRTT } = props;\n const localeStrings = useLocale().strings.rttModal;\n const strings = { ...localeStrings, ...props.strings };\n\n const theme = useTheme();\n\n const onDismiss = useCallback((): void => {\n if (onDismissModal) {\n onDismissModal();\n }\n }, [onDismissModal]);\n\n const onConfirm = useCallback(async (): Promise<void> => {\n if (onStartRTT) {\n await onStartRTT();\n }\n onDismiss();\n }, [onDismiss, onStartRTT]);\n\n const RTTModalStyle: Partial<IModalStyles> = useMemo(() => themedCaptionsSettingsModalStyle(theme), [theme]);\n\n return (\n <>\n {\n <Modal\n titleAriaId={strings?.rttModalAriaLabel}\n isOpen={showModal}\n onDismiss={onDismiss}\n isBlocking={true}\n styles={RTTModalStyle}\n >\n <Stack horizontal horizontalAlign=\"space-between\" verticalAlign=\"center\" className={titleContainerClassName}>\n <Text className={titleClassName}>{strings?.rttModalTitle}</Text>\n <IconButton\n iconProps={{ iconName: 'Cancel' }}\n ariaLabel={strings?.rttCloseModalButtonAriaLabel}\n onClick={onDismiss}\n style={{ color: theme.palette.black }}\n />\n </Stack>\n <Text>{strings?.rttModalText}</Text>\n\n <Stack horizontal horizontalAlign=\"end\" className={buttonsContainerClassName}>\n <PrimaryButton styles={buttonStyles(theme)} onClick={onConfirm}>\n <span>{strings?.rttConfirmButtonLabel}</span>\n </PrimaryButton>\n <DefaultButton onClick={onDismiss} styles={buttonStyles(theme)}>\n <span>{strings?.rttCancelButtonLabel}</span>\n </DefaultButton>\n </Stack>\n </Modal>\n }\n </>\n );\n};\n"]}
|
@@ -0,0 +1,54 @@
|
|
1
|
+
/// <reference types="react" />
|
2
|
+
import { OnRenderAvatarCallback } from '../types';
|
3
|
+
/**
|
4
|
+
* @beta
|
5
|
+
* strings for rtt
|
6
|
+
*/
|
7
|
+
export interface RealTimeTextStrings {
|
8
|
+
/**
|
9
|
+
* String indicating that the user is typing
|
10
|
+
*/
|
11
|
+
isTypingText?: string;
|
12
|
+
}
|
13
|
+
/**
|
14
|
+
* @beta
|
15
|
+
* Props for a single line of RealTimeText.
|
16
|
+
*/
|
17
|
+
export interface RealTimeTextProps {
|
18
|
+
/**
|
19
|
+
* RealTimeText id
|
20
|
+
*/
|
21
|
+
id: string;
|
22
|
+
/**
|
23
|
+
* Display name of the user
|
24
|
+
*/
|
25
|
+
displayName: string;
|
26
|
+
/**
|
27
|
+
* RealTimeText content
|
28
|
+
*/
|
29
|
+
captionText: string;
|
30
|
+
/**
|
31
|
+
* user id of the user
|
32
|
+
*/
|
33
|
+
userId?: string;
|
34
|
+
/**
|
35
|
+
* Optional callback to override render of the avatar.
|
36
|
+
*
|
37
|
+
* @param userId - user Id
|
38
|
+
*/
|
39
|
+
onRenderAvatar?: OnRenderAvatarCallback;
|
40
|
+
/**
|
41
|
+
* Boolean indicating whether the RealTimeText is still in progress
|
42
|
+
*/
|
43
|
+
isTyping?: boolean;
|
44
|
+
/**
|
45
|
+
* Strings for RealTimeText
|
46
|
+
*/
|
47
|
+
strings?: RealTimeTextStrings;
|
48
|
+
}
|
49
|
+
/**
|
50
|
+
* @beta
|
51
|
+
* A component for displaying a single line of RealTimeText
|
52
|
+
*/
|
53
|
+
export declare const RealTimeText: (props: RealTimeTextProps) => JSX.Element;
|
54
|
+
//# sourceMappingURL=RealTimeText.d.ts.map
|
@@ -0,0 +1,43 @@
|
|
1
|
+
// Copyright (c) Microsoft Corporation.
|
2
|
+
// Licensed under the MIT License.
|
3
|
+
/* @conditional-compile-remove(rtt) */
|
4
|
+
import { Persona, Stack, PersonaSize, Text, useTheme } from '@fluentui/react';
|
5
|
+
/* @conditional-compile-remove(rtt) */
|
6
|
+
import React from 'react';
|
7
|
+
/* @conditional-compile-remove(rtt) */
|
8
|
+
import { captionClassName, captionsContentContainerClassName, displayNameClassName, displayNameContainerClassName, iconClassName, isTypingClassName, rttContainerClassName } from './styles/Captions.style';
|
9
|
+
/* @conditional-compile-remove(rtt) */
|
10
|
+
import { useLocale } from '../localization';
|
11
|
+
/* @conditional-compile-remove(rtt) */
|
12
|
+
/**
|
13
|
+
* @beta
|
14
|
+
* A component for displaying a single line of RealTimeText
|
15
|
+
*/
|
16
|
+
export const RealTimeText = (props) => {
|
17
|
+
const { displayName, userId, captionText, onRenderAvatar, isTyping } = props;
|
18
|
+
const theme = useTheme();
|
19
|
+
const localeStrings = useLocale().strings.rtt;
|
20
|
+
const strings = Object.assign(Object.assign({}, localeStrings), props.strings);
|
21
|
+
const personaOptions = {
|
22
|
+
hidePersonaDetails: true,
|
23
|
+
size: PersonaSize.size32,
|
24
|
+
text: displayName,
|
25
|
+
showOverflowTooltip: false,
|
26
|
+
imageShouldStartVisible: true,
|
27
|
+
initialsTextColor: 'white',
|
28
|
+
styles: {
|
29
|
+
root: {
|
30
|
+
margin: '0.25rem'
|
31
|
+
}
|
32
|
+
}
|
33
|
+
};
|
34
|
+
const userIcon = onRenderAvatar ? onRenderAvatar(userId !== null && userId !== void 0 ? userId : '', personaOptions) : React.createElement(Persona, Object.assign({}, personaOptions));
|
35
|
+
return (React.createElement(Stack, { horizontal: true, verticalAlign: "start", horizontalAlign: "start", className: rttContainerClassName(theme, isTyping !== null && isTyping !== void 0 ? isTyping : false) },
|
36
|
+
React.createElement(Stack.Item, { className: iconClassName }, userIcon),
|
37
|
+
React.createElement(Stack, { verticalAlign: "start", className: captionsContentContainerClassName },
|
38
|
+
React.createElement(Stack, { className: displayNameContainerClassName, horizontal: true },
|
39
|
+
React.createElement(Text, { className: displayNameClassName }, displayName),
|
40
|
+
isTyping && React.createElement(Text, { className: isTypingClassName(theme) }, strings === null || strings === void 0 ? void 0 : strings.isTypingText)),
|
41
|
+
React.createElement(Stack.Item, { className: captionClassName, dir: "auto" }, captionText))));
|
42
|
+
};
|
43
|
+
//# sourceMappingURL=RealTimeText.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"RealTimeText.js","sourceRoot":"","sources":["../../../../../../react-components/src/components/RealTimeText.tsx"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAClC,sCAAsC;AACtC,OAAO,EAAY,OAAO,EAAE,KAAK,EAAE,WAAW,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AACxF,sCAAsC;AACtC,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,sCAAsC;AACtC,OAAO,EACL,gBAAgB,EAChB,iCAAiC,EACjC,oBAAoB,EACpB,6BAA6B,EAC7B,aAAa,EACb,iBAAiB,EACjB,qBAAqB,EACtB,MAAM,yBAAyB,CAAC;AAGjC,sCAAsC;AACtC,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAoD5C,sCAAsC;AACtC;;;GAGG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,KAAwB,EAAe,EAAE;IACpE,MAAM,EAAE,WAAW,EAAE,MAAM,EAAE,WAAW,EAAE,cAAc,EAAE,QAAQ,EAAE,GAAG,KAAK,CAAC;IAC7E,MAAM,KA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KAAK,CAAC,IAAI,IAAC,SAAS,EAAE,gBAAgB,EAAE,GAAG,EAAC,MAAM,IAChD,WAAW,CACD,CACP,CACF,CACT,CAAC;AACJ,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n/* @conditional-compile-remove(rtt) */\nimport { IPersona, Persona, Stack, PersonaSize, Text, useTheme } from '@fluentui/react';\n/* @conditional-compile-remove(rtt) */\nimport React from 'react';\n/* @conditional-compile-remove(rtt) */\nimport { OnRenderAvatarCallback } from '../types';\n/* @conditional-compile-remove(rtt) */\nimport {\n captionClassName,\n captionsContentContainerClassName,\n displayNameClassName,\n displayNameContainerClassName,\n iconClassName,\n isTypingClassName,\n rttContainerClassName\n} from './styles/Captions.style';\n/* @conditional-compile-remove(rtt) */\nimport { _CaptionsInfo } from './CaptionsBanner';\n/* @conditional-compile-remove(rtt) */\nimport { useLocale } from '../localization';\n\n/* @conditional-compile-remove(rtt) */\n/**\n * @beta\n * strings for rtt\n */\nexport interface RealTimeTextStrings {\n /**\n * String indicating that the user is typing\n */\n isTypingText?: string;\n}\n\n/* @conditional-compile-remove(rtt) */\n/**\n * @beta\n * Props for a single line of RealTimeText.\n */\nexport interface RealTimeTextProps {\n /**\n * RealTimeText id\n */\n id: string;\n /**\n * Display name of the user\n */\n displayName: string;\n /**\n * RealTimeText content\n */\n captionText: string;\n /**\n * user id of the user\n */\n userId?: string;\n /**\n * Optional callback to override render of the avatar.\n *\n * @param userId - user Id\n */\n onRenderAvatar?: OnRenderAvatarCallback;\n /**\n * Boolean indicating whether the RealTimeText is still in progress\n */\n isTyping?: boolean;\n /**\n * Strings for RealTimeText\n */\n strings?: RealTimeTextStrings;\n}\n\n/* @conditional-compile-remove(rtt) */\n/**\n * @beta\n * A component for displaying a single line of RealTimeText\n */\nexport const RealTimeText = (props: RealTimeTextProps): JSX.Element => {\n const { displayName, userId, captionText, onRenderAvatar, isTyping } = props;\n const theme = useTheme();\n const localeStrings = useLocale().strings.rtt;\n const strings = { ...localeStrings, ...props.strings };\n\n const personaOptions: IPersona = {\n hidePersonaDetails: true,\n size: PersonaSize.size32,\n text: displayName,\n showOverflowTooltip: false,\n imageShouldStartVisible: true,\n initialsTextColor: 'white',\n styles: {\n root: {\n margin: '0.25rem'\n }\n }\n };\n\n const userIcon = onRenderAvatar ? onRenderAvatar(userId ?? '', personaOptions) : <Persona {...personaOptions} />;\n\n return (\n <Stack\n horizontal\n verticalAlign=\"start\"\n horizontalAlign=\"start\"\n className={rttContainerClassName(theme, isTyping ?? false)}\n >\n <Stack.Item className={iconClassName}>{userIcon}</Stack.Item>\n\n <Stack verticalAlign=\"start\" className={captionsContentContainerClassName}>\n <Stack className={displayNameContainerClassName} horizontal>\n <Text className={displayNameClassName}>{displayName}</Text>\n {isTyping && <Text className={isTypingClassName(theme)}>{strings?.isTypingText}</Text>}\n </Stack>\n <Stack.Item className={captionClassName} dir=\"auto\">\n {captionText}\n </Stack.Item>\n </Stack>\n </Stack>\n );\n};\n"]}
|
@@ -34,6 +34,7 @@ export const RichTextEditor = React.forwardRef((props, ref) => {
|
|
34
34
|
onInsertInlineImage } = props;
|
35
35
|
const editor = useRef(null);
|
36
36
|
const editorDiv = useRef(null);
|
37
|
+
const toolbarRef = useRef(null);
|
37
38
|
const theme = useTheme();
|
38
39
|
const [contextMenuProps, setContextMenuProps] = useState(null);
|
39
40
|
const previousThemeDirection = useRef(themeDirection(theme));
|
@@ -51,6 +52,17 @@ export const RichTextEditor = React.forwardRef((props, ref) => {
|
|
51
52
|
// This effect should only run once when the component is unmounted, so we don't need to add any dependencies
|
52
53
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
53
54
|
}, []);
|
55
|
+
useEffect(() => {
|
56
|
+
var _a, _b;
|
57
|
+
if (editor.current) {
|
58
|
+
if (showRichTextEditorFormatting) {
|
59
|
+
(_a = toolbarRef.current) === null || _a === void 0 ? void 0 : _a.focus();
|
60
|
+
}
|
61
|
+
else {
|
62
|
+
(_b = editor.current) === null || _b === void 0 ? void 0 : _b.focus();
|
63
|
+
}
|
64
|
+
}
|
65
|
+
}, [showRichTextEditorFormatting]);
|
54
66
|
useImperativeHandle(ref, () => {
|
55
67
|
return {
|
56
68
|
focus() {
|
@@ -321,7 +333,7 @@ export const RichTextEditor = React.forwardRef((props, ref) => {
|
|
321
333
|
}
|
322
334
|
}, [theme]);
|
323
335
|
return (React.createElement("div", { "data-testid": 'rich-text-editor-wrapper' },
|
324
|
-
showRichTextEditorFormatting && toolbar,
|
336
|
+
React.createElement("div", { ref: toolbarRef }, showRichTextEditorFormatting && toolbar),
|
325
337
|
React.createElement("div", { className: richTextEditorWrapperStyle(theme) },
|
326
338
|
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 })),
|
327
339
|
contextMenuProps && React.createElement(ContextualMenu, Object.assign({}, contextMenuProps, { calloutProps: { isBeakVisible: false } }))));
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"RichTextEditor.js","sourceRoot":"","sources":["../../../../../../../react-components/src/components/RichTextEditor/RichTextEditor.tsx"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAClC,OAAO,KAAK,EAAE,EAAE,WAAW,EAAE,SAAS,EAAE,mBAAmB,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACtG,OAAO,EAAE,0BAA0B,EAAE,mBAAmB,EAAE,MAAM,iCAAiC,CAAC;AAClG,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAEzC,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AACxD,OAAO,eAAe,MAAM,2BAA2B,CAAC;AAUxD,OAAO,EAAE,mBAAmB,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAC1F,OAAO,EACL,QAAQ,EACR,gB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AAK,CAAC,CAAC;gBACrC,YAAY,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;gBAChC,4BAA4B,CAAC,YAAY,EAAE,KAAK,CAAC,CAAC;gBAClD,iFAAiF;gBACjF,KAAK,CAAC,QAAQ,CAAC,IAAI,CAAC,QAAQ,EAAE,CAAC,CAAC;YAClC,CAAC;QACH,CAAC;QACD,OAAO,YAAY,CAAC;IACtB,CAAC;AACH,CAAC,CAAC;AAEF,MAAM,4BAA4B,GAAG,CAAC,KAAqC,EAAE,KAA4B,EAAQ,EAAE;;IACjH,yEAAyE;IACzE,MAAM,MAAM,GAAG,KAAK,CAAC,QAAQ,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,MAAA,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,QAAQ,CAAC,MAAM,GAAG,CAAC,CAAC,0CAAE,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC;IACzG,MAAM,MAAM,GAAG,qBAAqB,CAAC,MAAM,CAAC,CAAC;IAC7C,KAAK,CAAC,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IAC5B,YAAY,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;AAC9B,CAAC,CAAC;AAEF,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 {\n ContentModelDocument,\n ContentModelParagraph,\n EditorPlugin,\n IEditor,\n ReadonlyContentModelBlockGroup,\n ShallowMutableContentModelDocument,\n KnownAnnounceStrings\n} from 'roosterjs-content-model-types';\nimport { createModelFromHtml, Editor, exportContent } from 'roosterjs-content-model-core';\nimport {\n createBr,\n createEmptyModel,\n createParagraph,\n createSelectionMarker,\n setSelection\n} from 'roosterjs-content-model-dom';\nimport { KeyboardInputPlugin } from './Plugins/KeyboardInputPlugin';\nimport {\n AutoFormatPlugin,\n EditPlugin,\n PastePlugin,\n ShortcutPlugin,\n DefaultSanitizers\n} 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';\n/* @conditional-compile-remove(rich-text-editor-image-upload) */\nimport {\n getPreviousInlineImages,\n getRemovedInlineImages,\n removeLocalBlobs,\n cleanAllLocalBlobs\n} 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: (\n newValue?: string,\n /* @conditional-compile-remove(rich-text-editor-image-upload) */ removedInlineImages?: Record<string, string>[]\n ) => void;\n onKeyDown?: (ev: KeyboardEvent) => 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 /* @conditional-compile-remove(rich-text-editor-image-upload) */\n onPaste?: (event: { content: DocumentFragment }) => void;\n /* @conditional-compile-remove(rich-text-editor-image-upload) */\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 onContentModelUpdate,\n contentModel,\n /* @conditional-compile-remove(rich-text-editor-image-upload) */\n onPaste,\n /* @conditional-compile-remove(rich-text-editor-image-upload) */\n onInsertInlineImage\n } = props;\n const editor = useRef<IEditor | null>(null);\n const editorDiv = useRef<HTMLDivElement>(null);\n const theme = useTheme();\n const [contextMenuProps, setContextMenuProps] = useState<IContextualMenuProps | null>(null);\n const previousThemeDirection = useRef(themeDirection(theme));\n /* @conditional-compile-remove(rich-text-editor-image-upload) */\n // This will be set when the editor is initialized and when the content is updated.\n const [previousInlineImages, setPreviousInlineImages] = useState<Record<string, string>[]>([]);\n /* @conditional-compile-remove(rich-text-editor-image-upload) */\n const [inlineImageLocalBlobs, setInlineImageLocalBlobs] = useState<Record<string, string>>({});\n\n /* @conditional-compile-remove(rich-text-editor-image-upload) */\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\n useImperativeHandle(ref, () => {\n return {\n focus() {\n if (editor.current) {\n editor.current.focus();\n }\n },\n setEmptyContent() {\n /* @conditional-compile-remove(rich-text-editor-image-upload) */\n setPreviousInlineImages([]);\n /* @conditional-compile-remove(rich-text-editor-image-upload) */\n cleanAllLocalBlobs(inlineImageLocalBlobs);\n\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 }, [/* @conditional-compile-remove(rich-text-editor-image-upload) */ inlineImageLocalBlobs, onContentModelUpdate]);\n\n const toolbarPlugin = React.useMemo(() => {\n return new RichTextToolbarPlugin();\n }, []);\n\n const placeholderPlugin = useMemo(() => {\n const textColor = theme.palette?.neutralSecondary;\n return new PlaceholderPlugin(\n '',\n textColor\n ? {\n textColor: textColor\n }\n : undefined\n );\n }, [theme]);\n\n useEffect(() => {\n if (placeholderText !== undefined) {\n placeholderPlugin.updatePlaceholder(placeholderText);\n }\n }, [placeholderPlugin, placeholderText]);\n\n const toolbar = useMemo(() => {\n return <RichTextToolbar plugin={toolbarPlugin} strings={strings} />;\n }, [strings, toolbarPlugin]);\n\n const updatePlugin = useMemo(() => {\n return new UpdateContentPlugin();\n }, []);\n\n const copyPastePlugin = useMemo(() => {\n return new CopyPastePlugin();\n }, []);\n\n const onChangeContent = useCallback(\n (/* @conditional-compile-remove(rich-text-editor-image-upload) */ shouldUpdateInlineImages?: boolean) => {\n if (editor.current === null) {\n return;\n }\n const content = exportContent(editor.current);\n /* @conditional-compile-remove(rich-text-editor-image-upload) */\n let removedInlineImages: Record<string, string>[] = [];\n /* @conditional-compile-remove(rich-text-editor-image-upload) */\n if (shouldUpdateInlineImages) {\n /* @conditional-compile-remove(rich-text-editor-image-upload) */\n removedInlineImages = getRemovedInlineImages(content, previousInlineImages);\n }\n\n onChange &&\n onChange(content, /* @conditional-compile-remove(rich-text-editor-image-upload) */ removedInlineImages);\n\n /* @conditional-compile-remove(rich-text-editor-image-upload) */\n setPreviousInlineImages(getPreviousInlineImages(content));\n },\n [onChange, /* @conditional-compile-remove(rich-text-editor-image-upload) */ previousInlineImages]\n );\n\n useEffect(() => {\n // don't set callback in plugin constructor to update callback without plugin recreation\n updatePlugin.onUpdate = (\n event: string,\n /* @conditional-compile-remove(rich-text-editor-image-upload) */ shouldRemoveInlineImages?: boolean\n ) => {\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 /* @conditional-compile-remove(rich-text-editor-image-upload) */\n let removedInlineImages: Record<string, string>[] = [];\n /* @conditional-compile-remove(rich-text-editor-image-upload) */\n if (shouldRemoveInlineImages) {\n removedInlineImages = getRemovedInlineImages(content, previousInlineImages);\n if (removedInlineImages.length > 0) {\n removeLocalBlobs(inlineImageLocalBlobs, removedInlineImages);\n }\n }\n\n onChange &&\n onChange(content, /* @conditional-compile-remove(rich-text-editor-image-upload) */ removedInlineImages);\n\n /* @conditional-compile-remove(rich-text-editor-image-upload) */\n setPreviousInlineImages(getPreviousInlineImages(content));\n }\n };\n }, [\n onChange,\n onContentModelUpdate,\n updatePlugin,\n /* @conditional-compile-remove(rich-text-editor-image-upload) */ previousInlineImages,\n /* @conditional-compile-remove(rich-text-editor-image-upload) */ inlineImageLocalBlobs\n ]);\n\n const undoRedoPlugin = useMemo(() => {\n return new UndoRedoPlugin();\n }, []);\n\n /* @conditional-compile-remove(rich-text-editor-image-upload) */\n useEffect(() => {\n if (onInsertInlineImage) {\n copyPastePlugin.onInsertInlineImage = (imageAttributes: Record<string, string>) => {\n const { id, src } = imageAttributes;\n setInlineImageLocalBlobs((prev) => {\n if (!id || !src) {\n return prev;\n }\n return { ...prev, [id]: src };\n });\n onInsertInlineImage(imageAttributes);\n };\n } else {\n copyPastePlugin.onInsertInlineImage = undefined;\n }\n undoRedoPlugin.onInsertInlineImage = onInsertInlineImage;\n }, [copyPastePlugin, onInsertInlineImage, undoRedoPlugin]);\n\n useEffect(() => {\n undoRedoPlugin.onUpdateContent = () => {\n onChangeContent(/* @conditional-compile-remove(rich-text-editor-image-upload) */ true);\n };\n }, [onChangeContent, undoRedoPlugin]);\n\n const keyboardInputPlugin = useMemo(() => {\n return new KeyboardInputPlugin();\n }, []);\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\n const tableContextMenuPlugin = useMemo(() => {\n return new TableEditContextMenuProvider();\n }, []);\n\n useEffect(() => {\n tableContextMenuPlugin.updateStrings(strings);\n }, [tableContextMenuPlugin, strings]);\n\n const onContextMenuRender = useCallback(\n (container: HTMLElement, items: IContextualMenuItem[], onDismiss: () => void): void => {\n setContextMenuProps({\n items: items,\n target: container,\n onDismiss: onDismiss\n });\n },\n []\n );\n\n const onContextMenuDismiss = useCallback((): void => {\n setContextMenuProps(null);\n }, []);\n\n /* @conditional-compile-remove(rich-text-editor-image-upload) */\n useEffect(() => {\n copyPastePlugin.onPaste = onPaste;\n }, [copyPastePlugin, onPaste]);\n\n const plugins: EditorPlugin[] = useMemo(() => {\n const contentEdit = new EditPlugin({ handleTabKey: false });\n // AutoFormatPlugin previously was a part of the edit plugin\n const autoFormatPlugin = new AutoFormatPlugin({ autoBullet: true, autoNumbering: true, autoLink: true });\n const roosterPastePlugin = new PastePlugin(false, {\n additionalDisallowedTags: ['head', '!doctype', '!cdata', '#comment'],\n additionalAllowedTags: [],\n styleSanitizers: DefaultSanitizers,\n attributeSanitizers: {}\n });\n\n const shortcutPlugin = new ShortcutPlugin();\n const contextMenuPlugin = new ContextMenuPlugin(onContextMenuRender, onContextMenuDismiss);\n return [\n placeholderPlugin,\n keyboardInputPlugin,\n contentEdit,\n autoFormatPlugin,\n updatePlugin,\n copyPastePlugin,\n roosterPastePlugin,\n toolbarPlugin,\n shortcutPlugin,\n // contextPlugin and tableEditMenuProvider allow to show insert/delete menu for the table\n contextMenuPlugin,\n tableContextMenuPlugin,\n undoRedoPlugin\n ];\n }, [\n onContextMenuRender,\n onContextMenuDismiss,\n placeholderPlugin,\n keyboardInputPlugin,\n updatePlugin,\n copyPastePlugin,\n toolbarPlugin,\n tableContextMenuPlugin,\n undoRedoPlugin\n ]);\n\n const announcerStringGetter = useCallback(\n (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 },\n [strings.richTextNewBulletedListItemAnnouncement, strings.richTextNewNumberedListItemAnnouncement]\n );\n\n useEffect(() => {\n /* @conditional-compile-remove(rich-text-editor-image-upload) */\n const prevInlineImage = getPreviousInlineImages(initialContent);\n /* @conditional-compile-remove(rich-text-editor-image-upload) */\n setPreviousInlineImages(prevInlineImage);\n\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\n if (autoFocus === 'sendBoxTextField') {\n editor.current?.focus();\n }\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\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\n return (\n <div data-testid={'rich-text-editor-wrapper'}>\n {showRichTextEditorFormatting && toolbar}\n <div className={richTextEditorWrapperStyle(theme)}>\n {/* div that is used by Rooster JS as a parent of the editor */}\n <div\n id=\"richTextSendBox\"\n ref={editorDiv}\n tabIndex={0}\n role=\"textbox\"\n aria-multiline=\"true\"\n data-testid={'rooster-rich-text-editor'}\n className={richTextEditorStyle(props.styles)}\n aria-label={placeholderText}\n />\n </div>\n {contextMenuProps && <ContextualMenu {...contextMenuProps} calloutProps={{ isBeakVisible: false }} />}\n </div>\n );\n});\n\nconst createEditorInitialModel = (\n initialContent?: string,\n contentModel?: ContentModelDocument\n): 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 =\n 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};\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};\n\nconst themeDirection = (theme: Theme): 'rtl' | 'ltr' => {\n return theme.rtl ? 'rtl' : 'ltr';\n};\n"]}
|
1
|
+
{"version":3,"file":"RichTextEditor.js","sourceRoot":"","sources":["../../../../../../../react-components/src/components/RichTextEditor/RichTextEditor.tsx"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAClC,OAAO,KAAK,EAAE,EAAE,WAAW,EAAE,SAAS,EAAE,mBAAmB,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACtG,OAAO,EAAE,0BAA0B,EAAE,mBAAmB,EAAE,MAAM,iCAAiC,CAAC;AAClG,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAEzC,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AACxD,OAAO,eAAe,MAAM,2BAA2B,CAAC;AAUxD,OAAO,EAAE,mBAAmB,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;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AAG,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 {\n ContentModelDocument,\n ContentModelParagraph,\n EditorPlugin,\n IEditor,\n ReadonlyContentModelBlockGroup,\n ShallowMutableContentModelDocument,\n KnownAnnounceStrings\n} from 'roosterjs-content-model-types';\nimport { createModelFromHtml, Editor, exportContent } from 'roosterjs-content-model-core';\nimport {\n createBr,\n createEmptyModel,\n createParagraph,\n createSelectionMarker,\n setSelection\n} from 'roosterjs-content-model-dom';\nimport { KeyboardInputPlugin } from './Plugins/KeyboardInputPlugin';\nimport {\n AutoFormatPlugin,\n EditPlugin,\n PastePlugin,\n ShortcutPlugin,\n DefaultSanitizers\n} 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';\n/* @conditional-compile-remove(rich-text-editor-image-upload) */\nimport {\n getPreviousInlineImages,\n getRemovedInlineImages,\n removeLocalBlobs,\n cleanAllLocalBlobs\n} 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: (\n newValue?: string,\n /* @conditional-compile-remove(rich-text-editor-image-upload) */ removedInlineImages?: Record<string, string>[]\n ) => void;\n onKeyDown?: (ev: KeyboardEvent) => 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 /* @conditional-compile-remove(rich-text-editor-image-upload) */\n onPaste?: (event: { content: DocumentFragment }) => void;\n /* @conditional-compile-remove(rich-text-editor-image-upload) */\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 onContentModelUpdate,\n contentModel,\n /* @conditional-compile-remove(rich-text-editor-image-upload) */\n onPaste,\n /* @conditional-compile-remove(rich-text-editor-image-upload) */\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));\n /* @conditional-compile-remove(rich-text-editor-image-upload) */\n // This will be set when the editor is initialized and when the content is updated.\n const [previousInlineImages, setPreviousInlineImages] = useState<Record<string, string>[]>([]);\n /* @conditional-compile-remove(rich-text-editor-image-upload) */\n const [inlineImageLocalBlobs, setInlineImageLocalBlobs] = useState<Record<string, string>>({});\n\n /* @conditional-compile-remove(rich-text-editor-image-upload) */\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\n useEffect(() => {\n if (editor.current) {\n if (showRichTextEditorFormatting) {\n toolbarRef.current?.focus();\n } else {\n editor.current?.focus();\n }\n }\n }, [showRichTextEditorFormatting]);\n\n useImperativeHandle(ref, () => {\n return {\n focus() {\n if (editor.current) {\n editor.current.focus();\n }\n },\n setEmptyContent() {\n /* @conditional-compile-remove(rich-text-editor-image-upload) */\n setPreviousInlineImages([]);\n /* @conditional-compile-remove(rich-text-editor-image-upload) */\n cleanAllLocalBlobs(inlineImageLocalBlobs);\n\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 }, [/* @conditional-compile-remove(rich-text-editor-image-upload) */ inlineImageLocalBlobs, onContentModelUpdate]);\n\n const toolbarPlugin = React.useMemo(() => {\n return new RichTextToolbarPlugin();\n }, []);\n\n const placeholderPlugin = useMemo(() => {\n const textColor = theme.palette?.neutralSecondary;\n return new PlaceholderPlugin(\n '',\n textColor\n ? {\n textColor: textColor\n }\n : undefined\n );\n }, [theme]);\n\n useEffect(() => {\n if (placeholderText !== undefined) {\n placeholderPlugin.updatePlaceholder(placeholderText);\n }\n }, [placeholderPlugin, placeholderText]);\n\n const toolbar = useMemo(() => {\n return <RichTextToolbar plugin={toolbarPlugin} strings={strings} />;\n }, [strings, toolbarPlugin]);\n\n const updatePlugin = useMemo(() => {\n return new UpdateContentPlugin();\n }, []);\n\n const copyPastePlugin = useMemo(() => {\n return new CopyPastePlugin();\n }, []);\n\n const onChangeContent = useCallback(\n (/* @conditional-compile-remove(rich-text-editor-image-upload) */ shouldUpdateInlineImages?: boolean) => {\n if (editor.current === null) {\n return;\n }\n const content = exportContent(editor.current);\n /* @conditional-compile-remove(rich-text-editor-image-upload) */\n let removedInlineImages: Record<string, string>[] = [];\n /* @conditional-compile-remove(rich-text-editor-image-upload) */\n if (shouldUpdateInlineImages) {\n /* @conditional-compile-remove(rich-text-editor-image-upload) */\n removedInlineImages = getRemovedInlineImages(content, previousInlineImages);\n }\n\n onChange &&\n onChange(content, /* @conditional-compile-remove(rich-text-editor-image-upload) */ removedInlineImages);\n\n /* @conditional-compile-remove(rich-text-editor-image-upload) */\n setPreviousInlineImages(getPreviousInlineImages(content));\n },\n [onChange, /* @conditional-compile-remove(rich-text-editor-image-upload) */ previousInlineImages]\n );\n\n useEffect(() => {\n // don't set callback in plugin constructor to update callback without plugin recreation\n updatePlugin.onUpdate = (\n event: string,\n /* @conditional-compile-remove(rich-text-editor-image-upload) */ shouldRemoveInlineImages?: boolean\n ) => {\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 /* @conditional-compile-remove(rich-text-editor-image-upload) */\n let removedInlineImages: Record<string, string>[] = [];\n /* @conditional-compile-remove(rich-text-editor-image-upload) */\n if (shouldRemoveInlineImages) {\n removedInlineImages = getRemovedInlineImages(content, previousInlineImages);\n if (removedInlineImages.length > 0) {\n removeLocalBlobs(inlineImageLocalBlobs, removedInlineImages);\n }\n }\n\n onChange &&\n onChange(content, /* @conditional-compile-remove(rich-text-editor-image-upload) */ removedInlineImages);\n\n /* @conditional-compile-remove(rich-text-editor-image-upload) */\n setPreviousInlineImages(getPreviousInlineImages(content));\n }\n };\n }, [\n onChange,\n onContentModelUpdate,\n updatePlugin,\n /* @conditional-compile-remove(rich-text-editor-image-upload) */ previousInlineImages,\n /* @conditional-compile-remove(rich-text-editor-image-upload) */ inlineImageLocalBlobs\n ]);\n\n const undoRedoPlugin = useMemo(() => {\n return new UndoRedoPlugin();\n }, []);\n\n /* @conditional-compile-remove(rich-text-editor-image-upload) */\n useEffect(() => {\n if (onInsertInlineImage) {\n copyPastePlugin.onInsertInlineImage = (imageAttributes: Record<string, string>) => {\n const { id, src } = imageAttributes;\n setInlineImageLocalBlobs((prev) => {\n if (!id || !src) {\n return prev;\n }\n return { ...prev, [id]: src };\n });\n onInsertInlineImage(imageAttributes);\n };\n } else {\n copyPastePlugin.onInsertInlineImage = undefined;\n }\n undoRedoPlugin.onInsertInlineImage = onInsertInlineImage;\n }, [copyPastePlugin, onInsertInlineImage, undoRedoPlugin]);\n\n useEffect(() => {\n undoRedoPlugin.onUpdateContent = () => {\n onChangeContent(/* @conditional-compile-remove(rich-text-editor-image-upload) */ true);\n };\n }, [onChangeContent, undoRedoPlugin]);\n\n const keyboardInputPlugin = useMemo(() => {\n return new KeyboardInputPlugin();\n }, []);\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\n const tableContextMenuPlugin = useMemo(() => {\n return new TableEditContextMenuProvider();\n }, []);\n\n useEffect(() => {\n tableContextMenuPlugin.updateStrings(strings);\n }, [tableContextMenuPlugin, strings]);\n\n const onContextMenuRender = useCallback(\n (container: HTMLElement, items: IContextualMenuItem[], onDismiss: () => void): void => {\n setContextMenuProps({\n items: items,\n target: container,\n onDismiss: onDismiss\n });\n },\n []\n );\n\n const onContextMenuDismiss = useCallback((): void => {\n setContextMenuProps(null);\n }, []);\n\n /* @conditional-compile-remove(rich-text-editor-image-upload) */\n useEffect(() => {\n copyPastePlugin.onPaste = onPaste;\n }, [copyPastePlugin, onPaste]);\n\n const plugins: EditorPlugin[] = useMemo(() => {\n const contentEdit = new EditPlugin({ handleTabKey: false });\n // AutoFormatPlugin previously was a part of the edit plugin\n const autoFormatPlugin = new AutoFormatPlugin({ autoBullet: true, autoNumbering: true, autoLink: true });\n const roosterPastePlugin = new PastePlugin(false, {\n additionalDisallowedTags: ['head', '!doctype', '!cdata', '#comment'],\n additionalAllowedTags: [],\n styleSanitizers: DefaultSanitizers,\n attributeSanitizers: {}\n });\n\n const shortcutPlugin = new ShortcutPlugin();\n const contextMenuPlugin = new ContextMenuPlugin(onContextMenuRender, onContextMenuDismiss);\n return [\n placeholderPlugin,\n keyboardInputPlugin,\n contentEdit,\n autoFormatPlugin,\n updatePlugin,\n copyPastePlugin,\n roosterPastePlugin,\n toolbarPlugin,\n shortcutPlugin,\n // contextPlugin and tableEditMenuProvider allow to show insert/delete menu for the table\n contextMenuPlugin,\n tableContextMenuPlugin,\n undoRedoPlugin\n ];\n }, [\n onContextMenuRender,\n onContextMenuDismiss,\n placeholderPlugin,\n keyboardInputPlugin,\n updatePlugin,\n copyPastePlugin,\n toolbarPlugin,\n tableContextMenuPlugin,\n undoRedoPlugin\n ]);\n\n const announcerStringGetter = useCallback(\n (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 },\n [strings.richTextNewBulletedListItemAnnouncement, strings.richTextNewNumberedListItemAnnouncement]\n );\n\n useEffect(() => {\n /* @conditional-compile-remove(rich-text-editor-image-upload) */\n const prevInlineImage = getPreviousInlineImages(initialContent);\n /* @conditional-compile-remove(rich-text-editor-image-upload) */\n setPreviousInlineImages(prevInlineImage);\n\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\n if (autoFocus === 'sendBoxTextField') {\n editor.current?.focus();\n }\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\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\n return (\n <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\n id=\"richTextSendBox\"\n ref={editorDiv}\n tabIndex={0}\n role=\"textbox\"\n aria-multiline=\"true\"\n data-testid={'rooster-rich-text-editor'}\n className={richTextEditorStyle(props.styles)}\n aria-label={placeholderText}\n />\n </div>\n {contextMenuProps && <ContextualMenu {...contextMenuProps} calloutProps={{ isBeakVisible: false }} />}\n </div>\n );\n});\n\nconst createEditorInitialModel = (\n initialContent?: string,\n contentModel?: ContentModelDocument\n): 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 =\n 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};\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};\n\nconst themeDirection = (theme: Theme): 'rtl' | 'ltr' => {\n return theme.rtl ? 'rtl' : 'ltr';\n};\n"]}
|
package/dist/dist-esm/react-components/src/components/RichTextEditor/RichTextInputBoxComponent.js
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
// Copyright (c) Microsoft Corporation.
|
2
2
|
// Licensed under the MIT License.
|
3
|
-
import React, { useCallback,
|
3
|
+
import React, { useCallback, useMemo, useState } from 'react';
|
4
4
|
import { RichTextEditor } from './RichTextEditor';
|
5
5
|
import { useTheme } from '../../theming';
|
6
6
|
import { Icon, Stack } from '@fluentui/react';
|
@@ -27,15 +27,6 @@ export const RichTextInputBoxComponent = (props) => {
|
|
27
27
|
const isRichTextEditorToolbarShown = showRichTextEditorFormatting === true;
|
28
28
|
return (React.createElement(Icon, { iconName: isHover || isRichTextEditorToolbarShown ? 'RichTextEditorButtonIconFilled' : 'RichTextEditorButtonIcon', className: richTextFormatButtonIconStyle(theme, !disabled && (isHover || isRichTextEditorToolbarShown)) }));
|
29
29
|
}, [disabled, showRichTextEditorFormatting, theme]);
|
30
|
-
useEffect(() => {
|
31
|
-
var _a;
|
32
|
-
if (showRichTextEditorFormatting !== undefined) {
|
33
|
-
// Focus the editor when toolbar shown/hidden
|
34
|
-
(_a = editorComponentRef.current) === null || _a === void 0 ? void 0 : _a.focus();
|
35
|
-
}
|
36
|
-
// we don't need execute this useEffect if editorComponentRef is changed
|
37
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
38
|
-
}, [showRichTextEditorFormatting]);
|
39
30
|
const actionButtons = useMemo(() => {
|
40
31
|
return (React.createElement(Stack.Item, { align: "end", className: richTextActionButtonsStackStyle },
|
41
32
|
React.createElement(Stack, { horizontal: true },
|
@@ -86,7 +77,13 @@ export const RichTextInputBoxComponent = (props) => {
|
|
86
77
|
theme: theme,
|
87
78
|
disabled: !!disabled
|
88
79
|
}) },
|
89
|
-
React.createElement(
|
80
|
+
React.createElement("div", { className: inputBoxContentStackStyle, style: {
|
81
|
+
display: 'flex',
|
82
|
+
flexGrow: 1,
|
83
|
+
flexDirection: useHorizontalLayout ? 'row' : 'column',
|
84
|
+
justifyContent: useHorizontalLayout ? 'flex-end' : 'space-between',
|
85
|
+
flexWrap: useHorizontalLayout ? 'wrap' : 'nowrap'
|
86
|
+
} },
|
90
87
|
React.createElement(Stack, { grow: true, className: inputBoxRichTextStackStyle },
|
91
88
|
React.createElement(Stack.Item, { className: inputBoxRichTextStackItemStyle },
|
92
89
|
React.createElement(RichTextEditor, { contentModel: contentModel, initialContent: initialContent, placeholderText: placeholderText, onChange: onChange, onKeyDown: onKeyDown, ref: editorComponentRef, strings: strings, showRichTextEditorFormatting: showRichTextEditorFormatting === true, styles: richTextEditorStyle, autoFocus: autoFocus, onContentModelUpdate: onContentModelUpdate,
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"RichTextInputBoxComponent.js","sourceRoot":"","sources":["../../../../../../../react-components/src/components/RichTextEditor/RichTextInputBoxComponent.tsx"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,KAAK,EAAE,EAAa,WAAW,EAAE,SAAS,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAEpF,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,EACL,iCAAiC,EACjC,+BAA+B,EAC/B,0BAA0B,EAC1B,6BAA6B,EAC9B,MAAM,iCAAiC,CAAC;AACzC,OAAO,EACL,yBAAyB,EACzB,8BAA8B,EAC9B,0BAA0B,EAC1B,sBAAsB,EACvB,MAAM,4CAA4C,CAAC;AAyCpD;;GAEG;AACH,M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Ac,EAAE,cAAc,EAC9B,eAAe,EAAE,eAAe,EAChC,QAAQ,EAAE,QAAQ,EAClB,SAAS,EAAE,SAAS,EACpB,GAAG,EAAE,kBAAkB,EACvB,OAAO,EAAE,OAAO,EAChB,4BAA4B,EAAE,4BAA4B,KAAK,IAAI,EACnE,MAAM,EAAE,mBAAmB,EAC3B,SAAS,EAAE,SAAS,EACpB,oBAAoB,EAAE,oBAAoB;wBAC1C,gEAAgE;wBAChE,OAAO,EAAE,KAAK,CAAC,OAAO;wBACtB,gEAAgE;wBAChE,mBAAmB,EAAE,mBAAmB,GACxC,CACS,EACZ,mDAAmD;gBAAC,yBAAyB,IAAI,yBAAyB,EAAE,CACvG;YACP,aAAa,CACR,CACJ,CACP,CAAC;AACJ,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport React, { ReactNode, useCallback, useEffect, 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 {\n richTextActionButtonsDividerStyle,\n richTextActionButtonsStackStyle,\n richTextActionButtonsStyle,\n richTextFormatButtonIconStyle\n} from '../styles/RichTextEditor.styles';\nimport {\n inputBoxContentStackStyle,\n inputBoxRichTextStackItemStyle,\n inputBoxRichTextStackStyle,\n richTextBorderBoxStyle\n} 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: (\n newValue?: string,\n /* @conditional-compile-remove(rich-text-editor-image-upload) */ removedInlineImages?: Record<string, string>[]\n ) => 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 /* @conditional-compile-remove(file-sharing-acs) */\n onRenderAttachmentUploads?: () => JSX.Element;\n /* @conditional-compile-remove(file-sharing-acs) */\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 /* @conditional-compile-remove(rich-text-editor-image-upload) */\n onPaste?: (event: { content: DocumentFragment }) => void;\n /* @conditional-compile-remove(rich-text-editor-image-upload) */\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 /* @conditional-compile-remove(file-sharing-acs) */\n onRenderAttachmentUploads,\n /* @conditional-compile-remove(file-sharing-acs) */\n hasAttachments,\n richTextEditorStyleProps,\n isHorizontalLayoutDisabled = false,\n autoFocus,\n onTyping,\n /* @conditional-compile-remove(rich-text-editor-image-upload) */\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\n const onRenderRichTextEditorIcon = useCallback(\n (isHover: boolean) => {\n const isRichTextEditorToolbarShown = showRichTextEditorFormatting === true;\n return (\n <Icon\n iconName={\n isHover || isRichTextEditorToolbarShown ? 'RichTextEditorButtonIconFilled' : 'RichTextEditorButtonIcon'\n }\n className={richTextFormatButtonIconStyle(theme, !disabled && (isHover || isRichTextEditorToolbarShown))}\n />\n );\n },\n [disabled, showRichTextEditorFormatting, theme]\n );\n\n useEffect(() => {\n if (showRichTextEditorFormatting !== undefined) {\n // Focus the editor when toolbar shown/hidden\n editorComponentRef.current?.focus();\n }\n // we don't need execute this useEffect if editorComponentRef is changed\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [showRichTextEditorFormatting]);\n\n const actionButtons = useMemo(() => {\n return (\n <Stack.Item align=\"end\" className={richTextActionButtonsStackStyle}>\n <Stack horizontal>\n <InputBoxButton\n onRenderIcon={onRenderRichTextEditorIcon}\n 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 }}\n ariaLabel={strings.richTextFormatButtonTooltip}\n tooltipContent={strings.richTextFormatButtonTooltip}\n className={richTextActionButtonsStyle}\n data-testId={'rich-text-input-box-format-button'}\n ariaExpanded={showRichTextEditorFormatting}\n />\n <Icon iconName=\"RichTextDividerIcon\" className={richTextActionButtonsDividerStyle(theme)} />\n {actionComponents}\n </Stack>\n </Stack.Item>\n );\n }, [\n actionComponents,\n onRenderRichTextEditorIcon,\n showRichTextEditorFormatting,\n strings.richTextFormatButtonTooltip,\n theme\n ]);\n\n const richTextEditorStyle = useMemo(() => {\n return richTextEditorStyleProps(showRichTextEditorFormatting === true);\n }, [richTextEditorStyleProps, showRichTextEditorFormatting]);\n\n const onKeyDown = useCallback(\n (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 },\n [onEnterKeyDown, showRichTextEditorFormatting, onTyping]\n );\n\n const useHorizontalLayout = useMemo(() => {\n const isRichTextEditorToolbarShown = showRichTextEditorFormatting === true;\n return (\n !isHorizontalLayoutDisabled &&\n !isRichTextEditorToolbarShown &&\n /* @conditional-compile-remove(file-sharing-acs) */ !hasAttachments\n );\n }, [\n isHorizontalLayoutDisabled,\n showRichTextEditorFormatting,\n /* @conditional-compile-remove(file-sharing-acs) */ hasAttachments\n ]);\n\n const onContentModelUpdate = useCallback((contentModel: ContentModelDocument | undefined) => {\n setContentModel(contentModel);\n }, []);\n\n return (\n <div\n className={richTextBorderBoxStyle({\n theme: theme,\n disabled: !!disabled\n })}\n >\n {/* This layout is used for the compact view when formatting options are not shown */}\n <Stack\n grow\n horizontal={useHorizontalLayout}\n horizontalAlign={useHorizontalLayout ? 'end' : 'space-between'}\n className={inputBoxContentStackStyle}\n wrap={useHorizontalLayout}\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\n contentModel={contentModel}\n initialContent={initialContent}\n placeholderText={placeholderText}\n onChange={onChange}\n onKeyDown={onKeyDown}\n ref={editorComponentRef}\n strings={strings}\n showRichTextEditorFormatting={showRichTextEditorFormatting === true}\n styles={richTextEditorStyle}\n autoFocus={autoFocus}\n onContentModelUpdate={onContentModelUpdate}\n /* @conditional-compile-remove(rich-text-editor-image-upload) */\n onPaste={props.onPaste}\n /* @conditional-compile-remove(rich-text-editor-image-upload) */\n onInsertInlineImage={onInsertInlineImage}\n />\n </Stack.Item>\n {/* @conditional-compile-remove(file-sharing-acs) */ onRenderAttachmentUploads && onRenderAttachmentUploads()}\n </Stack>\n {actionButtons}\n </Stack>\n </div>\n );\n};\n"]}
|
1
|
+
{"version":3,"file":"RichTextInputBoxComponent.js","sourceRoot":"","sources":["../../../../../../../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,EACL,iCAAiC,EACjC,+BAA+B,EAC/B,0BAA0B,EAC1B,6BAA6B,EAC9B,MAAM,iCAAiC,CAAC;AACzC,OAAO,EACL,yBAAyB,EACzB,8BAA8B,EAC9B,0BAA0B,EAC1B,sBAAsB,EACvB,MAAM,4CAA4C,CAAC;AAyCpD;;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;IAChB,mDAAmD;IACnD,yBAAyB;IACzB,mDAAmD;IACnD,cAAc,EACd,wBAAwB,EACxB,0BAA0B,GAAG,KAAK,EAClC,SAAS,EACT,QAAQ;IACR,gEAAgE;IAChE,mBAAmB,EACpB,GAAG,KAAK,CAAC;IACV,MAAM,KAAK,GAAG,QAAQ,EAAE,CAAC;IACzB,2FAA2F;IAC3F,MAAM,CAAC,4BAA4B,EAAE,+BAA+B,CAAC,GAAG,QAAQ,CAAsB,SAAS,CAAC,CAAC;IACjH,MAAM,CAAC,YAAY,EAAE,eAAe,CAAC,GAAG,QAAQ,CAAmC,SAAS,CAAC,CAAC;IA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KAAK,EAAE,KAAK;YACZ,QAAQ,EAAE,CAAC,CAAC,QAAQ;SACrB,CAAC;QAIF,6BACE,SAAS,EAAE,yBAAyB,EACpC,KAAK,EAAE;gBACL,OAAO,EAAE,MAAM;gBACf,QAAQ,EAAE,CAAC;gBACX,aAAa,EAAE,mBAAmB,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,QAAQ;gBACrD,cAAc,EAAE,mBAAmB,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,eAAe;gBAClE,QAAQ,EAAE,mBAAmB,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,QAAQ;aAClD;YAGD,oBAAC,KAAK,IAAC,IAAI,QAAC,SAAS,EAAE,0BAA0B;gBAC/C,oBAAC,KAAK,CAAC,IAAI,IAAC,SAAS,EAAE,8BAA8B;oBACnD,oBAAC,cAAc,IACb,YAAY,EAAE,YAAY,EAC1B,cAAc,EAAE,cAAc,EAC9B,eAAe,EAAE,eAAe,EAChC,QAAQ,EAAE,QAAQ,EAClB,SAAS,EAAE,SAAS,EACpB,GAAG,EAAE,kBAAkB,EACvB,OAAO,EAAE,OAAO,EAChB,4BAA4B,EAAE,4BAA4B,KAAK,IAAI,EACnE,MAAM,EAAE,mBAAmB,EAC3B,SAAS,EAAE,SAAS,EACpB,oBAAoB,EAAE,oBAAoB;wBAC1C,gEAAgE;wBAChE,OAAO,EAAE,KAAK,CAAC,OAAO;wBACtB,gEAAgE;wBAChE,mBAAmB,EAAE,mBAAmB,GACxC,CACS,EACZ,mDAAmD;gBAAC,yBAAyB,IAAI,yBAAyB,EAAE,CACvG;YACP,aAAa,CACV,CACF,CACP,CAAC;AACJ,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 {\n richTextActionButtonsDividerStyle,\n richTextActionButtonsStackStyle,\n richTextActionButtonsStyle,\n richTextFormatButtonIconStyle\n} from '../styles/RichTextEditor.styles';\nimport {\n inputBoxContentStackStyle,\n inputBoxRichTextStackItemStyle,\n inputBoxRichTextStackStyle,\n richTextBorderBoxStyle\n} 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: (\n newValue?: string,\n /* @conditional-compile-remove(rich-text-editor-image-upload) */ removedInlineImages?: Record<string, string>[]\n ) => 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 /* @conditional-compile-remove(file-sharing-acs) */\n onRenderAttachmentUploads?: () => JSX.Element;\n /* @conditional-compile-remove(file-sharing-acs) */\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 /* @conditional-compile-remove(rich-text-editor-image-upload) */\n onPaste?: (event: { content: DocumentFragment }) => void;\n /* @conditional-compile-remove(rich-text-editor-image-upload) */\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 /* @conditional-compile-remove(file-sharing-acs) */\n onRenderAttachmentUploads,\n /* @conditional-compile-remove(file-sharing-acs) */\n hasAttachments,\n richTextEditorStyleProps,\n isHorizontalLayoutDisabled = false,\n autoFocus,\n onTyping,\n /* @conditional-compile-remove(rich-text-editor-image-upload) */\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\n const onRenderRichTextEditorIcon = useCallback(\n (isHover: boolean) => {\n const isRichTextEditorToolbarShown = showRichTextEditorFormatting === true;\n return (\n <Icon\n iconName={\n isHover || isRichTextEditorToolbarShown ? 'RichTextEditorButtonIconFilled' : 'RichTextEditorButtonIcon'\n }\n className={richTextFormatButtonIconStyle(theme, !disabled && (isHover || isRichTextEditorToolbarShown))}\n />\n );\n },\n [disabled, showRichTextEditorFormatting, theme]\n );\n\n const actionButtons = useMemo(() => {\n return (\n <Stack.Item align=\"end\" className={richTextActionButtonsStackStyle}>\n <Stack horizontal>\n <InputBoxButton\n onRenderIcon={onRenderRichTextEditorIcon}\n 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 }}\n ariaLabel={strings.richTextFormatButtonTooltip}\n tooltipContent={strings.richTextFormatButtonTooltip}\n className={richTextActionButtonsStyle}\n data-testId={'rich-text-input-box-format-button'}\n ariaExpanded={showRichTextEditorFormatting}\n />\n <Icon iconName=\"RichTextDividerIcon\" className={richTextActionButtonsDividerStyle(theme)} />\n {actionComponents}\n </Stack>\n </Stack.Item>\n );\n }, [\n actionComponents,\n onRenderRichTextEditorIcon,\n showRichTextEditorFormatting,\n strings.richTextFormatButtonTooltip,\n theme\n ]);\n\n const richTextEditorStyle = useMemo(() => {\n return richTextEditorStyleProps(showRichTextEditorFormatting === true);\n }, [richTextEditorStyleProps, showRichTextEditorFormatting]);\n\n const onKeyDown = useCallback(\n (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 },\n [onEnterKeyDown, showRichTextEditorFormatting, onTyping]\n );\n\n const useHorizontalLayout = useMemo(() => {\n const isRichTextEditorToolbarShown = showRichTextEditorFormatting === true;\n return (\n !isHorizontalLayoutDisabled &&\n !isRichTextEditorToolbarShown &&\n /* @conditional-compile-remove(file-sharing-acs) */ !hasAttachments\n );\n }, [\n isHorizontalLayoutDisabled,\n showRichTextEditorFormatting,\n /* @conditional-compile-remove(file-sharing-acs) */ hasAttachments\n ]);\n\n const onContentModelUpdate = useCallback((contentModel: ContentModelDocument | undefined) => {\n setContentModel(contentModel);\n }, []);\n\n return (\n <div\n className={richTextBorderBoxStyle({\n theme: theme,\n disabled: !!disabled\n })}\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\n className={inputBoxContentStackStyle}\n 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 >\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\n contentModel={contentModel}\n initialContent={initialContent}\n placeholderText={placeholderText}\n onChange={onChange}\n onKeyDown={onKeyDown}\n ref={editorComponentRef}\n strings={strings}\n showRichTextEditorFormatting={showRichTextEditorFormatting === true}\n styles={richTextEditorStyle}\n autoFocus={autoFocus}\n onContentModelUpdate={onContentModelUpdate}\n /* @conditional-compile-remove(rich-text-editor-image-upload) */\n onPaste={props.onPaste}\n /* @conditional-compile-remove(rich-text-editor-image-upload) */\n onInsertInlineImage={onInsertInlineImage}\n />\n </Stack.Item>\n {/* @conditional-compile-remove(file-sharing-acs) */ onRenderAttachmentUploads && onRenderAttachmentUploads()}\n </Stack>\n {actionButtons}\n </div>\n </div>\n );\n};\n"]}
|
@@ -103,6 +103,10 @@ export interface RichTextStrings {
|
|
103
103
|
* Text for the delete table menu.
|
104
104
|
*/
|
105
105
|
richTextDeleteTableMenu: string;
|
106
|
+
/**
|
107
|
+
* Text for the rich text toolbar.
|
108
|
+
*/
|
109
|
+
richTextToolbarAriaLabel: string;
|
106
110
|
/**
|
107
111
|
* Text for the rich text toolbar more button.
|
108
112
|
*/
|