mirror of
https://github.com/Stirling-Tools/Stirling-PDF.git
synced 2025-09-20 10:39:30 +00:00
clean up
This commit is contained in:
parent
1598057ed0
commit
dc71b3007b
@ -24,7 +24,7 @@ const EmbedPdfViewerContent = ({
|
|||||||
previewFile,
|
previewFile,
|
||||||
}: EmbedPdfViewerProps) => {
|
}: EmbedPdfViewerProps) => {
|
||||||
const theme = useMantineTheme();
|
const theme = useMantineTheme();
|
||||||
const { colorScheme } = useMantineColorScheme();
|
const { colorScheme: _colorScheme } = useMantineColorScheme();
|
||||||
const viewerRef = React.useRef<HTMLDivElement>(null);
|
const viewerRef = React.useRef<HTMLDivElement>(null);
|
||||||
const [isViewerHovered, setIsViewerHovered] = React.useState(false);
|
const [isViewerHovered, setIsViewerHovered] = React.useState(false);
|
||||||
const { isThumbnailSidebarVisible, toggleThumbnailSidebar, zoomActions, spreadActions, panActions: _panActions, rotationActions: _rotationActions, getScrollState, getZoomState, getSpreadState } = useViewer();
|
const { isThumbnailSidebarVisible, toggleThumbnailSidebar, zoomActions, spreadActions, panActions: _panActions, rotationActions: _rotationActions, getScrollState, getZoomState, getSpreadState } = useViewer();
|
||||||
@ -66,8 +66,6 @@ const EmbedPdfViewerContent = ({
|
|||||||
|
|
||||||
// Handle scroll wheel zoom
|
// Handle scroll wheel zoom
|
||||||
React.useEffect(() => {
|
React.useEffect(() => {
|
||||||
let accumulator = 0;
|
|
||||||
|
|
||||||
const handleWheel = (event: WheelEvent) => {
|
const handleWheel = (event: WheelEvent) => {
|
||||||
// Check if Ctrl (Windows/Linux) or Cmd (Mac) is pressed
|
// Check if Ctrl (Windows/Linux) or Cmd (Mac) is pressed
|
||||||
if (event.ctrlKey || event.metaKey) {
|
if (event.ctrlKey || event.metaKey) {
|
||||||
|
@ -7,7 +7,7 @@ import { usePdfiumEngine } from '@embedpdf/engines/react';
|
|||||||
import { Viewport, ViewportPluginPackage } from '@embedpdf/plugin-viewport/react';
|
import { Viewport, ViewportPluginPackage } from '@embedpdf/plugin-viewport/react';
|
||||||
import { Scroller, ScrollPluginPackage, ScrollStrategy } from '@embedpdf/plugin-scroll/react';
|
import { Scroller, ScrollPluginPackage, ScrollStrategy } from '@embedpdf/plugin-scroll/react';
|
||||||
import { LoaderPluginPackage } from '@embedpdf/plugin-loader/react';
|
import { LoaderPluginPackage } from '@embedpdf/plugin-loader/react';
|
||||||
import { RenderLayer, RenderPluginPackage } from '@embedpdf/plugin-render/react';
|
import { RenderPluginPackage } from '@embedpdf/plugin-render/react';
|
||||||
import { ZoomPluginPackage } from '@embedpdf/plugin-zoom/react';
|
import { ZoomPluginPackage } from '@embedpdf/plugin-zoom/react';
|
||||||
import { InteractionManagerPluginPackage, PagePointerProvider, GlobalPointerProvider } from '@embedpdf/plugin-interaction-manager/react';
|
import { InteractionManagerPluginPackage, PagePointerProvider, GlobalPointerProvider } from '@embedpdf/plugin-interaction-manager/react';
|
||||||
import { SelectionLayer, SelectionPluginPackage } from '@embedpdf/plugin-selection/react';
|
import { SelectionLayer, SelectionPluginPackage } from '@embedpdf/plugin-selection/react';
|
||||||
|
@ -41,7 +41,7 @@ export function PdfViewerToolbar({
|
|||||||
|
|
||||||
// Register for immediate scroll updates and sync with actual scroll state
|
// Register for immediate scroll updates and sync with actual scroll state
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
registerImmediateScrollUpdate((currentPage, totalPages) => {
|
registerImmediateScrollUpdate((currentPage, _totalPages) => {
|
||||||
setPageInput(currentPage);
|
setPageInput(currentPage);
|
||||||
});
|
});
|
||||||
setPageInput(scrollState.currentPage);
|
setPageInput(scrollState.currentPage);
|
||||||
|
@ -61,7 +61,7 @@ export function ThumbnailSidebar({ visible, onToggle: _onToggle }: ThumbnailSide
|
|||||||
};
|
};
|
||||||
|
|
||||||
generateThumbnails();
|
generateThumbnails();
|
||||||
}, [visible, scrollState.totalPages, thumbnailAPI, thumbnails]);
|
}, [visible, scrollState.totalPages, thumbnailAPI]);
|
||||||
|
|
||||||
const handlePageClick = (pageIndex: number) => {
|
const handlePageClick = (pageIndex: number) => {
|
||||||
const pageNumber = pageIndex + 1; // Convert to 1-based
|
const pageNumber = pageIndex + 1; // Convert to 1-based
|
||||||
|
@ -30,6 +30,17 @@
|
|||||||
--color-primary-800: #1e40af;
|
--color-primary-800: #1e40af;
|
||||||
--color-primary-900: #1e3a8a;
|
--color-primary-900: #1e3a8a;
|
||||||
|
|
||||||
|
--color-red-50: #fef2f2;
|
||||||
|
--color-red-100: #fee2e2;
|
||||||
|
--color-red-200: #fecaca;
|
||||||
|
--color-red-300: #fca5a5;
|
||||||
|
--color-red-400: #f87171;
|
||||||
|
--color-red-500: #ef4444;
|
||||||
|
--color-red-600: #dc2626;
|
||||||
|
--color-red-700: #b91c1c;
|
||||||
|
--color-red-800: #991b1b;
|
||||||
|
--color-red-900: #7f1d1d;
|
||||||
|
|
||||||
--color-gray-50: #f9fafb;
|
--color-gray-50: #f9fafb;
|
||||||
--color-gray-100: #f3f4f6;
|
--color-gray-100: #f3f4f6;
|
||||||
--color-gray-200: #e5e7eb;
|
--color-gray-200: #e5e7eb;
|
||||||
@ -199,6 +210,17 @@
|
|||||||
--border: 55 65 81;
|
--border: 55 65 81;
|
||||||
|
|
||||||
/* Dark theme Mantine colors */
|
/* Dark theme Mantine colors */
|
||||||
|
--color-red-50: #2d1b1b;
|
||||||
|
--color-red-100: #3a2323;
|
||||||
|
--color-red-200: #4a2d2d;
|
||||||
|
--color-red-300: #5c3535;
|
||||||
|
--color-red-400: #7c4a4a;
|
||||||
|
--color-red-500: #ef4444;
|
||||||
|
--color-red-600: #dc2626;
|
||||||
|
--color-red-700: #b91c1c;
|
||||||
|
--color-red-800: #991b1b;
|
||||||
|
--color-red-900: #7f1d1d;
|
||||||
|
|
||||||
--color-gray-50: #111827;
|
--color-gray-50: #111827;
|
||||||
--color-gray-100: #1F2329;
|
--color-gray-100: #1F2329;
|
||||||
--color-gray-200: #2A2F36;
|
--color-gray-200: #2A2F36;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user