diff --git a/src/ComposerHistoryManager.js b/src/ComposerHistoryManager.js index 5c9ae26af0..938be9eee4 100644 --- a/src/ComposerHistoryManager.js +++ b/src/ComposerHistoryManager.js @@ -17,7 +17,7 @@ limitations under the License. import { Value } from 'slate'; import Html from 'slate-html-serializer'; -import Markdown as Md from 'slate-md-serializer'; +import { Markdown as Md } from 'slate-md-serializer'; import Plain from 'slate-plain-serializer'; import * as RichText from './RichText'; import Markdown from './Markdown'; diff --git a/src/components/views/avatars/RoomAvatar.js b/src/components/views/avatars/RoomAvatar.js index 499e575227..e37d8d5d19 100644 --- a/src/components/views/avatars/RoomAvatar.js +++ b/src/components/views/avatars/RoomAvatar.js @@ -177,7 +177,7 @@ module.exports = React.createClass({ render: function() { const BaseAvatar = sdk.getComponent("avatars.BaseAvatar"); - const {room, oobData, ...otherProps} = this.props; + const {room, oobData, viewAvatarOnClick, ...otherProps} = this.props; const roomName = room ? room.name : oobData.name; diff --git a/src/components/views/rooms/MessageComposerInput.js b/src/components/views/rooms/MessageComposerInput.js index c8523acea1..af942a75e6 100644 --- a/src/components/views/rooms/MessageComposerInput.js +++ b/src/components/views/rooms/MessageComposerInput.js @@ -22,7 +22,7 @@ import { Editor } from 'slate-react'; import { Value } from 'slate'; import Html from 'slate-html-serializer'; -import Markdown as Md from 'slate-md-serializer'; +import { Markdown as Md } from 'slate-md-serializer'; import Plain from 'slate-plain-serializer'; // import {Editor, EditorState, RichUtils, CompositeDecorator, Modifier, @@ -1103,6 +1103,10 @@ export default class MessageComposerInput extends React.Component { /* returns inline style and block type of current SelectionState so MessageComposer can render formatting buttons. */ getSelectionInfo(editorState: EditorState) { + return { + [], null + }; +/* const styleName = { BOLD: _td('bold'), ITALIC: _td('italic'), @@ -1130,13 +1134,17 @@ export default class MessageComposerInput extends React.Component { style, blockType, }; +*/ } getAutocompleteQuery(contentState: ContentState) { + return []; + // Don't send markdown links to the autocompleter - return this.removeMDLinks(contentState, ['@', '#']); + // return this.removeMDLinks(contentState, ['@', '#']); } +/* removeMDLinks(contentState: ContentState, prefixes: string[]) { const plaintext = contentState.getPlainText(); if (!plaintext) return ''; @@ -1169,7 +1177,7 @@ export default class MessageComposerInput extends React.Component { } }); } - +*/ onMarkdownToggleClicked = (e) => { e.preventDefault(); // don't steal focus from the editor! this.handleKeyCommand('toggle-mode'); @@ -1178,25 +1186,14 @@ export default class MessageComposerInput extends React.Component { render() { const activeEditorState = this.state.originalEditorState || this.state.editorState; - // From https://github.com/facebook/draft-js/blob/master/examples/rich/rich.html#L92 - // If the user changes block type before entering any text, we can - // either style the placeholder or hide it. - let hidePlaceholder = false; - const contentState = activeEditorState.getCurrentContent(); - if (!contentState.hasText()) { - if (contentState.getBlockMap().first().getType() !== 'unstyled') { - hidePlaceholder = true; - } - } - const className = classNames('mx_MessageComposer_input', { mx_MessageComposer_input_empty: hidePlaceholder, mx_MessageComposer_input_error: this.state.someCompletions === false, }); - const content = activeEditorState.getCurrentContent(); - const selection = RichText.selectionStateToTextOffsets(activeEditorState.getSelection(), - activeEditorState.getCurrentContent().getBlocksAsArray()); + // const content = activeEditorState.getCurrentContent(); + // const selection = RichText.selectionStateToTextOffsets(activeEditorState.getSelection(), + // activeEditorState.getCurrentContent().getBlocksAsArray()); return (
@@ -1219,6 +1216,7 @@ export default class MessageComposerInput extends React.Component { + spellCheck={true} + */ + />
);