@cccsaurora/clue-ui 1.5.0-dev.449 → 1.5.0-dev.454
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/ClassificationChip.js +4 -1
- package/components/actions/formats/index.js +1 -1
- package/components/fetchers/FetcherResultView.js +1 -1
- package/hooks/ClueDatabaseContext.d.ts +4 -0
- package/hooks/ClueDatabaseContext.js +4 -3
- package/hooks/ClueUIPluginContext.d.ts +4 -0
- package/hooks/ClueUIPluginContext.js +4 -3
- package/package.json +22 -22
- package/plugins/store.d.ts +1 -1
- package/plugins/store.js +1 -1
- package/{store-9Bv4xoVU.js → store-DHP48fQB.js} +2 -2
|
@@ -22,6 +22,9 @@ const ClassificationChip = React__default.memo(
|
|
|
22
22
|
}, [classification, config.c12nDef, parts]);
|
|
23
23
|
const chipProps = useMemo(() => {
|
|
24
24
|
var _a2, _b2, _c;
|
|
25
|
+
if (!parts) {
|
|
26
|
+
return { color: "default" };
|
|
27
|
+
}
|
|
25
28
|
const definedColor = (_c = (_b2 = config.c12nDef) == null ? void 0 : _b2.levels_styles_map[(_a2 = config.c12nDef) == null ? void 0 : _a2.levels_map[parts.lvlIdx]]) == null ? void 0 : _c.color;
|
|
26
29
|
if (THEME_TYPES.includes(definedColor)) {
|
|
27
30
|
return { color: definedColor };
|
|
@@ -30,7 +33,7 @@ const ClassificationChip = React__default.memo(
|
|
|
30
33
|
return { sx: { color: definedColor } };
|
|
31
34
|
}
|
|
32
35
|
return { color: "default" };
|
|
33
|
-
}, [(_a = config.c12nDef) == null ? void 0 : _a.levels_map, (_b = config.c12nDef) == null ? void 0 : _b.levels_styles_map, parts
|
|
36
|
+
}, [(_a = config.c12nDef) == null ? void 0 : _a.levels_map, (_b = config.c12nDef) == null ? void 0 : _b.levels_styles_map, parts]);
|
|
34
37
|
return /* @__PURE__ */ jsx(Tooltip, { title: classification, children: /* @__PURE__ */ jsx(
|
|
35
38
|
Chip,
|
|
36
39
|
{
|
|
@@ -3,7 +3,7 @@ import { Stack } from "@mui/material";
|
|
|
3
3
|
import { J as JSONViewer } from "../../../index-DUEubgWN.js";
|
|
4
4
|
import Markdown from "../../display/markdown/index.js";
|
|
5
5
|
import ErrorBoundary from "../../ErrorBoundary.js";
|
|
6
|
-
import { u as usePluginStore, c as clueUIPluginStore } from "../../../store-
|
|
6
|
+
import { u as usePluginStore, c as clueUIPluginStore } from "../../../store-DHP48fQB.js";
|
|
7
7
|
import { useTranslation } from "react-i18next";
|
|
8
8
|
const Result = ({
|
|
9
9
|
pluginName,
|
|
@@ -2,7 +2,7 @@ import { jsx, jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import { Stack } from "@mui/material";
|
|
3
3
|
import { J as JSONViewer } from "../../index-DUEubgWN.js";
|
|
4
4
|
import Markdown from "../display/markdown/index.js";
|
|
5
|
-
import { u as usePluginStore, c as clueUIPluginStore } from "../../store-
|
|
5
|
+
import { u as usePluginStore, c as clueUIPluginStore } from "../../store-DHP48fQB.js";
|
|
6
6
|
import { useTranslation } from "react-i18next";
|
|
7
7
|
import ErrorBoundary from "../ErrorBoundary.js";
|
|
8
8
|
const FetcherResultView = ({
|
|
@@ -37,6 +37,10 @@ export interface ClueDatabaseContextProps {
|
|
|
37
37
|
* @returns An access token valid for use with the clue API.
|
|
38
38
|
*/
|
|
39
39
|
getToken?: () => string;
|
|
40
|
+
/**
|
|
41
|
+
* The base URL that refers to the clue API. leaving this empty will forward requests to the current origin.
|
|
42
|
+
*/
|
|
43
|
+
baseURL?: string;
|
|
40
44
|
}
|
|
41
45
|
export type ClueDatabaseContextType = ClueDatabase;
|
|
42
46
|
export declare const ClueDatabaseContext: import('react').Context<ClueDatabase>;
|
|
@@ -6,7 +6,8 @@ const ClueDatabaseProvider = ({
|
|
|
6
6
|
children,
|
|
7
7
|
database: _database,
|
|
8
8
|
databaseConfig,
|
|
9
|
-
getToken
|
|
9
|
+
getToken,
|
|
10
|
+
baseURL
|
|
10
11
|
}) => {
|
|
11
12
|
const [database, setDatabase] = useState();
|
|
12
13
|
const getTokenRef = useRef(getToken);
|
|
@@ -22,7 +23,7 @@ const ClueDatabaseProvider = ({
|
|
|
22
23
|
let cancelled = false;
|
|
23
24
|
if (!_database) {
|
|
24
25
|
console.warn("It is heavily suggested to initialize the database outside of the React component tree.");
|
|
25
|
-
buildDatabase({ ...databaseConfig, getToken: getTokenRef.current }).then((_db) => {
|
|
26
|
+
buildDatabase({ baseURL, ...databaseConfig, getToken: getTokenRef.current }).then((_db) => {
|
|
26
27
|
if (!cancelled) {
|
|
27
28
|
setDatabase(_db);
|
|
28
29
|
}
|
|
@@ -31,7 +32,7 @@ const ClueDatabaseProvider = ({
|
|
|
31
32
|
cancelled = true;
|
|
32
33
|
};
|
|
33
34
|
}
|
|
34
|
-
}, [_database, databaseConfig]);
|
|
35
|
+
}, [_database, baseURL, databaseConfig]);
|
|
35
36
|
return /* @__PURE__ */ jsx(ClueDatabaseContext.Provider, { value: database, children });
|
|
36
37
|
};
|
|
37
38
|
export {
|
|
@@ -17,6 +17,10 @@ export type ClueUIPluginProviderProps = {
|
|
|
17
17
|
* If true, do not load any plugins from the ClueUIPluginsRegistry, only load plugins passed in via props
|
|
18
18
|
*/
|
|
19
19
|
excludeBuiltInPlugins?: boolean;
|
|
20
|
+
/**
|
|
21
|
+
* If true, don't print the author information of loaded plugins
|
|
22
|
+
*/
|
|
23
|
+
silent?: boolean;
|
|
20
24
|
};
|
|
21
25
|
export type ClueUIPluginContextType = {
|
|
22
26
|
clueUIPluginStore: ClueUIPluginStore;
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
2
|
import ClueUIPluginsRegistry from "../plugins/registry.js";
|
|
3
|
-
import { c as clueUIPluginStore, P as PluginProvider } from "../store-
|
|
3
|
+
import { c as clueUIPluginStore, P as PluginProvider } from "../store-DHP48fQB.js";
|
|
4
4
|
import { createContext, useState, useEffect } from "react";
|
|
5
5
|
const ClueUIPluginContext = createContext(null);
|
|
6
6
|
const ClueUIPluginProvider = ({
|
|
7
7
|
plugins,
|
|
8
8
|
excludePlugins,
|
|
9
9
|
excludeBuiltInPlugins,
|
|
10
|
+
silent,
|
|
10
11
|
children
|
|
11
12
|
}) => {
|
|
12
13
|
const [pluginStore, setPluginStore] = useState(() => clueUIPluginStore.pluginStore);
|
|
@@ -17,7 +18,7 @@ const ClueUIPluginProvider = ({
|
|
|
17
18
|
const pluginModule = await pluginDef.loadPlugin();
|
|
18
19
|
if (abortController.signal.aborted) return;
|
|
19
20
|
const plugin = new pluginModule.default();
|
|
20
|
-
clueUIPluginStore.install(plugin);
|
|
21
|
+
clueUIPluginStore.install(plugin, silent);
|
|
21
22
|
} catch (err) {
|
|
22
23
|
if (abortController.signal.aborted) return;
|
|
23
24
|
console.error(`[ClueUIPluginProvider] Failed to load plugin: ${pluginDef.name ?? pluginDef.id}`, err);
|
|
@@ -50,7 +51,7 @@ const ClueUIPluginProvider = ({
|
|
|
50
51
|
}
|
|
51
52
|
});
|
|
52
53
|
return () => abortController.abort();
|
|
53
|
-
}, [excludeBuiltInPlugins, excludePlugins, plugins]);
|
|
54
|
+
}, [excludeBuiltInPlugins, excludePlugins, plugins, silent]);
|
|
54
55
|
return /* @__PURE__ */ jsx(ClueUIPluginContext.Provider, { value: { clueUIPluginStore }, children: /* @__PURE__ */ jsx(PluginProvider, { pluginStore, children }) });
|
|
55
56
|
};
|
|
56
57
|
export {
|
package/package.json
CHANGED
|
@@ -67,60 +67,60 @@
|
|
|
67
67
|
},
|
|
68
68
|
"type": "module",
|
|
69
69
|
"types": "main.d.ts",
|
|
70
|
-
"version": "1.5.0-dev.
|
|
70
|
+
"version": "1.5.0-dev.454",
|
|
71
71
|
"exports": {
|
|
72
72
|
".": "./main.js",
|
|
73
73
|
"./index.css": "./index.css",
|
|
74
74
|
"./en/*.json": "./en/*.json",
|
|
75
75
|
"./fr/*.json": "./fr/*.json",
|
|
76
|
-
"./icons/*": "./icons/*.js",
|
|
77
76
|
"./plugins/*": "./plugins/*.js",
|
|
78
|
-
"./
|
|
77
|
+
"./database/*": "./database/*.js",
|
|
78
|
+
"./database": "./database/index.js",
|
|
79
79
|
"./hooks/*": "./hooks/*.js",
|
|
80
|
+
"./data/*": "./data/*.js",
|
|
81
|
+
"./text/*": "./text/*.js",
|
|
80
82
|
"./utils/*": "./utils/*.js",
|
|
81
83
|
"./utils/*.json": "./utils/*.json",
|
|
82
|
-
"./
|
|
84
|
+
"./icons/*": "./icons/*.js",
|
|
83
85
|
"./types/*": "./types/*.js",
|
|
84
|
-
"./database/*": "./database/*.js",
|
|
85
|
-
"./database": "./database/index.js",
|
|
86
86
|
"./components/*": "./components/*.js",
|
|
87
|
-
"./plugins/graph/*": "./plugins/graph/*.js",
|
|
88
|
-
"./plugins/graph": "./plugins/graph/index.js",
|
|
89
|
-
"./plugins/file/*": "./plugins/file/*.js",
|
|
90
|
-
"./plugins/file": "./plugins/file/index.js",
|
|
91
87
|
"./plugins/image/*": "./plugins/image/*.js",
|
|
92
88
|
"./plugins/image": "./plugins/image/index.js",
|
|
89
|
+
"./plugins/file/*": "./plugins/file/*.js",
|
|
90
|
+
"./plugins/file": "./plugins/file/index.js",
|
|
93
91
|
"./plugins/markdown/*.md": "./plugins/markdown/*.md.js",
|
|
94
92
|
"./plugins/markdown": "./plugins/markdown/index.js",
|
|
95
93
|
"./plugins/json/*": "./plugins/json/*.js",
|
|
96
94
|
"./plugins/json": "./plugins/json/index.js",
|
|
95
|
+
"./plugins/graph/*": "./plugins/graph/*.js",
|
|
96
|
+
"./plugins/graph": "./plugins/graph/index.js",
|
|
97
97
|
"./plugins/test/*": "./plugins/test/*.js",
|
|
98
98
|
"./plugins/test": "./plugins/test/index.js",
|
|
99
99
|
"./plugins/graph/example/*": "./plugins/graph/example/*.js",
|
|
100
|
+
"./components/stats/*": "./components/stats/*.js",
|
|
100
101
|
"./components/enrichment/*": "./components/enrichment/*.js",
|
|
101
|
-
"./components/fetchers/*": "./components/fetchers/*.js",
|
|
102
|
-
"./components/actions/*": "./components/actions/*.js",
|
|
103
102
|
"./components/group/*": "./components/group/*.js",
|
|
104
|
-
"./components/stats/*": "./components/stats/*.js",
|
|
105
103
|
"./components/display/*": "./components/display/*.js",
|
|
106
|
-
"./components/
|
|
107
|
-
"./components/actions
|
|
108
|
-
"./components/actions/formats": "./components/actions/formats/index.js",
|
|
109
|
-
"./components/display/icons/*": "./components/display/icons/*.js",
|
|
110
|
-
"./components/display/graph/*": "./components/display/graph/*.js",
|
|
111
|
-
"./components/display/graph": "./components/display/graph/index.js",
|
|
104
|
+
"./components/fetchers/*": "./components/fetchers/*.js",
|
|
105
|
+
"./components/actions/*": "./components/actions/*.js",
|
|
112
106
|
"./components/display/markdown/*.md": "./components/display/markdown/*.md.js",
|
|
113
107
|
"./components/display/markdown": "./components/display/markdown/index.js",
|
|
108
|
+
"./components/display/icons/*": "./components/display/icons/*.js",
|
|
114
109
|
"./components/display/json/*": "./components/display/json/*.js",
|
|
115
110
|
"./components/display/json": "./components/display/json/index.js",
|
|
116
|
-
"./components/display/graph
|
|
111
|
+
"./components/display/graph/*": "./components/display/graph/*.js",
|
|
112
|
+
"./components/display/graph": "./components/display/graph/index.js",
|
|
117
113
|
"./components/display/graph/elements/*": "./components/display/graph/elements/*.js",
|
|
114
|
+
"./components/display/graph/visualizations/*": "./components/display/graph/visualizations/*.js",
|
|
115
|
+
"./components/display/graph/visualizations/panels/*": "./components/display/graph/visualizations/panels/*.js",
|
|
118
116
|
"./components/display/graph/visualizations/icons/*": "./components/display/graph/visualizations/icons/*.js",
|
|
119
117
|
"./components/display/graph/visualizations/icons": "./components/display/graph/visualizations/icons/index.js",
|
|
120
|
-
"./components/display/graph/visualizations/panels/*": "./components/display/graph/visualizations/panels/*.js",
|
|
121
118
|
"./components/display/graph/visualizations/cloud/*": "./components/display/graph/visualizations/cloud/*.js",
|
|
122
119
|
"./components/display/graph/visualizations/cloud": "./components/display/graph/visualizations/cloud/index.js",
|
|
123
120
|
"./components/display/graph/visualizations/tree/*": "./components/display/graph/visualizations/tree/*.js",
|
|
124
|
-
"./components/display/graph/visualizations/tree": "./components/display/graph/visualizations/tree/index.js"
|
|
121
|
+
"./components/display/graph/visualizations/tree": "./components/display/graph/visualizations/tree/index.js",
|
|
122
|
+
"./components/actions/formats/*": "./components/actions/formats/*.js",
|
|
123
|
+
"./components/actions/formats": "./components/actions/formats/index.js",
|
|
124
|
+
"./components/actions/form/*": "./components/actions/form/*.js"
|
|
125
125
|
}
|
|
126
126
|
}
|
package/plugins/store.d.ts
CHANGED
|
@@ -15,7 +15,7 @@ export declare class ClueUIPluginStore {
|
|
|
15
15
|
actionPlugins: string[];
|
|
16
16
|
fetcherPlugins: string[];
|
|
17
17
|
reset(): void;
|
|
18
|
-
install(plugin: ClueUIPlugin): void;
|
|
18
|
+
install(plugin: ClueUIPlugin, silent?: boolean): void;
|
|
19
19
|
/**
|
|
20
20
|
* Get plugins based on the given criteria.
|
|
21
21
|
*
|
package/plugins/store.js
CHANGED
|
@@ -2060,11 +2060,11 @@ class ClueUIPluginStore {
|
|
|
2060
2060
|
this.actionPlugins = [];
|
|
2061
2061
|
this.fetcherPlugins = [];
|
|
2062
2062
|
}
|
|
2063
|
-
install(plugin) {
|
|
2063
|
+
install(plugin, silent = false) {
|
|
2064
2064
|
if (this.plugins.includes(plugin.name)) {
|
|
2065
2065
|
return;
|
|
2066
2066
|
}
|
|
2067
|
-
{
|
|
2067
|
+
if (!silent) {
|
|
2068
2068
|
console.log(`Installing plugin ${plugin.getPluginName()} by ${plugin.author}`);
|
|
2069
2069
|
}
|
|
2070
2070
|
this.pluginStore.install(plugin);
|