@cccsaurora/clue-ui 1.1.7 → 1.1.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/{ActionForm-CW8ZBIh8.js → ActionForm-BRNLvDmk.js} +152 -149
- package/components/actions/ActionForm.js +1 -1
- package/components/actions/ResultModal.js +1 -1
- package/components/enrichment/EnrichPopover.js +1 -1
- package/components/group/GroupControl.js +1 -1
- package/hooks/ClueActionContext.js +1 -1
- package/hooks/ClueProvider.js +1 -1
- package/hooks/selectors.js +1 -1
- package/hooks/useActionResult.js +1 -1
- package/hooks/useClueActions.js +1 -1
- package/icons/Action.js +1 -1
- package/main.js +1 -1
- package/package.json +1 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { jsx as
|
|
1
|
+
import { jsx as r, jsxs as p } from "react/jsx-runtime";
|
|
2
2
|
import { materialRenderers as Je, materialCells as Oe } from "@jsonforms/material-renderers";
|
|
3
3
|
import { JsonForms as Pe } from "@jsonforms/react";
|
|
4
|
-
import { Modal as ne, Paper as ae, Stack as
|
|
4
|
+
import { Modal as ne, Paper as ae, Stack as a, Typography as b, Divider as Z, LinearProgress as ze, Button as P, IconButton as He, Box as O, CircularProgress as Ve, Collapse as qe } from "@mui/material";
|
|
5
5
|
import ue from "./components/display/icons/Iconified.js";
|
|
6
6
|
import { J as Y } from "./index-DtRkeZWt.js";
|
|
7
7
|
import { ClueComponentContext as W } from "./hooks/ClueComponentContext.js";
|
|
@@ -10,7 +10,7 @@ import { a as K } from "./useClueTypeConfig-D1DlRG7e.js";
|
|
|
10
10
|
import { d as he } from "./_baseGet-DSZygzyq.js";
|
|
11
11
|
import { b as Ne } from "./_baseSlice-M5RKzt1A.js";
|
|
12
12
|
import { i as Te } from "./utils-C8TeL4oX.js";
|
|
13
|
-
import { useState as w, useRef as Le, useMemo as
|
|
13
|
+
import { useState as w, useRef as Le, useMemo as k, useEffect as Q, memo as xe, useCallback as S } from "react";
|
|
14
14
|
import { u as A, c as Ue, a as Ge } from "./index-E7g8cRyW.js";
|
|
15
15
|
import z from "./components/ErrorBoundary.js";
|
|
16
16
|
import { adaptSchema as Ke } from "./components/actions/form/schemaAdapter.js";
|
|
@@ -22,15 +22,15 @@ import { dayjs as Qe } from "./utils/time.js";
|
|
|
22
22
|
import { safeDispatchEvent as N } from "./utils/window.js";
|
|
23
23
|
import Xe from "./hooks/useClue.js";
|
|
24
24
|
import { i as ge } from "./isNil-CjWwlQS3.js";
|
|
25
|
-
function We(e,
|
|
25
|
+
function We(e, c, l) {
|
|
26
26
|
var i = e.length;
|
|
27
|
-
return
|
|
27
|
+
return l = l === void 0 ? i : l, !c && l >= i ? e : Ne(e, c, l);
|
|
28
28
|
}
|
|
29
|
-
var Ae = "\\ud800-\\udfff", De = "\\u0300-\\u036f", eo = "\\ufe20-\\ufe2f", oo = "\\u20d0-\\u20ff", ro = De + eo + oo, so = "\\ufe0e\\ufe0f", to = "\\u200d",
|
|
29
|
+
var Ae = "\\ud800-\\udfff", De = "\\u0300-\\u036f", eo = "\\ufe20-\\ufe2f", oo = "\\u20d0-\\u20ff", ro = De + eo + oo, so = "\\ufe0e\\ufe0f", to = "\\u200d", co = RegExp("[" + to + Ae + ro + so + "]");
|
|
30
30
|
function ye(e) {
|
|
31
|
-
return
|
|
31
|
+
return co.test(e);
|
|
32
32
|
}
|
|
33
|
-
function
|
|
33
|
+
function lo(e) {
|
|
34
34
|
return e.split("");
|
|
35
35
|
}
|
|
36
36
|
var Ce = "\\ud800-\\udfff", io = "\\u0300-\\u036f", mo = "\\ufe20-\\ufe2f", fo = "\\u20d0-\\u20ff", po = io + mo + fo, no = "\\ufe0e\\ufe0f", ao = "[" + Ce + "]", X = "[" + po + "]", g = "\\ud83c[\\udffb-\\udfff]", uo = "(?:" + X + "|" + g + ")", ve = "[^" + Ce + "]", we = "(?:\\ud83c[\\udde6-\\uddff]){2}", Re = "[\\ud800-\\udbff][\\udc00-\\udfff]", ho = "\\u200d", be = uo + "?", ke = "[" + no + "]?", xo = "(?:" + ho + "(?:" + [ve, we, Re].join("|") + ")" + ke + be + ")*", yo = ke + be + xo, Co = "(?:" + [ve + X + "?", X, we, Re, ao].join("|") + ")", vo = RegExp(g + "(?=" + g + ")|" + Co + yo, "g");
|
|
@@ -38,104 +38,107 @@ function wo(e) {
|
|
|
38
38
|
return e.match(vo) || [];
|
|
39
39
|
}
|
|
40
40
|
function Ro(e) {
|
|
41
|
-
return ye(e) ? wo(e) :
|
|
41
|
+
return ye(e) ? wo(e) : lo(e);
|
|
42
42
|
}
|
|
43
43
|
function bo(e) {
|
|
44
|
-
return function(
|
|
45
|
-
|
|
46
|
-
var
|
|
47
|
-
return i[e]() +
|
|
44
|
+
return function(c) {
|
|
45
|
+
c = he(c);
|
|
46
|
+
var l = ye(c) ? Ro(c) : void 0, i = l ? l[0] : c.charAt(0), o = l ? We(l, 1).join("") : c.slice(1);
|
|
47
|
+
return i[e]() + o;
|
|
48
48
|
};
|
|
49
49
|
}
|
|
50
50
|
var ko = bo("toUpperCase");
|
|
51
51
|
function Eo(e) {
|
|
52
52
|
return ko(he(e).toLowerCase());
|
|
53
53
|
}
|
|
54
|
-
const So = (e,
|
|
55
|
-
const [
|
|
54
|
+
const So = (e, c = 2e3) => {
|
|
55
|
+
const [l, i] = w(e), o = Le(null), { getActionStatus: v } = Se(), u = k(() => e == null ? void 0 : e.task_id, [e == null ? void 0 : e.task_id]), n = k(() => e == null ? void 0 : e.actionId, [e == null ? void 0 : e.actionId]);
|
|
56
56
|
return Q(() => {
|
|
57
|
-
if ((e == null ? void 0 : e.outcome) !== "pending" || !
|
|
58
|
-
let
|
|
59
|
-
const
|
|
60
|
-
const
|
|
61
|
-
if (!
|
|
57
|
+
if ((e == null ? void 0 : e.outcome) !== "pending" || !u) return;
|
|
58
|
+
let m = !1;
|
|
59
|
+
const h = async () => {
|
|
60
|
+
const x = await v(n, u);
|
|
61
|
+
if (!x)
|
|
62
62
|
i({ outcome: "failure", done: !0 });
|
|
63
|
-
else if (
|
|
64
|
-
i({ ...
|
|
63
|
+
else if (x.outcome === "success" || x.outcome === "failure")
|
|
64
|
+
i({ ...x, done: !0 });
|
|
65
65
|
else {
|
|
66
|
-
if (
|
|
67
|
-
i({ ...
|
|
66
|
+
if (m) return;
|
|
67
|
+
i({ ...x }), o.current = setTimeout(h, c);
|
|
68
68
|
}
|
|
69
69
|
};
|
|
70
|
-
return
|
|
71
|
-
|
|
70
|
+
return h(), () => {
|
|
71
|
+
m = !0, o.current && clearTimeout(o.current);
|
|
72
72
|
};
|
|
73
|
-
}, [
|
|
73
|
+
}, [n, v, c, e == null ? void 0 : e.outcome, u]), Q(() => {
|
|
74
74
|
i(e);
|
|
75
|
-
}, [e]),
|
|
76
|
-
() => e ||
|
|
77
|
-
[e,
|
|
75
|
+
}, [e]), k(
|
|
76
|
+
() => e || l ? { ...e, ...l } : void 0,
|
|
77
|
+
[e, l]
|
|
78
78
|
);
|
|
79
|
-
}, Mo = ({ result: e, onClose:
|
|
80
|
-
var
|
|
81
|
-
const { t: i } = A(W, (
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
/* @__PURE__ */
|
|
88
|
-
/* @__PURE__ */
|
|
79
|
+
}, Mo = ({ result: e, onClose: c, show: l = !1 }) => {
|
|
80
|
+
var u, n;
|
|
81
|
+
const { t: i } = A(W, (m) => m.i18next), o = So(e), v = k(
|
|
82
|
+
() => (o == null ? void 0 : o.outcome) === "success" || (o == null ? void 0 : o.outcome) === "failure" || (o == null ? void 0 : o.done),
|
|
83
|
+
[o == null ? void 0 : o.done, o == null ? void 0 : o.outcome]
|
|
84
|
+
);
|
|
85
|
+
return o ? /* @__PURE__ */ r(ne, { open: l, sx: { display: "flex", alignItems: "center", justifyContent: "center" }, onClose: c, children: /* @__PURE__ */ r(ae, { sx: { maxHeight: "80%", maxWidth: "80%", height: "100%", p: 2, minWidth: "750px" }, children: /* @__PURE__ */ r(z, { children: /* @__PURE__ */ p(a, { spacing: 1, height: "100%", children: [
|
|
86
|
+
/* @__PURE__ */ p(a, { direction: "row", spacing: 1, alignItems: "center", children: [
|
|
87
|
+
o.action.action_icon && /* @__PURE__ */ r(Ze, { height: "1.5rem", icon: o.action.action_icon }),
|
|
88
|
+
/* @__PURE__ */ r(b, { variant: "h5", children: o.action.name }),
|
|
89
|
+
o.action.supported_types && /* @__PURE__ */ r(b, { variant: "caption", color: "text.secondary", children: o.action.supported_types.map((m) => m.toUpperCase()).join(", ") }),
|
|
90
|
+
/* @__PURE__ */ r("div", { style: { flex: 1 } }),
|
|
91
|
+
/* @__PURE__ */ r(Ye, { size: "small", classification: o.action.classification })
|
|
89
92
|
] }),
|
|
90
|
-
/* @__PURE__ */
|
|
91
|
-
/* @__PURE__ */
|
|
92
|
-
|
|
93
|
-
/* @__PURE__ */
|
|
94
|
-
/* @__PURE__ */
|
|
95
|
-
] }) }) : /* @__PURE__ */ p(
|
|
96
|
-
|
|
97
|
-
/* @__PURE__ */
|
|
93
|
+
/* @__PURE__ */ r(b, { variant: "body1", children: o.action.summary }),
|
|
94
|
+
/* @__PURE__ */ r(Z, { flexItem: !0 }),
|
|
95
|
+
v ? /* @__PURE__ */ r(z, { children: o.format === "markdown" ? /* @__PURE__ */ r(pe, { md: o.output }) : o.format === "json" ? /* @__PURE__ */ r(Y, { data: o.output, collapse: !0, forceCompact: !0 }) : /* @__PURE__ */ p(a, { sx: { overflowY: "auto" }, children: [
|
|
96
|
+
/* @__PURE__ */ r(pe, { md: "`" + o.format + "` is not recognized as a format in this application." }),
|
|
97
|
+
/* @__PURE__ */ r(Y, { data: o, collapse: !0, forceCompact: !0 })
|
|
98
|
+
] }) }) : /* @__PURE__ */ p(a, { flex: 1, sx: { pt: 2, alignItems: "center" }, spacing: 1, children: [
|
|
99
|
+
o.summary && /* @__PURE__ */ r(b, { variant: "caption", children: o.summary }),
|
|
100
|
+
/* @__PURE__ */ r(
|
|
98
101
|
ze,
|
|
99
102
|
{
|
|
100
|
-
variant: (
|
|
101
|
-
value: ((
|
|
102
|
-
sx: { maxWidth: 500, width: "100%", borderRadius: (
|
|
103
|
+
variant: (u = o.output) != null && u.progress ? "determinate" : "indeterminate",
|
|
104
|
+
value: ((n = o.output) == null ? void 0 : n.progress) * 100,
|
|
105
|
+
sx: { maxWidth: 500, width: "100%", borderRadius: (m) => m.shape.borderRadius }
|
|
103
106
|
}
|
|
104
107
|
)
|
|
105
108
|
] }),
|
|
106
|
-
/* @__PURE__ */
|
|
107
|
-
/* @__PURE__ */ p(
|
|
108
|
-
/* @__PURE__ */
|
|
109
|
-
|
|
110
|
-
/* @__PURE__ */
|
|
109
|
+
/* @__PURE__ */ r("div", { style: { flex: 1 } }),
|
|
110
|
+
/* @__PURE__ */ p(a, { direction: "row", spacing: 1, children: [
|
|
111
|
+
/* @__PURE__ */ r("div", { style: { flex: 1 } }),
|
|
112
|
+
o.link && /* @__PURE__ */ r(P, { variant: "outlined", component: "a", target: "_blank", href: o.link, children: i("details.open") }),
|
|
113
|
+
/* @__PURE__ */ r(P, { variant: "outlined", color: "error", onClick: c, children: i("close") })
|
|
111
114
|
] })
|
|
112
115
|
] }) }) }) }) : null;
|
|
113
116
|
}, jo = xe(Mo), Fo = new Be({ removeAdditional: !0, coerceTypes: !0, strict: !1 }), Ee = Ue(null), rr = ({
|
|
114
117
|
baseURL: e,
|
|
115
|
-
children:
|
|
116
|
-
classification:
|
|
118
|
+
children: c,
|
|
119
|
+
classification: l,
|
|
117
120
|
includeContext: i,
|
|
118
|
-
getToken:
|
|
119
|
-
onNetworkCall:
|
|
121
|
+
getToken: o,
|
|
122
|
+
onNetworkCall: v
|
|
120
123
|
}) => {
|
|
121
|
-
const { t:
|
|
122
|
-
const s = {},
|
|
123
|
-
return
|
|
124
|
-
}, [e,
|
|
125
|
-
if (!
|
|
124
|
+
const { t: u, i18n: n } = A(W, (s) => s.i18next), { ready: m } = Xe(), [h, x] = w(null), [H, f] = w({}), [T, F] = w(!1), [t, y] = w(null), [E, M] = w(!1), [$, Me] = w({}), j = k(() => {
|
|
125
|
+
const s = {}, C = o == null ? void 0 : o();
|
|
126
|
+
return C && (s.Authorization = `Bearer ${C}`), v ? v({ baseURL: e, headers: s }) : { baseURL: e, headers: s };
|
|
127
|
+
}, [e, o, v]), L = S(async () => {
|
|
128
|
+
if (!m)
|
|
126
129
|
return;
|
|
127
130
|
const s = await K.actions.get(j);
|
|
128
131
|
return s && Me(s), s;
|
|
129
|
-
}, [
|
|
132
|
+
}, [m, j]);
|
|
130
133
|
Q(() => {
|
|
131
134
|
L();
|
|
132
|
-
}, [e,
|
|
133
|
-
const V =
|
|
134
|
-
(s,
|
|
135
|
-
[
|
|
136
|
-
), D =
|
|
137
|
-
async (s,
|
|
138
|
-
const { forceMenu: se, onComplete: q, skipMenu: $e, skipResultModal: te, timeout:
|
|
135
|
+
}, [e, m]);
|
|
136
|
+
const V = S(
|
|
137
|
+
(s, C, R) => JSON.stringify({ type: s, value: C, classification: R ?? l }),
|
|
138
|
+
[l]
|
|
139
|
+
), D = S(
|
|
140
|
+
async (s, C, R, Fe) => {
|
|
141
|
+
const { forceMenu: se, onComplete: q, skipMenu: $e, skipResultModal: te, timeout: ce, includeContext: _e, extraContext: le } = {
|
|
139
142
|
forceMenu: !1,
|
|
140
143
|
skipMenu: !1,
|
|
141
144
|
onComplete: null,
|
|
@@ -146,35 +149,35 @@ const So = (e, l = 2e3) => {
|
|
|
146
149
|
};
|
|
147
150
|
if (!Object.keys($).includes(s))
|
|
148
151
|
throw new Error("Invalid action id");
|
|
149
|
-
const ie =
|
|
152
|
+
const ie = C.map(
|
|
150
153
|
(d) => d.type === "telemetry" ? { ...d, value: JSON.stringify(d.value) } : d
|
|
151
154
|
), _ = $[s], U = Fo.compile(_.params), G = { selectors: ie, ...R };
|
|
152
155
|
let I = null;
|
|
153
156
|
if (_e && (I = {
|
|
154
157
|
timestamp: Qe().toISOString(),
|
|
155
158
|
url: window.location,
|
|
156
|
-
language: (
|
|
157
|
-
}), ge(
|
|
159
|
+
language: (n == null ? void 0 : n.language) ?? "en"
|
|
160
|
+
}), ge(le) || (I = {
|
|
158
161
|
...I ?? {},
|
|
159
|
-
...
|
|
162
|
+
...le
|
|
160
163
|
}), M(!0), !U(G) || se) {
|
|
161
164
|
if ($e && !se)
|
|
162
165
|
throw console.error(`Form is not valid (${U.errors.length} errors)`), new Error("Form is not completed");
|
|
163
|
-
(
|
|
166
|
+
(h == null ? void 0 : h.id) === s && (console.error(`Form is not valid (${U.errors.length} errors)`), N(
|
|
164
167
|
new CustomEvent(B, {
|
|
165
168
|
detail: {
|
|
166
|
-
message:
|
|
169
|
+
message: u("action.error.validation"),
|
|
167
170
|
level: "error"
|
|
168
171
|
}
|
|
169
172
|
})
|
|
170
|
-
)),
|
|
173
|
+
)), x({
|
|
171
174
|
id: s,
|
|
172
175
|
action: _,
|
|
173
|
-
selectors:
|
|
176
|
+
selectors: C,
|
|
174
177
|
params: G ?? {},
|
|
175
178
|
context: I,
|
|
176
179
|
onComplete: q,
|
|
177
|
-
timeout:
|
|
180
|
+
timeout: ce
|
|
178
181
|
});
|
|
179
182
|
return;
|
|
180
183
|
}
|
|
@@ -184,11 +187,11 @@ const So = (e, l = 2e3) => {
|
|
|
184
187
|
ie,
|
|
185
188
|
G ?? {},
|
|
186
189
|
I,
|
|
187
|
-
{ timeout:
|
|
190
|
+
{ timeout: ce },
|
|
188
191
|
j
|
|
189
192
|
), de = { ...d, actionId: s, action: _ };
|
|
190
|
-
q == null || q(de),
|
|
191
|
-
const Ie =
|
|
193
|
+
q == null || q(de), f((me) => {
|
|
194
|
+
const Ie = C.map((J) => V(J.type, J.value, J.classification));
|
|
192
195
|
return {
|
|
193
196
|
...me,
|
|
194
197
|
...Ie.reduce(
|
|
@@ -202,9 +205,9 @@ const So = (e, l = 2e3) => {
|
|
|
202
205
|
}), N(
|
|
203
206
|
new CustomEvent(B, {
|
|
204
207
|
detail: {
|
|
205
|
-
message: /* @__PURE__ */ p(
|
|
206
|
-
/* @__PURE__ */
|
|
207
|
-
d.link && /* @__PURE__ */
|
|
208
|
+
message: /* @__PURE__ */ p(a, { direction: "row", alignItems: "center", spacing: 0.5, width: "100%", children: [
|
|
209
|
+
/* @__PURE__ */ r(b, { children: d.summary }),
|
|
210
|
+
d.link && /* @__PURE__ */ r(He, { component: "a", href: d.link, size: "small", target: "_blank", children: /* @__PURE__ */ r(ue, { icon: "ic:baseline-open-in-new", fontSize: "small" }) })
|
|
208
211
|
] }),
|
|
209
212
|
timeout: d.link ? null : 5e3,
|
|
210
213
|
level: d.outcome === "success" ? "success" : d.outcome === "pending" ? "info" : "error",
|
|
@@ -220,7 +223,7 @@ const So = (e, l = 2e3) => {
|
|
|
220
223
|
}
|
|
221
224
|
}
|
|
222
225
|
})
|
|
223
|
-
), d.outcome === "success" &&
|
|
226
|
+
), d.outcome === "success" && x(null), d.outcome === "pending" && (y({ ...d, actionId: s, action: _ }), te || F(!0)), d.format && (y({ ...d, actionId: s, action: _ }), d.format !== "pivot" && !te ? F(!0) : window.open(d.output, "_blank", "noreferrer"));
|
|
224
227
|
} catch (d) {
|
|
225
228
|
N(
|
|
226
229
|
new CustomEvent(B, {
|
|
@@ -234,11 +237,11 @@ const So = (e, l = 2e3) => {
|
|
|
234
237
|
M(!1);
|
|
235
238
|
}
|
|
236
239
|
},
|
|
237
|
-
[$, i, V,
|
|
238
|
-
), ee =
|
|
239
|
-
async (s,
|
|
240
|
+
[$, i, V, n == null ? void 0 : n.language, j, h == null ? void 0 : h.id, u]
|
|
241
|
+
), ee = S(
|
|
242
|
+
async (s, C) => {
|
|
240
243
|
try {
|
|
241
|
-
return await K.actions.status.get(s,
|
|
244
|
+
return await K.actions.status.get(s, C, {}, j);
|
|
242
245
|
} catch (R) {
|
|
243
246
|
N(
|
|
244
247
|
new CustomEvent(B, {
|
|
@@ -251,28 +254,28 @@ const So = (e, l = 2e3) => {
|
|
|
251
254
|
}
|
|
252
255
|
},
|
|
253
256
|
[j]
|
|
254
|
-
), oe =
|
|
255
|
-
|
|
256
|
-
}, []), re =
|
|
257
|
-
(s,
|
|
257
|
+
), oe = S(() => {
|
|
258
|
+
x(null), M(!1);
|
|
259
|
+
}, []), re = S(
|
|
260
|
+
(s, C, R) => H[V(s, C, R)] ?? [],
|
|
258
261
|
[H, V]
|
|
259
|
-
), je =
|
|
262
|
+
), je = k(
|
|
260
263
|
() => ({
|
|
261
264
|
availableActions: $,
|
|
262
265
|
executeAction: D,
|
|
263
266
|
cancelAction: oe,
|
|
264
267
|
getActionStatus: ee,
|
|
265
268
|
getActionResults: re,
|
|
266
|
-
loading:
|
|
269
|
+
loading: E,
|
|
267
270
|
refreshActions: L
|
|
268
271
|
}),
|
|
269
|
-
[$, oe, D, re, ee,
|
|
272
|
+
[$, oe, D, re, ee, E, L]
|
|
270
273
|
);
|
|
271
274
|
return /* @__PURE__ */ p(Ee.Provider, { value: je, children: [
|
|
272
|
-
|
|
275
|
+
c,
|
|
273
276
|
/* @__PURE__ */ p(z, { children: [
|
|
274
|
-
|
|
275
|
-
/* @__PURE__ */
|
|
277
|
+
h && /* @__PURE__ */ r(Io, { runningActionData: h }),
|
|
278
|
+
/* @__PURE__ */ r(
|
|
276
279
|
jo,
|
|
277
280
|
{
|
|
278
281
|
show: T && !!t,
|
|
@@ -284,55 +287,55 @@ const So = (e, l = 2e3) => {
|
|
|
284
287
|
] });
|
|
285
288
|
}, Se = () => Ge(Ee), $o = Je.map((e) => ({
|
|
286
289
|
...e,
|
|
287
|
-
renderer: ({ ...
|
|
290
|
+
renderer: ({ ...c }) => /* @__PURE__ */ r(z, { children: /* @__PURE__ */ r(e.renderer, { ...c }) })
|
|
288
291
|
})), _o = ({ runningActionData: e }) => {
|
|
289
|
-
const { executeAction:
|
|
292
|
+
const { executeAction: c, cancelAction: l } = Se(), { t: i } = A(W, (t) => t.i18next), [o, v] = w(!1), [u, n] = w(null), [m, h] = w(e == null ? void 0 : e.params), [x, H] = w(!1), f = k(
|
|
290
293
|
() => e != null && e.action ? { ...Ke(e.action.params), ...e.action.extra_schema ?? {} } : null,
|
|
291
294
|
[e == null ? void 0 : e.action]
|
|
292
|
-
), T =
|
|
295
|
+
), T = k(
|
|
293
296
|
() => ({
|
|
294
297
|
type: "VerticalLayout",
|
|
295
|
-
elements: Object.entries((
|
|
296
|
-
var
|
|
298
|
+
elements: Object.entries((f == null ? void 0 : f.properties) ?? {}).sort(([t, y], [E, M]) => y.order || M.order ? y.order - M.order : +(f == null ? void 0 : f.required.includes(t)) - +(f == null ? void 0 : f.required.includes(E))).map(([t, y]) => {
|
|
299
|
+
var E;
|
|
297
300
|
return {
|
|
298
301
|
type: "Control",
|
|
299
302
|
scope: `#/properties/${t}`,
|
|
300
303
|
options: {
|
|
301
|
-
autocomplete: !!
|
|
304
|
+
autocomplete: !!y.enum || ((E = y.options) == null ? void 0 : E.autocomplete),
|
|
302
305
|
showUnfocusedDescription: !0,
|
|
303
|
-
...
|
|
306
|
+
...y.options
|
|
304
307
|
},
|
|
305
|
-
rule:
|
|
308
|
+
rule: y.rule
|
|
306
309
|
};
|
|
307
310
|
})
|
|
308
311
|
}),
|
|
309
|
-
[
|
|
310
|
-
), F =
|
|
312
|
+
[f == null ? void 0 : f.properties, f == null ? void 0 : f.required]
|
|
313
|
+
), F = S(async () => {
|
|
311
314
|
try {
|
|
312
|
-
|
|
315
|
+
v(!0);
|
|
313
316
|
const t = {};
|
|
314
|
-
e != null && e.onComplete && (t.onComplete = e == null ? void 0 : e.onComplete), e != null && e.timeout && (t.timeout = e == null ? void 0 : e.timeout), await
|
|
317
|
+
e != null && e.onComplete && (t.onComplete = e == null ? void 0 : e.onComplete), e != null && e.timeout && (t.timeout = e == null ? void 0 : e.timeout), await c(e == null ? void 0 : e.id, e == null ? void 0 : e.selectors, m, t);
|
|
315
318
|
} catch (t) {
|
|
316
319
|
console.error(t);
|
|
317
320
|
} finally {
|
|
318
|
-
|
|
321
|
+
v(!1);
|
|
319
322
|
}
|
|
320
323
|
}, [
|
|
321
|
-
|
|
324
|
+
c,
|
|
322
325
|
e == null ? void 0 : e.id,
|
|
323
326
|
e == null ? void 0 : e.selectors,
|
|
324
327
|
e == null ? void 0 : e.onComplete,
|
|
325
328
|
e == null ? void 0 : e.timeout,
|
|
326
|
-
|
|
329
|
+
m
|
|
327
330
|
]);
|
|
328
331
|
if (e != null && e.action)
|
|
329
332
|
try {
|
|
330
|
-
return /* @__PURE__ */
|
|
333
|
+
return /* @__PURE__ */ r(ne, { open: !0, sx: { display: "flex", alignItems: "center", justifyContent: "center" }, onClose: l, children: /* @__PURE__ */ r(
|
|
331
334
|
ae,
|
|
332
335
|
{
|
|
333
336
|
sx: { maxHeight: "80%", maxWidth: "80%", height: "100%", px: 2, pt: 2, minWidth: "750px", overflow: "auto" },
|
|
334
337
|
children: /* @__PURE__ */ p(
|
|
335
|
-
|
|
338
|
+
a,
|
|
336
339
|
{
|
|
337
340
|
spacing: 1,
|
|
338
341
|
height: "100%",
|
|
@@ -343,75 +346,75 @@ const So = (e, l = 2e3) => {
|
|
|
343
346
|
}
|
|
344
347
|
},
|
|
345
348
|
children: [
|
|
346
|
-
/* @__PURE__ */ p(
|
|
347
|
-
/* @__PURE__ */ p(
|
|
349
|
+
/* @__PURE__ */ p(a, { direction: "row", spacing: 1, children: [
|
|
350
|
+
/* @__PURE__ */ p(a, { direction: "column", spacing: 1, children: [
|
|
348
351
|
/* @__PURE__ */ p(b, { variant: "h5", children: [
|
|
349
352
|
i("actions.executing"),
|
|
350
353
|
" ",
|
|
351
354
|
e == null ? void 0 : e.action.id.replace(/_/g, " ").split(" ").map(Eo).join(" ")
|
|
352
355
|
] }),
|
|
353
|
-
(e == null ? void 0 : e.action.summary) && /* @__PURE__ */
|
|
356
|
+
(e == null ? void 0 : e.action.summary) && /* @__PURE__ */ r(b, { variant: "body1", color: "text.secondary", sx: { pb: 1.5 }, children: e == null ? void 0 : e.action.summary })
|
|
354
357
|
] }),
|
|
355
|
-
/* @__PURE__ */
|
|
356
|
-
/* @__PURE__ */
|
|
358
|
+
/* @__PURE__ */ r(O, { flex: 1 }),
|
|
359
|
+
/* @__PURE__ */ r(O, { alignContent: "end", children: /* @__PURE__ */ r(
|
|
357
360
|
P,
|
|
358
361
|
{
|
|
359
362
|
variant: "outlined",
|
|
360
363
|
onClick: () => H((t) => !t),
|
|
361
|
-
startIcon: /* @__PURE__ */
|
|
364
|
+
startIcon: /* @__PURE__ */ r(
|
|
362
365
|
O,
|
|
363
366
|
{
|
|
364
367
|
component: "span",
|
|
365
368
|
sx: (t) => ({
|
|
366
369
|
transition: t.transitions.create("transform"),
|
|
367
|
-
transform:
|
|
370
|
+
transform: x ? "rotate(180deg)" : "rotate(0deg)"
|
|
368
371
|
}),
|
|
369
|
-
children: /* @__PURE__ */
|
|
372
|
+
children: /* @__PURE__ */ r(ue, { icon: "ic:baseline-keyboard-double-arrow-right" })
|
|
370
373
|
}
|
|
371
374
|
),
|
|
372
|
-
children: i(
|
|
375
|
+
children: i(x ? "actions.json.hide" : "actions.json.show")
|
|
373
376
|
}
|
|
374
377
|
) })
|
|
375
378
|
] }),
|
|
376
|
-
/* @__PURE__ */
|
|
377
|
-
/* @__PURE__ */
|
|
378
|
-
/* @__PURE__ */ p(
|
|
379
|
-
/* @__PURE__ */ p(
|
|
380
|
-
/* @__PURE__ */
|
|
379
|
+
/* @__PURE__ */ r(Z, { orientation: "horizontal", variant: "middle" }),
|
|
380
|
+
/* @__PURE__ */ r(O, { pt: 1.5 }),
|
|
381
|
+
/* @__PURE__ */ p(a, { flexGrow: 1, direction: "row", spacing: 1, children: [
|
|
382
|
+
/* @__PURE__ */ p(a, { direction: "column", flexGrow: 1, children: [
|
|
383
|
+
/* @__PURE__ */ r(z, { children: /* @__PURE__ */ r(
|
|
381
384
|
Pe,
|
|
382
385
|
{
|
|
383
|
-
schema:
|
|
386
|
+
schema: f,
|
|
384
387
|
uischema: T,
|
|
385
388
|
renderers: $o,
|
|
386
389
|
cells: Oe,
|
|
387
|
-
data:
|
|
388
|
-
onChange: ({ data: t, errors:
|
|
389
|
-
Te(t,
|
|
390
|
+
data: m,
|
|
391
|
+
onChange: ({ data: t, errors: y }) => {
|
|
392
|
+
Te(t, m) || h(t), n(y);
|
|
390
393
|
},
|
|
391
394
|
config: {}
|
|
392
395
|
}
|
|
393
396
|
) }),
|
|
394
|
-
/* @__PURE__ */ p(
|
|
395
|
-
/* @__PURE__ */
|
|
396
|
-
/* @__PURE__ */
|
|
397
|
-
/* @__PURE__ */
|
|
397
|
+
/* @__PURE__ */ p(a, { direction: "row", spacing: 1, pb: 1, children: [
|
|
398
|
+
/* @__PURE__ */ r("div", { style: { flex: 1 } }),
|
|
399
|
+
/* @__PURE__ */ r(P, { color: "error", variant: "outlined", onClick: l, children: i("cancel") }),
|
|
400
|
+
/* @__PURE__ */ r(
|
|
398
401
|
P,
|
|
399
402
|
{
|
|
400
403
|
color: "success",
|
|
401
404
|
variant: "outlined",
|
|
402
|
-
disabled:
|
|
405
|
+
disabled: o || (u == null ? void 0 : u.length) > 0,
|
|
403
406
|
onClick: F,
|
|
404
|
-
endIcon:
|
|
407
|
+
endIcon: o && /* @__PURE__ */ r(Ve, { color: "inherit", size: 18 }),
|
|
405
408
|
children: i("actions.execute")
|
|
406
409
|
}
|
|
407
410
|
)
|
|
408
411
|
] })
|
|
409
412
|
] }),
|
|
410
|
-
/* @__PURE__ */
|
|
411
|
-
/* @__PURE__ */
|
|
412
|
-
/* @__PURE__ */ p(
|
|
413
|
-
/* @__PURE__ */
|
|
414
|
-
/* @__PURE__ */
|
|
413
|
+
/* @__PURE__ */ r(qe, { orientation: "horizontal", in: x, unmountOnExit: !0, mountOnEnter: !0, children: /* @__PURE__ */ p(a, { direction: "row", height: "100%", spacing: 1, children: [
|
|
414
|
+
/* @__PURE__ */ r(Z, { orientation: "vertical" }),
|
|
415
|
+
/* @__PURE__ */ p(a, { children: [
|
|
416
|
+
/* @__PURE__ */ r(b, { variant: "h5", children: i("action.data") }),
|
|
417
|
+
/* @__PURE__ */ r(O, { width: 600, height: "100%", children: /* @__PURE__ */ r(Y, { data: m, slotProps: { stack: { height: "100%" }, json: { name: !1 } } }) })
|
|
415
418
|
] })
|
|
416
419
|
] }) })
|
|
417
420
|
] })
|
|
@@ -5,7 +5,7 @@ import "@mui/material";
|
|
|
5
5
|
import "../display/icons/Iconified.js";
|
|
6
6
|
import "../../index-DtRkeZWt.js";
|
|
7
7
|
import "../../hooks/ClueComponentContext.js";
|
|
8
|
-
import { A } from "../../ActionForm-
|
|
8
|
+
import { A } from "../../ActionForm-BRNLvDmk.js";
|
|
9
9
|
import "../../utils-C8TeL4oX.js";
|
|
10
10
|
import "react";
|
|
11
11
|
import "../../index-E7g8cRyW.js";
|
|
@@ -4,7 +4,7 @@ import "@mui/material";
|
|
|
4
4
|
import "../../index-DtRkeZWt.js";
|
|
5
5
|
import "../display/markdown/index.js";
|
|
6
6
|
import "../../hooks/ClueComponentContext.js";
|
|
7
|
-
import { R as u } from "../../ActionForm-
|
|
7
|
+
import { R as u } from "../../ActionForm-BRNLvDmk.js";
|
|
8
8
|
import "react";
|
|
9
9
|
import "../../index-E7g8cRyW.js";
|
|
10
10
|
import "../ClassificationChip.js";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsxs as y, Fragment as C, jsx as e } from "react/jsx-runtime";
|
|
2
2
|
import { useTheme as k, Tooltip as S, IconButton as E, CircularProgress as d, Button as z, Popover as I, Paper as j, Stack as c, Box as P, Typography as B, Divider as O } from "@mui/material";
|
|
3
3
|
import { useClueComponentSelector as T, useClueEnrichSelector as p } from "../../hooks/selectors.js";
|
|
4
|
-
import { c as w } from "../../ActionForm-
|
|
4
|
+
import { c as w } from "../../ActionForm-BRNLvDmk.js";
|
|
5
5
|
import { useState as m, useRef as M, useCallback as D, useEffect as F } from "react";
|
|
6
6
|
import g from "../display/icons/Iconified.js";
|
|
7
7
|
const J = ({ show: t = !1, size: b = "small", selector: n }) => {
|
|
@@ -6,7 +6,7 @@ import { SNACKBAR_EVENT_ID as w } from "../../data/event.js";
|
|
|
6
6
|
import { ClueGroupContext as j } from "../../hooks/ClueGroupContext.js";
|
|
7
7
|
import { useClueComponentSelector as A, useClueEnrichSelector as u } from "../../hooks/selectors.js";
|
|
8
8
|
import { safeDispatchEvent as B } from "../../utils/window.js";
|
|
9
|
-
import { c as F } from "../../ActionForm-
|
|
9
|
+
import { c as F } from "../../ActionForm-BRNLvDmk.js";
|
|
10
10
|
import { useState as d, useMemo as O, useCallback as T } from "react";
|
|
11
11
|
import { u as D } from "../../index-E7g8cRyW.js";
|
|
12
12
|
import G from "../actions/ExecutePopover.js";
|
|
@@ -2,7 +2,7 @@ import "react/jsx-runtime";
|
|
|
2
2
|
import "@mui/material";
|
|
3
3
|
import "../index-BXxfAxFt.js";
|
|
4
4
|
import "../useClueTypeConfig-D1DlRG7e.js";
|
|
5
|
-
import { a as d, C as f } from "../ActionForm-
|
|
5
|
+
import { a as d, C as f } from "../ActionForm-BRNLvDmk.js";
|
|
6
6
|
import "../components/display/icons/Iconified.js";
|
|
7
7
|
import "../components/ErrorBoundary.js";
|
|
8
8
|
import "../data/event.js";
|
package/hooks/ClueProvider.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as r } from "react/jsx-runtime";
|
|
2
|
-
import { C as i } from "../ActionForm-
|
|
2
|
+
import { C as i } from "../ActionForm-BRNLvDmk.js";
|
|
3
3
|
import { ClueComponentProvider as m } from "./ClueComponentContext.js";
|
|
4
4
|
import { ClueConfigProvider as n } from "./ClueConfigProvider.js";
|
|
5
5
|
import { ClueDatabaseProvider as t } from "./ClueDatabaseContext.js";
|
package/hooks/selectors.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as o } from "../ActionForm-
|
|
1
|
+
import { a as o } from "../ActionForm-BRNLvDmk.js";
|
|
2
2
|
import { ClueComponentContext as r } from "./ClueComponentContext.js";
|
|
3
3
|
import { C as n } from "../ClueEnrichContext-CCZCMklu.js";
|
|
4
4
|
import { ClueFetcherContext as u } from "./ClueFetcherContext.js";
|
package/hooks/useActionResult.js
CHANGED
package/hooks/useClueActions.js
CHANGED
package/icons/Action.js
CHANGED
|
@@ -3,7 +3,7 @@ import { I } from "../iconify-BBckr5AQ.js";
|
|
|
3
3
|
import { useTheme as j, Stack as i, Divider as l, Typography as C } from "@mui/material";
|
|
4
4
|
import R from "../components/CountBadge.js";
|
|
5
5
|
import { C as v } from "../AnnotationPreview-BUNr3hF2.js";
|
|
6
|
-
import { u as B } from "../ActionForm-
|
|
6
|
+
import { u as B } from "../ActionForm-BRNLvDmk.js";
|
|
7
7
|
import { g as D } from "../groupBy-IWYxSFLq.js";
|
|
8
8
|
import { memo as L, useRef as A, useMemo as s, useEffect as O } from "react";
|
|
9
9
|
import { u as M } from "../index-E7g8cRyW.js";
|
package/main.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { A as t, u as r } from "./ActionForm-
|
|
1
|
+
import { A as t, u as r } from "./ActionForm-BRNLvDmk.js";
|
|
2
2
|
import { default as f } from "./components/AnnotationDetailPopover.js";
|
|
3
3
|
import { A as n } from "./AnnotationDetails-BuzcQyAM.js";
|
|
4
4
|
import { default as p } from "./components/AnnotationEntry.js";
|