diff --git a/package.json b/package.json index b10cec32d..0fe9622c2 100644 --- a/package.json +++ b/package.json @@ -32,6 +32,7 @@ "postinstall": "electron-builder install-app-deps && node build/downloadDaemon.js" }, "dependencies": { + "@types/three": "^0.93.1", "bluebird": "^3.5.1", "breakdance": "^3.0.1", "classnames": "^2.2.5", diff --git a/src/renderer/component/common/markdown-preview.jsx b/src/renderer/component/common/markdown-preview.jsx index b00ae7025..78af2273d 100644 --- a/src/renderer/component/common/markdown-preview.jsx +++ b/src/renderer/component/common/markdown-preview.jsx @@ -6,25 +6,34 @@ import remarkEmoji from 'remark-emoji'; import ExternalLink from 'component/externalLink'; import defaultSchema from 'hast-util-sanitize/lib/github.json'; +type MarkdownProps = { + content: ?string, + promptLinks?: boolean, +}; + +type SimpleLinkProps = { + href?: string, + title?: string, + children?: React.Node, +}; + +const SimpleLink = (props: SimpleLinkProps) => { + const { href, title, children } = props; + return ( + + {children} + + ); +}; + // Use github sanitation schema const schema = { ...defaultSchema }; // Extend sanitation schema to support lbry protocol schema.protocols.href[3] = 'lbry'; -type MarkdownProps = { - content: string, - promptLinks?: boolean, -}; - -const SimpleLink = ({ href, title, children }) => ( - - {children} - -); - const MarkdownPreview = (props: MarkdownProps) => { - const { content, externalLinks, promptLinks } = props; + const { content, promptLinks } = props; const remarkOptions = { sanitize: schema, remarkReactComponents: { diff --git a/src/renderer/component/fileRender/view.jsx b/src/renderer/component/fileRender/view.jsx index b9901564e..80a3236a5 100644 --- a/src/renderer/component/fileRender/view.jsx +++ b/src/renderer/component/fileRender/view.jsx @@ -10,11 +10,11 @@ import HtmlViewer from 'component/viewers/htmlViewer'; type Props = { mediaType: string, source: { + stream: string => void, fileName: string, fileType: string, + contentType: string, downloadPath: string, - stream: opts => void, - blob: callback => void, }, currentTheme: string, }; diff --git a/src/renderer/component/viewers/codeViewer.jsx b/src/renderer/component/viewers/codeViewer.jsx index 1d5164468..d10f3135c 100644 --- a/src/renderer/component/viewers/codeViewer.jsx +++ b/src/renderer/component/viewers/codeViewer.jsx @@ -1,6 +1,6 @@ // @flow -import React from 'react'; +import * as React from 'react'; import CodeMirror from 'codemirror/lib/codemirror'; import { openSnippetMenu, stopContextMenu } from 'util/contextMenu'; @@ -22,21 +22,20 @@ import 'codemirror/mode/javascript/javascript'; type Props = { theme: string, - value: string, + value: ?string, contentType: string, }; class CodeViewer extends React.PureComponent { - constructor(props) { + constructor(props: Props) { super(props); this.codeMirror = null; - this.textarea = React.createRef(); } componentDidMount() { const { theme, contentType } = this.props; // Init CodeMirror - this.codeMirror = CodeMirror.fromTextArea(this.textarea.current, { + this.codeMirror = CodeMirror.fromTextArea(this.textarea, { // Auto detect syntax with file contentType mode: contentType, // Adaptive theme @@ -54,11 +53,14 @@ class CodeViewer extends React.PureComponent { this.codeMirror.on('contextmenu', openSnippetMenu); } + textarea: ?HTMLTextAreaElement; + codeMirror: any; + render() { const { value } = this.props; return (
-