diff --git a/ACKNOWLEDGMENTS.md b/ACKNOWLEDGMENTS.md index 9bc960375..96aa45899 100644 --- a/ACKNOWLEDGMENTS.md +++ b/ACKNOWLEDGMENTS.md @@ -5,6 +5,10 @@ Signal Desktop makes use of the following open source projects. +## @popperjs/core + + License: MIT + ## @sindresorhus/is MIT License @@ -2478,10 +2482,6 @@ Signal Desktop makes use of the following open source projects. License: MIT -## popper.js - - License: MIT - ## protobufjs This license applies to all parts of protobuf.js except those files diff --git a/package.json b/package.json index 3b77c518a..da9ed4bee 100644 --- a/package.json +++ b/package.json @@ -69,6 +69,7 @@ "fs-xattr": "0.3.0" }, "dependencies": { + "@popperjs/core": "2.9.2", "@signalapp/signal-client": "0.8.1", "@sindresorhus/is": "0.8.0", "@types/pino": "6.3.6", @@ -123,7 +124,6 @@ "pify": "3.0.0", "pino": "6.11.1", "pino-multi-stream": "5.3.0", - "popper.js": "1.15.0", "protobufjs": "6.10.2", "proxy-agent": "4.0.1", "quill": "1.3.7", @@ -135,7 +135,7 @@ "react-dropzone": "10.1.7", "react-hot-loader": "4.12.11", "react-measure": "2.3.0", - "react-popper": "1.3.7", + "react-popper": "2.2.5", "react-quill": "2.0.0-beta.2", "react-redux": "7.1.0", "react-router-dom": "5.0.1", diff --git a/sticker-creator/components/StickerFrame.tsx b/sticker-creator/components/StickerFrame.tsx index 5b7dfbf1d..94d4c178d 100644 --- a/sticker-creator/components/StickerFrame.tsx +++ b/sticker-creator/components/StickerFrame.tsx @@ -1,4 +1,4 @@ -// Copyright 2019-2020 Signal Messenger, LLC +// Copyright 2019-2021 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only import * as React from 'react'; @@ -260,7 +260,12 @@ export const StickerFrame = React.memo( previewActive && previewPopperRoot ? createPortal( - + {({ ref, style, arrowProps, placement }) => ( ); -const getBaseClass = (placement?: Placement) => { - if (placement === 'top') { - return styles.top; - } - - if (placement === 'right') { - return styles.right; - } - - if (placement === 'left') { - return styles.left; - } - - return styles.bottom; -}; - const getArrowClass = (placement?: Placement) => { if (placement === 'top') { return styles.arrowBottom; @@ -64,7 +48,7 @@ export const StickerPreview = React.memo( const i18n = useI18n(); return ( -
+
{arrowProps ? (
{menuShowing && popperRoot ? createPortal( - + {({ ref, style, placement }) => (
= ({ )} - + {({ arrowProps, placement, ref, style }) => showTooltip && (
) => void; @@ -1429,7 +1430,7 @@ export class Message extends React.Component { {reactionPickerRoot && createPortal( // eslint-disable-next-line consistent-return - + {({ ref, style }) => ( {open && popperRoot ? createPortal( - + {({ ref, style }) => ( {!open && !showIntroduction && installedPack ? ( - + {({ ref, style, placement, arrowProps }) => (