@burdenoff/microfe-bigconsole 2026.1119.6 → 2026.1119.8
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/embed/widgets/ChartEmbed.js +70 -66
- package/dist/bigconsole/components/insights/GeneratedFormattingReview.d.ts +21 -0
- package/dist/bigconsole/components/insights/GeneratedFormattingReview.js +90 -44
- package/dist/bigconsole/components/settings/WidgetCatalogSection.d.ts +3 -0
- package/dist/bigconsole/components/settings/WidgetCatalogSection.js +207 -0
- package/dist/bigconsole/components/widgets/chart/ChartWidget.js +1 -0
- package/dist/bigconsole/components/widgets/chart/ReferenceLinesEditor.js +5 -1
- package/dist/bigconsole/components/widgets/chart/charts/AreaChart.js +4 -1
- package/dist/bigconsole/components/widgets/chart/charts/BarChart.js +53 -45
- package/dist/bigconsole/components/widgets/chart/charts/ComboChart.js +5 -1
- package/dist/bigconsole/components/widgets/chart/charts/LineChart.js +4 -1
- package/dist/bigconsole/components/widgets/chart/charts/referenceElements.d.ts +13 -11
- package/dist/bigconsole/components/widgets/chart/charts/referenceElements.js +58 -29
- package/dist/bigconsole/components/widgets/chart/charts/types.d.ts +8 -1
- package/dist/bigconsole/components/widgets/chart/referenceLineDraft.js +26 -23
- package/dist/bigconsole/components/widgets/utils/conditionalFormat.d.ts +41 -0
- package/dist/bigconsole/components/widgets/utils/conditionalFormat.js +80 -44
- package/dist/bigconsole/constants/backendErrors.js +2 -0
- package/dist/bigconsole/hooks/useWidgetTypeCatalog.d.ts +14 -0
- package/dist/bigconsole/hooks/useWidgetTypeCatalog.js +79 -0
- package/dist/bigconsole/pages/InsightsPage.js +458 -451
- package/dist/bigconsole/pages/SettingsPage.js +198 -196
- package/dist/bigconsole/types/index.d.ts +8 -0
- package/dist/bigconsole/utils/pipelineExecutionTimeline.d.ts +13 -1
- package/dist/bigconsole/utils/pipelineExecutionTimeline.js +26 -3
- package/dist/bigconsole/utils/widgetCatalog.d.ts +42 -0
- package/dist/bigconsole/utils/widgetCatalog.js +15 -0
- package/dist/constants/permissions.d.ts +2 -1
- package/dist/constants/permissions.js +1 -0
- package/dist/generated/global-operations.d.ts +45 -6
- package/dist/generated/global-types.d.ts +5839 -804
- package/dist/generated/wspace-operations.d.ts +85 -0
- package/dist/generated/wspace-operations.js +329 -30
- package/dist/generated/wspace-types.d.ts +1339 -6
- package/package.json +1 -1
|
@@ -1,38 +1,41 @@
|
|
|
1
|
-
|
|
1
|
+
import { parseComparison as e } from "../utils/conditionalFormat.js";
|
|
2
|
+
var t = [
|
|
2
3
|
"danger",
|
|
3
4
|
"warning",
|
|
4
5
|
"success",
|
|
5
6
|
"info",
|
|
6
7
|
"neutral"
|
|
7
8
|
];
|
|
8
|
-
function t(t) {
|
|
9
|
-
return typeof t == "string" && e.includes(t);
|
|
10
|
-
}
|
|
11
9
|
function n(e) {
|
|
12
|
-
return typeof e == "
|
|
10
|
+
return typeof e == "string" && t.includes(e);
|
|
13
11
|
}
|
|
14
12
|
function r(e) {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
if (
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
s
|
|
13
|
+
return typeof e == "number" && Number.isFinite(e) ? e : void 0;
|
|
14
|
+
}
|
|
15
|
+
function i(t) {
|
|
16
|
+
if (!Array.isArray(t)) return [];
|
|
17
|
+
let i = [];
|
|
18
|
+
for (let a of t) {
|
|
19
|
+
if (i.length >= 10) break;
|
|
20
|
+
if (!a || typeof a != "object") continue;
|
|
21
|
+
let t = a, o = r(t.value);
|
|
22
|
+
if (o === void 0) continue;
|
|
23
|
+
let s = e(t.relativeTo);
|
|
24
|
+
if (s === null) continue;
|
|
25
|
+
let c = { value: o };
|
|
26
|
+
(t.axis === "x" || t.axis === "y") && (c.axis = t.axis);
|
|
27
|
+
let l = r(t.value2);
|
|
28
|
+
l !== void 0 && (c.value2 = l), typeof t.label == "string" && t.label !== "" && (c.label = t.label), n(t.color) && (c.color = t.color), typeof t.dashed == "boolean" && (c.dashed = t.dashed), s && (c.relativeTo = s), i.push(c);
|
|
26
29
|
}
|
|
27
|
-
return
|
|
30
|
+
return i;
|
|
28
31
|
}
|
|
29
|
-
function
|
|
32
|
+
function a(e) {
|
|
30
33
|
let t = e.trim();
|
|
31
34
|
if (t === "") return null;
|
|
32
35
|
let n = Number(t);
|
|
33
36
|
return Number.isFinite(n) ? n : null;
|
|
34
37
|
}
|
|
35
|
-
function
|
|
38
|
+
function o(e, t = 0) {
|
|
36
39
|
return e.length >= 10 ? [...e] : [...e, {
|
|
37
40
|
axis: "y",
|
|
38
41
|
value: t,
|
|
@@ -40,7 +43,7 @@ function a(e, t = 0) {
|
|
|
40
43
|
dashed: !0
|
|
41
44
|
}];
|
|
42
45
|
}
|
|
43
|
-
function
|
|
46
|
+
function s(e, t, n) {
|
|
44
47
|
return e.map((e, r) => {
|
|
45
48
|
if (r !== t) return e;
|
|
46
49
|
let i = { ...e };
|
|
@@ -48,10 +51,10 @@ function o(e, t, n) {
|
|
|
48
51
|
return i;
|
|
49
52
|
});
|
|
50
53
|
}
|
|
51
|
-
function
|
|
54
|
+
function c(e, t) {
|
|
52
55
|
return e.filter((e, n) => n !== t);
|
|
53
56
|
}
|
|
54
|
-
function
|
|
57
|
+
function l(e) {
|
|
55
58
|
return e.length > 0 ? [...e] : void 0;
|
|
56
59
|
}
|
|
57
|
-
export {
|
|
60
|
+
export { t as REFERENCE_LINE_INTENTS, o as addReferenceLine, i as normalizeReferenceLines, a as parseReferenceValue, c as removeReferenceLine, l as toReferenceLinesConfig, s as updateReferenceLine };
|
|
@@ -31,6 +31,19 @@ export interface ConditionalStyle {
|
|
|
31
31
|
/** Color intent for the data bar (defaults to `info`). */
|
|
32
32
|
dataBarColor?: SemanticIntent;
|
|
33
33
|
}
|
|
34
|
+
/**
|
|
35
|
+
* How a derived rule compares its field with a base field on the same row
|
|
36
|
+
* (BOFF-10145). `percentChange` is (field - base) / |base| × 100, so
|
|
37
|
+
* "over budget by more than 10%" is `{field: 'actual', compareTo: {field:
|
|
38
|
+
* 'budget', mode: 'percentChange'}, operator: 'gt', value: 10}`;
|
|
39
|
+
* `difference` is field - base.
|
|
40
|
+
*/
|
|
41
|
+
export type ComparisonMode = 'percentChange' | 'difference';
|
|
42
|
+
export interface ConditionalComparison {
|
|
43
|
+
/** Sibling row key holding the base value (e.g. `budget`). */
|
|
44
|
+
field: string;
|
|
45
|
+
mode: ComparisonMode;
|
|
46
|
+
}
|
|
34
47
|
export interface ConditionalRule {
|
|
35
48
|
/** Optional stable id (UI keying). */
|
|
36
49
|
id?: string;
|
|
@@ -52,9 +65,31 @@ export interface ConditionalRule {
|
|
|
52
65
|
valueType?: 'constant' | 'field';
|
|
53
66
|
/** Sibling row key supplying the operand when `valueType === 'field'`. */
|
|
54
67
|
fieldRef?: string;
|
|
68
|
+
/**
|
|
69
|
+
* Test a value derived from `field` and another row field instead of the raw
|
|
70
|
+
* `field` value. Only numeric operators match a derived value.
|
|
71
|
+
*/
|
|
72
|
+
compareTo?: ConditionalComparison;
|
|
55
73
|
/** Styling applied when the rule matches. */
|
|
56
74
|
style: ConditionalStyle;
|
|
57
75
|
}
|
|
76
|
+
/**
|
|
77
|
+
* The derived value a comparison yields, or null when either side is missing,
|
|
78
|
+
* non-numeric, or the percentage base is zero (a change from 0 has no percent).
|
|
79
|
+
*/
|
|
80
|
+
export declare function deriveComparison(value: unknown, base: unknown, mode: ComparisonMode): number | null;
|
|
81
|
+
/**
|
|
82
|
+
* Read a stored `{field, mode}` comparison. Returns `undefined` when absent and
|
|
83
|
+
* `null` when malformed, so a caller can drop the rule or line instead of
|
|
84
|
+
* treating a relative threshold as an absolute one.
|
|
85
|
+
*/
|
|
86
|
+
export declare function parseComparison(value: unknown): ConditionalComparison | null | undefined;
|
|
87
|
+
/**
|
|
88
|
+
* The value a relative threshold resolves to for one row: `value`% above the
|
|
89
|
+
* base (`percentChange`) or `value` above it (`difference`). The percentage is
|
|
90
|
+
* taken of |base| to match `deriveComparison`. Null when the base is missing.
|
|
91
|
+
*/
|
|
92
|
+
export declare function relativeThreshold(base: unknown, value: number, mode: ComparisonMode): number | null;
|
|
58
93
|
/** Evaluate a single rule against a candidate value. */
|
|
59
94
|
export declare function evaluateRule(rawValue: unknown, rule: ConditionalRule, rowData?: Record<string, unknown>): boolean;
|
|
60
95
|
/**
|
|
@@ -63,6 +98,12 @@ export declare function evaluateRule(rawValue: unknown, rule: ConditionalRule, r
|
|
|
63
98
|
* general to specific. Returns `undefined` when nothing matches.
|
|
64
99
|
*/
|
|
65
100
|
export declare function resolveConditionalStyle(rawValue: unknown, rules: ConditionalRule[] | undefined, rowData?: Record<string, unknown>): ConditionalStyle | undefined;
|
|
101
|
+
/**
|
|
102
|
+
* Fill for one bar of a series (BOFF-10145). A rule applies to the bar of the
|
|
103
|
+
* series it names (`field`), or to every series' own value when it names none.
|
|
104
|
+
* Returns `undefined` when nothing matches, so the series colour is kept.
|
|
105
|
+
*/
|
|
106
|
+
export declare function resolveBarFill(row: Record<string, unknown>, seriesKey: string, rules: ConditionalRule[] | undefined): string | undefined;
|
|
66
107
|
/** CSS variable for a semantic intent's solid color (charts/SVG). */
|
|
67
108
|
export declare function intentToCssVar(intent: SemanticIntent): string;
|
|
68
109
|
/** Build the Tailwind className fragment for a resolved style (DOM cells). */
|
|
@@ -8,48 +8,84 @@ function e(e) {
|
|
|
8
8
|
return null;
|
|
9
9
|
}
|
|
10
10
|
function t(t, n, r) {
|
|
11
|
-
let i =
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
11
|
+
let i = e(t), a = e(n);
|
|
12
|
+
return i == null || a == null ? null : r === "difference" ? i - a : r !== "percentChange" || a === 0 ? null : (i - a) / Math.abs(a) * 100;
|
|
13
|
+
}
|
|
14
|
+
var n = ["percentChange", "difference"];
|
|
15
|
+
function r(e) {
|
|
16
|
+
return typeof e == "string" && n.includes(e);
|
|
17
|
+
}
|
|
18
|
+
function i(e) {
|
|
19
|
+
if (e === void 0) return;
|
|
20
|
+
if (!e || typeof e != "object" || Array.isArray(e)) return null;
|
|
21
|
+
let { field: t, mode: n } = e;
|
|
22
|
+
return typeof t != "string" || t.length === 0 || t.length > 128 || !r(n) ? null : {
|
|
23
|
+
field: t,
|
|
24
|
+
mode: n
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
function a(t, n, r) {
|
|
28
|
+
let i = e(t);
|
|
29
|
+
return i == null ? null : r === "difference" ? i + n : i + Math.abs(i) * n / 100;
|
|
30
|
+
}
|
|
31
|
+
function o(n, r, i) {
|
|
32
|
+
if (r.compareTo) {
|
|
33
|
+
if (!i || r.field == null) return !1;
|
|
34
|
+
let e = t(i[r.field], i[r.compareTo.field], r.compareTo.mode);
|
|
35
|
+
return e != null && o(e, {
|
|
36
|
+
...r,
|
|
37
|
+
field: void 0,
|
|
38
|
+
compareTo: void 0,
|
|
39
|
+
valueType: void 0
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
let a = r.field != null && i ? i[r.field] : n, s = r.valueType === "field" && r.fieldRef ? i?.[r.fieldRef] : r.value;
|
|
43
|
+
switch (r.operator) {
|
|
44
|
+
case "isEmpty": return a == null || a === "";
|
|
45
|
+
case "isNotEmpty": return a != null && a !== "";
|
|
46
|
+
case "contains": return String(a ?? "").toLowerCase().includes(String(s ?? "").toLowerCase());
|
|
47
|
+
case "notContains": return !String(a ?? "").toLowerCase().includes(String(s ?? "").toLowerCase());
|
|
48
|
+
case "startsWith": return String(a ?? "").toLowerCase().startsWith(String(s ?? "").toLowerCase());
|
|
49
|
+
case "endsWith": return String(a ?? "").toLowerCase().endsWith(String(s ?? "").toLowerCase());
|
|
19
50
|
}
|
|
20
|
-
if (
|
|
21
|
-
let t = e(
|
|
22
|
-
return
|
|
51
|
+
if (r.operator === "eq" || r.operator === "neq") {
|
|
52
|
+
let t = e(a), n = e(s), i = t != null && n != null ? t === n : String(a ?? "") === String(s ?? "");
|
|
53
|
+
return r.operator === "eq" ? i : !i;
|
|
23
54
|
}
|
|
24
|
-
let
|
|
25
|
-
if (
|
|
26
|
-
let
|
|
27
|
-
switch (
|
|
28
|
-
case "gt": return
|
|
29
|
-
case "gte": return
|
|
30
|
-
case "lt": return
|
|
31
|
-
case "lte": return
|
|
55
|
+
let c = e(a);
|
|
56
|
+
if (c == null) return !1;
|
|
57
|
+
let l = e(s);
|
|
58
|
+
switch (r.operator) {
|
|
59
|
+
case "gt": return l != null && c > l;
|
|
60
|
+
case "gte": return l != null && c >= l;
|
|
61
|
+
case "lt": return l != null && c < l;
|
|
62
|
+
case "lte": return l != null && c <= l;
|
|
32
63
|
case "between": {
|
|
33
|
-
let t = e(
|
|
34
|
-
return
|
|
64
|
+
let t = e(r.value2);
|
|
65
|
+
return l == null || t == null ? !1 : c >= Math.min(l, t) && c <= Math.max(l, t);
|
|
35
66
|
}
|
|
36
67
|
case "outside": {
|
|
37
|
-
let t = e(
|
|
38
|
-
return
|
|
68
|
+
let t = e(r.value2);
|
|
69
|
+
return l == null || t == null ? !1 : c < Math.min(l, t) || c > Math.max(l, t);
|
|
39
70
|
}
|
|
40
71
|
default: return !1;
|
|
41
72
|
}
|
|
42
73
|
}
|
|
43
|
-
function
|
|
44
|
-
if (!
|
|
45
|
-
let
|
|
46
|
-
for (let
|
|
47
|
-
...
|
|
48
|
-
...
|
|
74
|
+
function s(e, t, n) {
|
|
75
|
+
if (!t?.length) return;
|
|
76
|
+
let r;
|
|
77
|
+
for (let i of t) o(e, i, n) && (r = {
|
|
78
|
+
...r,
|
|
79
|
+
...i.style
|
|
49
80
|
});
|
|
50
|
-
return
|
|
81
|
+
return r;
|
|
51
82
|
}
|
|
52
|
-
function
|
|
83
|
+
function c(e, t, n) {
|
|
84
|
+
if (!n?.length) return;
|
|
85
|
+
let r = n.filter((e) => e.field == null || e.field === t), i = s(e[t], r, e), a = i?.bgColor ?? i?.textColor;
|
|
86
|
+
return a ? l(a) : void 0;
|
|
87
|
+
}
|
|
88
|
+
function l(e) {
|
|
53
89
|
switch (e) {
|
|
54
90
|
case "success": return "var(--color-status-success)";
|
|
55
91
|
case "warning": return "var(--color-status-warning)";
|
|
@@ -58,44 +94,44 @@ function r(e) {
|
|
|
58
94
|
default: return "var(--color-text-secondary)";
|
|
59
95
|
}
|
|
60
96
|
}
|
|
61
|
-
var
|
|
97
|
+
var u = {
|
|
62
98
|
success: "text-status-success-text",
|
|
63
99
|
warning: "text-[var(--color-status-warning-text)]",
|
|
64
100
|
danger: "text-status-error-text",
|
|
65
101
|
info: "text-[var(--color-status-info-text)]",
|
|
66
102
|
neutral: "text-text-secondary"
|
|
67
|
-
},
|
|
103
|
+
}, d = {
|
|
68
104
|
success: "bg-status-success-bg-subtle",
|
|
69
105
|
warning: "bg-status-warning-bg-subtle",
|
|
70
106
|
danger: "bg-status-error-bg-subtle",
|
|
71
107
|
info: "bg-status-info-bg-subtle",
|
|
72
108
|
neutral: "bg-bg-sunken"
|
|
73
109
|
};
|
|
74
|
-
function
|
|
110
|
+
function f(e) {
|
|
75
111
|
if (!e) return "";
|
|
76
112
|
let t = [];
|
|
77
|
-
return e.textColor && t.push(
|
|
113
|
+
return e.textColor && t.push(u[e.textColor]), e.bgColor && t.push(d[e.bgColor]), e.bold && t.push("font-semibold"), t.join(" ");
|
|
78
114
|
}
|
|
79
|
-
var
|
|
115
|
+
var p = {
|
|
80
116
|
success: "bg-status-success-bg-subtle",
|
|
81
117
|
warning: "bg-status-warning-bg-subtle",
|
|
82
118
|
danger: "bg-status-error-bg-subtle",
|
|
83
119
|
info: "bg-status-info-bg-subtle",
|
|
84
120
|
neutral: "bg-bg-sunken"
|
|
85
|
-
},
|
|
121
|
+
}, m = {
|
|
86
122
|
success: "border-l-4 border-status-success-border",
|
|
87
123
|
warning: "border-l-4 border-status-warning-border",
|
|
88
124
|
danger: "border-l-4 border-status-error-border",
|
|
89
125
|
info: "border-l-4 border-status-info-border",
|
|
90
126
|
neutral: "border-l-4 border-border-default"
|
|
91
127
|
};
|
|
92
|
-
function
|
|
93
|
-
let
|
|
94
|
-
if (!
|
|
95
|
-
let
|
|
96
|
-
return
|
|
128
|
+
function h(e, t) {
|
|
129
|
+
let n = s(void 0, t, e);
|
|
130
|
+
if (!n) return "";
|
|
131
|
+
let r = [], i = n.bgColor ?? n.textColor;
|
|
132
|
+
return i && (r.push(p[i]), r.push(m[i])), n.textColor && r.push(u[n.textColor]), n.bold && r.push("font-semibold"), r.join(" ");
|
|
97
133
|
}
|
|
98
|
-
var
|
|
134
|
+
var g = {
|
|
99
135
|
"arrow-up": "M5 15l7-7 7 7",
|
|
100
136
|
"arrow-down": "M19 9l-7 7-7-7",
|
|
101
137
|
flag: "M3 21V5a2 2 0 012-2h11l-2 4 2 4H5",
|
|
@@ -103,4 +139,4 @@ var u = {
|
|
|
103
139
|
alert: "M12 9v4m0 4h.01M10.29 3.86L1.82 18a2 2 0 001.71 3h16.94a2 2 0 001.71-3L13.71 3.86a2 2 0 00-3.42 0z",
|
|
104
140
|
dot: "M12 12m-4 0a4 4 0 108 0a4 4 0 10-8 0"
|
|
105
141
|
};
|
|
106
|
-
export {
|
|
142
|
+
export { g as CONDITIONAL_ICON_PATHS, f as conditionalStyleToClassName, t as deriveComparison, o as evaluateRule, l as intentToCssVar, i as parseComparison, a as relativeThreshold, c as resolveBarFill, s as resolveConditionalStyle, h as resolveRowClassName };
|
|
@@ -58,6 +58,8 @@ var e = {
|
|
|
58
58
|
NO_ACTIVE_WEBHOOK_MAPPINGS: "No active webhook mappings were found for this event.",
|
|
59
59
|
WIDGET_NOT_ASSOCIATED_WITH_DASHBOARD: "That widget is not associated with a dashboard.",
|
|
60
60
|
WIDGET_TYPE_NOT_REGISTERED: "That widget type is not registered. Register it before installing.",
|
|
61
|
+
WIDGET_TYPE_REQUIRES_STORE_INSTALL: "That widget type comes from the Store. Install it from the Store instead.",
|
|
62
|
+
WIDGET_TYPE_NOT_INSTALLABLE: "That widget type cannot be installed in its current status.",
|
|
61
63
|
INVALID_PUBLISH_TYPE: "That publish type is not valid.",
|
|
62
64
|
INVALID_REGISTRABLE_PUBLISH_TYPE: "That publish type cannot be registered.",
|
|
63
65
|
INVALID_WIDGET_RENDERER: "That widget renderer is not valid.",
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { WidgetCatalogRow } from '../utils/widgetCatalog';
|
|
2
|
+
export interface UseWidgetTypeCatalogResult {
|
|
3
|
+
rows: WidgetCatalogRow[];
|
|
4
|
+
loading: boolean;
|
|
5
|
+
/** The load error, if the catalog could not be read. */
|
|
6
|
+
loadError: unknown;
|
|
7
|
+
/** Key (`type@version`) of the row whose install/uninstall is in flight. */
|
|
8
|
+
pendingKey: string | null;
|
|
9
|
+
reload: () => Promise<void>;
|
|
10
|
+
/** Resolves to null on success, or the error to show. */
|
|
11
|
+
install: (row: WidgetCatalogRow) => Promise<unknown>;
|
|
12
|
+
uninstall: (row: WidgetCatalogRow) => Promise<unknown>;
|
|
13
|
+
}
|
|
14
|
+
export declare function useWidgetTypeCatalog(workspaceId: string | undefined, enabled: boolean): UseWidgetTypeCatalogResult;
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import { InstallWidgetTypeDocument as e, UninstallWidgetTypeDocument as t, WidgetTypeCatalogDocument as n } from "../../generated/wspace-operations.js";
|
|
2
|
+
import { widgetCatalogRowKey as r } from "../utils/widgetCatalog.js";
|
|
3
|
+
import { useCallback as i, useMemo as a, useState as o } from "react";
|
|
4
|
+
import { useApolloClient as s, useQuery as c } from "@apollo/client/react";
|
|
5
|
+
// src/bigconsole/hooks/useWidgetTypeCatalog.ts
|
|
6
|
+
function l(l, u) {
|
|
7
|
+
let d = s(), [f, p] = o(null), [m, h] = o({}), { data: g, dataState: _, loading: v, error: y, refetch: b } = c(n, {
|
|
8
|
+
skip: !u || !l,
|
|
9
|
+
fetchPolicy: "network-only",
|
|
10
|
+
notifyOnNetworkStatusChange: !0
|
|
11
|
+
}), x = _ === "complete" ? g?.widgetTypeCatalog : void 0, S = a(() => (x ?? []).map((e) => {
|
|
12
|
+
let t = m[r(e)];
|
|
13
|
+
return t === void 0 ? e : {
|
|
14
|
+
...e,
|
|
15
|
+
installedInWorkspace: t
|
|
16
|
+
};
|
|
17
|
+
}), [x, m]), C = i(async () => {
|
|
18
|
+
h({}), await b();
|
|
19
|
+
}, [b]), w = i((e, t) => {
|
|
20
|
+
let n = r(e);
|
|
21
|
+
h((e) => ({
|
|
22
|
+
...e,
|
|
23
|
+
[n]: t
|
|
24
|
+
}));
|
|
25
|
+
}, []), T = i(async (t) => {
|
|
26
|
+
if (!l) return null;
|
|
27
|
+
p(r(t));
|
|
28
|
+
try {
|
|
29
|
+
return await d.mutate({
|
|
30
|
+
mutation: e,
|
|
31
|
+
variables: { input: {
|
|
32
|
+
widgetType: t.widgetType,
|
|
33
|
+
widgetVersion: t.widgetVersion,
|
|
34
|
+
publishType: t.publishType,
|
|
35
|
+
workspaceId: l
|
|
36
|
+
} }
|
|
37
|
+
}), w(t, !0), null;
|
|
38
|
+
} catch (e) {
|
|
39
|
+
return e;
|
|
40
|
+
} finally {
|
|
41
|
+
p(null);
|
|
42
|
+
}
|
|
43
|
+
}, [
|
|
44
|
+
d,
|
|
45
|
+
w,
|
|
46
|
+
l
|
|
47
|
+
]), E = i(async (e) => {
|
|
48
|
+
if (!l) return null;
|
|
49
|
+
p(r(e));
|
|
50
|
+
try {
|
|
51
|
+
return await d.mutate({
|
|
52
|
+
mutation: t,
|
|
53
|
+
variables: { input: {
|
|
54
|
+
widgetType: e.widgetType,
|
|
55
|
+
widgetVersion: e.widgetVersion,
|
|
56
|
+
workspaceId: l
|
|
57
|
+
} }
|
|
58
|
+
}), w(e, !1), null;
|
|
59
|
+
} catch (e) {
|
|
60
|
+
return e;
|
|
61
|
+
} finally {
|
|
62
|
+
p(null);
|
|
63
|
+
}
|
|
64
|
+
}, [
|
|
65
|
+
d,
|
|
66
|
+
w,
|
|
67
|
+
l
|
|
68
|
+
]);
|
|
69
|
+
return {
|
|
70
|
+
rows: S,
|
|
71
|
+
loading: v,
|
|
72
|
+
loadError: y ?? null,
|
|
73
|
+
pendingKey: f,
|
|
74
|
+
reload: C,
|
|
75
|
+
install: T,
|
|
76
|
+
uninstall: E
|
|
77
|
+
};
|
|
78
|
+
}
|
|
79
|
+
export { l as useWidgetTypeCatalog };
|