@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 CHANGED
@@ -288,4 +288,4 @@ For issues and questions:
288
288
 
289
289
  **Version**: 4.43.0+
290
290
  **Last Updated**: Nov 26, 2025
291
- **Status**: ✅ Production Ready
291
+ **Status**: ✅ Production Ready
@@ -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[];
@@ -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 === "function") {
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, _k;
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
- if (!getConfig().disableRemoteConfig &&
59
- ((_b = clientConfigResponse.clientConfig.metadata) === null || _b === void 0 ? void 0 : _b.plugins)) {
60
- yield call(loadPlugins, (_c = clientConfigResponse.clientConfig.metadata) === null || _c === void 0 ? void 0 : _c.plugins);
61
- }
62
- else
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
- ((_f = (_e = clientConfigResponse.clientConfig.metadata) === null || _e === void 0 ? void 0 : _e.theme) === null || _f === void 0 ? void 0 : _f.name)) {
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 ((_h = (_g = clientConfigResponse.clientConfig.metadata) === null || _g === void 0 ? void 0 : _g.appStates) === null || _h === void 0 ? void 0 : _h.length) {
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 = ((_j = clientConfigResponse.clientConfig.metadata) === null || _j === void 0 ? void 0 : _j.appStates) ||
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: ((_k = clientConfigResponse.clientConfig.metadata) === null || _k === void 0 ? void 0 : _k.enableShadowInstance) || false,
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) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@legalplace/wizardx-core",
3
- "version": "4.42.10-nightly.20251126142157",
3
+ "version": "4.42.10-nightly.20251126144127",
4
4
  "author": "Moncef Hammou (moncef@legalplace.fr)",
5
5
  "license": "MIT",
6
6
  "files": [