@cccsaurora/clue-ui 1.2.4-patch.275 → 1.2.5-dev.298
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-D6gYuFRR.js +5970 -0
- package/AnnotationDetails-Zx4pjBiN.js +175 -0
- package/AnnotationPreview-Dmz7taAU.js +188 -0
- package/ClueEnrichContext-CJEJxrgs.js +541 -0
- package/FlexOne-BSYAhhtG.js +9 -0
- package/_MapCache-WmuDdwuH.js +222 -0
- package/_Uint8Array-B7JqpgFX.js +128 -0
- package/_baseAssignValue-CGTuELqU.js +25 -0
- package/_baseClone-CkNrTyhm.js +283 -0
- package/_baseExtremum-kob8QXyt.js +18 -0
- package/_baseFlatten-jIR_sN_-.js +92 -0
- package/_baseGet-Bx3A4Qfp.js +108 -0
- package/_baseIsEqual-C5OTWzTk.js +208 -0
- package/_baseIteratee-avi7MX2o.js +126 -0
- package/_baseSlice-GAv_YFTT.js +20 -0
- package/_baseSum-D0WC1dN0.js +13 -0
- package/_baseUniq-BI9GIHMF.js +115 -0
- package/_commonjsHelpers-DWwsNxpa.js +8 -0
- package/_createAggregator-QD8MzKwe.js +63 -0
- package/_getPrototype-CU0j_POw.js +5 -0
- package/_getTag-Ckxxfr88.js +126 -0
- package/_isIterateeCall-Ds3sw2SF.js +17 -0
- package/_setToArray-CaPKQhcz.js +33 -0
- package/cloneDeep-DJrLSw8W.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 +21 -10
- 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 +88 -69
- 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 +158 -119
- package/components/fetchers/PreviewModal.js +20 -17
- 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 +43 -33
- package/countBy-c6S3dvSW.js +14 -0
- package/data/event.js +6 -4
- package/database/index.js +2 -2
- package/debounce-bV0h5FC5.js +92 -0
- package/get-DSsNkRQs.js +8 -0
- package/groupBy-xqz-n0Vd.js +14 -0
- package/hooks/ClueActionContext.d.ts +10 -2
- package/hooks/ClueActionContext.js +6 -6
- package/hooks/ClueComponentContext.js +29 -23
- package/hooks/ClueConfigProvider.js +14 -12
- package/hooks/ClueDatabaseContext.js +19 -13
- package/hooks/ClueEnrichContext.js +8 -8
- package/hooks/ClueFetcherContext.js +83 -56
- package/hooks/ClueGroupContext.js +17 -14
- package/hooks/CluePopupContext.js +5 -5
- package/hooks/ClueProvider.js +12 -10
- package/hooks/selectors.js +7 -7
- package/hooks/useActionResult.d.ts +1 -0
- package/hooks/useActionResult.js +3 -3
- package/hooks/useAnnotations.js +47 -31
- package/hooks/useClue.js +6 -4
- package/hooks/useClueActions.js +3 -3
- package/hooks/useClueConfig.js +6 -4
- package/hooks/useClueTypeConfig.js +3 -3
- package/hooks/useComparator.js +722 -435
- package/hooks/useErrors.js +22 -18
- package/hooks/useFetcherResult.d.ts +1 -0
- package/hooks/useFetcherResult.js +33 -24
- package/hooks/useMyHighlights.js +66 -36
- package/hooks/useMyLocalStorage.js +66 -37
- package/iconify-CXMreGTg.js +1782 -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-AMfoEg_6.js +696 -0
- package/index-B6C2a_Lg.js +1172 -0
- package/index-C12gPw2W.js +17698 -0
- package/index-DCKkHTvx.js +15750 -0
- package/index-JcKyZeoY.js +465 -0
- package/isNil-CIubwp4T.js +6 -0
- package/isObject-FTY-5JQX.js +7 -0
- package/isObjectLike-OAgjjZye.js +48 -0
- package/isSymbol-Xd2FsJyp.js +8 -0
- package/last-CUCl67Im.js +7 -0
- package/main.js +60 -60
- package/maxBy-IKHzFrCS.js +8 -0
- package/package.json +1 -1
- package/sortBy-DfSj8IoJ.js +96 -0
- package/sumBy-D-hb_NY-.js +8 -0
- package/text/Frequency.js +42 -23
- package/toFinite-Bc55msYj.js +16 -0
- package/toNumber-DPxy1FBy.js +39 -0
- package/types/RunningActionData.d.ts +1 -0
- package/types/WithActionData.d.ts +1 -0
- package/useClueTypeConfig-Z1LFp01b.js +3289 -0
- package/utils/chain.js +92 -65
- package/utils/classificationParser.js +519 -256
- package/utils/constants.js +35 -10
- 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 +41 -27
- package/utils/time.js +423 -423
- package/utils/utils.js +9 -9
- package/utils/window.js +21 -10
- package/utils-HmNPuoDB.js +199 -0
- package/ActionForm-CwsfB99X.js +0 -4458
- package/AnnotationDetails-Bw2JdtTL.js +0 -160
- package/AnnotationPreview-BO7rVnOP.js +0 -140
- package/ClueEnrichContext-KqRuuWNS.js +0 -418
- package/FlexOne-BXWFOd1T.js +0 -6
- package/_MapCache-BiTi0iqu.js +0 -180
- package/_Uint8Array-BQNOM9Rr.js +0 -101
- package/_baseAssignValue-CNMLQZco.js +0 -20
- package/_baseClone-BnT-6pyM.js +0 -207
- package/_baseExtremum-Ca2EHgy2.js +0 -16
- package/_baseFlatten-Bfr_Molw.js +0 -72
- package/_baseGet-DSZygzyq.js +0 -79
- package/_baseIsEqual-VgvaAFZG.js +0 -147
- package/_baseIteratee-Dbfsw5z8.js +0 -95
- package/_baseSlice-M5RKzt1A.js +0 -10
- package/_baseSum-wEbgNeUs.js +0 -10
- package/_baseUniq-BJcj69PL.js +0 -79
- package/_commonjsHelpers-DaMA6jEr.js +0 -8
- package/_createAggregator-k3TuAnxT.js +0 -53
- package/_getPrototype-Cr1Mk7BC.js +0 -5
- package/_getTag-CK2Sffaq.js +0 -90
- package/_isIterateeCall-DkJP7Rbx.js +0 -13
- package/_setToArray-C7yMOeww.js +0 -29
- package/cloneDeep-CF8TtLHr.js +0 -8
- package/countBy-CdYegFSu.js +0 -8
- package/debounce-DryYcbJ4.js +0 -56
- package/get-CH7kz5Ix.js +0 -8
- package/groupBy-br8xmD2R.js +0 -8
- package/iconify-BBckr5AQ.js +0 -1263
- package/identity-ByMq8VxU.js +0 -6
- package/index-BHAe_V9n.js +0 -12768
- package/index-BK-zfYhR.js +0 -358
- package/index-CA5CUNZO.js +0 -975
- package/index-Dj5C04IX.js +0 -568
- package/index-p5_wX7q1.js +0 -11729
- package/isNil-CjWwlQS3.js +0 -6
- package/isObject-B53jY8Qg.js +0 -7
- package/isObjectLike-BatpeCIi.js +0 -29
- package/isSymbol-C3_SC0Qp.js +0 -8
- package/last-7CdUxN0r.js +0 -7
- package/maxBy-Bc0dYHcO.js +0 -8
- package/sortBy-DY2JBf9n.js +0 -75
- package/sumBy-DuMASLPd.js +0 -8
- package/toFinite-BMy6GObD.js +0 -14
- package/toNumber-YVhnnJv4.js +0 -31
- package/useClueTypeConfig-Ct9Ygter.js +0 -2292
- package/utils-DmwSUrum.js +0 -129
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import "react/jsx-runtime";
|
|
2
|
-
import "../iconify-
|
|
3
|
-
import "../useClueTypeConfig-
|
|
2
|
+
import "../iconify-CXMreGTg.js";
|
|
3
|
+
import "../useClueTypeConfig-Z1LFp01b.js";
|
|
4
4
|
import "../utils/loggerUtil.js";
|
|
5
|
-
import { C
|
|
6
|
-
import "../debounce-
|
|
7
|
-
import "../groupBy-
|
|
5
|
+
import { C, a } from "../ClueEnrichContext-CJEJxrgs.js";
|
|
6
|
+
import "../debounce-bV0h5FC5.js";
|
|
7
|
+
import "../groupBy-xqz-n0Vd.js";
|
|
8
8
|
import "react";
|
|
9
|
-
import "../index-
|
|
9
|
+
import "../index-AMfoEg_6.js";
|
|
10
10
|
import "./ClueDatabaseContext.js";
|
|
11
11
|
import "./useClueConfig.js";
|
|
12
12
|
export {
|
|
13
|
-
|
|
14
|
-
|
|
13
|
+
C as ClueEnrichContext,
|
|
14
|
+
a as ClueEnrichProvider
|
|
15
15
|
};
|
|
@@ -1,80 +1,107 @@
|
|
|
1
|
-
import { jsx
|
|
2
|
-
import { a as
|
|
3
|
-
import { SNACKBAR_EVENT_ID
|
|
4
|
-
import { safeDispatchEvent
|
|
5
|
-
import { useState
|
|
6
|
-
import { c as
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
const
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { a as api } from "../useClueTypeConfig-Z1LFp01b.js";
|
|
3
|
+
import { SNACKBAR_EVENT_ID } from "../data/event.js";
|
|
4
|
+
import { safeDispatchEvent } from "../utils/window.js";
|
|
5
|
+
import { useState, useRef, useMemo, useCallback, useEffect } from "react";
|
|
6
|
+
import { c as createContext } from "../index-AMfoEg_6.js";
|
|
7
|
+
import useClue from "./useClue.js";
|
|
8
|
+
import useClueConfig from "./useClueConfig.js";
|
|
9
|
+
const ClueFetcherContext = createContext(null);
|
|
10
|
+
const ClueFetcherProvider = ({
|
|
11
|
+
baseURL,
|
|
12
|
+
children,
|
|
13
|
+
classification: _defaultClassification,
|
|
14
|
+
getToken,
|
|
15
|
+
onNetworkCall
|
|
15
16
|
}) => {
|
|
16
|
-
var
|
|
17
|
-
const
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
17
|
+
var _a, _b;
|
|
18
|
+
const clueConfig = useClueConfig();
|
|
19
|
+
const { ready } = useClue();
|
|
20
|
+
const [defaultClassification, setDefaultClasification] = useState(_defaultClassification);
|
|
21
|
+
const [fetchCompleted, setFetchCompleted] = useState(false);
|
|
22
|
+
const [fetchers, setFetchers] = useState({});
|
|
23
|
+
const fetchRequests = useRef({});
|
|
24
|
+
const requestConfig = useMemo(() => {
|
|
25
|
+
const headers = {};
|
|
26
|
+
const token = getToken == null ? void 0 : getToken();
|
|
27
|
+
if (token) {
|
|
28
|
+
headers.Authorization = `Bearer ${token}`;
|
|
29
|
+
}
|
|
30
|
+
const baseConfig = { baseURL, headers };
|
|
31
|
+
return onNetworkCall ? onNetworkCall(baseConfig) : { baseURL, headers };
|
|
32
|
+
}, [baseURL, getToken, onNetworkCall]);
|
|
33
|
+
const getHashKey = useCallback(
|
|
34
|
+
({ type, value, classification }) => JSON.stringify({ type, value, classification: classification ?? defaultClassification }),
|
|
35
|
+
[defaultClassification]
|
|
36
|
+
);
|
|
37
|
+
const fetchSelector = useCallback(
|
|
38
|
+
async (fetcherId, selector) => {
|
|
39
|
+
var _a2;
|
|
40
|
+
if ((_a2 = fetchRequests.current[fetcherId]) == null ? void 0 : _a2[getHashKey(selector)]) {
|
|
41
|
+
return fetchRequests.current[fetcherId][getHashKey(selector)];
|
|
42
|
+
}
|
|
28
43
|
try {
|
|
29
|
-
const
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
44
|
+
const result = api.fetchers.post(fetcherId, selector, requestConfig);
|
|
45
|
+
if (!fetchRequests.current[fetcherId]) {
|
|
46
|
+
fetchRequests.current[fetcherId] = {};
|
|
47
|
+
}
|
|
48
|
+
fetchRequests.current[fetcherId][getHashKey(selector)] = result;
|
|
49
|
+
return await result;
|
|
50
|
+
} catch (e) {
|
|
51
|
+
safeDispatchEvent(
|
|
52
|
+
new CustomEvent(SNACKBAR_EVENT_ID, {
|
|
34
53
|
detail: {
|
|
35
|
-
message:
|
|
54
|
+
message: e.toString(),
|
|
36
55
|
level: "error"
|
|
37
56
|
}
|
|
38
57
|
})
|
|
39
58
|
);
|
|
40
59
|
}
|
|
41
60
|
},
|
|
42
|
-
[
|
|
43
|
-
)
|
|
44
|
-
|
|
61
|
+
[getHashKey, requestConfig]
|
|
62
|
+
);
|
|
63
|
+
const getFetcherStatus = useCallback(
|
|
64
|
+
async (fetcherId, taskId) => {
|
|
45
65
|
try {
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
66
|
+
const res = await api.fetchers.status.get(fetcherId, taskId, {}, requestConfig);
|
|
67
|
+
return res;
|
|
68
|
+
} catch (e) {
|
|
69
|
+
safeDispatchEvent(
|
|
70
|
+
new CustomEvent(SNACKBAR_EVENT_ID, {
|
|
50
71
|
detail: {
|
|
51
|
-
message:
|
|
72
|
+
message: e.toString(),
|
|
52
73
|
level: "error"
|
|
53
74
|
}
|
|
54
75
|
})
|
|
55
76
|
);
|
|
56
77
|
}
|
|
57
78
|
},
|
|
58
|
-
[
|
|
79
|
+
[requestConfig]
|
|
59
80
|
);
|
|
60
|
-
|
|
61
|
-
var
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
}, [
|
|
66
|
-
|
|
81
|
+
useEffect(() => {
|
|
82
|
+
var _a2, _b2, _c, _d;
|
|
83
|
+
if (!defaultClassification && ((_b2 = (_a2 = clueConfig.config) == null ? void 0 : _a2.c12nDef) == null ? void 0 : _b2.UNRESTRICTED)) {
|
|
84
|
+
setDefaultClasification((_d = (_c = clueConfig.config) == null ? void 0 : _c.c12nDef) == null ? void 0 : _d.UNRESTRICTED);
|
|
85
|
+
}
|
|
86
|
+
}, [(_b = (_a = clueConfig.config) == null ? void 0 : _a.c12nDef) == null ? void 0 : _b.UNRESTRICTED, defaultClassification]);
|
|
87
|
+
useEffect(() => {
|
|
88
|
+
if (!ready) {
|
|
89
|
+
return;
|
|
90
|
+
}
|
|
91
|
+
api.fetchers.get(requestConfig).then(setFetchers).finally(() => setFetchCompleted(true));
|
|
92
|
+
}, [baseURL, ready]);
|
|
93
|
+
const context = useMemo(
|
|
67
94
|
() => ({
|
|
68
|
-
fetchSelector
|
|
69
|
-
getFetcherStatus
|
|
70
|
-
fetchers
|
|
71
|
-
fetchCompleted
|
|
95
|
+
fetchSelector,
|
|
96
|
+
getFetcherStatus,
|
|
97
|
+
fetchers,
|
|
98
|
+
fetchCompleted
|
|
72
99
|
}),
|
|
73
|
-
[
|
|
100
|
+
[fetchCompleted, fetchSelector, fetchers, getFetcherStatus]
|
|
74
101
|
);
|
|
75
|
-
return /* @__PURE__ */
|
|
102
|
+
return /* @__PURE__ */ jsx(ClueFetcherContext.Provider, { value: context, children });
|
|
76
103
|
};
|
|
77
104
|
export {
|
|
78
|
-
|
|
79
|
-
|
|
105
|
+
ClueFetcherContext,
|
|
106
|
+
ClueFetcherProvider
|
|
80
107
|
};
|
|
@@ -1,20 +1,23 @@
|
|
|
1
|
-
import { jsx
|
|
2
|
-
import { useState
|
|
3
|
-
import { c as
|
|
4
|
-
import { b as
|
|
5
|
-
const
|
|
6
|
-
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useState, useMemo } from "react";
|
|
3
|
+
import { c as createContext } from "../index-AMfoEg_6.js";
|
|
4
|
+
import { b as useClueEnrichSelector } from "../ActionForm-D6gYuFRR.js";
|
|
5
|
+
const ClueGroupContext = createContext(null);
|
|
6
|
+
const ClueGroupProvider = ({ children, type, classification }) => {
|
|
7
|
+
const defaultClassification = useClueEnrichSelector((ctx) => ctx.defaultClassification);
|
|
8
|
+
const [values, setValues] = useState([]);
|
|
9
|
+
const context = useMemo(
|
|
7
10
|
() => ({
|
|
8
|
-
type
|
|
9
|
-
values
|
|
10
|
-
setValues
|
|
11
|
-
classification:
|
|
11
|
+
type,
|
|
12
|
+
values,
|
|
13
|
+
setValues,
|
|
14
|
+
classification: classification ?? defaultClassification
|
|
12
15
|
}),
|
|
13
|
-
[
|
|
16
|
+
[classification, defaultClassification, type, values]
|
|
14
17
|
);
|
|
15
|
-
return /* @__PURE__ */
|
|
18
|
+
return /* @__PURE__ */ jsx(ClueGroupContext.Provider, { value: context, children });
|
|
16
19
|
};
|
|
17
20
|
export {
|
|
18
|
-
|
|
19
|
-
|
|
21
|
+
ClueGroupContext,
|
|
22
|
+
ClueGroupProvider
|
|
20
23
|
};
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import "react/jsx-runtime";
|
|
2
2
|
import "../components/AnnotationDetailPopover.js";
|
|
3
|
-
import { C
|
|
3
|
+
import { C, a } from "../AnnotationPreview-Dmz7taAU.js";
|
|
4
4
|
import "../data/event.js";
|
|
5
5
|
import "../utils/window.js";
|
|
6
|
-
import "../AnnotationDetails-
|
|
6
|
+
import "../AnnotationDetails-Zx4pjBiN.js";
|
|
7
7
|
import "react";
|
|
8
|
-
import "../index-
|
|
8
|
+
import "../index-AMfoEg_6.js";
|
|
9
9
|
export {
|
|
10
|
-
|
|
11
|
-
|
|
10
|
+
C as CluePopupContext,
|
|
11
|
+
a as CluePopupProvider
|
|
12
12
|
};
|
package/hooks/ClueProvider.js
CHANGED
|
@@ -1,12 +1,14 @@
|
|
|
1
|
-
import { jsx
|
|
2
|
-
import { C as
|
|
3
|
-
import { ClueComponentProvider
|
|
4
|
-
import { ClueConfigProvider
|
|
5
|
-
import { ClueDatabaseProvider
|
|
6
|
-
import { a as
|
|
7
|
-
import { ClueFetcherProvider
|
|
8
|
-
import { a as
|
|
9
|
-
const
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { C as ClueActionProvider } from "../ActionForm-D6gYuFRR.js";
|
|
3
|
+
import { ClueComponentProvider } from "./ClueComponentContext.js";
|
|
4
|
+
import { ClueConfigProvider } from "./ClueConfigProvider.js";
|
|
5
|
+
import { ClueDatabaseProvider } from "./ClueDatabaseContext.js";
|
|
6
|
+
import { a as ClueEnrichProvider } from "../ClueEnrichContext-CJEJxrgs.js";
|
|
7
|
+
import { ClueFetcherProvider } from "./ClueFetcherContext.js";
|
|
8
|
+
import { a as CluePopupProvider } from "../AnnotationPreview-Dmz7taAU.js";
|
|
9
|
+
const ClueProvider = ({ children, ...props }) => {
|
|
10
|
+
return /* @__PURE__ */ jsx(ClueComponentProvider, { ...props, children: /* @__PURE__ */ jsx(ClueConfigProvider, { config: props.config, children: /* @__PURE__ */ jsx(ClueDatabaseProvider, { ...props, children: /* @__PURE__ */ jsx(ClueEnrichProvider, { ...props, children: /* @__PURE__ */ jsx(ClueFetcherProvider, { ...props, children: /* @__PURE__ */ jsx(ClueActionProvider, { ...props, children: /* @__PURE__ */ jsx(CluePopupProvider, { children }) }) }) }) }) }) });
|
|
11
|
+
};
|
|
10
12
|
export {
|
|
11
|
-
|
|
13
|
+
ClueProvider
|
|
12
14
|
};
|
package/hooks/selectors.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { a
|
|
1
|
+
import { a, d, b, c } from "../ActionForm-D6gYuFRR.js";
|
|
2
2
|
import "./ClueComponentContext.js";
|
|
3
|
-
import "../ClueEnrichContext-
|
|
3
|
+
import "../ClueEnrichContext-CJEJxrgs.js";
|
|
4
4
|
import "./ClueFetcherContext.js";
|
|
5
|
-
import "../index-
|
|
5
|
+
import "../index-AMfoEg_6.js";
|
|
6
6
|
export {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
7
|
+
a as useClueActionsSelector,
|
|
8
|
+
d as useClueComponentSelector,
|
|
9
|
+
b as useClueEnrichSelector,
|
|
10
|
+
c as useClueFetcherSelector
|
|
11
11
|
};
|
|
@@ -11,5 +11,6 @@ export declare const useActionResult: (resultWithData: WithActionData<ActionResu
|
|
|
11
11
|
task_id?: string;
|
|
12
12
|
actionId: string;
|
|
13
13
|
action: import("../types/action").ActionDefinition;
|
|
14
|
+
onUpdate?: (result: WithActionData<ActionResult>) => void;
|
|
14
15
|
onComplete?: (result: WithActionData<ActionResult>) => void;
|
|
15
16
|
};
|
package/hooks/useActionResult.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import "react";
|
|
2
|
-
import "../index-
|
|
2
|
+
import "../index-AMfoEg_6.js";
|
|
3
3
|
import "./ClueComponentContext.js";
|
|
4
|
-
import { f
|
|
4
|
+
import { f } from "../ActionForm-D6gYuFRR.js";
|
|
5
5
|
export {
|
|
6
|
-
|
|
6
|
+
f as useActionResult
|
|
7
7
|
};
|
package/hooks/useAnnotations.js
CHANGED
|
@@ -1,60 +1,76 @@
|
|
|
1
|
-
import { u as
|
|
2
|
-
import { useContext
|
|
3
|
-
import { ClueDatabaseContext
|
|
4
|
-
import { b as
|
|
5
|
-
const
|
|
6
|
-
const
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
1
|
+
import { u as uniqBy } from "../ClueEnrichContext-CJEJxrgs.js";
|
|
2
|
+
import { useContext, useMemo, useState, useEffect } from "react";
|
|
3
|
+
import { ClueDatabaseContext } from "./ClueDatabaseContext.js";
|
|
4
|
+
import { b as useClueEnrichSelector } from "../ActionForm-D6gYuFRR.js";
|
|
5
|
+
const useAnnotations = (type, value, _classification, { skipEnrichment } = { skipEnrichment: false }) => {
|
|
6
|
+
const database = useContext(ClueDatabaseContext);
|
|
7
|
+
const defaultClassification = useClueEnrichSelector((ctx) => ctx.defaultClassification);
|
|
8
|
+
const enrichReady = useClueEnrichSelector((ctx) => ctx.ready);
|
|
9
|
+
const availableSources = useClueEnrichSelector((ctx) => ctx.availableSources);
|
|
10
|
+
const queueEnrich = useClueEnrichSelector((state) => state.queueEnrich);
|
|
11
|
+
const classification = useMemo(
|
|
12
|
+
() => _classification ?? defaultClassification,
|
|
13
|
+
[_classification, defaultClassification]
|
|
12
14
|
);
|
|
13
|
-
|
|
14
|
-
|
|
15
|
+
const [loading, setLoading] = useState(false);
|
|
16
|
+
const [annotations, setAnnotations] = useState([]);
|
|
17
|
+
const ready = useMemo(
|
|
18
|
+
() => enrichReady && !!type && !!value && !!classification,
|
|
19
|
+
[classification, enrichReady, type, value]
|
|
20
|
+
);
|
|
21
|
+
useEffect(() => {
|
|
22
|
+
if (!ready || !(database == null ? void 0 : database.status)) {
|
|
15
23
|
return;
|
|
16
|
-
|
|
24
|
+
}
|
|
25
|
+
if (database == null ? void 0 : database.status.closed) {
|
|
17
26
|
console.warn("Status collection is closed");
|
|
18
27
|
return;
|
|
19
28
|
}
|
|
20
|
-
const
|
|
29
|
+
const observable = database.status.count({ selector: { type, value, classification, status: "in-progress" } }).$.subscribe((_count) => setLoading(_count > 0));
|
|
21
30
|
return () => {
|
|
22
|
-
|
|
31
|
+
observable == null ? void 0 : observable.unsubscribe();
|
|
23
32
|
};
|
|
24
|
-
}, [
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
if (!r || !(s != null && s.selectors) || s.selectors.closed)
|
|
33
|
+
}, [classification, database, ready, type, value]);
|
|
34
|
+
useEffect(() => {
|
|
35
|
+
if (skipEnrichment || availableSources.length < 1 || !ready) {
|
|
28
36
|
return;
|
|
29
|
-
|
|
37
|
+
}
|
|
38
|
+
queueEnrich(type, value, classification);
|
|
39
|
+
}, [availableSources.length, classification, queueEnrich, ready, skipEnrichment, type, value]);
|
|
40
|
+
useEffect(() => {
|
|
41
|
+
if (!ready || !(database == null ? void 0 : database.selectors) || database.selectors.closed) {
|
|
42
|
+
return;
|
|
43
|
+
}
|
|
44
|
+
const observable = database.selectors.find({
|
|
30
45
|
selector: {
|
|
31
46
|
$or: [
|
|
32
47
|
{
|
|
33
48
|
// Use regex instead of exact value for case-insensitivity
|
|
34
|
-
value: { $regex: `^${
|
|
49
|
+
value: { $regex: `^${value}$`, $options: "i" }
|
|
35
50
|
},
|
|
36
51
|
{
|
|
37
|
-
value
|
|
52
|
+
value
|
|
38
53
|
}
|
|
39
54
|
]
|
|
40
55
|
}
|
|
41
56
|
}).$.subscribe(
|
|
42
|
-
(
|
|
43
|
-
|
|
44
|
-
|
|
57
|
+
(result) => setAnnotations(
|
|
58
|
+
uniqBy(
|
|
59
|
+
result.flatMap((entry) => entry.getAnnotations()),
|
|
45
60
|
JSON.stringify
|
|
46
61
|
)
|
|
47
62
|
)
|
|
48
63
|
);
|
|
49
64
|
return () => {
|
|
50
65
|
try {
|
|
51
|
-
|
|
52
|
-
} catch (
|
|
53
|
-
console.warn(
|
|
66
|
+
observable.unsubscribe();
|
|
67
|
+
} catch (e) {
|
|
68
|
+
console.warn(e);
|
|
54
69
|
}
|
|
55
70
|
};
|
|
56
|
-
}, [
|
|
71
|
+
}, [database, ready, value]);
|
|
72
|
+
return [annotations, loading];
|
|
57
73
|
};
|
|
58
74
|
export {
|
|
59
|
-
|
|
75
|
+
useAnnotations as default
|
|
60
76
|
};
|
package/hooks/useClue.js
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
import { a as
|
|
2
|
-
import { C as
|
|
3
|
-
const
|
|
1
|
+
import { a as useContext } from "../index-AMfoEg_6.js";
|
|
2
|
+
import { C as ClueEnrichContext } from "../ClueEnrichContext-CJEJxrgs.js";
|
|
3
|
+
const useClue = () => {
|
|
4
|
+
return useContext(ClueEnrichContext);
|
|
5
|
+
};
|
|
4
6
|
export {
|
|
5
|
-
|
|
7
|
+
useClue as default
|
|
6
8
|
};
|
package/hooks/useClueActions.js
CHANGED
package/hooks/useClueConfig.js
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
import { ClueConfigContext
|
|
2
|
-
import { useContext
|
|
3
|
-
const
|
|
1
|
+
import { ClueConfigContext } from "./ClueConfigProvider.js";
|
|
2
|
+
import { useContext } from "react";
|
|
3
|
+
const useClueConfig = () => {
|
|
4
|
+
return useContext(ClueConfigContext);
|
|
5
|
+
};
|
|
4
6
|
export {
|
|
5
|
-
|
|
7
|
+
useClueConfig as default
|
|
6
8
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { b
|
|
1
|
+
import { b } from "../useClueTypeConfig-Z1LFp01b.js";
|
|
2
2
|
import "../utils/loggerUtil.js";
|
|
3
|
-
import "../_baseUniq-
|
|
3
|
+
import "../_baseUniq-BI9GIHMF.js";
|
|
4
4
|
import "react";
|
|
5
5
|
export {
|
|
6
|
-
|
|
6
|
+
b as default
|
|
7
7
|
};
|