@cccsaurora/clue-ui 1.4.0-dev.448 → 1.4.1-dev.451
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/ClueUIPluginContext.d.ts +4 -0
- package/hooks/ClueUIPluginContext.js +4 -3
- package/package.json +1 -1
- 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 = ({
|
|
@@ -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
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);
|