@datarecce/ui 0.1.28 → 0.1.30
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-tUxygNmN.js → RecceCheckContext-DPpu9nG5.js} +2 -2
- package/dist/{RecceCheckContext-tUxygNmN.js.map → RecceCheckContext-DPpu9nG5.js.map} +1 -1
- package/dist/{RecceCheckContext-CiG9fGRW.mjs → RecceCheckContext-bXdfQLGG.mjs} +2 -2
- package/dist/{RecceCheckContext-CiG9fGRW.mjs.map → RecceCheckContext-bXdfQLGG.mjs.map} +1 -1
- package/dist/api.d.mts +1 -1
- package/dist/api.d.ts +1 -1
- package/dist/api.js +4 -3
- package/dist/api.mjs +4 -3
- package/dist/{components-Cvfq_6t4.js → components-B-YxuuPz.js} +66 -65
- package/dist/{components-Cvfq_6t4.js.map → components-B-YxuuPz.js.map} +1 -1
- package/dist/{components-D2DRqJsz.css → components-BeAjVBV3.css} +1 -1
- package/dist/{components-D2DRqJsz.css.map → components-BeAjVBV3.css.map} +1 -1
- package/dist/{components-Bt0G4cpr.mjs → components-DCOI1YlQ.mjs} +8 -7
- package/dist/{components-Bt0G4cpr.mjs.map → components-DCOI1YlQ.mjs.map} +1 -1
- package/dist/{components-dVXbmdqd.css → components-iUxcqtUB.css} +1 -1
- package/dist/{components-dVXbmdqd.css.map → components-iUxcqtUB.css.map} +1 -1
- package/dist/components.d.mts +1 -1
- package/dist/components.d.ts +1 -1
- package/dist/components.js +6 -5
- package/dist/components.mjs +6 -5
- package/dist/hooks-B9hsc1oD.js +40 -0
- package/dist/hooks-B9hsc1oD.js.map +1 -0
- package/dist/hooks-DjBNmTdh.mjs +34 -0
- package/dist/hooks-DjBNmTdh.mjs.map +1 -0
- package/dist/hooks.d.mts +1 -1
- package/dist/hooks.d.ts +1 -1
- package/dist/hooks.js +13 -12
- package/dist/hooks.mjs +5 -4
- package/dist/{html2canvas-pro.esm-BR5xeFe-.mjs → html2canvas-pro.esm-BInzOtWO.mjs} +1 -1
- package/dist/{html2canvas-pro.esm-BR5xeFe-.mjs.map → html2canvas-pro.esm-BInzOtWO.mjs.map} +1 -1
- package/dist/{html2canvas-pro.esm-CVOsBdk0.js → html2canvas-pro.esm-WJxOmKlq.js} +1 -1
- package/dist/{html2canvas-pro.esm-CVOsBdk0.js.map → html2canvas-pro.esm-WJxOmKlq.js.map} +1 -1
- package/dist/{index-CUtFlKOo.d.ts → index-BNUP2V_N.d.ts} +70 -70
- package/dist/index-BNUP2V_N.d.ts.map +1 -0
- package/dist/{index-OJCzYajo.d.mts → index-DOPZuhD8.d.mts} +70 -70
- package/dist/{index-OJCzYajo.d.mts.map → index-DOPZuhD8.d.mts.map} +1 -1
- package/dist/index.d.mts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +16 -15
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +8 -7
- package/dist/index.mjs.map +1 -1
- package/dist/mui-theme-B2wm_cvZ.js +732 -0
- package/dist/mui-theme-B2wm_cvZ.js.map +1 -0
- package/dist/mui-theme-CUhybmBq.mjs +696 -0
- package/dist/mui-theme-CUhybmBq.mjs.map +1 -0
- package/dist/{state-DyHCt6IJ.mjs → state-B9yzhuKs.mjs} +186 -712
- package/dist/state-B9yzhuKs.mjs.map +1 -0
- package/dist/{state-eEsMhIy4.css → state-DOUPNifc.css} +1 -1
- package/dist/{state-eEsMhIy4.css.map → state-DOUPNifc.css.map} +1 -1
- package/dist/{state-FkYREAs-.js → state-lPCQsWy5.js} +246 -754
- package/dist/state-lPCQsWy5.js.map +1 -0
- package/dist/theme.d.mts +186 -0
- package/dist/theme.d.mts.map +1 -0
- package/dist/theme.d.ts +186 -0
- package/dist/theme.d.ts.map +1 -0
- package/dist/theme.js +9 -0
- package/dist/theme.mjs +4 -0
- package/dist/{tooltipMessage-CrXjOmVM.mjs → tooltipMessage-B--I3p1V.mjs} +1 -1
- package/dist/{tooltipMessage-CrXjOmVM.mjs.map → tooltipMessage-B--I3p1V.mjs.map} +1 -1
- package/dist/{tooltipMessage-Dbi1kkfi.js → tooltipMessage-DosF13kZ.js} +1 -1
- package/dist/{tooltipMessage-Dbi1kkfi.js.map → tooltipMessage-DosF13kZ.js.map} +1 -1
- package/dist/types.d.mts +1 -1
- package/dist/types.d.ts +1 -1
- package/dist/types.js +2 -2
- package/dist/types.mjs +2 -2
- package/dist/{urls-D7PrPolY.mjs → urls-B1Ymdoz-.mjs} +1 -1
- package/dist/{urls-D7PrPolY.mjs.map → urls-B1Ymdoz-.mjs.map} +1 -1
- package/dist/{urls-SazAekCZ.js → urls-C4eAc82S.js} +1 -1
- package/dist/{urls-SazAekCZ.js.map → urls-C4eAc82S.js.map} +1 -1
- package/dist/{version-BGNaeW6k.js → version-Dh8sZhvs.js} +2 -2
- package/dist/{version-BGNaeW6k.js.map → version-Dh8sZhvs.js.map} +1 -1
- package/dist/{version-Dav28qEz.mjs → version-OnOKzBeQ.mjs} +2 -2
- package/dist/{version-Dav28qEz.mjs.map → version-OnOKzBeQ.mjs.map} +1 -1
- package/package.json +6 -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/index-CUtFlKOo.d.ts.map +0 -1
- package/dist/state-DyHCt6IJ.mjs.map +0 -1
- package/dist/state-FkYREAs-.js.map +0 -1
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use client"
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
2
|
+
import { t as colors } from "./mui-theme-CUhybmBq.mjs";
|
|
3
|
+
import { n as PUBLIC_API_URL, t as RECCE_SUPPORT_CALENDAR_URL } from "./urls-B1Ymdoz-.mjs";
|
|
4
|
+
import { useTheme } from "@mui/material/styles";
|
|
4
5
|
import React, { ComponentType, Dispatch, ForwardRefExoticComponent, Fragment, ReactNode, Ref, RefAttributes, SetStateAction, createContext, forwardRef, useCallback, useContext, useEffect, useImperativeHandle, useMemo, useRef, useState } from "react";
|
|
5
6
|
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
6
7
|
import Alert from "@mui/material/Alert";
|
|
@@ -50,701 +51,11 @@ import { VscClose, VscKebabVertical, VscKey, VscPin, VscPinned } from "react-ico
|
|
|
50
51
|
import MuiTooltip from "@mui/material/Tooltip";
|
|
51
52
|
import { useCopyToClipboard } from "usehooks-ts";
|
|
52
53
|
import ListSubheader from "@mui/material/ListSubheader";
|
|
53
|
-
import { usePathname, usePathname as usePathname$1, useRouter } from "next/navigation";
|
|
54
|
+
import { useParams, usePathname, usePathname as usePathname$1, useRouter, useSearchParams } from "next/navigation";
|
|
54
55
|
import Link from "@mui/material/Link";
|
|
55
56
|
import MuiPopover from "@mui/material/Popover";
|
|
56
57
|
import ButtonGroup from "@mui/material/ButtonGroup";
|
|
57
58
|
|
|
58
|
-
//#region recce-source/js/src/components/ui/mui-theme.ts
|
|
59
|
-
/**
|
|
60
|
-
* MUI Theme Configuration for Recce
|
|
61
|
-
*
|
|
62
|
-
* This theme mirrors the existing Chakra UI theme tokens from theme.ts
|
|
63
|
-
* to ensure visual consistency during the migration period.
|
|
64
|
-
*
|
|
65
|
-
* Color palette mappings:
|
|
66
|
-
* - iochmara (custom blue) -> primary
|
|
67
|
-
* - cyan -> secondary
|
|
68
|
-
* - brand (orange) -> custom palette
|
|
69
|
-
* - green -> success
|
|
70
|
-
* - amber -> warning
|
|
71
|
-
* - red -> error
|
|
72
|
-
* - neutral -> grey
|
|
73
|
-
*/
|
|
74
|
-
const white = "#FFFFFF";
|
|
75
|
-
const black = "#000000";
|
|
76
|
-
const colors = {
|
|
77
|
-
white,
|
|
78
|
-
black,
|
|
79
|
-
iochmara: {
|
|
80
|
-
50: "#EAF3FB",
|
|
81
|
-
100: "#C4DDF3",
|
|
82
|
-
200: "#9EC6EB",
|
|
83
|
-
300: "#79B0E2",
|
|
84
|
-
400: "#5599D8",
|
|
85
|
-
500: "#3182CE",
|
|
86
|
-
600: "#2A6CA7",
|
|
87
|
-
700: "#225581",
|
|
88
|
-
800: "#193E5C",
|
|
89
|
-
900: "#102638",
|
|
90
|
-
950: "#060E14"
|
|
91
|
-
},
|
|
92
|
-
cyan: {
|
|
93
|
-
50: "#ECFEFF",
|
|
94
|
-
100: "#CFFAFE",
|
|
95
|
-
200: "#A5F3FC",
|
|
96
|
-
300: "#67E8F9",
|
|
97
|
-
400: "#22D3EE",
|
|
98
|
-
500: "#06B6D4",
|
|
99
|
-
600: "#0891B2",
|
|
100
|
-
700: "#0E7490",
|
|
101
|
-
800: "#155E75",
|
|
102
|
-
900: "#164E63",
|
|
103
|
-
950: "#083344"
|
|
104
|
-
},
|
|
105
|
-
neutral: {
|
|
106
|
-
50: "#FAFAFA",
|
|
107
|
-
100: "#F5F5F5",
|
|
108
|
-
200: "#E5E5E5",
|
|
109
|
-
300: "#D4D4D4",
|
|
110
|
-
400: "#A3A3A3",
|
|
111
|
-
500: "#737373",
|
|
112
|
-
600: "#525252",
|
|
113
|
-
700: "#404040",
|
|
114
|
-
800: "#262626",
|
|
115
|
-
900: "#171717",
|
|
116
|
-
950: "#0A0A0A"
|
|
117
|
-
},
|
|
118
|
-
amber: {
|
|
119
|
-
50: "#FFFBEB",
|
|
120
|
-
100: "#FEF3C7",
|
|
121
|
-
200: "#FDE68A",
|
|
122
|
-
300: "#FCD34D",
|
|
123
|
-
400: "#FBBF24",
|
|
124
|
-
500: "#F59E0B",
|
|
125
|
-
600: "#D97706",
|
|
126
|
-
700: "#B45309",
|
|
127
|
-
800: "#92400E",
|
|
128
|
-
900: "#78350F",
|
|
129
|
-
950: "#431407"
|
|
130
|
-
},
|
|
131
|
-
yellow: {
|
|
132
|
-
50: "#FEFCE8",
|
|
133
|
-
100: "#FEF9C3",
|
|
134
|
-
200: "#FEF08A",
|
|
135
|
-
300: "#FDE047",
|
|
136
|
-
400: "#FACC15",
|
|
137
|
-
500: "#EAB308",
|
|
138
|
-
600: "#CA8A04",
|
|
139
|
-
700: "#A16207",
|
|
140
|
-
800: "#854D0E",
|
|
141
|
-
900: "#713F12",
|
|
142
|
-
950: "#422006"
|
|
143
|
-
},
|
|
144
|
-
green: {
|
|
145
|
-
50: "#F0FDF4",
|
|
146
|
-
100: "#DCFCE7",
|
|
147
|
-
200: "#BBF7D0",
|
|
148
|
-
300: "#86EFAC",
|
|
149
|
-
400: "#4ADE80",
|
|
150
|
-
500: "#22C55E",
|
|
151
|
-
600: "#16A34A",
|
|
152
|
-
700: "#15803D",
|
|
153
|
-
800: "#166534",
|
|
154
|
-
900: "#14532D",
|
|
155
|
-
950: "#052E16"
|
|
156
|
-
},
|
|
157
|
-
red: {
|
|
158
|
-
50: "#FEF2F2",
|
|
159
|
-
100: "#FEE2E2",
|
|
160
|
-
200: "#FECACA",
|
|
161
|
-
300: "#FCA5A5",
|
|
162
|
-
400: "#F87171",
|
|
163
|
-
500: "#EF4444",
|
|
164
|
-
600: "#DC2626",
|
|
165
|
-
700: "#B91C1C",
|
|
166
|
-
800: "#991B1B",
|
|
167
|
-
900: "#7F1D1D",
|
|
168
|
-
950: "#450A0A"
|
|
169
|
-
},
|
|
170
|
-
rose: {
|
|
171
|
-
50: "#FFF1F2",
|
|
172
|
-
100: "#FFE4E6",
|
|
173
|
-
200: "#FECDD3",
|
|
174
|
-
300: "#FDA4AF",
|
|
175
|
-
400: "#FB7185",
|
|
176
|
-
500: "#F43F5E",
|
|
177
|
-
600: "#E11D48",
|
|
178
|
-
700: "#BE123C",
|
|
179
|
-
800: "#9F1239",
|
|
180
|
-
900: "#881337",
|
|
181
|
-
950: "#4C0519"
|
|
182
|
-
},
|
|
183
|
-
fuchsia: {
|
|
184
|
-
50: "#FDF4FF",
|
|
185
|
-
100: "#FAE8FF",
|
|
186
|
-
200: "#F5D0FE",
|
|
187
|
-
300: "#F0ABFC",
|
|
188
|
-
400: "#E879F9",
|
|
189
|
-
500: "#D946EF",
|
|
190
|
-
600: "#C026D3",
|
|
191
|
-
700: "#A21CAF",
|
|
192
|
-
800: "#86198F",
|
|
193
|
-
900: "#701A75",
|
|
194
|
-
950: "#4A044E"
|
|
195
|
-
},
|
|
196
|
-
brand: {
|
|
197
|
-
50: "#FFDED5",
|
|
198
|
-
100: "#FFC1B0",
|
|
199
|
-
200: "#FFA58C",
|
|
200
|
-
300: "#FF8967",
|
|
201
|
-
400: "#FF6E42",
|
|
202
|
-
500: "#FD541E",
|
|
203
|
-
600: "#F04104",
|
|
204
|
-
700: "#C93A06",
|
|
205
|
-
800: "#A23206",
|
|
206
|
-
900: "#7C2906",
|
|
207
|
-
950: "#571E05"
|
|
208
|
-
}
|
|
209
|
-
};
|
|
210
|
-
const semanticColors = {
|
|
211
|
-
envBase: colors.amber[500],
|
|
212
|
-
envCurrent: colors.iochmara[500]
|
|
213
|
-
};
|
|
214
|
-
/**
|
|
215
|
-
* Helper to generate button color variants for a given color
|
|
216
|
-
* Creates contained, outlined, and text variant styles
|
|
217
|
-
*/
|
|
218
|
-
function createButtonColorVariants(colorName, colorScale) {
|
|
219
|
-
return [
|
|
220
|
-
{
|
|
221
|
-
props: {
|
|
222
|
-
color: colorName,
|
|
223
|
-
variant: "contained"
|
|
224
|
-
},
|
|
225
|
-
style: {
|
|
226
|
-
backgroundColor: colorScale[500],
|
|
227
|
-
color: white,
|
|
228
|
-
"&:hover": { backgroundColor: colorScale[600] }
|
|
229
|
-
}
|
|
230
|
-
},
|
|
231
|
-
{
|
|
232
|
-
props: {
|
|
233
|
-
color: colorName,
|
|
234
|
-
variant: "outlined"
|
|
235
|
-
},
|
|
236
|
-
style: {
|
|
237
|
-
borderColor: colorScale[500],
|
|
238
|
-
color: colorScale[600],
|
|
239
|
-
"&:hover": {
|
|
240
|
-
borderColor: colorScale[600],
|
|
241
|
-
backgroundColor: `${colorScale[50]}80`
|
|
242
|
-
}
|
|
243
|
-
}
|
|
244
|
-
},
|
|
245
|
-
{
|
|
246
|
-
props: {
|
|
247
|
-
color: colorName,
|
|
248
|
-
variant: "text"
|
|
249
|
-
},
|
|
250
|
-
style: {
|
|
251
|
-
color: colorScale[600],
|
|
252
|
-
"&:hover": { backgroundColor: `${colorScale[50]}80` }
|
|
253
|
-
}
|
|
254
|
-
}
|
|
255
|
-
];
|
|
256
|
-
}
|
|
257
|
-
/**
|
|
258
|
-
* Helper to generate CircularProgress color variants
|
|
259
|
-
*/
|
|
260
|
-
function createProgressColorVariant(colorName, colorScale) {
|
|
261
|
-
return {
|
|
262
|
-
props: { color: colorName },
|
|
263
|
-
style: { color: colorScale[500] }
|
|
264
|
-
};
|
|
265
|
-
}
|
|
266
|
-
/**
|
|
267
|
-
* Helper to generate Badge color variants
|
|
268
|
-
*/
|
|
269
|
-
function createBadgeColorVariant(colorName, colorScale) {
|
|
270
|
-
return {
|
|
271
|
-
props: { color: colorName },
|
|
272
|
-
style: { "& .MuiBadge-badge": {
|
|
273
|
-
backgroundColor: colorScale[500],
|
|
274
|
-
color: white
|
|
275
|
-
} }
|
|
276
|
-
};
|
|
277
|
-
}
|
|
278
|
-
/**
|
|
279
|
-
* Helper to generate Chip color variants
|
|
280
|
-
*/
|
|
281
|
-
function createChipColorVariants(colorName, colorScale) {
|
|
282
|
-
return [{
|
|
283
|
-
props: {
|
|
284
|
-
color: colorName,
|
|
285
|
-
variant: "filled"
|
|
286
|
-
},
|
|
287
|
-
style: {
|
|
288
|
-
backgroundColor: colorScale[500],
|
|
289
|
-
color: white,
|
|
290
|
-
"&:hover": { backgroundColor: colorScale[600] }
|
|
291
|
-
}
|
|
292
|
-
}, {
|
|
293
|
-
props: {
|
|
294
|
-
color: colorName,
|
|
295
|
-
variant: "outlined"
|
|
296
|
-
},
|
|
297
|
-
style: {
|
|
298
|
-
borderColor: colorScale[500],
|
|
299
|
-
color: colorScale[600]
|
|
300
|
-
}
|
|
301
|
-
}];
|
|
302
|
-
}
|
|
303
|
-
const buttonColorVariants = [
|
|
304
|
-
...createButtonColorVariants("iochmara", colors.iochmara),
|
|
305
|
-
...createButtonColorVariants("cyan", colors.cyan),
|
|
306
|
-
...createButtonColorVariants("amber", colors.amber),
|
|
307
|
-
...createButtonColorVariants("green", colors.green),
|
|
308
|
-
...createButtonColorVariants("red", colors.red),
|
|
309
|
-
...createButtonColorVariants("rose", colors.rose),
|
|
310
|
-
...createButtonColorVariants("fuchsia", colors.fuchsia),
|
|
311
|
-
...createButtonColorVariants("brand", colors.brand)
|
|
312
|
-
];
|
|
313
|
-
const progressColorVariants = [
|
|
314
|
-
createProgressColorVariant("iochmara", colors.iochmara),
|
|
315
|
-
createProgressColorVariant("cyan", colors.cyan),
|
|
316
|
-
createProgressColorVariant("amber", colors.amber),
|
|
317
|
-
createProgressColorVariant("green", colors.green),
|
|
318
|
-
createProgressColorVariant("red", colors.red),
|
|
319
|
-
createProgressColorVariant("rose", colors.rose),
|
|
320
|
-
createProgressColorVariant("fuchsia", colors.fuchsia),
|
|
321
|
-
createProgressColorVariant("brand", colors.brand),
|
|
322
|
-
createProgressColorVariant("neutral", colors.neutral)
|
|
323
|
-
];
|
|
324
|
-
const badgeColorVariants = [
|
|
325
|
-
createBadgeColorVariant("iochmara", colors.iochmara),
|
|
326
|
-
createBadgeColorVariant("cyan", colors.cyan),
|
|
327
|
-
createBadgeColorVariant("amber", colors.amber),
|
|
328
|
-
createBadgeColorVariant("green", colors.green),
|
|
329
|
-
createBadgeColorVariant("red", colors.red),
|
|
330
|
-
createBadgeColorVariant("rose", colors.rose),
|
|
331
|
-
createBadgeColorVariant("fuchsia", colors.fuchsia),
|
|
332
|
-
createBadgeColorVariant("brand", colors.brand),
|
|
333
|
-
createBadgeColorVariant("neutral", colors.neutral)
|
|
334
|
-
];
|
|
335
|
-
const chipColorVariants = [
|
|
336
|
-
...createChipColorVariants("iochmara", colors.iochmara),
|
|
337
|
-
...createChipColorVariants("cyan", colors.cyan),
|
|
338
|
-
...createChipColorVariants("amber", colors.amber),
|
|
339
|
-
...createChipColorVariants("green", colors.green),
|
|
340
|
-
...createChipColorVariants("red", colors.red),
|
|
341
|
-
...createChipColorVariants("rose", colors.rose),
|
|
342
|
-
...createChipColorVariants("fuchsia", colors.fuchsia),
|
|
343
|
-
...createChipColorVariants("brand", colors.brand),
|
|
344
|
-
...createChipColorVariants("neutral", colors.neutral)
|
|
345
|
-
];
|
|
346
|
-
const componentOverrides = {
|
|
347
|
-
MuiButton: {
|
|
348
|
-
defaultProps: { disableElevation: true },
|
|
349
|
-
variants: [{
|
|
350
|
-
props: { size: "xsmall" },
|
|
351
|
-
style: {
|
|
352
|
-
padding: "0 0.5rem",
|
|
353
|
-
fontSize: "0.75rem",
|
|
354
|
-
fontWeight: 500,
|
|
355
|
-
borderRadius: 4,
|
|
356
|
-
minHeight: "unset",
|
|
357
|
-
lineHeight: 1.5
|
|
358
|
-
}
|
|
359
|
-
}, ...buttonColorVariants],
|
|
360
|
-
styleOverrides: {
|
|
361
|
-
root: ({ theme, ownerState }) => ({
|
|
362
|
-
textTransform: "none",
|
|
363
|
-
fontWeight: 500,
|
|
364
|
-
borderRadius: 6,
|
|
365
|
-
...ownerState.color === "neutral" && ownerState.variant === "contained" && {
|
|
366
|
-
backgroundColor: colors.neutral[700],
|
|
367
|
-
color: white,
|
|
368
|
-
"&:hover": { backgroundColor: colors.neutral[800] }
|
|
369
|
-
},
|
|
370
|
-
...ownerState.color === "neutral" && ownerState.variant === "outlined" && {
|
|
371
|
-
borderColor: theme.palette.mode === "dark" ? colors.neutral[500] : colors.neutral[300],
|
|
372
|
-
color: theme.palette.mode === "dark" ? colors.neutral[100] : colors.neutral[900],
|
|
373
|
-
"&:hover": {
|
|
374
|
-
borderColor: theme.palette.mode === "dark" ? colors.neutral[400] : colors.neutral[400],
|
|
375
|
-
backgroundColor: theme.palette.mode === "dark" ? colors.neutral[700] : colors.neutral[100]
|
|
376
|
-
}
|
|
377
|
-
},
|
|
378
|
-
...ownerState.color === "neutral" && ownerState.variant === "text" && {
|
|
379
|
-
color: theme.palette.mode === "dark" ? colors.neutral[200] : colors.neutral[700],
|
|
380
|
-
"&:hover": { backgroundColor: theme.palette.mode === "dark" ? colors.neutral[700] : colors.neutral[100] }
|
|
381
|
-
}
|
|
382
|
-
}),
|
|
383
|
-
sizeSmall: {
|
|
384
|
-
padding: "0.25rem 0.75rem",
|
|
385
|
-
fontSize: "0.875rem"
|
|
386
|
-
},
|
|
387
|
-
sizeMedium: {
|
|
388
|
-
padding: "0.5rem 1rem",
|
|
389
|
-
fontSize: "1rem"
|
|
390
|
-
},
|
|
391
|
-
sizeLarge: {
|
|
392
|
-
padding: "0.75rem 1.5rem",
|
|
393
|
-
fontSize: "1.125rem"
|
|
394
|
-
},
|
|
395
|
-
contained: { "&:hover": { boxShadow: "none" } },
|
|
396
|
-
outlined: {
|
|
397
|
-
borderWidth: "1px",
|
|
398
|
-
"&:hover": { borderWidth: "1px" }
|
|
399
|
-
},
|
|
400
|
-
text: ({ theme }) => ({ "&:hover": { backgroundColor: theme.palette.mode === "dark" ? "rgba(255, 255, 255, 0.08)" : "rgba(0, 0, 0, 0.04)" } })
|
|
401
|
-
}
|
|
402
|
-
},
|
|
403
|
-
MuiIconButton: { styleOverrides: {
|
|
404
|
-
root: { borderRadius: 6 },
|
|
405
|
-
sizeSmall: { padding: 4 },
|
|
406
|
-
sizeMedium: { padding: 8 },
|
|
407
|
-
sizeLarge: { padding: 12 }
|
|
408
|
-
} },
|
|
409
|
-
MuiTextField: {
|
|
410
|
-
defaultProps: {
|
|
411
|
-
variant: "outlined",
|
|
412
|
-
size: "small"
|
|
413
|
-
},
|
|
414
|
-
styleOverrides: { root: { "& .MuiOutlinedInput-root": { borderRadius: 6 } } }
|
|
415
|
-
},
|
|
416
|
-
MuiOutlinedInput: { styleOverrides: {
|
|
417
|
-
root: {
|
|
418
|
-
borderRadius: 6,
|
|
419
|
-
"&:hover .MuiOutlinedInput-notchedOutline": { borderColor: colors.iochmara[400] },
|
|
420
|
-
"&.Mui-focused .MuiOutlinedInput-notchedOutline": {
|
|
421
|
-
borderColor: colors.iochmara[500],
|
|
422
|
-
borderWidth: 2
|
|
423
|
-
}
|
|
424
|
-
},
|
|
425
|
-
notchedOutline: ({ theme }) => ({ borderColor: theme.palette.mode === "dark" ? colors.neutral[600] : colors.neutral[300] })
|
|
426
|
-
} },
|
|
427
|
-
MuiCheckbox: {
|
|
428
|
-
defaultProps: { color: "primary" },
|
|
429
|
-
styleOverrides: { root: { borderRadius: 4 } }
|
|
430
|
-
},
|
|
431
|
-
MuiSwitch: { defaultProps: { color: "primary" } },
|
|
432
|
-
MuiDialog: { styleOverrides: { paper: { borderRadius: 8 } } },
|
|
433
|
-
MuiDialogTitle: { styleOverrides: { root: {
|
|
434
|
-
fontWeight: 600,
|
|
435
|
-
fontSize: "1.125rem"
|
|
436
|
-
} } },
|
|
437
|
-
MuiMenu: { styleOverrides: { paper: ({ theme }) => ({
|
|
438
|
-
borderRadius: 8,
|
|
439
|
-
boxShadow: theme.shadows[3]
|
|
440
|
-
}) } },
|
|
441
|
-
MuiMenuItem: { styleOverrides: { root: ({ theme }) => ({
|
|
442
|
-
fontSize: "0.875rem",
|
|
443
|
-
padding: "0.5rem 0.75rem",
|
|
444
|
-
"&:hover": { backgroundColor: theme.palette.mode === "dark" ? colors.neutral[600] : colors.neutral[100] },
|
|
445
|
-
"&.Mui-selected": {
|
|
446
|
-
backgroundColor: theme.palette.mode === "dark" ? colors.iochmara[900] : colors.iochmara[50],
|
|
447
|
-
"&:hover": { backgroundColor: theme.palette.mode === "dark" ? colors.iochmara[800] : colors.iochmara[100] }
|
|
448
|
-
}
|
|
449
|
-
}) } },
|
|
450
|
-
MuiChip: {
|
|
451
|
-
variants: [{
|
|
452
|
-
props: { size: "xsmall" },
|
|
453
|
-
style: {
|
|
454
|
-
height: 20,
|
|
455
|
-
fontSize: "0.625rem"
|
|
456
|
-
}
|
|
457
|
-
}, ...chipColorVariants],
|
|
458
|
-
styleOverrides: {
|
|
459
|
-
root: {
|
|
460
|
-
borderRadius: 6,
|
|
461
|
-
fontWeight: 500
|
|
462
|
-
},
|
|
463
|
-
sizeSmall: {
|
|
464
|
-
height: 24,
|
|
465
|
-
fontSize: "0.75rem"
|
|
466
|
-
},
|
|
467
|
-
sizeMedium: {
|
|
468
|
-
height: 32,
|
|
469
|
-
fontSize: "0.875rem"
|
|
470
|
-
}
|
|
471
|
-
}
|
|
472
|
-
},
|
|
473
|
-
MuiTooltip: { styleOverrides: {
|
|
474
|
-
tooltip: ({ theme }) => ({
|
|
475
|
-
backgroundColor: theme.palette.mode === "dark" ? colors.neutral[700] : colors.neutral[800],
|
|
476
|
-
fontSize: "0.75rem",
|
|
477
|
-
padding: "0.25rem 0.5rem",
|
|
478
|
-
borderRadius: 4
|
|
479
|
-
}),
|
|
480
|
-
arrow: ({ theme }) => ({ color: theme.palette.mode === "dark" ? colors.neutral[700] : colors.neutral[800] })
|
|
481
|
-
} },
|
|
482
|
-
MuiAlert: { styleOverrides: {
|
|
483
|
-
root: { borderRadius: 6 },
|
|
484
|
-
standardSuccess: ({ theme }) => ({
|
|
485
|
-
backgroundColor: theme.palette.mode === "dark" ? colors.green[900] : colors.green[50],
|
|
486
|
-
color: theme.palette.mode === "dark" ? colors.green[200] : colors.green[800]
|
|
487
|
-
}),
|
|
488
|
-
standardWarning: ({ theme }) => ({
|
|
489
|
-
backgroundColor: theme.palette.mode === "dark" ? colors.amber[900] : colors.amber[50],
|
|
490
|
-
color: theme.palette.mode === "dark" ? colors.amber[200] : colors.amber[800]
|
|
491
|
-
}),
|
|
492
|
-
standardError: ({ theme }) => ({
|
|
493
|
-
backgroundColor: theme.palette.mode === "dark" ? colors.red[900] : colors.red[50],
|
|
494
|
-
color: theme.palette.mode === "dark" ? colors.red[200] : colors.red[800]
|
|
495
|
-
}),
|
|
496
|
-
standardInfo: ({ theme }) => ({
|
|
497
|
-
backgroundColor: theme.palette.mode === "dark" ? colors.iochmara[900] : colors.iochmara[50],
|
|
498
|
-
color: theme.palette.mode === "dark" ? colors.iochmara[200] : colors.iochmara[800]
|
|
499
|
-
})
|
|
500
|
-
} },
|
|
501
|
-
MuiTabs: { styleOverrides: { indicator: { height: 2 } } },
|
|
502
|
-
MuiTab: { styleOverrides: { root: {
|
|
503
|
-
textTransform: "none",
|
|
504
|
-
fontWeight: 500,
|
|
505
|
-
minHeight: 48
|
|
506
|
-
} } },
|
|
507
|
-
MuiAvatar: { styleOverrides: { root: { fontWeight: 500 } } },
|
|
508
|
-
MuiBadge: {
|
|
509
|
-
variants: badgeColorVariants,
|
|
510
|
-
styleOverrides: { badge: {
|
|
511
|
-
fontWeight: 500,
|
|
512
|
-
fontSize: "0.75rem"
|
|
513
|
-
} }
|
|
514
|
-
},
|
|
515
|
-
MuiCircularProgress: {
|
|
516
|
-
defaultProps: { color: "primary" },
|
|
517
|
-
variants: progressColorVariants
|
|
518
|
-
},
|
|
519
|
-
MuiLink: {
|
|
520
|
-
defaultProps: {
|
|
521
|
-
underline: "hover",
|
|
522
|
-
fontWeight: 500
|
|
523
|
-
},
|
|
524
|
-
styleOverrides: { root: {
|
|
525
|
-
color: colors.iochmara[600],
|
|
526
|
-
textDecorationColor: colors.iochmara[300],
|
|
527
|
-
"&:hover": { color: colors.iochmara[700] }
|
|
528
|
-
} }
|
|
529
|
-
},
|
|
530
|
-
MuiPaper: { styleOverrides: { rounded: { borderRadius: 8 } } },
|
|
531
|
-
MuiPopover: { styleOverrides: { paper: ({ theme }) => ({
|
|
532
|
-
borderRadius: 8,
|
|
533
|
-
boxShadow: theme.shadows[3]
|
|
534
|
-
}) } },
|
|
535
|
-
MuiDivider: { styleOverrides: { root: ({ theme }) => ({ borderColor: theme.palette.mode === "dark" ? colors.neutral[700] : colors.neutral[200] }) } },
|
|
536
|
-
MuiBreadcrumbs: { styleOverrides: { separator: ({ theme }) => ({ color: theme.palette.mode === "dark" ? colors.neutral[500] : colors.neutral[400] }) } }
|
|
537
|
-
};
|
|
538
|
-
const baseThemeOptions = {
|
|
539
|
-
palette: {
|
|
540
|
-
primary: {
|
|
541
|
-
main: colors.iochmara[500],
|
|
542
|
-
light: colors.iochmara[300],
|
|
543
|
-
dark: colors.iochmara[600],
|
|
544
|
-
contrastText: white
|
|
545
|
-
},
|
|
546
|
-
secondary: {
|
|
547
|
-
main: colors.cyan[500],
|
|
548
|
-
light: colors.cyan[400],
|
|
549
|
-
dark: colors.cyan[600],
|
|
550
|
-
contrastText: white
|
|
551
|
-
},
|
|
552
|
-
success: {
|
|
553
|
-
main: colors.green[500],
|
|
554
|
-
light: colors.green[400],
|
|
555
|
-
dark: colors.green[600],
|
|
556
|
-
contrastText: white
|
|
557
|
-
},
|
|
558
|
-
warning: {
|
|
559
|
-
main: colors.amber[500],
|
|
560
|
-
light: colors.amber[400],
|
|
561
|
-
dark: colors.amber[600],
|
|
562
|
-
contrastText: white
|
|
563
|
-
},
|
|
564
|
-
error: {
|
|
565
|
-
main: colors.red[500],
|
|
566
|
-
light: colors.red[400],
|
|
567
|
-
dark: colors.red[600],
|
|
568
|
-
contrastText: white
|
|
569
|
-
},
|
|
570
|
-
grey: {
|
|
571
|
-
50: colors.neutral[50],
|
|
572
|
-
100: colors.neutral[100],
|
|
573
|
-
200: colors.neutral[200],
|
|
574
|
-
300: colors.neutral[300],
|
|
575
|
-
400: colors.neutral[400],
|
|
576
|
-
500: colors.neutral[500],
|
|
577
|
-
600: colors.neutral[600],
|
|
578
|
-
700: colors.neutral[700],
|
|
579
|
-
800: colors.neutral[800],
|
|
580
|
-
900: colors.neutral[900]
|
|
581
|
-
}
|
|
582
|
-
},
|
|
583
|
-
typography: {
|
|
584
|
-
fontFamily: "ui-sans-serif, system-ui, sans-serif, \"Apple Color Emoji\", \"Segoe UI Emoji\", \"Segoe UI Symbol\", \"Noto Color Emoji\"",
|
|
585
|
-
fontWeightLight: 300,
|
|
586
|
-
fontWeightRegular: 400,
|
|
587
|
-
fontWeightMedium: 500,
|
|
588
|
-
fontWeightBold: 700,
|
|
589
|
-
h1: {
|
|
590
|
-
fontWeight: 700,
|
|
591
|
-
fontSize: "2.25rem",
|
|
592
|
-
lineHeight: 1.2
|
|
593
|
-
},
|
|
594
|
-
h2: {
|
|
595
|
-
fontWeight: 700,
|
|
596
|
-
fontSize: "1.875rem",
|
|
597
|
-
lineHeight: 1.2
|
|
598
|
-
},
|
|
599
|
-
h3: {
|
|
600
|
-
fontWeight: 600,
|
|
601
|
-
fontSize: "1.5rem",
|
|
602
|
-
lineHeight: 1.3
|
|
603
|
-
},
|
|
604
|
-
h4: {
|
|
605
|
-
fontWeight: 600,
|
|
606
|
-
fontSize: "1.25rem",
|
|
607
|
-
lineHeight: 1.4
|
|
608
|
-
},
|
|
609
|
-
h5: {
|
|
610
|
-
fontWeight: 600,
|
|
611
|
-
fontSize: "1.125rem",
|
|
612
|
-
lineHeight: 1.4
|
|
613
|
-
},
|
|
614
|
-
h6: {
|
|
615
|
-
fontWeight: 600,
|
|
616
|
-
fontSize: "1rem",
|
|
617
|
-
lineHeight: 1.5
|
|
618
|
-
},
|
|
619
|
-
body1: {
|
|
620
|
-
fontSize: "0.875rem",
|
|
621
|
-
lineHeight: 1.5
|
|
622
|
-
},
|
|
623
|
-
body2: {
|
|
624
|
-
fontSize: "0.75rem",
|
|
625
|
-
lineHeight: 1.5
|
|
626
|
-
},
|
|
627
|
-
button: {
|
|
628
|
-
textTransform: "none",
|
|
629
|
-
fontWeight: 500
|
|
630
|
-
}
|
|
631
|
-
},
|
|
632
|
-
shape: { borderRadius: 6 },
|
|
633
|
-
spacing: 4,
|
|
634
|
-
components: componentOverrides
|
|
635
|
-
};
|
|
636
|
-
const lightThemeOptions = {
|
|
637
|
-
...baseThemeOptions,
|
|
638
|
-
palette: {
|
|
639
|
-
...baseThemeOptions.palette,
|
|
640
|
-
mode: "light",
|
|
641
|
-
background: {
|
|
642
|
-
default: white,
|
|
643
|
-
paper: white
|
|
644
|
-
},
|
|
645
|
-
text: {
|
|
646
|
-
primary: colors.neutral[900],
|
|
647
|
-
secondary: colors.neutral[600]
|
|
648
|
-
}
|
|
649
|
-
}
|
|
650
|
-
};
|
|
651
|
-
const darkThemeOptions = {
|
|
652
|
-
...baseThemeOptions,
|
|
653
|
-
palette: {
|
|
654
|
-
...baseThemeOptions.palette,
|
|
655
|
-
mode: "dark",
|
|
656
|
-
background: {
|
|
657
|
-
default: colors.neutral[900],
|
|
658
|
-
paper: colors.neutral[800]
|
|
659
|
-
},
|
|
660
|
-
text: {
|
|
661
|
-
primary: colors.neutral[50],
|
|
662
|
-
secondary: colors.neutral[400]
|
|
663
|
-
}
|
|
664
|
-
}
|
|
665
|
-
};
|
|
666
|
-
const lightTheme = createTheme(lightThemeOptions);
|
|
667
|
-
const darkTheme = createTheme(darkThemeOptions);
|
|
668
|
-
function createPaletteColor(colorScale) {
|
|
669
|
-
return {
|
|
670
|
-
main: colorScale[500],
|
|
671
|
-
light: colorScale[300],
|
|
672
|
-
dark: colorScale[600],
|
|
673
|
-
contrastText: white
|
|
674
|
-
};
|
|
675
|
-
}
|
|
676
|
-
const customPaletteAdditions = {
|
|
677
|
-
brand: createPaletteColor(colors.brand),
|
|
678
|
-
iochmara: {
|
|
679
|
-
main: colors.iochmara[500],
|
|
680
|
-
light: colors.iochmara[50],
|
|
681
|
-
dark: colors.iochmara[700],
|
|
682
|
-
contrastText: white
|
|
683
|
-
},
|
|
684
|
-
cyan: createPaletteColor(colors.cyan),
|
|
685
|
-
amber: createPaletteColor(colors.amber),
|
|
686
|
-
green: createPaletteColor(colors.green),
|
|
687
|
-
red: createPaletteColor(colors.red),
|
|
688
|
-
rose: createPaletteColor(colors.rose),
|
|
689
|
-
fuchsia: createPaletteColor(colors.fuchsia),
|
|
690
|
-
neutral: {
|
|
691
|
-
main: colors.neutral[500],
|
|
692
|
-
light: colors.neutral[300],
|
|
693
|
-
dark: colors.neutral[600],
|
|
694
|
-
contrastText: white
|
|
695
|
-
},
|
|
696
|
-
envBase: semanticColors.envBase,
|
|
697
|
-
envCurrent: semanticColors.envCurrent
|
|
698
|
-
};
|
|
699
|
-
Object.assign(lightTheme.palette, customPaletteAdditions);
|
|
700
|
-
Object.assign(darkTheme.palette, customPaletteAdditions);
|
|
701
|
-
/**
|
|
702
|
-
* Semantic variant mappings from Chakra-style tokens to scale values
|
|
703
|
-
* These map semantic names to numeric scale values in the color palette
|
|
704
|
-
*/
|
|
705
|
-
const semanticVariantMap = {
|
|
706
|
-
solid: 600,
|
|
707
|
-
subtle: 50,
|
|
708
|
-
muted: 200,
|
|
709
|
-
emphasized: 500,
|
|
710
|
-
focusRing: 400,
|
|
711
|
-
light: 300
|
|
712
|
-
};
|
|
713
|
-
/**
|
|
714
|
-
* Color aliases - map Chakra color names to our color palette
|
|
715
|
-
*/
|
|
716
|
-
const colorAliases = {
|
|
717
|
-
orange: "amber",
|
|
718
|
-
gray: "neutral"
|
|
719
|
-
};
|
|
720
|
-
/**
|
|
721
|
-
* Token lookup function to mimic Chakra UI's token API
|
|
722
|
-
* Usage: token("colors.green.solid") => "#16A34A"
|
|
723
|
-
*/
|
|
724
|
-
function token(path$1) {
|
|
725
|
-
const parts = path$1.split(".");
|
|
726
|
-
if (parts[0] === "colors" && parts.length >= 3) {
|
|
727
|
-
let colorName = parts[1];
|
|
728
|
-
const variant = parts[2];
|
|
729
|
-
if (colorName in colorAliases) colorName = colorAliases[colorName];
|
|
730
|
-
if (colorName === "white") return white;
|
|
731
|
-
if (colorName === "black") return black;
|
|
732
|
-
if (colorName in semanticColors) {
|
|
733
|
-
const semantic = semanticColors[colorName];
|
|
734
|
-
if (typeof semantic === "object" && variant in semantic) return semantic[variant];
|
|
735
|
-
}
|
|
736
|
-
if (colorName in colors) {
|
|
737
|
-
const color = colors[colorName];
|
|
738
|
-
if (typeof color === "object" && variant in color) return color[variant];
|
|
739
|
-
if (variant in semanticVariantMap) {
|
|
740
|
-
const scaleValue = semanticVariantMap[variant];
|
|
741
|
-
if (typeof color === "object" && scaleValue in color) return color[scaleValue];
|
|
742
|
-
}
|
|
743
|
-
}
|
|
744
|
-
}
|
|
745
|
-
}
|
|
746
|
-
|
|
747
|
-
//#endregion
|
|
748
59
|
//#region recce-source/js/src/components/ui/toaster.tsx
|
|
749
60
|
const ToasterContext = createContext(null);
|
|
750
61
|
let toastIdCounter = 0;
|
|
@@ -1844,7 +1155,7 @@ async function getRecceInstanceInfo(client = axiosClient) {
|
|
|
1844
1155
|
|
|
1845
1156
|
//#endregion
|
|
1846
1157
|
//#region recce-source/js/src/lib/hooks/ApiConfigContext.tsx
|
|
1847
|
-
const defaultConfig = {
|
|
1158
|
+
const defaultConfig$1 = {
|
|
1848
1159
|
apiPrefix: "",
|
|
1849
1160
|
authToken: void 0,
|
|
1850
1161
|
baseUrl: void 0
|
|
@@ -1877,7 +1188,7 @@ function createApiClient(config) {
|
|
|
1877
1188
|
});
|
|
1878
1189
|
return client;
|
|
1879
1190
|
}
|
|
1880
|
-
function ApiConfigProvider({ children, apiPrefix = defaultConfig.apiPrefix, authToken = defaultConfig.authToken, baseUrl = defaultConfig.baseUrl }) {
|
|
1191
|
+
function ApiConfigProvider({ children, apiPrefix = defaultConfig$1.apiPrefix, authToken = defaultConfig$1.authToken, baseUrl = defaultConfig$1.baseUrl }) {
|
|
1881
1192
|
const config = useMemo(() => ({
|
|
1882
1193
|
apiPrefix,
|
|
1883
1194
|
authToken,
|
|
@@ -5475,21 +4786,76 @@ const RunModal = ({ isOpen, onClose, onExecute, type, title, params: defaultPara
|
|
|
5475
4786
|
};
|
|
5476
4787
|
|
|
5477
4788
|
//#endregion
|
|
5478
|
-
//#region
|
|
4789
|
+
//#region src/lib/hooks/RouteConfigContext.ts
|
|
4790
|
+
const defaultConfig = { basePath: "" };
|
|
4791
|
+
const RouteConfigContext = createContext(null);
|
|
4792
|
+
/**
|
|
4793
|
+
* Provider for route configuration.
|
|
4794
|
+
*
|
|
4795
|
+
* Wrap your application (or RecceContextProvider) with this provider
|
|
4796
|
+
* to configure path prefixes for navigation.
|
|
4797
|
+
*
|
|
4798
|
+
* @example
|
|
4799
|
+
* // In recce-cloud
|
|
4800
|
+
* <RouteConfigProvider basePath={`/oss/${sessionId}`}>
|
|
4801
|
+
* <RecceContextProvider>
|
|
4802
|
+
* {children}
|
|
4803
|
+
* </RecceContextProvider>
|
|
4804
|
+
* </RouteConfigProvider>
|
|
4805
|
+
*/
|
|
4806
|
+
function RouteConfigProvider({ children, basePath = defaultConfig.basePath }) {
|
|
4807
|
+
const resolvePath = useCallback((path$1) => {
|
|
4808
|
+
if (!basePath) return path$1;
|
|
4809
|
+
if (path$1.startsWith(basePath)) return path$1;
|
|
4810
|
+
if (path$1.match(/^https?:\/\//)) return path$1;
|
|
4811
|
+
if (path$1.startsWith("#")) return path$1;
|
|
4812
|
+
return `${basePath.endsWith("/") ? basePath.slice(0, -1) : basePath}${path$1.startsWith("/") ? path$1 : `/${path$1}`}`;
|
|
4813
|
+
}, [basePath]);
|
|
4814
|
+
const contextValue = useMemo(() => ({
|
|
4815
|
+
basePath,
|
|
4816
|
+
resolvePath
|
|
4817
|
+
}), [basePath, resolvePath]);
|
|
4818
|
+
return React.createElement(RouteConfigContext.Provider, { value: contextValue }, children);
|
|
4819
|
+
}
|
|
4820
|
+
const defaultRouteConfigContext = {
|
|
4821
|
+
basePath: "",
|
|
4822
|
+
resolvePath: (path$1) => path$1
|
|
4823
|
+
};
|
|
4824
|
+
/**
|
|
4825
|
+
* Hook to access route configuration.
|
|
4826
|
+
*
|
|
4827
|
+
* When used outside RouteConfigProvider, returns default config
|
|
4828
|
+
* (for OSS backward compatibility).
|
|
4829
|
+
*
|
|
4830
|
+
* @returns RouteConfigContextType with basePath and resolvePath function
|
|
4831
|
+
*/
|
|
4832
|
+
function useRouteConfig() {
|
|
4833
|
+
return useContext(RouteConfigContext) ?? defaultRouteConfigContext;
|
|
4834
|
+
}
|
|
4835
|
+
/**
|
|
4836
|
+
* Safe hook that returns null if context not available.
|
|
4837
|
+
* Useful for components that need to detect if RouteConfigProvider is present.
|
|
4838
|
+
*/
|
|
4839
|
+
function useRouteConfigSafe() {
|
|
4840
|
+
return useContext(RouteConfigContext);
|
|
4841
|
+
}
|
|
4842
|
+
|
|
4843
|
+
//#endregion
|
|
4844
|
+
//#region src/lib/hooks/useAppRouter.ts
|
|
5479
4845
|
/**
|
|
5480
|
-
* useAppRouter - Navigation utilities for Next.js App Router
|
|
4846
|
+
* useAppRouter - Navigation utilities for Next.js App Router with RouteConfig support
|
|
5481
4847
|
*
|
|
5482
|
-
*
|
|
5483
|
-
*
|
|
5484
|
-
* and useSearchParams into a unified interface.
|
|
4848
|
+
* This is a custom version that wraps the OSS useAppRouter to add
|
|
4849
|
+
* RouteConfigContext support for path prefixing in recce-cloud.
|
|
5485
4850
|
*
|
|
5486
|
-
*
|
|
5487
|
-
*
|
|
5488
|
-
*
|
|
5489
|
-
*
|
|
4851
|
+
* The key difference from OSS:
|
|
4852
|
+
* - setLocation() automatically prefixes paths with the configured basePath
|
|
4853
|
+
* - This allows OSS components to use setLocation("/query") while
|
|
4854
|
+
* recce-cloud can configure basePath="/oss/abc123" to get "/oss/abc123/query"
|
|
5490
4855
|
*/
|
|
5491
4856
|
/**
|
|
5492
4857
|
* Hook that provides Wouter-compatible location API using Next.js App Router
|
|
4858
|
+
* with RouteConfigContext support for path prefixing.
|
|
5493
4859
|
*
|
|
5494
4860
|
* NOTE: This returns only the pathname (not search params) to avoid
|
|
5495
4861
|
* triggering Suspense boundaries on every navigation.
|
|
@@ -5498,15 +4864,123 @@ const RunModal = ({ isOpen, onClose, onExecute, type, title, params: defaultPara
|
|
|
5498
4864
|
*
|
|
5499
4865
|
* @example
|
|
5500
4866
|
* const [location, setLocation] = useAppLocation();
|
|
5501
|
-
* setLocation("/checks?id=123"); //
|
|
5502
|
-
*
|
|
4867
|
+
* setLocation("/checks?id=123"); // In cloud mode with basePath="/oss/abc123"
|
|
4868
|
+
* // navigates to "/oss/abc123/checks?id=123"
|
|
5503
4869
|
*/
|
|
5504
4870
|
function useAppLocation() {
|
|
5505
4871
|
const router = useRouter();
|
|
5506
|
-
|
|
5507
|
-
|
|
5508
|
-
|
|
5509
|
-
|
|
4872
|
+
const pathname = usePathname$1();
|
|
4873
|
+
const { resolvePath } = useRouteConfig();
|
|
4874
|
+
return [pathname, useCallback((to, options) => {
|
|
4875
|
+
const [pathPart, queryPart] = to.split("?");
|
|
4876
|
+
const resolvedPath = resolvePath(pathPart);
|
|
4877
|
+
const fullPath = queryPart ? `${resolvedPath}?${queryPart}` : resolvedPath;
|
|
4878
|
+
if (options?.replace) router.replace(fullPath, { scroll: options?.scroll ?? true });
|
|
4879
|
+
else router.push(fullPath, { scroll: options?.scroll ?? true });
|
|
4880
|
+
}, [router, resolvePath])];
|
|
4881
|
+
}
|
|
4882
|
+
/**
|
|
4883
|
+
* Hook that includes search params in the location string.
|
|
4884
|
+
* Also supports RouteConfigContext path prefixing.
|
|
4885
|
+
*
|
|
4886
|
+
* WARNING: This hook uses useSearchParams() which triggers Suspense.
|
|
4887
|
+
* Only use this in components that are wrapped in a <Suspense> boundary,
|
|
4888
|
+
* or in leaf components where suspension is acceptable.
|
|
4889
|
+
*
|
|
4890
|
+
* @returns [fullLocation, setLocation] tuple with search params included
|
|
4891
|
+
*/
|
|
4892
|
+
function useAppLocationWithSearch() {
|
|
4893
|
+
const router = useRouter();
|
|
4894
|
+
const pathname = usePathname$1();
|
|
4895
|
+
const searchParams = useSearchParams();
|
|
4896
|
+
const { resolvePath } = useRouteConfig();
|
|
4897
|
+
return [useMemo(() => {
|
|
4898
|
+
const search = searchParams?.toString();
|
|
4899
|
+
return search ? `${pathname}?${search}` : pathname;
|
|
4900
|
+
}, [pathname, searchParams]), useCallback((to, options) => {
|
|
4901
|
+
const [pathPart, queryPart] = to.split("?");
|
|
4902
|
+
const resolvedPath = resolvePath(pathPart);
|
|
4903
|
+
const fullPath = queryPart ? `${resolvedPath}?${queryPart}` : resolvedPath;
|
|
4904
|
+
if (options?.replace) router.replace(fullPath, { scroll: options?.scroll ?? true });
|
|
4905
|
+
else router.push(fullPath, { scroll: options?.scroll ?? true });
|
|
4906
|
+
}, [router, resolvePath])];
|
|
4907
|
+
}
|
|
4908
|
+
/**
|
|
4909
|
+
* Hook to check if current path matches a pattern
|
|
4910
|
+
* Similar to Wouter's useRoute
|
|
4911
|
+
*
|
|
4912
|
+
* @param pattern - The route pattern to match (e.g., "/checks/:checkId")
|
|
4913
|
+
* @returns [isMatch, params] tuple
|
|
4914
|
+
*
|
|
4915
|
+
* @example
|
|
4916
|
+
* const [isMatch, params] = useAppRoute("/checks/:checkId");
|
|
4917
|
+
* if (isMatch) {
|
|
4918
|
+
* console.log(params.checkId); // "abc-123"
|
|
4919
|
+
* }
|
|
4920
|
+
*/
|
|
4921
|
+
function useAppRoute(pattern) {
|
|
4922
|
+
const pathname = usePathname$1();
|
|
4923
|
+
const params = useParams();
|
|
4924
|
+
return [useMemo(() => {
|
|
4925
|
+
const regexPattern = pattern.replace(/:\w+/g, "([^/]+)").replace(/\*/g, ".*");
|
|
4926
|
+
return (/* @__PURE__ */ new RegExp(`^${regexPattern}$`)).test(pathname);
|
|
4927
|
+
}, [pattern, pathname]), useMemo(() => {
|
|
4928
|
+
if (!params) return {};
|
|
4929
|
+
return Object.fromEntries(Object.entries(params).map(([key, value]) => [key, Array.isArray(value) ? value.join("/") : value]));
|
|
4930
|
+
}, [params])];
|
|
4931
|
+
}
|
|
4932
|
+
/**
|
|
4933
|
+
* Imperative navigation function for use outside React components
|
|
4934
|
+
* Use sparingly - prefer useAppLocation hook in components
|
|
4935
|
+
*
|
|
4936
|
+
* NOTE: This function does NOT support RouteConfigContext because
|
|
4937
|
+
* it's used outside of React component tree. If you need path prefixing,
|
|
4938
|
+
* use useAppLocation hook instead.
|
|
4939
|
+
*
|
|
4940
|
+
* @example
|
|
4941
|
+
* // In an event handler or utility function
|
|
4942
|
+
* import { navigateTo } from "@/lib/hooks/useAppRouter";
|
|
4943
|
+
* navigateTo("/checks?id=123");
|
|
4944
|
+
*/
|
|
4945
|
+
function navigateTo(path$1, replace = false) {
|
|
4946
|
+
if (typeof window !== "undefined") {
|
|
4947
|
+
if (replace) window.history.replaceState(null, "", path$1);
|
|
4948
|
+
else window.history.pushState(null, "", path$1);
|
|
4949
|
+
window.dispatchEvent(new PopStateEvent("popstate"));
|
|
4950
|
+
}
|
|
4951
|
+
}
|
|
4952
|
+
/**
|
|
4953
|
+
* Hook for programmatic navigation with more options
|
|
4954
|
+
* Provides direct access to Next.js router methods with RouteConfigContext support
|
|
4955
|
+
*
|
|
4956
|
+
* NOTE: Does not include searchParams to avoid Suspense.
|
|
4957
|
+
* Use useSearchParams() directly in components that need it.
|
|
4958
|
+
*/
|
|
4959
|
+
function useAppNavigation() {
|
|
4960
|
+
const router = useRouter();
|
|
4961
|
+
const pathname = usePathname$1();
|
|
4962
|
+
const params = useParams();
|
|
4963
|
+
const { resolvePath } = useRouteConfig();
|
|
4964
|
+
return {
|
|
4965
|
+
pathname,
|
|
4966
|
+
params,
|
|
4967
|
+
push: useCallback((href, options) => {
|
|
4968
|
+
const [pathPart, queryPart] = href.split("?");
|
|
4969
|
+
const resolvedPath = resolvePath(pathPart);
|
|
4970
|
+
const fullPath = queryPart ? `${resolvedPath}?${queryPart}` : resolvedPath;
|
|
4971
|
+
router.push(fullPath, options);
|
|
4972
|
+
}, [router, resolvePath]),
|
|
4973
|
+
replace: useCallback((href, options) => {
|
|
4974
|
+
const [pathPart, queryPart] = href.split("?");
|
|
4975
|
+
const resolvedPath = resolvePath(pathPart);
|
|
4976
|
+
const fullPath = queryPart ? `${resolvedPath}?${queryPart}` : resolvedPath;
|
|
4977
|
+
router.replace(fullPath, options);
|
|
4978
|
+
}, [router, resolvePath]),
|
|
4979
|
+
back: router.back,
|
|
4980
|
+
forward: router.forward,
|
|
4981
|
+
refresh: router.refresh,
|
|
4982
|
+
prefetch: router.prefetch
|
|
4983
|
+
};
|
|
5510
4984
|
}
|
|
5511
4985
|
|
|
5512
4986
|
//#endregion
|
|
@@ -8222,5 +7696,5 @@ async function shareState(client = axiosClient) {
|
|
|
8222
7696
|
}
|
|
8223
7697
|
|
|
8224
7698
|
//#endregion
|
|
8225
|
-
export {
|
|
8226
|
-
//# sourceMappingURL=state-
|
|
7699
|
+
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, waitRun as Jt, IconEdit as K, 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, 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, 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 };
|
|
7700
|
+
//# sourceMappingURL=state-B9yzhuKs.mjs.map
|