From 217c027044dc1f4253cccf0f732d77b2d18b88e1 Mon Sep 17 00:00:00 2001 From: Untone Date: Tue, 1 Oct 2024 22:52:45 +0300 Subject: [PATCH] .. --- src/components/Editor/Editor.tsx | 13 +------------ src/components/Editor/MicroEditor.tsx | 2 +- src/components/Editor/MiniEditor.module.scss | 4 ++-- src/components/Editor/MiniEditor.tsx | 2 +- src/components/Upload/renderUploadedImage.ts | 11 +++++++++++ 5 files changed, 16 insertions(+), 16 deletions(-) diff --git a/src/components/Editor/Editor.tsx b/src/components/Editor/Editor.tsx index 7eed52c7..1468f9ad 100644 --- a/src/components/Editor/Editor.tsx +++ b/src/components/Editor/Editor.tsx @@ -16,7 +16,7 @@ import { useSnackbar } from '~/context/ui' import { Author } from '~/graphql/schema/core.gen' import { base, custom, extended } from '~/lib/editorExtensions' import { handleImageUpload } from '~/lib/handleImageUpload' -import { renderUploadedImage } from '../Upload/renderUploadedImage' +import { allowedImageTypes, renderUploadedImage } from '../Upload/renderUploadedImage' import { BlockquoteBubbleMenu } from './Toolbar/BlockquoteBubbleMenu' import { EditorFloatingMenu } from './Toolbar/EditorFloatingMenu' import { FigureBubbleMenu } from './Toolbar/FigureBubbleMenu' @@ -32,17 +32,6 @@ export type EditorComponentProps = { disableCollaboration?: boolean } -const allowedImageTypes = new Set([ - 'image/bmp', - 'image/gif', - 'image/jpeg', - 'image/jpg', - 'image/png', - 'image/tiff', - 'image/webp', - 'image/x-icon' -]) - const yDocs: Record = {} const providers: Record = {} diff --git a/src/components/Editor/MicroEditor.tsx b/src/components/Editor/MicroEditor.tsx index 0b9073c3..87416823 100644 --- a/src/components/Editor/MicroEditor.tsx +++ b/src/components/Editor/MicroEditor.tsx @@ -32,7 +32,7 @@ export const MicroEditor = (props: MicroEditorProps): JSX.Element => { ], editorProps: { attributes: { - class: styles.simplifiedEditorField + class: styles.compactEditor } }, content: props.content || '', diff --git a/src/components/Editor/MiniEditor.module.scss b/src/components/Editor/MiniEditor.module.scss index 6302d525..7b1548f5 100644 --- a/src/components/Editor/MiniEditor.module.scss +++ b/src/components/Editor/MiniEditor.module.scss @@ -7,7 +7,7 @@ padding: 16px 16px 8px; position: relative; - .simplifiedEditorField { + .compactEditor { @include font-size(1.4rem); min-height: 100px; @@ -25,7 +25,7 @@ } } - &.smallHeight .simplifiedEditorField { + &.smallHeight .compactEditor { min-height: 34px; } diff --git a/src/components/Editor/MiniEditor.tsx b/src/components/Editor/MiniEditor.tsx index 0aba98d8..31c358ab 100644 --- a/src/components/Editor/MiniEditor.tsx +++ b/src/components/Editor/MiniEditor.tsx @@ -43,7 +43,7 @@ export default function MiniEditor(props: MiniEditorProps): JSX.Element { ], editorProps: { attributes: { - class: styles.simplifiedEditorField + class: styles.compactEditor } }, content: props.content || '', diff --git a/src/components/Upload/renderUploadedImage.ts b/src/components/Upload/renderUploadedImage.ts index 70c1e91d..c7aee077 100644 --- a/src/components/Upload/renderUploadedImage.ts +++ b/src/components/Upload/renderUploadedImage.ts @@ -20,3 +20,14 @@ export const renderUploadedImage = (editor: Editor, image: { url: string; origin }) .run() } + +export const allowedImageTypes = new Set([ + 'image/bmp', + 'image/gif', + 'image/jpeg', + 'image/jpg', + 'image/png', + 'image/tiff', + 'image/webp', + 'image/x-icon' +])