mirror of
https://github.com/IRBorisov/ConceptPortal.git
synced 2025-08-13 20:30:36 +03:00
npm update: zod4
This commit is contained in:
parent
709471356f
commit
5d8cfe0b21
1150
rsconcept/frontend/package-lock.json
generated
1150
rsconcept/frontend/package-lock.json
generated
File diff suppressed because it is too large
Load Diff
|
@ -24,7 +24,7 @@
|
|||
"@tanstack/react-table": "^8.21.3",
|
||||
"@uiw/codemirror-themes": "^4.24.1",
|
||||
"@uiw/react-codemirror": "^4.24.1",
|
||||
"axios": "^1.10.0",
|
||||
"axios": "^1.11.0",
|
||||
"class-variance-authority": "^0.7.1",
|
||||
"clsx": "^2.1.1",
|
||||
"cmdk": "^1.1.1",
|
||||
|
@ -35,7 +35,7 @@
|
|||
"react": "^19.1.0",
|
||||
"react-dom": "^19.1.0",
|
||||
"react-error-boundary": "^6.0.0",
|
||||
"react-hook-form": "^7.60.0",
|
||||
"react-hook-form": "^7.61.0",
|
||||
"react-icons": "^5.5.0",
|
||||
"react-intl": "^7.1.11",
|
||||
"react-router": "^7.7.0",
|
||||
|
@ -48,7 +48,7 @@
|
|||
"tailwind-merge": "^3.3.1",
|
||||
"tw-animate-css": "^1.3.5",
|
||||
"use-debounce": "^10.0.5",
|
||||
"zod": "^3.25.76",
|
||||
"zod": "^4.0.8",
|
||||
"zustand": "^5.0.6"
|
||||
},
|
||||
"devDependencies": {
|
||||
|
@ -56,12 +56,12 @@
|
|||
"@playwright/test": "^1.54.1",
|
||||
"@tailwindcss/vite": "^4.1.11",
|
||||
"@types/jest": "^30.0.0",
|
||||
"@types/node": "^24.0.14",
|
||||
"@types/node": "^24.1.0",
|
||||
"@types/react": "^19.1.8",
|
||||
"@types/react-dom": "^19.1.6",
|
||||
"@typescript-eslint/eslint-plugin": "^8.0.1",
|
||||
"@typescript-eslint/parser": "^8.0.1",
|
||||
"@vitejs/plugin-react": "^4.6.0",
|
||||
"@vitejs/plugin-react": "^4.7.0",
|
||||
"babel-plugin-react-compiler": "^19.1.0-rc.1",
|
||||
"eslint": "^9.31.0",
|
||||
"eslint-plugin-import": "^2.32.0",
|
||||
|
@ -71,16 +71,16 @@
|
|||
"eslint-plugin-react-hooks": "^5.2.0",
|
||||
"eslint-plugin-simple-import-sort": "^12.1.1",
|
||||
"globals": "^16.3.0",
|
||||
"jest": "^30.0.4",
|
||||
"stylelint": "^16.21.1",
|
||||
"jest": "^30.0.5",
|
||||
"stylelint": "^16.22.0",
|
||||
"stylelint-config-recommended": "^16.0.0",
|
||||
"stylelint-config-standard": "^38.0.0",
|
||||
"stylelint-config-tailwindcss": "^1.0.0",
|
||||
"tailwindcss": "^4.0.7",
|
||||
"ts-jest": "^29.4.0",
|
||||
"typescript": "^5.8.3",
|
||||
"typescript-eslint": "^8.37.0",
|
||||
"vite": "^7.0.5"
|
||||
"typescript-eslint": "^8.38.0",
|
||||
"vite": "^7.0.6"
|
||||
},
|
||||
"jest": {
|
||||
"preset": "ts-jest",
|
||||
|
|
|
@ -21,6 +21,7 @@ export function DescribeError({ error }: { error: ErrorData }) {
|
|||
return (
|
||||
<div>
|
||||
<p>Ошибка валидации данных</p>
|
||||
{/* eslint-disable-next-line @typescript-eslint/no-base-to-string */}
|
||||
<PrettyJson data={JSON.parse(error.toString()) as unknown} />;
|
||||
</div>
|
||||
);
|
||||
|
|
|
@ -14,7 +14,7 @@ import { useModificationStore } from '@/stores/modification';
|
|||
import { PromptTabID, TemplatesTabs } from './templates-tabs';
|
||||
|
||||
const paramsSchema = z.strictObject({
|
||||
tab: z.preprocess(v => (v ? Number(v) : undefined), z.nativeEnum(PromptTabID).default(PromptTabID.LIST)),
|
||||
tab: z.preprocess(v => (v ? Number(v) : undefined), z.enum(PromptTabID).default(PromptTabID.LIST)),
|
||||
active: z.preprocess(v => (v ? Number(v) : undefined), z.number().nullable().default(null))
|
||||
});
|
||||
|
||||
|
|
|
@ -22,7 +22,7 @@ import { OssTabs } from './oss-tabs';
|
|||
|
||||
const paramsSchema = z.strictObject({
|
||||
id: z.coerce.number(),
|
||||
tab: z.preprocess(v => (v ? Number(v) : undefined), z.nativeEnum(OssTabID).default(OssTabID.GRAPH))
|
||||
tab: z.preprocess(v => (v ? Number(v) : undefined), z.enum(OssTabID).default(OssTabID.GRAPH))
|
||||
});
|
||||
|
||||
export function OssPage() {
|
||||
|
|
|
@ -269,8 +269,8 @@ export const schemaCstType = z.enum(Object.values(CstType) as [CstType, ...CstTy
|
|||
export const schemaSyntax = z.enum(Object.values(Syntax) as [Syntax, ...Syntax[]]);
|
||||
export const schemaValueClass = z.enum(Object.values(ValueClass) as [ValueClass, ...ValueClass[]]);
|
||||
export const schemaParsingStatus = z.enum(Object.values(ParsingStatus) as [ParsingStatus, ...ParsingStatus[]]);
|
||||
export const schemaTokenID = z.nativeEnum(TokenID);
|
||||
export const schemaRSErrorType = z.nativeEnum(RSErrorType);
|
||||
export const schemaTokenID = z.enum(TokenID);
|
||||
export const schemaRSErrorType = z.enum(RSErrorType);
|
||||
|
||||
export const schemaConstituentaBasics = z.strictObject({
|
||||
id: z.coerce.number(),
|
||||
|
|
|
@ -40,7 +40,7 @@ const schemaEditReferenceState = z
|
|||
entity: z.string(),
|
||||
grams: z.array(schemaGrammeme)
|
||||
}),
|
||||
syntactic: z.strictObject({ offset: z.coerce.number(), nominal: z.string() })
|
||||
syntactic: z.strictObject({ offset: z.number(), nominal: z.string() })
|
||||
})
|
||||
.refine(
|
||||
data =>
|
||||
|
@ -92,7 +92,21 @@ export function DlgEditReference() {
|
|||
}
|
||||
|
||||
function handleChangeTab(tab: number) {
|
||||
methods.setValue('type', tab === TabID.ENTITY ? ReferenceType.ENTITY : ReferenceType.SYNTACTIC);
|
||||
const type = tab === TabID.ENTITY ? ReferenceType.ENTITY : ReferenceType.SYNTACTIC;
|
||||
methods.setValue('type', type);
|
||||
if (type === ReferenceType.ENTITY) {
|
||||
methods.setValue('entity', initEntityReference(initial));
|
||||
methods.setValue('syntactic', {
|
||||
offset: 0,
|
||||
nominal: ''
|
||||
});
|
||||
} else {
|
||||
methods.setValue('syntactic', initSyntacticReference(initial));
|
||||
methods.setValue('entity', {
|
||||
entity: '',
|
||||
grams: []
|
||||
});
|
||||
}
|
||||
setActiveTab(tab as TabID);
|
||||
}
|
||||
|
||||
|
|
|
@ -26,7 +26,7 @@ const paramsSchema = z.strictObject({
|
|||
.number()
|
||||
.nullish()
|
||||
.transform(v => v ?? undefined),
|
||||
tab: z.preprocess(v => (v ? Number(v) : undefined), z.nativeEnum(RSTabID).default(RSTabID.CARD)),
|
||||
tab: z.preprocess(v => (v ? Number(v) : undefined), z.enum(RSTabID).default(RSTabID.CARD)),
|
||||
activeID: z.coerce
|
||||
.number()
|
||||
.nullish()
|
||||
|
|
Loading…
Reference in New Issue
Block a user