From 918f1513844ebf85fd1b2a43b96a724a155ed25a Mon Sep 17 00:00:00 2001 From: Florian Duros Date: Tue, 31 Jan 2023 18:13:24 +0100 Subject: [PATCH] Add indentation increasing/decreasing to RTE (#10034) Add indent and unindent actions to RTE --- package.json | 2 +- .../room/composer/indent_decrease.svg | 10 ++++++++++ .../room/composer/indent_increase.svg | 10 ++++++++++ .../components/FormattingButtons.tsx | 14 ++++++++++++++ src/i18n/strings/en_EN.json | 2 ++ .../components/FormattingButtons-test.tsx | 4 ++++ yarn.lock | 8 ++++---- 7 files changed, 45 insertions(+), 5 deletions(-) create mode 100644 res/img/element-icons/room/composer/indent_decrease.svg create mode 100644 res/img/element-icons/room/composer/indent_increase.svg diff --git a/package.json b/package.json index 1906e1e580..8b8c3209f5 100644 --- a/package.json +++ b/package.json @@ -57,7 +57,7 @@ "dependencies": { "@babel/runtime": "^7.12.5", "@matrix-org/analytics-events": "^0.4.0", - "@matrix-org/matrix-wysiwyg": "^0.22.0", + "@matrix-org/matrix-wysiwyg": "^0.23.0", "@matrix-org/react-sdk-module-api": "^0.0.3", "@sentry/browser": "^7.0.0", "@sentry/tracing": "^7.0.0", diff --git a/res/img/element-icons/room/composer/indent_decrease.svg b/res/img/element-icons/room/composer/indent_decrease.svg new file mode 100644 index 0000000000..660c3e55ca --- /dev/null +++ b/res/img/element-icons/room/composer/indent_decrease.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/res/img/element-icons/room/composer/indent_increase.svg b/res/img/element-icons/room/composer/indent_increase.svg new file mode 100644 index 0000000000..f40162e05d --- /dev/null +++ b/res/img/element-icons/room/composer/indent_increase.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/src/components/views/rooms/wysiwyg_composer/components/FormattingButtons.tsx b/src/components/views/rooms/wysiwyg_composer/components/FormattingButtons.tsx index 80f2563d1d..7bc4b33d41 100644 --- a/src/components/views/rooms/wysiwyg_composer/components/FormattingButtons.tsx +++ b/src/components/views/rooms/wysiwyg_composer/components/FormattingButtons.tsx @@ -28,6 +28,8 @@ import { Icon as LinkIcon } from "../../../../../../res/img/element-icons/room/c import { Icon as BulletedListIcon } from "../../../../../../res/img/element-icons/room/composer/bulleted_list.svg"; import { Icon as NumberedListIcon } from "../../../../../../res/img/element-icons/room/composer/numbered_list.svg"; import { Icon as CodeBlockIcon } from "../../../../../../res/img/element-icons/room/composer/code_block.svg"; +import { Icon as IndentIcon } from "../../../../../../res/img/element-icons/room/composer/indent_increase.svg"; +import { Icon as UnIndentIcon } from "../../../../../../res/img/element-icons/room/composer/indent_decrease.svg"; import AccessibleTooltipButton from "../../../elements/AccessibleTooltipButton"; import { Alignment } from "../../../elements/Tooltip"; import { KeyboardShortcut } from "../../../settings/KeyboardShortcut"; @@ -127,6 +129,18 @@ export function FormattingButtons({ composer, actionStates }: FormattingButtonsP onClick={() => composer.orderedList()} icon={} /> +