@cccsaurora/clue-ui 1.2.3 → 1.2.4-dev.278

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.
Files changed (188) hide show
  1. package/ActionForm-BdW0Za1y.js +5956 -0
  2. package/AnnotationDetails-BHZFzyt-.js +175 -0
  3. package/AnnotationPreview-DGoyoxRb.js +188 -0
  4. package/ClueEnrichContext-CJEJxrgs.js +541 -0
  5. package/FlexOne-BSYAhhtG.js +9 -0
  6. package/_MapCache-WmuDdwuH.js +222 -0
  7. package/_Uint8Array-B7JqpgFX.js +128 -0
  8. package/_baseAssignValue-CGTuELqU.js +25 -0
  9. package/_baseClone-CkNrTyhm.js +283 -0
  10. package/_baseExtremum-kob8QXyt.js +18 -0
  11. package/_baseFlatten-jIR_sN_-.js +92 -0
  12. package/_baseGet-Bx3A4Qfp.js +108 -0
  13. package/_baseIsEqual-C5OTWzTk.js +208 -0
  14. package/_baseIteratee-avi7MX2o.js +126 -0
  15. package/_baseSlice-GAv_YFTT.js +20 -0
  16. package/_baseSum-D0WC1dN0.js +13 -0
  17. package/_baseUniq-BI9GIHMF.js +115 -0
  18. package/_commonjsHelpers-DWwsNxpa.js +8 -0
  19. package/_createAggregator-QD8MzKwe.js +63 -0
  20. package/_getPrototype-CU0j_POw.js +5 -0
  21. package/_getTag-Ckxxfr88.js +126 -0
  22. package/_isIterateeCall-Ds3sw2SF.js +17 -0
  23. package/_setToArray-CaPKQhcz.js +33 -0
  24. package/cloneDeep-DJrLSw8W.js +8 -0
  25. package/components/AnnotationBody.js +49 -35
  26. package/components/AnnotationDetailPopover.js +36 -30
  27. package/components/AnnotationDetails.js +7 -7
  28. package/components/AnnotationEntry.js +35 -35
  29. package/components/AnnotationPreview.js +5 -5
  30. package/components/ClassificationChip.js +44 -23
  31. package/components/CountBadge.js +31 -26
  32. package/components/EnrichedCard.js +110 -97
  33. package/components/EnrichedChip.js +130 -105
  34. package/components/EnrichedTypography.js +133 -107
  35. package/components/ErrorBoundary.js +28 -24
  36. package/components/RetryFailedEnrichments.js +10 -9
  37. package/components/SourcePicker.js +57 -49
  38. package/components/actions/ActionForm.js +4 -4
  39. package/components/actions/ExecutePopover.js +75 -59
  40. package/components/actions/ResultModal.js +4 -4
  41. package/components/actions/form/schemaAdapter.js +39 -23
  42. package/components/actions/formats/FileResult.js +86 -59
  43. package/components/actions/formats/index.js +21 -10
  44. package/components/display/graph/ExpandMoreButton.js +10 -10
  45. package/components/display/graph/elements/NodeCard.js +111 -91
  46. package/components/display/graph/elements/NodeTag.js +15 -13
  47. package/components/display/graph/index.js +261 -202
  48. package/components/display/graph/visualizations/Leaf.js +88 -69
  49. package/components/display/graph/visualizations/cloud/index.js +98 -81
  50. package/components/display/graph/visualizations/icons/BaseIcon.js +26 -21
  51. package/components/display/graph/visualizations/icons/BugIcon.js +12 -12
  52. package/components/display/graph/visualizations/icons/HostIcon.js +12 -12
  53. package/components/display/graph/visualizations/icons/NetworkIcon.js +12 -12
  54. package/components/display/graph/visualizations/icons/ProcessIcon.js +12 -12
  55. package/components/display/graph/visualizations/icons/TargetIcon.js +13 -13
  56. package/components/display/graph/visualizations/icons/index.js +14 -13
  57. package/components/display/graph/visualizations/panels/NodePanel.js +10 -8
  58. package/components/display/graph/visualizations/tree/BundleLine.js +108 -81
  59. package/components/display/graph/visualizations/tree/Triangle.js +13 -13
  60. package/components/display/graph/visualizations/tree/index.js +408 -306
  61. package/components/display/icons/Iconified.js +27 -12
  62. package/components/display/json/index.js +4 -4
  63. package/components/display/markdown/index.js +8678 -5770
  64. package/components/enrichment/EnrichPopover.js +54 -46
  65. package/components/fetchers/Fetcher.js +158 -119
  66. package/components/fetchers/PreviewModal.js +20 -17
  67. package/components/fetchers/StatusChip.js +21 -17
  68. package/components/group/Entry.js +13 -11
  69. package/components/group/Group.js +13 -10
  70. package/components/group/GroupControl.js +76 -65
  71. package/components/stats/QueryStatus.js +43 -33
  72. package/countBy-c6S3dvSW.js +14 -0
  73. package/data/event.js +6 -4
  74. package/database/index.js +2 -2
  75. package/debounce-bV0h5FC5.js +92 -0
  76. package/en/translation.json +1 -1
  77. package/fr/translation.json +1 -1
  78. package/get-DSsNkRQs.js +8 -0
  79. package/groupBy-xqz-n0Vd.js +14 -0
  80. package/hooks/ClueActionContext.js +6 -6
  81. package/hooks/ClueComponentContext.js +29 -23
  82. package/hooks/ClueConfigProvider.js +14 -12
  83. package/hooks/ClueDatabaseContext.js +19 -13
  84. package/hooks/ClueEnrichContext.js +8 -8
  85. package/hooks/ClueFetcherContext.js +83 -56
  86. package/hooks/ClueGroupContext.js +17 -14
  87. package/hooks/CluePopupContext.js +5 -5
  88. package/hooks/ClueProvider.js +12 -10
  89. package/hooks/selectors.js +7 -7
  90. package/hooks/useActionResult.d.ts +1 -0
  91. package/hooks/useActionResult.js +4 -2
  92. package/hooks/useAnnotations.js +47 -31
  93. package/hooks/useClue.js +6 -4
  94. package/hooks/useClueActions.js +3 -3
  95. package/hooks/useClueConfig.js +6 -4
  96. package/hooks/useClueTypeConfig.js +3 -3
  97. package/hooks/useComparator.js +722 -435
  98. package/hooks/useErrors.js +22 -18
  99. package/hooks/useFetcherResult.d.ts +1 -0
  100. package/hooks/useFetcherResult.js +33 -24
  101. package/hooks/useMyHighlights.js +66 -36
  102. package/hooks/useMyLocalStorage.js +66 -37
  103. package/iconify-CXMreGTg.js +1782 -0
  104. package/icons/Action.js +66 -49
  105. package/icons/Assessment.js +85 -69
  106. package/icons/Context.js +77 -63
  107. package/icons/Opinion.js +76 -60
  108. package/icons/iconMap.js +2 -2
  109. package/identity-CPGTqrE4.js +6 -0
  110. package/index-AMfoEg_6.js +696 -0
  111. package/index-B6C2a_Lg.js +1172 -0
  112. package/index-C12gPw2W.js +17698 -0
  113. package/index-DCKkHTvx.js +15750 -0
  114. package/index-JcKyZeoY.js +465 -0
  115. package/isNil-CIubwp4T.js +6 -0
  116. package/isObject-FTY-5JQX.js +7 -0
  117. package/isObjectLike-OAgjjZye.js +48 -0
  118. package/isSymbol-Xd2FsJyp.js +8 -0
  119. package/last-CUCl67Im.js +7 -0
  120. package/main.js +60 -60
  121. package/maxBy-IKHzFrCS.js +8 -0
  122. package/package.json +1 -1
  123. package/sortBy-DfSj8IoJ.js +96 -0
  124. package/sumBy-D-hb_NY-.js +8 -0
  125. package/text/Frequency.js +42 -23
  126. package/toFinite-Bc55msYj.js +16 -0
  127. package/toNumber-DPxy1FBy.js +39 -0
  128. package/types/WithActionData.d.ts +2 -1
  129. package/useClueTypeConfig-Z1LFp01b.js +3289 -0
  130. package/utils/chain.js +92 -65
  131. package/utils/classificationParser.js +519 -256
  132. package/utils/constants.js +35 -10
  133. package/utils/graph.js +72 -45
  134. package/utils/hashUtil.js +7 -7
  135. package/utils/line.js +131 -81
  136. package/utils/loggerUtil.js +5 -3
  137. package/utils/sessionStorage.js +41 -27
  138. package/utils/time.js +423 -423
  139. package/utils/utils.js +9 -9
  140. package/utils/window.js +21 -10
  141. package/utils-HmNPuoDB.js +199 -0
  142. package/ActionForm-DlOXqMUx.js +0 -4460
  143. package/AnnotationDetails-Bk-p0F6h.js +0 -160
  144. package/AnnotationPreview-jzZvkCxJ.js +0 -140
  145. package/ClueEnrichContext-KqRuuWNS.js +0 -418
  146. package/FlexOne-BXWFOd1T.js +0 -6
  147. package/_MapCache-BiTi0iqu.js +0 -180
  148. package/_Uint8Array-BQNOM9Rr.js +0 -101
  149. package/_baseAssignValue-CNMLQZco.js +0 -20
  150. package/_baseClone-BnT-6pyM.js +0 -207
  151. package/_baseExtremum-Ca2EHgy2.js +0 -16
  152. package/_baseFlatten-Bfr_Molw.js +0 -72
  153. package/_baseGet-DSZygzyq.js +0 -79
  154. package/_baseIsEqual-VgvaAFZG.js +0 -147
  155. package/_baseIteratee-Dbfsw5z8.js +0 -95
  156. package/_baseSlice-M5RKzt1A.js +0 -10
  157. package/_baseSum-wEbgNeUs.js +0 -10
  158. package/_baseUniq-BJcj69PL.js +0 -79
  159. package/_commonjsHelpers-DaMA6jEr.js +0 -8
  160. package/_createAggregator-k3TuAnxT.js +0 -53
  161. package/_getPrototype-Cr1Mk7BC.js +0 -5
  162. package/_getTag-CK2Sffaq.js +0 -90
  163. package/_isIterateeCall-DkJP7Rbx.js +0 -13
  164. package/_setToArray-C7yMOeww.js +0 -29
  165. package/cloneDeep-CF8TtLHr.js +0 -8
  166. package/countBy-CdYegFSu.js +0 -8
  167. package/debounce-DryYcbJ4.js +0 -56
  168. package/get-CH7kz5Ix.js +0 -8
  169. package/groupBy-br8xmD2R.js +0 -8
  170. package/iconify-BBckr5AQ.js +0 -1263
  171. package/identity-ByMq8VxU.js +0 -6
  172. package/index-BHAe_V9n.js +0 -12768
  173. package/index-BK-zfYhR.js +0 -358
  174. package/index-CA5CUNZO.js +0 -975
  175. package/index-Dj5C04IX.js +0 -568
  176. package/index-p5_wX7q1.js +0 -11729
  177. package/isNil-CjWwlQS3.js +0 -6
  178. package/isObject-B53jY8Qg.js +0 -7
  179. package/isObjectLike-BatpeCIi.js +0 -29
  180. package/isSymbol-C3_SC0Qp.js +0 -8
  181. package/last-7CdUxN0r.js +0 -7
  182. package/maxBy-Bc0dYHcO.js +0 -8
  183. package/sortBy-DY2JBf9n.js +0 -75
  184. package/sumBy-DuMASLPd.js +0 -8
  185. package/toFinite-BMy6GObD.js +0 -14
  186. package/toNumber-YVhnnJv4.js +0 -31
  187. package/useClueTypeConfig-Ct9Ygter.js +0 -2292
  188. package/utils-DmwSUrum.js +0 -129
