mirror of
https://github.com/muerwre/vault-frontend.git
synced 2025-04-24 20:36:40 +07:00
refactor editos
This commit is contained in:
parent
03ddb1862c
commit
5e9c111e0f
149 changed files with 416 additions and 317 deletions
|
@ -1,15 +1,5 @@
|
|||
import { FC } from 'react';
|
||||
|
||||
import { AudioEditor } from '~/components/editors/AudioEditor';
|
||||
import { EditorAudioUploadButton } from '~/components/editors/EditorAudioUploadButton';
|
||||
import { EditorFiller } from '~/components/editors/EditorFiller';
|
||||
import { EditorImageUploadButton } from '~/components/editors/EditorImageUploadButton';
|
||||
import { EditorPublicSwitch } from '~/components/editors/EditorPublicSwitch';
|
||||
import { EditorUploadCoverButton } from '~/components/editors/EditorUploadCoverButton';
|
||||
import { ImageEditor } from '~/components/editors/ImageEditor';
|
||||
import { RoomEditor } from '~/components/editors/RoomEditor';
|
||||
import { TextEditor } from '~/components/editors/TextEditor';
|
||||
import { VideoEditor } from '~/components/editors/VideoEditor';
|
||||
import { LabAudio } from '~/components/lab/LabAudioBlock';
|
||||
import { LabDescription } from '~/components/lab/LabDescription';
|
||||
import { LabImage } from '~/components/lab/LabImage';
|
||||
|
@ -23,7 +13,6 @@ import { NodeImageSwiperBlock } from '~/components/node/NodeImageSwiperBlock';
|
|||
import { NodeTextBlock } from '~/components/node/NodeTextBlock';
|
||||
import { NodeVideoBlock } from '~/components/node/NodeVideoBlock';
|
||||
import { IComment, INode, ValueOf } from '~/types';
|
||||
import { IEditorComponentProps, NodeEditorProps } from '~/types/node';
|
||||
|
||||
export const EMPTY_NODE: INode = {
|
||||
id: 0,
|
||||
|
@ -98,60 +87,6 @@ export const EMPTY_COMMENT: IComment = {
|
|||
user: undefined,
|
||||
};
|
||||
|
||||
export const NODE_EDITORS: Record<
|
||||
typeof NODE_TYPES[keyof typeof NODE_TYPES],
|
||||
FC<NodeEditorProps>
|
||||
> = {
|
||||
[NODE_TYPES.IMAGE]: ImageEditor,
|
||||
[NODE_TYPES.TEXT]: TextEditor,
|
||||
[NODE_TYPES.VIDEO]: VideoEditor,
|
||||
[NODE_TYPES.AUDIO]: AudioEditor,
|
||||
[NODE_TYPES.ROOM]: RoomEditor,
|
||||
};
|
||||
|
||||
export const NODE_PANEL_COMPONENTS: Record<
|
||||
string,
|
||||
FC<IEditorComponentProps>[]
|
||||
> = {
|
||||
[NODE_TYPES.TEXT]: [
|
||||
EditorFiller,
|
||||
EditorUploadCoverButton,
|
||||
EditorPublicSwitch,
|
||||
],
|
||||
[NODE_TYPES.VIDEO]: [
|
||||
EditorFiller,
|
||||
EditorUploadCoverButton,
|
||||
EditorPublicSwitch,
|
||||
],
|
||||
[NODE_TYPES.IMAGE]: [
|
||||
EditorImageUploadButton,
|
||||
EditorFiller,
|
||||
EditorUploadCoverButton,
|
||||
EditorPublicSwitch,
|
||||
],
|
||||
[NODE_TYPES.AUDIO]: [
|
||||
EditorAudioUploadButton,
|
||||
EditorImageUploadButton,
|
||||
EditorFiller,
|
||||
EditorUploadCoverButton,
|
||||
EditorPublicSwitch,
|
||||
],
|
||||
[NODE_TYPES.ROOM]: [
|
||||
EditorAudioUploadButton,
|
||||
EditorImageUploadButton,
|
||||
EditorFiller,
|
||||
],
|
||||
};
|
||||
|
||||
export const NODE_EDITOR_DATA: Record<
|
||||
typeof NODE_TYPES[keyof typeof NODE_TYPES],
|
||||
Partial<INode>
|
||||
> = {
|
||||
[NODE_TYPES.TEXT]: {
|
||||
blocks: [{ text: '', type: 'text' }],
|
||||
},
|
||||
};
|
||||
|
||||
export const NODE_SETTINGS = {
|
||||
MAX_FILES: 16,
|
||||
MAX_IMAGE_ASPECT: 1.2,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue