Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 12 additions & 10 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,29 +18,31 @@
"react": "^19.2.8",
"react-dom": "^19.2.8",
"pdf-lib": "^1.17.1",
"pdfjs-dist": "^4.9.155",
"pdfjs-dist": "^6.1.200",
"jszip": "^3.10.1",
"downloadjs": "^1.4.7"
},
"devDependencies": {
"@testing-library/jest-dom": "^6.9.1",
"@tailwindcss/postcss": "^4.3.3",
"@testing-library/dom": "^10.4.1",
"@testing-library/jest-dom": "^7.0.0",
"@testing-library/react": "^16.3.2",
"@types/react": "^19.2.0",
"@types/react-dom": "^19.2.3",
"@types/downloadjs": "^1.4.3",
"jsdom": "^25.0.1",
"jsdom": "^30.0.0",
"@typescript-eslint/eslint-plugin": "^8.65.0",
"@typescript-eslint/parser": "^8.15.0",
"@vitejs/plugin-react": "^4.3.4",
"@vitejs/plugin-react": "^6.0.4",
"autoprefixer": "^10.5.4",
"eslint": "^9.15.0",
"eslint-plugin-react-hooks": "^5.0.0",
"eslint-plugin-react-refresh": "^0.4.14",
"eslint": "^10.8.0",
"eslint-plugin-react-hooks": "^7.1.1",
"eslint-plugin-react-refresh": "^0.5.3",
"postcss": "^8.5.22",
"tailwindcss": "^3.4.15",
"tailwindcss": "^4.3.3",
"typescript": "~7.0.2",
"vite": "^6.0.1",
"vitest": "^2.1.8"
"vite": "^8.1.5",
"vitest": "^4.1.10"
},
"keywords": [
"pdf",
Expand Down
2 changes: 1 addition & 1 deletion postcss.config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
export default {
plugins: {
tailwindcss: {},
'@tailwindcss/postcss': {},
autoprefixer: {},
},
};
8 changes: 5 additions & 3 deletions src/index.css
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
@tailwind base;
@tailwind components;
@tailwind utilities;
@import "tailwindcss";

@theme {
--font-sans: 'Inter', '-apple-system', 'BlinkMacSystemFont', 'Segoe UI', 'Roboto', 'sans-serif';
}

@layer base {
body {
Expand Down
4 changes: 4 additions & 0 deletions src/services/pdfUtils.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ import { PDFDocument } from 'pdf-lib';
import { compressPdf, rotatePdf } from './pdfUtils';

vi.mock('downloadjs', () => ({ default: vi.fn() }));
vi.mock('pdfjs-dist', () => ({
GlobalWorkerOptions: { workerSrc: '' },
getDocument: vi.fn(),
}));

async function samplePdf(): Promise<File> {
const document = await PDFDocument.create();
Expand Down
2 changes: 1 addition & 1 deletion src/services/pdfUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ async function getPdfJsDoc(file: File, onProgress?: (progress: number) => void)
return pdfDocCache.get(fileKey);
}
const arrayBuffer = await fileToArrayBuffer(file);
const loadingTask = pdfjsLib.getDocument(arrayBuffer);
const loadingTask = pdfjsLib.getDocument({ data: arrayBuffer });

if (onProgress) {
loadingTask.onProgress = (data: { loaded: number, total: number }) => {
Expand Down