diff --git a/packages/web/components/templates/article/HighlightsLayer.tsx b/packages/web/components/templates/article/HighlightsLayer.tsx index 1bc09ff2d..6ee2145eb 100644 --- a/packages/web/components/templates/article/HighlightsLayer.tsx +++ b/packages/web/components/templates/article/HighlightsLayer.tsx @@ -18,7 +18,6 @@ import { HighlightBar, HighlightAction } from '../../patterns/HighlightBar' import { removeHighlights } from '../../../lib/highlights/deleteHighlight' import { createHighlight } from '../../../lib/highlights/createHighlight' import { HighlightNoteModal } from './HighlightNoteModal' -import { ShareHighlightModal } from './ShareHighlightModal' import { NotebookModal } from './NotebookModal' import { useCanShareNative } from '../../../lib/hooks/useCanShareNative' import { showErrorToast } from '../../../lib/toastHelpers' @@ -69,15 +68,13 @@ export function HighlightsLayer(props: HighlightsLayerProps): JSX.Element { >([]) const focusedHighlightMousePos = useRef({ pageX: 0, pageY: 0 }) - const [focusedHighlight, setFocusedHighlight] = useState< - Highlight | undefined - >(undefined) + const [focusedHighlight, setFocusedHighlight] = + useState(undefined) const [selectionData, setSelectionData] = useSelection(highlightLocations) - const [labelsTarget, setLabelsTarget] = useState( - undefined - ) + const [labelsTarget, setLabelsTarget] = + useState(undefined) const canShareNative = useCanShareNative() @@ -616,23 +613,6 @@ export function HighlightsLayer(props: HighlightsLayerProps): JSX.Element { ) } - if ( - highlightModalAction?.highlightModalAction == 'share' && - highlightModalAction.highlight - ) { - return ( - { - setHighlightModalAction({ highlightModalAction: 'none' }) - }} - /> - ) - } - // Display the button bar if we are not in the native app and there // is a focused highlight or selection data if (!props.highlightBarDisabled && (focusedHighlight || selectionData)) { diff --git a/packages/web/components/templates/article/PdfArticleContainer.tsx b/packages/web/components/templates/article/PdfArticleContainer.tsx index 2437cf83c..e297c1ded 100644 --- a/packages/web/components/templates/article/PdfArticleContainer.tsx +++ b/packages/web/components/templates/article/PdfArticleContainer.tsx @@ -11,7 +11,6 @@ import { createHighlightMutation } from '../../../lib/networking/mutations/creat import { deleteHighlightMutation } from '../../../lib/networking/mutations/deleteHighlightMutation' import { articleReadingProgressMutation } from '../../../lib/networking/mutations/articleReadingProgressMutation' import { mergeHighlightMutation } from '../../../lib/networking/mutations/mergeHighlightMutation' -import { ShareHighlightModal } from './ShareHighlightModal' import { useCanShareNative } from '../../../lib/hooks/useCanShareNative' import { webBaseURL } from '../../../lib/appConfig' import { pspdfKitKey } from '../../../lib/appConfig' @@ -30,14 +29,12 @@ export default function PdfArticleContainer( props: PdfArticleContainerProps ): JSX.Element { const containerRef = useRef(null) - const [shareTarget, setShareTarget] = useState( - undefined - ) + const [shareTarget, setShareTarget] = + useState(undefined) const [notebookKey, setNotebookKey] = useState(uuidv4()) const [noteTarget, setNoteTarget] = useState(undefined) - const [noteTargetPageIndex, setNoteTargetPageIndex] = useState< - number | undefined - >(undefined) + const [noteTargetPageIndex, setNoteTargetPageIndex] = + useState(undefined) const highlightsRef = useRef([]) const canShareNative = useCanShareNative() @@ -459,17 +456,6 @@ export default function PdfArticleContainer( return (
- {shareTarget && ( - { - setShareTarget(undefined) - }} - /> - )} {noteTarget && ( void -} - -export function ShareHighlightModal( - props: ShareHighlightModalProps -): JSX.Element { - return ( - - - - ) -} diff --git a/packages/web/next.config.js b/packages/web/next.config.js index 16ae40aa3..8d3c2378a 100644 --- a/packages/web/next.config.js +++ b/packages/web/next.config.js @@ -1,4 +1,3 @@ - const moduleExports = { images: { domains: [ @@ -148,4 +147,7 @@ const moduleExports = { }, } -module.exports = moduleExports +const withBundleAnalyzer = require('@next/bundle-analyzer')({ + enabled: process.env.ANALYZE === 'true', +}) +module.exports = withBundleAnalyzer(moduleExports) diff --git a/packages/web/package.json b/packages/web/package.json index 0278a7335..c4e1f68dc 100644 --- a/packages/web/package.json +++ b/packages/web/package.json @@ -59,6 +59,7 @@ }, "devDependencies": { "@babel/core": "^7.17.5", + "@next/bundle-analyzer": "^13.2.1", "@storybook/addon-actions": "^6.4.22", "@storybook/addon-essentials": "^6.4.22", "@storybook/addon-interactions": "^6.4.22", diff --git a/yarn.lock b/yarn.lock index 4a28485e7..fc1096aad 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4276,6 +4276,13 @@ resolved "https://registry.yarnpkg.com/@n1ru4l/graphql-live-query/-/graphql-live-query-0.9.0.tgz#defaebdd31f625bee49e6745934f36312532b2bc" integrity sha512-BTpWy1e+FxN82RnLz4x1+JcEewVdfmUhV1C6/XYD5AjS7PQp9QFF7K8bCD6gzPTr2l+prvqOyVueQhFJxB1vfg== +"@next/bundle-analyzer@^13.2.1": + version "13.2.1" + resolved "https://registry.yarnpkg.com/@next/bundle-analyzer/-/bundle-analyzer-13.2.1.tgz#a80bf24adef2380233c9e3cd9f5c77849c851b36" + integrity sha512-ex5CyyqWfBaDE0eguyhWlWZAsg2n9zN1c/YK4FNui7C/cKnjib5FcZeVNeKU9PfSYXDDT9onIhWkhsMNQwIGVg== + dependencies: + webpack-bundle-analyzer "4.7.0" + "@next/env@12.1.6": version "12.1.6" resolved "https://registry.yarnpkg.com/@next/env/-/env-12.1.6.tgz#5f44823a78335355f00f1687cfc4f1dafa3eca08" @@ -26786,6 +26793,21 @@ webidl-conversions@^6.1.0: resolved "https://registry.yarnpkg.com/webidl-conversions/-/webidl-conversions-6.1.0.tgz#9111b4d7ea80acd40f5270d666621afa78b69514" integrity sha512-qBIvFLGiBpLjfwmYAaHPXsn+ho5xZnGvyGvsarywGNc8VyQJUMHJ8OBKGGrPER0okBeMDaan4mNBlgBROxuI8w== +webpack-bundle-analyzer@4.7.0: + version "4.7.0" + resolved "https://registry.yarnpkg.com/webpack-bundle-analyzer/-/webpack-bundle-analyzer-4.7.0.tgz#33c1c485a7fcae8627c547b5c3328b46de733c66" + integrity sha512-j9b8ynpJS4K+zfO5GGwsAcQX4ZHpWV+yRiHDiL+bE0XHJ8NiPYLTNVQdlFYWxtpg9lfAQNlwJg16J9AJtFSXRg== + dependencies: + acorn "^8.0.4" + acorn-walk "^8.0.0" + chalk "^4.1.0" + commander "^7.2.0" + gzip-size "^6.0.0" + lodash "^4.17.20" + opener "^1.5.2" + sirv "^1.0.7" + ws "^7.3.1" + webpack-bundle-analyzer@^4.5.0: version "4.5.0" resolved "https://registry.yarnpkg.com/webpack-bundle-analyzer/-/webpack-bundle-analyzer-4.5.0.tgz#1b0eea2947e73528754a6f9af3e91b2b6e0f79d5"