@azure/communication-react 1.15.0-alpha-202404040013 → 1.15.0-alpha-202404050013
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/dist-cjs/communication-react/{ChatMessageComponentAsRichTextEditBox-ButXxDca.js → ChatMessageComponentAsRichTextEditBox-B3cXye-F.js} +2 -2
- package/dist/dist-cjs/communication-react/{ChatMessageComponentAsRichTextEditBox-ButXxDca.js.map → ChatMessageComponentAsRichTextEditBox-B3cXye-F.js.map} +1 -1
- package/dist/dist-cjs/communication-react/{index-BK44EyzL.js → index-C4BFVPuO.js} +68 -9
- package/dist/dist-cjs/communication-react/index-C4BFVPuO.js.map +1 -0
- package/dist/dist-cjs/communication-react/index.js +1 -1
- package/dist/dist-esm/acs-ui-common/src/telemetryVersion.js +1 -1
- package/dist/dist-esm/acs-ui-common/src/telemetryVersion.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/RichTextEditor/Buttons/Table/RichTextInsertTableButton.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/RichTextEditor/Buttons/Table/RichTextTableContextMenu.js +11 -2
- package/dist/dist-esm/react-components/src/components/RichTextEditor/Buttons/Table/RichTextTableContextMenu.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/RichTextEditor/Plugins/CopyPastePlugin.d.ts +16 -0
- package/dist/dist-esm/react-components/src/components/RichTextEditor/Plugins/CopyPastePlugin.js +36 -0
- package/dist/dist-esm/react-components/src/components/RichTextEditor/Plugins/CopyPastePlugin.js.map +1 -0
- package/dist/dist-esm/react-components/src/components/RichTextEditor/RichTextEditor.js +11 -1
- package/dist/dist-esm/react-components/src/components/RichTextEditor/RichTextEditor.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/VideoGallery/ParticipantVideoTileOverlay.js +2 -1
- package/dist/dist-esm/react-components/src/components/VideoGallery/ParticipantVideoTileOverlay.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/VideoGallery/RemoteContentShareReactionOverlay.js +2 -2
- package/dist/dist-esm/react-components/src/components/VideoGallery/RemoteContentShareReactionOverlay.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/styles/RichTextEditor.styles.d.ts +4 -0
- package/dist/dist-esm/react-components/src/components/styles/RichTextEditor.styles.js +6 -0
- package/dist/dist-esm/react-components/src/components/styles/RichTextEditor.styles.js.map +1 -1
- package/package.json +13 -12
- package/dist/dist-cjs/communication-react/index-BK44EyzL.js.map +0 -1
@@ -4,7 +4,7 @@ var react = require('@fluentui/react');
|
|
4
4
|
var reactChat = require('@fluentui-contrib/react-chat');
|
5
5
|
var reactComponents = require('@fluentui/react-components');
|
6
6
|
require('@azure/communication-common');
|
7
|
-
var index = require('./index-
|
7
|
+
var index = require('./index-C4BFVPuO.js');
|
8
8
|
var React = require('react');
|
9
9
|
require('reselect');
|
10
10
|
require('@azure/communication-calling');
|
@@ -119,4 +119,4 @@ const ChatMessageComponentAsRichTextEditBox = (props) => {
|
|
119
119
|
};
|
120
120
|
|
121
121
|
exports.ChatMessageComponentAsRichTextEditBox = ChatMessageComponentAsRichTextEditBox;
|
122
|
-
//# sourceMappingURL=ChatMessageComponentAsRichTextEditBox-
|
122
|
+
//# sourceMappingURL=ChatMessageComponentAsRichTextEditBox-B3cXye-F.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"ChatMessageComponentAsRichTextEditBox-ButXxDca.js","sources":["../../../../react-components/src/components/ChatMessage/ChatMessageComponentAsRichTextEditBox.tsx"],"sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { mergeStyles, Stack } from '@fluentui/react';\nimport { ChatMyMessage } from '@fluentui-contrib/react-chat';\nimport { mergeClasses } from '@fluentui/react-components';\nimport { _formatString } from '@internal/acs-ui-common';\nimport { useTheme } from '../../theming/FluentThemeProvider';\nimport React, { useCallback, useEffect, useMemo, useState } from 'react';\nimport { editBoxWidthStyles, richTextEditBoxActionButtonIcon } from '../styles/EditBox.styles';\nimport { InputBoxButton } from '../InputBoxButton';\nimport { MessageThreadStrings } from '../MessageThread';\nimport { useChatMyMessageStyles } from '../styles/MessageThread.styles';\nimport { ChatMessage } from '../../types';\nimport { _AttachmentUploadCards } from '../AttachmentUploadCards';\n/* @conditional-compile-remove(attachment-upload) */\nimport { AttachmentMetadata } from '../../types/Attachment';\nimport { useChatMessageRichTextEditContainerStyles } from '../styles/ChatMessageComponent.styles';\nimport { MAXIMUM_LENGTH_OF_MESSAGE } from '../utils/SendBoxUtils';\nimport { getMessageState, onRenderCancelIcon, onRenderSubmitIcon } from '../utils/ChatMessageComponentAsEditBoxUtils';\n/* @conditional-compile-remove(attachment-upload) */\nimport { getMessageWithAttachmentMetadata } from '../utils/ChatMessageComponentAsEditBoxUtils';\nimport { RichTextEditorComponentRef } from '../RichTextEditor/RichTextEditor';\nimport { RichTextInputBoxComponent } from '../RichTextEditor/RichTextInputBoxComponent';\nimport { editBoxRichTextEditorStyle, richTextActionButtonsStyle } from '../styles/RichTextEditor.styles';\nimport { RichTextSendBoxErrors } from '../RichTextEditor/RichTextSendBoxErrors';\nimport { useLocale } from '../../localization';\n\n/** @beta */\nexport type ChatMessageComponentAsRichTextEditBoxProps = {\n onCancel?: (messageId: string) => void;\n onSubmit: (\n text: string,\n metadata?: Record<string, string>,\n options?: {\n /* @conditional-compile-remove(attachment-upload) */\n attachmentMetadata?: AttachmentMetadata[];\n }\n ) => void;\n message: ChatMessage;\n strings: MessageThreadStrings;\n};\n\n/**\n * @beta\n */\nexport const ChatMessageComponentAsRichTextEditBox = (\n props: ChatMessageComponentAsRichTextEditBoxProps\n): JSX.Element => {\n const { onCancel, onSubmit, strings, message } = props;\n\n const [textValue, setTextValue] = useState<string>(message.content || '');\n /* @conditional-compile-remove(attachment-upload) */\n const [attachmentMetadata, _] = React.useState(getMessageWithAttachmentMetadata(message));\n const editTextFieldRef = React.useRef<RichTextEditorComponentRef>(null);\n const theme = useTheme();\n const messageState = getMessageState(\n textValue,\n /* @conditional-compile-remove(attachment-upload) */ attachmentMetadata ?? []\n );\n const submitEnabled = messageState === 'OK';\n\n const editContainerStyles = useChatMessageRichTextEditContainerStyles();\n const chatMyMessageStyles = useChatMyMessageStyles();\n const locale = useLocale().strings;\n\n // TODO: Check if the focus is needed, if so use `focusOnInit` prop\n // for Rooster component instead as this sets focus too early\n useEffect(() => {\n editTextFieldRef.current?.focus();\n }, []);\n\n const setText = (newValue?: string): void => {\n setTextValue(newValue ?? '');\n };\n\n const textTooLongMessage =\n messageState === 'too long'\n ? _formatString(strings.editBoxTextLimit, { limitNumber: `${MAXIMUM_LENGTH_OF_MESSAGE}` })\n : undefined;\n\n const iconClassName = useCallback(\n (isHover: boolean) => {\n const color = isHover ? theme.palette.accent : theme.palette.neutralSecondary;\n return mergeStyles(richTextEditBoxActionButtonIcon, { color });\n },\n [theme.palette.accent, theme.palette.neutralSecondary]\n );\n\n const onRenderThemedCancelIcon = useCallback(\n (isHover: boolean) => {\n return onRenderCancelIcon(iconClassName(isHover));\n },\n [iconClassName]\n );\n\n const onRenderThemedSubmitIcon = useCallback(\n (isHover: boolean) => {\n return onRenderSubmitIcon(iconClassName(isHover));\n },\n [iconClassName]\n );\n\n const actionButtons = useMemo(() => {\n return (\n <Stack horizontal>\n <InputBoxButton\n className={richTextActionButtonsStyle}\n ariaLabel={strings.editBoxCancelButton}\n tooltipContent={strings.editBoxCancelButton}\n onRenderIcon={onRenderThemedCancelIcon}\n onClick={() => {\n onCancel && onCancel(message.messageId);\n }}\n id={'dismissIconWrapper'}\n />\n <InputBoxButton\n className={richTextActionButtonsStyle}\n ariaLabel={strings.editBoxSubmitButton}\n tooltipContent={strings.editBoxSubmitButton}\n onRenderIcon={onRenderThemedSubmitIcon}\n onClick={(e) => {\n submitEnabled &&\n onSubmit(\n textValue,\n message.metadata,\n /* @conditional-compile-remove(attachment-upload) */ {\n attachmentMetadata\n }\n );\n e.stopPropagation();\n }}\n id={'submitIconWrapper'}\n />\n </Stack>\n );\n }, [\n /* @conditional-compile-remove(attachment-upload) */ attachmentMetadata,\n message.messageId,\n message.metadata,\n onCancel,\n onRenderThemedCancelIcon,\n onRenderThemedSubmitIcon,\n onSubmit,\n strings.editBoxCancelButton,\n strings.editBoxSubmitButton,\n submitEnabled,\n textValue\n ]);\n const richTextLocaleStrings = useMemo(() => {\n /* @conditional-compile-remove(rich-text-editor) */\n return locale.richTextSendBox;\n return locale.sendBox;\n }, [/* @conditional-compile-remove(rich-text-editor) */ locale.richTextSendBox, locale.sendBox]);\n\n const getContent = (): JSX.Element => {\n return (\n <Stack className={mergeStyles(editBoxWidthStyles)}>\n <RichTextSendBoxErrors textTooLongMessage={textTooLongMessage} systemMessage={message.failureReason} />\n <RichTextInputBoxComponent\n placeholderText={strings.editBoxPlaceholderText}\n onChange={setText}\n editorComponentRef={editTextFieldRef}\n initialContent={message.content}\n strings={richTextLocaleStrings}\n disabled={false}\n actionComponents={actionButtons}\n richTextEditorStyleProps={editBoxRichTextEditorStyle}\n isHorizontalLayoutDisabled={true}\n />\n </Stack>\n );\n };\n\n const attached = message.attached === true ? 'center' : message.attached === 'bottom' ? 'bottom' : 'top';\n return (\n <ChatMyMessage\n attached={attached}\n root={{\n className: chatMyMessageStyles.root\n }}\n body={{\n className: mergeClasses(\n editContainerStyles.body,\n attached !== 'top' ? editContainerStyles.bodyAttached : undefined\n )\n }}\n >\n {getContent()}\n </ChatMyMessage>\n );\n};\n"],"names":["useState","getMessageWithAttachmentMetadata","useTheme","getMessageState","useChatMessageRichTextEditContainerStyles","useChatMyMessageStyles","useLocale","useEffect","_formatString","MAXIMUM_LENGTH_OF_MESSAGE","useCallback","mergeStyles","richTextEditBoxActionButtonIcon","onRenderCancelIcon","onRenderSubmitIcon","useMemo","Stack","InputBoxButton","richTextActionButtonsStyle","editBoxWidthStyles","RichTextSendBoxErrors","RichTextInputBoxComponent","editBoxRichTextEditorStyle","ChatMyMessage","mergeClasses"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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C,aAAa,EAAI,CAAA;YACvG,KAAC,CAAA,aAAA,CAAAC,+BAAyB,IACxB,eAAe,EAAE,OAAO,CAAC,sBAAsB,EAC/C,QAAQ,EAAE,OAAO,EACjB,kBAAkB,EAAE,gBAAgB,EACpC,cAAc,EAAE,OAAO,CAAC,OAAO,EAC/B,OAAO,EAAE,qBAAqB,EAC9B,QAAQ,EAAE,KAAK,EACf,gBAAgB,EAAE,aAAa,EAC/B,wBAAwB,EAAEC,gCAA0B,EACpD,0BAA0B,EAAE,IAAI,EAChC,CAAA,CACI,EACR;AACJ,KAAC,CAAC;IAEF,MAAM,QAAQ,GAAG,OAAO,CAAC,QAAQ,KAAK,IAAI,GAAG,QAAQ,GAAG,OAAO,CAAC,QAAQ,KAAK,QAAQ,GAAG,QAAQ,GAAG,KAAK,CAAC;IACzG,QACE,oBAACC,uBAAa,EAAA,EACZ,QAAQ,EAAE,QAAQ,EAClB,IAAI,EAAE;YACJ,SAAS,EAAE,mBAAmB,CAAC,IAAI;AACpC,SAAA,EACD,IAAI,EAAE;YACJ,SAAS,EAAEC,4BAAY,CACrB,mBAAmB,CAAC,IAAI,EACxB,QAAQ,KAAK,KAAK,GAAG,mBAAmB,CAAC,YAAY,GAAG,SAAS,CAClE;AACF,SAAA,EAAA,EAEA,UAAU,EAAE,CACC,EAChB;AACJ;;;;"}
|
1
|
+
{"version":3,"file":"ChatMessageComponentAsRichTextEditBox-B3cXye-F.js","sources":["../../../../react-components/src/components/ChatMessage/ChatMessageComponentAsRichTextEditBox.tsx"],"sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { mergeStyles, Stack } from '@fluentui/react';\nimport { ChatMyMessage } from '@fluentui-contrib/react-chat';\nimport { mergeClasses } from '@fluentui/react-components';\nimport { _formatString } from '@internal/acs-ui-common';\nimport { useTheme } from '../../theming/FluentThemeProvider';\nimport React, { useCallback, useEffect, useMemo, useState } from 'react';\nimport { editBoxWidthStyles, richTextEditBoxActionButtonIcon } from '../styles/EditBox.styles';\nimport { InputBoxButton } from '../InputBoxButton';\nimport { MessageThreadStrings } from '../MessageThread';\nimport { useChatMyMessageStyles } from '../styles/MessageThread.styles';\nimport { ChatMessage } from '../../types';\nimport { _AttachmentUploadCards } from '../AttachmentUploadCards';\n/* @conditional-compile-remove(attachment-upload) */\nimport { AttachmentMetadata } from '../../types/Attachment';\nimport { useChatMessageRichTextEditContainerStyles } from '../styles/ChatMessageComponent.styles';\nimport { MAXIMUM_LENGTH_OF_MESSAGE } from '../utils/SendBoxUtils';\nimport { getMessageState, onRenderCancelIcon, onRenderSubmitIcon } from '../utils/ChatMessageComponentAsEditBoxUtils';\n/* @conditional-compile-remove(attachment-upload) */\nimport { getMessageWithAttachmentMetadata } from '../utils/ChatMessageComponentAsEditBoxUtils';\nimport { RichTextEditorComponentRef } from '../RichTextEditor/RichTextEditor';\nimport { RichTextInputBoxComponent } from '../RichTextEditor/RichTextInputBoxComponent';\nimport { editBoxRichTextEditorStyle, richTextActionButtonsStyle } from '../styles/RichTextEditor.styles';\nimport { RichTextSendBoxErrors } from '../RichTextEditor/RichTextSendBoxErrors';\nimport { useLocale } from '../../localization';\n\n/** @beta */\nexport type ChatMessageComponentAsRichTextEditBoxProps = {\n onCancel?: (messageId: string) => void;\n onSubmit: (\n text: string,\n metadata?: Record<string, string>,\n options?: {\n /* @conditional-compile-remove(attachment-upload) */\n attachmentMetadata?: AttachmentMetadata[];\n }\n ) => void;\n message: ChatMessage;\n strings: MessageThreadStrings;\n};\n\n/**\n * @beta\n */\nexport const ChatMessageComponentAsRichTextEditBox = (\n props: ChatMessageComponentAsRichTextEditBoxProps\n): JSX.Element => {\n const { onCancel, onSubmit, strings, message } = props;\n\n const [textValue, setTextValue] = useState<string>(message.content || '');\n /* @conditional-compile-remove(attachment-upload) */\n const [attachmentMetadata, _] = React.useState(getMessageWithAttachmentMetadata(message));\n const editTextFieldRef = React.useRef<RichTextEditorComponentRef>(null);\n const theme = useTheme();\n const messageState = getMessageState(\n textValue,\n /* @conditional-compile-remove(attachment-upload) */ attachmentMetadata ?? []\n );\n const submitEnabled = messageState === 'OK';\n\n const editContainerStyles = useChatMessageRichTextEditContainerStyles();\n const chatMyMessageStyles = useChatMyMessageStyles();\n const locale = useLocale().strings;\n\n // TODO: Check if the focus is needed, if so use `focusOnInit` prop\n // for Rooster component instead as this sets focus too early\n useEffect(() => {\n editTextFieldRef.current?.focus();\n }, []);\n\n const setText = (newValue?: string): void => {\n setTextValue(newValue ?? '');\n };\n\n const textTooLongMessage =\n messageState === 'too long'\n ? _formatString(strings.editBoxTextLimit, { limitNumber: `${MAXIMUM_LENGTH_OF_MESSAGE}` })\n : undefined;\n\n const iconClassName = useCallback(\n (isHover: boolean) => {\n const color = isHover ? theme.palette.accent : theme.palette.neutralSecondary;\n return mergeStyles(richTextEditBoxActionButtonIcon, { color });\n },\n [theme.palette.accent, theme.palette.neutralSecondary]\n );\n\n const onRenderThemedCancelIcon = useCallback(\n (isHover: boolean) => {\n return onRenderCancelIcon(iconClassName(isHover));\n },\n [iconClassName]\n );\n\n const onRenderThemedSubmitIcon = useCallback(\n (isHover: boolean) => {\n return onRenderSubmitIcon(iconClassName(isHover));\n },\n [iconClassName]\n );\n\n const actionButtons = useMemo(() => {\n return (\n <Stack horizontal>\n <InputBoxButton\n className={richTextActionButtonsStyle}\n ariaLabel={strings.editBoxCancelButton}\n tooltipContent={strings.editBoxCancelButton}\n onRenderIcon={onRenderThemedCancelIcon}\n onClick={() => {\n onCancel && onCancel(message.messageId);\n }}\n id={'dismissIconWrapper'}\n />\n <InputBoxButton\n className={richTextActionButtonsStyle}\n ariaLabel={strings.editBoxSubmitButton}\n tooltipContent={strings.editBoxSubmitButton}\n onRenderIcon={onRenderThemedSubmitIcon}\n onClick={(e) => {\n submitEnabled &&\n onSubmit(\n textValue,\n message.metadata,\n /* @conditional-compile-remove(attachment-upload) */ {\n attachmentMetadata\n }\n );\n e.stopPropagation();\n }}\n id={'submitIconWrapper'}\n />\n </Stack>\n );\n }, [\n /* @conditional-compile-remove(attachment-upload) */ attachmentMetadata,\n message.messageId,\n message.metadata,\n onCancel,\n onRenderThemedCancelIcon,\n onRenderThemedSubmitIcon,\n onSubmit,\n strings.editBoxCancelButton,\n strings.editBoxSubmitButton,\n submitEnabled,\n textValue\n ]);\n const richTextLocaleStrings = useMemo(() => {\n /* @conditional-compile-remove(rich-text-editor) */\n return locale.richTextSendBox;\n return locale.sendBox;\n }, [/* @conditional-compile-remove(rich-text-editor) */ locale.richTextSendBox, locale.sendBox]);\n\n const getContent = (): JSX.Element => {\n return (\n <Stack className={mergeStyles(editBoxWidthStyles)}>\n <RichTextSendBoxErrors textTooLongMessage={textTooLongMessage} systemMessage={message.failureReason} />\n <RichTextInputBoxComponent\n placeholderText={strings.editBoxPlaceholderText}\n onChange={setText}\n editorComponentRef={editTextFieldRef}\n initialContent={message.content}\n strings={richTextLocaleStrings}\n disabled={false}\n actionComponents={actionButtons}\n richTextEditorStyleProps={editBoxRichTextEditorStyle}\n isHorizontalLayoutDisabled={true}\n />\n </Stack>\n );\n };\n\n const attached = message.attached === true ? 'center' : message.attached === 'bottom' ? 'bottom' : 'top';\n return (\n <ChatMyMessage\n attached={attached}\n root={{\n className: chatMyMessageStyles.root\n }}\n body={{\n className: mergeClasses(\n editContainerStyles.body,\n attached !== 'top' ? editContainerStyles.bodyAttached : undefined\n )\n }}\n >\n {getContent()}\n </ChatMyMessage>\n );\n};\n"],"names":["useState","getMessageWithAttachmentMetadata","useTheme","getMessageState","useChatMessageRichTextEditContainerStyles","useChatMyMessageStyles","useLocale","useEffect","_formatString","MAXIMUM_LENGTH_OF_MESSAGE","useCallback","mergeStyles","richTextEditBoxActionButtonIcon","onRenderCancelIcon","onRenderSubmitIcon","useMemo","Stack","InputBoxButton","richTextActionButtonsStyle","editBoxWidthStyles","RichTextSendBoxErrors","RichTextInputBoxComponent","editBoxRichTextEditorStyle","ChatMyMessage","mergeClasses"],"mappings":";;;;;;;;;;;;;;;;;;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,aAAa,EAAE,OAAO,CAAC,aAAa,EAAI,CAAA;YACvG,KAAC,CAAA,aAAA,CAAAC,+BAAyB,IACxB,eAAe,EAAE,OAAO,CAAC,sBAAsB,EAC/C,QAAQ,EAAE,OAAO,EACjB,kBAAkB,EAAE,gBAAgB,EACpC,cAAc,EAAE,OAAO,CAAC,OAAO,EAC/B,OAAO,EAAE,qBAAqB,EAC9B,QAAQ,EAAE,KAAK,EACf,gBAAgB,EAAE,aAAa,EAC/B,wBAAwB,EAAEC,gCAA0B,EACpD,0BAA0B,EAAE,IAAI,EAChC,CAAA,CACI,EACR;AACJ,KAAC,CAAC;IAEF,MAAM,QAAQ,GAAG,OAAO,CAAC,QAAQ,KAAK,IAAI,GAAG,QAAQ,GAAG,OAAO,CAAC,QAAQ,KAAK,QAAQ,GAAG,QAAQ,GAAG,KAAK,CAAC;IACzG,QACE,oBAACC,uBAAa,EAAA,EACZ,QAAQ,EAAE,QAAQ,EAClB,IAAI,EAAE;YACJ,SAAS,EAAE,mBAAmB,CAAC,IAAI;AACpC,SAAA,EACD,IAAI,EAAE;YACJ,SAAS,EAAEC,4BAAY,CACrB,mBAAmB,CAAC,IAAI,EACxB,QAAQ,KAAK,KAAK,GAAG,mBAAmB,CAAC,YAAY,GAAG,SAAS,CAClE;AACF,SAAA,EAAA,EAEA,UAAU,EAAE,CACC,EAChB;AACJ;;;;"}
|
@@ -176,7 +176,7 @@ function getDefaultExportFromCjs (x) {
|
|
176
176
|
// Copyright (c) Microsoft Corporation.
|
177
177
|
// Licensed under the MIT License.
|
178
178
|
// GENERATED FILE. DO NOT EDIT MANUALLY.
|
179
|
-
var telemetryVersion = '1.15.0-alpha-
|
179
|
+
var telemetryVersion = '1.15.0-alpha-202404050013';
|
180
180
|
|
181
181
|
|
182
182
|
var telemetryVersion$1 = /*@__PURE__*/getDefaultExportFromCjs(telemetryVersion);
|
@@ -9974,6 +9974,12 @@ const insertTableMenuTitleStyles = react.mergeStyles({
|
|
9974
9974
|
fontSize: '0.75rem',
|
9975
9975
|
marginBottom: '0.5rem'
|
9976
9976
|
});
|
9977
|
+
/**
|
9978
|
+
* @private
|
9979
|
+
*/
|
9980
|
+
const tableContextMenuIconStyles = react.mergeStyles({
|
9981
|
+
marginTop: '0.375rem'
|
9982
|
+
});
|
9977
9983
|
|
9978
9984
|
// Copyright (c) Microsoft Corporation.
|
9979
9985
|
// Licensed under the MIT License.
|
@@ -10287,7 +10293,11 @@ const tableEditInsertMenuItem = {
|
|
10287
10293
|
menuNameTableInsertLeft: 'Insert left123 ',
|
10288
10294
|
menuNameTableInsertRight: 'Insert right'
|
10289
10295
|
},
|
10290
|
-
onClick
|
10296
|
+
onClick,
|
10297
|
+
iconProps: {
|
10298
|
+
iconName: 'RichTextTableInsertMenuIcon',
|
10299
|
+
styles: { root: tableContextMenuIconStyles }
|
10300
|
+
}
|
10291
10301
|
};
|
10292
10302
|
const tableEditDeleteMenuItem = {
|
10293
10303
|
key: 'menuNameTableDelete',
|
@@ -10297,7 +10307,11 @@ const tableEditDeleteMenuItem = {
|
|
10297
10307
|
menuNameTableDeleteRow: 'Delete row',
|
10298
10308
|
menuNameTableDeleteTable: 'Delete table'
|
10299
10309
|
},
|
10300
|
-
onClick
|
10310
|
+
onClick,
|
10311
|
+
iconProps: {
|
10312
|
+
iconName: 'RichTextTableDeleteMenuIcon',
|
10313
|
+
styles: { root: tableContextMenuIconStyles }
|
10314
|
+
}
|
10301
10315
|
};
|
10302
10316
|
const tableActions = [tableEditInsertMenuItem, tableEditDeleteMenuItem];
|
10303
10317
|
/**
|
@@ -10313,6 +10327,41 @@ const getEditingTable = (editor, node) => {
|
|
10313
10327
|
return (table === null || table === void 0 ? void 0 : table.isContentEditable) ? { table, td } : null;
|
10314
10328
|
};
|
10315
10329
|
|
10330
|
+
// Copyright (c) Microsoft Corporation.
|
10331
|
+
// Licensed under the MIT License.
|
10332
|
+
/**
|
10333
|
+
* CopyPastePlugin is a plugin for handling copy and paste events in the editor.
|
10334
|
+
*/
|
10335
|
+
class CopyPastePlugin {
|
10336
|
+
getName() {
|
10337
|
+
return 'CopyPastePlugin';
|
10338
|
+
}
|
10339
|
+
initialize() { }
|
10340
|
+
dispose() { }
|
10341
|
+
onPluginEvent(event) {
|
10342
|
+
removeImageElement(event);
|
10343
|
+
}
|
10344
|
+
}
|
10345
|
+
/**
|
10346
|
+
* @internal
|
10347
|
+
* Exported only for unit testing
|
10348
|
+
*/
|
10349
|
+
const removeImageElement = (event) => {
|
10350
|
+
// We don't support the pasting options such as paste as image yet.
|
10351
|
+
if (event.eventType === roosterjsEditorTypesCompatible.CompatiblePluginEventType.BeforePaste && event.pasteType === roosterjsEditorTypesCompatible.CompatiblePasteType.Normal) {
|
10352
|
+
event.fragment.querySelectorAll('img').forEach((image) => {
|
10353
|
+
// If the image is the only child of its parent, remove all the parents of this img element.
|
10354
|
+
let parentNode = image.parentElement;
|
10355
|
+
let currentNode = image;
|
10356
|
+
while ((parentNode === null || parentNode === void 0 ? void 0 : parentNode.childNodes.length) === 1) {
|
10357
|
+
currentNode = parentNode;
|
10358
|
+
parentNode = parentNode.parentElement;
|
10359
|
+
}
|
10360
|
+
currentNode === null || currentNode === void 0 ? void 0 : currentNode.remove();
|
10361
|
+
});
|
10362
|
+
}
|
10363
|
+
};
|
10364
|
+
|
10316
10365
|
// Copyright (c) Microsoft Corporation.
|
10317
10366
|
// Licensed under the MIT License.
|
10318
10367
|
/**
|
@@ -10365,7 +10414,16 @@ const RichTextEditor = React.forwardRef((props, ref) => {
|
|
10365
10414
|
const updateContentPlugin = roosterjsReact.createUpdateContentPlugin(roosterjsReact.UpdateMode.OnContentChangedEvent | roosterjsReact.UpdateMode.OnUserInput, (content) => {
|
10366
10415
|
onChange && onChange(content);
|
10367
10416
|
});
|
10368
|
-
|
10417
|
+
const copyPastePlugin = new CopyPastePlugin();
|
10418
|
+
return [
|
10419
|
+
contentEdit,
|
10420
|
+
placeholderPlugin,
|
10421
|
+
updateContentPlugin,
|
10422
|
+
ribbonPlugin,
|
10423
|
+
contextPlugin,
|
10424
|
+
tableEditMenuProvider,
|
10425
|
+
copyPastePlugin
|
10426
|
+
];
|
10369
10427
|
}, [onChange, placeholderPlugin, ribbonPlugin, strings]);
|
10370
10428
|
const ribbon = React.useMemo(() => {
|
10371
10429
|
const buttons = ribbonButtons(theme);
|
@@ -12473,7 +12531,7 @@ const ChatMessageComponentAsEditBox = (props) => {
|
|
12473
12531
|
// Copyright (c) Microsoft Corporation.
|
12474
12532
|
// Licensed under the MIT License.
|
12475
12533
|
/* @conditional-compile-remove(rich-text-editor) */
|
12476
|
-
const ChatMessageComponentAsRichTextEditBox = React.lazy(() => Promise.resolve().then(function () { return require('./ChatMessageComponentAsRichTextEditBox-
|
12534
|
+
const ChatMessageComponentAsRichTextEditBox = React.lazy(() => Promise.resolve().then(function () { return require('./ChatMessageComponentAsRichTextEditBox-B3cXye-F.js'); }).then((module) => ({
|
12477
12535
|
default: module.ChatMessageComponentAsRichTextEditBox
|
12478
12536
|
})));
|
12479
12537
|
/**
|
@@ -15560,7 +15618,8 @@ const ParticipantVideoTileOverlay = React.memo((props) => {
|
|
15560
15618
|
display: 'flex',
|
15561
15619
|
justifyContent: 'center',
|
15562
15620
|
alignItems: 'center',
|
15563
|
-
backgroundColor: canRenderReaction ? 'rgba(0, 0, 0, 0.5)' : 'transparent'
|
15621
|
+
backgroundColor: canRenderReaction ? 'rgba(0, 0, 0, 0.5)' : 'transparent',
|
15622
|
+
borderRadius: '0.25rem'
|
15564
15623
|
}) },
|
15565
15624
|
React.createElement("div", { style: { height: '33.33%' } }),
|
15566
15625
|
canRenderReaction && isValidImageSource && (React.createElement("div", { style: {
|
@@ -15885,10 +15944,10 @@ const RemoteContentShareReactionOverlay = React.memo((props) => {
|
|
15885
15944
|
}
|
15886
15945
|
return canRender;
|
15887
15946
|
};
|
15888
|
-
const containerHeight = hostDivHeight !== null && hostDivHeight !== void 0 ? hostDivHeight : 0;
|
15889
|
-
const containerWidth = hostDivWidth !== null && hostDivWidth !== void 0 ? hostDivWidth : 0;
|
15890
15947
|
const styleBucket = () => getReactionStyleBucket();
|
15891
15948
|
const displaySizePx = () => REACTION_START_DISPLAY_SIZE * styleBucket().sizeScale;
|
15949
|
+
const containerHeight = hostDivHeight !== null && hostDivHeight !== void 0 ? hostDivHeight : 0;
|
15950
|
+
const containerWidth = (hostDivWidth !== null && hostDivWidth !== void 0 ? hostDivWidth : 0) - displaySizePx();
|
15892
15951
|
const leftPosition = (position) => generateStartPositionWave(position, containerWidth / 2, true);
|
15893
15952
|
const reactionMovementStyle = (position) => getReactionMovementStyle(leftPosition(position));
|
15894
15953
|
return (React.createElement(react.Stack, { className: react.mergeStyles(videoContainerStyles, {
|
@@ -39455,4 +39514,4 @@ exports.useTeamsCall = useTeamsCall;
|
|
39455
39514
|
exports.useTeamsCallAdapter = useTeamsCallAdapter;
|
39456
39515
|
exports.useTeamsCallAgent = useTeamsCallAgent;
|
39457
39516
|
exports.useTheme = useTheme;
|
39458
|
-
//# sourceMappingURL=index-
|
39517
|
+
//# sourceMappingURL=index-C4BFVPuO.js.map
|