From 0d9d504aab344e04c47baa758ed7275ae87d2916 Mon Sep 17 00:00:00 2001 From: Paulo Gustavo Veiga Date: Wed, 5 Oct 2022 21:39:41 -0700 Subject: [PATCH] Disable text selection. --- .../src/components/styles/mindplot-styles.js | 4 + packages/mindplot/src/index.ts | 2 - packages/mindplot/src/mindplot-styles.css | 110 ------------------ .../history-dialog/index.tsx | 1 - 4 files changed, 4 insertions(+), 113 deletions(-) delete mode 100644 packages/mindplot/src/mindplot-styles.css diff --git a/packages/mindplot/src/components/styles/mindplot-styles.js b/packages/mindplot/src/components/styles/mindplot-styles.js index c67134b2..eefa7667 100644 --- a/packages/mindplot/src/components/styles/mindplot-styles.js +++ b/packages/mindplot/src/components/styles/mindplot-styles.js @@ -12,6 +12,10 @@ const mindplotStyles = ` background-image: linear-gradient(#ebe9e7 1px, transparent 1px), linear-gradient(to right, #ebe9e7 1px, #f2f2f2 1px); background-size: 50px 50px; + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; } .mindplot-svg-tooltip { diff --git a/packages/mindplot/src/index.ts b/packages/mindplot/src/index.ts index 51cd1b1e..3d073a71 100644 --- a/packages/mindplot/src/index.ts +++ b/packages/mindplot/src/index.ts @@ -51,8 +51,6 @@ import { $notify } from './components/widget/ToolbarNotifier'; import { $msg } from './components/Messages'; -import './mindplot-styles.css'; - const globalAny: any = global; globalAny.jQuery = jquery; // WebComponent registration diff --git a/packages/mindplot/src/mindplot-styles.css b/packages/mindplot/src/mindplot-styles.css deleted file mode 100644 index 3e566cdb..00000000 --- a/packages/mindplot/src/mindplot-styles.css +++ /dev/null @@ -1,110 +0,0 @@ -/* - DO NOT USE THIS FILE until we resolve how to import .css files into shadow dom - As a workaround, use the file mindplot-styles.js instead -*/ -.mindplot-svg-tooltip { - display: none; - color: rgb(51, 51, 51); - text-align: center; - padding: 1px; - border-radius: 6px; - position: absolute; - z-index: 999; - background-color: rgb(255, 255, 255); - animation: fadeIn 0.4s; -} - -.fade-in { - animation: fadeIn ease 0.4s; - -webkit-animation: fadeIn ease 0.4s; - -moz-animation: fadeIn ease 0.4s; - -o-animation: fadeIn ease 0.4s; - -ms-animation: fadeIn ease 0.4s; - } - - - @keyframes fadeIn { - 0% { opacity: 0; } - 100% { opacity: 1; } - } - - @-moz-keyframes fadeIn { - 0% { opacity: 0; } - 100% { opacity: 1; } - } - - @-webkit-keyframes fadeIn { - 0% { opacity: 0; } - 100% { opacity: 1; } - } - - @-o-keyframes fadeIn { - 0% { opacity: 0; } - 100% { opacity: 1; } - } - - @-ms-keyframes fadeIn { - 0% { opacity: 0; } - 100% { opacity: 1; } - } - -.mindplot-svg-tooltip-title { - background-color: rgb(247, 247, 247); - border-bottom-color: rgb(235, 235, 235); - border-bottom-left-radius: 0px; - border-bottom-right-radius: 0px; - border-bottom-style: solid; - border-bottom-width: 1px; - border-top-left-radius: 5px; - border-top-right-radius: 5px; - box-sizing: border-box; - color: rgb(51, 51, 51); - cursor: default; - display: block; - font-family: Arial; - padding: 8px 14px; - text-align: left; -} - -.mindplot-svg-tooltip-content { - background-color: rgb(255, 255, 255); - padding: 6px 4px; - max-width: 250px; -} - -.mindplot-svg-tooltip-content-link { - padding: 3px 5px; - overflow: hidden; -} - -.mindplot-svg-tooltip-content-note { - text-align: left; -} - -.mindplot-svg-tooltip:before { - content: ""; - position: absolute; - width: 0; - height: 0; - border-left: 10px solid transparent; - border-right: 10px solid transparent; - border-bottom: 10px solid #fff; - bottom: 100%; - right: 50%; - transform: translateX(50%); - z-index: 5; - } - - .mindplot-svg-tooltip:after { - content: ""; - display: block; - position: absolute; - width: 0; - height: 0; - border-left: 10px solid transparent; - border-right: 10px solid transparent; - border-bottom: 10px solid rgb(247, 247, 247); - bottom: calc(1px + 100%); - right: 50%; - transform: translateX(50%); - } diff --git a/packages/webapp/src/components/maps-page/action-dispatcher/history-dialog/index.tsx b/packages/webapp/src/components/maps-page/action-dispatcher/history-dialog/index.tsx index 00bf7ee4..70fedba0 100644 --- a/packages/webapp/src/components/maps-page/action-dispatcher/history-dialog/index.tsx +++ b/packages/webapp/src/components/maps-page/action-dispatcher/history-dialog/index.tsx @@ -20,7 +20,6 @@ import Paper from '@mui/material/Paper'; const HistoryDialog = ({ mapId, onClose }: SimpleDialogProps): React.ReactElement => { const intl = useIntl(); - const queryClient = useQueryClient(); const client: Client = useSelector(activeInstance); const { data } = useQuery( `history-${mapId}`,