@legalplace/wizardx-core 3.1.4 → 3.2.1
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/CHANGELOG.md +25 -0
- package/dist/PluginLoader.d.ts +3 -0
- package/dist/PluginLoader.js +7 -1
- package/dist/helpers/outputsParsing.d.ts +2 -2
- package/dist/libs/InputsInitiator.d.ts +2 -2
- package/dist/redux/index.d.ts +1 -0
- package/dist/redux/index.js +1 -0
- package/dist/redux/sagas/index.d.ts +1 -0
- package/dist/redux/sagas/index.js +1 -0
- package/dist/redux/sagas/initPlugins.d.ts +2 -0
- package/dist/redux/sagas/initPlugins.js +24 -0
- package/dist/redux/sagas/middleware.d.ts +1 -0
- package/dist/redux/sagas/middleware.js +3 -0
- package/dist/redux/sagas/runner.js +2 -0
- package/dist/redux/store.js +2 -2
- package/package.json +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,31 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [3.2.1](https://git.legalplace.eu/legalplace/monorepo/compare/@legalplace/wizardx-core@3.2.0...@legalplace/wizardx-core@3.2.1) (2023-03-14)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @legalplace/wizardx-core
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
# [3.2.0](https://git.legalplace.eu/legalplace/monorepo/compare/@legalplace/wizardx-core@3.1.4...@legalplace/wizardx-core@3.2.0) (2023-03-08)
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
### Bug Fixes
|
|
18
|
+
|
|
19
|
+
* fix build api[#6208](https://git.legalplace.eu/legalplace/monorepo/issues/6208) ([67e81f9](https://git.legalplace.eu/legalplace/monorepo/commits/67e81f948e320c944aaaf6de848d5d25aafcdd6f))
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
### Features
|
|
23
|
+
|
|
24
|
+
* refactoring model duplication api[#6208](https://git.legalplace.eu/legalplace/monorepo/issues/6208) ([6186eba](https://git.legalplace.eu/legalplace/monorepo/commits/6186eba1ad49ee4d5606e9b11ec8b84fcd53d138))
|
|
25
|
+
* refactoring softSocial plugin into Kanoon (WIP) api[#6208](https://git.legalplace.eu/legalplace/monorepo/issues/6208) ([94f0642](https://git.legalplace.eu/legalplace/monorepo/commits/94f0642946793adc7310af2c0de556a55aaae62b))
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
|
|
6
31
|
## [3.1.4](https://git.legalplace.eu/legalplace/monorepo/compare/@legalplace/wizardx-core@3.1.3...@legalplace/wizardx-core@3.1.4) (2023-03-02)
|
|
7
32
|
|
|
8
33
|
**Note:** Version bump only for package @legalplace/wizardx-core
|
package/dist/PluginLoader.d.ts
CHANGED
|
@@ -2,8 +2,11 @@ import type { Props } from "react";
|
|
|
2
2
|
import React from "react";
|
|
3
3
|
import type { LoadableComponent } from "@loadable/component";
|
|
4
4
|
import type { Action, AnyAction, CombinedState, Reducer } from "redux";
|
|
5
|
+
import type { Saga } from "redux-saga";
|
|
5
6
|
declare let pluginsStoreReducers: Record<string, Reducer<CombinedState<Record<string, any>>, AnyAction>>;
|
|
7
|
+
declare const pluginsStoreSagas: Record<string, Saga[]>;
|
|
6
8
|
export declare const getPluginsStoreReducers: () => Readonly<typeof pluginsStoreReducers>;
|
|
9
|
+
export declare const getPluginsStoreSagas: () => Readonly<typeof pluginsStoreSagas>;
|
|
7
10
|
export declare type PluginAppStatesRegisterFunction = (currentAppStates: string[]) => string[];
|
|
8
11
|
export declare type PluginsPageAppStatesType = Record<string, string>;
|
|
9
12
|
export declare type actionOverrideFunction = (action: Action) => Action;
|
package/dist/PluginLoader.js
CHANGED
|
@@ -20,7 +20,9 @@ let reduxAnchors = {};
|
|
|
20
20
|
let actionOverrideAnchor = {};
|
|
21
21
|
let replacers = {};
|
|
22
22
|
let pluginsStoreReducers = {};
|
|
23
|
+
const pluginsStoreSagas = {};
|
|
23
24
|
export const getPluginsStoreReducers = () => pluginsStoreReducers;
|
|
25
|
+
export const getPluginsStoreSagas = () => pluginsStoreSagas;
|
|
24
26
|
let PluginsAppStatesRegistrers = [];
|
|
25
27
|
let PluginsPageAppStates = {};
|
|
26
28
|
let PluginsAppStatesComponents = {};
|
|
@@ -118,6 +120,9 @@ const loadPluginFiles = (pluginsList) => __awaiter(void 0, void 0, void 0, funct
|
|
|
118
120
|
if (anchor === "reduxStore" && anchors[anchor].reducer) {
|
|
119
121
|
pluginsStoreReducers[plugin] = anchors[anchor].reducer;
|
|
120
122
|
}
|
|
123
|
+
if (anchor === "reduxStore" && anchors[anchor].sagas) {
|
|
124
|
+
pluginsStoreSagas[plugin] = anchors[anchor].sagas;
|
|
125
|
+
}
|
|
121
126
|
if (!Object.prototype.hasOwnProperty.call(globalAnchors, anchor))
|
|
122
127
|
globalAnchors[anchor] = [];
|
|
123
128
|
globalAnchors[anchor].push(anchors[anchor]);
|
|
@@ -125,7 +130,8 @@ const loadPluginFiles = (pluginsList) => __awaiter(void 0, void 0, void 0, funct
|
|
|
125
130
|
if (typeof anchors.onLoad === "function")
|
|
126
131
|
anchors.onLoad();
|
|
127
132
|
});
|
|
128
|
-
if (Object.keys(pluginsStoreReducers).length > 0
|
|
133
|
+
if (Object.keys(pluginsStoreReducers).length > 0 ||
|
|
134
|
+
Object.keys(pluginsStoreSagas).length > 0) {
|
|
129
135
|
getStore().dispatch({ type: INIT_PLUGINS });
|
|
130
136
|
}
|
|
131
137
|
});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { OptionsVariablesType } from "../libs/InputsInitiator";
|
|
2
2
|
export declare type relVarsValsT = Record<string, string | number>;
|
|
3
3
|
export declare type getRelatedVarsT = (optionId: number, index: number, variables: number[]) => relVarsValsT;
|
|
4
4
|
export declare const getRelatedVariablesValues: getRelatedVarsT;
|
|
@@ -11,5 +11,5 @@ export declare type parseVariableLabelT = (id: number, index: number) => string;
|
|
|
11
11
|
export declare const parseVariableLabel: parseVariableLabelT;
|
|
12
12
|
export declare type parseOptionLabelT = (id: number, index: number) => string;
|
|
13
13
|
export declare const parseOptionLabel: parseOptionLabelT;
|
|
14
|
-
export declare type parseRawT = (text: string, inputs?:
|
|
14
|
+
export declare type parseRawT = (text: string, inputs?: OptionsVariablesType, placeholder?: string) => string;
|
|
15
15
|
export declare const parseRawWithVariables: parseRawT;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { StateType } from "../types/State.type";
|
|
2
|
-
export declare type
|
|
2
|
+
export declare type OptionsVariablesType = {
|
|
3
3
|
options: {
|
|
4
4
|
[key: string]: boolean[];
|
|
5
5
|
};
|
|
@@ -11,7 +11,7 @@ export declare class IntputsInitiator {
|
|
|
11
11
|
private inputs;
|
|
12
12
|
private references;
|
|
13
13
|
private ovc;
|
|
14
|
-
constructor(references: StateType.References, ovc:
|
|
14
|
+
constructor(references: StateType.References, ovc: OptionsVariablesType | null);
|
|
15
15
|
getInputs(): StateType.Inputs;
|
|
16
16
|
private setMultiples;
|
|
17
17
|
private initOptionsInputs;
|
package/dist/redux/index.d.ts
CHANGED
package/dist/redux/index.js
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./middleware";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./middleware";
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { call, takeLeading } from "redux-saga/effects";
|
|
2
|
+
import { getPluginsStoreSagas } from "../../PluginLoader";
|
|
3
|
+
import { INIT_PLUGINS } from "../constants";
|
|
4
|
+
import { getSagaMiddleware } from "./middleware";
|
|
5
|
+
function* initPluginsDecorator() {
|
|
6
|
+
try {
|
|
7
|
+
const pluginsStoreSagas = getPluginsStoreSagas();
|
|
8
|
+
const sagaMiddleware = getSagaMiddleware();
|
|
9
|
+
yield call(() => {
|
|
10
|
+
Object.keys(pluginsStoreSagas).forEach((plugin) => {
|
|
11
|
+
pluginsStoreSagas[plugin].forEach((saga) => {
|
|
12
|
+
sagaMiddleware.run(saga);
|
|
13
|
+
});
|
|
14
|
+
});
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
catch (e) {
|
|
18
|
+
console.error(e);
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
function* initPluginsSaga() {
|
|
22
|
+
yield takeLeading(INIT_PLUGINS, initPluginsDecorator);
|
|
23
|
+
}
|
|
24
|
+
export default initPluginsSaga;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const getSagaMiddleware: () => import("@redux-saga/core").SagaMiddleware<object>;
|
|
@@ -4,6 +4,7 @@ import saveDataSaga from "./saveData";
|
|
|
4
4
|
import homogeneousRadioInputsSaga from "./homogeneousRadioInputsSaga";
|
|
5
5
|
import setUserEmailSaga from "./setUserEmail";
|
|
6
6
|
import initInputsSaga from "./initInputs";
|
|
7
|
+
import initPluginsSaga from "./initPlugins";
|
|
7
8
|
const sagas = [
|
|
8
9
|
fetchModelSaga,
|
|
9
10
|
setDefaultsSaga,
|
|
@@ -11,6 +12,7 @@ const sagas = [
|
|
|
11
12
|
setUserEmailSaga,
|
|
12
13
|
homogeneousRadioInputsSaga,
|
|
13
14
|
initInputsSaga,
|
|
15
|
+
initPluginsSaga,
|
|
14
16
|
];
|
|
15
17
|
export const sagasRunner = (sagaMiddleware) => {
|
|
16
18
|
sagas.forEach((saga) => sagaMiddleware.run(saga));
|
package/dist/redux/store.js
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { combineReducers, createStore, applyMiddleware } from "redux";
|
|
2
2
|
import { connectRouter, routerMiddleware } from "connected-react-router";
|
|
3
3
|
import { composeWithDevTools } from "redux-devtools-extension";
|
|
4
|
-
import createSagaMiddleware from "@redux-saga/core";
|
|
5
4
|
import { appReducer } from "./reducers/app";
|
|
6
5
|
import { userReducer } from "./reducers/user";
|
|
7
6
|
import { referencesReducer } from "./reducers/references";
|
|
@@ -25,6 +24,7 @@ import smartscriptMiddleware from "./middlewares/smartscriptMiddleware";
|
|
|
25
24
|
import thirdPartyScriptsMiddleware from "./middlewares/thirdpartyScriptsMiddleware";
|
|
26
25
|
import { pluginsStoreReducer } from "./reducers/pluginsStore";
|
|
27
26
|
import { DANGEROUS_DESTROY_STORE } from "./constants/app";
|
|
27
|
+
import { getSagaMiddleware } from "./sagas/middleware";
|
|
28
28
|
let store;
|
|
29
29
|
let history = null;
|
|
30
30
|
export const createAppStore = (historyType = "browser") => {
|
|
@@ -45,7 +45,7 @@ export const createAppStore = (historyType = "browser") => {
|
|
|
45
45
|
return wizardxReducers(undefined, action);
|
|
46
46
|
return wizardxReducers(state, action);
|
|
47
47
|
};
|
|
48
|
-
const sagaMiddleware =
|
|
48
|
+
const sagaMiddleware = getSagaMiddleware();
|
|
49
49
|
const appliedMiddlewares = applyMiddleware(pluginsHookMiddleware, routerMiddleware(history), sagaMiddleware, paginationWatcherMiddleware, selectorsMiddleware, conditionsWatcherMiddleware, prefillerWatcherMiddleware, evaluationsWatcherMiddleware, multiplesActionsMiddleware, mandatoriesWatcherMiddleware, smartscriptMiddleware, thirdPartyScriptsMiddleware);
|
|
50
50
|
const middlewares = Globals.appEnv !== "production"
|
|
51
51
|
? composeWithDevTools(appliedMiddlewares)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@legalplace/wizardx-core",
|
|
3
|
-
"version": "3.1
|
|
3
|
+
"version": "3.2.1",
|
|
4
4
|
"author": "Moncef Hammou (moncef@legalplace.fr)",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"files": [
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
"@legalplace/lp-events": "1.14.0",
|
|
25
25
|
"@legalplace/lplogic": "^2.1.6",
|
|
26
26
|
"@legalplace/model-healthcheck": "^1.1.5",
|
|
27
|
-
"@legalplace/referencesparser": "^2.3.
|
|
27
|
+
"@legalplace/referencesparser": "^2.3.15",
|
|
28
28
|
"@legalplace/storybook": "^2.171.0",
|
|
29
29
|
"@legalplace/typeorm-constants": "^2.44.1",
|
|
30
30
|
"@loadable/component": "^5.15.0",
|
|
@@ -57,7 +57,7 @@
|
|
|
57
57
|
"@legalplace/eslint-config": "^2.2.0",
|
|
58
58
|
"@legalplace/models-v3-types": "^4.1.2",
|
|
59
59
|
"@legalplace/prettier-config": "^2.1.3",
|
|
60
|
-
"@legalplace/typeorm-entities": "^4.8.
|
|
60
|
+
"@legalplace/typeorm-entities": "^4.8.3",
|
|
61
61
|
"@swc-node/jest": "^1.3.2",
|
|
62
62
|
"@swc/core": "^1.2.93",
|
|
63
63
|
"@swc/jest": "^0.2.4",
|
|
@@ -95,5 +95,5 @@
|
|
|
95
95
|
"*.test.ts",
|
|
96
96
|
"*.test.tsx"
|
|
97
97
|
],
|
|
98
|
-
"gitHead": "
|
|
98
|
+
"gitHead": "113096c94842e11898fa615bbda2b610bb1a2d54"
|
|
99
99
|
}
|