@proofhound/web-ui 0.1.11 → 0.1.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/hooks/index.d.ts +1 -0
- package/dist/hooks/index.d.ts.map +1 -1
- package/dist/hooks/index.js +1 -0
- package/dist/hooks/index.js.map +1 -1
- package/dist/hooks/run-result.d.ts +4 -0
- package/dist/hooks/run-result.d.ts.map +1 -1
- package/dist/hooks/use-mounted.d.ts +13 -0
- package/dist/hooks/use-mounted.d.ts.map +1 -0
- package/dist/hooks/use-mounted.js +22 -0
- package/dist/hooks/use-mounted.js.map +1 -0
- package/dist/providers/refine-provider.d.ts.map +1 -1
- package/dist/providers/refine-provider.js +25 -8
- package/dist/providers/refine-provider.js.map +1 -1
- package/package.json +4 -4
package/dist/hooks/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/hooks/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,kBAAkB,CAAC;AACjC,cAAc,aAAa,CAAC;AAC5B,cAAc,WAAW,CAAC;AAC1B,cAAc,cAAc,CAAC;AAC7B,cAAc,SAAS,CAAC;AACxB,cAAc,gBAAgB,CAAC;AAC/B,cAAc,sBAAsB,CAAC;AACrC,cAAc,sBAAsB,CAAC;AACrC,cAAc,UAAU,CAAC;AACzB,cAAc,eAAe,CAAC;AAC9B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,cAAc,CAAC;AAC7B,cAAc,SAAS,CAAC;AACxB,cAAc,oBAAoB,CAAC;AACnC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,uBAAuB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/hooks/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,kBAAkB,CAAC;AACjC,cAAc,aAAa,CAAC;AAC5B,cAAc,WAAW,CAAC;AAC1B,cAAc,cAAc,CAAC;AAC7B,cAAc,SAAS,CAAC;AACxB,cAAc,gBAAgB,CAAC;AAC/B,cAAc,sBAAsB,CAAC;AACrC,cAAc,sBAAsB,CAAC;AACrC,cAAc,UAAU,CAAC;AACzB,cAAc,eAAe,CAAC;AAC9B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,cAAc,CAAC;AAC7B,cAAc,SAAS,CAAC;AACxB,cAAc,oBAAoB,CAAC;AACnC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,uBAAuB,CAAC;AACtC,cAAc,eAAe,CAAC"}
|
package/dist/hooks/index.js
CHANGED
package/dist/hooks/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/hooks/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,kBAAkB,CAAC;AACjC,cAAc,aAAa,CAAC;AAC5B,cAAc,WAAW,CAAC;AAC1B,cAAc,cAAc,CAAC;AAC7B,cAAc,SAAS,CAAC;AACxB,cAAc,gBAAgB,CAAC;AAC/B,cAAc,sBAAsB,CAAC;AACrC,cAAc,sBAAsB,CAAC;AACrC,cAAc,UAAU,CAAC;AACzB,cAAc,eAAe,CAAC;AAC9B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,cAAc,CAAC;AAC7B,cAAc,SAAS,CAAC;AACxB,cAAc,oBAAoB,CAAC;AACnC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,uBAAuB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/hooks/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,kBAAkB,CAAC;AACjC,cAAc,aAAa,CAAC;AAC5B,cAAc,WAAW,CAAC;AAC1B,cAAc,cAAc,CAAC;AAC7B,cAAc,SAAS,CAAC;AACxB,cAAc,gBAAgB,CAAC;AAC/B,cAAc,sBAAsB,CAAC;AACrC,cAAc,sBAAsB,CAAC;AACrC,cAAc,UAAU,CAAC;AACzB,cAAc,eAAe,CAAC;AAC9B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,cAAc,CAAC;AAC7B,cAAc,SAAS,CAAC;AACxB,cAAc,oBAAoB,CAAC;AACnC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,uBAAuB,CAAC;AACtC,cAAc,eAAe,CAAC"}
|
|
@@ -21,6 +21,8 @@ export declare function useExperimentRunResults(projectId: string, experimentId:
|
|
|
21
21
|
role: "text" | "metadata" | "image" | "image_url" | "image_base64" | "expected_output";
|
|
22
22
|
value: unknown;
|
|
23
23
|
}[];
|
|
24
|
+
inputPreview: string | null;
|
|
25
|
+
outputPreview: string | null;
|
|
24
26
|
inputVariables: unknown;
|
|
25
27
|
rawResponse: string | null;
|
|
26
28
|
parsedOutput: unknown;
|
|
@@ -100,6 +102,8 @@ export declare function useRunResult(projectId: string, experimentId: string, ru
|
|
|
100
102
|
role: "text" | "metadata" | "image" | "image_url" | "image_base64" | "expected_output";
|
|
101
103
|
value: unknown;
|
|
102
104
|
}[];
|
|
105
|
+
inputPreview: string | null;
|
|
106
|
+
outputPreview: string | null;
|
|
103
107
|
errorClass: string | null;
|
|
104
108
|
errorMessage: string | null;
|
|
105
109
|
latencyMs: number | null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"run-result.d.ts","sourceRoot":"","sources":["../../src/hooks/run-result.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,qBAAqB,EAAE,4BAA4B,EAAE,MAAM,oBAAoB,CAAC;AAK9F,wBAAgB,uBAAuB,CAAC,SAAS,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,EAAE,KAAK,EAAE,qBAAqB
|
|
1
|
+
{"version":3,"file":"run-result.d.ts","sourceRoot":"","sources":["../../src/hooks/run-result.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,qBAAqB,EAAE,4BAA4B,EAAE,MAAM,oBAAoB,CAAC;AAK9F,wBAAgB,uBAAuB,CAAC,SAAS,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,EAAE,KAAK,EAAE,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;UAU5G;AAED,wBAAgB,oBAAoB,CAAC,SAAS,EAAE,MAAM,EAAE,KAAK,EAAE,4BAA4B,EAAE,OAAO,UAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;UAU1G;AAED,wBAAgB,YAAY,CAAC,SAAS,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,GAAG,IAAI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;UAM/F"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Returns `false` during the server render and the client's first (hydration) render,
|
|
3
|
+
* flipping to `true` only after the component has mounted on the client.
|
|
4
|
+
*
|
|
5
|
+
* Use it as a hydration boundary for content that depends on client-only state — e.g. a
|
|
6
|
+
* React Query cache that is never prefetched/dehydrated on the server. Gating such content
|
|
7
|
+
* behind `useMounted()` guarantees the server output and the client's first paint render the
|
|
8
|
+
* same placeholder, then the real content appears after mount. Unlike `useDelayedLoading`
|
|
9
|
+
* (an anti-flicker timer), this establishes a deterministic first frame, so it is the correct
|
|
10
|
+
* tool for avoiding hydration mismatches.
|
|
11
|
+
*/
|
|
12
|
+
export declare function useMounted(): boolean;
|
|
13
|
+
//# sourceMappingURL=use-mounted.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-mounted.d.ts","sourceRoot":"","sources":["../../src/hooks/use-mounted.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;GAUG;AACH,wBAAgB,UAAU,IAAI,OAAO,CAOpC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { useEffect, useState } from 'react';
|
|
3
|
+
/**
|
|
4
|
+
* Returns `false` during the server render and the client's first (hydration) render,
|
|
5
|
+
* flipping to `true` only after the component has mounted on the client.
|
|
6
|
+
*
|
|
7
|
+
* Use it as a hydration boundary for content that depends on client-only state — e.g. a
|
|
8
|
+
* React Query cache that is never prefetched/dehydrated on the server. Gating such content
|
|
9
|
+
* behind `useMounted()` guarantees the server output and the client's first paint render the
|
|
10
|
+
* same placeholder, then the real content appears after mount. Unlike `useDelayedLoading`
|
|
11
|
+
* (an anti-flicker timer), this establishes a deterministic first frame, so it is the correct
|
|
12
|
+
* tool for avoiding hydration mismatches.
|
|
13
|
+
*/
|
|
14
|
+
export function useMounted() {
|
|
15
|
+
const [mounted, setMounted] = useState(false);
|
|
16
|
+
useEffect(() => {
|
|
17
|
+
// eslint-disable-next-line react-hooks/set-state-in-effect -- intentional: the post-mount flip is exactly what makes this a hydration boundary
|
|
18
|
+
setMounted(true);
|
|
19
|
+
}, []);
|
|
20
|
+
return mounted;
|
|
21
|
+
}
|
|
22
|
+
//# sourceMappingURL=use-mounted.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-mounted.js","sourceRoot":"","sources":["../../src/hooks/use-mounted.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;AAEb,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAE5C;;;;;;;;;;GAUG;AACH,MAAM,UAAU,UAAU;IACxB,MAAM,CAAC,OAAO,EAAE,UAAU,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IAC9C,SAAS,CAAC,GAAG,EAAE;QACb,+IAA+I;QAC/I,UAAU,CAAC,IAAI,CAAC,CAAC;IACnB,CAAC,EAAE,EAAE,CAAC,CAAC;IACP,OAAO,OAAO,CAAC;AACjB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"refine-provider.d.ts","sourceRoot":"","sources":["../../src/providers/refine-provider.tsx"],"names":[],"mappings":"AAKA,OAAO,EAAY,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"refine-provider.d.ts","sourceRoot":"","sources":["../../src/providers/refine-provider.tsx"],"names":[],"mappings":"AAKA,OAAO,EAAY,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AA8BjD,wBAAgB,cAAc,CAAC,EAAE,QAAQ,EAAE,EAAE;IAAE,QAAQ,EAAE,SAAS,CAAA;CAAE,2CAkBnE"}
|
|
@@ -4,16 +4,33 @@ import { Refine } from '@refinedev/core';
|
|
|
4
4
|
import routerProvider from '@refinedev/nextjs-router';
|
|
5
5
|
import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
|
|
6
6
|
import { Suspense } from 'react';
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
7
|
+
function makeQueryClient() {
|
|
8
|
+
return new QueryClient({
|
|
9
|
+
defaultOptions: {
|
|
10
|
+
queries: {
|
|
11
|
+
retry: 1,
|
|
12
|
+
staleTime: 30_000,
|
|
13
|
+
refetchOnWindowFocus: true,
|
|
14
|
+
},
|
|
13
15
|
},
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
let browserQueryClient;
|
|
19
|
+
// TanStack's recommended SSR pattern: a fresh client per request on the server (so the cache
|
|
20
|
+
// never leaks across requests and every SSR starts from an empty cache for a deterministic
|
|
21
|
+
// first paint), and a reused singleton in the browser (so the cache survives Suspense, remounts
|
|
22
|
+
// and client-side navigations). The previous module-level singleton was shared across all
|
|
23
|
+
// server requests, which is both a cross-request data-leak hazard and a source of hydration
|
|
24
|
+
// mismatches (a warm server cache could render content the client's fresh first paint lacked).
|
|
25
|
+
function getQueryClient() {
|
|
26
|
+
if (typeof window === 'undefined') {
|
|
27
|
+
return makeQueryClient();
|
|
28
|
+
}
|
|
29
|
+
browserQueryClient ??= makeQueryClient();
|
|
30
|
+
return browserQueryClient;
|
|
31
|
+
}
|
|
16
32
|
export function RefineProvider({ children }) {
|
|
33
|
+
const queryClient = getQueryClient();
|
|
17
34
|
return (_jsx(QueryClientProvider, { client: queryClient, children: _jsx(Suspense, { fallback: null, children: _jsx(Refine, { routerProvider: routerProvider, options: {
|
|
18
35
|
syncWithLocation: true,
|
|
19
36
|
warnWhenUnsavedChanges: false,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"refine-provider.js","sourceRoot":"","sources":["../../src/providers/refine-provider.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AACzC,OAAO,cAAc,MAAM,0BAA0B,CAAC;AACtD,OAAO,EAAE,WAAW,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AACzE,OAAO,EAAE,QAAQ,EAAkB,MAAM,OAAO,CAAC;AAEjD,
|
|
1
|
+
{"version":3,"file":"refine-provider.js","sourceRoot":"","sources":["../../src/providers/refine-provider.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AACzC,OAAO,cAAc,MAAM,0BAA0B,CAAC;AACtD,OAAO,EAAE,WAAW,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AACzE,OAAO,EAAE,QAAQ,EAAkB,MAAM,OAAO,CAAC;AAEjD,SAAS,eAAe;IACtB,OAAO,IAAI,WAAW,CAAC;QACrB,cAAc,EAAE;YACd,OAAO,EAAE;gBACP,KAAK,EAAE,CAAC;gBACR,SAAS,EAAE,MAAM;gBACjB,oBAAoB,EAAE,IAAI;aAC3B;SACF;KACF,CAAC,CAAC;AACL,CAAC;AAED,IAAI,kBAA2C,CAAC;AAEhD,6FAA6F;AAC7F,2FAA2F;AAC3F,gGAAgG;AAChG,0FAA0F;AAC1F,4FAA4F;AAC5F,+FAA+F;AAC/F,SAAS,cAAc;IACrB,IAAI,OAAO,MAAM,KAAK,WAAW,EAAE,CAAC;QAClC,OAAO,eAAe,EAAE,CAAC;IAC3B,CAAC;IACD,kBAAkB,KAAK,eAAe,EAAE,CAAC;IACzC,OAAO,kBAAkB,CAAC;AAC5B,CAAC;AAED,MAAM,UAAU,cAAc,CAAC,EAAE,QAAQ,EAA2B;IAClE,MAAM,WAAW,GAAG,cAAc,EAAE,CAAC;IACrC,OAAO,CACL,KAAC,mBAAmB,IAAC,MAAM,EAAE,WAAW,YACtC,KAAC,QAAQ,IAAC,QAAQ,EAAE,IAAI,YACtB,KAAC,MAAM,IACL,cAAc,EAAE,cAAc,EAC9B,OAAO,EAAE;oBACP,gBAAgB,EAAE,IAAI;oBACtB,sBAAsB,EAAE,KAAK;oBAC7B,gBAAgB,EAAE,IAAI;iBACvB,YAEA,QAAQ,GACF,GACA,GACS,CACvB,CAAC;AACJ,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@proofhound/web-ui",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.13",
|
|
4
4
|
"description": "ProofHound reusable product frontend: screens / hooks / providers / i18n / components / contracts",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
@@ -30,9 +30,9 @@
|
|
|
30
30
|
"jsonc-parser": "3.3.1",
|
|
31
31
|
"lucide-react": "^1.14.0",
|
|
32
32
|
"recharts": "^3.3.1",
|
|
33
|
-
"@proofhound/ui": "0.1.
|
|
34
|
-
"@proofhound/api-client": "0.1.
|
|
35
|
-
"@proofhound/shared": "0.1.
|
|
33
|
+
"@proofhound/ui": "0.1.13",
|
|
34
|
+
"@proofhound/api-client": "0.1.13",
|
|
35
|
+
"@proofhound/shared": "0.1.13"
|
|
36
36
|
},
|
|
37
37
|
"peerDependencies": {
|
|
38
38
|
"next": "^16",
|