diff --git a/.env.example b/.env.example index fa329d7d..ce9f91ce 100644 --- a/.env.example +++ b/.env.example @@ -1,4 +1,5 @@ -INDEXSUPPLY_API_KEY= +TIDX_BASIC_AUTH= # e.g. tidx:... +TIDX_URL=https://tidx.tempo.xyz SLACK_FEEDBACK_WEBHOOK= # e.g. https://hooks.slack.com/services/... VITE_BASE_URL= # e.g. https://docs.tempo.xyz VITE_GA_MEASUREMENT_ID= diff --git a/env.d.ts b/env.d.ts index 5a86c157..22ac6500 100644 --- a/env.d.ts +++ b/env.d.ts @@ -6,7 +6,8 @@ interface EnvironmentVariables { readonly VITE_POSTHOG_HOST: string readonly VITE_TEMPO_ENV: 'localnet' | 'devnet' | 'moderato' - readonly INDEXSUPPLY_API_KEY: string + readonly TIDX_BASIC_AUTH: string + readonly TIDX_URL: string readonly SLACK_FEEDBACK_WEBHOOK: string readonly VERCEL_URL: string diff --git a/package.json b/package.json index 563a4612..c5d6fb2f 100644 --- a/package.json +++ b/package.json @@ -43,6 +43,7 @@ "sql-formatter": "^15.7.3", "tailwind-merge": "^3.5.0", "tailwindcss": "^4.2.2", + "tidx.ts": "^0.1.1", "unplugin-auto-import": "^21.0.0", "unplugin-icons": "^23.0.1", "viem": "^2.48.4", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 14670c0c..80a45fcc 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -93,6 +93,9 @@ importers: tailwindcss: specifier: ^4.2.2 version: 4.2.2 + tidx.ts: + specifier: ^0.1.1 + version: 0.1.1(typescript@5.9.3) unplugin-auto-import: specifier: ^21.0.0 version: 21.0.0 @@ -2603,6 +2606,10 @@ packages: khroma@2.1.0: resolution: {integrity: sha512-Ls993zuzfayK269Svk9hzpeGUKob/sIgZzyHYdjQoAdQetRKpOLj+k/QQQ/6Qi0Yz65mlROrfd+Ev+1+7dz9Kw==} + kysely@0.28.16: + resolution: {integrity: sha512-3i5pmOiZvMDj00qhrIVbH0AnioVTx22DMP7Vn5At4yJO46iy+FM8Y/g61ltenLVSo3fiO8h8Q3QOFgf/gQ72ww==} + engines: {node: '>=20.0.0'} + langium@4.2.2: resolution: {integrity: sha512-JUshTRAfHI4/MF9dH2WupvjSXyn8JBuUEWazB8ZVJUtXutT0doDlAv1XKbZ1Pb5sMexa8FF4CFBc0iiul7gbUQ==} engines: {node: '>=20.10.0', npm: '>=10.2.3'} @@ -2955,6 +2962,9 @@ packages: typescript: optional: true + mitt@3.0.1: + resolution: {integrity: sha512-vKivATfr97l2/QBCYAkXYDbrIWPM2IIKEl7YPhjCvKlG3kE2gm+uBo6nEXK3M5/Ffh/FLpKExzOQ3JJoJGFKBw==} + mlly@1.8.2: resolution: {integrity: sha512-d+ObxMQFmbt10sretNDytwt85VrbkhhUA/JBGm1MPaWJ65Cl4wOgLaB1NYvJSZ0Ef03MMEU/0xpPMXUIQ29UfA==} @@ -3653,6 +3663,9 @@ packages: thenify@3.3.1: resolution: {integrity: sha512-RVZSIV5IG10Hk3enotrhvz0T9em6cyHBLkH/YAZuKqd8hRkKhSfCGIcP2KUY0EPxndzANBmNllzWPwak+bheSw==} + tidx.ts@0.1.1: + resolution: {integrity: sha512-XFoDuwCQwkERGRYB+QGQvzH//Y6kDknttWSts3durreALgkrKOCM9mUDfgRVg3zVisuQgx5RfvoJmO8x8oXm+g==} + tinyexec@1.1.1: resolution: {integrity: sha512-VKS/ZaQhhkKFMANmAOhhXVoIfBXblQxGX1myCQ2faQrfmobMftXeJPcZGp0gS07ocvGJWDLZGyOZDadDBqYIJg==} engines: {node: '>=18'} @@ -6559,6 +6572,8 @@ snapshots: khroma@2.1.0: {} + kysely@0.28.16: {} + langium@4.2.2: dependencies: '@chevrotain/regexp-to-ast': 12.0.0 @@ -7184,6 +7199,8 @@ snapshots: optionalDependencies: typescript: 5.9.3 + mitt@3.0.1: {} + mlly@1.8.2: dependencies: acorn: 8.16.0 @@ -7918,6 +7935,16 @@ snapshots: dependencies: any-promise: 1.3.0 + tidx.ts@0.1.1(typescript@5.9.3): + dependencies: + abitype: 1.2.3(typescript@5.9.3)(zod@4.3.6) + kysely: 0.28.16 + mitt: 3.0.1 + ox: 0.14.20(typescript@5.9.3)(zod@4.3.6) + zod: 4.3.6 + transitivePeerDependencies: + - typescript + tinyexec@1.1.1: {} tinyglobby@0.2.16: diff --git a/src/components/SignatureSelector.tsx b/src/components/SignatureSelector.tsx index 358e95e6..72dcac41 100644 --- a/src/components/SignatureSelector.tsx +++ b/src/components/SignatureSelector.tsx @@ -1,6 +1,6 @@ 'use client' import * as React from 'react' -import { getAllSignatures, type SignatureInfo } from './lib/IndexSupplySignatures' +import { getAllSignatures, type SignatureInfo } from './lib/TidxSignatures' type SignatureSelectorProps = { value: string[] @@ -17,6 +17,12 @@ export function SignatureSelector(props: SignatureSelectorProps) { const allSignatures = React.useMemo(() => getAllSignatures(), []) + const handleClickOutside = React.useEffectEvent((event: MouseEvent) => { + if (dropdownRef.current && !dropdownRef.current.contains(event.target as Node)) { + setIsOpen(false) + } + }) + const filteredSignatures = React.useMemo(() => { let signatures = allSignatures @@ -56,12 +62,6 @@ export function SignatureSelector(props: SignatureSelectorProps) { React.useEffect(() => { if (!isOpen) return - function handleClickOutside(event: MouseEvent) { - if (dropdownRef.current && !dropdownRef.current.contains(event.target as Node)) { - setIsOpen(false) - } - } - document.addEventListener('mousedown', handleClickOutside) return () => document.removeEventListener('mousedown', handleClickOutside) }, [isOpen]) @@ -115,7 +115,7 @@ export function SignatureSelector(props: SignatureSelectorProps) { onChange={(e) => setSearchQuery(e.target.value)} onFocus={() => !disabled && setIsOpen(true)} placeholder={placeholderText} - className="h-[34px] w-full rounded-lg border border-gray4 px-3 text-[13px] focus:outline-none focus:ring-1 focus:ring-accent disabled:cursor-not-allowed disabled:opacity-50" + className="h-8.5 w-full rounded-lg border border-gray4 px-3 text-[13px] focus:outline-none focus:ring-1 focus:ring-accent disabled:cursor-not-allowed disabled:opacity-50" disabled={disabled} /> {value.length > 0 && !disabled && ( @@ -131,7 +131,7 @@ export function SignatureSelector(props: SignatureSelectorProps) { {isOpen && ( -
+
{Object.keys(groupedSignatures).length === 0 ? (
No signatures found
) : ( @@ -159,7 +159,7 @@ export function SignatureSelector(props: SignatureSelectorProps) { {sig.signature} @@ -194,7 +194,7 @@ export function SignatureSelector(props: SignatureSelectorProps) {
- - {sigInfo?.name || sig} - + {sigInfo?.name || sig} {!disabled && (