@legalplace/wizardx-core 4.42.10-nightly.20251125161109 → 4.42.10-nightly.20251125161338
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/dist/PluginLoader.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
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
4
|
let pluginsStoreReducers = {};
|
|
@@ -8,6 +8,9 @@ export const PluginLoader = (props) => {
|
|
|
8
8
|
const { anchor } = props;
|
|
9
9
|
const plugins = getStore().getState().pluginsStore;
|
|
10
10
|
let Plugins = [];
|
|
11
|
+
if (!plugins || !plugins.config || !Array.isArray(plugins.config)) {
|
|
12
|
+
return _jsx(_Fragment, {});
|
|
13
|
+
}
|
|
11
14
|
const matchedPlugins = plugins.config.filter((p) => {
|
|
12
15
|
if (p.anchor.length !== anchor.length)
|
|
13
16
|
return false;
|
|
@@ -121,11 +124,13 @@ export function getPluginsReducers() {
|
|
|
121
124
|
export function getPluginsAdditionalRoutes() {
|
|
122
125
|
const routes = [];
|
|
123
126
|
const plugins = getStore().getState().pluginsStore;
|
|
124
|
-
plugins.config.
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
127
|
+
if ((plugins === null || plugins === void 0 ? void 0 : plugins.config) && Array.isArray(plugins.config)) {
|
|
128
|
+
plugins.config.forEach((p) => {
|
|
129
|
+
if (p.anchor[0] === "routes") {
|
|
130
|
+
routes.push(p);
|
|
131
|
+
}
|
|
132
|
+
});
|
|
133
|
+
}
|
|
129
134
|
return routes;
|
|
130
135
|
}
|
|
131
136
|
export function getPluginsSagas() {
|
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
import { getPluginsStoreReducers } from "../../PluginLoader";
|
|
2
2
|
import { RESET_STATE } from "../constants/app";
|
|
3
|
-
|
|
3
|
+
const initialState = {
|
|
4
|
+
config: [],
|
|
5
|
+
};
|
|
6
|
+
export const pluginsStoreReducer = (state = initialState, action) => {
|
|
4
7
|
if (action.type === RESET_STATE)
|
|
5
|
-
return
|
|
8
|
+
return initialState;
|
|
6
9
|
const pluginsStoreReducers = getPluginsStoreReducers();
|
|
7
10
|
const plugins = Object.keys(pluginsStoreReducers);
|
|
8
11
|
const newState = Object.assign({}, state);
|