@legalplace/wizardx-core 4.42.10-nightly.20251125120616 → 4.42.11
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 -376
- package/dist/App.d.ts +6 -1
- package/dist/App.js +7 -2
- package/dist/App.test.js +37 -0
- package/dist/Loader.d.ts +1 -1
- package/dist/Loader.js +1 -1
- package/dist/PluginLoader.d.ts +36 -21
- package/dist/PluginLoader.js +227 -90
- package/dist/PluginLoader.test.d.ts +1 -0
- package/dist/PluginLoader.test.js +52 -0
- package/dist/Shimmer.d.ts +11 -8
- package/dist/Shimmer.js +4 -4
- package/dist/ThemeLoader.d.ts +8 -8
- package/dist/ThemeLoader.test.d.ts +2 -0
- package/dist/ThemeLoader.test.js +65 -0
- package/dist/components/PluginRoute.d.ts +2 -2
- package/dist/components/PluginRoute.js +4 -3
- package/dist/components/SmartScript.d.ts +6 -2
- package/dist/components/SmartScript.js +1 -1
- package/dist/components/UserLocked/UserLockedComponent.js +2 -2
- package/dist/components/View.d.ts +3 -3
- package/dist/components/View.js +7 -5
- package/dist/components/View.test.d.ts +2 -0
- package/dist/components/View.test.js +84 -0
- package/dist/componentsConnectors/connectBox.d.ts +6 -4
- package/dist/componentsConnectors/connectBox.test.d.ts +1 -0
- package/dist/componentsConnectors/connectBox.test.js +218 -0
- package/dist/componentsConnectors/connectDocument.d.ts +6 -4
- package/dist/componentsConnectors/connectDocument.test.d.ts +1 -0
- package/dist/componentsConnectors/connectDocument.test.js +95 -0
- package/dist/componentsConnectors/connectHeader.d.ts +6 -4
- package/dist/componentsConnectors/connectMetaTitle.d.ts +7 -3
- package/dist/componentsConnectors/connectMetaTitle.test.d.ts +1 -0
- package/dist/componentsConnectors/connectMetaTitle.test.js +32 -0
- package/dist/componentsConnectors/connectOption.d.ts +7 -5
- package/dist/componentsConnectors/connectPagination.d.ts +7 -5
- package/dist/componentsConnectors/connectPreview.d.ts +7 -3
- package/dist/componentsConnectors/connectProgress.d.ts +6 -4
- package/dist/componentsConnectors/connectRootOption.d.ts +7 -5
- package/dist/componentsConnectors/connectSection.d.ts +6 -4
- package/dist/componentsConnectors/connectSummary.d.ts +9 -5
- package/dist/componentsConnectors/connectSummaryItem.d.ts +6 -4
- package/dist/componentsConnectors/connectTermsheet.js +1 -1
- package/dist/componentsConnectors/connectVariable.d.ts +8 -6
- package/dist/componentsConnectors/connectWizardWrapper.d.ts +6 -4
- package/dist/componentsConnectors/connector/componentConnector.d.ts +10 -7
- package/dist/componentsConnectors/connector/componentConnector.js +3 -3
- package/dist/componentsConnectors/library.d.ts +81 -47
- package/dist/config.test.d.ts +1 -0
- package/dist/config.test.js +54 -0
- package/dist/helpers/activitiesHelper.d.ts +3 -3
- package/dist/helpers/autocomplete.helper.d.ts +2 -2
- package/dist/helpers/autocomplete.helper.js +1 -1
- package/dist/helpers/autosave.helper.d.ts +13 -3
- package/dist/helpers/autosave.helper.js +70 -3
- package/dist/helpers/inpiCitiesHelper.js +1 -1
- package/dist/helpers/outputsParsing.d.ts +9 -9
- package/dist/hooks/useDispatch.d.ts +1 -1
- package/dist/hooks/usePrevious.js +1 -1
- package/dist/index.d.ts +0 -3
- package/dist/index.js +0 -3
- package/dist/libs/ConditionsRunner.d.ts +1 -1
- package/dist/libs/Formatter/FormatAddress.d.ts +1 -1
- package/dist/libs/InputsInitiator.d.ts +1 -1
- package/dist/libs/NumAuto.test.d.ts +1 -0
- package/dist/libs/NumAuto.test.js +43 -0
- package/dist/libs/PathReader.d.ts +1 -96
- package/dist/libs/PathReader.js +2 -1
- package/dist/libs/SectionValidity.test.d.ts +1 -0
- package/dist/libs/SectionValidity.test.js +116 -0
- package/dist/libs/SmartScriptStore.d.ts +6 -6
- package/dist/redux/actions/app.d.ts +1 -1
- package/dist/redux/actions/app.test.d.ts +1 -0
- package/dist/redux/actions/app.test.js +90 -0
- package/dist/redux/actions/conditions.test.d.ts +1 -0
- package/dist/redux/actions/conditions.test.js +68 -0
- package/dist/redux/actions/inputs.d.ts +1 -1
- package/dist/redux/actions/inputs.test.d.ts +1 -0
- package/dist/redux/actions/inputs.test.js +53 -0
- package/dist/redux/actions/library.d.ts +21 -15
- package/dist/redux/actions/references.d.ts +2 -2
- package/dist/redux/actions/references.test.d.ts +1 -0
- package/dist/redux/actions/references.test.js +43 -0
- package/dist/redux/actions/sagas/data.d.ts +1 -1
- package/dist/redux/actions/sagas/data.test.d.ts +1 -0
- package/dist/redux/actions/sagas/data.test.js +11 -0
- package/dist/redux/actions/sagas/model.test.d.ts +1 -0
- package/dist/redux/actions/sagas/model.test.js +11 -0
- package/dist/redux/actions/sagas/user.d.ts +1 -1
- package/dist/redux/actions/user.test.d.ts +1 -0
- package/dist/redux/actions/user.test.js +16 -0
- package/dist/redux/listeners/subscriber.d.ts +1 -1
- package/dist/redux/listeners/subscriber.test.d.ts +1 -0
- package/dist/redux/listeners/subscriber.test.js +31 -0
- package/dist/redux/middlewares/conditionsWatcherMiddleware.d.ts +1 -1
- package/dist/redux/middlewares/conditionsWatcherMiddleware.test.d.ts +1 -0
- package/dist/redux/middlewares/conditionsWatcherMiddleware.test.js +330 -0
- package/dist/redux/middlewares/evaluationsWatcherMiddleware.d.ts +1 -1
- package/dist/redux/middlewares/evaluationsWatcherMiddleware.test.d.ts +1 -0
- package/dist/redux/middlewares/evaluationsWatcherMiddleware.test.js +242 -0
- package/dist/redux/middlewares/mandatoriesWatcherMiddleware.d.ts +1 -1
- package/dist/redux/middlewares/multiplesActionsMiddleware.d.ts +1 -1
- package/dist/redux/middlewares/multiplesActionsMiddleware.test.d.ts +1 -0
- package/dist/redux/middlewares/multiplesActionsMiddleware.test.js +209 -0
- package/dist/redux/middlewares/paginationWatcherMiddleware.d.ts +2 -2
- package/dist/redux/middlewares/pluginsHookMiddleware.d.ts +2 -1
- package/dist/redux/middlewares/pluginsHookMiddleware.js +7 -1
- package/dist/redux/middlewares/prefillerWatcherMiddleware.d.ts +1 -1
- package/dist/redux/middlewares/prefillerWatcherMiddleware.test.d.ts +1 -0
- package/dist/redux/middlewares/prefillerWatcherMiddleware.test.js +84 -0
- package/dist/redux/middlewares/smartscriptMiddleware.d.ts +1 -1
- package/dist/redux/middlewares/smartscriptMiddleware.js +2 -2
- package/dist/redux/middlewares/thirdpartyScriptsMiddleware.d.ts +1 -1
- package/dist/redux/reducers/app/instance.test.d.ts +1 -0
- package/dist/redux/reducers/app/instance.test.js +75 -0
- package/dist/redux/reducers/app/meta.test.d.ts +1 -0
- package/dist/redux/reducers/app/meta.test.js +70 -0
- package/dist/redux/reducers/app/pagination/updateAvailableAppStates.js +2 -1
- package/dist/redux/reducers/app/pagination.test.d.ts +1 -0
- package/dist/redux/reducers/app/pagination.test.js +134 -0
- package/dist/redux/reducers/app/wizard.test.d.ts +1 -0
- package/dist/redux/reducers/app/wizard.test.js +53 -0
- package/dist/redux/reducers/app.d.ts +6 -6
- package/dist/redux/reducers/app.test.d.ts +1 -0
- package/dist/redux/reducers/app.test.js +175 -0
- package/dist/redux/reducers/conditions/addMultipleOccurency.test.d.ts +1 -0
- package/dist/redux/reducers/conditions/addMultipleOccurency.test.js +108 -0
- package/dist/redux/reducers/conditions/deleteMultipleOccurency.test.d.ts +1 -0
- package/dist/redux/reducers/conditions/deleteMultipleOccurency.test.js +77 -0
- package/dist/redux/reducers/conditions/updateDocumentConditions.test.d.ts +1 -0
- package/dist/redux/reducers/conditions/updateDocumentConditions.test.js +35 -0
- package/dist/redux/reducers/conditions/updateOptionValidatorCondition.test.d.ts +1 -0
- package/dist/redux/reducers/conditions/updateOptionValidatorCondition.test.js +35 -0
- package/dist/redux/reducers/conditions/updateVariableValidatorCondition.test.d.ts +1 -0
- package/dist/redux/reducers/conditions/updateVariableValidatorCondition.test.js +35 -0
- package/dist/redux/reducers/conditions.test.d.ts +1 -0
- package/dist/redux/reducers/conditions.test.js +196 -0
- package/dist/redux/reducers/inputs/addMultipleOccurency.test.d.ts +1 -0
- package/dist/redux/reducers/inputs/addMultipleOccurency.test.js +101 -0
- package/dist/redux/reducers/inputs/deleteMultipleOccurency.test.d.ts +1 -0
- package/dist/redux/reducers/inputs/deleteMultipleOccurency.test.js +56 -0
- package/dist/redux/reducers/inputs.test.d.ts +1 -0
- package/dist/redux/reducers/inputs.test.js +171 -0
- package/dist/redux/reducers/references.js +0 -2
- package/dist/redux/reducers/user.test.d.ts +1 -0
- package/dist/redux/reducers/user.test.js +42 -0
- package/dist/redux/routerHistore.test.d.ts +1 -0
- package/dist/redux/routerHistore.test.js +15 -0
- package/dist/redux/sagas/fetchModel.test.d.ts +1 -0
- package/dist/redux/sagas/fetchModel.test.js +127 -0
- package/dist/redux/sagas/runner.test.d.ts +1 -0
- package/dist/redux/sagas/runner.test.js +10 -0
- package/dist/redux/sagas/saveData.test.d.ts +1 -0
- package/dist/redux/sagas/saveData.test.js +74 -0
- package/dist/redux/sagas/setDefaults.test.d.ts +1 -0
- package/dist/redux/sagas/setDefaults.test.js +73 -0
- package/dist/redux/selectors/app.test.d.ts +1 -0
- package/dist/redux/selectors/app.test.js +99 -0
- package/dist/redux/selectors/conditions.test.d.ts +1 -0
- package/dist/redux/selectors/conditions.test.js +70 -0
- package/dist/redux/selectors/inputs.d.ts +1 -1
- package/dist/redux/selectors/inputs.test.d.ts +1 -0
- package/dist/redux/selectors/inputs.test.js +44 -0
- package/dist/redux/selectors/references.test.d.ts +1 -0
- package/dist/redux/selectors/references.test.js +471 -0
- package/dist/redux/selectors/selectors.d.ts +4 -4
- package/dist/redux/selectors/selectors.test.d.ts +1 -0
- package/dist/redux/selectors/selectors.test.js +16 -0
- package/dist/redux/selectors/user.test.d.ts +1 -0
- package/dist/redux/selectors/user.test.js +29 -0
- package/dist/redux/store.d.ts +3 -5
- package/dist/redux/store.js +1 -2
- package/dist/redux/store.test.d.ts +1 -0
- package/dist/redux/store.test.js +16 -0
- package/dist/service/api.manager.d.ts +2 -2
- package/dist/service/autocomplete.manager.d.ts +3 -3
- package/dist/service/autocomplete.manager.js +3 -3
- package/dist/tests-misc/plugins/jestTestPlugin/after.js +1 -1
- package/dist/tests-misc/plugins/jestTestPlugin/before.js +1 -1
- package/dist/tests-misc/plugins/jestTestPlugin/title.js +1 -1
- package/dist/tests-misc/themes/jestTestTheme/components/EmailComponent.d.ts +1 -1
- package/dist/tests-misc/themes/jestTestTheme/components/EmailComponent.js +1 -1
- package/dist/tests-misc/themes/jestTestTheme/components/TermsheetComponent.d.ts +1 -1
- package/dist/tests-misc/themes/jestTestTheme/components/TermsheetComponent.js +1 -1
- package/dist/tests-misc/themes/jestTestTheme/components/WizardComponent.d.ts +1 -1
- package/dist/tests-misc/themes/jestTestTheme/components/WizardComponent.js +1 -1
- package/dist/types/Actions.type.d.ts +6 -70
- package/dist/types/Components.type.d.ts +2 -3
- package/dist/types/PluginConfig.type.d.ts +52 -18
- package/dist/types/State.type.d.ts +2 -2
- package/dist/types/config.type.d.ts +1 -1
- package/dist/types/getActions.type.d.ts +1 -1
- package/dist/types/getConnectors.type.d.ts +2 -2
- package/dist/types/getSelectors.type.d.ts +1 -1
- package/package.json +22 -45
- package/dist/WizardCore.d.ts +0 -29
- package/dist/WizardCore.js +0 -153
- package/dist/app.entry.d.ts +0 -2
- package/dist/app.entry.js +0 -1
- package/dist/routing/adapters/nextjs.adapter.d.ts +0 -3
- package/dist/routing/adapters/nextjs.adapter.js +0 -61
- package/dist/routing/adapters/reactRouter.adapter.d.ts +0 -2
- package/dist/routing/adapters/reactRouter.adapter.js +0 -16
- package/dist/routing/context.d.ts +0 -14
- package/dist/routing/context.js +0 -23
- package/dist/routing/index.d.ts +0 -4
- package/dist/routing/index.js +0 -4
- package/dist/routing/types.d.ts +0 -26
- package/dist/wizardcore.entry.d.ts +0 -3
- package/dist/wizardcore.entry.js +0 -2
- /package/dist/{routing/types.js → App.test.d.ts} +0 -0
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type { connectorsLibrary } from "../componentsConnectors/library";
|
|
2
|
-
export type ConnectorProps<T extends (c: React.ComponentType<any>) => any> = T extends (c: React.ComponentType<infer P>) => any ? P : {};
|
|
3
|
-
export type ComponentsConnectors = typeof connectorsLibrary;
|
|
2
|
+
export declare type ConnectorProps<T extends (c: React.ComponentType<any>) => any> = T extends (c: React.ComponentType<infer P>) => any ? P : {};
|
|
3
|
+
export declare type ComponentsConnectors = typeof connectorsLibrary;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import type { selectorsLibrary } from "../redux/selectors/library";
|
|
2
|
-
export type SelectorsLibraryType = typeof selectorsLibrary;
|
|
2
|
+
export declare type SelectorsLibraryType = typeof selectorsLibrary;
|
package/package.json
CHANGED
|
@@ -1,42 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@legalplace/wizardx-core",
|
|
3
|
-
"version": "4.42.
|
|
3
|
+
"version": "4.42.11",
|
|
4
4
|
"author": "Moncef Hammou (moncef@legalplace.fr)",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"files": [
|
|
7
7
|
"dist/**/*"
|
|
8
8
|
],
|
|
9
9
|
"main": "dist/index.js",
|
|
10
|
-
"module": "dist/index.js",
|
|
11
|
-
"types": "dist/index.d.ts",
|
|
12
|
-
"sideEffects": false,
|
|
13
|
-
"exports": {
|
|
14
|
-
".": {
|
|
15
|
-
"types": "./dist/index.d.ts",
|
|
16
|
-
"import": "./dist/index.js",
|
|
17
|
-
"require": "./dist/index.js",
|
|
18
|
-
"default": "./dist/index.js"
|
|
19
|
-
},
|
|
20
|
-
"./App": {
|
|
21
|
-
"types": "./dist/App.d.ts",
|
|
22
|
-
"import": "./dist/App.js",
|
|
23
|
-
"require": "./dist/App.js",
|
|
24
|
-
"default": "./dist/App.js"
|
|
25
|
-
},
|
|
26
|
-
"./WizardCore": {
|
|
27
|
-
"types": "./dist/WizardCore.d.ts",
|
|
28
|
-
"import": "./dist/WizardCore.js",
|
|
29
|
-
"require": "./dist/WizardCore.js",
|
|
30
|
-
"default": "./dist/WizardCore.js"
|
|
31
|
-
},
|
|
32
|
-
"./routing": {
|
|
33
|
-
"types": "./dist/routing/index.d.ts",
|
|
34
|
-
"import": "./dist/routing/index.js",
|
|
35
|
-
"require": "./dist/routing/index.js",
|
|
36
|
-
"default": "./dist/routing/index.js"
|
|
37
|
-
},
|
|
38
|
-
"./package.json": "./package.json"
|
|
39
|
-
},
|
|
40
10
|
"scripts": {
|
|
41
11
|
"build": "npx rimraf dist && npx tsc",
|
|
42
12
|
"build:ci": "npx rimraf dist && npx tsc",
|
|
@@ -49,15 +19,16 @@
|
|
|
49
19
|
"precommit": "test && lint:fix"
|
|
50
20
|
},
|
|
51
21
|
"dependencies": {
|
|
22
|
+
"@appnest/masonry-layout": "^2.0.8",
|
|
52
23
|
"@cryptography/sha1": "^0.2.0",
|
|
53
|
-
"@legalplace/data-gouv": "^1.6.
|
|
24
|
+
"@legalplace/data-gouv": "^1.6.93",
|
|
54
25
|
"@legalplace/lp-events": "1.14.0",
|
|
55
26
|
"@legalplace/lplogic": "2.3.1",
|
|
56
27
|
"@legalplace/model-healthcheck": "^1.1.5",
|
|
57
28
|
"@legalplace/pappers": "^1.2.4",
|
|
58
|
-
"@legalplace/referencesparser": "^3.1.
|
|
29
|
+
"@legalplace/referencesparser": "^3.1.78",
|
|
59
30
|
"@legalplace/storybook": "2.364.5",
|
|
60
|
-
"@legalplace/typeorm-constants": "^3.
|
|
31
|
+
"@legalplace/typeorm-constants": "^3.75.0",
|
|
61
32
|
"@loadable/component": "^5.15.0",
|
|
62
33
|
"@redux-saga/core": "^1.1.3",
|
|
63
34
|
"axios": "^0.24.0",
|
|
@@ -71,16 +42,17 @@
|
|
|
71
42
|
"mousetrap": "^1.6.5",
|
|
72
43
|
"prop-types": "^15.7.2",
|
|
73
44
|
"query-string": "^7.0.1",
|
|
74
|
-
"react": "^
|
|
45
|
+
"react": "^17.0.2",
|
|
75
46
|
"react-app-polyfill": "^2.0.0",
|
|
76
|
-
"react-dom": "^
|
|
77
|
-
"react-redux": "^7.2.
|
|
47
|
+
"react-dom": "^17.0.2",
|
|
48
|
+
"react-redux": "^7.2.5",
|
|
78
49
|
"react-router": "5.2.1",
|
|
79
50
|
"react-router-dom": "^5.2.0",
|
|
80
|
-
"react-test-renderer": "^
|
|
81
|
-
"redux": "^4.
|
|
51
|
+
"react-test-renderer": "^17.0.2",
|
|
52
|
+
"redux": "^4.1.1",
|
|
82
53
|
"redux-devtools-extension": "^2.13.9",
|
|
83
54
|
"redux-saga": "^1.1.3",
|
|
55
|
+
"route-parser": "^0.0.5",
|
|
84
56
|
"universal-cookie": "^4.0.4",
|
|
85
57
|
"uuid": "^8.3.2",
|
|
86
58
|
"xss": "^1.0.9"
|
|
@@ -88,25 +60,29 @@
|
|
|
88
60
|
"devDependencies": {
|
|
89
61
|
"@legalplace/data-gouv": "^1.6.30",
|
|
90
62
|
"@legalplace/eslint-config": "^2.3.0",
|
|
91
|
-
"@legalplace/models-v3-types": "^5.14.
|
|
63
|
+
"@legalplace/models-v3-types": "^5.14.10",
|
|
92
64
|
"@legalplace/prettier-config": "^2.1.3",
|
|
93
|
-
"@legalplace/typeorm-entities": "^5.
|
|
65
|
+
"@legalplace/typeorm-entities": "^5.66.1",
|
|
94
66
|
"@swc-node/jest": "^1.3.2",
|
|
95
67
|
"@swc/core": "^1.2.93",
|
|
96
68
|
"@swc/jest": "^0.2.4",
|
|
97
69
|
"@testing-library/jest-dom": "^4.2.4",
|
|
98
70
|
"@testing-library/react": "^12.1.2",
|
|
99
71
|
"@types/crypto-js": "^4.0.2",
|
|
72
|
+
"@types/enzyme-adapter-react-16": "^1.0.6",
|
|
100
73
|
"@types/jest": "^27.0.2",
|
|
101
74
|
"@types/loadable__component": "^5.13.4",
|
|
102
75
|
"@types/lodash": "^4.14.175",
|
|
103
76
|
"@types/mousetrap": "^1.6.8",
|
|
104
|
-
"@types/react": "^
|
|
105
|
-
"@types/react-dom": "
|
|
77
|
+
"@types/react": "^17.0.37",
|
|
78
|
+
"@types/react-dom": "17.0.11",
|
|
106
79
|
"@types/react-router-dom": "^5.1.6",
|
|
107
|
-
"@types/react-test-renderer": "^
|
|
80
|
+
"@types/react-test-renderer": "^17.0.1",
|
|
108
81
|
"@types/redux-mock-store": "^1.0.3",
|
|
82
|
+
"@types/route-parser": "^0.1.3",
|
|
109
83
|
"@types/uuid": "^8.3.1",
|
|
84
|
+
"enzyme": "^3.11.0",
|
|
85
|
+
"enzyme-adapter-react-16": "^1.15.6",
|
|
110
86
|
"jest": "^27.2.4",
|
|
111
87
|
"jest-fetch-mock": "^3.0.3",
|
|
112
88
|
"jest-junit": "^13.0.0",
|
|
@@ -123,5 +99,6 @@
|
|
|
123
99
|
"eslintIgnore": [
|
|
124
100
|
"*.test.ts",
|
|
125
101
|
"*.test.tsx"
|
|
126
|
-
]
|
|
102
|
+
],
|
|
103
|
+
"gitHead": "64bd54ff72f62b4e763f3bba9300535d3a5acc40"
|
|
127
104
|
}
|
package/dist/WizardCore.d.ts
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import type { ModelV3 } from "@legalplace/models-v3-types";
|
|
3
|
-
import type { StateType } from "./types/State.type";
|
|
4
|
-
import type { IWizardParams } from "./types/config.type";
|
|
5
|
-
import type { IRouterAdapter, IWizardCoreRouterProps } from "./routing/types";
|
|
6
|
-
export interface WizardCoreProps {
|
|
7
|
-
historyType?: "browser" | "memory";
|
|
8
|
-
model?: ModelV3;
|
|
9
|
-
meta?: StateType.App.Meta;
|
|
10
|
-
instance?: StateType.App.Instance;
|
|
11
|
-
user?: StateType.User;
|
|
12
|
-
wizardParams?: IWizardParams;
|
|
13
|
-
preloadTheme?: boolean;
|
|
14
|
-
loadPlugin: (plugin: string) => Promise<any>;
|
|
15
|
-
loadTheme: (theme: string) => Promise<any>;
|
|
16
|
-
routerAdapter?: IRouterAdapter;
|
|
17
|
-
routing?: IWizardCoreRouterProps;
|
|
18
|
-
}
|
|
19
|
-
declare class WizardCore extends React.Component<WizardCoreProps, {
|
|
20
|
-
initialized: boolean;
|
|
21
|
-
}> {
|
|
22
|
-
private storeInitialized;
|
|
23
|
-
constructor(props: WizardCoreProps);
|
|
24
|
-
private initializeStore;
|
|
25
|
-
componentDidMount(): void;
|
|
26
|
-
componentWillUnmount(): void;
|
|
27
|
-
render(): import("react/jsx-runtime").JSX.Element | null;
|
|
28
|
-
}
|
|
29
|
-
export default WizardCore;
|
package/dist/WizardCore.js
DELETED
|
@@ -1,153 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import React from "react";
|
|
3
|
-
import { Provider } from "react-redux";
|
|
4
|
-
import { getStore, createAppStore } from "./redux/store";
|
|
5
|
-
import Globals, { setGlobals } from "./Globals";
|
|
6
|
-
import { getConfig, updateConfig } from "./config";
|
|
7
|
-
import { fetchModelPrerequisitesAction } from "./redux/actions/sagas/model";
|
|
8
|
-
import { preloadTheme } from "./helpers/preloadTheme";
|
|
9
|
-
import ViewComponent from "./components/View";
|
|
10
|
-
import PluginRoute from "./components/PluginRoute";
|
|
11
|
-
import SmartScriptComponent from "./components/SmartScript";
|
|
12
|
-
import { clearPlugins } from "./PluginLoader";
|
|
13
|
-
import { PathReader } from "./libs/PathReader";
|
|
14
|
-
import { resetStateAction } from "./redux/actions/app";
|
|
15
|
-
import { callInitDataSmartscriptAction } from "./redux";
|
|
16
|
-
import { externalPartnerRedirectUrl } from "./helpers/redirectionConfig";
|
|
17
|
-
import { autoSave } from "./helpers/autosave.helper";
|
|
18
|
-
import { NOT_FOUND_PAGE_LINK } from "./constants/links.constant";
|
|
19
|
-
import { RouterProvider } from "./routing/context";
|
|
20
|
-
const getRouteComponent = (pathname, params) => {
|
|
21
|
-
const config = getConfig();
|
|
22
|
-
if (pathname.startsWith("/p/")) {
|
|
23
|
-
const pluginPath = params.path || pathname.replace("/p/", "");
|
|
24
|
-
return {
|
|
25
|
-
component: PluginRoute,
|
|
26
|
-
props: { match: { params: { path: pluginPath } } },
|
|
27
|
-
};
|
|
28
|
-
}
|
|
29
|
-
if (pathname.includes("/smartscript/")) {
|
|
30
|
-
return { component: SmartScriptComponent };
|
|
31
|
-
}
|
|
32
|
-
const wizardInstanceRegex = /\/contrats\/.*\/continuer\//;
|
|
33
|
-
const wizardRegex = /\/contrats\/.*\/creer\//;
|
|
34
|
-
if (wizardInstanceRegex.test(pathname) || wizardRegex.test(pathname)) {
|
|
35
|
-
return { component: ViewComponent };
|
|
36
|
-
}
|
|
37
|
-
return null;
|
|
38
|
-
};
|
|
39
|
-
const RedirectHandler = ({ navigate, }) => {
|
|
40
|
-
React.useEffect(() => {
|
|
41
|
-
const matchedPartner = Object.keys(externalPartnerRedirectUrl).find((partner) => window.location.origin.toLowerCase().includes(partner));
|
|
42
|
-
if (matchedPartner) {
|
|
43
|
-
window.location.href = externalPartnerRedirectUrl[matchedPartner];
|
|
44
|
-
}
|
|
45
|
-
else {
|
|
46
|
-
window.location.href = NOT_FOUND_PAGE_LINK;
|
|
47
|
-
}
|
|
48
|
-
}, []);
|
|
49
|
-
return null;
|
|
50
|
-
};
|
|
51
|
-
class WizardCore extends React.Component {
|
|
52
|
-
constructor(props) {
|
|
53
|
-
super(props);
|
|
54
|
-
this.storeInitialized = false;
|
|
55
|
-
this.state = {
|
|
56
|
-
initialized: false,
|
|
57
|
-
};
|
|
58
|
-
this.initializeStore(props);
|
|
59
|
-
}
|
|
60
|
-
initializeStore(props) {
|
|
61
|
-
var _a;
|
|
62
|
-
if (this.storeInitialized)
|
|
63
|
-
return;
|
|
64
|
-
clearPlugins();
|
|
65
|
-
const historyType = typeof props.historyType === "string" ? props.historyType : "browser";
|
|
66
|
-
const params = Object.assign(Object.assign({}, Globals), { loadTheme: props.loadTheme, loadPlugin: props.loadPlugin });
|
|
67
|
-
if (props.model) {
|
|
68
|
-
params.model = props.model;
|
|
69
|
-
}
|
|
70
|
-
if (props.meta) {
|
|
71
|
-
params.meta = props.meta;
|
|
72
|
-
}
|
|
73
|
-
if (props.instance) {
|
|
74
|
-
params.instance = props.instance;
|
|
75
|
-
}
|
|
76
|
-
if (props.user) {
|
|
77
|
-
params.user = props.user;
|
|
78
|
-
}
|
|
79
|
-
setGlobals(params);
|
|
80
|
-
if (props.wizardParams)
|
|
81
|
-
updateConfig(props.wizardParams);
|
|
82
|
-
if (props.preloadTheme && ((_a = props.wizardParams) === null || _a === void 0 ? void 0 : _a.theme.name))
|
|
83
|
-
preloadTheme(props.wizardParams.theme.name);
|
|
84
|
-
try {
|
|
85
|
-
createAppStore(historyType);
|
|
86
|
-
this.storeInitialized = true;
|
|
87
|
-
}
|
|
88
|
-
catch (error) {
|
|
89
|
-
console.error("Failed to initialize store:", error);
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
componentDidMount() {
|
|
93
|
-
if (!this.storeInitialized) {
|
|
94
|
-
this.initializeStore(this.props);
|
|
95
|
-
}
|
|
96
|
-
setTimeout(() => {
|
|
97
|
-
try {
|
|
98
|
-
const { dispatch, getState } = getStore();
|
|
99
|
-
const state = getState();
|
|
100
|
-
let parent = null;
|
|
101
|
-
window.addEventListener("message", ({ data, source }) => {
|
|
102
|
-
if (parent === null || data.from === "BO") {
|
|
103
|
-
parent = source;
|
|
104
|
-
}
|
|
105
|
-
if (data.from && data.from === "BO") {
|
|
106
|
-
const { variables } = data;
|
|
107
|
-
autoSave(variables, getStore());
|
|
108
|
-
}
|
|
109
|
-
});
|
|
110
|
-
dispatch(callInitDataSmartscriptAction());
|
|
111
|
-
if (!PathReader.isSmartScriptPath()) {
|
|
112
|
-
dispatch(fetchModelPrerequisitesAction(getConfig().permalink || state.app.meta.permalink, getConfig().prefix || state.app.meta.prefix || ""));
|
|
113
|
-
}
|
|
114
|
-
this.setState({ initialized: true });
|
|
115
|
-
}
|
|
116
|
-
catch (error) {
|
|
117
|
-
console.error("Error during component mount:", error);
|
|
118
|
-
}
|
|
119
|
-
}, 0);
|
|
120
|
-
}
|
|
121
|
-
componentWillUnmount() {
|
|
122
|
-
getStore().dispatch(resetStateAction());
|
|
123
|
-
}
|
|
124
|
-
render() {
|
|
125
|
-
if (!this.storeInitialized) {
|
|
126
|
-
return null;
|
|
127
|
-
}
|
|
128
|
-
const { routerAdapter, routing } = this.props;
|
|
129
|
-
try {
|
|
130
|
-
const store = getStore();
|
|
131
|
-
if (routing) {
|
|
132
|
-
const { pathname, params, navigate } = routing;
|
|
133
|
-
const routeMatch = getRouteComponent(pathname, params);
|
|
134
|
-
if (routeMatch) {
|
|
135
|
-
const RouteComponent = routeMatch.component;
|
|
136
|
-
return (_jsx(Provider, { store: store, children: _jsx(RouteComponent, Object.assign({}, (routeMatch.props || {}))) }));
|
|
137
|
-
}
|
|
138
|
-
return (_jsx(Provider, { store: store, children: _jsx(RedirectHandler, { navigate: navigate }) }));
|
|
139
|
-
}
|
|
140
|
-
if (routerAdapter) {
|
|
141
|
-
return (_jsx(Provider, { store: store, children: _jsx(RouterProvider, { adapter: routerAdapter, children: _jsx(WizardCoreContent, {}) }) }));
|
|
142
|
-
}
|
|
143
|
-
console.warn("WizardCore: No routing mechanism provided. Pass either 'routerAdapter' or 'routing' props.");
|
|
144
|
-
return (_jsx(Provider, { store: store, children: _jsx("div", { children: "No routing configured" }) }));
|
|
145
|
-
}
|
|
146
|
-
catch (error) {
|
|
147
|
-
console.error("Error rendering WizardCore:", error);
|
|
148
|
-
return _jsx("div", { children: "Error initializing wizard. Check console for details." });
|
|
149
|
-
}
|
|
150
|
-
}
|
|
151
|
-
}
|
|
152
|
-
const WizardCoreContent = () => (_jsx(ViewComponent, {}));
|
|
153
|
-
export default WizardCore;
|
package/dist/app.entry.d.ts
DELETED
package/dist/app.entry.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default as App } from "./App";
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import type { IRouterAdapter } from "../types";
|
|
2
|
-
export declare const createNextJSAdapter: (router: any, pathname: string, searchParams: URLSearchParams | null, params: Record<string, string | string[]>) => IRouterAdapter;
|
|
3
|
-
export declare const useNextJSAdapter: () => IRouterAdapter;
|
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
|
2
|
-
var t = {};
|
|
3
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
4
|
-
t[p] = s[p];
|
|
5
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
6
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
7
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
8
|
-
t[p[i]] = s[p[i]];
|
|
9
|
-
}
|
|
10
|
-
return t;
|
|
11
|
-
};
|
|
12
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
|
-
import { useMemo } from "react";
|
|
14
|
-
export const createNextJSAdapter = (router, pathname, searchParams, params) => {
|
|
15
|
-
const normalizedParams = useMemo(() => {
|
|
16
|
-
const normalized = {};
|
|
17
|
-
Object.entries(params).forEach(([key, value]) => {
|
|
18
|
-
normalized[key] = Array.isArray(value) ? value[0] : value;
|
|
19
|
-
});
|
|
20
|
-
return normalized;
|
|
21
|
-
}, [params]);
|
|
22
|
-
return {
|
|
23
|
-
useParams: () => normalizedParams,
|
|
24
|
-
useNavigate: () => (path) => {
|
|
25
|
-
if (router === null || router === void 0 ? void 0 : router.push) {
|
|
26
|
-
router.push(path);
|
|
27
|
-
}
|
|
28
|
-
},
|
|
29
|
-
useLocation: () => ({
|
|
30
|
-
pathname,
|
|
31
|
-
search: searchParams ? `?${searchParams.toString()}` : "",
|
|
32
|
-
}),
|
|
33
|
-
Link: (_a) => {
|
|
34
|
-
var { to, children } = _a, props = __rest(_a, ["to", "children"]);
|
|
35
|
-
return (_jsx("a", Object.assign({ href: to, onClick: (e) => {
|
|
36
|
-
e.preventDefault();
|
|
37
|
-
if (router === null || router === void 0 ? void 0 : router.push) {
|
|
38
|
-
router.push(to);
|
|
39
|
-
}
|
|
40
|
-
} }, props, { children: children })));
|
|
41
|
-
},
|
|
42
|
-
};
|
|
43
|
-
};
|
|
44
|
-
export const useNextJSAdapter = () => {
|
|
45
|
-
const params = {};
|
|
46
|
-
const pathname = "";
|
|
47
|
-
return {
|
|
48
|
-
useParams: () => params,
|
|
49
|
-
useNavigate: () => (path) => {
|
|
50
|
-
console.warn("useNextJSAdapter: Navigation not available. Use createNextJSAdapter with Next.js router instead.");
|
|
51
|
-
},
|
|
52
|
-
useLocation: () => ({
|
|
53
|
-
pathname,
|
|
54
|
-
search: "",
|
|
55
|
-
}),
|
|
56
|
-
Link: (_a) => {
|
|
57
|
-
var { to, children } = _a, props = __rest(_a, ["to", "children"]);
|
|
58
|
-
return (_jsx("a", Object.assign({ href: to }, props, { children: children })));
|
|
59
|
-
},
|
|
60
|
-
};
|
|
61
|
-
};
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { useParams as useParamsRR, useHistory, useLocation as useLocationRR, Link as LinkRR, } from "react-router-dom";
|
|
2
|
-
export const createReactRouterAdapter = () => ({
|
|
3
|
-
useParams: () => useParamsRR(),
|
|
4
|
-
useNavigate: () => {
|
|
5
|
-
const history = useHistory();
|
|
6
|
-
return (path) => history.push(path);
|
|
7
|
-
},
|
|
8
|
-
useLocation: () => {
|
|
9
|
-
const location = useLocationRR();
|
|
10
|
-
return {
|
|
11
|
-
pathname: location.pathname,
|
|
12
|
-
search: location.search,
|
|
13
|
-
};
|
|
14
|
-
},
|
|
15
|
-
Link: LinkRR,
|
|
16
|
-
});
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import type { IRouterAdapter } from "./types";
|
|
3
|
-
export interface RouterProviderProps {
|
|
4
|
-
adapter: IRouterAdapter;
|
|
5
|
-
children: React.ReactNode;
|
|
6
|
-
}
|
|
7
|
-
export declare const RouterProvider: React.FC<RouterProviderProps>;
|
|
8
|
-
export declare const useRouterAdapter: () => IRouterAdapter;
|
|
9
|
-
export declare const useParams: <T = any>() => T;
|
|
10
|
-
export declare const useNavigate: () => (path: string) => void;
|
|
11
|
-
export declare const useLocation: () => {
|
|
12
|
-
pathname: string;
|
|
13
|
-
search: string;
|
|
14
|
-
};
|
package/dist/routing/context.js
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { createContext, useContext } from "react";
|
|
3
|
-
const RouterContext = createContext(null);
|
|
4
|
-
export const RouterProvider = ({ adapter, children, }) => (_jsx(RouterContext.Provider, { value: adapter, children: children }));
|
|
5
|
-
export const useRouterAdapter = () => {
|
|
6
|
-
const adapter = useContext(RouterContext);
|
|
7
|
-
if (!adapter) {
|
|
8
|
-
throw new Error("useRouterAdapter must be used within a RouterProvider or use native react-router hooks directly");
|
|
9
|
-
}
|
|
10
|
-
return adapter;
|
|
11
|
-
};
|
|
12
|
-
export const useParams = () => {
|
|
13
|
-
const adapter = useRouterAdapter();
|
|
14
|
-
return adapter.useParams();
|
|
15
|
-
};
|
|
16
|
-
export const useNavigate = () => {
|
|
17
|
-
const adapter = useRouterAdapter();
|
|
18
|
-
return adapter.useNavigate();
|
|
19
|
-
};
|
|
20
|
-
export const useLocation = () => {
|
|
21
|
-
const adapter = useRouterAdapter();
|
|
22
|
-
return adapter.useLocation();
|
|
23
|
-
};
|
package/dist/routing/index.d.ts
DELETED
package/dist/routing/index.js
DELETED
package/dist/routing/types.d.ts
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import type { ReactNode, ComponentType } from "react";
|
|
2
|
-
export interface IRouterAdapter {
|
|
3
|
-
useParams: <T = any>() => T;
|
|
4
|
-
useNavigate: () => (path: string) => void;
|
|
5
|
-
useLocation: () => {
|
|
6
|
-
pathname: string;
|
|
7
|
-
search: string;
|
|
8
|
-
};
|
|
9
|
-
Link: ComponentType<{
|
|
10
|
-
to: string;
|
|
11
|
-
children: ReactNode;
|
|
12
|
-
[key: string]: any;
|
|
13
|
-
}>;
|
|
14
|
-
}
|
|
15
|
-
export interface IRouteConfig {
|
|
16
|
-
path: string;
|
|
17
|
-
component: ComponentType<any>;
|
|
18
|
-
exact?: boolean;
|
|
19
|
-
strict?: boolean;
|
|
20
|
-
}
|
|
21
|
-
export interface IWizardCoreRouterProps {
|
|
22
|
-
pathname: string;
|
|
23
|
-
search?: string;
|
|
24
|
-
params: Record<string, string | undefined>;
|
|
25
|
-
navigate: (path: string) => void;
|
|
26
|
-
}
|
package/dist/wizardcore.entry.js
DELETED
|
File without changes
|