diff --git a/editors/editoria/src/EditorConfig.js b/editors/editoria/src/EditorConfig.js index e6f8538187f71702143dd497d824706f9a850078..1d0e2400863c6d7de810bd603f1e8574f7fa4bd9 100644 --- a/editors/editoria/src/EditorConfig.js +++ b/editors/editoria/src/EditorConfig.js @@ -75,7 +75,6 @@ const keys = new CreateShortCuts({ schema, shortCuts }); const plugins = [ columnResizing(), tableEditing(), - // LinkToolTipPlugin, TrackChangePlugin({ options: {} }), invisibles([hardBreak()]) ]; diff --git a/wax-prosemirror-components/index.js b/wax-prosemirror-components/index.js index 6cf409f3018453d20bae098869721dddbb0e9e7f..9b8a5e7d67e183e93b9082b88614463b6b987323 100644 --- a/wax-prosemirror-components/index.js +++ b/wax-prosemirror-components/index.js @@ -1,3 +1,2 @@ export { default as MainMenuBar } from "./src/mainMenuBar/MainMenuBar"; export { default as SideMenuBar } from "./src/sideMenuBar/SideMenuBar"; -export { default as LinkToolTip } from "./src/linkToolTip/LinkToolTip"; diff --git a/wax-prosemirror-components/src/linkToolTip/LinkToolTip.js b/wax-prosemirror-components/src/linkToolTip/LinkToolTip.js deleted file mode 100644 index fd14e3e715b3d71c7d8f86029944d9d493874ce7..0000000000000000000000000000000000000000 --- a/wax-prosemirror-components/src/linkToolTip/LinkToolTip.js +++ /dev/null @@ -1,18 +0,0 @@ -import React, { Component } from "react"; -import { EditorView } from "prosemirror-view"; -import "./linktooltip.css"; - -class LinkToolTip extends React.Component { - render() { - const { href, onEdit, onRemove } = this.props; - return ( - <div className="wax-link-tooltip"> - <div className="wax-link-tooltip-body"> - <div className="wax-link-tooltip-row">Link tooltip</div> - </div> - </div> - ); - } -} - -export default LinkToolTip; diff --git a/wax-prosemirror-components/src/linkToolTip/linktooltip.css b/wax-prosemirror-components/src/linkToolTip/linktooltip.css deleted file mode 100644 index aff9aa60f7ae2cba3edf4073adf1b7dd5d60c0ac..0000000000000000000000000000000000000000 --- a/wax-prosemirror-components/src/linkToolTip/linktooltip.css +++ /dev/null @@ -1,61 +0,0 @@ -/*@import "./wax-custom-button.css";*/ -.wax-link-tooltip { - display: flex; - justify-content: center; - left: -150px; - pointer-events: none; - position: absolute; - top: -70px; - width: 400px; -} - -.wax-link-tooltip .wax-custom-button { - margin: 0 3px; -} - -.wax-link-tooltip-href { - border: none; - color: var(--wax-link-color); - display: inline-block; - flex: 1; - margin: 0 6px 0 0; - max-width: 200px; - overflow: hidden; - padding: 6px 0; - position: relative; - text-overflow: ellipsis; - vertical-align: middle; - white-space: nowrap; - z-index: 2; -} - -.wax-link-tooltip-row { - direction: row; - display: flex; -} - -.wax-link-tooltip-body { - background: #fff; - border-radius: var(--wax-overlay-radius); - box-shadow: var(--wax-overlay-shadow); - box-sizing: border-box; - display: inline-block; - font-family: var(--wax-font-family); - font-size: var(--wax-font-size); - max-width: 400px; - padding: 10px; - pointer-events: auto; -} - -.wax-link-tooltip-body::after { - background-color: #fff; - box-shadow: 2px 2px 2px rgba(0, 0, 0, 0.26); - content: ""; - height: 20px; - left: 35%; - position: absolute; - top: 37px; - width: 20px; - transform: rotate(45deg); - z-index: 1; -} diff --git a/wax-prosemirror-plugins/index.js b/wax-prosemirror-plugins/index.js index e73e55f58cb450a164dd3f5c2ad8702bd7804a5e..71af7e529ce957df1da80b7e1e382146e21b738f 100644 --- a/wax-prosemirror-plugins/index.js +++ b/wax-prosemirror-plugins/index.js @@ -1,4 +1,3 @@ -export { default as LinkToolTipPlugin } from "./src/LinkToolTipPlugin"; export { default as TrackChangePlugin } from "./src/trackChanges/TrackChangePlugin"; diff --git a/wax-prosemirror-plugins/src/LinkToolTipPlugin.js b/wax-prosemirror-plugins/src/LinkToolTipPlugin.js deleted file mode 100644 index a311bc0350eb7ed41a3186e97eedccfe5eccca03..0000000000000000000000000000000000000000 --- a/wax-prosemirror-plugins/src/LinkToolTipPlugin.js +++ /dev/null @@ -1,58 +0,0 @@ -import { EditorState, Plugin } from "prosemirror-state"; -import { TextSelection } from "prosemirror-state"; -import { EditorView } from "prosemirror-view"; - -const LinkToolTipPlugin = new Plugin({ - view(editorView) { - return new LinkToolTip(editorView); - } -}); - -class LinkToolTip { - constructor(view) { - this.tooltip = document.createElement("div"); - this.tooltip.className = "tooltip"; - - view.dom.appendChild(this.tooltip); - - this.update(view, null); - } - - update(view, lastState) { - let state = view.state; - // Don't do anything if the document/selection didn't change - if ( - lastState && - lastState.doc.eq(state.doc) && - lastState.selection.eq(state.selection) - ) - return; - - // Hide the tooltip if the selection is empty - if (state.selection.empty) { - this.tooltip.style.display = "none"; - return; - } - - // Otherwise, reposition it and update its content - this.tooltip.style.display = ""; - let { from, to } = state.selection; - // These are in screen coordinates - let start = view.coordsAtPos(from), - end = view.coordsAtPos(to); - // The box in which the tooltip is positioned, to use as base - let box = this.tooltip.offsetParent.getBoundingClientRect(); - // Find a center-ish x position from the selection endpoints (when - // crossing lines, end may be more to the left) - let left = Math.max((start.left + end.left) / 2, start.left + 3); - this.tooltip.style.left = left - box.left + "px"; - this.tooltip.style.bottom = box.bottom - start.top + "px"; - this.tooltip.textContent = to - from; - } - - destroy() { - this.tooltip.remove(); - } -} - -export default LinkToolTipPlugin;