diff --git a/components.json b/components.json index a5eec41d9..fcf21ac23 100644 --- a/components.json +++ b/components.json @@ -5,7 +5,7 @@ "tsx": true, "tailwind": { "config": "tailwind.config.cjs", - "css": "src/renderer/src/assets/main.css", + "css": "src/renderer/src/styles/main.css", "baseColor": "slate", "cssVariables": true, "prefix": "" diff --git a/package.json b/package.json index 619fd1ce9..6e507e87c 100644 --- a/package.json +++ b/package.json @@ -48,6 +48,7 @@ "@tanstack/react-query-persist-client": "5.40.0", "@use-gesture/react": "10.3.1", "class-variance-authority": "0.7.0", + "click-to-react-component": "1.1.0", "clsx": "2.1.1", "cmdk": "1.0.0", "dayjs": "1.11.11", @@ -57,8 +58,8 @@ "hast-util-to-jsx-runtime": "2.3.0", "immer": "10.1.1", "jotai": "2.8.2", - "jotai-dark": "^0.3.0", - "jotai-effect": "^1.0.0", + "jotai-dark": "0.3.1", + "jotai-effect": "1.0.0", "lethargy": "1.0.9", "lodash-es": "4.17.21", "lucide-react": "0.381.0", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index ad51b66aa..52d9f993b 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -83,6 +83,9 @@ importers: class-variance-authority: specifier: 0.7.0 version: 0.7.0 + click-to-react-component: + specifier: 1.1.0 + version: 1.1.0(@types/react@18.3.3)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) clsx: specifier: 2.1.1 version: 2.1.1 @@ -111,10 +114,10 @@ importers: specifier: 2.8.2 version: 2.8.2(@types/react@18.3.3)(react@18.3.1) jotai-dark: - specifier: ^0.3.0 - version: 0.3.0(jotai-effect@1.0.0(jotai@2.8.2(@types/react@18.3.3)(react@18.3.1)))(jotai@2.8.2(@types/react@18.3.3)(react@18.3.1))(react@18.3.1) + specifier: 0.3.1 + version: 0.3.1(jotai-effect@1.0.0(jotai@2.8.2(@types/react@18.3.3)(react@18.3.1)))(jotai@2.8.2(@types/react@18.3.3)(react@18.3.1))(react@18.3.1) jotai-effect: - specifier: ^1.0.0 + specifier: 1.0.0 version: 1.0.0(jotai@2.8.2(@types/react@18.3.3)(react@18.3.1)) lethargy: specifier: 1.0.9 @@ -1119,12 +1122,28 @@ packages: resolution: {integrity: sha512-niBqk8iwv96+yuTwjM6bWg8ovzAPF9qkICsGtcoa5/dmqcEMfdwNAX7+/OHcJHc7wj7XqPxH98oAHytFYlw6Sw==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + '@floating-ui/core@0.6.2': + resolution: {integrity: sha512-jktYRmZwmau63adUG3GKOAVCofBXkk55S/zQ94XOorAHhwqFIOFAy1rSp2N0Wp6/tGbe9V3u/ExlGZypyY17rg==} + '@floating-ui/core@1.6.0': resolution: {integrity: sha512-PcF++MykgmTj3CIyOQbKA/hDzOAiqI3mhuoN44WRCopIs1sgoDoU4oty4Jtqaj/y3oDU6fnVSm4QG0a3t5i0+g==} + '@floating-ui/dom@0.4.5': + resolution: {integrity: sha512-b+prvQgJt8pieaKYMSJBXHxX/DYwdLsAWxKYqnO5dO2V4oo/TYBZJAUQCVNjTWWsrs6o4VDrNcP9+E70HAhJdw==} + '@floating-ui/dom@1.6.3': resolution: {integrity: sha512-RnDthu3mzPlQ31Ss/BTwQ1zjzIhr3lk1gZB1OC56h/1vEtaXkESrOqL5fQVMfXpwGtRwX+YsZBdyHtJMQnkArw==} + '@floating-ui/react-dom-interactions@0.3.1': + resolution: {integrity: sha512-tP2KEh7EHJr5hokSBHcPGojb+AorDNUf0NYfZGg/M+FsMvCOOsSEeEF0O1NDfETIzDnpbHnCs0DuvCFhSMSStg==} + deprecated: Package renamed to @floating-ui/react + + '@floating-ui/react-dom@0.6.3': + resolution: {integrity: sha512-hC+pS5D6AgS2wWjbmSQ6UR6Kpy+drvWGJIri6e1EDGADTPsCaa4KzCgmCczHrQeInx9tqs81EyDmbKJYY2swKg==} + peerDependencies: + react: '>=16.8.0' + react-dom: '>=16.8.0' + '@floating-ui/react-dom@2.0.8': resolution: {integrity: sha512-HOdqOt3R3OGeTKidaLvJKcgg75S6tibQ3Tif4eyd91QnIJWr0NLvoXFpJA/j8HqkFSL68GDca9AuyWEHlhyClw==} peerDependencies: @@ -2362,6 +2381,11 @@ packages: resolution: {integrity: sha512-nPdaFdQ0h/GEigbPClz11D0v/ZJEwxmeVZGeMo3Z5StPtUTkA9o1lD6QwoirYiSDzbcwn2XcjwmCp68W1IS4TA==} engines: {node: '>=18'} + click-to-react-component@1.1.0: + resolution: {integrity: sha512-/DjZemufS1BkxyRgZL3r7HXVVOFRWVQi5Xd4EBnjxZMwrHEh0OlUVA2N9CjXkZ0x8zMf8dL1cKnnx+xUWUg4VA==} + peerDependencies: + react: '>=16.8.0' + cliui@8.0.1: resolution: {integrity: sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==} engines: {node: '>=12'} @@ -3328,6 +3352,9 @@ packages: resolution: {integrity: sha512-kyCuEOWjJqZuDbRHzL8V93NzQhwIB71oFWSyzVo+KPZI+pnQPPxucdkrOZvkLRnrf5URsQM+IJ09Dw29cRALIA==} engines: {node: '>=10'} + htm@3.1.1: + resolution: {integrity: sha512-983Vyg8NwUE7JkZ6NmOqpCZ+sh1bKv2iYTlUkzlWmA5JD2acKoxd4KVxbMmxX/85mtfdnDmTFoNKcg5DGAvxNQ==} + html-void-elements@3.0.0: resolution: {integrity: sha512-bEqo66MRXsUGxWHV5IP0PUiAWwoEjba4VCzg0LjFJBpchPaTfyfCKTG6bc5F8ucKec3q5y6qOdGyYTSBEvhCrg==} @@ -3538,8 +3565,8 @@ packages: jose@5.3.0: resolution: {integrity: sha512-IChe9AtAE79ru084ow8jzkN2lNrG3Ntfiv65Cvj9uOCE2m5LNsdHG+9EbxWxAoWRF9TgDOqLN5jm08++owDVRg==} - jotai-dark@0.3.0: - resolution: {integrity: sha512-Vuhymer1VLaAjSW+hLowZBZa0FSKMamo3xajXubCr0Jdnp5P80vrh/5s29EQ2cp3eSa9weuUy+kdoMKEDdp/sA==} + jotai-dark@0.3.1: + resolution: {integrity: sha512-6yW4qk+xG9kv/YkDr4aCWHMPQZHd+q/p1orFzg5NFJwlBCfK/UBlUJfPTRLMdbMf1+U5u4pBQWPGa7ZHOqSFBQ==} peerDependencies: foxact: ^0.2.33 jotai: '>=2.5.0' @@ -4237,6 +4264,9 @@ packages: resolution: {integrity: sha512-Nc3IT5yHzflTfbjgqWcCPpo7DaKy4FnpB0l/zCAW0Tc7jxAiuqSxHasntB3D7887LSrA93kDJ9IXovxJYxyLCA==} engines: {node: '>=4'} + point-in-polygon@1.1.0: + resolution: {integrity: sha512-3ojrFwjnnw8Q9242TzgXuTD+eKiutbzyslcq1ydfu82Db2y+Ogbmyrkpv0Hgj31qwT3lbS9+QAAO/pIQM35XRw==} + postcss-import@15.1.0: resolution: {integrity: sha512-hpr+J05B2FVYUAXHeK1YyI267J/dDDhMU6B6civm8hSY1jYJnBXxzKDKDswzJmtLHryrjhnDjqqp/49t8FALew==} engines: {node: '>=14.0.0'} @@ -4353,6 +4383,9 @@ packages: react-dom: optional: true + react-merge-refs@1.1.0: + resolution: {integrity: sha512-alTKsjEL0dKH/ru1Iyn7vliS2QRcBp9zZPGoWxUOvRGWPUYgjo+V01is7p04It6KhgrzhJGnIj9GgX8W4bZoCQ==} + react-refresh@0.14.2: resolution: {integrity: sha512-jCvmsr+1IUSMUyzOkRcvnVbX3ZYC6g9TDrDbFuFmRDq7PD4yaGbLKNQL6k2jnArV8hjYxh7hVhAZB6s9HDGpZA==} engines: {node: '>=0.10.0'} @@ -4966,6 +4999,15 @@ packages: '@types/react': optional: true + use-isomorphic-layout-effect@1.1.2: + resolution: {integrity: sha512-49L8yCO3iGT/ZF9QttjwLF/ZD9Iwto5LnH5LmEdk/6cFmXddqi2ulF0edxTwjj+7mqvpVVGQWvbXZdn32wRSHA==} + peerDependencies: + '@types/react': '*' + react: ^16.8.0 || ^17.0.0 || ^18.0.0 + peerDependenciesMeta: + '@types/react': + optional: true + use-sidecar@1.1.2: resolution: {integrity: sha512-epTbsLuzZ7lPClpz2TyryBfztm7m+28DlEv2ZCQ3MDr5ssiwyOwGH/e5F9CkfWjJ1t4clvI58yF822/GUkjjhw==} engines: {node: '>=10'} @@ -6106,15 +6148,41 @@ snapshots: '@eslint/js@9.3.0': {} + '@floating-ui/core@0.6.2': {} + '@floating-ui/core@1.6.0': dependencies: '@floating-ui/utils': 0.2.1 + '@floating-ui/dom@0.4.5': + dependencies: + '@floating-ui/core': 0.6.2 + '@floating-ui/dom@1.6.3': dependencies: '@floating-ui/core': 1.6.0 '@floating-ui/utils': 0.2.1 + '@floating-ui/react-dom-interactions@0.3.1(@types/react@18.3.3)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)': + dependencies: + '@floating-ui/react-dom': 0.6.3(@types/react@18.3.3)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) + aria-hidden: 1.2.4 + point-in-polygon: 1.1.0 + use-isomorphic-layout-effect: 1.1.2(@types/react@18.3.3)(react@18.3.1) + transitivePeerDependencies: + - '@types/react' + - react + - react-dom + + '@floating-ui/react-dom@0.6.3(@types/react@18.3.3)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)': + dependencies: + '@floating-ui/dom': 0.4.5 + react: 18.3.1 + react-dom: 18.3.1(react@18.3.1) + use-isomorphic-layout-effect: 1.1.2(@types/react@18.3.3)(react@18.3.1) + transitivePeerDependencies: + - '@types/react' + '@floating-ui/react-dom@2.0.8(react-dom@18.3.1(react@18.3.1))(react@18.3.1)': dependencies: '@floating-ui/dom': 1.6.3 @@ -7578,6 +7646,16 @@ snapshots: slice-ansi: 5.0.0 string-width: 7.1.0 + click-to-react-component@1.1.0(@types/react@18.3.3)(react-dom@18.3.1(react@18.3.1))(react@18.3.1): + dependencies: + '@floating-ui/react-dom-interactions': 0.3.1(@types/react@18.3.3)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) + htm: 3.1.1 + react: 18.3.1 + react-merge-refs: 1.1.0 + transitivePeerDependencies: + - '@types/react' + - react-dom + cliui@8.0.1: dependencies: string-width: 4.2.3 @@ -8930,6 +9008,8 @@ snapshots: dependencies: lru-cache: 6.0.0 + htm@3.1.1: {} + html-void-elements@3.0.0: {} http-cache-semantics@4.1.1: {} @@ -9110,7 +9190,7 @@ snapshots: jose@5.3.0: {} - jotai-dark@0.3.0(jotai-effect@1.0.0(jotai@2.8.2(@types/react@18.3.3)(react@18.3.1)))(jotai@2.8.2(@types/react@18.3.3)(react@18.3.1))(react@18.3.1): + jotai-dark@0.3.1(jotai-effect@1.0.0(jotai@2.8.2(@types/react@18.3.3)(react@18.3.1)))(jotai@2.8.2(@types/react@18.3.3)(react@18.3.1))(react@18.3.1): optionalDependencies: jotai: 2.8.2(@types/react@18.3.3)(react@18.3.1) jotai-effect: 1.0.0(jotai@2.8.2(@types/react@18.3.3)(react@18.3.1)) @@ -9912,6 +9992,8 @@ snapshots: pluralize@8.0.0: {} + point-in-polygon@1.1.0: {} + postcss-import@15.1.0(postcss@8.4.38): dependencies: postcss: 8.4.38 @@ -10005,6 +10087,8 @@ snapshots: optionalDependencies: react-dom: 18.3.1(react@18.3.1) + react-merge-refs@1.1.0: {} + react-refresh@0.14.2: {} react-remove-scroll-bar@2.3.6(@types/react@18.3.3)(react@18.3.1): @@ -10685,6 +10769,12 @@ snapshots: optionalDependencies: '@types/react': 18.3.3 + use-isomorphic-layout-effect@1.1.2(@types/react@18.3.3)(react@18.3.1): + dependencies: + react: 18.3.1 + optionalDependencies: + '@types/react': 18.3.3 + use-sidecar@1.1.2(@types/react@18.3.3)(react@18.3.1): dependencies: detect-node-es: 1.1.0 diff --git a/src/renderer/index.html b/src/renderer/index.html index 97192d472..f94cb07d8 100644 --- a/src/renderer/index.html +++ b/src/renderer/index.html @@ -1,9 +1,20 @@ - +
Dark Mode
diff --git a/src/renderer/src/components/entry-column/index.tsx b/src/renderer/src/components/entry-column/index.tsx index 232ff5baf..a21ffb723 100644 --- a/src/renderer/src/components/entry-column/index.tsx +++ b/src/renderer/src/components/entry-column/index.tsx @@ -1,17 +1,13 @@ -import { Button } from "@renderer/components/ui/button" +import { Button, HeaderActionButton } from "@renderer/components/ui/button" import { Popover, PopoverClose, PopoverContent, PopoverTrigger, } from "@renderer/components/ui/popover" -import { - Tooltip, - TooltipContent, - TooltipTrigger, -} from "@renderer/components/ui/tooltip" import { views } from "@renderer/lib/constants" import { buildStorageNS } from "@renderer/lib/ns" +import type { EntryModel } from "@renderer/lib/types" import { cn, getEntriesParams } from "@renderer/lib/utils" import { apiClient } from "@renderer/queries/api-fetch" import { useEntries } from "@renderer/queries/entries" @@ -110,7 +106,7 @@ export function EntryColumn() { ), ) - const virtusoOptions = { + const virtuosoOptions = { components: { List: ListContent, }, @@ -119,7 +115,7 @@ export function EntryColumn() { totalCount: entries.data?.pages?.[0]?.total, endReached: () => entries.hasNextPage && entries.fetchNextPage(), data: entries.data?.pages.flatMap((page) => page.data) || [], - itemContent: (_, entry) => { + itemContent: useCallback((_, entry: EntryModel | undefined) => { if (!entry) return null return (