Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(RichTextEditor): format toolbar [WPB-12089] #18398

Merged
merged 36 commits into from
Dec 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
60f68c9
feat(messageRenderer): add 'list' support to markdown rendering options
olafsulich Nov 26, 2024
8e4d9be
feat(RichTextEditor): format toolbar draft
olafsulich Nov 27, 2024
d9be719
feat(RichText): draft format toolbar component
olafsulich Nov 29, 2024
427fe9c
refactor(ControlButtons): split buttons to their own components
olafsulich Nov 29, 2024
6187bab
feat: add feature flag for message format buttons
olafsulich Nov 29, 2024
0b416ba
feat: add analytics events
olafsulich Dec 2, 2024
4b1a850
fix: message edition
olafsulich Dec 2, 2024
3fd1269
revert: edit message changes
olafsulich Dec 2, 2024
c556ef8
fix: mentions rendering
olafsulich Dec 2, 2024
6878aae
fix(RichTextEditor): maintain markdown preview for editing messages
olafsulich Dec 3, 2024
a636ef2
chore: merge dev
olafsulich Dec 3, 2024
6c01411
fix: packages
olafsulich Dec 3, 2024
b0fe00d
fix: translation typedefs
olafsulich Dec 3, 2024
594930f
fix: test
olafsulich Dec 3, 2024
ca3a198
fix: input bar styles
olafsulich Dec 4, 2024
4a0841a
refactor: cleanup
olafsulich Dec 4, 2024
7633171
Merge branch 'dev' into feat/rich-message-editor
olafsulich Dec 4, 2024
12a0749
fix: grid layout
olafsulich Dec 4, 2024
3e9b6f9
fix: message reply preview
olafsulich Dec 4, 2024
b1fc432
feat: hide gif changes behind the flag
olafsulich Dec 4, 2024
3a5600a
chore: improve comments
olafsulich Dec 4, 2024
4cdf798
feat: hide avatar showing changes behind the flag
olafsulich Dec 4, 2024
29f5f0d
chore(typescript): bring back noImplicitReturns option set to true
olafsulich Dec 4, 2024
0ed0e95
refactor(useToolbarState): return undefined in the useEffect instead …
olafsulich Dec 4, 2024
85ec8b3
feat(RichTextEditor): add styles for heading 2 and 3
olafsulich Dec 4, 2024
fef2e11
fix(InputBar): update avatar visibility logic to include message form…
olafsulich Dec 6, 2024
1262a49
test(ImageUploadButton): simplify props by removing redundant boolean…
olafsulich Dec 6, 2024
abb2b84
refactor(useHeadingState): simplify command registration by removing …
olafsulich Dec 6, 2024
c76609e
refactor(useToolbarState): streamline return of update listener regis…
olafsulich Dec 6, 2024
209ca4f
chore: merge dev
olafsulich Dec 9, 2024
d4de139
chore: update packages
olafsulich Dec 9, 2024
2d64101
chore: update packages
olafsulich Dec 9, 2024
603ed30
refacotor(EmojiPicker): reuse closing logic
olafsulich Dec 12, 2024
36dabea
refactor(FormatToolbar): use TextFormatType for passing the formt in …
olafsulich Dec 12, 2024
6882baf
refactor(useEmojiPicker): handleClose funcitonallity
olafsulich Dec 12, 2024
a968f41
chore: merge dev
olafsulich Dec 16, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,12 @@
"@datadog/browser-logs": "5.33.0",
"@datadog/browser-rum": "5.33.0",
"@emotion/react": "11.11.4",
"@lexical/history": "0.21.0",
"@lexical/react": "0.21.0",
"@lexical/code": "0.20.2",
"@lexical/history": "0.20.2",
"@lexical/list": "0.20.2",
"@lexical/markdown": "0.20.2",
"@lexical/react": "0.20.2",
"@lexical/rich-text": "0.20.2",
"@mediapipe/tasks-vision": "0.10.20",
"@wireapp/avs": "10.0.4",
"@wireapp/avs-debugger": "0.0.7",
Expand All @@ -31,7 +35,7 @@
"kalium-backup": "./TEMP-crossplatform-backup",
"keyboardjs": "2.7.0",
"knockout": "3.5.1",
"lexical": "0.21.0",
"lexical": "0.20.2",
"libsodium-wrappers": "0.7.15",
"linkify-it": "5.0.0",
"long": "5.2.3",
Expand Down
1 change: 1 addition & 0 deletions server/config/client.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@
ENFORCE_CONSTANT_BITRATE: env.FEATURE_ENFORCE_CONSTANT_BITRATE == 'true',
ENABLE_ENCRYPTION_AT_REST: env.FEATURE_ENABLE_ENCRYPTION_AT_REST == 'true',
ENABLE_BLUR_BACKGROUND: env.FEATURE_ENABLE_BLUR_BACKGROUND == 'true',
ENABLE_MESSAGE_FORMAT_BUTTONS: env.FEATURE_ENABLE_MESSAGE_FORMAT_BUTTONS == 'true',
FORCE_EXTRA_CLIENT_ENTROPY: env.FEATURE_FORCE_EXTRA_CLIENT_ENTROPY == 'true',
MLS_CONFIG_KEYING_MATERIAL_UPDATE_THRESHOLD: env.FEATURE_MLS_CONFIG_KEYING_MATERIAL_UPDATE_THRESHOLD
? Number(env.FEATURE_MLS_CONFIG_KEYING_MATERIAL_UPDATE_THRESHOLD)
Expand All @@ -75,12 +76,12 @@
SHOW_LOADING_INFORMATION: env.FEATURE_SHOW_LOADING_INFORMATION == 'true',
USE_CORE_CRYPTO: env.FEATURE_USE_CORE_CRYPTO == 'true',
MAX_USERS_TO_PING_WITHOUT_ALERT:
(env.FEATURE_MAX_USERS_TO_PING_WITHOUT_ALERT && Number(env.FEATURE_MAX_USERS_TO_PING_WITHOUT_ALERT)) || 4,

