@cccsaurora/clue-ui 1.1.0-dev.52 → 1.1.0-dev.55
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/components/EnrichedCard.js +10 -4
- package/components/EnrichedChip.js +3 -9
- package/components/EnrichedTypography.js +6 -11
- package/components/actions/ActionForm.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.d.ts +4 -4
- package/hooks/selectors.js +2 -2
- package/hooks/useClueActions.d.ts +1 -1
- package/hooks/useClueActions.js +1 -1
- package/icons/Action.js +1 -1
- package/main.js +1 -1
- package/package.json +1 -1
- package/{ActionForm-oiPSbHip.js → ActionForm-BnJ5oGNK.js} +1 -1
|
@@ -14,6 +14,8 @@ import { u as uniq } from "../ClueEnrichContext-C4hjLcHp.js";
|
|
|
14
14
|
import { memo, useState, useMemo, useCallback } from "react";
|
|
15
15
|
import { u as useContextSelector } from "../index-BDVjGvMI.js";
|
|
16
16
|
import AnnotationEntry from "./AnnotationEntry.js";
|
|
17
|
+
import ExecutePopover from "./actions/ExecutePopover.js";
|
|
18
|
+
import EnrichPopover from "./enrichment/EnrichPopover.js";
|
|
17
19
|
const EnrichedCard = ({
|
|
18
20
|
type,
|
|
19
21
|
value,
|
|
@@ -34,6 +36,7 @@ const EnrichedCard = ({
|
|
|
34
36
|
);
|
|
35
37
|
const [annotations, loading] = useAnnotations(type, value, classification);
|
|
36
38
|
const errors = useErrors(value);
|
|
39
|
+
const enrichRequest = { type, value, classification };
|
|
37
40
|
const options = useMemo(() => ["all", ...uniq(annotations.map((annotation) => annotation.type))], [annotations]);
|
|
38
41
|
const forceEnrich = useCallback(() => {
|
|
39
42
|
return enrich(type, value, {
|
|
@@ -61,7 +64,7 @@ const EnrichedCard = ({
|
|
|
61
64
|
/* @__PURE__ */ jsx(
|
|
62
65
|
AssessmentIcon,
|
|
63
66
|
{
|
|
64
|
-
value:
|
|
67
|
+
value: enrichRequest,
|
|
65
68
|
annotations,
|
|
66
69
|
counters,
|
|
67
70
|
fontSize: "1em",
|
|
@@ -71,7 +74,7 @@ const EnrichedCard = ({
|
|
|
71
74
|
/* @__PURE__ */ jsx(
|
|
72
75
|
OpinionIcon,
|
|
73
76
|
{
|
|
74
|
-
value:
|
|
77
|
+
value: enrichRequest,
|
|
75
78
|
annotations,
|
|
76
79
|
counters,
|
|
77
80
|
fontSize: "1em",
|
|
@@ -81,7 +84,7 @@ const EnrichedCard = ({
|
|
|
81
84
|
/* @__PURE__ */ jsx(
|
|
82
85
|
ContextIcon,
|
|
83
86
|
{
|
|
84
|
-
value:
|
|
87
|
+
value: enrichRequest,
|
|
85
88
|
annotations,
|
|
86
89
|
counters,
|
|
87
90
|
showExtraIcon: contextIcon,
|
|
@@ -89,7 +92,10 @@ const EnrichedCard = ({
|
|
|
89
92
|
disableTooltip: true
|
|
90
93
|
}
|
|
91
94
|
),
|
|
92
|
-
loading && !hideLoading && /* @__PURE__ */ jsx(CircularProgress, { color: "primary", size: 18 })
|
|
95
|
+
loading && !hideLoading && /* @__PURE__ */ jsx(CircularProgress, { color: "primary", size: 18 }),
|
|
96
|
+
/* @__PURE__ */ jsx("div", { style: { flex: 1 } }),
|
|
97
|
+
/* @__PURE__ */ jsx(EnrichPopover, { selector: enrichRequest }),
|
|
98
|
+
/* @__PURE__ */ jsx(ExecutePopover, { selectors: [enrichRequest] })
|
|
93
99
|
] })
|
|
94
100
|
}
|
|
95
101
|
),
|
|
@@ -55,21 +55,15 @@ const EnrichedChip = React__default.memo(
|
|
|
55
55
|
return options;
|
|
56
56
|
}, [setForceDetails, slotProps.popover]);
|
|
57
57
|
const clicker = useMemo(
|
|
58
|
-
() => !
|
|
58
|
+
() => !hideDetails || useDetailsIcon ? (e) => {
|
|
59
59
|
var _a;
|
|
60
60
|
showInfo("details", anchorRef.current, { type, value, classification }, buildOptions());
|
|
61
61
|
(_a = otherProps.onClick) == null ? void 0 : _a.call(otherProps, e);
|
|
62
62
|
e.stopPropagation();
|
|
63
63
|
e.preventDefault();
|
|
64
|
-
} : otherProps.onClick
|
|
65
|
-
// We need to give a dummy callback when loading so the popover doesn't get confused
|
|
66
|
-
(e) => {
|
|
67
|
-
var _a;
|
|
68
|
-
(_a = otherProps.onClick) == null ? void 0 : _a.call(otherProps, e);
|
|
69
|
-
}
|
|
70
|
-
),
|
|
64
|
+
} : otherProps.onClick,
|
|
71
65
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
72
|
-
[
|
|
66
|
+
[hideDetails, useDetailsIcon, otherProps, type, value, classification]
|
|
73
67
|
);
|
|
74
68
|
useEffect(() => {
|
|
75
69
|
if (forceDetails) {
|
|
@@ -29,7 +29,7 @@ const EnrichedTypography = ({
|
|
|
29
29
|
children,
|
|
30
30
|
...otherProps
|
|
31
31
|
}) => {
|
|
32
|
-
var _a, _b, _c;
|
|
32
|
+
var _a, _b, _c, _d;
|
|
33
33
|
const { t } = useContextSelector(ClueComponentContext, (ctx) => ctx.i18next);
|
|
34
34
|
const theme = useTheme();
|
|
35
35
|
const anchorRef = useRef();
|
|
@@ -57,21 +57,15 @@ const EnrichedTypography = ({
|
|
|
57
57
|
return options;
|
|
58
58
|
}, [setForceDetails, slotProps.popover]);
|
|
59
59
|
const clicker = useMemo(
|
|
60
|
-
() => !
|
|
60
|
+
() => !hideDetails || useDetailsIcon ? (e) => {
|
|
61
61
|
var _a2;
|
|
62
62
|
showInfo("details", anchorRef.current, { type, value, classification }, buildOptions());
|
|
63
63
|
(_a2 = otherProps.onClick) == null ? void 0 : _a2.call(otherProps, e);
|
|
64
64
|
e.stopPropagation();
|
|
65
65
|
e.preventDefault();
|
|
66
|
-
} : otherProps.onClick
|
|
67
|
-
// We need to give a dummy callback when loading so the popover doesn't get confused
|
|
68
|
-
(e) => {
|
|
69
|
-
var _a2;
|
|
70
|
-
(_a2 = otherProps.onClick) == null ? void 0 : _a2.call(otherProps, e);
|
|
71
|
-
}
|
|
72
|
-
),
|
|
66
|
+
} : otherProps.onClick,
|
|
73
67
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
74
|
-
[
|
|
68
|
+
[hideDetails, useDetailsIcon, otherProps, type, value, classification]
|
|
75
69
|
);
|
|
76
70
|
useEffect(() => {
|
|
77
71
|
if (forceDetails) {
|
|
@@ -92,6 +86,7 @@ const EnrichedTypography = ({
|
|
|
92
86
|
spacing: 1,
|
|
93
87
|
alignItems: "center",
|
|
94
88
|
...slotProps == null ? void 0 : slotProps.stack,
|
|
89
|
+
className: `enriched-typography ${((_a = slotProps == null ? void 0 : slotProps.stack) == null ? void 0 : _a.className) ?? ""}`.trim(),
|
|
95
90
|
sx: [
|
|
96
91
|
{
|
|
97
92
|
cursor: !loading && !hideDetails ? "pointer" : "inherit",
|
|
@@ -101,7 +96,7 @@ const EnrichedTypography = ({
|
|
|
101
96
|
borderBottomColor: !loading && (!hideDetails ? theme.palette.primary.light : null)
|
|
102
97
|
}
|
|
103
98
|
},
|
|
104
|
-
...Array.isArray((
|
|
99
|
+
...Array.isArray((_b = slotProps == null ? void 0 : slotProps.stack) == null ? void 0 : _b.sx) ? (_c = slotProps == null ? void 0 : slotProps.stack) == null ? void 0 : _c.sx : [(_d = slotProps == null ? void 0 : slotProps.stack) == null ? void 0 : _d.sx]
|
|
105
100
|
],
|
|
106
101
|
onClick: !useDetailsIcon ? clicker : void 0,
|
|
107
102
|
children: [
|
|
@@ -5,7 +5,7 @@ import "@mui/material";
|
|
|
5
5
|
import "../display/icons/Iconified.js";
|
|
6
6
|
import "../../index-Bi21Wb23.js";
|
|
7
7
|
import "../../hooks/ClueComponentContext.js";
|
|
8
|
-
import { A } from "../../ActionForm-
|
|
8
|
+
import { A } from "../../ActionForm-BnJ5oGNK.js";
|
|
9
9
|
import "../../utils-7OtvGnmf.js";
|
|
10
10
|
import "react";
|
|
11
11
|
import "../../index-BDVjGvMI.js";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsxs, Fragment, jsx } from "react/jsx-runtime";
|
|
2
2
|
import { useTheme, Tooltip, IconButton, CircularProgress, Button, Popover, Paper, Stack, Box, Typography, Divider } from "@mui/material";
|
|
3
3
|
import { useClueComponentSelector, useClueEnrichSelector } from "../../hooks/selectors.js";
|
|
4
|
-
import { c as capitalize } from "../../ActionForm-
|
|
4
|
+
import { c as capitalize } from "../../ActionForm-BnJ5oGNK.js";
|
|
5
5
|
import { useState, useRef, useCallback, useEffect } from "react";
|
|
6
6
|
import Iconified from "../display/icons/Iconified.js";
|
|
7
7
|
const EnrichPopover = ({ show = false, size = "small", selector }) => {
|
|
@@ -6,7 +6,7 @@ import { SNACKBAR_EVENT_ID } from "../../data/event.js";
|
|
|
6
6
|
import { ClueGroupContext } from "../../hooks/ClueGroupContext.js";
|
|
7
7
|
import { useClueComponentSelector, useClueEnrichSelector } from "../../hooks/selectors.js";
|
|
8
8
|
import { safeDispatchEvent } from "../../utils/window.js";
|
|
9
|
-
import { c as capitalize } from "../../ActionForm-
|
|
9
|
+
import { c as capitalize } from "../../ActionForm-BnJ5oGNK.js";
|
|
10
10
|
import { useState, useMemo, useCallback } from "react";
|
|
11
11
|
import { u as useContextSelector } from "../../index-BDVjGvMI.js";
|
|
12
12
|
import ExecutePopover from "../actions/ExecutePopover.js";
|
|
@@ -2,7 +2,7 @@ import "react/jsx-runtime";
|
|
|
2
2
|
import "@mui/material";
|
|
3
3
|
import "../index-CC12Ux-9.js";
|
|
4
4
|
import "../useClueTypeConfig-HmNKKYHY.js";
|
|
5
|
-
import { a, C } from "../ActionForm-
|
|
5
|
+
import { a, C } from "../ActionForm-BnJ5oGNK.js";
|
|
6
6
|
import "../components/actions/ResultModal.js";
|
|
7
7
|
import "../components/display/icons/Iconified.js";
|
|
8
8
|
import "../components/ErrorBoundary.js";
|
package/hooks/ClueProvider.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
|
-
import { C as ClueActionProvider } from "../ActionForm-
|
|
2
|
+
import { C as ClueActionProvider } from "../ActionForm-BnJ5oGNK.js";
|
|
3
3
|
import { ClueComponentProvider } from "./ClueComponentContext.js";
|
|
4
4
|
import { ClueConfigProvider } from "./ClueConfigProvider.js";
|
|
5
5
|
import { ClueDatabaseProvider } from "./ClueDatabaseContext.js";
|
package/hooks/selectors.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { ClueActionContextType } from
|
|
2
|
-
import { ClueComponentContextType } from
|
|
3
|
-
import { ClueEnrichContextType } from
|
|
4
|
-
import { ClueFetcherContextType } from
|
|
1
|
+
import { ClueActionContextType } from "../hooks/ClueActionContext";
|
|
2
|
+
import { ClueComponentContextType } from "../hooks/ClueComponentContext";
|
|
3
|
+
import { ClueEnrichContextType } from "../hooks/ClueEnrichContextType";
|
|
4
|
+
import { ClueFetcherContextType } from "../hooks/ClueFetcherContext";
|
|
5
5
|
|
|
6
6
|
export declare const useClueFetcherSelector: <Selected>(selector: (value: ClueFetcherContextType) => Selected) => Selected;
|
|
7
7
|
export declare const useClueActionsSelector: <Selected>(selector: (value: ClueActionContextType) => Selected) => Selected;
|
package/hooks/selectors.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { a as ClueActionContext } from "../ActionForm-oiPSbHip.js";
|
|
1
|
+
import { a as ClueActionContext } from "../ActionForm-BnJ5oGNK.js";
|
|
3
2
|
import { ClueComponentContext } from "./ClueComponentContext.js";
|
|
4
3
|
import { C as ClueEnrichContext } from "../ClueEnrichContext-C4hjLcHp.js";
|
|
5
4
|
import { ClueFetcherContext } from "./ClueFetcherContext.js";
|
|
5
|
+
import { u as useContextSelector } from "../index-BDVjGvMI.js";
|
|
6
6
|
const useClueFetcherSelector = (selector) => {
|
|
7
7
|
return useContextSelector(ClueFetcherContext, selector);
|
|
8
8
|
};
|
package/hooks/useClueActions.js
CHANGED
package/icons/Action.js
CHANGED
|
@@ -3,7 +3,7 @@ import { I as Icon } from "../iconify-CXMreGTg.js";
|
|
|
3
3
|
import { useTheme, Stack, Divider, Typography } from "@mui/material";
|
|
4
4
|
import CountBadge from "../components/CountBadge.js";
|
|
5
5
|
import { C as CluePopupContext } from "../AnnotationPreview-biAV6uKB.js";
|
|
6
|
-
import { u as useClueActions } from "../ActionForm-
|
|
6
|
+
import { u as useClueActions } from "../ActionForm-BnJ5oGNK.js";
|
|
7
7
|
import { g as groupBy } from "../groupBy-DC2oOuBN.js";
|
|
8
8
|
import { memo, useRef, useMemo, useEffect } from "react";
|
|
9
9
|
import { u as useContextSelector } from "../index-BDVjGvMI.js";
|
package/main.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { A, u } from "./ActionForm-
|
|
1
|
+
import { A, u } from "./ActionForm-BnJ5oGNK.js";
|
|
2
2
|
import { default as default2 } from "./components/AnnotationDetailPopover.js";
|
|
3
3
|
import { A as A2 } from "./AnnotationDetails-fsvrH3_v.js";
|
|
4
4
|
import { default as default3 } from "./components/AnnotationEntry.js";
|
package/package.json
CHANGED
|
@@ -5,13 +5,13 @@ import { Stack, Typography, IconButton, Modal, Paper, Box, Button, Divider, Circ
|
|
|
5
5
|
import Iconified from "./components/display/icons/Iconified.js";
|
|
6
6
|
import { J as JSONViewer } from "./index-Bi21Wb23.js";
|
|
7
7
|
import { ClueComponentContext } from "./hooks/ClueComponentContext.js";
|
|
8
|
-
import { c as createContext, u as useContextSelector, a as useContext } from "./index-BDVjGvMI.js";
|
|
9
8
|
import { A as Ajv } from "./index-CC12Ux-9.js";
|
|
10
9
|
import { a as api } from "./useClueTypeConfig-HmNKKYHY.js";
|
|
11
10
|
import { d as toString } from "./_baseGet-BSK_nnoz.js";
|
|
12
11
|
import { b as baseSlice } from "./_baseSlice-GAv_YFTT.js";
|
|
13
12
|
import { i as isEqual } from "./utils-7OtvGnmf.js";
|
|
14
13
|
import { useState, useCallback, useEffect, useMemo, memo } from "react";
|
|
14
|
+
import { c as createContext, u as useContextSelector, a as useContext } from "./index-BDVjGvMI.js";
|
|
15
15
|
import ErrorBoundary from "./components/ErrorBoundary.js";
|
|
16
16
|
import { adaptSchema } from "./components/actions/form/schemaAdapter.js";
|
|
17
17
|
import ResultModal from "./components/actions/ResultModal.js";
|