Skip to content

Commit 249c7db

Browse files
authored
Merge pull request #144 from kit-data-manager/bump-deps
Bump deps
2 parents 05f15cc + f956dc0 commit 249c7db

File tree

7 files changed

+1869
-1604
lines changed

7 files changed

+1869
-1604
lines changed

CITATION.cff

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,9 @@ cff-version: 1.2.0
22
message: If you use this software, please cite it using these metadata.
33
type: software
44
title: '@kit-data-manager/react-search-component'
5-
abstract: All-in-one component for rendering an elastic search UI for searching anything.
6-
Built-in support for visualizing related items in a graph and resolving unique identifiers.
5+
abstract: All-in-one component for rendering an elastic search UI for searching
6+
anything. Built-in support for visualizing related items in a graph and
7+
resolving unique identifiers.
78
version: 0.2.1
89
keywords:
910
- react

package-lock.json

Lines changed: 1846 additions & 1578 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
"@elastic/react-search-ui-views": "^1.22.0",
4141
"@elastic/search-ui": "^1.22.0",
4242
"@elastic/search-ui-elasticsearch-connector": "^1.22.0",
43-
"@kit-data-manager/react-pid-component": "^0.1.6",
43+
"@kit-data-manager/react-pid-component": "^0.2.2",
4444
"@radix-ui/react-checkbox": "^1.1.3",
4545
"@radix-ui/react-dialog": "^1.1.4",
4646
"@radix-ui/react-dropdown-menu": "^2.1.4",
@@ -54,20 +54,20 @@
5454
"class-variance-authority": "^0.7.1",
5555
"clsx": "^2.1.1",
5656
"embla-carousel-react": "^8.5.2",
57-
"lucide-react": "^0.515.0",
57+
"lucide-react": "^0.544.0",
5858
"luxon": "^3.5.0",
5959
"swr": "^2.3.0",
6060
"tailwind-merge": "^3.0.1",
6161
"usehooks-ts": "^3.1.0",
62-
"zod": "^3.24.1",
62+
"zod": "^4.1.11",
6363
"zustand": "^5.0.2"
6464
},
6565
"devDependencies": {
6666
"@babel/core": "^7.26.0",
6767
"@babel/preset-env": "^7.26.0",
6868
"@babel/preset-react": "^7.26.3",
6969
"@elastic/elasticsearch": "^9.0.2",
70-
"@eslint-react/eslint-plugin": "^1.23.2",
70+
"@eslint-react/eslint-plugin": "^2.0.2",
7171
"@eslint/eslintrc": "^3.2.0",
7272
"@eslint/js": "^9.15.0",
7373
"@storybook/addon-docs": "^9.0.9",
@@ -81,7 +81,6 @@
8181
"@vitejs/plugin-react": "^4.3.4",
8282
"autoprefixer": "^10.4.20",
8383
"babel-loader": "^10.0.0",
84-
"chromatic": "^12.2.0",
8584
"css-loader": "^7.1.2",
8685
"eslint": "^9.15.0",
8786
"eslint-config-next": "^15.1.5",

src/components/result/GenericResultView.tsx

Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { useCallback, useContext, useEffect, useMemo, useState } from "react"
22
import { RelationsGraphContext } from "@/components/graph/RelationsGraphContext"
33
import { ReactSearchComponentContext } from "@/components/ReactSearchComponentContext"
4-
import { useStore } from "zustand/index"
4+
import { useStore } from "zustand"
55
import { resultCache } from "@/lib/ResultCache"
66
import { DateTime } from "luxon"
77
import { ChevronDown, Download, GitFork, LoaderCircle, Microscope, Pencil, PlusIcon, SearchIcon, TableProperties } from "lucide-react"
@@ -10,7 +10,7 @@ import { Button } from "@/components/ui/button"
1010
import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuSeparator, DropdownMenuTrigger } from "@/components/ui/dropdown-menu"
1111
import { SearchFieldConfiguration } from "@elastic/search-ui"
1212
import { GenericResultViewTag, GenericResultViewTagProps } from "@/components/result/GenericResultViewTag"
13-
import { z } from "zod"
13+
import * as z from "zod/mini"
1414
import { GenericResultViewImage } from "@/components/result/GenericResultViewImage"
1515
import { GraphNodeUtils } from "@/components/graph/GraphNodeUtils"
1616
import { Dialog, DialogContent, DialogTitle } from "@/components/ui/dialog"
@@ -143,12 +143,7 @@ export function GenericResultView({
143143
(field: string) => {
144144
try {
145145
const value = autoUnwrap(
146-
z
147-
.string()
148-
.or(z.number())
149-
.or(z.object({ raw: z.string().or(z.number()) }))
150-
.optional()
151-
.parse(result[field])
146+
z.optional(z.union([z.string(), z.number(), z.object({ raw: z.union([z.string(), z.number()]) })])).parse(result[field])
152147
)
153148

154149
return value ? value + "" : undefined
@@ -165,12 +160,14 @@ export function GenericResultView({
165160
try {
166161
const value = autoUnwrapArray<string | number>(
167162
z
168-
.string()
169-
.array()
170-
.or(z.number().array())
171-
.or(z.object({ raw: z.string().array() }))
172-
.or(z.object({ raw: z.number().array() }))
173-
.optional()
163+
.optional(
164+
z.union([
165+
z.array(z.string()),
166+
z.array(z.number()),
167+
z.object({ raw: z.array(z.number()) }),
168+
z.object({ raw: z.array(z.string()) })
169+
])
170+
)
174171
.parse(result[field])
175172
)
176173
return value ? value.map((v) => v + "") : []

src/components/result/ResultViewSelector.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { ResultViewProps } from "@elastic/react-search-ui-views"
22
import { ComponentType, useMemo } from "react"
33
import { PlaceholderResultView } from "@/components/result/PlaceholderResultView"
4-
import { z } from "zod"
4+
import * as z from "zod/mini"
55

66
interface ResultViewSelectorProps {
77
resultView?: ComponentType<ResultViewProps>

src/lib/PIDDataType.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
import { z } from "zod"
1+
import * as z from "zod/mini"
22

33
export const PIDDataSchema = z.object({
44
identifier: z.string(),
55
name: z.string(),
6-
description: z.string().optional()
6+
description: z.optional(z.string())
77
})
88

99
export type PIDData = z.infer<typeof PIDDataSchema>

src/lib/TempResolver.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
import { z } from "zod"
1+
import * as z from "zod/mini"
22

33
/**
44
* !TODO Replace with resolver from pid-component
55
*/
66

77
const TS4TIBResponse = z.object({
88
response: z.object({
9-
docs: z.object({ label: z.string(), iri: z.string() }).array()
9+
docs: z.array(z.object({ label: z.string(), iri: z.string() }))
1010
})
1111
})
1212

0 commit comments

Comments
 (0)