Merge pull request #37 from fantasticit/feat/mobile

pull/44/head
fantasticit 2022-05-04 19:28:12 +08:00 committed by GitHub
commit 81735b204d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 5 deletions

View File

@ -20,7 +20,6 @@ import { GridSelect } from 'components/grid-select';
import { useToggle } from 'hooks/use-toggle'; import { useToggle } from 'hooks/use-toggle';
import { useUser } from 'data/user'; import { useUser } from 'data/user';
import { createKeysLocalStorageLRUCache } from 'helpers/lru-cache'; import { createKeysLocalStorageLRUCache } from 'helpers/lru-cache';
import { getEditorContainerDOMSize } from 'tiptap/prose-utils';
import { useActive } from 'tiptap/editor/hooks/use-active'; import { useActive } from 'tiptap/editor/hooks/use-active';
import { Title } from 'tiptap/core/extensions/title'; import { Title } from 'tiptap/core/extensions/title';
import { createCountdown } from '../countdown/service'; import { createCountdown } from '../countdown/service';
@ -69,8 +68,7 @@ const COMMANDS = [
icon: <IconImage />, icon: <IconImage />,
label: '图片', label: '图片',
action: (editor) => { action: (editor) => {
const { width } = getEditorContainerDOMSize(editor); editor.chain().focus().setEmptyImage({ width: '100%' }).run();
editor.chain().focus().setEmptyImage({ width }).run();
}, },
}, },
{ {
@ -95,8 +93,7 @@ const COMMANDS = [
icon: <IconMind />, icon: <IconMind />,
label: '思维导图', label: '思维导图',
action: (editor) => { action: (editor) => {
const { width } = getEditorContainerDOMSize(editor); editor.chain().focus().setMind({ width: '100%' }).run();
editor.chain().focus().setMind({ width }).run();
}, },
}, },
{ {