@legalplace/wizardx-core 2.1.0-alpha.12 → 2.1.0-alpha.2

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.
Files changed (251) hide show
  1. package/CHANGELOG.md +0 -112
  2. package/dist/App.d.ts +2 -2
  3. package/dist/App.js +2 -2
  4. package/dist/PluginLoader.js +6 -3
  5. package/dist/Shimmer.js +1 -1
  6. package/dist/ThemeLoader.d.ts +1 -1
  7. package/dist/components/SmartScript.d.ts +2 -2
  8. package/dist/components/SmartScript.js +9 -9
  9. package/dist/components/View.d.ts +1 -0
  10. package/dist/components/View.js +16 -1
  11. package/dist/componentsConnectors/connector/connectorSelectors.d.ts +0 -2
  12. package/dist/config.test.js +2 -2
  13. package/dist/helpers/sendinblueHelper.js +5 -8
  14. package/dist/libs/Eval/EvalFunctions.d.ts +21 -21
  15. package/dist/libs/Eval/EvalFunctions.js +99 -141
  16. package/dist/libs/EvalVariable.d.ts +1 -1
  17. package/dist/libs/EvalVariable.js +49 -61
  18. package/dist/libs/EventsTracking.d.ts +0 -1
  19. package/dist/libs/EventsTracking.js +5 -11
  20. package/dist/redux/actions/inputs.d.ts +0 -2
  21. package/dist/redux/actions/inputs.js +1 -6
  22. package/dist/redux/constants/inputs.d.ts +0 -1
  23. package/dist/redux/constants/inputs.js +0 -1
  24. package/dist/redux/middlewares/smartscriptMiddleware.js +3 -21
  25. package/dist/redux/sagas/fetchModel.js +58 -6
  26. package/dist/redux/sagas/fetchModel.test.js +3 -2
  27. package/dist/redux/sagas/runner.js +0 -2
  28. package/dist/redux/selectors/app.d.ts +0 -1
  29. package/dist/redux/selectors/app.js +0 -1
  30. package/dist/redux/selectors/references.d.ts +0 -1
  31. package/dist/redux/selectors/references.js +0 -1
  32. package/dist/service/api.manager.d.ts +1 -1
  33. package/dist/service/api.manager.js +5 -13
  34. package/dist/types/Actions.type.d.ts +1 -6
  35. package/dist/types/config.type.d.ts +5 -3
  36. package/dist/wizard-params.js +2 -2
  37. package/jest.config.ts +1 -1
  38. package/package.json +9 -17
  39. package/src/App.tsx +27 -24
  40. package/src/Globals.ts +8 -12
  41. package/src/PluginLoader.tsx +37 -20
  42. package/src/Shimmer.tsx +45 -58
  43. package/src/ThemeLoader.test.tsx +0 -1
  44. package/src/ThemeLoader.tsx +42 -27
  45. package/src/components/PluginRoute.tsx +6 -8
  46. package/src/components/SmartScript.tsx +28 -29
  47. package/src/components/UserLocked/UserLockedComponent.tsx +3 -3
  48. package/src/components/View.test.tsx +0 -3
  49. package/src/components/View.tsx +54 -52
  50. package/src/componentsConnectors/connectBox.tsx +6 -6
  51. package/src/componentsConnectors/connectDocument.tsx +6 -6
  52. package/src/componentsConnectors/connectHeader.tsx +2 -2
  53. package/src/componentsConnectors/connectMetaTitle.tsx +2 -2
  54. package/src/componentsConnectors/connectOption.tsx +11 -11
  55. package/src/componentsConnectors/connectPagination.tsx +3 -3
  56. package/src/componentsConnectors/connectPreview.tsx +2 -2
  57. package/src/componentsConnectors/connectProgress.tsx +3 -3
  58. package/src/componentsConnectors/connectRootOption.tsx +4 -4
  59. package/src/componentsConnectors/connectSection.tsx +4 -4
  60. package/src/componentsConnectors/connectSummary.tsx +2 -2
  61. package/src/componentsConnectors/connectSummaryItem.tsx +6 -6
  62. package/src/componentsConnectors/connectTermsheet.tsx +46 -46
  63. package/src/componentsConnectors/connectVariable.tsx +11 -11
  64. package/src/componentsConnectors/connectWizardWrapper.tsx +4 -4
  65. package/src/componentsConnectors/connector/componentConnector.tsx +20 -22
  66. package/src/componentsConnectors/connector/connectorSelectors.ts +19 -0
  67. package/src/componentsConnectors/index.ts +16 -0
  68. package/src/config.test.ts +3 -4
  69. package/src/config.ts +1 -1
  70. package/src/constants/index.ts +1 -0
  71. package/src/definitions/path.join.d.ts +1 -1
  72. package/src/helpers/index.ts +2 -0
  73. package/src/helpers/outputsParsing.ts +26 -26
  74. package/src/helpers/preloadTheme.ts +2 -2
  75. package/src/helpers/sendinblueHelper.ts +17 -23
  76. package/src/hooks/index.ts +1 -0
  77. package/src/hooks/usePrevious.ts +1 -1
  78. package/src/index.ts +47 -0
  79. package/src/libs/ConditionsInitiator.ts +3 -3
  80. package/src/libs/ConditionsRunner/DataPopulator.ts +7 -7
  81. package/src/libs/ConditionsRunner.ts +53 -53
  82. package/src/libs/DocumentsOutputs.ts +7 -7
  83. package/src/libs/Eval/EvalBase.ts +17 -17
  84. package/src/libs/Eval/EvalFunctions.ts +100 -100
  85. package/src/libs/Eval/NumbersToLetters.ts +48 -48
  86. package/src/libs/EvalVariable.ts +31 -34
  87. package/src/libs/EventsTracking.ts +34 -48
  88. package/src/libs/Extracts.ts +21 -21
  89. package/src/libs/InputsInitiator.ts +16 -16
  90. package/src/libs/NumAuto.ts +1 -1
  91. package/src/libs/OvcConverter.ts +25 -25
  92. package/src/libs/PathReader.ts +23 -23
  93. package/src/libs/SectionValidity.ts +3 -3
  94. package/src/libs/SmartScriptStore.ts +40 -40
  95. package/src/libs/index.ts +12 -0
  96. package/src/misc/test_model.ts +3809 -3809
  97. package/src/polyfills/prepend.ts +2 -2
  98. package/src/polyfills/stringRepeat.ts +4 -4
  99. package/src/redux/actions/app.ts +13 -13
  100. package/src/redux/actions/conditions.ts +3 -3
  101. package/src/redux/actions/index.ts +8 -0
  102. package/src/redux/actions/inputs.ts +2 -18
  103. package/src/redux/actions/mandatories.ts +2 -2
  104. package/src/redux/actions/references.ts +5 -5
  105. package/src/redux/actions/sagas/data.ts +2 -2
  106. package/src/redux/actions/sagas/index.ts +3 -0
  107. package/src/redux/actions/sagas/model.ts +6 -6
  108. package/src/redux/actions/sagas/user.ts +2 -2
  109. package/src/redux/actions/smartscript.ts +4 -4
  110. package/src/redux/actions/user.ts +5 -5
  111. package/src/redux/constants/app.ts +22 -22
  112. package/src/redux/constants/conditions.ts +8 -8
  113. package/src/redux/constants/index.ts +8 -0
  114. package/src/redux/constants/inputs.ts +6 -8
  115. package/src/redux/constants/mandatories.ts +6 -6
  116. package/src/redux/constants/references.ts +3 -3
  117. package/src/redux/constants/sagas/data.ts +1 -1
  118. package/src/redux/constants/sagas/index.ts +3 -0
  119. package/src/redux/constants/sagas/model.ts +2 -2
  120. package/src/redux/constants/sagas/user.ts +2 -2
  121. package/src/redux/constants/smartscript.ts +4 -4
  122. package/src/redux/constants/user.ts +3 -3
  123. package/src/redux/index.ts +4 -0
  124. package/src/redux/listeners/subscriber.ts +2 -2
  125. package/src/redux/middlewares/conditionsWatcherMiddleware.ts +31 -31
  126. package/src/redux/middlewares/evaluationsWatcherMiddleware.test.ts +1 -1
  127. package/src/redux/middlewares/evaluationsWatcherMiddleware.ts +13 -13
  128. package/src/redux/middlewares/mandatoriesWatcherMiddleware.ts +16 -16
  129. package/src/redux/middlewares/multiplesActionsMiddleware.ts +6 -6
  130. package/src/redux/middlewares/paginationWatcherMiddleware.ts +27 -27
  131. package/src/redux/middlewares/pluginsHookMiddleware.ts +2 -2
  132. package/src/redux/middlewares/prefillerWatcherMiddleware.ts +31 -31
  133. package/src/redux/middlewares/smartscriptMiddleware.ts +22 -63
  134. package/src/redux/reducers/app/customizations/initCustomizationAutoDefault.ts +2 -2
  135. package/src/redux/reducers/app/customizations/initCustomizationMeta.ts +2 -2
  136. package/src/redux/reducers/app/instance/initInstance.ts +2 -2
  137. package/src/redux/reducers/app/instance/setDataStatus.ts +2 -2
  138. package/src/redux/reducers/app/instance/updateInstance.ts +2 -2
  139. package/src/redux/reducers/app/instance/updateInstancePaid.ts +2 -2
  140. package/src/redux/reducers/app/meta/fetchModelFailed.ts +2 -2
  141. package/src/redux/reducers/app/meta/fetchModelNonBlocking.ts +2 -2
  142. package/src/redux/reducers/app/meta/fetchModelSucceeded.ts +2 -2
  143. package/src/redux/reducers/app/meta/fetchModelUnhealthy.ts +3 -3
  144. package/src/redux/reducers/app/meta/fetchModelUserLocked.ts +2 -2
  145. package/src/redux/reducers/app/meta/initMeta.ts +2 -2
  146. package/src/redux/reducers/app/meta/setModelUuid.ts +2 -2
  147. package/src/redux/reducers/app/pagination/goNextPage.ts +2 -2
  148. package/src/redux/reducers/app/pagination/goPage.ts +4 -4
  149. package/src/redux/reducers/app/pagination/goPreviousPage.ts +2 -2
  150. package/src/redux/reducers/app/pagination/initPagination.ts +3 -3
  151. package/src/redux/reducers/app/pagination/updateAvailableAppStates.ts +7 -7
  152. package/src/redux/reducers/app/wizard/updateAvailableSections.ts +4 -4
  153. package/src/redux/reducers/app.ts +32 -32
  154. package/src/redux/reducers/conditions/addMultipleOccurency.ts +5 -5
  155. package/src/redux/reducers/conditions/deleteMultipleOccurency.ts +4 -4
  156. package/src/redux/reducers/conditions/initConditions.ts +2 -2
  157. package/src/redux/reducers/conditions/updateDocumentConditions.ts +2 -2
  158. package/src/redux/reducers/conditions/updateOptionConditions.ts +2 -2
  159. package/src/redux/reducers/conditions/updateOptionValidatorCondition.ts +2 -2
  160. package/src/redux/reducers/conditions/updatePrefillerConditions.ts +4 -4
  161. package/src/redux/reducers/conditions/updateSectionConditions.ts +2 -2
  162. package/src/redux/reducers/conditions/updateVariableConditions.ts +2 -2
  163. package/src/redux/reducers/conditions/updateVariableValidatorCondition.ts +2 -2
  164. package/src/redux/reducers/conditions.ts +15 -15
  165. package/src/redux/reducers/inputs/addMultipleOccurency.ts +6 -6
  166. package/src/redux/reducers/inputs/deleteMultipleOccurency.ts +4 -4
  167. package/src/redux/reducers/inputs/initOption.ts +2 -2
  168. package/src/redux/reducers/inputs/initVariable.ts +2 -2
  169. package/src/redux/reducers/inputs/updateOptionInput.ts +2 -2
  170. package/src/redux/reducers/inputs/updateVariableInput.ts +2 -2
  171. package/src/redux/reducers/inputs.ts +10 -10
  172. package/src/redux/reducers/mandatories/addMultipleOccurency.ts +4 -4
  173. package/src/redux/reducers/mandatories/deleteMultipleOccurency.ts +4 -4
  174. package/src/redux/reducers/mandatories/initMandatoryOption.ts +2 -2
  175. package/src/redux/reducers/mandatories/initMandatoryVariable.ts +2 -2
  176. package/src/redux/reducers/mandatories/setMandatoryIgnore.ts +2 -2
  177. package/src/redux/reducers/mandatories/setMandatoryOption.ts +2 -2
  178. package/src/redux/reducers/mandatories/setMandatorySection.ts +2 -2
  179. package/src/redux/reducers/mandatories/setMandatoryVariable.ts +2 -2
  180. package/src/redux/reducers/mandatories.ts +13 -13
  181. package/src/redux/reducers/references/initReferences.ts +2 -2
  182. package/src/redux/reducers/references/updateOptionMeta.ts +4 -4
  183. package/src/redux/reducers/references/updateVariableMeta.ts +4 -4
  184. package/src/redux/reducers/references.ts +7 -7
  185. package/src/redux/reducers/smartscript/enableSmartScript.ts +1 -1
  186. package/src/redux/reducers/smartscript/initSmartScriptTriggers.ts +2 -2
  187. package/src/redux/reducers/smartscript/updateSmartscriptOptionHidden.ts +2 -2
  188. package/src/redux/reducers/smartscript/updateSmartscriptVariableHidden.ts +2 -2
  189. package/src/redux/reducers/smartscript.ts +8 -8
  190. package/src/redux/reducers/user/initUser.ts +2 -2
  191. package/src/redux/reducers/user/setUserStatus.ts +2 -2
  192. package/src/redux/reducers/user/setUserValidToken.ts +2 -2
  193. package/src/redux/reducers/user.ts +11 -11
  194. package/src/redux/routerHistory.ts +6 -6
  195. package/src/redux/sagas/fetchModel.test.ts +5 -2
  196. package/src/redux/sagas/fetchModel.ts +187 -87
  197. package/src/redux/sagas/homogeneousRadioInputsSaga.ts +6 -6
  198. package/src/redux/sagas/runner.ts +6 -8
  199. package/src/redux/sagas/saveData.ts +28 -32
  200. package/src/redux/sagas/setDefaults.ts +8 -8
  201. package/src/redux/sagas/setUserEmail.ts +45 -46
  202. package/src/redux/selectors/app.ts +28 -34
  203. package/src/redux/selectors/conditions.ts +41 -41
  204. package/src/redux/selectors/index.ts +7 -0
  205. package/src/redux/selectors/inputs.ts +10 -10
  206. package/src/redux/selectors/mandatories.ts +10 -10
  207. package/src/redux/selectors/references.ts +21 -25
  208. package/src/redux/selectors/selectors.ts +4 -4
  209. package/src/redux/selectors/smartscript.ts +6 -6
  210. package/src/redux/selectors/user.ts +8 -8
  211. package/src/redux/store.ts +32 -42
  212. package/src/service/api.manager.ts +53 -66
  213. package/src/service/auth.service.ts +2 -2
  214. package/src/service/index.ts +3 -0
  215. package/src/service/pardot.service.ts +2 -2
  216. package/src/tests-misc/plugins/jestTestPlugin/after.tsx +1 -1
  217. package/src/tests-misc/plugins/jestTestPlugin/before.tsx +1 -1
  218. package/src/tests-misc/plugins/jestTestPlugin/index.ts +4 -4
  219. package/src/tests-misc/plugins/jestTestPlugin/title.tsx +2 -2
  220. package/src/tests-misc/themes/jestTestTheme/components/EmailComponent.tsx +1 -1
  221. package/src/tests-misc/themes/jestTestTheme/components/TermsheetComponent.tsx +1 -1
  222. package/src/tests-misc/themes/jestTestTheme/components/WizardComponent.tsx +1 -1
  223. package/src/tests-misc/themes/jestTestTheme/faltyIndex.ts +1 -1
  224. package/src/tests-misc/themes/jestTestTheme/faltyIndexLoader.ts +1 -1
  225. package/src/tests-misc/themes/jestTestTheme/index.ts +4 -4
  226. package/src/types/Actions.type.ts +55 -63
  227. package/src/types/Components.type.ts +4 -4
  228. package/src/types/State.type.ts +14 -14
  229. package/src/types/Termsheet.type.ts +4 -4
  230. package/src/types/api.type.ts +4 -4
  231. package/src/types/config.type.ts +6 -5
  232. package/src/types/getActions.type.ts +2 -2
  233. package/src/types/getConnectors.type.ts +2 -2
  234. package/src/types/getSelectors.type.ts +2 -2
  235. package/src/types/index.ts +10 -0
  236. package/src/wizard-params.ts +17 -17
  237. package/tsconfig.json +1 -1
  238. package/dist/constants/phoneValidation.d.ts +0 -3
  239. package/dist/constants/phoneValidation.js +0 -3
  240. package/dist/redux/sagas/initInputs.d.ts +0 -5
  241. package/dist/redux/sagas/initInputs.js +0 -63
  242. package/setupJest.ts +0 -8
  243. package/src/Loader.tsx +0 -8
  244. package/src/componentsConnectors/library.ts +0 -35
  245. package/src/constants/phoneValidation.ts +0 -6
  246. package/src/helpers/scriptsLoader.ts +0 -20
  247. package/src/polyfills/index.ts +0 -5
  248. package/src/redux/actions/library.ts +0 -23
  249. package/src/redux/middlewares/thirdpartyScriptsMiddleware.ts +0 -41
  250. package/src/redux/sagas/initInputs.ts +0 -110
  251. package/src/redux/selectors/library.ts +0 -17