Check warning on line 79 in server/config/client.config.ts

View workflow job for this annotation

GitHub Actions / test

No magic number: 4
DATADOG_ENVIRONMENT: env.FEATURE_DATADOG_ENVIRONMENT,
},
MAX_GROUP_PARTICIPANTS: (env.MAX_GROUP_PARTICIPANTS && Number(env.MAX_GROUP_PARTICIPANTS)) || 500,

Check warning on line 82 in server/config/client.config.ts

View workflow job for this annotation

GitHub Actions / test

No magic number: 500
MAX_VIDEO_PARTICIPANTS: (env.MAX_VIDEO_PARTICIPANTS && Number(env.MAX_VIDEO_PARTICIPANTS)) || 4,

Check warning on line 83 in server/config/client.config.ts

View workflow job for this annotation

GitHub Actions / test

No magic number: 4
NEW_PASSWORD_MINIMUM_LENGTH: (env.NEW_PASSWORD_MINIMUM_LENGTH && Number(env.NEW_PASSWORD_MINIMUM_LENGTH)) || 8,

Check warning on line 84 in server/config/client.config.ts

View workflow job for this annotation

GitHub Actions / test

No magic number: 8
URL: {
ACCOUNT_BASE: env.URL_ACCOUNT_BASE,
MOBILE_BASE: env.URL_MOBILE_BASE,
Expand Down
3 changes: 3 additions & 0 deletions server/config/env.ts
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,9 @@ export type Env = {
/** Feature to enable team creation flow for individual users */
FEATURE_ENABLE_TEAM_CREATION: string;

/** Feature to enable rich text editor */
FEATURE_ENABLE_MESSAGE_FORMAT_BUTTONS: string;

/** Feature to enable Cross Platform Backup export */
FEATURE_ENABLE_CROSS_PLATFORM_BACKUP_EXPORT: string;

Expand Down
10 changes: 10 additions & 0 deletions src/i18n/en-US.json
Original file line number Diff line number Diff line change
Expand Up @@ -1376,6 +1376,13 @@
"replyQuoteShowMore": "Show more",
"replyQuoteTimeStampDate": "Original message from {date}",
"replyQuoteTimeStampTime": "Original message from {time}",
"richTextHeading": "Heading",
"richTextBold": "Bold",
"richTextItalic": "Italic",
"richTextStrikethrough": "Strikethrough",
"richTextUnorderedList": "Unordered list",
"richTextOrderedList": "Ordered list",
"richTextCode": "Code",
"roleAdmin": "Admin",
"roleOwner": "Owner",
"rolePartner": "External",
Expand Down Expand Up @@ -1532,9 +1539,11 @@
"tooltipConversationCall": "Call",
"tooltipConversationDetailsAddPeople": "Add participants to conversation ({shortcut})",
"tooltipConversationDetailsRename": "Change conversation name",
"tooltipConversationEmoji": "Select emoji",
"tooltipConversationEphemeral": "Self-deleting message",
"tooltipConversationEphemeralAriaLabel": "Type a self-deleting message, currently set to {time}",
"tooltipConversationFile": "Add file",
"tooltipConversationHideFormatting": "Hide formatting",
"tooltipConversationInfo": "Conversation info",
"tooltipConversationInputMoreThanTwoUserTyping": "{user1} and {count} more people are typing",
"tooltipConversationInputOneUserTyping": "{user1} is typing",
Expand All @@ -1545,6 +1554,7 @@
"tooltipConversationPing": "Ping",
"tooltipConversationSearch": "Search",
"tooltipConversationSendMessage": "Send message",
"tooltipConversationShowFormatting": "Show formatting",
"tooltipConversationVideoCall": "Video Call",
"tooltipConversationsArchive": "Archive ({shortcut})",
"tooltipConversationsArchived": "Show archive ({number})",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,16 @@
*
*/

import {useState, useEffect, useRef, FC, RefObject} from 'react';
import {useState, useEffect, useRef, RefObject} from 'react';

import EmojiPicker, {EmojiClickData, EmojiStyle, SkinTones} from 'emoji-picker-react';
import EmojiPickerReact, {EmojiClickData, EmojiStyle, SkinTones} from 'emoji-picker-react';
import {createPortal} from 'react-dom';

import {useClickOutside} from 'src/script/hooks/useClickOutside';
import {isEnterKey, isEscapeKey} from 'Util/KeyboardUtil';
import {t} from 'Util/LocalizerUtil';

interface EmojiPickerContainerProps {
interface EmojiPickerProps {
posX: number;
posY: number;
onKeyPress: () => void;
Expand All @@ -35,14 +35,14 @@ interface EmojiPickerContainerProps {
handleReactionClick: (emoji: string) => void;
}

const EmojiPickerContainer: FC<EmojiPickerContainerProps> = ({
export const EmojiPicker = ({
posX,
posY,
onKeyPress,
resetActionMenuStates,
wrapperRef,
handleReactionClick,
}) => {
}: EmojiPickerProps) => {
const emojiRef = useRef<HTMLDivElement>(null);
useClickOutside(emojiRef, resetActionMenuStates, wrapperRef);
const [style, setStyle] = useState<object>({
Expand Down Expand Up @@ -128,7 +128,7 @@ const EmojiPickerContainer: FC<EmojiPickerContainerProps> = ({
event.stopPropagation();
}}
>
<EmojiPicker
<EmojiPickerReact
emojiStyle={EmojiStyle.NATIVE}
onEmojiClick={onEmojiClick}
searchPlaceHolder={t('accessibility.emojiPickerSearchPlaceholder')}
Expand All @@ -141,5 +141,3 @@ const EmojiPickerContainer: FC<EmojiPickerContainerProps> = ({
</>
);
};

export {EmojiPickerContainer};
Loading
Loading