import { IconProp } from '@fortawesome/fontawesome-svg-core'; import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; import { Tooltip } from '@material-ui/core'; import { action, observable, runInAction } from 'mobx'; import { observer } from "mobx-react"; import { Doc, DocListCast } from '../../../fields/Doc'; import { Cast, StrCast } from '../../../fields/Types'; import { WebField } from '../../../fields/URLField'; import { emptyFunction, setupMoveUpEvents, returnFalse, returnTrue, returnEmptyDoclist, returnEmptyFilter } from '../../../Utils'; import { DocumentType } from '../../documents/DocumentTypes'; import { DocumentManager } from '../../util/DocumentManager'; import { DragManager } from '../../util/DragManager'; import { Hypothesis } from '../../util/HypothesisUtils'; import { LinkManager } from '../../util/LinkManager'; import { undoBatch } from '../../util/UndoManager'; import { DocumentLinksButton } from '../nodes/DocumentLinksButton'; import { DocumentView, DocumentViewSharedProps } from '../nodes/DocumentView'; import { LinkDocPreview } from '../nodes/LinkDocPreview'; import './LinkPopup.scss'; import React = require("react"); import { CurrentUserUtils } from '../../util/CurrentUserUtils'; import { DefaultStyleProvider } from '../StyleProvider'; import { Transform } from '../../util/Transform'; import { DocUtils } from '../../documents/Documents'; import { SearchBox } from '../search/SearchBox'; import { EditorView } from 'prosemirror-view'; import { FormattedTextBox } from '../nodes/formattedText/FormattedTextBox'; interface LinkPopupProps { showPopup: boolean; // groupType: string; // linkDoc: Doc; // docView: DocumentView; // sourceDoc: Doc; } /** * Popup component for creating links from text to Dash documents */ @observer export class LinkPopup extends React.Component { @observable private linkURL: string = ""; @observable public view?: EditorView; // TODO: should check for valid URL @undoBatch makeLinkToURL = (target: string, lcoation: string) => { ((this.view as any)?.TextView as FormattedTextBox).makeLinkAnchor(undefined, "onRadd:rightight", target, target); } @action onLinkChange = (e: React.ChangeEvent) => { this.linkURL = e.target.value; console.log(this.linkURL) } getPWidth = () => 500; getPHeight = () => 500; render() { const popupVisibility = this.props.showPopup ? "block" : "none"; return (

or

{/* */}
); } }