package/CHANGELOG.md CHANGED
@@ -3,118 +3,6 @@
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
- # [2.1.0-alpha.12](https://git.legalplace.eu/legalplace/monorepo/compare/@legalplace/wizardx-core@2.1.0-alpha.11...@legalplace/wizardx-core@2.1.0-alpha.12) (2021-12-02)
7
-
8
- **Note:** Version bump only for package @legalplace/wizardx-core
9
-
10
-
11
-
12
-
13
-
14
- # [2.1.0-alpha.11](https://git.legalplace.eu/legalplace/monorepo/compare/@legalplace/wizardx-core@2.1.0-alpha.9...@legalplace/wizardx-core@2.1.0-alpha.11) (2021-12-02)
15
-
16
-
17
- ### Bug Fixes
18
-
19
- * disabling tests tmp api[#4480](https://git.legalplace.eu/legalplace/monorepo/issues/4480) ([79c3050](https://git.legalplace.eu/legalplace/monorepo/commits/79c30506ba070b50a0f9a7ab48b84a4822200437))
20
- * fix merge ([ce4fb47](https://git.legalplace.eu/legalplace/monorepo/commits/ce4fb47dd42c56e27ee427725893d0c2acb826f7))
21
- * fixing test api[#4480](https://git.legalplace.eu/legalplace/monorepo/issues/4480) ([53ff5be](https://git.legalplace.eu/legalplace/monorepo/commits/53ff5be76e31c5cc5476b0c5a1ce43cab5e36656))
22
- * loading third parties api[#4480](https://git.legalplace.eu/legalplace/monorepo/issues/4480) ([fb69116](https://git.legalplace.eu/legalplace/monorepo/commits/fb69116f896cf4055eed75ecba1e1fa19f9a01ed))
23
- * setting eval to sync to avoid potential bugs until further refactoring api[#4480](https://git.legalplace.eu/legalplace/monorepo/issues/4480) ([99c7e7c](https://git.legalplace.eu/legalplace/monorepo/commits/99c7e7c0fb3f06e2ead8c4d418991292fd692dc1))
24
-
25
-
26
- ### Features
27
-
28
- * optimizing wizardx (WIP) api[#4480](https://git.legalplace.eu/legalplace/monorepo/issues/4480) ([afdce18](https://git.legalplace.eu/legalplace/monorepo/commits/afdce18db5f85f5128d819003ce9335e7d6b4d93))
29
- * testing optimization api[#4480](https://git.legalplace.eu/legalplace/monorepo/issues/4480) ([104ff6d](https://git.legalplace.eu/legalplace/monorepo/commits/104ff6d5dad5f680ad5ed32f34f9bb5905461732))
30
-
31
-
32
-
33
-
34
-
35
- # [2.1.0-alpha.9](https://git.legalplace.eu/legalplace/monorepo/compare/@legalplace/wizardx-core@2.1.0-alpha.8...@legalplace/wizardx-core@2.1.0-alpha.9) (2021-11-28)
36
-
37
-
38
- ### Bug Fixes
39
-
40
- * fix linting api[#4480](https://git.legalplace.eu/legalplace/monorepo/issues/4480) ([e8d76f5](https://git.legalplace.eu/legalplace/monorepo/commits/e8d76f5333b2940dbb170099a77d19a37c503cba))
41
-
42
-
43
- ### Features
44
-
45
- * load speed optimizations api[#4480](https://git.legalplace.eu/legalplace/monorepo/issues/4480) ([5227752](https://git.legalplace.eu/legalplace/monorepo/commits/522775255c71f98d4a4052fbcd05c5ae956925a2))
46
-
47
-
48
-
49
-
50
-
51
- # [2.1.0-alpha.8](https://git.legalplace.eu/legalplace/monorepo/compare/@legalplace/wizardx-core@2.1.0-alpha.7...@legalplace/wizardx-core@2.1.0-alpha.8) (2021-11-24)
52
-
53
-
54
- ### Bug Fixes
55
-
56
- * fixing issue with smartscript not getting executed after init_inputs api[#3338](https://git.legalplace.eu/legalplace/monorepo/issues/3338) ([2c96fd6](https://git.legalplace.eu/legalplace/monorepo/commits/2c96fd63a6d2e7685e75ee9125a4759831548139))
57
-
58
-
59
-
60
-
61
-
62
- # [2.1.0-alpha.7](https://git.legalplace.eu/legalplace/monorepo/compare/@legalplace/wizardx-core@2.1.0-alpha.6...@legalplace/wizardx-core@2.1.0-alpha.7) (2021-11-24)
63
-
64
- **Note:** Version bump only for package @legalplace/wizardx-core
65
-
66
-
67
-
68
-
69
-
70
- # [2.1.0-alpha.6](https://git.legalplace.eu/legalplace/monorepo/compare/@legalplace/wizardx-core@2.1.0-alpha.5...@legalplace/wizardx-core@2.1.0-alpha.6) (2021-11-23)
71
-
72
-
73
- ### Bug Fixes
74
-
75
- * fix push api[#3338](https://git.legalplace.eu/legalplace/monorepo/issues/3338) ([1c961d5](https://git.legalplace.eu/legalplace/monorepo/commits/1c961d5a459513f791c2afb363881aa3d9214add))
76
-
77
-
78
- ### Features
79
-
80
- * Adding possibility to clone instance and improving UX on kanoon softSocial modal api[#3338](https://git.legalplace.eu/legalplace/monorepo/issues/3338) ([cec91b7](https://git.legalplace.eu/legalplace/monorepo/commits/cec91b79a512de1699e75fbb0e1bf95359f43376))
81
-
82
-
83
-
84
-
85
-
86
- # [2.1.0-alpha.5](https://git.legalplace.eu/legalplace/monorepo/compare/@legalplace/wizardx-core@2.1.0-alpha.4...@legalplace/wizardx-core@2.1.0-alpha.5) (2021-11-15)
87
-
88
-
89
- ### Features
90
-
91
- * tracking X-Source cookie api[#4377](https://git.legalplace.eu/legalplace/monorepo/issues/4377) ([0b52550](https://git.legalplace.eu/legalplace/monorepo/commits/0b52550632daa141ab241183a9cf2169e8d5fb08))
92
-
93
-
94
-
95
-
96
-
97
- # [2.1.0-alpha.4](https://git.legalplace.eu/legalplace/monorepo/compare/@legalplace/wizardx-core@2.1.0-alpha.3...@legalplace/wizardx-core@2.1.0-alpha.4) (2021-11-08)
98
-
99
- **Note:** Version bump only for package @legalplace/wizardx-core
100
-
101
-
102
-
103
-
104
-
105
- # [2.1.0-alpha.3](https://git.legalplace.eu/legalplace/monorepo/compare/@legalplace/wizardx-core@2.1.0-alpha.2...@legalplace/wizardx-core@2.1.0-alpha.3) (2021-11-04)
106
-
107
-
108
- ### Bug Fixes
109
-
110
- * fix config test api[#4377](https://git.legalplace.eu/legalplace/monorepo/issues/4377) ([8de0c2c](https://git.legalplace.eu/legalplace/monorepo/commits/8de0c2c8faadf18c082d372e0b9caf70d3b0d669))
111
- * fix styled-component issues api[#4377](https://git.legalplace.eu/legalplace/monorepo/issues/4377) ([d21227c](https://git.legalplace.eu/legalplace/monorepo/commits/d21227c278d545a6aba492b5e6b33062e31a52cd))
112
- * fix type errors api[#4377](https://git.legalplace.eu/legalplace/monorepo/issues/4377) ([c14a871](https://git.legalplace.eu/legalplace/monorepo/commits/c14a8717b53d023f89d09b329d2dff062b4890f0))
113
-
114
-
115
-
116
-
117
-
118
6
  # [2.1.0-alpha.2](https://git.legalplace.eu/legalplace/monorepo/compare/@legalplace/wizardx-core@2.1.0...@legalplace/wizardx-core@2.1.0-alpha.2) (2021-11-04)
119
7
 
120
8
 
package/dist/App.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import React from 'react';
2
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';
3
+ import { StateType } from './types/State.type';
4
+ import { IWizardParams } from './types/config.type';
5
5
  export interface AppProps {
6
6
  historyType: 'browser' | 'memory';
7
7
  model?: ModelV3;
package/dist/App.js CHANGED
@@ -73,10 +73,10 @@ class WizardXCore extends React.Component {
73
73
  React.createElement(Route, { path: "/p/:path", component: PluginRoute }),
74
74
  React.createElement(Route, { path: getConfig().router.wizardInstancePath, component: ViewComponent }),
75
75
  React.createElement(Route, { path: getConfig().router.wizardPath, component: ViewComponent }),
76
- React.createElement(Route, { path: getConfig().router.smartscriptPath ||
76
+ React.createElement(Route, { path: getConfig().router.smartscriptRoute ||
77
77
  '/contrats/:permalink/smartscript/:uniqid?', component: SmartScriptComponent }),
78
78
  React.createElement(Redirect, { to: {
79
- pathname: getConfig().router.notFoundPath,
79
+ pathname: getConfig().router.notFoundUrl,
80
80
  } })))));
81
81
  }
82
82
  }
@@ -10,10 +10,13 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
10
10
  import React from 'react';
11
11
  import PropTypes from 'prop-types';
12
12
  import { getConfig } from './config';
13
+ import * as connectorActions from './redux/actions';
13
14
  import { getStore } from './redux/store';
14
15
  import { getHistory } from './redux/routerHistory';
15
16
  import { EventsTracking } from './libs/EventsTracking';
16
17
  import Globals from './Globals';
18
+ import * as selectorsList from './redux/selectors';
19
+ import * as connectorsList from './componentsConnectors';
17
20
  let globalAnchors = {};
18
21
  let reduxAnchors = {};
19
22
  let actionOverrideAnchor = {};
@@ -66,7 +69,7 @@ export const pluginPageAppState = (page) => {
66
69
  return false;
67
70
  };
68
71
  export const getPluginsPageAppStates = () => PluginsPageAppStates;
69
- const loadPluginFiles = (pluginsList) => __awaiter(void 0, void 0, void 0, function* () {
72
+ const loadPluginFiles = (pluginsList, connectorSelectors, connectors) => __awaiter(void 0, void 0, void 0, function* () {
70
73
  const plugins = Object.keys(pluginsList);
71
74
  const pluginModules = yield Promise.all(plugins.map((plugin) => Globals.loadPlugin(plugin)));
72
75
  plugins.forEach((plugin, index) => {
@@ -74,7 +77,7 @@ const loadPluginFiles = (pluginsList) => __awaiter(void 0, void 0, void 0, funct
74
77
  const anchors = pluginModule.default;
75
78
  const { loader } = pluginModule;
76
79
  if (loader !== undefined) {
77
- loader(getStore().dispatch, getHistory(), getConfig(), EventsTracking);
80
+ loader(connectorSelectors, connectors, getStore().dispatch, connectorActions, getHistory(), getConfig(), EventsTracking);
78
81
  }
79
82
  Object.keys(anchors).forEach((anchor) => {
80
83
  if (anchor === 'replace') {
@@ -125,7 +128,7 @@ export const loadPlugins = (plugins) => __awaiter(void 0, void 0, void 0, functi
125
128
  if (pluginsList === undefined) {
126
129
  pluginsList = getConfig().plugins;
127
130
  }
128
- yield loadPluginFiles(pluginsList);
131
+ yield loadPluginFiles(pluginsList, selectorsList, connectorsList);
129
132
  pluginsLoadingDone = true;
130
133
  });
131
134
  export const pluginsLoaded = () => pluginsLoadingDone;
package/dist/Shimmer.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
2
  import { connect } from 'react-redux';
3
- import { Loader } from '@legalplace/storybook/dist/components/UI/Loader';
3
+ import { Loader } from '@legalplace/storybook';
4
4
  import { getThemeShimmer } from './ThemeLoader';
5
5
  import { PluginLoader } from './PluginLoader';
6
6
  import UserLockedComponent from './components/UserLocked/UserLockedComponent';
@@ -21,7 +21,7 @@ export declare const getThemeParams: () => {
21
21
  email?: import("./types/config.type").SideBarType;
22
22
  };
23
23
  };
24
- fonts?: any;
24
+ fonts?: import("@legalplace/storybook").IFonts | undefined;
25
25
  style?: Record<string, any> | undefined;
26
26
  };
27
27
  export declare const loadThemeComponent: (name: string) => LoadableComponent<any>;
@@ -1,6 +1,6 @@
1
1
  /// <reference types="react" />
2
2
  import { Action } from 'redux';
3
- import type { Moment } from 'moment-business-days';
3
+ import moment from 'moment-business-days';
4
4
  import { SmartScriptStore } from '../libs/SmartScriptStore';
5
5
  import { StateType } from '../types/State.type';
6
6
  export declare type TInitTriggersCallback = (triggers: StateType.SmartScript['triggers'], actions: Action[]) => void;
@@ -22,7 +22,7 @@ declare global {
22
22
  displayOption: typeof SmartScriptStore.displayOption;
23
23
  hideVariable: typeof SmartScriptStore.hideVariable;
24
24
  displayVariable: typeof SmartScriptStore.displayVariable;
25
- moment: Moment;
25
+ moment: typeof moment;
26
26
  triggerListeners: (type: 'option' | 'variable', id: number, inputs: StateType.Inputs) => Action[];
27
27
  initTriggers: (callback: TInitTriggersCallback, inputs: StateType.Inputs, newInstance: boolean) => void;
28
28
  }
@@ -1,6 +1,7 @@
1
1
  import React, { useEffect, useState } from 'react';
2
2
  import { useParams } from 'react-router-dom';
3
3
  import queryString from 'query-string';
4
+ import moment from 'moment-business-days';
4
5
  import { getConfig } from '../config';
5
6
  import { SmartScriptStore } from '../libs/SmartScriptStore';
6
7
  const SmartScriptComponent = () => {
@@ -23,6 +24,7 @@ const SmartScriptComponent = () => {
23
24
  window.displayVariable = SmartScriptStore.displayVariable;
24
25
  window.hideOption = SmartScriptStore.hideOption;
25
26
  window.displayOption = SmartScriptStore.displayOption;
27
+ window.moment = moment;
26
28
  const apiEndpoint = getConfig().apiEndpoint + (/\/$/.test(getConfig().apiEndpoint) ? '' : '/');
27
29
  const { permalink, uniqid } = useParams();
28
30
  const modelVersion = queryString.parse(window.location.search).version;
@@ -32,15 +34,13 @@ const SmartScriptComponent = () => {
32
34
  const scriptElement = document.createElement('script');
33
35
  scriptElement.setAttribute('src', src);
34
36
  scriptElement.onload = () => {
35
- import('moment-business-days').then(() => {
36
- if (typeof initTriggersCallback === 'function') {
37
- if (isNewInstance)
38
- SmartScriptStore.execOnInit();
39
- SmartScriptStore.execOnLoad();
40
- initTriggersCallback(SmartScriptStore.triggers, SmartScriptStore.grabActions());
41
- }
42
- setSmartScriptLoaded(true);
43
- });
37
+ if (typeof initTriggersCallback === 'function') {
38
+ if (isNewInstance)
39
+ SmartScriptStore.execOnInit();
40
+ SmartScriptStore.execOnLoad();
41
+ initTriggersCallback(SmartScriptStore.triggers, SmartScriptStore.grabActions());
42
+ }
43
+ setSmartScriptLoaded(true);
44
44
  };
45
45
  document.body.append(scriptElement);
46
46
  }
@@ -4,6 +4,7 @@ export declare type OwnProps = {
4
4
  goPage: (p: number) => void;
5
5
  };
6
6
  declare class ViewComponent extends React.Component<OwnProps> {
7
+ componentDidMount(): void;
7
8
  shouldComponentUpdate(newProps: OwnProps): boolean;
8
9
  render(): JSX.Element;
9
10
  }
@@ -1,12 +1,27 @@
1
1
  import React from 'react';
2
2
  import { connect } from 'react-redux';
3
+ import Moustrap from 'mousetrap';
3
4
  import Shimmer from '../Shimmer';
4
5
  import { loadThemeComponent } from '../ThemeLoader';
5
- import { selectCurrentAppState } from '../redux/selectors/app';
6
+ import { selectCurrentAppState, selectAvailableAppStates, selectAvailableSections, } from '../redux/selectors/app';
6
7
  import Globals from '../Globals';
7
8
  import { goPageAction } from '../redux/actions/app';
8
9
  import { loadPluginComponent, pluginsLoaded } from '../PluginLoader';
9
10
  class ViewComponent extends React.Component {
11
+ componentDidMount() {
12
+ Moustrap.bind('g o d l d', () => {
13
+ const currentAppState = selectCurrentAppState();
14
+ if (currentAppState === 'email') {
15
+ return;
16
+ }
17
+ const totalSections = selectAvailableSections().length;
18
+ const availableAppStates = selectAvailableAppStates();
19
+ const emailIndex = availableAppStates.indexOf('email');
20
+ const wizardIndex = availableAppStates.indexOf('wizard');
21
+ const emailPage = totalSections + (emailIndex - wizardIndex);
22
+ this.props.goPage(emailPage);
23
+ });
24
+ }
10
25
  shouldComponentUpdate(newProps) {
11
26
  if (this.props.currentAppState !== newProps.currentAppState) {
12
27
  return true;
@@ -15,7 +15,6 @@ declare const connectorSelectors: {
15
15
  selectUserValidToken: () => Readonly<boolean>;
16
16
  selectUserEmail: () => string;
17
17
  isLevelAccessibleForUser: (level: "ADMIN" | "MANAGER" | "USER" | "GUEST" | "SUPER") => Readonly<boolean>;
18
- selectReferences: () => Readonly<import("@legalplace/referencesparser/dist/libs/References.type").ReferencesType>;
19
18
  selectOutputReference: (id: number) => Readonly<import("@legalplace/referencesparser/dist/libs/References.type").ReferencesSingleOutputType | undefined>;
20
19
  selectBoxReference: (id: number) => Readonly<import("@legalplace/referencesparser/dist/libs/References.type").ReferencesSingleBoxType>;
21
20
  isOptionMultiple: (id: number) => Readonly<boolean | undefined>;
@@ -94,6 +93,5 @@ declare const connectorSelectors: {
94
93
  selectCustomizationMeta: () => Readonly<import("../..").AppCustomizationMetaType | undefined>;
95
94
  selectCustomizationAutoDefaultType: () => Readonly<boolean | undefined>;
96
95
  selectModelUuid: () => Readonly<string | undefined>;
97
- CompletelyUnusedSelector: () => Readonly<string | undefined>;
98
96
  };
99
97
  export default connectorSelectors;
@@ -16,12 +16,12 @@ describe('Config loader', () => {
16
16
  router: {
17
17
  wizardPath: '/contrats/:prefix?/:permalink/creer/:page?',
18
18
  wizardInstancePath: '/contrats/:prefix?/:permalink/continuer/:uniqid([0-9a-zA-Z]+)/:page?',
19
- notFoundPath: '/contrats/conditions-generales-de-vente/creer',
19
+ notFoundUrl: '/contrats/conditions-generales-de-vente/creer',
20
20
  appStatesPages: {
21
21
  termsheet: 'resume',
22
22
  email: 'email',
23
23
  },
24
- smartscriptPath: '/contrats/:permalink/smartscript/:uniqid?',
24
+ smartscriptRoute: '/contrats/:permalink/smartscript/:uniqid?',
25
25
  },
26
26
  plugins: {
27
27
  b2c_actions: '1.0.0',
@@ -1,15 +1,12 @@
1
1
  import PhoneNumber from 'awesome-phonenumber';
2
- import { FRENCH_OVERSEAS_NUMBERS_REGEX } from '../constants/phoneValidation';
3
2
  import Extracts from '../libs/Extracts';
4
3
  import { pardotAttributes } from '../service/pardot.service';
5
- const formatMobilePhone = (number) => {
6
- const phoneNumber = new PhoneNumber(number, 'FR');
7
- const sanitizedNumber = phoneNumber.getNumber();
8
- return !(sanitizedNumber === null || sanitizedNumber === void 0 ? void 0 : sanitizedNumber.length) ||
9
- (!phoneNumber.isValid() &&
10
- !FRENCH_OVERSEAS_NUMBERS_REGEX.test(sanitizedNumber))
4
+ const formatMobilePhone = (phoneNumber) => {
5
+ var _a;
6
+ const sanitizedNumber = new PhoneNumber(phoneNumber, 'FR');
7
+ return !((_a = sanitizedNumber === null || sanitizedNumber === void 0 ? void 0 : sanitizedNumber.getNumber()) === null || _a === void 0 ? void 0 : _a.length) || !sanitizedNumber.isMobile()
11
8
  ? ''
12
- : sanitizedNumber;
9
+ : sanitizedNumber.getNumber();
13
10
  };
14
11
  export const getSIBExtract = () => {
15
12
  let sibExtract;
@@ -2,25 +2,25 @@ import { EvalBase } from './EvalBase';
2
2
  export declare class EvalFunctions extends EvalBase {
3
3
  holidays: string[];
4
4
  private parseVariableArgumentDate;
5
- afficherDate: (varRef: string) => Promise<string>;
6
- afficherAnnee: (varRef: string) => Promise<string>;
7
- date: (varRef: string) => Promise<number>;
8
- jourOuvre: (varRef: string) => Promise<string>;
9
- jourOuvrable: (varRef: string) => Promise<string>;
10
- ajouterJoursOuvres: (varRef: string, businessDaysRef: string) => Promise<string>;
11
- ajouterJoursOuvrables: (varRef: string, businessDaysRef: string) => Promise<string>;
12
- ajouterJours: (varRef: string, daysRef: string) => Promise<string>;
13
- ajouterMois: (varRef: string, monthsRef: string) => Promise<string>;
14
- ajouterAnnees: (varRef: string, yearsRef: string) => Promise<string>;
15
- enleverJoursOuvrables: (varRef: string, businessDaysRef: string) => Promise<string>;
16
- enleverJoursOuvres: (varRef: string, businessDaysRef: string) => Promise<string>;
17
- enleverJours: (varRef: string, daysRef: string) => Promise<string>;
18
- enleverMois: (varRef: string, monthsRef: string) => Promise<string>;
19
- enleverAnnees: (varRef: string, yearsRef: string) => Promise<string>;
20
- dureeJours: (varRefA: string, varRefB: string) => Promise<number>;
21
- dureeMois: (varRefA: string, varRefB: string) => Promise<number>;
22
- dureeAnnees: (varRefA: string, varRefB: string) => Promise<number>;
23
- today: () => Promise<string>;
24
- somme: (varRef: string) => Promise<number>;
25
- lettres: (varRef: string) => Promise<string>;
5
+ afficherDate: (varRef: string) => string;
6
+ afficherAnnee: (varRef: string) => string;
7
+ date: (varRef: string) => number;
8
+ jourOuvre: (varRef: string) => string;
9
+ jourOuvrable: (varRef: string) => string;
10
+ ajouterJoursOuvres: (varRef: string, businessDaysRef: string) => string;
11
+ ajouterJoursOuvrables: (varRef: string, businessDaysRef: string) => string;
12
+ ajouterJours: (varRef: string, daysRef: string) => string;
13
+ ajouterMois: (varRef: string, monthsRef: string) => string;
14
+ ajouterAnnees: (varRef: string, yearsRef: string) => string;
15
+ enleverJoursOuvrables: (varRef: string, businessDaysRef: string) => string;
16
+ enleverJoursOuvres: (varRef: string, businessDaysRef: string) => string;
17
+ enleverJours: (varRef: string, daysRef: string) => string;
18
+ enleverMois: (varRef: string, monthsRef: string) => string;
19
+ enleverAnnees: (varRef: string, yearsRef: string) => string;
20
+ dureeJours: (varRefA: string, varRefB: string) => number;
21
+ dureeMois: (varRefA: string, varRefB: string) => number;
22
+ dureeAnnees: (varRefA: string, varRefB: string) => number;
23
+ today: () => string;
24
+ somme: (varRef: string) => number;
25
+ lettres: (varRef: string) => string;
26
26
  }