@eternalheart/react-file-preview 1.0.0 → 1.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/types.d.ts CHANGED
@@ -26,4 +26,8 @@ export interface PreviewState {
26
26
  currentPage: number;
27
27
  totalPages: number;
28
28
  }
29
+ export interface CustomRenderer {
30
+ test: (file: PreviewFile) => boolean;
31
+ render: (file: PreviewFile) => React.ReactNode;
32
+ }
29
33
  //# sourceMappingURL=types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AACA,MAAM,WAAW,eAAe;IAC9B,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAGD,MAAM,WAAW,WAAW;IAC1B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAGD,MAAM,MAAM,gBAAgB,GAAG,IAAI,GAAG,eAAe,GAAG,MAAM,CAAC;AAE/D,MAAM,MAAM,QAAQ,GAChB,OAAO,GACP,KAAK,GACL,MAAM,GACN,MAAM,GACN,MAAM,GACN,OAAO,GACP,OAAO,GACP,UAAU,GACV,MAAM,GACN,aAAa,CAAC;AAElB,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,KAAK,CAAC,SAAS,CAAC;IACtB,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,M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@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eternalheart/react-file-preview",
3
- "version": "1.0.0",
3
+ "version": "1.0.1",
4
4
  "description": "A modern, feature-rich file preview component for React with support for images, videos, audio, PDFs, Office documents (Word, Excel, PowerPoint), Markdown, and code files.",
5
5
  "type": "module",
6
6
  "main": "./lib/index.cjs",
@@ -39,7 +39,8 @@
39
39
  "homepage": "https://wh131462.github.io/react-file-preview",
40
40
  "repository": {
41
41
  "type": "git",
42
- "url": "git+https://github.com/wh131462/react-file-preview.git"
42
+ "url": "git+https://github.com/wh131462/react-file-preview.git",
43
+ "directory": "packages/react-file-preview"
43
44
  },
44
45
  "bugs": {
45
46
  "url": "https://github.com/wh131462/react-file-preview/issues"
@@ -53,21 +54,17 @@
53
54
  "email": "hao131462@qq.com",
54
55
  "url": "https://github.com/wh131462"
55
56
  },
56
- "packageManager": "pnpm@10.15.0",
57
57
  "scripts": {
58
- "dev": "pnpm copy-pdf-worker && vite",
59
- "build": "pnpm build:demo",
60
- "build:demo": "pnpm copy-pdf-worker && tsc && vite build",
61
- "build:lib": "vite build --config vite.config.lib.ts && tsc --project tsconfig.lib.json",
62
- "preview": "vite preview",
63
- "lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0",
64
- "copy-pdf-worker": "node -e \"require('fs').copyFileSync('node_modules/pdfjs-dist/build/pdf.worker.min.mjs', 'public/pdf.worker.min.mjs')\"",
65
- "generate-favicon": "node scripts/generate-favicon.js",
66
- "postinstall": "pnpm copy-pdf-worker",
67
- "predeploy": "pnpm build:demo",
68
- "deploy": "gh-pages -d dist",
69
- "prepublishOnly": "pnpm build:lib",
70
- "pub": "npm publish --registry https://registry.npmjs.com"
58
+ "build": "vite build && tsc --project tsconfig.json",
59
+ "dev": "vite build --watch",
60
+ "prepublishOnly": "pnpm build",
61
+ "version:patch": "npm version patch",
62
+ "version:minor": "npm version minor",
63
+ "version:major": "npm version major",
64
+ "pub": "npm publish --registry https://registry.npmjs.com",
65
+ "pub:patch": "pnpm version:patch && pnpm pub",
66
+ "pub:minor": "pnpm version:minor && pnpm pub",
67
+ "pub:major": "pnpm version:major && pnpm pub"
71
68
  },
72
69
  "peerDependencies": {
73
70
  "react": "^18.0.0",
@@ -93,21 +90,13 @@
93
90
  "@types/node": "^24.10.1",
94
91
  "@types/react": "^18.3.12",
95
92
  "@types/react-dom": "^18.3.1",
96
- "@typescript-eslint/eslint-plugin": "^8.15.0",
97
- "@typescript-eslint/parser": "^8.15.0",
98
93
  "@vitejs/plugin-react": "^4.3.4",
99
94
  "autoprefixer": "^10.4.20",
100
- "cli-real-favicon": "^0.0.9",
101
- "eslint": "^9.15.0",
102
- "eslint-plugin-react-hooks": "^5.0.0",
103
- "eslint-plugin-react-refresh": "^0.4.14",
104
- "gh-pages": "^6.3.0",
105
95
  "postcss": "^8.4.49",
106
96
  "react": "^18.3.1",
107
97
  "react-dom": "^18.3.1",
108
- "sharp": "^0.34.5",
109
- "tailwindcss": "^3.4.15",
98
+ "tailwindcss": "^3.4.18",
110
99
  "typescript": "^5.6.3",
111
100
  "vite": "^5.4.11"
112
101
  }
113
- }
102
+ }