@@ -1,12 +1,13 @@
1
- import { jsx as n } from "react/jsx-runtime";
2
- import { Button as o } from "@mui/material";
3
- import { ClueComponentContext as i } from "../hooks/ClueComponentContext.js";
4
- import { b as c } from "../ActionForm-DlOXqMUx.js";
5
- import { u as m } from "../index-Dj5C04IX.js";
6
- const p = () => {
7
- const t = c((e) => e.enrichFailedEnrichments), { t: r } = m(i, (e) => e.i18next);
8
- return /* @__PURE__ */ n(o, { onClick: t, children: r("retry.enrich") });
1
+ import { jsx } from "react/jsx-runtime";
2
+ import { Button } from "@mui/material";
3
+ import { ClueComponentContext } from "../hooks/ClueComponentContext.js";
4
+ import { b as useClueEnrichSelector } from "../ActionForm-BdW0Za1y.js";
5
+ import { u as useContextSelector } from "../index-AMfoEg_6.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
- p as default
12
+ RetryFailedEnrichments as default
12
13
  };
@@ -1,90 +1,98 @@
1
- import { jsxs as n, Fragment as k, jsx as l } from "react/jsx-runtime";
2
- import { Button as v, Popover as w, TextField as z, Divider as _, Stack as F, FormControlLabel as d, Checkbox as m } from "@mui/material";
3
- import { d as E, b as a } from "../ActionForm-DlOXqMUx.js";
4
- import { memo as P, useState as g, useEffect as T } from "react";
5
- const L = () => {
6
- const { t: r } = E((e) => e.i18next), o = a((e) => e.availableSources), t = a((e) => e.sources), c = a((e) => e.setSources), [s, i] = g(null), [h, x] = g(), f = (e) => {
7
- i(e.currentTarget);
8
- }, C = () => {
9
- i(null);
1
+ import { jsxs, Fragment, jsx } from "react/jsx-runtime";
2
+ import { Button, Popover, TextField, Divider, Stack, FormControlLabel, Checkbox } from "@mui/material";
3
+ import { d as useClueComponentSelector, b as useClueEnrichSelector } from "../ActionForm-BdW0Za1y.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
- T(() => {
12
- c(o);
13
- }, [o]);
14
- const u = s ? "sources-popover" : void 0;
15
- return /* @__PURE__ */ n(k, { children: [
16
- /* @__PURE__ */ n(v, { "aria-describedby": u, variant: "outlined", onClick: f, children: [
17
- r("sources"),
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
- t.length === o.length ? r("all") : t.length,
26
+ sources.length === availableSources.length ? t("all") : sources.length,
20
27
  ")"
21
28
  ] }),
22
- /* @__PURE__ */ n(
23
- w,
29
+ /* @__PURE__ */ jsxs(
30
+ Popover,
24
31
  {
25
- id: u,
26
- open: !!s,
27
- anchorEl: s,
28
- onClose: C,
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__ */ l(
35
- z,
41
+ /* @__PURE__ */ jsx(
42
+ TextField,
36
43
  {
37
- fullWidth: !0,
44
+ fullWidth: true,
38
45
  sx: { p: 1, width: "350px" },
39
- placeholder: r("quicksearch.placeholder"),
40
- onChange: (e) => x(e.target.value.toLowerCase())
46
+ placeholder: t("quicksearch.placeholder"),
47
+ onChange: (event) => setSourceFilter(event.target.value.toLowerCase())
41
48
  }
42
49
  ),
43
- /* @__PURE__ */ l(_, { orientation: "horizontal" }),
44
- /* @__PURE__ */ n(F, { spacing: 0.5, m: 1, sx: { maxHeight: "500px", overflow: "auto" }, onClick: (e) => e.stopPropagation(), children: [
45
- /* @__PURE__ */ l(
46
- d,
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__ */ l(
49
- m,
55
+ control: /* @__PURE__ */ jsx(
56
+ Checkbox,
50
57
  {
51
58
  size: "small",
52
- checked: t.length === o.length,
59
+ checked: sources.length === availableSources.length,
53
60
  sx: { mr: 1 },
54
- onChange: (e, p) => {
55
- c(p ? o : []);
61
+ onChange: (__, checked) => {
62
+ setSources(checked ? availableSources : []);
56
63
  }
57
64
  }
58
65
  ),
59
- label: t.length < o.length ? r("sources.select.all") : r("sources.select.none"),
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
- o.filter((e) => !h || e.toLowerCase().includes(h)).map((e) => /* @__PURE__ */ l(
64
- d,
70
+ availableSources.filter((source) => !sourceFilter || source.toLowerCase().includes(sourceFilter)).map((source) => /* @__PURE__ */ jsx(
71
+ FormControlLabel,
65
72
  {
66
- control: /* @__PURE__ */ l(
67
- m,
73
+ control: /* @__PURE__ */ jsx(
74
+ Checkbox,
68
75
  {
69
76
  size: "small",
70
- checked: t.includes(e),
71
- onChange: (p, S) => {
72
- c(S ? [...t, e] : t.filter((b) => b !== e));
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: e.replace(/[_-]/g, " "),
84
+ label: source.replace(/[_-]/g, " "),
78
85
  sx: { whiteSpace: "nowrap", textTransform: "capitalize" }
79
86
  },
80
- e
87
+ source
81
88
  ))
82
89
  ] })
83
90
  ]
84
91
  }
85
92
  )
86
93
  ] });
87
- }, B = P(L);
94
+ };
95
+ const SourcePicker_default = memo(SourcePicker);
88
96
  export {
89
- B as default
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-BK-zfYhR.js";
6
+ import "../../index-JcKyZeoY.js";
7
7
  import "../../hooks/ClueComponentContext.js";
8
- import { A } from "../../ActionForm-DlOXqMUx.js";
9
- import "../../utils-DmwSUrum.js";
8
+ import { A } from "../../ActionForm-BdW0Za1y.js";
9
+ import "../../utils-HmNPuoDB.js";
10
10
  import "react";
11
- import "../../index-Dj5C04IX.js";
11
+ import "../../index-AMfoEg_6.js";
12
12
  import "../ErrorBoundary.js";
13
13
  import "./form/schemaAdapter.js";
14
14
  export {
@@ -1,104 +1,120 @@
1
- import { jsxs as s, Fragment as j, jsx as e } from "react/jsx-runtime";
2
- import { I as O } from "../../iconify-BBckr5AQ.js";
3
- import { useTheme as w, Tooltip as S, IconButton as z, CircularProgress as E, Button as D, Popover as M, Paper as B, Stack as l, Typography as I, Box as T, Divider as F } from "@mui/material";
4
- import h from "../display/icons/Iconified.js";
5
- import { ClueComponentContext as R } from "../../hooks/ClueComponentContext.js";
6
- import { a } from "../../ActionForm-DlOXqMUx.js";
7
- import W from "../../hooks/useClueConfig.js";
8
- import { isAccessible as q } from "../../utils/classificationParser.js";
9
- import { useState as G, useRef as H, useMemo as J, useEffect as P } from "react";
10
- import { u as K } from "../../index-Dj5C04IX.js";
11
- import L from "../ClassificationChip.js";
12
- const ie = ({ show: u = !1, size: _ = "small", selectors: i, multiples: x = !1 }) => {
13
- const { t: p } = K(R, (o) => o.i18next), g = w(), C = a((o) => o.availableActions), b = a((o) => o.refreshActions), y = a((o) => o.executeAction), f = a((o) => o.loading), { config: k } = W(), [m, r] = G(u), d = H(null), v = J(
1
+ import { jsxs, Fragment, jsx } from "react/jsx-runtime";
2
+ import { I as Icon } from "../../iconify-CXMreGTg.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 { a as useClueActionsSelector } from "../../ActionForm-BdW0Za1y.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 { u as useContextSelector } from "../../index-AMfoEg_6.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(C).filter(
16
- ([o, t]) => {
17
- var n;
18
- return (!((n = t.supported_types) != null && n.length) || i.every((c) => t.supported_types.includes(c == null ? void 0 : c.type))) && (!x || t.accept_multiple || i.length === 1) && i.every((c) => q(t.classification, c.classification, k.c12nDef));
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
- [C, k.c12nDef, x, i]
23
- ), A = Object.keys(v).length < 1 || f || i.length < 1;
24
- return P(() => {
25
- r(u);
26
- }, [u]), P(() => {
27
- m && b();
28
- }, [b, m]), /* @__PURE__ */ s(j, { children: [
29
- _ === "small" ? /* @__PURE__ */ e(S, { ref: d, title: p("actions.execute"), children: /* @__PURE__ */ e("span", { style: { alignSelf: "center" }, children: /* @__PURE__ */ e(z, { onClick: () => r(!0), disabled: A, color: "success", children: f ? /* @__PURE__ */ e(E, { color: "success", size: "24px" }) : /* @__PURE__ */ e(h, { icon: "ic:outline-play-arrow" }) }) }) }) : /* @__PURE__ */ e(
30
- D,
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: d,
46
+ ref: executeEl,
33
47
  variant: "outlined",
34
48
  color: "success",
35
- disabled: A,
36
- startIcon: f ? /* @__PURE__ */ e(E, { color: "success", size: "20px" }) : /* @__PURE__ */ e(h, { icon: "ic:outline-play-arrow" }),
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: () => r(!0),
39
- children: p("actions.execute")
52
+ onClick: () => setShowExecuteMenu(true),
53
+ children: t("actions.execute")
40
54
  }
41
55
  ),
42
- /* @__PURE__ */ e(
43
- M,
56
+ /* @__PURE__ */ jsx(
57
+ Popover,
44
58
  {
45
59
  sx: { zIndex: 2e3 },
46
- open: m,
47
- disablePortal: !0,
48
- onClose: () => r(!1),
49
- anchorEl: d.current,
60
+ open: showExecuteMenu,
61
+ disablePortal: true,
62
+ onClose: () => setShowExecuteMenu(false),
63
+ anchorEl: executeEl.current,
50
64
  anchorOrigin: { horizontal: "left", vertical: "bottom" },
51
- children: /* @__PURE__ */ e(B, { onClick: () => r(!1), children: /* @__PURE__ */ e(l, { divider: /* @__PURE__ */ e(F, { flexItem: !0, orientation: "horizontal" }), children: Object.entries(v).map(([o, t]) => /* @__PURE__ */ s(
52
- l,
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: g.transitions.create("background-color"),
60
- "&:hover": { backgroundColor: g.palette.background.default }
73
+ transition: theme.transitions.create("background-color"),
74
+ "&:hover": { backgroundColor: theme.palette.background.default }
61
75
  },
62
- onClick: (n) => {
63
- n.isPropagationStopped() || y(o, i);
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__ */ s(l, { flex: 1, children: [
70
- /* @__PURE__ */ s(l, { direction: "row", spacing: 1, alignItems: "center", children: [
71
- t.action_icon && /* @__PURE__ */ e(O, { icon: t.action_icon }),
72
- /* @__PURE__ */ e(I, { variant: "body1", children: t.name }),
73
- /* @__PURE__ */ e(L, { size: "small", classification: t.classification })
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
- t.summary && /* @__PURE__ */ e(I, { variant: "caption", color: "text.secondary", maxWidth: "300px", children: t.summary })
91
+ action.summary && /* @__PURE__ */ jsx(Typography, { variant: "caption", color: "text.secondary", maxWidth: "300px", children: action.summary })
76
92
  ] }),
77
- /* @__PURE__ */ e(
78
- T,
93
+ /* @__PURE__ */ jsx(
94
+ Box,
79
95
  {
80
96
  sx: { pl: 1 },
81
- onClick: (n) => {
82
- n.stopPropagation();
97
+ onClick: (ev) => {
98
+ ev.stopPropagation();
83
99
  },
84
- children: /* @__PURE__ */ e(S, { title: p("actions.execute.menu"), children: /* @__PURE__ */ e(
85
- z,
100
+ children: /* @__PURE__ */ jsx(Tooltip, { title: t("actions.execute.menu"), children: /* @__PURE__ */ jsx(
101
+ IconButton,
86
102
  {
87
103
  size: "small",
88
- onClick: () => y(o, i, null, { forceMenu: !0 }),
89
- children: /* @__PURE__ */ e(h, { icon: "ic:baseline-settings" })
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
- o
112
+ actionId
97
113
  )) }) })
98
114
  }
99
115
  )
100
116
  ] });
101
117
  };
102
118
  export {
103
- ie as default
119
+ ExecutePopover as default
104
120
  };
@@ -1,13 +1,13 @@
1
1
  import "react/jsx-runtime";
2
- import "../../iconify-BBckr5AQ.js";
2
+ import "../../iconify-CXMreGTg.js";
3
3
  import "@mui/material";
4
4
  import "../../hooks/ClueComponentContext.js";
5
- import { R as s } from "../../ActionForm-DlOXqMUx.js";
5
+ import { R } from "../../ActionForm-BdW0Za1y.js";
6
6
  import "react";
7
- import "../../index-Dj5C04IX.js";
7
+ import "../../index-AMfoEg_6.js";
8
8
  import "../ClassificationChip.js";
9
9
  import "../ErrorBoundary.js";
10
10
  import "./formats/index.js";
11
11
  export {
12
- s as default
12
+ R as default
13
13
  };
@@ -1,32 +1,48 @@
1
- import { c as y } from "../../../cloneDeep-CF8TtLHr.js";
2
- import { g as s } from "../../../get-CH7kz5Ix.js";
3
- const u = (i) => {
4
- const r = [], l = y(i), n = {
5
- ...l,
1
+ import { c as cloneDeep } from "../../../cloneDeep-DJrLSw8W.js";
2
+ import { g as get } from "../../../get-DSsNkRQs.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(l.properties ?? {}).filter(([t]) => !["raw_data", "selector", "selectors", "context"].includes(t)).map(([t, e]) => {
8
- var a, o;
9
- if (r.push(t), typeof e == "boolean")
10
- return [t, e];
11
- if (((a = e.anyOf) == null ? void 0 : a.length) === 2) {
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 (((o = e.allOf) == null ? void 0 : o.length) > 0 && typeof e.allOf[0] != "boolean" && e.allOf[0].$ref) {
17
- const p = {
18
- ...e,
19
- ...s(l, e.allOf[0].$ref.replace("#/", "").replaceAll("/", ".")),
20
- title: e.title
21
- };
22
- return delete p.allOf, [t, p];
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
- return [t, e];
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
- return n.required = r, n;
43
+ newSchema.required = requiredFields;
44
+ return newSchema;
29
45
  };
30
46
  export {
31
- u as adaptSchema
47
+ adaptSchema
32
48
  };