Allow copy/paste of formatting and mentions

This commit is contained in:
Scott Nonnenberg 2023-05-09 17:40:19 -07:00 committed by GitHub
parent 320ac044a8
commit b4caf67bf9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
55 changed files with 1003 additions and 446 deletions

View file

@ -28,9 +28,13 @@ const useProps = (overrideProps: Partial<Props> = {}): Props => ({
clearQuotedMessage: action('clearQuotedMessage'),
getPreferredBadge: () => undefined,
getQuotedMessage: action('getQuotedMessage'),
isFormattingSpoilersEnabled:
overrideProps.isFormattingSpoilersEnabled === false
? overrideProps.isFormattingSpoilersEnabled
isFormattingFlagEnabled:
overrideProps.isFormattingFlagEnabled === false
? overrideProps.isFormattingFlagEnabled
: true,
isFormattingSpoilersFlagEnabled:
overrideProps.isFormattingSpoilersFlagEnabled === false
? overrideProps.isFormattingSpoilersFlagEnabled
: true,
isFormattingEnabled:
overrideProps.isFormattingEnabled === false
@ -42,6 +46,7 @@ const useProps = (overrideProps: Partial<Props> = {}): Props => ({
onPickEmoji: action('onPickEmoji'),
onSubmit: action('onSubmit'),
onTextTooLong: action('onTextTooLong'),
platform: 'darwin',
sendCounter: 0,
sortedGroupMembers: overrideProps.sortedGroupMembers || [],
skinTone: select(
@ -142,12 +147,18 @@ export function Mentions(): JSX.Element {
return <CompositionInput {...props} />;
}
export function NoFormatting(): JSX.Element {
export function NoFormattingMenu(): JSX.Element {
return <CompositionInput {...useProps({ isFormattingEnabled: false })} />;
}
export function NoSpoilerFormatting(): JSX.Element {
export function NoFormattingFlag(): JSX.Element {
return <CompositionInput {...useProps({ isFormattingFlagEnabled: false })} />;
}
export function NoSpoilerFormattingFlag(): JSX.Element {
return (
<CompositionInput {...useProps({ isFormattingSpoilersEnabled: false })} />
<CompositionInput
{...useProps({ isFormattingSpoilersFlagEnabled: false })}
/>
);
}