Fix lintineg errors

This commit is contained in:
Reece
2025-09-26 16:39:38 +01:00
parent 50e60d4972
commit 3fdbf425b4
15 changed files with 26 additions and 40 deletions

View File

@@ -1,5 +1,5 @@
import React, { useState } from 'react';
import { Stack, Tabs, Alert, Text } from '@mantine/core';
import { Stack, Alert, Text } from '@mantine/core';
import { useTranslation } from 'react-i18next';
import { DrawingControls } from './DrawingControls';
import { ColorPicker } from './ColorPicker';
@@ -29,10 +29,8 @@ export const BaseAnnotationTool: React.FC<BaseAnnotationToolProps> = ({
const { t } = useTranslation();
const {
activateSignaturePlacementMode,
deactivateDrawMode,
undo,
redo,
isPlacementMode
redo
} = usePDFAnnotation();
const [selectedColor, setSelectedColor] = useState('#000000');

View File

@@ -41,7 +41,7 @@ export const DrawingCanvas: React.FC<DrawingCanvasProps> = ({
const [isDrawing, setIsDrawing] = useState(false);
const [isModalDrawing, setIsModalDrawing] = useState(false);
const [isModalOpen, setIsModalOpen] = useState(false);
const [signatureData, setSignatureData] = useState<string | null>(null);
const [, setSignatureData] = useState<string | null>(null);
// Drawing functions for main canvas
const startDrawing = useCallback((e: React.MouseEvent<HTMLCanvasElement>) => {

View File

@@ -1,9 +1,7 @@
import React, { useState } from 'react';
import { Stack, Paper, Text, Group } from '@mantine/core';
import { Stack } from '@mantine/core';
import { BaseAnnotationTool } from '../shared/BaseAnnotationTool';
import { DrawingCanvas } from '../shared/DrawingCanvas';
import { ColorSwatchButton } from '../shared/ColorPicker';
import PenSizeSelector from '../../tools/sign/PenSizeSelector';
interface DrawingToolProps {
onDrawingChange?: (data: string | null) => void;
@@ -14,7 +12,7 @@ export const DrawingTool: React.FC<DrawingToolProps> = ({
onDrawingChange,
disabled = false
}) => {
const [selectedColor, setSelectedColor] = useState('#000000');
const [selectedColor] = useState('#000000');
const [penSize, setPenSize] = useState(2);
const [penSizeInput, setPenSizeInput] = useState('2');

View File

@@ -12,7 +12,7 @@ export const ImageTool: React.FC<ImageToolProps> = ({
onImageChange,
disabled = false
}) => {
const [imageData, setImageData] = useState<string | null>(null);
const [, setImageData] = useState<string | null>(null);
const handleImageUpload = async (file: File | null) => {
if (file && !disabled) {

View File

@@ -17,11 +17,6 @@ import { ViewerContext } from '../../contexts/ViewerContext';
import { useSignature } from '../../contexts/SignatureContext';
import { parseSelection } from '../../utils/bulkselection/parseSelection';
import { flattenSignatures } from '../../utils/signatureFlattening';
import { PDFDocument, rgb } from 'pdf-lib';
import { generateThumbnailWithMetadata } from '../../utils/thumbnailUtils';
import { createProcessedFile } from '../../contexts/file/fileActions';
import { createNewStirlingFileStub, createStirlingFile } from '../../types/fileContext';
export default function RightRail() {

View File

@@ -1,6 +1,6 @@
import React, { useState, useEffect } from 'react';
import { useTranslation } from "react-i18next";
import { Stack, Button, Text, Alert, Tabs, Group, Paper } from '@mantine/core';
import { Stack, Button, Text, Alert, Tabs } from '@mantine/core';
import { SignParameters } from "../../../hooks/tools/sign/useSignParameters";
import { SuggestedToolsSection } from "../shared/SuggestedToolsSection";
@@ -28,10 +28,8 @@ const SignSettings = ({
parameters,
onParameterChange,
disabled = false,
onActivateDrawMode,
onActivateSignaturePlacement,
onDeactivateSignature,
onUpdateDrawSettings,
onUndo,
onRedo,
onSave

View File

@@ -189,7 +189,7 @@ const EmbedPdfViewerContent = ({
enableSignature={isSignatureMode}
signatureApiRef={signatureApiRef as React.RefObject<any>}
historyApiRef={historyApiRef as React.RefObject<any>}
onSignatureAdded={(annotation) => {
onSignatureAdded={() => {
// Handle signature added - for debugging, enable console logs as needed
// Future: Handle signature completion
}}

View File

@@ -1,4 +1,4 @@
import React, { useImperativeHandle, forwardRef, useEffect } from 'react';
import { useImperativeHandle, forwardRef, useEffect } from 'react';
import { useHistoryCapability } from '@embedpdf/plugin-history/react';
import { useAnnotationCapability } from '@embedpdf/plugin-annotation/react';
import { useSignature } from '../../contexts/SignatureContext';
@@ -11,9 +11,10 @@ export interface HistoryAPI {
canRedo: () => boolean;
}
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
export interface HistoryAPIBridgeProps {}
export const HistoryAPIBridge = forwardRef<HistoryAPI, HistoryAPIBridgeProps>((props, ref) => {
export const HistoryAPIBridge = forwardRef<HistoryAPI, HistoryAPIBridgeProps>(function HistoryAPIBridge(_props, ref) {
const { provides: historyApi } = useHistoryCapability();
const { provides: annotationApi } = useAnnotationCapability();
const { getImageData, storeImageData } = useSignature();
@@ -38,7 +39,7 @@ export const HistoryAPIBridge = forwardRef<HistoryAPI, HistoryAPIBridgeProps>((p
if (event.type === 'create' && event.committed) {
// Check if this is a STAMP annotation (signature) that might need image data restoration
if (annotation && annotation.type === 13 && annotation.id) {
const storedImageData = getImageData(annotation.id);
getImageData(annotation.id);
// Delay the check to allow the annotation to be fully created
setTimeout(() => {

View File

@@ -1,4 +1,4 @@
import React, { useEffect, useMemo, useState, useRef } from 'react';
import React, { useEffect, useMemo, useState } from 'react';
import { createPluginRegistration } from '@embedpdf/core';
import { EmbedPDF } from '@embedpdf/core/react';
import { usePdfiumEngine } from '@embedpdf/engines/react';
@@ -22,7 +22,7 @@ import { Rotation } from '@embedpdf/models';
// Import annotation plugins
import { HistoryPluginPackage } from '@embedpdf/plugin-history/react';
import { AnnotationLayer, AnnotationPluginPackage, useAnnotationCapability } from '@embedpdf/plugin-annotation/react';
import { AnnotationLayer, AnnotationPluginPackage } from '@embedpdf/plugin-annotation/react';
import { PdfAnnotationSubtype } from '@embedpdf/models';
import { CustomSearchLayer } from './CustomSearchLayer';
import { ZoomAPIBridge } from './ZoomAPIBridge';
@@ -50,7 +50,7 @@ interface LocalEmbedPDFProps {
export function LocalEmbedPDF({ file, url, enableSignature = false, onSignatureAdded, signatureApiRef, historyApiRef }: LocalEmbedPDFProps) {
const [pdfUrl, setPdfUrl] = useState<string | null>(null);
const [annotations, setAnnotations] = useState<Array<{id: string, pageIndex: number, rect: any}>>([]);
const [, setAnnotations] = useState<Array<{id: string, pageIndex: number, rect: any}>>([]);
// Convert File to URL if needed
useEffect(() => {

View File

@@ -21,7 +21,7 @@ import { Rotation } from '@embedpdf/models';
// Import annotation plugins
import { HistoryPluginPackage } from '@embedpdf/plugin-history/react';
import { AnnotationLayer, AnnotationPluginPackage, useAnnotationCapability } from '@embedpdf/plugin-annotation/react';
import { AnnotationLayer, AnnotationPluginPackage } from '@embedpdf/plugin-annotation/react';
import { PdfAnnotationSubtype } from '@embedpdf/models';
import { CustomSearchLayer } from './CustomSearchLayer';

View File

@@ -1,4 +1,4 @@
import React, { useImperativeHandle, forwardRef, useEffect } from 'react';
import { useImperativeHandle, forwardRef, useEffect } from 'react';
import { useAnnotationCapability } from '@embedpdf/plugin-annotation/react';
import { PdfAnnotationSubtype, PdfStandardFont, PdfTextAlignment, PdfVerticalAlignment, uuidV4 } from '@embedpdf/models';
import { SignParameters } from '../../hooks/tools/sign/useSignParameters';
@@ -17,9 +17,10 @@ export interface SignatureAPI {
getPageAnnotations: (pageIndex: number) => Promise<any[]>;
}
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
export interface SignatureAPIBridgeProps {}
export const SignatureAPIBridge = forwardRef<SignatureAPI, SignatureAPIBridgeProps>((props, ref) => {
export const SignatureAPIBridge = forwardRef<SignatureAPI, SignatureAPIBridgeProps>((_props, ref) => {
const { provides: annotationApi } = useAnnotationCapability();
const { signatureConfig, storeImageData } = useSignature();