@azure/communication-react 1.14.0-alpha-202403060013 → 1.14.0-alpha-202403080013
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 +127 -51
- package/dist/dist-cjs/communication-react/RichTextSendBoxWrapper-CQnsLK4_.js +51 -0
- package/dist/dist-cjs/communication-react/RichTextSendBoxWrapper-CQnsLK4_.js.map +1 -0
- package/dist/dist-cjs/communication-react/index--vbi3hW5.js +38028 -0
- package/dist/dist-cjs/communication-react/index--vbi3hW5.js.map +1 -0
- package/dist/dist-cjs/communication-react/index.js +157 -37619
- 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/chat-component-bindings/src/hooks/usePropsFor.d.ts +2 -1
- package/dist/dist-esm/chat-component-bindings/src/hooks/usePropsFor.js +5 -0
- package/dist/dist-esm/chat-component-bindings/src/hooks/usePropsFor.js.map +1 -1
- package/dist/dist-esm/chat-component-bindings/src/messageThreadSelector.js +15 -9
- package/dist/dist-esm/chat-component-bindings/src/messageThreadSelector.js.map +1 -1
- package/dist/dist-esm/chat-stateful-client/src/ChatContext.js +4 -4
- package/dist/dist-esm/chat-stateful-client/src/ChatContext.js.map +1 -1
- package/dist/dist-esm/chat-stateful-client/src/ResourceDownloadQueue.d.ts +0 -11
- package/dist/dist-esm/chat-stateful-client/src/ResourceDownloadQueue.js +19 -47
- package/dist/dist-esm/chat-stateful-client/src/ResourceDownloadQueue.js.map +1 -1
- package/dist/dist-esm/chat-stateful-client/src/index.d.ts +1 -0
- package/dist/dist-esm/chat-stateful-client/src/index.js.map +1 -1
- package/dist/dist-esm/chat-stateful-client/src/types/ChatMessageWithStatus.d.ts +9 -1
- package/dist/dist-esm/chat-stateful-client/src/types/ChatMessageWithStatus.js.map +1 -1
- package/dist/dist-esm/communication-react/src/index.d.ts +3 -2
- package/dist/dist-esm/communication-react/src/index.js +2 -0
- package/dist/dist-esm/communication-react/src/index.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/CaptionsSettingsModal.js +4 -4
- package/dist/dist-esm/react-components/src/components/CaptionsSettingsModal.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/ChatMessage/ChatMessageComponentAsEditBox.d.ts +2 -2
- package/dist/dist-esm/react-components/src/components/ChatMessage/ChatMessageComponentAsEditBox.js +16 -34
- package/dist/dist-esm/react-components/src/components/ChatMessage/ChatMessageComponentAsEditBox.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/ChatMessage/ChatMessageComponentAsRichTextEditBox.d.ts +18 -0
- package/dist/dist-esm/react-components/src/components/ChatMessage/ChatMessageComponentAsRichTextEditBox.js +102 -0
- package/dist/dist-esm/react-components/src/components/ChatMessage/ChatMessageComponentAsRichTextEditBox.js.map +1 -0
- package/dist/dist-esm/react-components/src/components/FileDownloadCards.d.ts +1 -7
- package/dist/dist-esm/react-components/src/components/FileDownloadCards.js +5 -17
- package/dist/dist-esm/react-components/src/components/FileDownloadCards.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/{RTE → RichTextEditor}/RichTextEditor.d.ts +14 -2
- package/dist/dist-esm/react-components/src/components/{RTE → RichTextEditor}/RichTextEditor.js +22 -21
- package/dist/dist-esm/react-components/src/components/RichTextEditor/RichTextEditor.js.map +1 -0
- package/dist/dist-esm/react-components/src/components/RichTextEditor/RichTextInputBoxComponent.d.ts +28 -0
- package/dist/dist-esm/react-components/src/components/RichTextEditor/RichTextInputBoxComponent.js +50 -0
- package/dist/dist-esm/react-components/src/components/RichTextEditor/RichTextInputBoxComponent.js.map +1 -0
- package/dist/dist-esm/react-components/src/components/{RTE/RTERibbonButtons.d.ts → RichTextEditor/RichTextRibbonButtons.d.ts} +2 -2
- package/dist/dist-esm/react-components/src/components/{RTE/RTERibbonButtons.js → RichTextEditor/RichTextRibbonButtons.js} +9 -9
- package/dist/dist-esm/react-components/src/components/RichTextEditor/RichTextRibbonButtons.js.map +1 -0
- package/dist/dist-esm/react-components/src/components/{RTE/RTESendBox.d.ts → RichTextEditor/RichTextSendBox.d.ts} +5 -1
- package/dist/dist-esm/react-components/src/components/{RTE/RTESendBox.js → RichTextEditor/RichTextSendBox.js} +33 -20
- package/dist/dist-esm/react-components/src/components/RichTextEditor/RichTextSendBox.js.map +1 -0
- package/dist/dist-esm/react-components/src/components/{RTE/RTESendBoxErrors.d.ts → RichTextEditor/RichTextSendBoxErrors.d.ts} +3 -3
- package/dist/dist-esm/react-components/src/components/{RTE/RTESendBoxErrors.js → RichTextEditor/RichTextSendBoxErrors.js} +2 -2
- package/dist/dist-esm/react-components/src/components/RichTextEditor/RichTextSendBoxErrors.js.map +1 -0
- package/dist/dist-esm/react-components/src/components/SendBox.js +2 -2
- package/dist/dist-esm/react-components/src/components/SendBox.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/index.d.ts +4 -2
- package/dist/dist-esm/react-components/src/components/index.js +4 -1
- package/dist/dist-esm/react-components/src/components/index.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/styles/ChatMessageComponent.styles.d.ts +4 -0
- package/dist/dist-esm/react-components/src/components/styles/ChatMessageComponent.styles.js +10 -0
- package/dist/dist-esm/react-components/src/components/styles/ChatMessageComponent.styles.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/styles/EditBox.styles.d.ts +10 -4
- package/dist/dist-esm/react-components/src/components/styles/EditBox.styles.js +17 -4
- package/dist/dist-esm/react-components/src/components/styles/EditBox.styles.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/styles/RichTextEditor.styles.d.ts +34 -2
- package/dist/dist-esm/react-components/src/components/styles/RichTextEditor.styles.js +72 -11
- package/dist/dist-esm/react-components/src/components/styles/RichTextEditor.styles.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/styles/RichTextInputBoxComponent.styles.d.ts +17 -0
- package/dist/dist-esm/react-components/src/components/styles/RichTextInputBoxComponent.styles.js +30 -0
- package/dist/dist-esm/react-components/src/components/styles/RichTextInputBoxComponent.styles.js.map +1 -0
- package/dist/dist-esm/react-components/src/components/styles/SendBox.styles.d.ts +15 -0
- package/dist/dist-esm/react-components/src/components/styles/SendBox.styles.js +22 -11
- package/dist/dist-esm/react-components/src/components/styles/SendBox.styles.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/utils/ChatMessageComponentAsEditBoxUtils.d.ts +23 -0
- package/dist/dist-esm/react-components/src/components/utils/ChatMessageComponentAsEditBoxUtils.js +44 -0
- package/dist/dist-esm/react-components/src/components/utils/ChatMessageComponentAsEditBoxUtils.js.map +1 -0
- package/dist/dist-esm/react-components/src/components/utils/SendBoxUtils.d.ts +1 -1
- package/dist/dist-esm/react-components/src/components/utils/SendBoxUtils.js +1 -1
- package/dist/dist-esm/react-components/src/components/utils/SendBoxUtils.js.map +1 -1
- package/dist/dist-esm/react-components/src/localization/LocalizationProvider.d.ts +2 -2
- 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 +2 -1
- package/dist/dist-esm/react-components/src/theming/icons.d.ts +10 -8
- package/dist/dist-esm/react-components/src/theming/icons.js +13 -9
- package/dist/dist-esm/react-components/src/theming/icons.js.map +1 -1
- package/dist/dist-esm/react-components/src/types/ChatMessage.d.ts +3 -3
- package/dist/dist-esm/react-components/src/types/ChatMessage.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/CallComposite.js +6 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/CallComposite.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/ChatComposite/ChatComposite.d.ts +14 -0
- package/dist/dist-esm/react-composites/src/composites/ChatComposite/ChatComposite.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/ChatComposite/ChatScreen.d.ts +0 -1
- package/dist/dist-esm/react-composites/src/composites/ChatComposite/ChatScreen.js +6 -15
- package/dist/dist-esm/react-composites/src/composites/ChatComposite/ChatScreen.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/ChatComposite/file-sharing/FileUpload.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/ChatComposite/index.d.ts +1 -0
- package/dist/dist-esm/react-composites/src/composites/ChatComposite/index.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/ChatComposite/selectors/fileUploadsSelector.d.ts +2 -2
- package/dist/dist-esm/react-composites/src/composites/common/RichTextSendBoxWrapper.d.ts +9 -0
- package/dist/dist-esm/react-composites/src/composites/common/RichTextSendBoxWrapper.js +20 -0
- package/dist/dist-esm/react-composites/src/composites/common/RichTextSendBoxWrapper.js.map +1 -0
- package/dist/dist-esm/react-composites/src/composites/common/SendBox.d.ts +17 -0
- package/dist/dist-esm/react-composites/src/composites/common/SendBox.js +46 -0
- package/dist/dist-esm/react-composites/src/composites/common/SendBox.js.map +1 -0
- package/dist/dist-esm/react-composites/src/composites/common/icons.d.ts +10 -8
- package/package.json +1 -1
- package/dist/dist-esm/react-components/src/components/RTE/RTEInputBoxComponent.d.ts +0 -25
- package/dist/dist-esm/react-components/src/components/RTE/RTEInputBoxComponent.js +0 -21
- package/dist/dist-esm/react-components/src/components/RTE/RTEInputBoxComponent.js.map +0 -1
- package/dist/dist-esm/react-components/src/components/RTE/RTERibbonButtons.js.map +0 -1
- package/dist/dist-esm/react-components/src/components/RTE/RTESendBox.js.map +0 -1
- package/dist/dist-esm/react-components/src/components/RTE/RTESendBoxErrors.js.map +0 -1
- package/dist/dist-esm/react-components/src/components/RTE/RichTextEditor.js.map +0 -1
@@ -35,6 +35,10 @@ export interface RichTextSendBoxStrings extends SendBoxStrings {
|
|
35
35
|
* Tooltip text for the decrease indent button.
|
36
36
|
*/
|
37
37
|
decreaseIndentTooltip: string;
|
38
|
+
/**
|
39
|
+
* Tooltip text for the rich text format button button.
|
40
|
+
*/
|
41
|
+
richTextFormatButtonTooltip: string;
|
38
42
|
}
|
39
43
|
/**
|
40
44
|
* Props for {@link RichTextSendBox}.
|
@@ -85,4 +89,4 @@ export interface RichTextSendBoxProps {
|
|
85
89
|
* @beta
|
86
90
|
*/
|
87
91
|
export declare const RichTextSendBox: (props: RichTextSendBoxProps) => JSX.Element;
|
88
|
-
//# sourceMappingURL=
|
92
|
+
//# sourceMappingURL=RichTextSendBox.d.ts.map
|
@@ -1,16 +1,17 @@
|
|
1
1
|
// Copyright (c) Microsoft Corporation.
|
2
2
|
// Licensed under the MIT License.
|
3
3
|
import React, { useCallback, useMemo, useRef, useState } from 'react';
|
4
|
-
import {
|
4
|
+
import { RichTextInputBoxComponent } from './RichTextInputBoxComponent';
|
5
5
|
import { Icon, Stack } from '@fluentui/react';
|
6
6
|
import { useLocale } from '../../localization';
|
7
|
-
import {
|
7
|
+
import { sendIconStyle } from '../styles/SendBox.styles';
|
8
8
|
import { InputBoxButton } from '../InputBoxButton';
|
9
|
-
import {
|
10
|
-
import {
|
9
|
+
import { RichTextSendBoxErrors } from './RichTextSendBoxErrors';
|
10
|
+
import { isMessageTooLong, sanitizeText } from '../utils/SendBoxUtils';
|
11
11
|
/* @conditional-compile-remove(file-sharing) */
|
12
12
|
import { hasCompletedFileUploads } from '../utils/SendBoxUtils';
|
13
13
|
import { useTheme } from '../../theming';
|
14
|
+
import { richTextActionButtonsStyle, sendBoxRichTextEditorStyle } from '../styles/RichTextEditor.styles';
|
14
15
|
/**
|
15
16
|
* A component to render SendBox with Rich Text Editor support.
|
16
17
|
*
|
@@ -27,7 +28,9 @@ export const RichTextSendBox = (props) => {
|
|
27
28
|
return locale.strings.richTextSendBox;
|
28
29
|
return locale.strings.sendBox;
|
29
30
|
}, [/* @conditional-compile-remove(rich-text-editor) */ locale.strings.richTextSendBox, locale.strings.sendBox]);
|
30
|
-
const strings =
|
31
|
+
const strings = useMemo(() => {
|
32
|
+
return Object.assign(Object.assign({}, localeStrings), props.strings);
|
33
|
+
}, [localeStrings, props.strings]);
|
31
34
|
const [contentValue, setContentValue] = useState('');
|
32
35
|
const [contentValueOverflow, setContentValueOverflow] = useState(false);
|
33
36
|
/* @conditional-compile-remove(file-sharing) */
|
@@ -38,11 +41,11 @@ export const RichTextSendBox = (props) => {
|
|
38
41
|
if (newValue === undefined) {
|
39
42
|
return;
|
40
43
|
}
|
41
|
-
setContentValueOverflow(
|
44
|
+
setContentValueOverflow(isMessageTooLong(newValue.length));
|
42
45
|
setContentValue(newValue);
|
43
46
|
}, []);
|
44
|
-
const sendMessageOnClick = () => {
|
45
|
-
var _a;
|
47
|
+
const sendMessageOnClick = useCallback(() => {
|
48
|
+
var _a, _b;
|
46
49
|
if (disabled || contentValueOverflow) {
|
47
50
|
return;
|
48
51
|
}
|
@@ -60,9 +63,16 @@ export const RichTextSendBox = (props) => {
|
|
60
63
|
/* @conditional-compile-remove(file-sharing) */ hasCompletedFileUploads(activeFileUploads)) {
|
61
64
|
onSendMessage(message);
|
62
65
|
setContentValue('');
|
66
|
+
(_a = editorComponentRef.current) === null || _a === void 0 ? void 0 : _a.setEmptyContent();
|
63
67
|
}
|
64
|
-
(
|
65
|
-
}
|
68
|
+
(_b = editorComponentRef.current) === null || _b === void 0 ? void 0 : _b.focus();
|
69
|
+
}, [
|
70
|
+
/* @conditional-compile-remove(file-sharing) */ activeFileUploads,
|
71
|
+
contentValue,
|
72
|
+
contentValueOverflow,
|
73
|
+
disabled,
|
74
|
+
onSendMessage
|
75
|
+
]);
|
66
76
|
const hasErrorMessage = useMemo(() => {
|
67
77
|
var _a;
|
68
78
|
return (!!systemMessage ||
|
@@ -84,8 +94,10 @@ export const RichTextSendBox = (props) => {
|
|
84
94
|
hasText: !!contentValue,
|
85
95
|
/* @conditional-compile-remove(file-sharing) */
|
86
96
|
hasFile: false,
|
87
|
-
hasErrorMessage: hasErrorMessage
|
88
|
-
|
97
|
+
hasErrorMessage: hasErrorMessage,
|
98
|
+
defaultTextColor: theme.palette.neutralSecondary,
|
99
|
+
disabled: disabled
|
100
|
+
}) })), [contentValue, disabled, hasErrorMessage, theme]);
|
89
101
|
const sendBoxErrorsProps = useMemo(() => {
|
90
102
|
var _a;
|
91
103
|
return {
|
@@ -104,13 +116,14 @@ export const RichTextSendBox = (props) => {
|
|
104
116
|
fileUploadsPendingError,
|
105
117
|
systemMessage
|
106
118
|
]);
|
119
|
+
const sendButton = useMemo(() => {
|
120
|
+
return (React.createElement(InputBoxButton, { onRenderIcon: onRenderSendIcon, onClick: (e) => {
|
121
|
+
sendMessageOnClick();
|
122
|
+
e.stopPropagation(); // Prevents the click from bubbling up and triggering a focus event on the chat.
|
123
|
+
}, className: richTextActionButtonsStyle, ariaLabel: localeStrings.sendButtonAriaLabel, tooltipContent: localeStrings.sendButtonAriaLabel }));
|
124
|
+
}, [localeStrings.sendButtonAriaLabel, onRenderSendIcon, sendMessageOnClick]);
|
107
125
|
return (React.createElement(Stack, null,
|
108
|
-
React.createElement(
|
109
|
-
React.createElement(
|
110
|
-
React.createElement(Stack.Item, { align: "end" },
|
111
|
-
React.createElement(InputBoxButton, { onRenderIcon: onRenderSendIcon, onClick: (e) => {
|
112
|
-
sendMessageOnClick();
|
113
|
-
e.stopPropagation(); // Prevents the click from bubbling up and triggering a focus event on the chat.
|
114
|
-
}, className: sendButtonStyle, ariaLabel: localeStrings.sendButtonAriaLabel, tooltipContent: localeStrings.sendButtonAriaLabel }))));
|
126
|
+
React.createElement(RichTextSendBoxErrors, Object.assign({}, sendBoxErrorsProps)),
|
127
|
+
React.createElement(RichTextInputBoxComponent, { placeholderText: strings.placeholderText, onChange: setContent, editorComponentRef: editorComponentRef, strings: strings, disabled: disabled, actionComponents: sendButton, richTextEditorStyleProps: sendBoxRichTextEditorStyle })));
|
115
128
|
};
|
116
|
-
//# sourceMappingURL=
|
129
|
+
//# sourceMappingURL=RichTextSendBox.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"RichTextSendBox.js","sourceRoot":"","sources":["../../../../../../../react-components/src/components/RichTextEditor/RichTextSendBox.tsx"],"names":[],"mappings":"AAA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AkB,EAAI;QACjD,oBAAC,yBAAyB,IACxB,eAAe,EAAE,OAAO,CAAC,eAAe,EACxC,QAAQ,EAAE,UAAU,EACpB,kBAAkB,EAAE,kBAAkB,EACtC,OAAO,EAAE,OAAO,EAChB,QAAQ,EAAE,QAAQ,EAClB,gBAAgB,EAAE,UAAU,EAC5B,wBAAwB,EAAE,0BAA0B,GACpD,CACI,CACT,CAAC;AACJ,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport React, { useCallback, useMemo, useRef, useState } from 'react';\nimport { RichTextInputBoxComponent } from './RichTextInputBoxComponent';\nimport { Icon, Stack } from '@fluentui/react';\nimport { useLocale } from '../../localization';\nimport { SendBoxStrings } from '../SendBox';\nimport { sendIconStyle } from '../styles/SendBox.styles';\nimport { InputBoxButton } from '../InputBoxButton';\nimport { RichTextSendBoxErrors, RichTextSendBoxErrorsProps } from './RichTextSendBoxErrors';\n/* @conditional-compile-remove(file-sharing) */\nimport { ActiveFileUpload } from '../FileUploadCards';\n/* @conditional-compile-remove(file-sharing) */\nimport { SendBoxErrorBarError } from '../SendBoxErrorBar';\nimport { isMessageTooLong, sanitizeText } from '../utils/SendBoxUtils';\n/* @conditional-compile-remove(file-sharing) */\nimport { hasCompletedFileUploads } from '../utils/SendBoxUtils';\nimport { RichTextEditorComponentRef } from './RichTextEditor';\nimport { useTheme } from '../../theming';\nimport { richTextActionButtonsStyle, sendBoxRichTextEditorStyle } from '../styles/RichTextEditor.styles';\n\n/**\n * Strings of {@link RichTextSendBox} that can be overridden.\n *\n * @beta\n */\nexport interface RichTextSendBoxStrings extends SendBoxStrings {\n /**\n * Tooltip text for the bold button.\n */\n boldTooltip: string;\n /**\n * Tooltip text for the italic button.\n */\n italicTooltip: string;\n /**\n * Tooltip text for the underline button.\n */\n underlineTooltip: string;\n /**\n * Tooltip text for the bullet list button.\n */\n bulletListTooltip: string;\n /**\n * Tooltip text for the number list button.\n */\n numberListTooltip: string;\n /**\n * Tooltip text for the increase indent button.\n */\n increaseIndentTooltip: string;\n /**\n * Tooltip text for the decrease indent button.\n */\n decreaseIndentTooltip: string;\n /**\n * Tooltip text for the rich text format button button.\n */\n richTextFormatButtonTooltip: string;\n}\n\n/**\n * Props for {@link RichTextSendBox}.\n *\n * @beta\n */\nexport interface RichTextSendBoxProps {\n /**\n * Optional boolean to disable text box\n * @defaultValue false\n */\n disabled?: boolean;\n /**\n * Optional strings to override in component\n */\n strings?: Partial<RichTextSendBoxStrings>;\n /**\n * Optional text for system message above the text box\n */\n systemMessage?: string;\n /* @conditional-compile-remove(file-sharing) */\n /**\n * Optional callback to render uploaded files in the SendBox. The sendBox will expand\n * vertically to accommodate the uploaded files. File uploads will\n * be rendered below the text area in sendBox.\n * @beta\n */\n onRenderFileUploads?: () => JSX.Element;\n /* @conditional-compile-remove(file-sharing) */\n /**\n * Optional array of active file uploads where each object has attributes\n * of a file upload like name, progress, errorMessage etc.\n * @beta\n */\n activeFileUploads?: ActiveFileUpload[];\n /* @conditional-compile-remove(file-sharing) */\n /**\n * Optional callback to remove the file upload before sending by clicking on\n * cancel icon.\n * @beta\n */\n onCancelFileUpload?: (fileId: string) => void;\n /**\n * Callback function used when the send button is clicked.\n */\n onSendMessage: (content: string) => Promise<void>;\n}\n\n/**\n * A component to render SendBox with Rich Text Editor support.\n *\n * @beta\n */\nexport const RichTextSendBox = (props: RichTextSendBoxProps): JSX.Element => {\n const {\n disabled = false,\n systemMessage,\n onSendMessage,\n /* @conditional-compile-remove(file-sharing) */\n activeFileUploads\n } = props;\n\n const theme = useTheme();\n const locale = useLocale();\n\n const localeStrings = useMemo(() => {\n /* @conditional-compile-remove(rich-text-editor) */\n return locale.strings.richTextSendBox;\n return locale.strings.sendBox;\n }, [/* @conditional-compile-remove(rich-text-editor) */ locale.strings.richTextSendBox, locale.strings.sendBox]);\n\n const strings = useMemo(() => {\n return { ...localeStrings, ...props.strings };\n }, [localeStrings, props.strings]);\n\n const [contentValue, setContentValue] = useState('');\n const [contentValueOverflow, setContentValueOverflow] = useState(false);\n /* @conditional-compile-remove(file-sharing) */\n const [fileUploadsPendingError, setFileUploadsPendingError] = useState<SendBoxErrorBarError | undefined>(undefined);\n const editorComponentRef = useRef<RichTextEditorComponentRef>(null);\n\n const contentTooLongMessage = useMemo(\n () => (contentValueOverflow ? strings.textTooLong : undefined),\n [contentValueOverflow, strings.textTooLong]\n );\n\n const setContent = useCallback((newValue?: string): void => {\n if (newValue === undefined) {\n return;\n }\n\n setContentValueOverflow(isMessageTooLong(newValue.length));\n setContentValue(newValue);\n }, []);\n\n const sendMessageOnClick = useCallback((): void => {\n if (disabled || contentValueOverflow) {\n return;\n }\n // Don't send message until all files have been uploaded successfully\n /* @conditional-compile-remove(file-sharing) */\n setFileUploadsPendingError(undefined);\n\n // if (hasIncompleteFileUploads(activeFileUploads)) {\n // setFileUploadsPendingError({ message: strings.fileUploadsPendingError, timestamp: Date.now() });\n // return;\n // }\n\n const message = contentValue;\n // we don't want to send empty messages including spaces, newlines, tabs\n // Message can be empty if there is a valid file upload\n if (\n sanitizeText(message).length > 0 ||\n /* @conditional-compile-remove(file-sharing) */ hasCompletedFileUploads(activeFileUploads)\n ) {\n onSendMessage(message);\n setContentValue('');\n editorComponentRef.current?.setEmptyContent();\n }\n editorComponentRef.current?.focus();\n }, [\n /* @conditional-compile-remove(file-sharing) */ activeFileUploads,\n contentValue,\n contentValueOverflow,\n disabled,\n onSendMessage\n ]);\n\n const hasErrorMessage = useMemo(() => {\n return (\n !!systemMessage ||\n !!contentTooLongMessage ||\n /* @conditional-compile-remove(file-sharing) */\n !!fileUploadsPendingError ||\n /* @conditional-compile-remove(file-sharing) */\n !!activeFileUploads?.filter((fileUpload) => fileUpload.error).pop()?.error\n );\n }, [\n /* @conditional-compile-remove(file-sharing) */\n activeFileUploads,\n contentTooLongMessage,\n /* @conditional-compile-remove(file-sharing) */\n fileUploadsPendingError,\n systemMessage\n ]);\n\n const onRenderSendIcon = useCallback(\n (isHover: boolean) => (\n <Icon\n iconName={isHover && contentValue ? 'SendBoxSendHovered' : 'SendBoxSend'}\n className={sendIconStyle({\n theme,\n hasText: !!contentValue,\n /* @conditional-compile-remove(file-sharing) */\n hasFile: false,\n hasErrorMessage: hasErrorMessage,\n defaultTextColor: theme.palette.neutralSecondary,\n disabled: disabled\n })}\n />\n ),\n [contentValue, disabled, hasErrorMessage, theme]\n );\n\n const sendBoxErrorsProps: RichTextSendBoxErrorsProps = useMemo(() => {\n return {\n /* @conditional-compile-remove(file-sharing) */\n fileUploadsPendingError: fileUploadsPendingError,\n /* @conditional-compile-remove(file-sharing) */\n fileUploadError: activeFileUploads?.filter((fileUpload) => fileUpload.error).pop()?.error,\n systemMessage: systemMessage,\n textTooLongMessage: contentTooLongMessage\n };\n }, [\n /* @conditional-compile-remove(file-sharing) */\n activeFileUploads,\n contentTooLongMessage,\n /* @conditional-compile-remove(file-sharing) */\n fileUploadsPendingError,\n systemMessage\n ]);\n\n const sendButton = useMemo(() => {\n return (\n <InputBoxButton\n onRenderIcon={onRenderSendIcon}\n onClick={(e) => {\n sendMessageOnClick();\n e.stopPropagation(); // Prevents the click from bubbling up and triggering a focus event on the chat.\n }}\n className={richTextActionButtonsStyle}\n ariaLabel={localeStrings.sendButtonAriaLabel}\n tooltipContent={localeStrings.sendButtonAriaLabel}\n />\n );\n }, [localeStrings.sendButtonAriaLabel, onRenderSendIcon, sendMessageOnClick]);\n\n return (\n <Stack>\n <RichTextSendBoxErrors {...sendBoxErrorsProps} />\n <RichTextInputBoxComponent\n placeholderText={strings.placeholderText}\n onChange={setContent}\n editorComponentRef={editorComponentRef}\n strings={strings}\n disabled={disabled}\n actionComponents={sendButton}\n richTextEditorStyleProps={sendBoxRichTextEditorStyle}\n />\n </Stack>\n );\n};\n"]}
|
@@ -3,7 +3,7 @@ import { SendBoxErrorBarError } from '../SendBoxErrorBar';
|
|
3
3
|
/**
|
4
4
|
* @private
|
5
5
|
*/
|
6
|
-
export interface
|
6
|
+
export interface RichTextSendBoxErrorsProps {
|
7
7
|
fileUploadsPendingError?: SendBoxErrorBarError;
|
8
8
|
fileUploadError?: SendBoxErrorBarError;
|
9
9
|
systemMessage?: string;
|
@@ -12,5 +12,5 @@ export interface RTESendBoxErrorsProps {
|
|
12
12
|
/**
|
13
13
|
* @private
|
14
14
|
*/
|
15
|
-
export declare const
|
16
|
-
//# sourceMappingURL=
|
15
|
+
export declare const RichTextSendBoxErrors: (props: RichTextSendBoxErrorsProps) => JSX.Element;
|
16
|
+
//# sourceMappingURL=RichTextSendBoxErrors.d.ts.map
|
@@ -5,7 +5,7 @@ import { SendBoxErrorBar } from '../SendBoxErrorBar';
|
|
5
5
|
/**
|
6
6
|
* @private
|
7
7
|
*/
|
8
|
-
export const
|
8
|
+
export const RichTextSendBoxErrors = (props) => {
|
9
9
|
const {
|
10
10
|
/* @conditional-compile-remove(file-sharing) */
|
11
11
|
fileUploadError,
|
@@ -65,4 +65,4 @@ export const RTESendBoxErrors = (props) => {
|
|
65
65
|
const isMessageEmpty = (message) => {
|
66
66
|
return message.trim().length === 0;
|
67
67
|
};
|
68
|
-
//# sourceMappingURL=
|
68
|
+
//# sourceMappingURL=RichTextSendBoxErrors.js.map
|
package/dist/dist-esm/react-components/src/components/RichTextEditor/RichTextSendBoxErrors.js.map
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"RichTextSendBoxErrors.js","sourceRoot":"","sources":["../../../../../../../react-components/src/components/RichTextEditor/RichTextSendBoxErrors.tsx"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,KAAK,EAAE,EAAE,WAAW,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAChE,OAAO,EAAE,eAAe,EAAwB,MAAM,oBAAoB,CAAC;AAc3E;;GAEG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,KAAiC,EAAe,EAAE;IACtF,MAAM;IACJ,+CAA+C;IAC/C,eAAe;I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AAM,KAAK,CAAC,CAAC;AACrC,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport React, { useCallback, useEffect, useState } from 'react';\nimport { SendBoxErrorBar, SendBoxErrorBarError } from '../SendBoxErrorBar';\n\n/**\n * @private\n */\nexport interface RichTextSendBoxErrorsProps {\n /* @conditional-compile-remove(file-sharing) */\n fileUploadsPendingError?: SendBoxErrorBarError;\n /* @conditional-compile-remove(file-sharing) */\n fileUploadError?: SendBoxErrorBarError;\n systemMessage?: string;\n textTooLongMessage?: string;\n}\n\n/**\n * @private\n */\nexport const RichTextSendBoxErrors = (props: RichTextSendBoxErrorsProps): JSX.Element => {\n const {\n /* @conditional-compile-remove(file-sharing) */\n fileUploadError,\n /* @conditional-compile-remove(file-sharing) */\n fileUploadsPendingError,\n systemMessage,\n textTooLongMessage\n } = props;\n const [sendBoxError, setSendBoxError] = useState<SendBoxErrorBarError | undefined>(undefined);\n\n useEffect(() => {\n if (systemMessage && !isMessageEmpty(systemMessage)) {\n setSendBoxError({ message: systemMessage, timestamp: Date.now() });\n }\n }, [systemMessage]);\n\n useEffect(() => {\n if (textTooLongMessage && !isMessageEmpty(textTooLongMessage)) {\n setSendBoxError({ message: textTooLongMessage, timestamp: Date.now() });\n }\n }, [textTooLongMessage]);\n\n useEffect(() => {\n if (\n (textTooLongMessage === undefined || isMessageEmpty(textTooLongMessage)) &&\n (systemMessage === undefined || isMessageEmpty(systemMessage))\n ) {\n setSendBoxError(undefined);\n }\n }, [systemMessage, textTooLongMessage]);\n\n useEffect(() => {\n setSendBoxError((prev) => {\n const errors: SendBoxErrorBarError[] = [];\n if (prev) {\n errors.push(prev);\n }\n /* @conditional-compile-remove(file-sharing) */\n if (fileUploadsPendingError) {\n errors.push(fileUploadsPendingError);\n }\n /* @conditional-compile-remove(file-sharing) */\n if (fileUploadError) {\n errors.push(fileUploadError);\n }\n if (errors.length === 0) {\n return undefined;\n }\n // sort to get the latest error\n const sortedErrors = errors.sort((a, b) => b.timestamp - a.timestamp);\n return sortedErrors[0];\n });\n }, [\n /* @conditional-compile-remove(file-sharing) */ fileUploadError,\n /* @conditional-compile-remove(file-sharing) */ fileUploadsPendingError\n ]);\n\n const onDismiss = useCallback(() => {\n if (systemMessage && !isMessageEmpty(systemMessage)) {\n setSendBoxError({ message: systemMessage, timestamp: Date.now() });\n }\n }, [systemMessage]);\n\n return (\n <SendBoxErrorBar\n error={sendBoxError}\n dismissAfterMs={\n // don't dismiss the system message\n systemMessage !== undefined && sendBoxError?.message !== systemMessage ? 10 * 1000 : undefined\n }\n onDismiss={onDismiss}\n />\n );\n};\n\nconst isMessageEmpty = (message: string): boolean => {\n return message.trim().length === 0;\n};\n"]}
|
@@ -16,7 +16,7 @@ import { _FileUploadCards } from './FileUploadCards';
|
|
16
16
|
import { fileUploadCardsStyles } from './styles/SendBox.styles';
|
17
17
|
/* @conditional-compile-remove(file-sharing) */
|
18
18
|
import { hasCompletedFileUploads, hasIncompleteFileUploads } from './utils/SendBoxUtils';
|
19
|
-
import { MAXIMUM_LENGTH_OF_MESSAGE,
|
19
|
+
import { MAXIMUM_LENGTH_OF_MESSAGE, isMessageTooLong, sanitizeText } from './utils/SendBoxUtils';
|
20
20
|
/**
|
21
21
|
* Component for typing and sending messages.
|
22
22
|
*
|
@@ -68,7 +68,7 @@ export const SendBox = (props) => {
|
|
68
68
|
if (newValue === undefined) {
|
69
69
|
return;
|
70
70
|
}
|
71
|
-
setTextValueOverflow(
|
71
|
+
setTextValueOverflow(isMessageTooLong(newValue.length));
|
72
72
|
setTextValue(newValue);
|
73
73
|
};
|
74
74
|
const textTooLongMessage = textValueOverflow ? strings.textTooLong : undefined;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"SendBox.js","sourceRoot":"","sources":["../../../../../../react-components/src/components/SendBox.tsx"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,OAA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AAC,eAAe,EACxC,SAAS,EAAE,SAAS,EACpB,QAAQ,EAAE,CAAC,CAAC,EAAE,QAAQ,EAAE,EAAE,CAAC,OAAO,CAAC,QAAQ,CAAC,EAC5C,SAAS,EAAE,CAAC,EAAE,EAAE,EAAE;oBAChB,MAAM,oBAAoB,GAAG,EAAE,CAAC,GAAG,KAAK,OAAO,IAAI,CAAC,EAAE,CAAC,QAAQ,KAAK,KAAK,IAAI,CAAC,cAAc,CAAC,CAAC;oBAC9F,IAAI,CAAC,oBAAoB,EAAE,CAAC;wBAC1B,QAAQ,aAAR,QAAQ,uBAAR,QAAQ,EAAI,CAAC;oBACf,CAAC;gBACH,CAAC,EACD,cAAc,EAAE,GAAG,EAAE;oBACnB,kBAAkB,EAAE,CAAC;gBACvB,CAAC,EACD,MAAM,EAAE,YAAY,EACpB,cAAc,EAAE,cAAc,EAC9B,SAAS,EAAE,yBAAyB;gBACpC,0CAA0C;gBAC1C,oBAAoB,EAAE,oBAAoB;gBAE1C,oBAAC,cAAc,IACb,YAAY,EAAE,gBAAgB,EAC9B,OAAO,EAAE,CAAC,CAAC,EAAE,EAAE;wBACb,IAAI,CAAC,iBAAiB,EAAE,CAAC;4BACvB,kBAAkB,EAAE,CAAC;wBACvB,CAAC;wBACD,CAAC,CAAC,eAAe,EAAE,CAAC;oBACtB,CAAC,EACD,EAAE,EAAE,iBAAiB,EACrB,SAAS,EAAE,qBAAqB,EAChC,SAAS,EAAE,aAAa,CAAC,mBAAmB,EAC5C,cAAc,EAAE,aAAa,CAAC,mBAAmB,GACjD,CACgB;YAElB,+CAA+C;YAC/C,mBAAmB,EAAE,CAEjB,CACF,CACT,CAAC;AACJ,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport React, { useState, useMemo, useCallback } from 'react';\nimport { IStyle, ITextField, mergeStyles, concatStyleSets, Icon, Stack } from '@fluentui/react';\nimport { sendButtonStyle, sendIconStyle, sendBoxWrapperStyles, borderAndBoxShadowStyle } from './styles/SendBox.styles';\nimport { BaseCustomStyles } from '../types';\nimport { useTheme } from '../theming';\nimport { useLocale } from '../localization';\nimport { useIdentifiers } from '../identifiers';\nimport { InputBoxComponent } from './InputBoxComponent';\nimport { InputBoxButton } from './InputBoxButton';\n/* @conditional-compile-remove(file-sharing) */\nimport { SendBoxErrors } from './SendBoxErrors';\n/* @conditional-compile-remove(file-sharing) */\nimport { ActiveFileUpload, _FileUploadCards } from './FileUploadCards';\n/* @conditional-compile-remove(file-sharing) */\nimport { fileUploadCardsStyles } from './styles/SendBox.styles';\n/* @conditional-compile-remove(file-sharing) */\nimport { SendBoxErrorBarError } from './SendBoxErrorBar';\n/* @conditional-compile-remove(file-sharing) */\nimport { hasCompletedFileUploads, hasIncompleteFileUploads } from './utils/SendBoxUtils';\nimport { MAXIMUM_LENGTH_OF_MESSAGE, exceedsMaxAllowedLength, sanitizeText } from './utils/SendBoxUtils';\n/* @conditional-compile-remove(mention) */\nimport { MentionLookupOptions } from './MentionPopover';\n\n/**\n * Fluent styles for {@link Sendbox}.\n *\n * @public\n */\nexport interface SendBoxStylesProps extends BaseCustomStyles {\n /** Styles for the text field. */\n textField?: IStyle;\n /** styles for the text field container */\n textFieldContainer?: IStyle;\n /** Styles for the container of the send message icon. */\n sendMessageIconContainer?: IStyle;\n /** Styles for the send message icon; These styles will be ignored when a custom send message icon is provided. */\n sendMessageIcon?: IStyle;\n /** Styles for the system message; These styles will be ignored when a custom system message component is provided. */\n systemMessage?: IStyle;\n}\n\n/**\n * Strings of {@link SendBox} that can be overridden.\n *\n * @public\n */\nexport interface SendBoxStrings {\n /**\n * Placeholder text in SendBox when there is no user input\n */\n placeholderText: string;\n /**\n * The warning message when send box text length is more than max limit\n */\n textTooLong: string;\n /**\n * Aria label for send message button\n */\n sendButtonAriaLabel: string;\n /* @conditional-compile-remove(file-sharing) */\n /**\n * Error message indicating that all file uploads are not complete.\n */\n fileUploadsPendingError: string;\n /* @conditional-compile-remove(file-sharing) */\n /**\n * Aria label to notify user when focus is on cancel file upload button.\n */\n removeFile: string;\n /* @conditional-compile-remove(file-sharing) */\n /**\n * Aria label to notify user file uploading starts.\n */\n uploading: string;\n /* @conditional-compile-remove(file-sharing) */\n /**\n * Aria label to notify user file is uploaded.\n */\n uploadCompleted: string;\n}\n\n/**\n * Props for {@link SendBox}.\n *\n * @public\n */\nexport interface SendBoxProps {\n /**\n * Optional boolean to disable text box\n * @defaultValue false\n */\n disabled?: boolean;\n /**\n * Optional text for system message below text box\n */\n systemMessage?: string;\n /**\n * Optional override behavior on send button click\n */\n onSendMessage?: (content: string) => Promise<void>;\n /* @conditional-compile-remove(mention) */\n /**\n * Optional props needed to lookup suggestions in the mention scenario.\n * @beta\n */\n mentionLookupOptions?: MentionLookupOptions;\n\n /**\n * Optional callback called when user is typing\n */\n onTyping?: () => Promise<void>;\n /**\n * Optional callback to render system message below the SendBox.\n * @defaultValue MessageBar\n */\n onRenderSystemMessage?: (systemMessage: string | undefined) => React.ReactElement;\n /**\n * Optional boolean to support new line in SendBox.\n * @defaultValue false\n */\n supportNewline?: boolean;\n /**\n * Optional callback to render send button icon to the right of the SendBox.\n * @defaultValue SendBoxSendHovered icon when mouse over icon and SendBoxSend icon otherwise\n */\n onRenderIcon?: (isHover: boolean) => JSX.Element;\n /**\n * Allows users to pass in an object contains custom CSS styles.\n * @Example\n * ```\n * <SendBox styles={{ root: { background: 'blue' } }} />\n * ```\n */\n styles?: SendBoxStylesProps;\n /**\n * Optional strings to override in component\n */\n strings?: Partial<SendBoxStrings>;\n /**\n * enumerable to determine if the input box has focus on render or not.\n * When undefined nothing has focus on render\n */\n autoFocus?: 'sendBoxTextField';\n /* @conditional-compile-remove(file-sharing) */\n /**\n * Optional callback to render uploaded files in the SendBox. The sendBox will expand\n * vertically to accommodate the uploaded files. File uploads will\n * be rendered below the text area in sendBox.\n * @beta\n */\n onRenderFileUploads?: () => JSX.Element;\n /* @conditional-compile-remove(file-sharing) */\n /**\n * Optional array of active file uploads where each object has attributes\n * of a file upload like name, progress, errorMessage etc.\n * @beta\n */\n activeFileUploads?: ActiveFileUpload[];\n /* @conditional-compile-remove(file-sharing) */\n /**\n * Optional callback to remove the file upload before sending by clicking on\n * cancel icon.\n * @beta\n */\n onCancelFileUpload?: (fileId: string) => void;\n}\n\n/**\n * Component for typing and sending messages.\n *\n * Supports sending typing notification when user starts entering text.\n * Supports an optional message below the text input field.\n *\n * @public\n */\nexport const SendBox = (props: SendBoxProps): JSX.Element => {\n const {\n disabled,\n systemMessage,\n supportNewline,\n onSendMessage,\n onTyping,\n onRenderIcon,\n onRenderSystemMessage,\n styles,\n autoFocus,\n /* @conditional-compile-remove(mention) */\n mentionLookupOptions,\n /* @conditional-compile-remove(file-sharing) */\n activeFileUploads\n } = props;\n const theme = useTheme();\n const localeStrings = useLocale().strings.sendBox;\n const strings = { ...localeStrings, ...props.strings };\n const ids = useIdentifiers();\n\n const [textValue, setTextValue] = useState('');\n const [textValueOverflow, setTextValueOverflow] = useState(false);\n\n const sendTextFieldRef = React.useRef<ITextField>(null);\n\n /* @conditional-compile-remove(file-sharing) */\n const [fileUploadsPendingError, setFileUploadsPendingError] = useState<SendBoxErrorBarError | undefined>(undefined);\n\n const sendMessageOnClick = (): void => {\n // don't send a message when disabled\n if (disabled || textValueOverflow) {\n return;\n }\n\n // Don't send message until all files have been uploaded successfully\n /* @conditional-compile-remove(file-sharing) */\n setFileUploadsPendingError(undefined);\n\n /* @conditional-compile-remove(file-sharing) */\n if (hasIncompleteFileUploads(activeFileUploads)) {\n setFileUploadsPendingError({ message: strings.fileUploadsPendingError, timestamp: Date.now() });\n return;\n }\n\n const message = textValue;\n // we don't want to send empty messages including spaces, newlines, tabs\n // Message can be empty if there is a valid file upload\n if (\n sanitizeText(message).length > 0 ||\n /* @conditional-compile-remove(file-sharing) */ hasCompletedFileUploads(activeFileUploads)\n ) {\n onSendMessage && onSendMessage(message);\n setTextValue('');\n }\n sendTextFieldRef.current?.focus();\n };\n\n const setText = (newValue?: string | undefined): void => {\n if (newValue === undefined) {\n return;\n }\n\n setTextValueOverflow(exceedsMaxAllowedLength(newValue.length));\n setTextValue(newValue);\n };\n\n const textTooLongMessage = textValueOverflow ? strings.textTooLong : undefined;\n const errorMessage = systemMessage ?? textTooLongMessage;\n\n const mergedSendButtonStyle = useMemo(\n () => mergeStyles(sendButtonStyle, styles?.sendMessageIconContainer),\n [styles?.sendMessageIconContainer]\n );\n\n const mergedStyles = useMemo(() => concatStyleSets(styles), [styles]);\n\n const mergedSendIconStyle = useMemo(\n () =>\n sendIconStyle({\n theme,\n hasText: !!textValue,\n /* @conditional-compile-remove(file-sharing) */ hasFile: hasCompletedFileUploads(activeFileUploads),\n hasErrorMessage: !!errorMessage,\n customSendIconStyle: styles?.sendMessageIcon\n }),\n [\n theme,\n textValue,\n /* @conditional-compile-remove(file-sharing) */ activeFileUploads,\n errorMessage,\n styles?.sendMessageIcon\n ]\n );\n\n const onRenderSendIcon = useCallback(\n (isHover: boolean) =>\n onRenderIcon ? (\n onRenderIcon(isHover)\n ) : (\n <Icon iconName={isHover && textValue ? 'SendBoxSendHovered' : 'SendBoxSend'} className={mergedSendIconStyle} />\n ),\n [mergedSendIconStyle, onRenderIcon, textValue]\n );\n\n // Ensure that errors are cleared when there are no files in sendBox\n /* @conditional-compile-remove(file-sharing) */\n React.useEffect(() => {\n if (!activeFileUploads?.filter((upload) => !upload.error).length) {\n setFileUploadsPendingError(undefined);\n }\n }, [activeFileUploads]);\n\n /* @conditional-compile-remove(file-sharing) */\n const sendBoxErrorsProps = useMemo(() => {\n return {\n fileUploadsPendingError: fileUploadsPendingError,\n fileUploadError: activeFileUploads?.filter((fileUpload) => fileUpload.error).pop()?.error\n };\n }, [activeFileUploads, fileUploadsPendingError]);\n\n /* @conditional-compile-remove(file-sharing) */\n const onRenderFileUploads = useCallback(() => {\n if (!activeFileUploads?.filter((upload) => !upload.error).length) {\n return null;\n }\n return props.onRenderFileUploads ? (\n props.onRenderFileUploads()\n ) : (\n <Stack className={fileUploadCardsStyles}>\n <_FileUploadCards\n activeFileUploads={activeFileUploads}\n onCancelFileUpload={props.onCancelFileUpload}\n strings={{\n removeFile: props.strings?.removeFile ?? localeStrings.removeFile,\n uploading: props.strings?.uploading ?? localeStrings.uploading,\n uploadCompleted: props.strings?.uploadCompleted ?? localeStrings.uploadCompleted\n }}\n />\n </Stack>\n );\n }, [activeFileUploads, props, localeStrings]);\n\n return (\n <Stack\n className={mergeStyles(\n sendBoxWrapperStyles,\n { overflow: 'visible' } // This is needed for the mention popup to be visible\n )}\n >\n {/* @conditional-compile-remove(file-sharing) */ <SendBoxErrors {...sendBoxErrorsProps} />}\n <Stack\n className={borderAndBoxShadowStyle({\n theme,\n hasErrorMessage: !!errorMessage,\n disabled: !!disabled\n })}\n >\n <InputBoxComponent\n autoFocus={autoFocus}\n data-ui-id={ids.sendboxTextField}\n disabled={disabled}\n errorMessage={onRenderSystemMessage ? onRenderSystemMessage(errorMessage) : errorMessage}\n textFieldRef={sendTextFieldRef}\n id=\"sendbox\"\n placeholderText={strings.placeholderText}\n textValue={textValue}\n onChange={(_, newValue) => setText(newValue)}\n onKeyDown={(ev) => {\n const keyWasSendingMessage = ev.key === 'Enter' && (ev.shiftKey === false || !supportNewline);\n if (!keyWasSendingMessage) {\n onTyping?.();\n }\n }}\n onEnterKeyDown={() => {\n sendMessageOnClick();\n }}\n styles={mergedStyles}\n supportNewline={supportNewline}\n maxLength={MAXIMUM_LENGTH_OF_MESSAGE}\n /* @conditional-compile-remove(mention) */\n mentionLookupOptions={mentionLookupOptions}\n >\n <InputBoxButton\n onRenderIcon={onRenderSendIcon}\n onClick={(e) => {\n if (!textValueOverflow) {\n sendMessageOnClick();\n }\n e.stopPropagation();\n }}\n id={'sendIconWrapper'}\n className={mergedSendButtonStyle}\n ariaLabel={localeStrings.sendButtonAriaLabel}\n tooltipContent={localeStrings.sendButtonAriaLabel}\n />\n </InputBoxComponent>\n {\n /* @conditional-compile-remove(file-sharing) */\n onRenderFileUploads()\n }\n </Stack>\n </Stack>\n );\n};\n"]}
|
1
|
+
{"version":3,"file":"SendBox.js","sourceRoot":"","sources":["../../../../../../react-components/src/components/SendBox.tsx"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AAC9D,OAAO,EAAsB,WAAW,EAAE,eAAe,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AAChG,OAAO,EAAE,eAAe,EAAE,aAAa,EAAE,oBAAoB,EAAE,uBAAuB,EAAE,MAAM,yBAAyB,CAAC;AAExH,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAChD,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,+CAA+C;AAC/C,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,+CAA+C;AAC/C,OAAO,EAAoB,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AACvE,+CAA+C;AAC/C,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAGhE,+CAA+C;AAC/C,OAAO,EAAE,uBAAuB,EAAE,wBAAwB,EAAE,MAAM,sBAAsB,CAAC;AACzF,OAAO,EAAE,yBAAyB,EAAE,gBAAgB,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAoJjG;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,OAAO,GAAG,CAAC,KAAmB,EAAe,EAAE;IAC1D,MAAM,EACJ,QAAQ,EACR,aAAa,EACb,cAAc,EACd,aAAa,EACb,QAAQ,EACR,YAAY,EACZ,qBAAqB,EAC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AAC;AACJ,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport React, { useState, useMemo, useCallback } from 'react';\nimport { IStyle, ITextField, mergeStyles, concatStyleSets, Icon, Stack } from '@fluentui/react';\nimport { sendButtonStyle, sendIconStyle, sendBoxWrapperStyles, borderAndBoxShadowStyle } from './styles/SendBox.styles';\nimport { BaseCustomStyles } from '../types';\nimport { useTheme } from '../theming';\nimport { useLocale } from '../localization';\nimport { useIdentifiers } from '../identifiers';\nimport { InputBoxComponent } from './InputBoxComponent';\nimport { InputBoxButton } from './InputBoxButton';\n/* @conditional-compile-remove(file-sharing) */\nimport { SendBoxErrors } from './SendBoxErrors';\n/* @conditional-compile-remove(file-sharing) */\nimport { ActiveFileUpload, _FileUploadCards } from './FileUploadCards';\n/* @conditional-compile-remove(file-sharing) */\nimport { fileUploadCardsStyles } from './styles/SendBox.styles';\n/* @conditional-compile-remove(file-sharing) */\nimport { SendBoxErrorBarError } from './SendBoxErrorBar';\n/* @conditional-compile-remove(file-sharing) */\nimport { hasCompletedFileUploads, hasIncompleteFileUploads } from './utils/SendBoxUtils';\nimport { MAXIMUM_LENGTH_OF_MESSAGE, isMessageTooLong, sanitizeText } from './utils/SendBoxUtils';\n/* @conditional-compile-remove(mention) */\nimport { MentionLookupOptions } from './MentionPopover';\n\n/**\n * Fluent styles for {@link Sendbox}.\n *\n * @public\n */\nexport interface SendBoxStylesProps extends BaseCustomStyles {\n /** Styles for the text field. */\n textField?: IStyle;\n /** styles for the text field container */\n textFieldContainer?: IStyle;\n /** Styles for the container of the send message icon. */\n sendMessageIconContainer?: IStyle;\n /** Styles for the send message icon; These styles will be ignored when a custom send message icon is provided. */\n sendMessageIcon?: IStyle;\n /** Styles for the system message; These styles will be ignored when a custom system message component is provided. */\n systemMessage?: IStyle;\n}\n\n/**\n * Strings of {@link SendBox} that can be overridden.\n *\n * @public\n */\nexport interface SendBoxStrings {\n /**\n * Placeholder text in SendBox when there is no user input\n */\n placeholderText: string;\n /**\n * The warning message when send box text length is more than max limit\n */\n textTooLong: string;\n /**\n * Aria label for send message button\n */\n sendButtonAriaLabel: string;\n /* @conditional-compile-remove(file-sharing) */\n /**\n * Error message indicating that all file uploads are not complete.\n */\n fileUploadsPendingError: string;\n /* @conditional-compile-remove(file-sharing) */\n /**\n * Aria label to notify user when focus is on cancel file upload button.\n */\n removeFile: string;\n /* @conditional-compile-remove(file-sharing) */\n /**\n * Aria label to notify user file uploading starts.\n */\n uploading: string;\n /* @conditional-compile-remove(file-sharing) */\n /**\n * Aria label to notify user file is uploaded.\n */\n uploadCompleted: string;\n}\n\n/**\n * Props for {@link SendBox}.\n *\n * @public\n */\nexport interface SendBoxProps {\n /**\n * Optional boolean to disable text box\n * @defaultValue false\n */\n disabled?: boolean;\n /**\n * Optional text for system message below text box\n */\n systemMessage?: string;\n /**\n * Optional override behavior on send button click\n */\n onSendMessage?: (content: string) => Promise<void>;\n /* @conditional-compile-remove(mention) */\n /**\n * Optional props needed to lookup suggestions in the mention scenario.\n * @beta\n */\n mentionLookupOptions?: MentionLookupOptions;\n\n /**\n * Optional callback called when user is typing\n */\n onTyping?: () => Promise<void>;\n /**\n * Optional callback to render system message below the SendBox.\n * @defaultValue MessageBar\n */\n onRenderSystemMessage?: (systemMessage: string | undefined) => React.ReactElement;\n /**\n * Optional boolean to support new line in SendBox.\n * @defaultValue false\n */\n supportNewline?: boolean;\n /**\n * Optional callback to render send button icon to the right of the SendBox.\n * @defaultValue SendBoxSendHovered icon when mouse over icon and SendBoxSend icon otherwise\n */\n onRenderIcon?: (isHover: boolean) => JSX.Element;\n /**\n * Allows users to pass in an object contains custom CSS styles.\n * @Example\n * ```\n * <SendBox styles={{ root: { background: 'blue' } }} />\n * ```\n */\n styles?: SendBoxStylesProps;\n /**\n * Optional strings to override in component\n */\n strings?: Partial<SendBoxStrings>;\n /**\n * enumerable to determine if the input box has focus on render or not.\n * When undefined nothing has focus on render\n */\n autoFocus?: 'sendBoxTextField';\n /* @conditional-compile-remove(file-sharing) */\n /**\n * Optional callback to render uploaded files in the SendBox. The sendBox will expand\n * vertically to accommodate the uploaded files. File uploads will\n * be rendered below the text area in sendBox.\n * @beta\n */\n onRenderFileUploads?: () => JSX.Element;\n /* @conditional-compile-remove(file-sharing) */\n /**\n * Optional array of active file uploads where each object has attributes\n * of a file upload like name, progress, errorMessage etc.\n * @beta\n */\n activeFileUploads?: ActiveFileUpload[];\n /* @conditional-compile-remove(file-sharing) */\n /**\n * Optional callback to remove the file upload before sending by clicking on\n * cancel icon.\n * @beta\n */\n onCancelFileUpload?: (fileId: string) => void;\n}\n\n/**\n * Component for typing and sending messages.\n *\n * Supports sending typing notification when user starts entering text.\n * Supports an optional message below the text input field.\n *\n * @public\n */\nexport const SendBox = (props: SendBoxProps): JSX.Element => {\n const {\n disabled,\n systemMessage,\n supportNewline,\n onSendMessage,\n onTyping,\n onRenderIcon,\n onRenderSystemMessage,\n styles,\n autoFocus,\n /* @conditional-compile-remove(mention) */\n mentionLookupOptions,\n /* @conditional-compile-remove(file-sharing) */\n activeFileUploads\n } = props;\n const theme = useTheme();\n const localeStrings = useLocale().strings.sendBox;\n const strings = { ...localeStrings, ...props.strings };\n const ids = useIdentifiers();\n\n const [textValue, setTextValue] = useState('');\n const [textValueOverflow, setTextValueOverflow] = useState(false);\n\n const sendTextFieldRef = React.useRef<ITextField>(null);\n\n /* @conditional-compile-remove(file-sharing) */\n const [fileUploadsPendingError, setFileUploadsPendingError] = useState<SendBoxErrorBarError | undefined>(undefined);\n\n const sendMessageOnClick = (): void => {\n // don't send a message when disabled\n if (disabled || textValueOverflow) {\n return;\n }\n\n // Don't send message until all files have been uploaded successfully\n /* @conditional-compile-remove(file-sharing) */\n setFileUploadsPendingError(undefined);\n\n /* @conditional-compile-remove(file-sharing) */\n if (hasIncompleteFileUploads(activeFileUploads)) {\n setFileUploadsPendingError({ message: strings.fileUploadsPendingError, timestamp: Date.now() });\n return;\n }\n\n const message = textValue;\n // we don't want to send empty messages including spaces, newlines, tabs\n // Message can be empty if there is a valid file upload\n if (\n sanitizeText(message).length > 0 ||\n /* @conditional-compile-remove(file-sharing) */ hasCompletedFileUploads(activeFileUploads)\n ) {\n onSendMessage && onSendMessage(message);\n setTextValue('');\n }\n sendTextFieldRef.current?.focus();\n };\n\n const setText = (newValue?: string | undefined): void => {\n if (newValue === undefined) {\n return;\n }\n\n setTextValueOverflow(isMessageTooLong(newValue.length));\n setTextValue(newValue);\n };\n\n const textTooLongMessage = textValueOverflow ? strings.textTooLong : undefined;\n const errorMessage = systemMessage ?? textTooLongMessage;\n\n const mergedSendButtonStyle = useMemo(\n () => mergeStyles(sendButtonStyle, styles?.sendMessageIconContainer),\n [styles?.sendMessageIconContainer]\n );\n\n const mergedStyles = useMemo(() => concatStyleSets(styles), [styles]);\n\n const mergedSendIconStyle = useMemo(\n () =>\n sendIconStyle({\n theme,\n hasText: !!textValue,\n /* @conditional-compile-remove(file-sharing) */ hasFile: hasCompletedFileUploads(activeFileUploads),\n hasErrorMessage: !!errorMessage,\n customSendIconStyle: styles?.sendMessageIcon\n }),\n [\n theme,\n textValue,\n /* @conditional-compile-remove(file-sharing) */ activeFileUploads,\n errorMessage,\n styles?.sendMessageIcon\n ]\n );\n\n const onRenderSendIcon = useCallback(\n (isHover: boolean) =>\n onRenderIcon ? (\n onRenderIcon(isHover)\n ) : (\n <Icon iconName={isHover && textValue ? 'SendBoxSendHovered' : 'SendBoxSend'} className={mergedSendIconStyle} />\n ),\n [mergedSendIconStyle, onRenderIcon, textValue]\n );\n\n // Ensure that errors are cleared when there are no files in sendBox\n /* @conditional-compile-remove(file-sharing) */\n React.useEffect(() => {\n if (!activeFileUploads?.filter((upload) => !upload.error).length) {\n setFileUploadsPendingError(undefined);\n }\n }, [activeFileUploads]);\n\n /* @conditional-compile-remove(file-sharing) */\n const sendBoxErrorsProps = useMemo(() => {\n return {\n fileUploadsPendingError: fileUploadsPendingError,\n fileUploadError: activeFileUploads?.filter((fileUpload) => fileUpload.error).pop()?.error\n };\n }, [activeFileUploads, fileUploadsPendingError]);\n\n /* @conditional-compile-remove(file-sharing) */\n const onRenderFileUploads = useCallback(() => {\n if (!activeFileUploads?.filter((upload) => !upload.error).length) {\n return null;\n }\n return props.onRenderFileUploads ? (\n props.onRenderFileUploads()\n ) : (\n <Stack className={fileUploadCardsStyles}>\n <_FileUploadCards\n activeFileUploads={activeFileUploads}\n onCancelFileUpload={props.onCancelFileUpload}\n strings={{\n removeFile: props.strings?.removeFile ?? localeStrings.removeFile,\n uploading: props.strings?.uploading ?? localeStrings.uploading,\n uploadCompleted: props.strings?.uploadCompleted ?? localeStrings.uploadCompleted\n }}\n />\n </Stack>\n );\n }, [activeFileUploads, props, localeStrings]);\n\n return (\n <Stack\n className={mergeStyles(\n sendBoxWrapperStyles,\n { overflow: 'visible' } // This is needed for the mention popup to be visible\n )}\n >\n {/* @conditional-compile-remove(file-sharing) */ <SendBoxErrors {...sendBoxErrorsProps} />}\n <Stack\n className={borderAndBoxShadowStyle({\n theme,\n hasErrorMessage: !!errorMessage,\n disabled: !!disabled\n })}\n >\n <InputBoxComponent\n autoFocus={autoFocus}\n data-ui-id={ids.sendboxTextField}\n disabled={disabled}\n errorMessage={onRenderSystemMessage ? onRenderSystemMessage(errorMessage) : errorMessage}\n textFieldRef={sendTextFieldRef}\n id=\"sendbox\"\n placeholderText={strings.placeholderText}\n textValue={textValue}\n onChange={(_, newValue) => setText(newValue)}\n onKeyDown={(ev) => {\n const keyWasSendingMessage = ev.key === 'Enter' && (ev.shiftKey === false || !supportNewline);\n if (!keyWasSendingMessage) {\n onTyping?.();\n }\n }}\n onEnterKeyDown={() => {\n sendMessageOnClick();\n }}\n styles={mergedStyles}\n supportNewline={supportNewline}\n maxLength={MAXIMUM_LENGTH_OF_MESSAGE}\n /* @conditional-compile-remove(mention) */\n mentionLookupOptions={mentionLookupOptions}\n >\n <InputBoxButton\n onRenderIcon={onRenderSendIcon}\n onClick={(e) => {\n if (!textValueOverflow) {\n sendMessageOnClick();\n }\n e.stopPropagation();\n }}\n id={'sendIconWrapper'}\n className={mergedSendButtonStyle}\n ariaLabel={localeStrings.sendButtonAriaLabel}\n tooltipContent={localeStrings.sendButtonAriaLabel}\n />\n </InputBoxComponent>\n {\n /* @conditional-compile-remove(file-sharing) */\n onRenderFileUploads()\n }\n </Stack>\n </Stack>\n );\n};\n"]}
|
@@ -9,8 +9,10 @@ export { _MentionPopover } from './MentionPopover';
|
|
9
9
|
export { ImageOverlay } from './ImageOverlay';
|
10
10
|
export type { ImageOverlayStrings } from './ImageOverlay';
|
11
11
|
export type { SendBoxProps, SendBoxStrings, SendBoxStylesProps } from './SendBox';
|
12
|
-
export { RichTextSendBox } from './
|
13
|
-
export
|
12
|
+
export { RichTextSendBox } from './RichTextEditor/RichTextSendBox';
|
13
|
+
export { ChatMessageComponentAsRichTextEditBox } from './ChatMessage/ChatMessageComponentAsRichTextEditBox';
|
14
|
+
export type { ChatMessageComponentAsRichTextEditBoxProps } from './ChatMessage/ChatMessageComponentAsRichTextEditBox';
|
15
|
+
export type { RichTextSendBoxProps, RichTextSendBoxStrings } from './RichTextEditor/RichTextSendBox';
|
14
16
|
export type { _MentionPopoverProps, MentionLookupOptions, MentionDisplayOptions, MentionOptions, Mention, MentionPopoverStrings } from './MentionPopover';
|
15
17
|
export type { ImageOverlayProps } from './ImageOverlay';
|
16
18
|
export type { InlineImageOptions, InlineImage } from './ChatMessage/ChatMessageContent';
|
@@ -9,7 +9,10 @@ export { _MentionPopover } from './MentionPopover';
|
|
9
9
|
/* @conditional-compile-remove(image-overlay) */
|
10
10
|
export { ImageOverlay } from './ImageOverlay';
|
11
11
|
/* @conditional-compile-remove(rich-text-editor) */
|
12
|
-
export { RichTextSendBox } from './
|
12
|
+
export { RichTextSendBox } from './RichTextEditor/RichTextSendBox';
|
13
|
+
// TODO: This component is exported only for testing purposes. Remove this when this component is added to composites
|
14
|
+
/* @conditional-compile-remove(rich-text-editor) */
|
15
|
+
export { ChatMessageComponentAsRichTextEditBox } from './ChatMessage/ChatMessageComponentAsRichTextEditBox';
|
13
16
|
export { MessageStatusIndicator } from './MessageStatusIndicator';
|
14
17
|
export { MessageThread } from './MessageThread';
|
15
18
|
export { StreamMedia } from './StreamMedia';
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../react-components/src/components/index.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAGpD,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAGtC,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAG1C,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,0CAA0C;AAC1C,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAEnD,gDAAgD;AAChD,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAK9C,mDAAmD;AACnD,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAuBnD,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAGlE,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAYhD,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAI5C,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAGpD,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAWpD,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAGxC,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAe9C,OAAO,EAAE,2BAA2B,EAAE,MAAM,0BAA0B,CAAC;AAGvE,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAQ9C,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAG1C,OAAO,EAAE,gBAAg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AAO,EAAE,WAAW,EAAE,MAAM,gCAAgC,CAAC;AAG7D,6CAA6C;AAC7C,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAI1C,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AACnD,OAAO,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AACrD,OAAO,EAAE,sBAAsB,EAAE,MAAM,yBAAyB,CAAC;AAGjE,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAE1D,OAAO,EAAE,yBAAyB,EAAE,MAAM,6BAA6B,CAAC;AAExE,OAAO,EAAE,0BAA0B,EAAE,MAAM,8BAA8B,CAAC;AAG1E,OAAO,EAAE,6BAA6B,EAAE,MAAM,gCAAgC,CAAC;AAM/E,OAAO,EAAE,yBAAyB,EAAE,MAAM,8CAA8C,CAAC;AAOzF,OAAO,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAC;AAEpE,OAAO,EACL,6BAA6B,EAC7B,qBAAqB,EACrB,yBAAyB,EAC1B,MAAM,wCAAwC,CAAC;AAEhD,OAAO,EAAE,6BAA6B,EAAE,MAAM,6CAA6C,CAAC;AAQ5F,iDAAiD;AACjD,cAAc,kBAAkB,CAAC;AACjC,iDAAiD;AACjD,cAAc,WAAW,CAAC;AAC1B,iDAAiD;AACjD,cAAc,uBAAuB,CAAC;AACtC,iDAAiD;AACjD,cAAc,yBAAyB,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nexport { TypingIndicator } from './TypingIndicator';\nexport type { TypingIndicatorProps, TypingIndicatorStrings, TypingIndicatorStylesProps } from './TypingIndicator';\n\nexport { ErrorBar } from './ErrorBar';\nexport type { ActiveErrorMessage, ErrorBarProps, ErrorBarStrings, ErrorType } from './ErrorBar';\n\nexport { GridLayout } from './GridLayout';\nexport type { GridLayoutProps, GridLayoutStyles } from './GridLayout';\n\nexport { SendBox } from './SendBox';\n/* @conditional-compile-remove(mention) */\nexport { _MentionPopover } from './MentionPopover';\n\n/* @conditional-compile-remove(image-overlay) */\nexport { ImageOverlay } from './ImageOverlay';\n/* @conditional-compile-remove(image-overlay) */\nexport type { ImageOverlayStrings } from './ImageOverlay';\nexport type { SendBoxProps, SendBoxStrings, SendBoxStylesProps } from './SendBox';\n\n/* @conditional-compile-remove(rich-text-editor) */\nexport { RichTextSendBox } from './RTE/RTESendBox';\n/* @conditional-compile-remove(rich-text-editor) */\nexport type { RichTextSendBoxProps, RichTextSendBoxStrings } from './RTE/RTESendBox';\n\n/* @conditional-compile-remove(mention) */\nexport type {\n _MentionPopoverProps,\n MentionLookupOptions,\n MentionDisplayOptions,\n MentionOptions,\n Mention,\n MentionPopoverStrings\n} from './MentionPopover';\n\n/* @conditional-compile-remove(image-overlay) */\nexport type { ImageOverlayProps } from './ImageOverlay';\n\n/* @conditional-compile-remove(image-overlay) */\nexport type { InlineImageOptions, InlineImage } from './ChatMessage/ChatMessageContent';\n\n/* @conditional-compile-remove(file-sharing) */\nexport type { ActiveFileUpload } from './FileUploadCards';\n\nexport { MessageStatusIndicator } from './MessageStatusIndicator';\nexport type { MessageStatusIndicatorProps, MessageStatusIndicatorStrings } from './MessageStatusIndicator';\n\nexport { MessageThread } from './MessageThread';\nexport type {\n MessageProps,\n MessageThreadProps,\n MessageThreadStrings,\n MessageThreadStyles,\n JumpToNewMessageButtonProps,\n MessageRenderer,\n UpdateMessageCallback,\n CancelEditCallback\n} from './MessageThread';\n\nexport { StreamMedia } from './StreamMedia';\nexport type { StreamMediaProps } from './StreamMedia';\nexport type { LoadingState } from './StreamMedia';\n\nexport { ParticipantItem } from './ParticipantItem';\nexport type { ParticipantItemProps, ParticipantItemStrings, ParticipantItemStyles } from './ParticipantItem';\n\nexport { ParticipantList } from './ParticipantList';\nexport type {\n ParticipantListItemStyles,\n ParticipantListProps,\n ParticipantListStyles,\n ParticipantMenuItemsCallback\n} from './ParticipantList';\n\n/* @conditional-compile-remove(total-participant-count) */\nexport type { ParticipantListStrings } from './ParticipantList';\n\nexport { Announcer } from './Announcer';\nexport type { AnnouncerProps } from './Announcer';\n\nexport { VideoGallery } from './VideoGallery';\nexport type {\n VideoGalleryProps,\n VideoGalleryStrings,\n VideoGalleryStyles,\n VideoGalleryLayout,\n VideoTileContextualMenuProps,\n VideoTileDrawerMenuProps\n} from './VideoGallery';\n/* @conditional-compile-remove(vertical-gallery) */\nexport type { OverflowGalleryPosition } from './VideoGallery';\n/* @conditional-compile-remove(click-to-call) */ /* @conditional-compile-remove(rooms) */\nexport type { LocalVideoTileSize } from './VideoGallery';\nexport type { HorizontalGalleryStyles } from './HorizontalGallery';\n\nexport { LocalVideoCameraCycleButton } from './LocalVideoCameraButton';\nexport type { LocalVideoCameraCycleButtonProps } from './LocalVideoCameraButton';\n\nexport { CameraButton } from './CameraButton';\nexport type {\n CameraButtonContextualMenuStyles,\n CameraButtonProps,\n CameraButtonStrings,\n CameraButtonStyles\n} from './CameraButton';\n\nexport { ControlBar } from './ControlBar';\nexport type { ControlBarProps, ControlBarLayout } from './ControlBar';\n\nexport { ControlBarButton } from './ControlBarButton';\nexport type { ControlBarButtonProps, ControlBarButtonStrings, ControlBarButtonStyles } from './ControlBarButton';\n\nexport { EndCallButton } from './EndCallButton';\nexport type { EndCallButtonProps, EndCallButtonStrings } from './EndCallButton';\n\nexport { MicrophoneButton } from './MicrophoneButton';\nexport type {\n MicrophoneButtonStyles,\n MicrophoneButtonContextualMenuStyles,\n MicrophoneButtonProps,\n MicrophoneButtonStrings\n} from './MicrophoneButton';\n\nexport { DevicesButton, generateDefaultDeviceMenuProps as _generateDefaultDeviceMenuProps } from './DevicesButton';\nexport type {\n OptionsDevice,\n DevicesButtonProps,\n DevicesButtonStrings,\n DevicesButtonStyles,\n DevicesButtonContextualMenuStyles,\n DeviceMenuProps as _DeviceMenuProps,\n DeviceMenuStrings as _DeviceMenuStrings,\n DeviceMenuStyles as _DeviceMenuStyles\n} from './DevicesButton';\n\n/* @conditional-compile-remove(call-readiness) */\nexport {\n CameraAndMicrophoneSitePermissions,\n MicrophoneSitePermissions,\n CameraSitePermissions\n} from './DevicePermissions/SitePermissions';\n/* @conditional-compile-remove(call-readiness) */\nexport type { SitePermissionsStrings, SitePermissionsStyles } from './DevicePermissions/SitePermissionsScaffolding';\n/* @conditional-compile-remove(call-readiness) */\nexport type {\n CameraAndMicrophoneSitePermissionsStrings,\n CameraAndMicrophoneSitePermissionsProps,\n CameraSitePermissionsStrings,\n CameraSitePermissionsProps,\n CommonSitePermissionsProps,\n MicrophoneSitePermissionsStrings,\n MicrophoneSitePermissionsProps\n} from './DevicePermissions/SitePermissions';\n/* @conditional-compile-remove(call-readiness) */\nexport { BrowserPermissionDenied } from './DevicePermissions/BrowserPermissionDenied';\n/* @conditional-compile-remove(call-readiness) */\nexport type {\n BrowserPermissionDeniedStrings,\n BrowserPermissionDeniedStyles,\n BrowserPermissionDeniedProps\n} from './DevicePermissions/BrowserPermissionDenied';\n/* @conditional-compile-remove(call-readiness) */\nexport { BrowserPermissionDeniedIOS } from './DevicePermissions/BrowserPermissionDeniedIOS';\n/* @conditional-compile-remove(call-readiness) */\nexport type {\n BrowserPermissionDeniedIOSStrings,\n BrowserPermissionDeniedIOSProps\n} from './DevicePermissions/BrowserPermissionDeniedIOS';\n\nexport { ParticipantsButton } from './ParticipantsButton';\nexport type {\n ParticipantsButtonContextualMenuStyles,\n ParticipantsButtonProps,\n ParticipantsButtonStrings,\n ParticipantsButtonStyles\n} from './ParticipantsButton';\n\nexport { ScreenShareButton } from './ScreenShareButton';\nexport type { ScreenShareButtonProps, ScreenShareButtonStrings } from './ScreenShareButton';\n\n/* @conditional-compile-remove(raise-hand) */\nexport { RaiseHandButton } from './RaiseHandButton';\n/* @conditional-compile-remove(raise-hand) */\nexport type { RaiseHandButtonProps, RaiseHandButtonStrings } from './RaiseHandButton';\n/* @conditional-compile-remove(reaction) */\nexport { ReactionButton } from './ReactionButton';\n/* @conditional-compile-remove(reaction) */\nexport type { ReactionButtonProps, ReactionButtonStrings } from './ReactionButton';\nexport { VideoTile } from './VideoTile';\nexport type { VideoTileProps, VideoTileStylesProps } from './VideoTile';\n/* @conditional-compile-remove(PSTN-calls) */\nexport type { VideoTileStrings } from './VideoTile';\n\nexport { _PictureInPictureInPicture } from './PictureInPictureInPicture/PictureInPictureInPicture';\nexport type {\n _PictureInPictureInPictureProps,\n _PictureInPictureInPictureStrings\n} from './PictureInPictureInPicture/PictureInPictureInPicture';\nexport type {\n _PictureInPictureInPictureTileProps,\n _TileOrientation\n} from './PictureInPictureInPicture/PictureInPictureInPictureTile';\n\nexport * from './Drawer';\n/* @conditional-compile-remove(file-sharing) */\nexport type { SendBoxErrorBarError } from './SendBoxErrorBar';\nexport * from './FileCard';\nexport * from './FileCardGroup';\nexport * from './ModalClone/ModalClone';\nexport * from './FileDownloadCards';\nexport type { _FileUploadCardsStrings } from './FileUploadCards';\n\nexport { _useContainerHeight, _useContainerWidth } from './utils/responsive';\n\nexport { _ComplianceBanner } from './ComplianceBanner';\nexport type { _ComplianceBannerProps, _ComplianceBannerStrings } from './ComplianceBanner';\nexport { Dialpad } from './Dialpad/Dialpad';\nexport type { DialpadProps, DialpadStrings, DialpadStyles, DtmfTone } from './Dialpad/Dialpad';\nexport type { DialpadMode, LongPressTrigger } from './Dialpad/Dialpad';\n/* @conditional-compile-remove(end-of-call-survey) */\nexport { _StarSurvey } from './Survey/StarSurvey/StarSurvey';\n/* @conditional-compile-remove(end-of-call-survey) */\nexport type { _StarSurveyProps, _StarSurveyStrings } from './Survey/StarSurvey/StarSurvey';\n/* @conditional-compile-remove(end-of-call-survey) */\nexport * from './Survey/SurveyTypes';\n/* @conditional-compile-remove(end-of-call-survey) */\nexport { _TagsSurvey } from './Survey/TagsSurvey/TagsSurvey';\n/* @conditional-compile-remove(end-of-call-survey) */\nexport type { _TagsSurveyProps, _TagsSurveyStrings, _IssueCategory, _SurveyTag } from './Survey/TagsSurvey/TagsSurvey';\n/* @conditional-compile-remove(PSTN-calls) */\nexport { HoldButton } from './HoldButton';\n/* @conditional-compile-remove(PSTN-calls) */\nexport type { HoldButtonProps, HoldButtonStrings } from './HoldButton';\n\nexport { _LocalVideoTile } from './LocalVideoTile';\nexport { _RemoteVideoTile } from './RemoteVideoTile';\nexport { _HighContrastAwareIcon } from './HighContrastAwareIcon';\nexport type { _HighContrastAwareIconProps } from './HighContrastAwareIcon';\n\nexport { UnsupportedBrowser } from './UnsupportedBrowser';\nexport type { UnsupportedBrowserStrings, UnsupportedBrowserProps } from './UnsupportedBrowser';\nexport { UnsupportedBrowserVersion } from './UnsupportedBrowserVersion';\nexport type { UnsupportedBrowserVersionStrings, UnsupportedBrowserVersionProps } from './UnsupportedBrowserVersion';\nexport { UnsupportedOperatingSystem } from './UnsupportedOperatingSystem';\nexport type { UnsupportedOperatingSystemStrings, UnsupportedOperatingSystemProps } from './UnsupportedOperatingSystem';\n\nexport { _TroubleshootingGuideErrorBar } from './TroubleshootingGuideErrorBar';\nexport type {\n _TroubleshootingGuideErrorBarStrings,\n _TroubleshootingGuideErrorBarProps\n} from './TroubleshootingGuideErrorBar';\n\nexport { _DevicePermissionDropdown } from './DevicePermissions/DevicePermissionDropdown';\nexport type {\n _DevicePermissionDropdownStrings,\n _DevicePermissionDropdownProps,\n _PermissionConstraints\n} from './DevicePermissions/DevicePermissionDropdown';\n\nexport { _VideoEffectsItem } from './VideoEffects/VideoEffectsItem';\nexport type { _VideoEffectsItemProps, _VideoEffectsItemStyles } from './VideoEffects/VideoEffectsItem';\nexport {\n _VideoEffectsItemNoBackground,\n _VideoEffectsItemBlur,\n _VideoEffectsItemAddImage\n} from './VideoEffects/PresetVideoEffectsItems';\n\nexport { _VideoBackgroundEffectsPicker } from './VideoEffects/VideoBackgroundEffectsPicker';\nexport type {\n _VideoBackgroundEffectsPickerProps,\n _VideoBackgroundEffectChoiceOption,\n _VideoBackgroundEffectsPickerStyles\n} from './VideoEffects/VideoBackgroundEffectsPicker';\n\nexport type { VerticalGalleryStyles, VerticalGalleryStrings, VerticalGalleryControlBarStyles } from './VerticalGallery';\n/* @conditional-compile-remove(close-captions) */\nexport * from './CaptionsBanner';\n/* @conditional-compile-remove(close-captions) */\nexport * from './Caption';\n/* @conditional-compile-remove(close-captions) */\nexport * from './StartCaptionsButton';\n/* @conditional-compile-remove(close-captions) */\nexport * from './CaptionsSettingsModal';\n"]}
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../react-components/src/components/index.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAGpD,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAGtC,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAG1C,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,0CAA0C;AAC1C,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAEnD,gDAAgD;AAChD,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAK9C,mDAAmD;AACnD,OAAO,EAAE,eAAe,EAAE,MAAM,kCAAkC,CAAC;AACnE,qHAAqH;AACrH,mDAAmD;AACnD,OAAO,EAAE,qCAAqC,EAAE,MAAM,qDAAqD,CAAC;AA0B5G,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAGlE,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAYhD,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAI5C,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAGpD,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAWpD,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAGxC,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAe9C,OAAO,EAAE,2BAA2B,EAAE,MAAM,0BAA0B,CA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;AAG5C,qDAAqD;AACrD,OAAO,EAAE,WAAW,EAAE,MAAM,gCAAgC,CAAC;AAG7D,qDAAqD;AACrD,cAAc,sBAAsB,CAAC;AACrC,qDAAqD;AACrD,OAAO,EAAE,WAAW,EAAE,MAAM,gCAAgC,CAAC;AAG7D,6CAA6C;AAC7C,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAI1C,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AACnD,OAAO,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AACrD,OAAO,EAAE,sBAAsB,EAAE,MAAM,yBAAyB,CAAC;AAGjE,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAE1D,OAAO,EAAE,yBAAyB,EAAE,MAAM,6BAA6B,CAAC;AAExE,OAAO,EAAE,0BAA0B,EAAE,MAAM,8BAA8B,CAAC;AAG1E,OAAO,EAAE,6BAA6B,EAAE,MAAM,gCAAgC,CAAC;AAM/E,OAAO,EAAE,yBAAyB,EAAE,MAAM,8CAA8C,CAAC;AAOzF,OAAO,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAC;AAEpE,OAAO,EACL,6BAA6B,EAC7B,qBAAqB,EACrB,yBAAyB,EAC1B,MAAM,wCAAwC,CAAC;AAEhD,OAAO,EAAE,6BAA6B,EAAE,MAAM,6CAA6C,CAAC;AAQ5F,iDAAiD;AACjD,cAAc,kBAAkB,CAAC;AACjC,iDAAiD;AACjD,cAAc,WAAW,CAAC;AAC1B,iDAAiD;AACjD,cAAc,uBAAuB,CAAC;AACtC,iDAAiD;AACjD,cAAc,yBAAyB,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nexport { TypingIndicator } from './TypingIndicator';\nexport type { TypingIndicatorProps, TypingIndicatorStrings, TypingIndicatorStylesProps } from './TypingIndicator';\n\nexport { ErrorBar } from './ErrorBar';\nexport type { ActiveErrorMessage, ErrorBarProps, ErrorBarStrings, ErrorType } from './ErrorBar';\n\nexport { GridLayout } from './GridLayout';\nexport type { GridLayoutProps, GridLayoutStyles } from './GridLayout';\n\nexport { SendBox } from './SendBox';\n/* @conditional-compile-remove(mention) */\nexport { _MentionPopover } from './MentionPopover';\n\n/* @conditional-compile-remove(image-overlay) */\nexport { ImageOverlay } from './ImageOverlay';\n/* @conditional-compile-remove(image-overlay) */\nexport type { ImageOverlayStrings } from './ImageOverlay';\nexport type { SendBoxProps, SendBoxStrings, SendBoxStylesProps } from './SendBox';\n\n/* @conditional-compile-remove(rich-text-editor) */\nexport { RichTextSendBox } from './RichTextEditor/RichTextSendBox';\n// TODO: This component is exported only for testing purposes. Remove this when this component is added to composites\n/* @conditional-compile-remove(rich-text-editor) */\nexport { ChatMessageComponentAsRichTextEditBox } from './ChatMessage/ChatMessageComponentAsRichTextEditBox';\n// TODO: This component is exported only for testing purposes. Remove this when this component is added to composites\n/* @conditional-compile-remove(rich-text-editor) */\nexport type { ChatMessageComponentAsRichTextEditBoxProps } from './ChatMessage/ChatMessageComponentAsRichTextEditBox';\n/* @conditional-compile-remove(rich-text-editor) */\nexport type { RichTextSendBoxProps, RichTextSendBoxStrings } from './RichTextEditor/RichTextSendBox';\n\n/* @conditional-compile-remove(mention) */\nexport type {\n _MentionPopoverProps,\n MentionLookupOptions,\n MentionDisplayOptions,\n MentionOptions,\n Mention,\n MentionPopoverStrings\n} from './MentionPopover';\n\n/* @conditional-compile-remove(image-overlay) */\nexport type { ImageOverlayProps } from './ImageOverlay';\n\n/* @conditional-compile-remove(image-overlay) */\nexport type { InlineImageOptions, InlineImage } from './ChatMessage/ChatMessageContent';\n\n/* @conditional-compile-remove(file-sharing) */\nexport type { ActiveFileUpload } from './FileUploadCards';\n\nexport { MessageStatusIndicator } from './MessageStatusIndicator';\nexport type { MessageStatusIndicatorProps, MessageStatusIndicatorStrings } from './MessageStatusIndicator';\n\nexport { MessageThread } from './MessageThread';\nexport type {\n MessageProps,\n MessageThreadProps,\n MessageThreadStrings,\n MessageThreadStyles,\n JumpToNewMessageButtonProps,\n MessageRenderer,\n UpdateMessageCallback,\n CancelEditCallback\n} from './MessageThread';\n\nexport { StreamMedia } from './StreamMedia';\nexport type { StreamMediaProps } from './StreamMedia';\nexport type { LoadingState } from './StreamMedia';\n\nexport { ParticipantItem } from './ParticipantItem';\nexport type { ParticipantItemProps, ParticipantItemStrings, ParticipantItemStyles } from './ParticipantItem';\n\nexport { ParticipantList } from './ParticipantList';\nexport type {\n ParticipantListItemStyles,\n ParticipantListProps,\n ParticipantListStyles,\n ParticipantMenuItemsCallback\n} from './ParticipantList';\n\n/* @conditional-compile-remove(total-participant-count) */\nexport type { ParticipantListStrings } from './ParticipantList';\n\nexport { Announcer } from './Announcer';\nexport type { AnnouncerProps } from './Announcer';\n\nexport { VideoGallery } from './VideoGallery';\nexport type {\n VideoGalleryProps,\n VideoGalleryStrings,\n VideoGalleryStyles,\n VideoGalleryLayout,\n VideoTileContextualMenuProps,\n VideoTileDrawerMenuProps\n} from './VideoGallery';\n/* @conditional-compile-remove(vertical-gallery) */\nexport type { OverflowGalleryPosition } from './VideoGallery';\n/* @conditional-compile-remove(click-to-call) */ /* @conditional-compile-remove(rooms) */\nexport type { LocalVideoTileSize } from './VideoGallery';\nexport type { HorizontalGalleryStyles } from './HorizontalGallery';\n\nexport { LocalVideoCameraCycleButton } from './LocalVideoCameraButton';\nexport type { LocalVideoCameraCycleButtonProps } from './LocalVideoCameraButton';\n\nexport { CameraButton } from './CameraButton';\nexport type {\n CameraButtonContextualMenuStyles,\n CameraButtonProps,\n CameraButtonStrings,\n CameraButtonStyles\n} from './CameraButton';\n\nexport { ControlBar } from './ControlBar';\nexport type { ControlBarProps, ControlBarLayout } from './ControlBar';\n\nexport { ControlBarButton } from './ControlBarButton';\nexport type { ControlBarButtonProps, ControlBarButtonStrings, ControlBarButtonStyles } from './ControlBarButton';\n\nexport { EndCallButton } from './EndCallButton';\nexport type { EndCallButtonProps, EndCallButtonStrings } from './EndCallButton';\n\nexport { MicrophoneButton } from './MicrophoneButton';\nexport type {\n MicrophoneButtonStyles,\n MicrophoneButtonContextualMenuStyles,\n MicrophoneButtonProps,\n MicrophoneButtonStrings\n} from './MicrophoneButton';\n\nexport { DevicesButton, generateDefaultDeviceMenuProps as _generateDefaultDeviceMenuProps } from './DevicesButton';\nexport type {\n OptionsDevice,\n DevicesButtonProps,\n DevicesButtonStrings,\n DevicesButtonStyles,\n DevicesButtonContextualMenuStyles,\n DeviceMenuProps as _DeviceMenuProps,\n DeviceMenuStrings as _DeviceMenuStrings,\n DeviceMenuStyles as _DeviceMenuStyles\n} from './DevicesButton';\n\n/* @conditional-compile-remove(call-readiness) */\nexport {\n CameraAndMicrophoneSitePermissions,\n MicrophoneSitePermissions,\n CameraSitePermissions\n} from './DevicePermissions/SitePermissions';\n/* @conditional-compile-remove(call-readiness) */\nexport type { SitePermissionsStrings, SitePermissionsStyles } from './DevicePermissions/SitePermissionsScaffolding';\n/* @conditional-compile-remove(call-readiness) */\nexport type {\n CameraAndMicrophoneSitePermissionsStrings,\n CameraAndMicrophoneSitePermissionsProps,\n CameraSitePermissionsStrings,\n CameraSitePermissionsProps,\n CommonSitePermissionsProps,\n MicrophoneSitePermissionsStrings,\n MicrophoneSitePermissionsProps\n} from './DevicePermissions/SitePermissions';\n/* @conditional-compile-remove(call-readiness) */\nexport { BrowserPermissionDenied } from './DevicePermissions/BrowserPermissionDenied';\n/* @conditional-compile-remove(call-readiness) */\nexport type {\n BrowserPermissionDeniedStrings,\n BrowserPermissionDeniedStyles,\n BrowserPermissionDeniedProps\n} from './DevicePermissions/BrowserPermissionDenied';\n/* @conditional-compile-remove(call-readiness) */\nexport { BrowserPermissionDeniedIOS } from './DevicePermissions/BrowserPermissionDeniedIOS';\n/* @conditional-compile-remove(call-readiness) */\nexport type {\n BrowserPermissionDeniedIOSStrings,\n BrowserPermissionDeniedIOSProps\n} from './DevicePermissions/BrowserPermissionDeniedIOS';\n\nexport { ParticipantsButton } from './ParticipantsButton';\nexport type {\n ParticipantsButtonContextualMenuStyles,\n ParticipantsButtonProps,\n ParticipantsButtonStrings,\n ParticipantsButtonStyles\n} from './ParticipantsButton';\n\nexport { ScreenShareButton } from './ScreenShareButton';\nexport type { ScreenShareButtonProps, ScreenShareButtonStrings } from './ScreenShareButton';\n\n/* @conditional-compile-remove(raise-hand) */\nexport { RaiseHandButton } from './RaiseHandButton';\n/* @conditional-compile-remove(raise-hand) */\nexport type { RaiseHandButtonProps, RaiseHandButtonStrings } from './RaiseHandButton';\n/* @conditional-compile-remove(reaction) */\nexport { ReactionButton } from './ReactionButton';\n/* @conditional-compile-remove(reaction) */\nexport type { ReactionButtonProps, ReactionButtonStrings } from './ReactionButton';\nexport { VideoTile } from './VideoTile';\nexport type { VideoTileProps, VideoTileStylesProps } from './VideoTile';\n/* @conditional-compile-remove(PSTN-calls) */\nexport type { VideoTileStrings } from './VideoTile';\n\nexport { _PictureInPictureInPicture } from './PictureInPictureInPicture/PictureInPictureInPicture';\nexport type {\n _PictureInPictureInPictureProps,\n _PictureInPictureInPictureStrings\n} from './PictureInPictureInPicture/PictureInPictureInPicture';\nexport type {\n _PictureInPictureInPictureTileProps,\n _TileOrientation\n} from './PictureInPictureInPicture/PictureInPictureInPictureTile';\n\nexport * from './Drawer';\n/* @conditional-compile-remove(file-sharing) */\nexport type { SendBoxErrorBarError } from './SendBoxErrorBar';\nexport * from './FileCard';\nexport * from './FileCardGroup';\nexport * from './ModalClone/ModalClone';\nexport * from './FileDownloadCards';\nexport type { _FileUploadCardsStrings } from './FileUploadCards';\n\nexport { _useContainerHeight, _useContainerWidth } from './utils/responsive';\n\nexport { _ComplianceBanner } from './ComplianceBanner';\nexport type { _ComplianceBannerProps, _ComplianceBannerStrings } from './ComplianceBanner';\nexport { Dialpad } from './Dialpad/Dialpad';\nexport type { DialpadProps, DialpadStrings, DialpadStyles, DtmfTone } from './Dialpad/Dialpad';\nexport type { DialpadMode, LongPressTrigger } from './Dialpad/Dialpad';\n/* @conditional-compile-remove(end-of-call-survey) */\nexport { _StarSurvey } from './Survey/StarSurvey/StarSurvey';\n/* @conditional-compile-remove(end-of-call-survey) */\nexport type { _StarSurveyProps, _StarSurveyStrings } from './Survey/StarSurvey/StarSurvey';\n/* @conditional-compile-remove(end-of-call-survey) */\nexport * from './Survey/SurveyTypes';\n/* @conditional-compile-remove(end-of-call-survey) */\nexport { _TagsSurvey } from './Survey/TagsSurvey/TagsSurvey';\n/* @conditional-compile-remove(end-of-call-survey) */\nexport type { _TagsSurveyProps, _TagsSurveyStrings, _IssueCategory, _SurveyTag } from './Survey/TagsSurvey/TagsSurvey';\n/* @conditional-compile-remove(PSTN-calls) */\nexport { HoldButton } from './HoldButton';\n/* @conditional-compile-remove(PSTN-calls) */\nexport type { HoldButtonProps, HoldButtonStrings } from './HoldButton';\n\nexport { _LocalVideoTile } from './LocalVideoTile';\nexport { _RemoteVideoTile } from './RemoteVideoTile';\nexport { _HighContrastAwareIcon } from './HighContrastAwareIcon';\nexport type { _HighContrastAwareIconProps } from './HighContrastAwareIcon';\n\nexport { UnsupportedBrowser } from './UnsupportedBrowser';\nexport type { UnsupportedBrowserStrings, UnsupportedBrowserProps } from './UnsupportedBrowser';\nexport { UnsupportedBrowserVersion } from './UnsupportedBrowserVersion';\nexport type { UnsupportedBrowserVersionStrings, UnsupportedBrowserVersionProps } from './UnsupportedBrowserVersion';\nexport { UnsupportedOperatingSystem } from './UnsupportedOperatingSystem';\nexport type { UnsupportedOperatingSystemStrings, UnsupportedOperatingSystemProps } from './UnsupportedOperatingSystem';\n\nexport { _TroubleshootingGuideErrorBar } from './TroubleshootingGuideErrorBar';\nexport type {\n _TroubleshootingGuideErrorBarStrings,\n _TroubleshootingGuideErrorBarProps\n} from './TroubleshootingGuideErrorBar';\n\nexport { _DevicePermissionDropdown } from './DevicePermissions/DevicePermissionDropdown';\nexport type {\n _DevicePermissionDropdownStrings,\n _DevicePermissionDropdownProps,\n _PermissionConstraints\n} from './DevicePermissions/DevicePermissionDropdown';\n\nexport { _VideoEffectsItem } from './VideoEffects/VideoEffectsItem';\nexport type { _VideoEffectsItemProps, _VideoEffectsItemStyles } from './VideoEffects/VideoEffectsItem';\nexport {\n _VideoEffectsItemNoBackground,\n _VideoEffectsItemBlur,\n _VideoEffectsItemAddImage\n} from './VideoEffects/PresetVideoEffectsItems';\n\nexport { _VideoBackgroundEffectsPicker } from './VideoEffects/VideoBackgroundEffectsPicker';\nexport type {\n _VideoBackgroundEffectsPickerProps,\n _VideoBackgroundEffectChoiceOption,\n _VideoBackgroundEffectsPickerStyles\n} from './VideoEffects/VideoBackgroundEffectsPicker';\n\nexport type { VerticalGalleryStyles, VerticalGalleryStrings, VerticalGalleryControlBarStyles } from './VerticalGallery';\n/* @conditional-compile-remove(close-captions) */\nexport * from './CaptionsBanner';\n/* @conditional-compile-remove(close-captions) */\nexport * from './Caption';\n/* @conditional-compile-remove(close-captions) */\nexport * from './StartCaptionsButton';\n/* @conditional-compile-remove(close-captions) */\nexport * from './CaptionsSettingsModal';\n"]}
|
package/dist/dist-esm/react-components/src/components/styles/ChatMessageComponent.styles.d.ts
CHANGED
@@ -43,6 +43,10 @@ export declare const chatMessageMenuStyle: string;
|
|
43
43
|
* @private
|
44
44
|
*/
|
45
45
|
export declare const useChatMessageEditContainerStyles: () => Record<"body" | "bodyAttached" | "bodyError" | "bodyDefault", string>;
|
46
|
+
/**
|
47
|
+
* @private
|
48
|
+
*/
|
49
|
+
export declare const useChatMessageRichTextEditContainerStyles: () => Record<"body" | "bodyAttached", string>;
|
46
50
|
/**
|
47
51
|
* Styles that can be applied to ensure flyout items have the minimum touch target size.
|
48
52
|
*
|
@@ -115,6 +115,16 @@ export const useChatMessageEditContainerStyles = makeStyles({
|
|
115
115
|
bodyError: Object.assign({}, shorthands.borderColor(errorTextColor)),
|
116
116
|
bodyDefault: Object.assign(Object.assign({}, shorthands.borderColor(tokens.colorNeutralStrokeAccessible)), { '&:hover, &:active, &:focus, &:focus-within': Object.assign({}, shorthands.borderColor(tokens.colorCompoundBrandStroke)) })
|
117
117
|
});
|
118
|
+
/**
|
119
|
+
* @private
|
120
|
+
*/
|
121
|
+
export const useChatMessageRichTextEditContainerStyles = makeStyles({
|
122
|
+
body: Object.assign(Object.assign(Object.assign(Object.assign({}, shorthands.padding(0)), { backgroundColor: 'transparent' }), shorthands.margin('1.25rem', 0, 0, 0)), { width: '100%' }),
|
123
|
+
bodyAttached: {
|
124
|
+
marginTop: '0.125rem',
|
125
|
+
marginBottom: 0
|
126
|
+
}
|
127
|
+
});
|
118
128
|
/**
|
119
129
|
* Styles that can be applied to ensure flyout items have the minimum touch target size.
|
120
130
|
*
|
package/dist/dist-esm/react-components/src/components/styles/ChatMessageComponent.styles.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"ChatMessageComponent.styles.js","sourceRoot":"","sources":["../../../../../../../react-components/src/components/styles/ChatMessageComponent.styles.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EACL,WAAW,EAEX,WAAW,EAKZ,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,QAAQ,EAAE,sCAAgC;AACnD,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAC;AAC5E,OAAO,EACL,wCAAwC,EACxC,sCAAsC,EACvC,MAAM,0BAA0B,CAAC;AAElC,MAAM,+BAA+B,GAAG,CAAC,CAAC;AAC1C,MAAM,cAAc,GAAG,kBAAkB,CAAC;AAE1C;;GAEG;AACH,MAAM,CAAC,MAAM,cAAc,GAAW;IACpC,KAAK,EAAE;QACL,KAAK,EAAE,GAAG;QACV,IAAI,EAAE,MAAM;QACZ,GAAG,EAAE,SAAS;QACd,MAAM,EAAE,MAAM;QACd,QAAQ,EAAE,UAAU;KACrB;IACD,KAAK,EAAE;QACL,MAAM,EAAE,GAAG;QACX,OAAO,EAAE,GAAG;QACZ,MAAM,EAAE,GAAG;KACZ;CAC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port {\n mergeStyles,\n IStyle,\n FontWeights,\n Theme,\n IContextualMenuItemStyles,\n ITheme,\n IIconStyles\n} from '@fluentui/react';\nimport { _pxToRem } from '@internal/acs-ui-common';\nimport { makeStyles, shorthands, tokens } from '@fluentui/react-components';\nimport {\n defaultSendBoxInactiveBorderThicknessREM,\n defaultSendBoxActiveBorderThicknessREM\n} from '../styles/SendBox.styles';\n\nconst MINIMUM_TOUCH_TARGET_HEIGHT_REM = 3;\nconst errorTextColor = 'var(--errorText)';\n\n/**\n * @private\n */\nexport const chatActionsCSS: IStyle = {\n 'ul&': {\n right: '0',\n left: 'auto',\n top: '-1.2rem',\n bottom: 'auto',\n position: 'absolute'\n },\n '& a': {\n margin: '0',\n padding: '0',\n border: '0'\n }\n};\n\n/**\n * @private\n */\nexport const iconWrapperStyle = (theme: ITheme, isSubMenuOpen: boolean): IIconStyles => ({\n root: {\n margin: _pxToRem(3),\n // Show hover styles when the Edit/Delete menu is showing as this action button is still considered 'active'\n color: isSubMenuOpen ? theme.palette.black : theme.palette.neutralPrimary,\n strokeWidth: isSubMenuOpen ? _pxToRem(0.5) : _pxToRem(0),\n stroke: theme.palette.black,\n ':hover, :focus': {\n color: theme.palette.black,\n strokeWidth: _pxToRem(0.5)\n }\n }\n});\n\n/**\n * @private\n */\nexport const chatMessageDateStyle = mergeStyles({\n color: tokens.colorNeutralForeground2,\n fontWeight: FontWeights.regular,\n fontSize: '0.75rem'\n});\n\n/**\n * @private\n */\nexport const chatMessageAuthorStyle = mergeStyles({\n fontWeight: FontWeights.semibold,\n fontSize: '0.75rem'\n});\n\n/**\n * @private\n */\nexport const chatMessageEditedTagStyle = (theme: Theme): string =>\n mergeStyles({ fontWeight: FontWeights.semibold, color: theme.palette.neutralSecondary });\n\n/**\n * @private\n */\nexport const chatMessageFailedTagStyle = (theme: Theme): string =>\n mergeStyles({\n fontWeight: FontWeights.regular,\n color: theme.semanticColors.errorText,\n fontSize: theme.fonts.smallPlus.fontSize,\n lineHeight: '1rem'\n });\n\n/**\n * @private\n */\nexport const editChatMessageFailedTagStyle = mergeStyles({\n marginBottom: '0.5rem'\n});\n\n/**\n * @private\n */\nexport const chatMessageFailedTagStackItemStyle = mergeStyles({\n alignSelf: 'end'\n});\n\n/**\n * @private\n */\nexport const editChatMessageButtonsStackStyle = mergeStyles({\n padding: '0 0.5rem',\n marginTop: '-0.25rem'\n});\n\n/**\n * @private\n */\nexport const chatMessageMenuStyle = mergeStyles({\n minWidth: '8.5rem',\n height: 'max-content',\n cursor: 'pointer',\n overflow: 'hidden'\n});\n\n/**\n * @private\n */\nexport const useChatMessageEditContainerStyles = makeStyles({\n body: {\n ...shorthands.padding(0),\n backgroundColor: 'transparent',\n boxSizing: 'border-box',\n ...shorthands.border(`${defaultSendBoxInactiveBorderThicknessREM}rem`, 'solid'),\n ...shorthands.borderRadius(tokens.borderRadiusMedium),\n // The border thickness changes on hover, to prevent the border thickness change causing the\n // input box to shift we apply a margin to compensate. This margin is then removed on hover when the border is thicker.\n ...shorthands.margin('21px', '1px', '1px', '1px'),\n // Width should be updated on hover to include the border width change\n width: `calc(100% - ${defaultSendBoxActiveBorderThicknessREM}rem)`,\n '&:hover, &:active, &:focus, &:focus-within': {\n ...shorthands.borderWidth(`${defaultSendBoxActiveBorderThicknessREM}rem`),\n ...shorthands.margin('20px', 0, 0, 0),\n width: '100%'\n }\n },\n bodyAttached: {\n marginBottom: '1px',\n marginTop: '3px',\n // Width should be updated on hover to include the border width change\n width: `calc(100% - ${defaultSendBoxActiveBorderThicknessREM}rem)`,\n '&:hover, &:active, &:focus, &:focus-within': {\n marginTop: '2px',\n marginBottom: 0\n }\n },\n bodyError: {\n ...shorthands.borderColor(errorTextColor)\n },\n bodyDefault: {\n ...shorthands.borderColor(tokens.colorNeutralStrokeAccessible),\n '&:hover, &:active, &:focus, &:focus-within': {\n ...shorthands.borderColor(tokens.colorCompoundBrandStroke)\n }\n }\n});\n\n/**\n * Styles that can be applied to ensure flyout items have the minimum touch target size.\n *\n * @private\n */\nexport const menuItemIncreasedSizeStyles: IContextualMenuItemStyles = {\n root: {\n height: `${MINIMUM_TOUCH_TARGET_HEIGHT_REM}rem`,\n lineHeight: `${MINIMUM_TOUCH_TARGET_HEIGHT_REM}rem`,\n maxHeight: 'unset'\n },\n linkContent: {\n height: `${MINIMUM_TOUCH_TARGET_HEIGHT_REM}rem`,\n lineHeight: `${MINIMUM_TOUCH_TARGET_HEIGHT_REM}rem`,\n maxHeight: 'unset'\n },\n icon: {\n maxHeight: 'unset'\n }\n};\n\n/**\n * @private\n */\nexport const menuIconStyleSet = {\n root: {\n height: 'calc(100% - 8px)', // Adjust for the pixel margin Fluent applies\n width: '1.25rem'\n }\n};\n\n/**\n * @private\n */\nexport const menuSubIconStyleSet = {\n root: {\n height: 'unset',\n lineHeight: '100%',\n width: '1.25rem'\n }\n};\n"]}
|
1
|
+
{"version":3,"file":"ChatMessageComponent.styles.js","sourceRoot":"","sources":["../../../../../../../react-components/src/components/styles/ChatMessageComponent.styles.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EACL,WAAW,EAEX,WAAW,EAKZ,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,QAAQ,EAAE,sCAAgC;AACnD,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAC;AAC5E,OAAO,EACL,wCAAwC,EACxC,sCAAsC,EACvC,MAAM,0BAA0B,CAAC;AAElC,MAAM,+BAA+B,GAAG,CAAC,CAAC;AAC1C,MAAM,cAAc,GAAG,kBAAkB,CAAC;AAE1C;;GAEG;AACH,MAAM,CAAC,MAAM,cAAc,GAAW;IACpC,KAAK,EAAE;QACL,KAAK,EAAE,GAAG;QACV,IAAI,EAAE,MAAM;QACZ,GAAG,EAAE,SAAS;QACd,MAAM,EAAE,MAAM;QACd,QAAQ,EAAE,UAAU;KACrB;IACD,KAAK,EAAE;QACL,MAAM,EAAE,GAAG;QACX,OAAO,EA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KACnB;CACF,CAAC;AAEF;;GAEG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG;IAC9B,IAAI,EAAE;QACJ,MAAM,EAAE,kBAAkB,EAAE,6CAA6C;QACzE,KAAK,EAAE,SAAS;KACjB;CACF,CAAC;AAEF;;GAEG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG;IACjC,IAAI,EAAE;QACJ,MAAM,EAAE,OAAO;QACf,UAAU,EAAE,MAAM;QAClB,KAAK,EAAE,SAAS;KACjB;CACF,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport {\n mergeStyles,\n IStyle,\n FontWeights,\n Theme,\n IContextualMenuItemStyles,\n ITheme,\n IIconStyles\n} from '@fluentui/react';\nimport { _pxToRem } from '@internal/acs-ui-common';\nimport { makeStyles, shorthands, tokens } from '@fluentui/react-components';\nimport {\n defaultSendBoxInactiveBorderThicknessREM,\n defaultSendBoxActiveBorderThicknessREM\n} from '../styles/SendBox.styles';\n\nconst MINIMUM_TOUCH_TARGET_HEIGHT_REM = 3;\nconst errorTextColor = 'var(--errorText)';\n\n/**\n * @private\n */\nexport const chatActionsCSS: IStyle = {\n 'ul&': {\n right: '0',\n left: 'auto',\n top: '-1.2rem',\n bottom: 'auto',\n position: 'absolute'\n },\n '& a': {\n margin: '0',\n padding: '0',\n border: '0'\n }\n};\n\n/**\n * @private\n */\nexport const iconWrapperStyle = (theme: ITheme, isSubMenuOpen: boolean): IIconStyles => ({\n root: {\n margin: _pxToRem(3),\n // Show hover styles when the Edit/Delete menu is showing as this action button is still considered 'active'\n color: isSubMenuOpen ? theme.palette.black : theme.palette.neutralPrimary,\n strokeWidth: isSubMenuOpen ? _pxToRem(0.5) : _pxToRem(0),\n stroke: theme.palette.black,\n ':hover, :focus': {\n color: theme.palette.black,\n strokeWidth: _pxToRem(0.5)\n }\n }\n});\n\n/**\n * @private\n */\nexport const chatMessageDateStyle = mergeStyles({\n color: tokens.colorNeutralForeground2,\n fontWeight: FontWeights.regular,\n fontSize: '0.75rem'\n});\n\n/**\n * @private\n */\nexport const chatMessageAuthorStyle = mergeStyles({\n fontWeight: FontWeights.semibold,\n fontSize: '0.75rem'\n});\n\n/**\n * @private\n */\nexport const chatMessageEditedTagStyle = (theme: Theme): string =>\n mergeStyles({ fontWeight: FontWeights.semibold, color: theme.palette.neutralSecondary });\n\n/**\n * @private\n */\nexport const chatMessageFailedTagStyle = (theme: Theme): string =>\n mergeStyles({\n fontWeight: FontWeights.regular,\n color: theme.semanticColors.errorText,\n fontSize: theme.fonts.smallPlus.fontSize,\n lineHeight: '1rem'\n });\n\n/**\n * @private\n */\nexport const editChatMessageFailedTagStyle = mergeStyles({\n marginBottom: '0.5rem'\n});\n\n/**\n * @private\n */\nexport const chatMessageFailedTagStackItemStyle = mergeStyles({\n alignSelf: 'end'\n});\n\n/**\n * @private\n */\nexport const editChatMessageButtonsStackStyle = mergeStyles({\n padding: '0 0.5rem',\n marginTop: '-0.25rem'\n});\n\n/**\n * @private\n */\nexport const chatMessageMenuStyle = mergeStyles({\n minWidth: '8.5rem',\n height: 'max-content',\n cursor: 'pointer',\n overflow: 'hidden'\n});\n\n/**\n * @private\n */\nexport const useChatMessageEditContainerStyles = makeStyles({\n body: {\n ...shorthands.padding(0),\n backgroundColor: 'transparent',\n boxSizing: 'border-box',\n ...shorthands.border(`${defaultSendBoxInactiveBorderThicknessREM}rem`, 'solid'),\n ...shorthands.borderRadius(tokens.borderRadiusMedium),\n // The border thickness changes on hover, to prevent the border thickness change causing the\n // input box to shift we apply a margin to compensate. This margin is then removed on hover when the border is thicker.\n ...shorthands.margin('21px', '1px', '1px', '1px'),\n // Width should be updated on hover to include the border width change\n width: `calc(100% - ${defaultSendBoxActiveBorderThicknessREM}rem)`,\n '&:hover, &:active, &:focus, &:focus-within': {\n ...shorthands.borderWidth(`${defaultSendBoxActiveBorderThicknessREM}rem`),\n ...shorthands.margin('20px', 0, 0, 0),\n width: '100%'\n }\n },\n bodyAttached: {\n marginBottom: '1px',\n marginTop: '3px',\n // Width should be updated on hover to include the border width change\n width: `calc(100% - ${defaultSendBoxActiveBorderThicknessREM}rem)`,\n '&:hover, &:active, &:focus, &:focus-within': {\n marginTop: '2px',\n marginBottom: 0\n }\n },\n bodyError: {\n ...shorthands.borderColor(errorTextColor)\n },\n bodyDefault: {\n ...shorthands.borderColor(tokens.colorNeutralStrokeAccessible),\n '&:hover, &:active, &:focus, &:focus-within': {\n ...shorthands.borderColor(tokens.colorCompoundBrandStroke)\n }\n }\n});\n\n/**\n * @private\n */\nexport const useChatMessageRichTextEditContainerStyles = makeStyles({\n body: {\n ...shorthands.padding(0),\n backgroundColor: 'transparent',\n ...shorthands.margin('1.25rem', 0, 0, 0),\n width: '100%'\n },\n bodyAttached: {\n marginTop: '0.125rem',\n marginBottom: 0\n }\n});\n\n/**\n * Styles that can be applied to ensure flyout items have the minimum touch target size.\n *\n * @private\n */\nexport const menuItemIncreasedSizeStyles: IContextualMenuItemStyles = {\n root: {\n height: `${MINIMUM_TOUCH_TARGET_HEIGHT_REM}rem`,\n lineHeight: `${MINIMUM_TOUCH_TARGET_HEIGHT_REM}rem`,\n maxHeight: 'unset'\n },\n linkContent: {\n height: `${MINIMUM_TOUCH_TARGET_HEIGHT_REM}rem`,\n lineHeight: `${MINIMUM_TOUCH_TARGET_HEIGHT_REM}rem`,\n maxHeight: 'unset'\n },\n icon: {\n maxHeight: 'unset'\n }\n};\n\n/**\n * @private\n */\nexport const menuIconStyleSet = {\n root: {\n height: 'calc(100% - 8px)', // Adjust for the pixel margin Fluent applies\n width: '1.25rem'\n }\n};\n\n/**\n * @private\n */\nexport const menuSubIconStyleSet = {\n root: {\n height: 'unset',\n lineHeight: '100%',\n width: '1.25rem'\n }\n};\n"]}
|
@@ -1,3 +1,4 @@
|
|
1
|
+
import { IStyle } from '@fluentui/react';
|
1
2
|
/**
|
2
3
|
* @private
|
3
4
|
*/
|
@@ -10,13 +11,18 @@ export declare const editingButtonStyle: string;
|
|
10
11
|
* @private
|
11
12
|
*/
|
12
13
|
export declare const inputBoxIcon: string;
|
14
|
+
/**
|
15
|
+
* @private
|
16
|
+
*/
|
17
|
+
export declare const richTextEditBoxActionButtonIcon: string;
|
18
|
+
/**
|
19
|
+
* @private
|
20
|
+
*/
|
21
|
+
export declare const editBoxWidthStyles: IStyle;
|
13
22
|
/**
|
14
23
|
* @private
|
15
24
|
*/
|
16
25
|
export declare const editBoxStyleSet: {
|
17
|
-
root:
|
18
|
-
minWidth: string;
|
19
|
-
maxWidth: string;
|
20
|
-
};
|
26
|
+
root: import("@fluentui/react").IRawStyle;
|
21
27
|
};
|
22
28
|
//# sourceMappingURL=EditBox.styles.d.ts.map
|
@@ -1,6 +1,7 @@
|
|
1
1
|
// Copyright (c) Microsoft Corporation.
|
2
2
|
// Licensed under the MIT License.
|
3
3
|
import { mergeStyles } from '@fluentui/react';
|
4
|
+
import { editorTextBoxButtonStyle } from './SendBox.styles';
|
4
5
|
/**
|
5
6
|
* @private
|
6
7
|
*/
|
@@ -29,10 +30,22 @@ export const inputBoxIcon = mergeStyles({
|
|
29
30
|
/**
|
30
31
|
* @private
|
31
32
|
*/
|
32
|
-
export const
|
33
|
-
|
34
|
-
|
35
|
-
maxWidth: '100%'
|
33
|
+
export const richTextEditBoxActionButtonIcon = mergeStyles(editorTextBoxButtonStyle, {
|
34
|
+
'&:hover svg': {
|
35
|
+
stroke: 'currentColor'
|
36
36
|
}
|
37
|
+
});
|
38
|
+
/**
|
39
|
+
* @private
|
40
|
+
*/
|
41
|
+
export const editBoxWidthStyles = {
|
42
|
+
minWidth: '6.25rem',
|
43
|
+
maxWidth: '100%'
|
44
|
+
};
|
45
|
+
/**
|
46
|
+
* @private
|
47
|
+
*/
|
48
|
+
export const editBoxStyleSet = {
|
49
|
+
root: editBoxWidthStyles
|
37
50
|
};
|
38
51
|
//# sourceMappingURL=EditBox.styles.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"EditBox.styles.js","sourceRoot":"","sources":["../../../../../../../react-components/src/components/styles/EditBox.styles.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,
|
1
|
+
{"version":3,"file":"EditBox.styles.js","sourceRoot":"","sources":["../../../../../../../react-components/src/components/styles/EditBox.styles.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EAAU,WAAW,EAAE,MAAM,iBAAiB,CAAC;AACtD,OAAO,EAAE,wBAAwB,EAAE,MAAM,kBAAkB,CAAC;AAE5D;;GAEG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG,WAAW,CAAC;IACtC,SAAS,EAAE,WAAW;IACtB,YAAY,EAAE,WAAW;CAC1B,CAAC,CAAC;AAEH;;GAEG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG,WAAW,CAAC;IAC5C,MAAM,EAAE,GAAG;IACX,KAAK,EAAE,UAAU;IACjB,MAAM,EAAE,UAAU;IAClB,OAAO,EAAE,gBAAgB;CAC1B,CAAC,CAAC;AAEH;;GAEG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG,WAAW,CAAC;IACtC,MAAM,EAAE,MAAM;IACd,aAAa,EAAE;QACb,MAAM,EAAE,cAAc;KACvB;CACF,CAAC,CAAC;AACH;;GAEG;AACH,MAAM,CAAC,MAAM,+BAA+B,GAAG,WAAW,CAAC,wBAAwB,EAAE;IACnF,aAAa,EAAE;QACb,MAAM,EAAE,cAAc;KACvB;CACF,CAAC,CAAC;AAEH;;GAEG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAW;IACxC,QAAQ,EAAE,SAAS;IACnB,QAAQ,EAAE,MAAM;CACjB,CAAC;AAEF;;GAEG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG;IAC7B,IAAI,EAAE,kBAAkB;CACzB,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { IStyle, mergeStyles } from '@fluentui/react';\nimport { editorTextBoxButtonStyle } from './SendBox.styles';\n\n/**\n * @private\n */\nexport const editBoxStyle = mergeStyles({\n marginTop: '0.0875rem',\n marginBottom: '0.0875rem'\n});\n\n/**\n * @private\n */\nexport const editingButtonStyle = mergeStyles({\n margin: '0',\n width: '2.125rem',\n height: '2.125rem',\n padding: '0.375rem 0 0 0'\n});\n\n/**\n * @private\n */\nexport const inputBoxIcon = mergeStyles({\n margin: 'auto',\n '&:hover svg': {\n stroke: 'currentColor'\n }\n});\n/**\n * @private\n */\nexport const richTextEditBoxActionButtonIcon = mergeStyles(editorTextBoxButtonStyle, {\n '&:hover svg': {\n stroke: 'currentColor'\n }\n});\n\n/**\n * @private\n */\nexport const editBoxWidthStyles: IStyle = {\n minWidth: '6.25rem',\n maxWidth: '100%'\n};\n\n/**\n * @private\n */\nexport const editBoxStyleSet = {\n root: editBoxWidthStyles\n};\n"]}
|