@cccsaurora/clue-ui 1.3.0 → 1.4.0-dev.424
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-CqKcnDWC.js +6099 -0
- package/AnnotationDetails-BlPd3T8k.js +176 -0
- package/AnnotationPreview-Bl447SKT.js +188 -0
- package/ClueEnrichContext-B3YrTCaJ.js +567 -0
- package/FlexOne-BSYAhhtG.js +9 -0
- package/_MapCache-kuEY_iOH.js +220 -0
- package/_Set-BrSMTlHn.js +6 -0
- package/_Uint8Array-OPpgYQj7.js +123 -0
- package/_arrayIncludes-BNqL-9ZP.js +31 -0
- package/_arrayPush-CBkQqaE_.js +10 -0
- package/_baseAssignValue-CNUVPOBW.js +16 -0
- package/_baseClone-9FaRd1R2.js +287 -0
- package/_baseExtremum-wOGT4Dgw.js +18 -0
- package/_baseFlatten-Co6QHDlG.js +92 -0
- package/_baseGet-Cmp6FztG.js +109 -0
- package/_baseGetTag-Hj-0NTYF.js +44 -0
- package/_baseIsEqual-1CpU47TZ.js +211 -0
- package/_baseIteratee-BN7Vbe5g.js +126 -0
- package/_baseRest-BZ_hQ9PC.js +8 -0
- package/_baseSlice-GAv_YFTT.js +20 -0
- package/_baseSum-D0WC1dN0.js +13 -0
- package/_baseUniq-BnvS3JHL.js +63 -0
- package/_cacheHas-_aF2y2Xv.js +25 -0
- package/_commonjsHelpers-CUmg6egw.js +6 -0
- package/_createAggregator-BUZrP_is.js +63 -0
- package/_defineProperty-DolZLKmv.js +12 -0
- package/_getPrototype-Bb4gm-5m.js +5 -0
- package/_getTag-CML_cXiN.js +105 -0
- package/_isIterateeCall-B1IFEqVv.js +17 -0
- package/_setToArray-CqyqC8ib.js +10 -0
- package/cloneDeep-l3UkXG5M.js +8 -0
- package/components/AnnotationBody.js +49 -35
- package/components/AnnotationDetailPopover.js +36 -30
- package/components/AnnotationDetails.js +7 -7
- package/components/AnnotationEntry.js +35 -35
- package/components/AnnotationPreview.js +5 -5
- package/components/ClassificationChip.js +44 -23
- package/components/CountBadge.js +31 -26
- package/components/EnrichedCard.js +110 -97
- package/components/EnrichedChip.js +130 -105
- package/components/EnrichedTypography.js +133 -107
- package/components/ErrorBoundary.js +28 -24
- package/components/RetryFailedEnrichments.js +10 -9
- package/components/SourcePicker.js +57 -49
- package/components/actions/ActionForm.js +4 -4
- package/components/actions/ExecutePopover.js +75 -59
- package/components/actions/ResultModal.js +4 -4
- package/components/actions/form/schemaAdapter.js +39 -23
- package/components/actions/formats/FileResult.js +86 -59
- package/components/actions/formats/index.js +29 -25
- package/components/display/graph/ExpandMoreButton.js +10 -10
- package/components/display/graph/elements/NodeCard.js +111 -91
- package/components/display/graph/elements/NodeTag.js +15 -13
- package/components/display/graph/index.js +261 -202
- package/components/display/graph/visualizations/Leaf.js +89 -70
- package/components/display/graph/visualizations/cloud/index.js +98 -81
- package/components/display/graph/visualizations/icons/BaseIcon.js +26 -21
- package/components/display/graph/visualizations/icons/BugIcon.js +12 -12
- package/components/display/graph/visualizations/icons/HostIcon.js +12 -12
- package/components/display/graph/visualizations/icons/NetworkIcon.js +12 -12
- package/components/display/graph/visualizations/icons/ProcessIcon.js +12 -12
- package/components/display/graph/visualizations/icons/TargetIcon.js +13 -13
- package/components/display/graph/visualizations/icons/index.js +14 -13
- package/components/display/graph/visualizations/panels/NodePanel.js +10 -8
- package/components/display/graph/visualizations/tree/BundleLine.js +108 -81
- package/components/display/graph/visualizations/tree/Triangle.js +13 -13
- package/components/display/graph/visualizations/tree/index.js +408 -306
- package/components/display/icons/Iconified.js +27 -12
- package/components/display/json/index.js +4 -4
- package/components/display/markdown/index.js +8678 -5770
- package/components/enrichment/EnrichPopover.js +54 -46
- package/components/fetchers/Fetcher.js +166 -123
- package/components/fetchers/FetcherResultView.js +31 -27
- package/components/fetchers/PreviewModal.js +17 -16
- package/components/fetchers/StatusChip.js +21 -17
- package/components/group/Entry.js +13 -11
- package/components/group/Group.js +13 -10
- package/components/group/GroupControl.js +76 -65
- package/components/stats/QueryStatus.js +45 -32
- package/countBy-Bqcp3VCs.js +14 -0
- package/data/event.js +6 -4
- package/database/globals.js +2 -2
- package/database/index.js +3 -3
- package/database/replication.js +4 -4
- package/get-CdMThM8x.js +8 -0
- package/groupBy-BVV07EGQ.js +14 -0
- package/hooks/ClueActionContext.js +6 -6
- package/hooks/ClueComponentContext.js +29 -23
- package/hooks/ClueConfigProvider.js +14 -12
- package/hooks/ClueDatabaseContext.js +35 -23
- package/hooks/ClueEnrichContext.js +11 -11
- package/hooks/ClueFetcherContext.js +83 -56
- package/hooks/ClueGroupContext.js +17 -14
- package/hooks/CluePopupContext.js +5 -5
- package/hooks/ClueProvider.js +13 -11
- package/hooks/ClueUIPluginContext.js +49 -35
- package/hooks/selectors.js +7 -7
- package/hooks/useActionResult.js +3 -3
- package/hooks/useAnnotations.js +48 -32
- package/hooks/useClue.js +6 -4
- package/hooks/useClueActions.js +3 -3
- package/hooks/useClueConfig.js +6 -4
- package/hooks/useClueTypeConfig.js +49 -24
- package/hooks/useClueUIPlugins.js +8 -7
- package/hooks/useComparator.js +722 -435
- package/hooks/useErrors.js +22 -18
- package/hooks/useFetcherResult.js +33 -24
- package/hooks/useMyHighlights.js +66 -36
- package/hooks/useMyLocalStorage.js +66 -37
- package/iconify-DJxl6dC-.js +1789 -0
- package/icons/Action.js +66 -49
- package/icons/Assessment.js +85 -69
- package/icons/Context.js +77 -63
- package/icons/Opinion.js +76 -60
- package/icons/iconMap.js +2 -2
- package/identity-CPGTqrE4.js +6 -0
- package/index-CAvu7vwt.js +1172 -0
- package/index-CVUD9o3t.js +15768 -0
- package/index-DUEubgWN.js +464 -0
- package/index-Dj1N4IQP.js +9314 -0
- package/index-DpJxD74E.js +3272 -0
- package/index-_gpzM2Px.js +702 -0
- package/isArguments-CuYlEuhP.js +27 -0
- package/isArray-RJPfgWqI.js +4 -0
- package/isEmpty-BE656RUK.js +30 -0
- package/isNil-CIubwp4T.js +6 -0
- package/isObject-FTY-5JQX.js +7 -0
- package/isObjectLike-CeENW9FN.js +6 -0
- package/isSymbol-D_H4HPZQ.js +9 -0
- package/last-CUCl67Im.js +7 -0
- package/main.js +62 -62
- package/maxBy-BjjQmX5t.js +8 -0
- package/package.json +1 -1
- package/plugins/ClueUIPlugin.js +163 -96
- package/plugins/file/index.js +15 -15
- package/plugins/graph/index.js +29 -26
- package/plugins/image/index.js +28 -24
- package/plugins/json/index.js +21 -21
- package/plugins/markdown/index.js +18 -18
- package/plugins/registry.js +6 -6
- package/plugins/store.js +4 -4
- package/plugins/test/index.js +17 -17
- package/plugins/utils.js +13 -12
- package/replication--gLEZw8a.js +11777 -0
- package/sessionStorage-B68y-wnE.js +140 -0
- package/sortBy-B8JVsLQY.js +95 -0
- package/store-B9sjQbcS.js +2163 -0
- package/sumBy-D-HCzM2i.js +8 -0
- package/text/Frequency.js +42 -23
- package/toFinite-meZTg4Su.js +16 -0
- package/toNumber-B5JaA1vX.js +39 -0
- package/uniq-CahZPAwp.js +7 -0
- package/utils/chain.js +92 -65
- package/utils/classificationParser.js +519 -256
- package/utils/constants.js +37 -11
- package/utils/graph.js +72 -45
- package/utils/hashUtil.js +7 -7
- package/utils/line.js +131 -81
- package/utils/loggerUtil.js +5 -3
- package/utils/sessionStorage.js +7 -7
- package/utils/time.js +447 -427
- package/utils/utils.js +10 -10
- package/utils/window.js +21 -10
- package/utils-CEySTPtg.js +224 -0
- package/ActionForm-CHOSKfvu.js +0 -4403
- package/AnnotationDetails-Bqq6Ymmg.js +0 -160
- package/AnnotationPreview-CqXmC-j8.js +0 -140
- package/ClueEnrichContext-DL6aGe1k.js +0 -432
- package/FlexOne-BXWFOd1T.js +0 -6
- package/_MapCache-DRK-s2eK.js +0 -179
- package/_Set-DrS_bbSV.js +0 -6
- package/_Uint8Array-D9R2N9Lp.js +0 -98
- package/_arrayIncludes-Dcl_29E6.js +0 -25
- package/_arrayPush-DBJIuK2V.js +0 -8
- package/_baseAssignValue-Bx1cxHj5.js +0 -12
- package/_baseClone-DRhywkxm.js +0 -211
- package/_baseExtremum-DodEaEyF.js +0 -16
- package/_baseFlatten-CD9NgrYE.js +0 -72
- package/_baseGet-bVwDaGrA.js +0 -80
- package/_baseGetTag-CxDaTem-.js +0 -25
- package/_baseIsEqual-C-FKsm1J.js +0 -150
- package/_baseIteratee-D0FhC5bC.js +0 -95
- package/_baseRest-D_eW2E0d.js +0 -8
- package/_baseSlice-M5RKzt1A.js +0 -10
- package/_baseSum-wEbgNeUs.js +0 -10
- package/_baseUniq-D3N8igOm.js +0 -41
- package/_cacheHas-Wgl-hw34.js +0 -22
- package/_commonjsHelpers-C6fGbg64.js +0 -6
- package/_createAggregator-BVj8IAuF.js +0 -53
- package/_defineProperty-BZU4WKA3.js +0 -11
- package/_getPrototype-BGBCg-aX.js +0 -5
- package/_getTag-B7R9qBo7.js +0 -73
- package/_isIterateeCall-Dm0VTAYy.js +0 -13
- package/_setToArray-Ck4YZu0Z.js +0 -9
- package/cloneDeep-fV59zwUf.js +0 -8
- package/countBy-B3rNuG4T.js +0 -8
- package/get-Bil3mzRD.js +0 -8
- package/groupBy-CrJC7sGa.js +0 -8
- package/iconify-Ptb5dTKy.js +0 -1270
- package/identity-ByMq8VxU.js +0 -6
- package/index-BH-gBhtO.js +0 -2282
- package/index-BM9Sve5T.js +0 -571
- package/index-Cj4d5cGz.js +0 -357
- package/index-Dh2PP9h8.js +0 -11747
- package/index-DoFpWPHo.js +0 -975
- package/index-DzVIklWY.js +0 -6464
- package/isArguments-BWcXOE6a.js +0 -24
- package/isArray-WzO_os3q.js +0 -4
- package/isEmpty-DKxrY-_M.js +0 -22
- package/isNil-CjWwlQS3.js +0 -6
- package/isObject-B53jY8Qg.js +0 -7
- package/isObjectLike-CYbdrIBr.js +0 -6
- package/isSymbol-DE1Kcy2M.js +0 -9
- package/last-7CdUxN0r.js +0 -7
- package/maxBy-BOWDkL_D.js +0 -8
- package/replication-WkKbPdwG.js +0 -8453
- package/sessionStorage-DFMae61b.js +0 -90
- package/sortBy-BHe812lF.js +0 -74
- package/store-DClHBq7r.js +0 -1169
- package/sumBy-B7f_bP_k.js +0 -8
- package/toFinite-CBrE65MP.js +0 -14
- package/toNumber-CxmWey0f.js +0 -31
- package/uniq-B4UZ671_.js +0 -7
- package/utils-SpTOhPYl.js +0 -147
|
@@ -1,12 +1,13 @@
|
|
|
1
|
-
import { jsx
|
|
2
|
-
import { Button
|
|
3
|
-
import { ClueComponentContext
|
|
4
|
-
import { f as
|
|
5
|
-
import { a as
|
|
6
|
-
const
|
|
7
|
-
const
|
|
8
|
-
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Button } from "@mui/material";
|
|
3
|
+
import { ClueComponentContext } from "../hooks/ClueComponentContext.js";
|
|
4
|
+
import { f as useClueEnrichSelector } from "../ActionForm-CqKcnDWC.js";
|
|
5
|
+
import { a as useContextSelector } from "../index-_gpzM2Px.js";
|
|
6
|
+
const RetryFailedEnrichments = () => {
|
|
7
|
+
const enrichFailedEnrichments = useClueEnrichSelector((ctx) => ctx.enrichFailedEnrichments);
|
|
8
|
+
const { t } = useContextSelector(ClueComponentContext, (ctx) => ctx.i18next);
|
|
9
|
+
return /* @__PURE__ */ jsx(Button, { onClick: enrichFailedEnrichments, children: t("retry.enrich") });
|
|
9
10
|
};
|
|
10
11
|
export {
|
|
11
|
-
|
|
12
|
+
RetryFailedEnrichments as default
|
|
12
13
|
};
|
|
@@ -1,90 +1,98 @@
|
|
|
1
|
-
import { jsxs
|
|
2
|
-
import { Button
|
|
3
|
-
import { e as
|
|
4
|
-
import { memo
|
|
5
|
-
const
|
|
6
|
-
const { t
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
1
|
+
import { jsxs, Fragment, jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Button, Popover, TextField, Divider, Stack, FormControlLabel, Checkbox } from "@mui/material";
|
|
3
|
+
import { e as useClueComponentSelector, f as useClueEnrichSelector } from "../ActionForm-CqKcnDWC.js";
|
|
4
|
+
import { memo, useState, useEffect } from "react";
|
|
5
|
+
const SourcePicker = () => {
|
|
6
|
+
const { t } = useClueComponentSelector((ctx) => ctx.i18next);
|
|
7
|
+
const availableSources = useClueEnrichSelector((state) => state.availableSources);
|
|
8
|
+
const sources = useClueEnrichSelector((state) => state.sources);
|
|
9
|
+
const setSources = useClueEnrichSelector((state) => state.setSources);
|
|
10
|
+
const [anchorEl, setAnchorEl] = useState(null);
|
|
11
|
+
const [sourceFilter, setSourceFilter] = useState();
|
|
12
|
+
const handleClick = (event) => {
|
|
13
|
+
setAnchorEl(event.currentTarget);
|
|
10
14
|
};
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
15
|
+
const handleClose = () => {
|
|
16
|
+
setAnchorEl(null);
|
|
17
|
+
};
|
|
18
|
+
useEffect(() => {
|
|
19
|
+
setSources(availableSources);
|
|
20
|
+
}, [availableSources]);
|
|
21
|
+
const id = !!anchorEl ? "sources-popover" : void 0;
|
|
22
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
23
|
+
/* @__PURE__ */ jsxs(Button, { "aria-describedby": id, variant: "outlined", onClick: handleClick, children: [
|
|
24
|
+
t("sources"),
|
|
18
25
|
" (",
|
|
19
|
-
|
|
26
|
+
sources.length === availableSources.length ? t("all") : sources.length,
|
|
20
27
|
")"
|
|
21
28
|
] }),
|
|
22
|
-
/* @__PURE__ */
|
|
23
|
-
|
|
29
|
+
/* @__PURE__ */ jsxs(
|
|
30
|
+
Popover,
|
|
24
31
|
{
|
|
25
|
-
id
|
|
26
|
-
open: !!
|
|
27
|
-
anchorEl
|
|
28
|
-
onClose:
|
|
32
|
+
id,
|
|
33
|
+
open: !!anchorEl,
|
|
34
|
+
anchorEl,
|
|
35
|
+
onClose: handleClose,
|
|
29
36
|
anchorOrigin: {
|
|
30
37
|
vertical: "bottom",
|
|
31
38
|
horizontal: "left"
|
|
32
39
|
},
|
|
33
40
|
children: [
|
|
34
|
-
/* @__PURE__ */
|
|
35
|
-
|
|
41
|
+
/* @__PURE__ */ jsx(
|
|
42
|
+
TextField,
|
|
36
43
|
{
|
|
37
|
-
fullWidth:
|
|
44
|
+
fullWidth: true,
|
|
38
45
|
sx: { p: 1, width: "350px" },
|
|
39
|
-
placeholder:
|
|
40
|
-
onChange: (
|
|
46
|
+
placeholder: t("quicksearch.placeholder"),
|
|
47
|
+
onChange: (event) => setSourceFilter(event.target.value.toLowerCase())
|
|
41
48
|
}
|
|
42
49
|
),
|
|
43
|
-
/* @__PURE__ */
|
|
44
|
-
/* @__PURE__ */
|
|
45
|
-
/* @__PURE__ */
|
|
46
|
-
|
|
50
|
+
/* @__PURE__ */ jsx(Divider, { orientation: "horizontal" }),
|
|
51
|
+
/* @__PURE__ */ jsxs(Stack, { spacing: 0.5, m: 1, sx: { maxHeight: "500px", overflow: "auto" }, onClick: (e) => e.stopPropagation(), children: [
|
|
52
|
+
/* @__PURE__ */ jsx(
|
|
53
|
+
FormControlLabel,
|
|
47
54
|
{
|
|
48
|
-
control: /* @__PURE__ */
|
|
49
|
-
|
|
55
|
+
control: /* @__PURE__ */ jsx(
|
|
56
|
+
Checkbox,
|
|
50
57
|
{
|
|
51
58
|
size: "small",
|
|
52
|
-
checked:
|
|
59
|
+
checked: sources.length === availableSources.length,
|
|
53
60
|
sx: { mr: 1 },
|
|
54
|
-
onChange: (
|
|
55
|
-
|
|
61
|
+
onChange: (__, checked) => {
|
|
62
|
+
setSources(checked ? availableSources : []);
|
|
56
63
|
}
|
|
57
64
|
}
|
|
58
65
|
),
|
|
59
|
-
label:
|
|
66
|
+
label: sources.length < availableSources.length ? t("sources.select.all") : t("sources.select.none"),
|
|
60
67
|
sx: { whiteSpace: "nowrap", textTransform: "capitalize" }
|
|
61
68
|
}
|
|
62
69
|
),
|
|
63
|
-
|
|
64
|
-
|
|
70
|
+
availableSources.filter((source) => !sourceFilter || source.toLowerCase().includes(sourceFilter)).map((source) => /* @__PURE__ */ jsx(
|
|
71
|
+
FormControlLabel,
|
|
65
72
|
{
|
|
66
|
-
control: /* @__PURE__ */
|
|
67
|
-
|
|
73
|
+
control: /* @__PURE__ */ jsx(
|
|
74
|
+
Checkbox,
|
|
68
75
|
{
|
|
69
76
|
size: "small",
|
|
70
|
-
checked:
|
|
71
|
-
onChange: (
|
|
72
|
-
|
|
77
|
+
checked: sources.includes(source),
|
|
78
|
+
onChange: (__, checked) => {
|
|
79
|
+
setSources(checked ? [...sources, source] : sources.filter((src) => src !== source));
|
|
73
80
|
},
|
|
74
81
|
sx: { mr: 1 }
|
|
75
82
|
}
|
|
76
83
|
),
|
|
77
|
-
label:
|
|
84
|
+
label: source.replace(/[_-]/g, " "),
|
|
78
85
|
sx: { whiteSpace: "nowrap", textTransform: "capitalize" }
|
|
79
86
|
},
|
|
80
|
-
|
|
87
|
+
source
|
|
81
88
|
))
|
|
82
89
|
] })
|
|
83
90
|
]
|
|
84
91
|
}
|
|
85
92
|
)
|
|
86
93
|
] });
|
|
87
|
-
}
|
|
94
|
+
};
|
|
95
|
+
const SourcePicker_default = memo(SourcePicker);
|
|
88
96
|
export {
|
|
89
|
-
|
|
97
|
+
SourcePicker_default as default
|
|
90
98
|
};
|
|
@@ -3,12 +3,12 @@ import "@jsonforms/material-renderers";
|
|
|
3
3
|
import "@jsonforms/react";
|
|
4
4
|
import "@mui/material";
|
|
5
5
|
import "../display/icons/Iconified.js";
|
|
6
|
-
import "../../index-
|
|
6
|
+
import "../../index-DUEubgWN.js";
|
|
7
7
|
import "../../hooks/ClueComponentContext.js";
|
|
8
|
-
import { A } from "../../ActionForm-
|
|
9
|
-
import "../../utils-
|
|
8
|
+
import { A } from "../../ActionForm-CqKcnDWC.js";
|
|
9
|
+
import "../../utils-CEySTPtg.js";
|
|
10
10
|
import "react";
|
|
11
|
-
import "../../index-
|
|
11
|
+
import "../../index-_gpzM2Px.js";
|
|
12
12
|
import "../ErrorBoundary.js";
|
|
13
13
|
import "./form/schemaAdapter.js";
|
|
14
14
|
export {
|
|
@@ -1,104 +1,120 @@
|
|
|
1
|
-
import { jsxs
|
|
2
|
-
import { I as
|
|
3
|
-
import { useTheme
|
|
4
|
-
import
|
|
5
|
-
import { ClueComponentContext
|
|
6
|
-
import { d as
|
|
7
|
-
import
|
|
8
|
-
import { isAccessible
|
|
9
|
-
import { useState
|
|
10
|
-
import { a as
|
|
11
|
-
import
|
|
12
|
-
const
|
|
13
|
-
const { t
|
|
1
|
+
import { jsxs, Fragment, jsx } from "react/jsx-runtime";
|
|
2
|
+
import { I as Icon } from "../../iconify-DJxl6dC-.js";
|
|
3
|
+
import { useTheme, Tooltip, IconButton, CircularProgress, Button, Popover, Paper, Stack, Typography, Box, Divider } from "@mui/material";
|
|
4
|
+
import Iconified from "../display/icons/Iconified.js";
|
|
5
|
+
import { ClueComponentContext } from "../../hooks/ClueComponentContext.js";
|
|
6
|
+
import { d as useClueActionsSelector } from "../../ActionForm-CqKcnDWC.js";
|
|
7
|
+
import useClueConfig from "../../hooks/useClueConfig.js";
|
|
8
|
+
import { isAccessible } from "../../utils/classificationParser.js";
|
|
9
|
+
import { useState, useRef, useMemo, useEffect } from "react";
|
|
10
|
+
import { a as useContextSelector } from "../../index-_gpzM2Px.js";
|
|
11
|
+
import ClassificationChip from "../ClassificationChip.js";
|
|
12
|
+
const ExecutePopover = ({ show = false, size = "small", selectors, multiples = false }) => {
|
|
13
|
+
const { t } = useContextSelector(ClueComponentContext, (ctx) => ctx.i18next);
|
|
14
|
+
const theme = useTheme();
|
|
15
|
+
const availableActions = useClueActionsSelector((ctx) => ctx.availableActions);
|
|
16
|
+
const refreshActions = useClueActionsSelector((ctx) => ctx.refreshActions);
|
|
17
|
+
const executeAction = useClueActionsSelector((ctx) => ctx.executeAction);
|
|
18
|
+
const loading = useClueActionsSelector((ctx) => ctx.loading);
|
|
19
|
+
const { config } = useClueConfig();
|
|
20
|
+
const [showExecuteMenu, setShowExecuteMenu] = useState(show);
|
|
21
|
+
const executeEl = useRef(null);
|
|
22
|
+
const actions = useMemo(
|
|
14
23
|
() => Object.fromEntries(
|
|
15
|
-
Object.entries(
|
|
16
|
-
([
|
|
17
|
-
var
|
|
18
|
-
return (!((
|
|
24
|
+
Object.entries(availableActions).filter(
|
|
25
|
+
([__, action]) => {
|
|
26
|
+
var _a;
|
|
27
|
+
return (!((_a = action.supported_types) == null ? void 0 : _a.length) || selectors.every((value) => action.supported_types.includes(value == null ? void 0 : value.type))) && (!multiples || action.accept_multiple || selectors.length === 1) && selectors.every((value) => isAccessible(action.classification, value.classification, config.c12nDef));
|
|
19
28
|
}
|
|
20
29
|
)
|
|
21
30
|
),
|
|
22
|
-
[
|
|
23
|
-
)
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
+
[availableActions, config.c12nDef, multiples, selectors]
|
|
32
|
+
);
|
|
33
|
+
const actionDisabled = Object.keys(actions).length < 1 || loading || selectors.length < 1;
|
|
34
|
+
useEffect(() => {
|
|
35
|
+
setShowExecuteMenu(show);
|
|
36
|
+
}, [show]);
|
|
37
|
+
useEffect(() => {
|
|
38
|
+
if (showExecuteMenu) {
|
|
39
|
+
refreshActions();
|
|
40
|
+
}
|
|
41
|
+
}, [refreshActions, showExecuteMenu]);
|
|
42
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
43
|
+
size === "small" ? /* @__PURE__ */ jsx(Tooltip, { ref: executeEl, title: t("actions.execute"), children: /* @__PURE__ */ jsx("span", { style: { alignSelf: "center" }, children: /* @__PURE__ */ jsx(IconButton, { onClick: () => setShowExecuteMenu(true), disabled: actionDisabled, color: "success", children: loading ? /* @__PURE__ */ jsx(CircularProgress, { color: "success", size: "24px" }) : /* @__PURE__ */ jsx(Iconified, { icon: "ic:outline-play-arrow" }) }) }) }) : /* @__PURE__ */ jsx(
|
|
44
|
+
Button,
|
|
31
45
|
{
|
|
32
|
-
ref:
|
|
46
|
+
ref: executeEl,
|
|
33
47
|
variant: "outlined",
|
|
34
48
|
color: "success",
|
|
35
|
-
disabled:
|
|
36
|
-
startIcon:
|
|
49
|
+
disabled: actionDisabled,
|
|
50
|
+
startIcon: loading ? /* @__PURE__ */ jsx(CircularProgress, { color: "success", size: "20px" }) : /* @__PURE__ */ jsx(Iconified, { icon: "ic:outline-play-arrow" }),
|
|
37
51
|
sx: { alignSelf: "stretch" },
|
|
38
|
-
onClick: () =>
|
|
39
|
-
children:
|
|
52
|
+
onClick: () => setShowExecuteMenu(true),
|
|
53
|
+
children: t("actions.execute")
|
|
40
54
|
}
|
|
41
55
|
),
|
|
42
|
-
/* @__PURE__ */
|
|
43
|
-
|
|
56
|
+
/* @__PURE__ */ jsx(
|
|
57
|
+
Popover,
|
|
44
58
|
{
|
|
45
59
|
sx: { zIndex: 2e3 },
|
|
46
|
-
open:
|
|
47
|
-
disablePortal:
|
|
48
|
-
onClose: () =>
|
|
49
|
-
anchorEl:
|
|
60
|
+
open: showExecuteMenu,
|
|
61
|
+
disablePortal: true,
|
|
62
|
+
onClose: () => setShowExecuteMenu(false),
|
|
63
|
+
anchorEl: executeEl.current,
|
|
50
64
|
anchorOrigin: { horizontal: "left", vertical: "bottom" },
|
|
51
|
-
children: /* @__PURE__ */
|
|
52
|
-
|
|
65
|
+
children: /* @__PURE__ */ jsx(Paper, { onClick: () => setShowExecuteMenu(false), children: /* @__PURE__ */ jsx(Stack, { divider: /* @__PURE__ */ jsx(Divider, { flexItem: true, orientation: "horizontal" }), children: Object.entries(actions).map(([actionId, action]) => /* @__PURE__ */ jsxs(
|
|
66
|
+
Stack,
|
|
53
67
|
{
|
|
54
68
|
sx: {
|
|
55
69
|
pl: 3,
|
|
56
70
|
pr: 2,
|
|
57
71
|
py: 1,
|
|
58
72
|
cursor: "pointer",
|
|
59
|
-
transition:
|
|
60
|
-
"&:hover": { backgroundColor:
|
|
73
|
+
transition: theme.transitions.create("background-color"),
|
|
74
|
+
"&:hover": { backgroundColor: theme.palette.background.default }
|
|
61
75
|
},
|
|
62
|
-
onClick: (
|
|
63
|
-
|
|
76
|
+
onClick: (ev) => {
|
|
77
|
+
if (!ev.isPropagationStopped()) {
|
|
78
|
+
executeAction(actionId, selectors);
|
|
79
|
+
}
|
|
64
80
|
},
|
|
65
81
|
direction: "row",
|
|
66
82
|
spacing: 1,
|
|
67
83
|
alignItems: "center",
|
|
68
84
|
children: [
|
|
69
|
-
/* @__PURE__ */
|
|
70
|
-
/* @__PURE__ */
|
|
71
|
-
|
|
72
|
-
/* @__PURE__ */
|
|
73
|
-
/* @__PURE__ */
|
|
85
|
+
/* @__PURE__ */ jsxs(Stack, { flex: 1, children: [
|
|
86
|
+
/* @__PURE__ */ jsxs(Stack, { direction: "row", spacing: 1, alignItems: "center", children: [
|
|
87
|
+
action.action_icon && /* @__PURE__ */ jsx(Icon, { icon: action.action_icon }),
|
|
88
|
+
/* @__PURE__ */ jsx(Typography, { variant: "body1", children: action.name }),
|
|
89
|
+
/* @__PURE__ */ jsx(ClassificationChip, { size: "small", classification: action.classification })
|
|
74
90
|
] }),
|
|
75
|
-
|
|
91
|
+
action.summary && /* @__PURE__ */ jsx(Typography, { variant: "caption", color: "text.secondary", maxWidth: "300px", children: action.summary })
|
|
76
92
|
] }),
|
|
77
|
-
/* @__PURE__ */
|
|
78
|
-
|
|
93
|
+
/* @__PURE__ */ jsx(
|
|
94
|
+
Box,
|
|
79
95
|
{
|
|
80
96
|
sx: { pl: 1 },
|
|
81
|
-
onClick: (
|
|
82
|
-
|
|
97
|
+
onClick: (ev) => {
|
|
98
|
+
ev.stopPropagation();
|
|
83
99
|
},
|
|
84
|
-
children: /* @__PURE__ */
|
|
85
|
-
|
|
100
|
+
children: /* @__PURE__ */ jsx(Tooltip, { title: t("actions.execute.menu"), children: /* @__PURE__ */ jsx(
|
|
101
|
+
IconButton,
|
|
86
102
|
{
|
|
87
103
|
size: "small",
|
|
88
|
-
onClick: () =>
|
|
89
|
-
children: /* @__PURE__ */
|
|
104
|
+
onClick: () => executeAction(actionId, selectors, null, { forceMenu: true }),
|
|
105
|
+
children: /* @__PURE__ */ jsx(Iconified, { icon: "ic:baseline-settings" })
|
|
90
106
|
}
|
|
91
107
|
) })
|
|
92
108
|
}
|
|
93
109
|
)
|
|
94
110
|
]
|
|
95
111
|
},
|
|
96
|
-
|
|
112
|
+
actionId
|
|
97
113
|
)) }) })
|
|
98
114
|
}
|
|
99
115
|
)
|
|
100
116
|
] });
|
|
101
117
|
};
|
|
102
118
|
export {
|
|
103
|
-
|
|
119
|
+
ExecutePopover as default
|
|
104
120
|
};
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import "react/jsx-runtime";
|
|
2
|
-
import "../../iconify-
|
|
2
|
+
import "../../iconify-DJxl6dC-.js";
|
|
3
3
|
import "@mui/material";
|
|
4
4
|
import "../../hooks/ClueComponentContext.js";
|
|
5
|
-
import { R
|
|
5
|
+
import { R } from "../../ActionForm-CqKcnDWC.js";
|
|
6
6
|
import "react";
|
|
7
|
-
import "../../index-
|
|
7
|
+
import "../../index-_gpzM2Px.js";
|
|
8
8
|
import "../ClassificationChip.js";
|
|
9
9
|
import "../ErrorBoundary.js";
|
|
10
10
|
import "./formats/index.js";
|
|
11
11
|
export {
|
|
12
|
-
|
|
12
|
+
R as default
|
|
13
13
|
};
|
|
@@ -1,32 +1,48 @@
|
|
|
1
|
-
import { c as
|
|
2
|
-
import { g as
|
|
3
|
-
const
|
|
4
|
-
const
|
|
5
|
-
|
|
1
|
+
import { c as cloneDeep } from "../../../cloneDeep-l3UkXG5M.js";
|
|
2
|
+
import { g as get } from "../../../get-CdMThM8x.js";
|
|
3
|
+
const adaptSchema = (_schema) => {
|
|
4
|
+
const requiredFields = [];
|
|
5
|
+
const schema = cloneDeep(_schema);
|
|
6
|
+
const newSchema = {
|
|
7
|
+
...schema,
|
|
6
8
|
properties: Object.fromEntries(
|
|
7
|
-
Object.entries(
|
|
8
|
-
var
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
if (typeof e.anyOf[1] == "boolean")
|
|
13
|
-
return [t, e];
|
|
14
|
-
e.anyOf[1].type === "null" && typeof e.anyOf[0] != "boolean" && (e.anyOf[0].enum && (e.enum = e.anyOf[0].enum), e.type = [...Array.isArray(e.anyOf[0].type) ? e.anyOf[0].type : [e.anyOf[0].type], "null"], delete e.anyOf, r.pop());
|
|
9
|
+
Object.entries(schema.properties ?? {}).filter(([name]) => !["raw_data", "selector", "selectors", "context"].includes(name)).map(([name, def]) => {
|
|
10
|
+
var _a, _b;
|
|
11
|
+
requiredFields.push(name);
|
|
12
|
+
if (typeof def === "boolean") {
|
|
13
|
+
return [name, def];
|
|
15
14
|
}
|
|
16
|
-
if (((
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
15
|
+
if (((_a = def.anyOf) == null ? void 0 : _a.length) === 2) {
|
|
16
|
+
if (typeof def.anyOf[1] === "boolean") {
|
|
17
|
+
return [name, def];
|
|
18
|
+
}
|
|
19
|
+
if (def.anyOf[1].type === "null" && typeof def.anyOf[0] !== "boolean") {
|
|
20
|
+
if (def.anyOf[0].enum) {
|
|
21
|
+
def.enum = def.anyOf[0].enum;
|
|
22
|
+
}
|
|
23
|
+
def.type = [...Array.isArray(def.anyOf[0].type) ? def.anyOf[0].type : [def.anyOf[0].type], "null"];
|
|
24
|
+
delete def.anyOf;
|
|
25
|
+
requiredFields.pop();
|
|
26
|
+
}
|
|
23
27
|
}
|
|
24
|
-
|
|
28
|
+
if (((_b = def.allOf) == null ? void 0 : _b.length) > 0) {
|
|
29
|
+
if (typeof def.allOf[0] !== "boolean" && def.allOf[0].$ref) {
|
|
30
|
+
const newDef = {
|
|
31
|
+
...def,
|
|
32
|
+
...get(schema, def.allOf[0].$ref.replace("#/", "").replaceAll("/", ".")),
|
|
33
|
+
title: def.title
|
|
34
|
+
};
|
|
35
|
+
delete newDef.allOf;
|
|
36
|
+
return [name, newDef];
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
return [name, def];
|
|
25
40
|
})
|
|
26
41
|
)
|
|
27
42
|
};
|
|
28
|
-
|
|
43
|
+
newSchema.required = requiredFields;
|
|
44
|
+
return newSchema;
|
|
29
45
|
};
|
|
30
46
|
export {
|
|
31
|
-
|
|
47
|
+
adaptSchema
|
|
32
48
|
};
|