mirror of
https://github.com/certimate-go/certimate.git
synced 2026-06-22 21:05:48 +08:00
dev
This commit is contained in:
parent
7d633135bc
commit
3308bcb01d
1276
ui/package-lock.json
generated
1276
ui/package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@ -15,6 +15,7 @@
|
||||
"@codemirror/lang-yaml": "^6.1.2",
|
||||
"@codemirror/language": "^6.11.2",
|
||||
"@codemirror/legacy-modes": "^6.5.1",
|
||||
"@flowgram.ai/fixed-layout-editor": "^0.2.28",
|
||||
"@tabler/icons-react": "^3.34.1",
|
||||
"@uiw/codemirror-extensions-basic-setup": "^4.24.1",
|
||||
"@uiw/codemirror-theme-vscode": "^4.24.1",
|
||||
@ -29,19 +30,19 @@
|
||||
"i18next-browser-languagedetector": "^8.2.0",
|
||||
"immer": "^10.1.1",
|
||||
"nanoid": "^5.1.5",
|
||||
"pocketbase": "^0.26.1",
|
||||
"pocketbase": "^0.26.2",
|
||||
"radash": "^12.1.1",
|
||||
"react": "^18.3.1",
|
||||
"react-copy-to-clipboard": "^5.1.0",
|
||||
"react-dom": "^18.3.1",
|
||||
"react-i18next": "^15.6.1",
|
||||
"react-router-dom": "^7.7.0",
|
||||
"react-router-dom": "^7.7.1",
|
||||
"tailwind-merge": "^3.3.1",
|
||||
"zod": "^4.0.5",
|
||||
"zod": "^4.0.10",
|
||||
"zustand": "^5.0.6"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@eslint/js": "^9.31.0",
|
||||
"@eslint/js": "^9.32.0",
|
||||
"@tailwindcss/postcss": "^4.1.11",
|
||||
"@tailwindcss/vite": "^4.1.11",
|
||||
"@types/file-saver": "^2.0.7",
|
||||
@ -52,10 +53,10 @@
|
||||
"@types/react-dom": "^18.3.7",
|
||||
"@vitejs/plugin-legacy": "^6.1.1",
|
||||
"@vitejs/plugin-react": "^4.7.0",
|
||||
"eslint": "^9.31.0",
|
||||
"eslint": "^9.32.0",
|
||||
"eslint-config-prettier": "^10.1.8",
|
||||
"eslint-import-resolver-typescript": "^4.4.4",
|
||||
"eslint-plugin-better-tailwindcss": "^3.7.1",
|
||||
"eslint-plugin-better-tailwindcss": "^3.7.2",
|
||||
"eslint-plugin-import": "^2.32.0",
|
||||
"eslint-plugin-prettier": "^5.5.3",
|
||||
"eslint-plugin-react-hooks": "^5.2.0",
|
||||
|
||||
@ -4,7 +4,7 @@ import { IconFileImport } from "@tabler/icons-react";
|
||||
import { Button, type ButtonProps, Input, type UploadProps } from "antd";
|
||||
import { type TextAreaProps } from "antd/es/input/TextArea";
|
||||
|
||||
import { readFileContent } from "@/utils/file";
|
||||
import { readFileAsText } from "@/utils/file";
|
||||
|
||||
export interface TextFileInputProps extends Omit<TextAreaProps, "onChange"> {
|
||||
accept?: UploadProps["accept"];
|
||||
@ -27,7 +27,7 @@ const TextFileInput = ({ className, style, accept, disabled, readOnly, uploadTex
|
||||
const handleFileChange = async (e: ChangeEvent<HTMLInputElement>) => {
|
||||
const { files } = e.target as HTMLInputElement;
|
||||
if (files?.length) {
|
||||
const value = await readFileContent(files[0]);
|
||||
const value = await readFileAsText(files[0]);
|
||||
onChange?.(value);
|
||||
}
|
||||
};
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
export function readFileContent(file: File): Promise<string> {
|
||||
export function readFileAsText(file: File): Promise<string> {
|
||||
return new Promise((resolve, reject) => {
|
||||
const reader = new FileReader();
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user