@cccsaurora/clue-ui 1.1.6 → 1.1.7
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/hooks/useAnnotations.js +19 -12
- package/package.json +17 -17
package/hooks/useAnnotations.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { u as p } from "../ClueEnrichContext-CCZCMklu.js";
|
|
2
|
-
import { useContext as q, useMemo as h, useState as
|
|
2
|
+
import { useContext as q, useMemo as h, useState as $, useEffect as u } from "react";
|
|
3
3
|
import { ClueDatabaseContext as A } from "./ClueDatabaseContext.js";
|
|
4
4
|
import { useClueEnrichSelector as i } from "./selectors.js";
|
|
5
|
-
const D = (n, o, l, { skipEnrichment:
|
|
6
|
-
const s = q(A),
|
|
7
|
-
() => l ??
|
|
8
|
-
[l,
|
|
9
|
-
), [
|
|
5
|
+
const D = (n, o, l, { skipEnrichment: f } = { skipEnrichment: !1 }) => {
|
|
6
|
+
const s = q(A), a = i((t) => t.defaultClassification), m = i((t) => t.ready), g = i((t) => t.availableSources), d = i((t) => t.queueEnrich), e = h(
|
|
7
|
+
() => l ?? a,
|
|
8
|
+
[l, a]
|
|
9
|
+
), [b, C] = $(!1), [S, x] = $([]), r = h(
|
|
10
10
|
() => m && !!n && !!o && !!e,
|
|
11
11
|
[e, m, n, o]
|
|
12
12
|
);
|
|
@@ -17,19 +17,26 @@ const D = (n, o, l, { skipEnrichment: a } = { skipEnrichment: !1 }) => {
|
|
|
17
17
|
console.warn("Status collection is closed");
|
|
18
18
|
return;
|
|
19
19
|
}
|
|
20
|
-
const t = s.status.count({ selector: { type: n, value: o, classification: e, status: "in-progress" } }).$.subscribe((c) =>
|
|
20
|
+
const t = s.status.count({ selector: { type: n, value: o, classification: e, status: "in-progress" } }).$.subscribe((c) => C(c > 0));
|
|
21
21
|
return () => {
|
|
22
22
|
t == null || t.unsubscribe();
|
|
23
23
|
};
|
|
24
24
|
}, [e, s, r, n, o]), u(() => {
|
|
25
|
-
|
|
26
|
-
}, [g.length, e, d, r,
|
|
25
|
+
f || g.length < 1 || !r || d(n, o, e);
|
|
26
|
+
}, [g.length, e, d, r, f, n, o]), u(() => {
|
|
27
27
|
if (!r || !(s != null && s.selectors) || s.selectors.closed)
|
|
28
28
|
return;
|
|
29
29
|
const t = s.selectors.find({
|
|
30
30
|
selector: {
|
|
31
|
-
|
|
32
|
-
|
|
31
|
+
$or: [
|
|
32
|
+
{
|
|
33
|
+
// Use regex instead of exact value for case-insensitivity
|
|
34
|
+
value: { $regex: `^${o}$`, $options: "i" }
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
value: o
|
|
38
|
+
}
|
|
39
|
+
]
|
|
33
40
|
}
|
|
34
41
|
}).$.subscribe(
|
|
35
42
|
(c) => x(
|
|
@@ -46,7 +53,7 @@ const D = (n, o, l, { skipEnrichment: a } = { skipEnrichment: !1 }) => {
|
|
|
46
53
|
console.warn(c);
|
|
47
54
|
}
|
|
48
55
|
};
|
|
49
|
-
}, [s, r, o]), [
|
|
56
|
+
}, [s, r, o]), [S, b];
|
|
50
57
|
};
|
|
51
58
|
export {
|
|
52
59
|
D as default
|
package/package.json
CHANGED
|
@@ -63,44 +63,44 @@
|
|
|
63
63
|
},
|
|
64
64
|
"type": "module",
|
|
65
65
|
"types": "main.d.ts",
|
|
66
|
-
"version": "1.1.
|
|
66
|
+
"version": "1.1.7",
|
|
67
67
|
"exports": {
|
|
68
68
|
".": "./main.js",
|
|
69
69
|
"./index.css": "./index.css",
|
|
70
70
|
"./en/*.json": "./en/*.json",
|
|
71
71
|
"./fr/*.json": "./fr/*.json",
|
|
72
|
-
"./icons/*": "./icons/*.js",
|
|
73
|
-
"./types/*": "./types/*.js",
|
|
74
|
-
"./utils/*": "./utils/*.js",
|
|
75
|
-
"./utils/*.json": "./utils/*.json",
|
|
76
72
|
"./components/*": "./components/*.js",
|
|
77
|
-
"./hooks/*": "./hooks/*.js",
|
|
78
73
|
"./text/*": "./text/*.js",
|
|
74
|
+
"./utils/*": "./utils/*.js",
|
|
75
|
+
"./utils/*.json": "./utils/*.json",
|
|
79
76
|
"./data/*": "./data/*.js",
|
|
80
77
|
"./database/*": "./database/*.js",
|
|
81
78
|
"./database": "./database/index.js",
|
|
82
|
-
"./
|
|
79
|
+
"./types/*": "./types/*.js",
|
|
80
|
+
"./hooks/*": "./hooks/*.js",
|
|
81
|
+
"./icons/*": "./icons/*.js",
|
|
82
|
+
"./components/actions/*": "./components/actions/*.js",
|
|
83
83
|
"./components/enrichment/*": "./components/enrichment/*.js",
|
|
84
|
+
"./components/group/*": "./components/group/*.js",
|
|
84
85
|
"./components/fetchers/*": "./components/fetchers/*.js",
|
|
85
|
-
"./components/stats/*": "./components/stats/*.js",
|
|
86
86
|
"./components/display/*": "./components/display/*.js",
|
|
87
|
-
"./components/
|
|
88
|
-
"./components/
|
|
87
|
+
"./components/stats/*": "./components/stats/*.js",
|
|
88
|
+
"./components/actions/form/*": "./components/actions/form/*.js",
|
|
89
89
|
"./components/display/graph/*": "./components/display/graph/*.js",
|
|
90
90
|
"./components/display/graph": "./components/display/graph/index.js",
|
|
91
|
-
"./components/display/json/*": "./components/display/json/*.js",
|
|
92
|
-
"./components/display/json": "./components/display/json/index.js",
|
|
93
91
|
"./components/display/markdown/*.md": "./components/display/markdown/*.md.js",
|
|
94
92
|
"./components/display/markdown": "./components/display/markdown/index.js",
|
|
95
|
-
"./components/display/
|
|
93
|
+
"./components/display/icons/*": "./components/display/icons/*.js",
|
|
94
|
+
"./components/display/json/*": "./components/display/json/*.js",
|
|
95
|
+
"./components/display/json": "./components/display/json/index.js",
|
|
96
96
|
"./components/display/graph/visualizations/*": "./components/display/graph/visualizations/*.js",
|
|
97
|
-
"./components/display/graph/
|
|
98
|
-
"./components/display/graph/visualizations/
|
|
97
|
+
"./components/display/graph/elements/*": "./components/display/graph/elements/*.js",
|
|
98
|
+
"./components/display/graph/visualizations/panels/*": "./components/display/graph/visualizations/panels/*.js",
|
|
99
99
|
"./components/display/graph/visualizations/cloud/*": "./components/display/graph/visualizations/cloud/*.js",
|
|
100
100
|
"./components/display/graph/visualizations/cloud": "./components/display/graph/visualizations/cloud/index.js",
|
|
101
101
|
"./components/display/graph/visualizations/tree/*": "./components/display/graph/visualizations/tree/*.js",
|
|
102
102
|
"./components/display/graph/visualizations/tree": "./components/display/graph/visualizations/tree/index.js",
|
|
103
|
-
"./components/display/graph/visualizations/
|
|
104
|
-
"./components/
|
|
103
|
+
"./components/display/graph/visualizations/icons/*": "./components/display/graph/visualizations/icons/*.js",
|
|
104
|
+
"./components/display/graph/visualizations/icons": "./components/display/graph/visualizations/icons/index.js"
|
|
105
105
|
}
|
|
106
106
|
}
|