@legalplace/wizardx-core 4.42.10-nightly.20251126142157 → 4.42.10-nightly.20251126144127
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/dist/redux/sagas/fetchModel.js +10 -12
- 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
|
}
|
|
@@ -38,7 +38,7 @@ function* setFetchModelToNonBlocking(firstCurrentAppState) {
|
|
|
38
38
|
yield put(fetchModelNonBlockingAction());
|
|
39
39
|
}
|
|
40
40
|
function* getClientConfig(permalink, uniqid) {
|
|
41
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j
|
|
41
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
42
42
|
if (uniqid) {
|
|
43
43
|
yield call(fetch, ...checkInstanceModel(uniqid));
|
|
44
44
|
}
|
|
@@ -55,32 +55,30 @@ function* getClientConfig(permalink, uniqid) {
|
|
|
55
55
|
if (((_a = theme === null || theme === void 0 ? void 0 : theme.params) === null || _a === void 0 ? void 0 : _a.hasPartner) && clientConfigResponse.clientConfig.name) {
|
|
56
56
|
updateConfig(Object.assign(Object.assign({}, getConfig()), { brand: Object.assign(Object.assign({}, getConfig().brand), { name: clientConfigResponse.clientConfig.name }) }));
|
|
57
57
|
}
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
yield call(loadPlugins);
|
|
64
|
-
updateConfig(Object.assign(Object.assign({}, getConfig()), { authCookieDomain: ((_d = clientConfigResponse.clientConfig.metadata) === null || _d === void 0 ? void 0 : _d.authCookieDomain) ||
|
|
58
|
+
const pluginsToLoad = !getConfig().disableRemoteConfig && ((_b = clientConfigResponse.clientConfig.metadata) === null || _b === void 0 ? void 0 : _b.plugins)
|
|
59
|
+
? clientConfigResponse.clientConfig.metadata.plugins
|
|
60
|
+
: getConfig().plugins;
|
|
61
|
+
yield call(loadPlugins, pluginsToLoad);
|
|
62
|
+
updateConfig(Object.assign(Object.assign({}, getConfig()), { authCookieDomain: ((_c = clientConfigResponse.clientConfig.metadata) === null || _c === void 0 ? void 0 : _c.authCookieDomain) ||
|
|
65
63
|
process.env.REACT_APP_COOKIES_ALL_SUBDOMAIN }));
|
|
66
64
|
if (/compactTheme/.test(window.location.href)) {
|
|
67
65
|
yield call(setWizardTheme, { name: "compact" });
|
|
68
66
|
}
|
|
69
67
|
else if (!getConfig().disableRemoteConfig &&
|
|
70
|
-
((
|
|
68
|
+
((_e = (_d = clientConfigResponse.clientConfig.metadata) === null || _d === void 0 ? void 0 : _d.theme) === null || _e === void 0 ? void 0 : _e.name)) {
|
|
71
69
|
yield call(setWizardTheme, clientConfigResponse.clientConfig.metadata.theme);
|
|
72
70
|
}
|
|
73
71
|
else {
|
|
74
72
|
yield call(loadTheme);
|
|
75
73
|
}
|
|
76
|
-
if ((
|
|
74
|
+
if ((_g = (_f = clientConfigResponse.clientConfig.metadata) === null || _f === void 0 ? void 0 : _f.appStates) === null || _g === void 0 ? void 0 : _g.length) {
|
|
77
75
|
yield put(updateAvailableAppStatesAction(clientConfigResponse.clientConfig.metadata.appStates));
|
|
78
76
|
}
|
|
79
|
-
const availableAppStates = ((
|
|
77
|
+
const availableAppStates = ((_h = clientConfigResponse.clientConfig.metadata) === null || _h === void 0 ? void 0 : _h.appStates) ||
|
|
80
78
|
getConfig().appStates;
|
|
81
79
|
return {
|
|
82
80
|
appStates: availableAppStates,
|
|
83
|
-
enableShadowInstance: ((
|
|
81
|
+
enableShadowInstance: ((_j = clientConfigResponse.clientConfig.metadata) === null || _j === void 0 ? void 0 : _j.enableShadowInstance) || false,
|
|
84
82
|
};
|
|
85
83
|
}
|
|
86
84
|
function* getWizardConfig(permalink, uniqidParam, prefix, queryParams) {
|