@datarecce/ui 0.1.28 → 0.1.29
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/{RecceCheckContext-CiG9fGRW.mjs → RecceCheckContext-PT4-g1bW.mjs} +2 -2
- package/dist/{RecceCheckContext-CiG9fGRW.mjs.map → RecceCheckContext-PT4-g1bW.mjs.map} +1 -1
- package/dist/{RecceCheckContext-tUxygNmN.js → RecceCheckContext-fAKHgsGz.js} +2 -2
- package/dist/{RecceCheckContext-tUxygNmN.js.map → RecceCheckContext-fAKHgsGz.js.map} +1 -1
- package/dist/api.d.mts +1 -1
- package/dist/api.js +2 -2
- package/dist/api.mjs +2 -2
- package/dist/{components-Cvfq_6t4.js → components-B9F5oJbK.js} +4 -4
- package/dist/{components-Cvfq_6t4.js.map → components-B9F5oJbK.js.map} +1 -1
- package/dist/{components-Bt0G4cpr.mjs → components-gDC1ucjo.mjs} +4 -4
- package/dist/{components-Bt0G4cpr.mjs.map → components-gDC1ucjo.mjs.map} +1 -1
- package/dist/components.d.mts +1 -1
- package/dist/components.js +4 -4
- package/dist/components.mjs +4 -4
- package/dist/hooks-4hRUjy9Q.mjs +34 -0
- package/dist/hooks-4hRUjy9Q.mjs.map +1 -0
- package/dist/hooks-C2jUJ9EN.js +40 -0
- package/dist/hooks-C2jUJ9EN.js.map +1 -0
- package/dist/hooks.d.mts +1 -1
- package/dist/hooks.js +11 -11
- package/dist/hooks.mjs +3 -3
- package/dist/{index-OJCzYajo.d.mts → index-Bv5R8iLo.d.mts} +70 -70
- package/dist/{index-OJCzYajo.d.mts.map → index-Bv5R8iLo.d.mts.map} +1 -1
- package/dist/index-CUtFlKOo.d.ts.map +1 -1
- package/dist/index.d.mts +1 -1
- package/dist/index.js +13 -13
- package/dist/index.mjs +5 -5
- package/dist/{state-DyHCt6IJ.mjs → state-CELzQ0tM.mjs} +183 -20
- package/dist/state-CELzQ0tM.mjs.map +1 -0
- package/dist/{state-FkYREAs-.js → state-CemiRRon.js} +223 -18
- package/dist/state-CemiRRon.js.map +1 -0
- package/dist/types.d.mts +1 -1
- package/dist/{version-BGNaeW6k.js → version-bWg7XwOu.js} +2 -2
- package/dist/{version-BGNaeW6k.js.map → version-bWg7XwOu.js.map} +1 -1
- package/dist/{version-Dav28qEz.mjs → version-paZ9esBk.mjs} +2 -2
- package/dist/{version-Dav28qEz.mjs.map → version-paZ9esBk.mjs.map} +1 -1
- package/package.json +1 -1
- package/dist/hooks-BxV6qN9q.mjs +0 -233
- package/dist/hooks-BxV6qN9q.mjs.map +0 -1
- package/dist/hooks-CriUVJO1.js +0 -287
- package/dist/hooks-CriUVJO1.js.map +0 -1
- package/dist/state-DyHCt6IJ.mjs.map +0 -1
- package/dist/state-FkYREAs-.js.map +0 -1
|
@@ -50,7 +50,7 @@ import { VscClose, VscKebabVertical, VscKey, VscPin, VscPinned } from "react-ico
|
|
|
50
50
|
import MuiTooltip from "@mui/material/Tooltip";
|
|
51
51
|
import { useCopyToClipboard } from "usehooks-ts";
|
|
52
52
|
import ListSubheader from "@mui/material/ListSubheader";
|
|
53
|
-
import { usePathname, usePathname as usePathname$1, useRouter } from "next/navigation";
|
|
53
|
+
import { useParams, usePathname, usePathname as usePathname$1, useRouter, useSearchParams } from "next/navigation";
|
|
54
54
|
import Link from "@mui/material/Link";
|
|
55
55
|
import MuiPopover from "@mui/material/Popover";
|
|
56
56
|
import ButtonGroup from "@mui/material/ButtonGroup";
|
|
@@ -1844,7 +1844,7 @@ async function getRecceInstanceInfo(client = axiosClient) {
|
|
|
1844
1844
|
|
|
1845
1845
|
//#endregion
|
|
1846
1846
|
//#region recce-source/js/src/lib/hooks/ApiConfigContext.tsx
|
|
1847
|
-
const defaultConfig = {
|
|
1847
|
+
const defaultConfig$1 = {
|
|
1848
1848
|
apiPrefix: "",
|
|
1849
1849
|
authToken: void 0,
|
|
1850
1850
|
baseUrl: void 0
|
|
@@ -1877,7 +1877,7 @@ function createApiClient(config) {
|
|
|
1877
1877
|
});
|
|
1878
1878
|
return client;
|
|
1879
1879
|
}
|
|
1880
|
-
function ApiConfigProvider({ children, apiPrefix = defaultConfig.apiPrefix, authToken = defaultConfig.authToken, baseUrl = defaultConfig.baseUrl }) {
|
|
1880
|
+
function ApiConfigProvider({ children, apiPrefix = defaultConfig$1.apiPrefix, authToken = defaultConfig$1.authToken, baseUrl = defaultConfig$1.baseUrl }) {
|
|
1881
1881
|
const config = useMemo(() => ({
|
|
1882
1882
|
apiPrefix,
|
|
1883
1883
|
authToken,
|
|
@@ -5475,21 +5475,76 @@ const RunModal = ({ isOpen, onClose, onExecute, type, title, params: defaultPara
|
|
|
5475
5475
|
};
|
|
5476
5476
|
|
|
5477
5477
|
//#endregion
|
|
5478
|
-
//#region
|
|
5478
|
+
//#region src/lib/hooks/RouteConfigContext.ts
|
|
5479
|
+
const defaultConfig = { basePath: "" };
|
|
5480
|
+
const RouteConfigContext = createContext(null);
|
|
5479
5481
|
/**
|
|
5480
|
-
*
|
|
5482
|
+
* Provider for route configuration.
|
|
5481
5483
|
*
|
|
5482
|
-
*
|
|
5483
|
-
*
|
|
5484
|
-
* and useSearchParams into a unified interface.
|
|
5484
|
+
* Wrap your application (or RecceContextProvider) with this provider
|
|
5485
|
+
* to configure path prefixes for navigation.
|
|
5485
5486
|
*
|
|
5486
|
-
*
|
|
5487
|
-
*
|
|
5488
|
-
*
|
|
5489
|
-
*
|
|
5487
|
+
* @example
|
|
5488
|
+
* // In recce-cloud
|
|
5489
|
+
* <RouteConfigProvider basePath={`/oss/${sessionId}`}>
|
|
5490
|
+
* <RecceContextProvider>
|
|
5491
|
+
* {children}
|
|
5492
|
+
* </RecceContextProvider>
|
|
5493
|
+
* </RouteConfigProvider>
|
|
5494
|
+
*/
|
|
5495
|
+
function RouteConfigProvider({ children, basePath = defaultConfig.basePath }) {
|
|
5496
|
+
const resolvePath = useCallback((path$1) => {
|
|
5497
|
+
if (!basePath) return path$1;
|
|
5498
|
+
if (path$1.startsWith(basePath)) return path$1;
|
|
5499
|
+
if (path$1.match(/^https?:\/\//)) return path$1;
|
|
5500
|
+
if (path$1.startsWith("#")) return path$1;
|
|
5501
|
+
return `${basePath.endsWith("/") ? basePath.slice(0, -1) : basePath}${path$1.startsWith("/") ? path$1 : `/${path$1}`}`;
|
|
5502
|
+
}, [basePath]);
|
|
5503
|
+
const contextValue = useMemo(() => ({
|
|
5504
|
+
basePath,
|
|
5505
|
+
resolvePath
|
|
5506
|
+
}), [basePath, resolvePath]);
|
|
5507
|
+
return React.createElement(RouteConfigContext.Provider, { value: contextValue }, children);
|
|
5508
|
+
}
|
|
5509
|
+
const defaultRouteConfigContext = {
|
|
5510
|
+
basePath: "",
|
|
5511
|
+
resolvePath: (path$1) => path$1
|
|
5512
|
+
};
|
|
5513
|
+
/**
|
|
5514
|
+
* Hook to access route configuration.
|
|
5515
|
+
*
|
|
5516
|
+
* When used outside RouteConfigProvider, returns default config
|
|
5517
|
+
* (for OSS backward compatibility).
|
|
5518
|
+
*
|
|
5519
|
+
* @returns RouteConfigContextType with basePath and resolvePath function
|
|
5520
|
+
*/
|
|
5521
|
+
function useRouteConfig() {
|
|
5522
|
+
return useContext(RouteConfigContext) ?? defaultRouteConfigContext;
|
|
5523
|
+
}
|
|
5524
|
+
/**
|
|
5525
|
+
* Safe hook that returns null if context not available.
|
|
5526
|
+
* Useful for components that need to detect if RouteConfigProvider is present.
|
|
5527
|
+
*/
|
|
5528
|
+
function useRouteConfigSafe() {
|
|
5529
|
+
return useContext(RouteConfigContext);
|
|
5530
|
+
}
|
|
5531
|
+
|
|
5532
|
+
//#endregion
|
|
5533
|
+
//#region src/lib/hooks/useAppRouter.ts
|
|
5534
|
+
/**
|
|
5535
|
+
* useAppRouter - Navigation utilities for Next.js App Router with RouteConfig support
|
|
5536
|
+
*
|
|
5537
|
+
* This is a custom version that wraps the OSS useAppRouter to add
|
|
5538
|
+
* RouteConfigContext support for path prefixing in recce-cloud.
|
|
5539
|
+
*
|
|
5540
|
+
* The key difference from OSS:
|
|
5541
|
+
* - setLocation() automatically prefixes paths with the configured basePath
|
|
5542
|
+
* - This allows OSS components to use setLocation("/query") while
|
|
5543
|
+
* recce-cloud can configure basePath="/oss/abc123" to get "/oss/abc123/query"
|
|
5490
5544
|
*/
|
|
5491
5545
|
/**
|
|
5492
5546
|
* Hook that provides Wouter-compatible location API using Next.js App Router
|
|
5547
|
+
* with RouteConfigContext support for path prefixing.
|
|
5493
5548
|
*
|
|
5494
5549
|
* NOTE: This returns only the pathname (not search params) to avoid
|
|
5495
5550
|
* triggering Suspense boundaries on every navigation.
|
|
@@ -5498,15 +5553,123 @@ const RunModal = ({ isOpen, onClose, onExecute, type, title, params: defaultPara
|
|
|
5498
5553
|
*
|
|
5499
5554
|
* @example
|
|
5500
5555
|
* const [location, setLocation] = useAppLocation();
|
|
5501
|
-
* setLocation("/checks?id=123"); //
|
|
5502
|
-
*
|
|
5556
|
+
* setLocation("/checks?id=123"); // In cloud mode with basePath="/oss/abc123"
|
|
5557
|
+
* // navigates to "/oss/abc123/checks?id=123"
|
|
5503
5558
|
*/
|
|
5504
5559
|
function useAppLocation() {
|
|
5505
5560
|
const router = useRouter();
|
|
5506
|
-
|
|
5507
|
-
|
|
5508
|
-
|
|
5509
|
-
|
|
5561
|
+
const pathname = usePathname$1();
|
|
5562
|
+
const { resolvePath } = useRouteConfig();
|
|
5563
|
+
return [pathname, useCallback((to, options) => {
|
|
5564
|
+
const [pathPart, queryPart] = to.split("?");
|
|
5565
|
+
const resolvedPath = resolvePath(pathPart);
|
|
5566
|
+
const fullPath = queryPart ? `${resolvedPath}?${queryPart}` : resolvedPath;
|
|
5567
|
+
if (options?.replace) router.replace(fullPath, { scroll: options?.scroll ?? true });
|
|
5568
|
+
else router.push(fullPath, { scroll: options?.scroll ?? true });
|
|
5569
|
+
}, [router, resolvePath])];
|
|
5570
|
+
}
|
|
5571
|
+
/**
|
|
5572
|
+
* Hook that includes search params in the location string.
|
|
5573
|
+
* Also supports RouteConfigContext path prefixing.
|
|
5574
|
+
*
|
|
5575
|
+
* WARNING: This hook uses useSearchParams() which triggers Suspense.
|
|
5576
|
+
* Only use this in components that are wrapped in a <Suspense> boundary,
|
|
5577
|
+
* or in leaf components where suspension is acceptable.
|
|
5578
|
+
*
|
|
5579
|
+
* @returns [fullLocation, setLocation] tuple with search params included
|
|
5580
|
+
*/
|
|
5581
|
+
function useAppLocationWithSearch() {
|
|
5582
|
+
const router = useRouter();
|
|
5583
|
+
const pathname = usePathname$1();
|
|
5584
|
+
const searchParams = useSearchParams();
|
|
5585
|
+
const { resolvePath } = useRouteConfig();
|
|
5586
|
+
return [useMemo(() => {
|
|
5587
|
+
const search = searchParams?.toString();
|
|
5588
|
+
return search ? `${pathname}?${search}` : pathname;
|
|
5589
|
+
}, [pathname, searchParams]), useCallback((to, options) => {
|
|
5590
|
+
const [pathPart, queryPart] = to.split("?");
|
|
5591
|
+
const resolvedPath = resolvePath(pathPart);
|
|
5592
|
+
const fullPath = queryPart ? `${resolvedPath}?${queryPart}` : resolvedPath;
|
|
5593
|
+
if (options?.replace) router.replace(fullPath, { scroll: options?.scroll ?? true });
|
|
5594
|
+
else router.push(fullPath, { scroll: options?.scroll ?? true });
|
|
5595
|
+
}, [router, resolvePath])];
|
|
5596
|
+
}
|
|
5597
|
+
/**
|
|
5598
|
+
* Hook to check if current path matches a pattern
|
|
5599
|
+
* Similar to Wouter's useRoute
|
|
5600
|
+
*
|
|
5601
|
+
* @param pattern - The route pattern to match (e.g., "/checks/:checkId")
|
|
5602
|
+
* @returns [isMatch, params] tuple
|
|
5603
|
+
*
|
|
5604
|
+
* @example
|
|
5605
|
+
* const [isMatch, params] = useAppRoute("/checks/:checkId");
|
|
5606
|
+
* if (isMatch) {
|
|
5607
|
+
* console.log(params.checkId); // "abc-123"
|
|
5608
|
+
* }
|
|
5609
|
+
*/
|
|
5610
|
+
function useAppRoute(pattern) {
|
|
5611
|
+
const pathname = usePathname$1();
|
|
5612
|
+
const params = useParams();
|
|
5613
|
+
return [useMemo(() => {
|
|
5614
|
+
const regexPattern = pattern.replace(/:\w+/g, "([^/]+)").replace(/\*/g, ".*");
|
|
5615
|
+
return (/* @__PURE__ */ new RegExp(`^${regexPattern}$`)).test(pathname);
|
|
5616
|
+
}, [pattern, pathname]), useMemo(() => {
|
|
5617
|
+
if (!params) return {};
|
|
5618
|
+
return Object.fromEntries(Object.entries(params).map(([key, value]) => [key, Array.isArray(value) ? value.join("/") : value]));
|
|
5619
|
+
}, [params])];
|
|
5620
|
+
}
|
|
5621
|
+
/**
|
|
5622
|
+
* Imperative navigation function for use outside React components
|
|
5623
|
+
* Use sparingly - prefer useAppLocation hook in components
|
|
5624
|
+
*
|
|
5625
|
+
* NOTE: This function does NOT support RouteConfigContext because
|
|
5626
|
+
* it's used outside of React component tree. If you need path prefixing,
|
|
5627
|
+
* use useAppLocation hook instead.
|
|
5628
|
+
*
|
|
5629
|
+
* @example
|
|
5630
|
+
* // In an event handler or utility function
|
|
5631
|
+
* import { navigateTo } from "@/lib/hooks/useAppRouter";
|
|
5632
|
+
* navigateTo("/checks?id=123");
|
|
5633
|
+
*/
|
|
5634
|
+
function navigateTo(path$1, replace = false) {
|
|
5635
|
+
if (typeof window !== "undefined") {
|
|
5636
|
+
if (replace) window.history.replaceState(null, "", path$1);
|
|
5637
|
+
else window.history.pushState(null, "", path$1);
|
|
5638
|
+
window.dispatchEvent(new PopStateEvent("popstate"));
|
|
5639
|
+
}
|
|
5640
|
+
}
|
|
5641
|
+
/**
|
|
5642
|
+
* Hook for programmatic navigation with more options
|
|
5643
|
+
* Provides direct access to Next.js router methods with RouteConfigContext support
|
|
5644
|
+
*
|
|
5645
|
+
* NOTE: Does not include searchParams to avoid Suspense.
|
|
5646
|
+
* Use useSearchParams() directly in components that need it.
|
|
5647
|
+
*/
|
|
5648
|
+
function useAppNavigation() {
|
|
5649
|
+
const router = useRouter();
|
|
5650
|
+
const pathname = usePathname$1();
|
|
5651
|
+
const params = useParams();
|
|
5652
|
+
const { resolvePath } = useRouteConfig();
|
|
5653
|
+
return {
|
|
5654
|
+
pathname,
|
|
5655
|
+
params,
|
|
5656
|
+
push: useCallback((href, options) => {
|
|
5657
|
+
const [pathPart, queryPart] = href.split("?");
|
|
5658
|
+
const resolvedPath = resolvePath(pathPart);
|
|
5659
|
+
const fullPath = queryPart ? `${resolvedPath}?${queryPart}` : resolvedPath;
|
|
5660
|
+
router.push(fullPath, options);
|
|
5661
|
+
}, [router, resolvePath]),
|
|
5662
|
+
replace: useCallback((href, options) => {
|
|
5663
|
+
const [pathPart, queryPart] = href.split("?");
|
|
5664
|
+
const resolvedPath = resolvePath(pathPart);
|
|
5665
|
+
const fullPath = queryPart ? `${resolvedPath}?${queryPart}` : resolvedPath;
|
|
5666
|
+
router.replace(fullPath, options);
|
|
5667
|
+
}, [router, resolvePath]),
|
|
5668
|
+
back: router.back,
|
|
5669
|
+
forward: router.forward,
|
|
5670
|
+
refresh: router.refresh,
|
|
5671
|
+
prefetch: router.prefetch
|
|
5672
|
+
};
|
|
5510
5673
|
}
|
|
5511
5674
|
|
|
5512
5675
|
//#endregion
|
|
@@ -8222,5 +8385,5 @@ async function shareState(client = axiosClient) {
|
|
|
8222
8385
|
}
|
|
8223
8386
|
|
|
8224
8387
|
//#endregion
|
|
8225
|
-
export {
|
|
8226
|
-
//# sourceMappingURL=state-
|
|
8388
|
+
export { DiffText as $, trackColumnLevelLineage as $t, ColumnNameCell as A, selectUpstream as An, useApiConfigSafe as At, useAppNavigation as B, reactQueryClient as Bn, submitQueryDiff as Bt, TopKSummaryList as C, isValueDiffDetailRun as Cn, formatDuration as Ct, QueryDiffResultView as D, isLineageGraphNode as Dn, ApiConfigProvider as Dt, QueryResultView as E, isLineageGraphColumnNode as En, useRecceInstanceInfo as Et, RecceActionContextProvider as F, getLineageDiff as Fn, submitValueDiffDetail as Ft, RunModal as G, useToaster as Gn, searchRuns as Gt, RouteConfigProvider as H, Toaster as Hn, cancelRun as Ht, useRecceActionContext as I, getLineageWithError as In, submitProfileDiff as It, IconImport as J, lightTheme as Jn, waitRun as Jt, IconEdit as K, colors as Kn, submitRun as Kt, navigateTo as L, getModelInfo as Ln, createLineageDiffCheck as Lt, useLineageViewContext as M, union as Mn, EmptyRowsRenderer as Mt, useLineageViewContextSafe as N, getCll as Nn, ScreenshotDataGrid as Nt, ProfileDiffResultView as O, layout as On, useApiClient as Ot, RecceActionContext as P, getLineage as Pn, submitValueDiff as Pt, deltaPercentageString as Q, LINEAGE_SELECTION_ACTION as Qt, useAppLocation as R, getServerInfo as Rn, submitQuery as Rt, TopKDiffResultView as S, isTopKDiffRun as Sn, markRelaunchHintCompleted as St, RowCountDiffResultView as T, COLUMN_HEIGHT as Tn, useRecceInstanceContext as Tt, useRouteConfig as U, ToasterProvider as Un, getRun as Ut, useAppRoute as V, ScreenshotBox as Vn, aggregateRuns as Vt, useRouteConfigSafe as W, toaster as Wn, listRuns as Wt, IconSave as X, EXPLORE_FORM_EVENT as Xt, IconInfo as Y, token as Yn, EXPLORE_ACTION as Yt, IconSync as Z, EXPLORE_SOURCE as Zt, findByRunType as _, isQueryBaseRun as _n, useRecceServerFlag as _t, saveAs as a, trackLineageSelection as an, queryModelRowCount as at, ValueDiffForm as b, isRowCountDiffRun as bn, getServerFlag as bt, createCheckByRun as c, trackNavigation as cn, HistogramDiffResultView as ct, getCheck as d, trackShareState as dn, HistogramDiffForm as dt, trackCopyToClipboard as en, useClipBoardToast as et, listChecks as f, trackSingleEnvironment as fn, supportsHistogramDiff as ft, useChecks as g, isProfileDiffRun as gn, useRunsAggregated as gt, updateCheck as h, isHistogramDiffRun as hn, useLineageGraphContext as ht, rename as i, trackHistoryAction as in, fetchModelRowCount as it, LineageViewContext as j, toReactFlow as jn, cacheKeys as jt, createDataGridFromData as k, selectDownstream as kn, useApiConfig as kt, createSimpleCheck as l, trackPreviewChange as ln, HistogramChart as lt, reorderChecks as m, RunToolbar as mn, LineageGraphContextProvider as mt, importState as n, trackExploreAction as nn, mergeKeysWithStatus as nt, shareState as o, trackLineageViewRender as on, queryRowCount as ot, markAsPresetCheck as p, trackStateAction as pn, useModelColumns_default as pt, IconExport as q, darkTheme as qn, submitRunFromCheck as qt, isStateSyncing as r, trackExploreActionForm as rn, submitRowCountDiff as rt, syncState as s, trackMultiNodesAction as sn, ProfileDiffForm as st, exportState as t, trackEnvironmentConfig as tn, mergeKeys as tt, deleteCheck as u, trackPreviewChangeFeedback as un, SquareIcon as ut, runTypeHasRef as v, isQueryDiffRun as vn, IdleTimeoutProvider as vt, TopKDiffForm as w, isValueDiffRun as wn, RecceInstanceInfoProvider as wt, ValueDiffDetailResultView as x, isRowCountRun as xn, markOnboardingCompleted as xt, ValueDiffResultView as y, isQueryRun as yn, useIdleTimeout as yt, useAppLocationWithSearch as z, axiosClient as zn, submitQueryBase as zt };
|
|
8389
|
+
//# sourceMappingURL=state-CELzQ0tM.mjs.map
|