diff --git a/public/locales/en/translation.json b/public/locales/en/translation.json index 00658000..eec2686a 100644 --- a/public/locales/en/translation.json +++ b/public/locales/en/translation.json @@ -218,6 +218,7 @@ "Quotes": "Quotes", "Reason uknown": "Reason unknown", "Recent": "Fresh", + "Remove link": "Remove link", "Reply": "Reply", "Report": "Complain", "Required": "Required", @@ -321,8 +322,8 @@ "back to menu": "back to menu", "bold": "bold", "bookmarks": "bookmarks", - "cancel": "Cancel", - "cancel_low_caps": "cancel", + "Cancel": "Cancel", + "cancel": "cancel", "collections": "collections", "community": "community", "delimiter": "delimiter", diff --git a/public/locales/ru/translation.json b/public/locales/ru/translation.json index 7790f35e..8d69d693 100644 --- a/public/locales/ru/translation.json +++ b/public/locales/ru/translation.json @@ -233,6 +233,7 @@ "Reason uknown": "Причина неизвестна", "Recent": "Свежее", "Release date...": "Дата выхода...", + "Remove link": "Убрать ссылку", "Reply": "Ответить", "Report": "Пожаловаться", "Required": "Поле обязательно для заполнения", @@ -339,8 +340,8 @@ "back to menu": "назад в меню", "bold": "жирный", "bookmarks": "закладки", - "cancel": "Отмена", - "cancel_low_caps": "отменить", + "Cancel": "Отмена", + "cancel": "отменить", "collections": "коллекции", "community": "сообщество", "create_chat": "Создать чат", diff --git a/src/components/Article/FullArticle.tsx b/src/components/Article/FullArticle.tsx index 591a6707..c7255952 100644 --- a/src/components/Article/FullArticle.tsx +++ b/src/components/Article/FullArticle.tsx @@ -153,7 +153,13 @@ export const FullArticle = (props: ArticleProps) => { )} - +
{ } } + const handleClear = () => { + props.initialValue ? props.onClear() : props.onClose() + } + return (
@@ -76,9 +80,9 @@ export const InlineForm = (props: Props) => { )} - + {(triggerRef: (el) => void) => ( - )} diff --git a/src/components/Editor/Panel/Panel.tsx b/src/components/Editor/Panel/Panel.tsx index c9a7cca7..5024e05e 100644 --- a/src/components/Editor/Panel/Panel.tsx +++ b/src/components/Editor/Panel/Panel.tsx @@ -237,7 +237,7 @@ export const Panel = (props: Props) => {

- {t('cancel_low_caps')} + {t('cancel')} Ctrl Z diff --git a/src/components/Editor/SimplifiedEditor.tsx b/src/components/Editor/SimplifiedEditor.tsx index 210a9576..8badf04a 100644 --- a/src/components/Editor/SimplifiedEditor.tsx +++ b/src/components/Editor/SimplifiedEditor.tsx @@ -124,16 +124,21 @@ const SimplifiedEditor = (props: Props) => { }) const handleKeyDown = async (event) => { - if (props.submitByEnter && event.keyCode === 13 && !event.shiftKey && !isEmpty()) { + if (isEmpty() || !editor().isFocused) { + return + } + + if ( + event.code === 'Enter' && + ((props.submitByEnter && !event.shiftKey) || (props.submitByShiftEnter && event.shiftKey)) + ) { event.preventDefault() props.onSubmit(html()) handleClear() } - if (props.submitByShiftEnter && event.keyCode === 13 && event.shiftKey && !isEmpty()) { - event.preventDefault() - props.onSubmit(html()) - handleClear() + if (event.code === 'KeyK' && (event.metaKey || event.ctrlKey) && !editor().state.selection.empty) { + showModal('editorInsertLink') } } @@ -144,7 +149,8 @@ const SimplifiedEditor = (props: Props) => { onCleanup(() => { window.removeEventListener('keydown', handleKeyDown) }) - + const handleToggleBlockquote = () => editor().chain().focus().toggleBlockquote().run() + const handleInsertLink = () => !editor().state.selection.empty && showModal('editorInsertLink') return (

{
-
- - -
- - handleSlideDescriptionChange(index(), 'title', event.target.value) - } - /> - - handleSlideDescriptionChange(index(), 'source', event.target.value) - } - /> - handleSlideDescriptionChange(index(), 'body', value)} - submitButtonText={t('Save')} - /> -
-
- -
- -
{slide.title}
-
- -
{slide.source}
-
- -
- -
-
-
-
-
)} @@ -249,23 +204,19 @@ export const SolidSwiper = (props: Props) => { {slideIndex() + 1} / {props.images.length}
-
(thumbSwipeRef.current = el)} slides-per-view={'auto'} - free-mode={true} - observer={true} space-between={20} auto-scroll-offset={1} watch-overflow={true} - slide-to-clicked-slide={true} watch-slides-visibility={true} - watch-slides-progress={true} direction={props.editorMode ? 'horizontal' : 'vertical'} - slides-offset-after={props.editorMode && 140} + slides-offset-after={props.editorMode && 160} + slides-offset-before={props.editorMode && 30} > {(slide, index) => ( @@ -337,6 +288,46 @@ export const SolidSwiper = (props: Props) => {
+ + +
{props.images[slideIndex()].title}
+
+ +
{props.images[slideIndex()].source}
+
+ +
+ +
+ } + > +
+ handleSlideDescriptionChange(slideIndex(), 'title', event.target.value)} + /> + handleSlideDescriptionChange(slideIndex(), 'source', event.target.value)} + /> + handleSlideDescriptionChange(slideIndex(), 'body', value)} + submitButtonText={t('Save')} + /> +
+
) } diff --git a/src/components/_shared/SolidSwiper/Swiper.module.scss b/src/components/_shared/SolidSwiper/Swiper.module.scss index 3a7e3447..02044bb0 100644 --- a/src/components/_shared/SolidSwiper/Swiper.module.scss +++ b/src/components/_shared/SolidSwiper/Swiper.module.scss @@ -11,6 +11,7 @@ $navigation-reserve: 32px; .Swiper { display: block; margin: 2rem 0; + flex-direction: column; &.articleMode { background: var(--background-color-invert); @@ -137,6 +138,11 @@ $navigation-reserve: 32px; } } } + &.editorMode { + .holder { + width: 100%; + } + } .navigation { background: rgb(0 0 0 / 40%); @@ -183,6 +189,7 @@ $navigation-reserve: 32px; .slideDescription { margin-top: 8px; + align-self: flex-start; .articleTitle { @include font-size(1.4rem);