@legalplace/wizardx-core 4.42.10-nightly.20251126142157 → 4.42.10-nightly.20251126143216
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/README.md +1 -1
- package/dist/PluginLoader.d.ts +1 -1
- package/dist/PluginLoader.js +11 -1
- package/package.json +1 -1
package/README.md
CHANGED
package/dist/PluginLoader.d.ts
CHANGED
|
@@ -18,7 +18,7 @@ export type ReplaceFragmentPropsType = {
|
|
|
18
18
|
};
|
|
19
19
|
export declare const ReplaceFragment: ({ replacerName, fragmentName, children, }: ReplaceFragmentPropsType) => import("react/jsx-runtime").JSX.Element;
|
|
20
20
|
export declare function registerReplacer(replacerName: string, Replacer: ReactComponent<any>): void;
|
|
21
|
-
export declare function loadPlugins(plugins?: Record<string, (() => Promise<IPlugin>) | Promise<IPlugin> | IPlugin>): Promise<any>;
|
|
21
|
+
export declare function loadPlugins(plugins?: Record<string, string | (() => Promise<IPlugin>) | Promise<IPlugin> | IPlugin>): Promise<any>;
|
|
22
22
|
export declare function getPluginsReducers(): Record<string, Reducer<Record<string, any>, any>>;
|
|
23
23
|
export declare function getPluginsAdditionalRoutes(): IPluginConfig[];
|
|
24
24
|
export declare function getPluginsSagas(): Saga[];
|
package/dist/PluginLoader.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Fragment as _Fragment, jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import React from "react";
|
|
3
3
|
import { getStore } from "./redux/store";
|
|
4
|
+
import Globals from "./Globals";
|
|
4
5
|
let pluginsStoreReducers = {};
|
|
5
6
|
let pluginsSagas = [];
|
|
6
7
|
const replacers = {};
|
|
@@ -88,7 +89,16 @@ export function loadPlugins(plugins) {
|
|
|
88
89
|
Object.keys(plugins).forEach((key) => {
|
|
89
90
|
const pluginValue = plugins[key];
|
|
90
91
|
let pluginPromise;
|
|
91
|
-
if (typeof pluginValue === "
|
|
92
|
+
if (typeof pluginValue === "string") {
|
|
93
|
+
try {
|
|
94
|
+
pluginPromise = Promise.resolve(Globals.loadPlugin(key));
|
|
95
|
+
}
|
|
96
|
+
catch (error) {
|
|
97
|
+
console.error(`Failed to load plugin "${key}" using Globals.loadPlugin:`, error);
|
|
98
|
+
return;
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
else if (typeof pluginValue === "function") {
|
|
92
102
|
try {
|
|
93
103
|
pluginPromise = Promise.resolve(pluginValue());
|
|
94
104
|
}
|