pull/3164/head
Laurent Cozic 2020-05-04 18:37:22 +01:00
parent 3f8833eaf1
commit 9a2f0bee29
5 changed files with 5 additions and 21 deletions

View File

@ -228,9 +228,6 @@ function AceEditor(props: NoteBodyEditorProps, ref: any) {
useImperativeHandle(ref, () => {
return {
content: () => props.content,
setContent: (body: string) => {
aceEditor_change(body);
},
resetScroll: () => {
resetScroll();
},
@ -246,11 +243,6 @@ function AceEditor(props: NoteBodyEditorProps, ref: any) {
throw new Error(`Unsupported scroll options: ${options.type}`);
}
},
clearState: () => {
if (!editor) return;
editor.clearSelection();
editor.moveCursorTo(0, 0);
},
supportsCommand: (/* name:string*/) => {
// TODO: not implemented, currently only used for "search" command
// which is not directly supported by Ace Editor.

View File

@ -199,9 +199,6 @@ const TinyMCE = (props:NoteBodyEditorProps, ref:any) => {
if (!editorRef.current) return '';
return prop_htmlToMarkdownRef.current(props.contentMarkupLanguage, editorRef.current.getContent(), props.contentOriginalCss);
},
setContent: (/* body: string*/) => {
console.warn('TinyMCE::setContent - not implemented');
},
resetScroll: () => {
if (editor) editor.getWin().scrollTo(0,0);
},
@ -220,11 +217,6 @@ const TinyMCE = (props:NoteBodyEditorProps, ref:any) => {
} else {
throw new Error(`Unsupported scroll options: ${options.type}`);
}
},
clearState: () => {
console.warn('TinyMCE::clearState - not implemented');
},
supportsCommand: (name:string) => {
// TODO: should also handle commands that are not in this map (insertText, focus, etc);

View File

@ -15,7 +15,7 @@ import useDropHandler from './utils/useDropHandler';
import useMarkupToHtml from './utils/useMarkupToHtml';
import useFormNote, { OnLoadEvent } from './utils/useFormNote';
import styles_ from './styles';
import { NoteTextProps, FormNote, ScrollOptions, ScrollOptionTypes, OnChangeEvent, NoteBodyEditorProps } from './utils/types';
import { NoteEditorProps, FormNote, ScrollOptions, ScrollOptionTypes, OnChangeEvent, NoteBodyEditorProps } from './utils/types';
import { attachResources } from './utils/resourceHandling';
const { themeStyle } = require('../../theme.js');
@ -33,7 +33,7 @@ const eventManager = require('../../eventManager');
const NoteRevisionViewer = require('../NoteRevisionViewer.min');
const TagList = require('../TagList.min.js');
function NoteEditor(props: NoteTextProps) {
function NoteEditor(props: NoteEditorProps) {
const theme = themeStyle(props.theme);
const [showRevisions, setShowRevisions] = useState(false);

View File

@ -1,8 +1,8 @@
import { NoteTextProps } from '../utils/types';
import { NoteEditorProps } from '../utils/types';
const { buildStyle } = require('../../../theme.js');
export default function styles(props: NoteTextProps) {
export default function styles(props: NoteEditorProps) {
return buildStyle('NoteEditor', props.theme, (theme: any) => {
return {
root: {

View File

@ -1,7 +1,7 @@
// eslint-disable-next-line no-unused-vars
import AsyncActionQueue from '../../../lib/AsyncActionQueue';
export interface NoteTextProps {
export interface NoteEditorProps {
style: any;
noteId: string;
theme: number;