@burdenoff/microfe-bigconsole 2026.1121.1 → 2026.1121.3
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/bigconsole/components/ask/AskYourData.js +126 -123
- package/dist/bigconsole/components/explore/CreateQueryWidget.js +106 -103
- package/dist/bigconsole/components/explore/SqlDraftEditor.js +85 -83
- package/dist/bigconsole/components/explore/exploreErrors.d.ts +21 -0
- package/dist/bigconsole/components/explore/exploreErrors.js +79 -0
- package/dist/bigconsole/components/explore/useExploreRun.d.ts +2 -2
- package/dist/bigconsole/components/explore/useExploreRun.js +40 -55
- package/dist/bigconsole/utils/backendError.d.ts +9 -2
- package/dist/bigconsole/utils/backendError.js +29 -26
- package/dist/shared/hooks/useTr.d.ts +8 -0
- package/dist/shared/hooks/useTr.js +15 -8
- package/package.json +1 -1
|
@@ -25,38 +25,41 @@ function r(t, r) {
|
|
|
25
25
|
}
|
|
26
26
|
var i = 4;
|
|
27
27
|
function a(e) {
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
28
|
+
if (!t(e)) return [];
|
|
29
|
+
let { code: n, reason: r } = e;
|
|
30
|
+
return typeof n != "string" || n.length === 0 ? [] : [typeof r == "string" && r.length > 0 ? {
|
|
31
|
+
code: n,
|
|
32
|
+
reason: r
|
|
33
|
+
} : { code: n }];
|
|
32
34
|
}
|
|
33
35
|
function o(e) {
|
|
36
|
+
return Array.isArray(e) ? e.flatMap((e) => t(e) ? a(e.extensions) : []) : [];
|
|
37
|
+
}
|
|
38
|
+
function s(e) {
|
|
34
39
|
if (typeof e != "string" || e.length === 0) return [];
|
|
35
40
|
try {
|
|
36
41
|
let n = JSON.parse(e);
|
|
37
|
-
return
|
|
42
|
+
return (Array.isArray(n) ? n : [n]).flatMap((e) => t(e) ? o(e.errors) : []);
|
|
38
43
|
} catch {
|
|
39
44
|
return [];
|
|
40
45
|
}
|
|
41
46
|
}
|
|
42
|
-
function
|
|
43
|
-
let n = /* @__PURE__ */ new Set(), r = (e,
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
}
|
|
62
|
-
export { s as graphQLErrorCodes, c as hasGraphQLErrorCode, r as resolveBackendErrorMessage };
|
|
47
|
+
function c(e) {
|
|
48
|
+
let n = /* @__PURE__ */ new Set(), r = (e, c) => !t(e) || c > i || n.has(e) ? [] : (n.add(e), [
|
|
49
|
+
...o(e.errors),
|
|
50
|
+
...o(e.graphQLErrors),
|
|
51
|
+
...t(e.result) ? o(e.result.errors) : [],
|
|
52
|
+
...s(e.bodyText),
|
|
53
|
+
...a(e.extensions),
|
|
54
|
+
...r(e.cause, c + 1),
|
|
55
|
+
...r(e.error, c + 1)
|
|
56
|
+
]);
|
|
57
|
+
return r(e, 0);
|
|
58
|
+
}
|
|
59
|
+
function l(e) {
|
|
60
|
+
return [...new Set(c(e).map(({ code: e }) => e))];
|
|
61
|
+
}
|
|
62
|
+
function u(e, t) {
|
|
63
|
+
return l(e).some((e) => t.has(e));
|
|
64
|
+
}
|
|
65
|
+
export { l as graphQLErrorCodes, c as graphQLErrorDetails, u as hasGraphQLErrorCode, r as resolveBackendErrorMessage };
|
|
@@ -22,3 +22,11 @@ export declare function interpolateParams(text: string, params?: Record<string,
|
|
|
22
22
|
* return <p>{tr('bigconsole.delete.confirm', 'Delete {{count}} items?', { count: 5 })}</p>;
|
|
23
23
|
*/
|
|
24
24
|
export declare function useTr(): (key: string, fallback: string, params?: Record<string, string | number>) => string;
|
|
25
|
+
/**
|
|
26
|
+
* useOptionalTr — like {@link useTr}, but safe outside an I18nProvider.
|
|
27
|
+
*
|
|
28
|
+
* For hooks and widgets that can also mount where no provider exists (for example a
|
|
29
|
+
* dashboard widget rendered by a host without the shell providers). Without a provider
|
|
30
|
+
* every call returns the English fallback.
|
|
31
|
+
*/
|
|
32
|
+
export declare function useOptionalTr(): (key: string, fallback: string, params?: Record<string, string | number>) => string;
|
|
@@ -1,14 +1,21 @@
|
|
|
1
1
|
import { useCallback as e } from "react";
|
|
2
|
-
import { useI18n as t } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
|
|
2
|
+
import { useI18n as t, useOptionalI18n as n } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
|
|
3
3
|
// src/shared/hooks/useTr.ts
|
|
4
|
-
function
|
|
4
|
+
function r(e, t) {
|
|
5
5
|
return t ? Object.entries(t).reduce((e, [t, n]) => e.replace(RegExp(`\\{\\{${t}\\}\\}`, "g"), () => String(n)), e) : e;
|
|
6
6
|
}
|
|
7
|
-
function
|
|
8
|
-
let { t:
|
|
7
|
+
function i() {
|
|
8
|
+
let { t: n } = t();
|
|
9
9
|
return e((e, t, i) => {
|
|
10
|
-
let a =
|
|
11
|
-
return
|
|
12
|
-
}, [
|
|
10
|
+
let a = n(e);
|
|
11
|
+
return r(a === e ? t : a, i);
|
|
12
|
+
}, [n]);
|
|
13
13
|
}
|
|
14
|
-
|
|
14
|
+
function a() {
|
|
15
|
+
let t = n()?.t;
|
|
16
|
+
return e((e, n, i) => {
|
|
17
|
+
let a = t ? t(e) : e;
|
|
18
|
+
return r(a === e ? n : a, i);
|
|
19
|
+
}, [t]);
|
|
20
|
+
}
|
|
21
|
+
export { r as interpolateParams, a as useOptionalTr, i as useTr };
|