@legalplace/wizardx-core 2.14.1 → 2.15.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 CHANGED
@@ -3,6 +3,28 @@
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.15.1](https://git.legalplace.eu/legalplace/monorepo/compare/@legalplace/wizardx-core@2.15.0...@legalplace/wizardx-core@2.15.1) (2023-02-07)
7
+
8
+
9
+ ### Bug Fixes
10
+
11
+ * fix review ([271671b](https://git.legalplace.eu/legalplace/monorepo/commits/271671b2ee053097c1ed85e713fb0abf78dd2586)), closes [api#7667](https://git.legalplace.eu/legalplace/monorepo/issues/7667)
12
+
13
+
14
+
15
+
16
+
17
+ # [2.15.0](https://git.legalplace.eu/legalplace/monorepo/compare/@legalplace/wizardx-core@2.14.1...@legalplace/wizardx-core@2.15.0) (2023-01-18)
18
+
19
+
20
+ ### Features
21
+
22
+ * supporting multiple replacements in wizardx api[#7119](https://git.legalplace.eu/legalplace/monorepo/issues/7119) ([6002531](https://git.legalplace.eu/legalplace/monorepo/commits/60025314634fb679acaef9a12d2a4e6ae3704ded))
23
+
24
+
25
+
26
+
27
+
6
28
  ## [2.14.1](https://git.legalplace.eu/legalplace/monorepo/compare/@legalplace/wizardx-core@2.14.0...@legalplace/wizardx-core@2.14.1) (2023-01-10)
7
29
 
8
30
 
@@ -82,7 +82,10 @@ const loadPluginFiles = (pluginsList) => __awaiter(void 0, void 0, void 0, funct
82
82
  Object.keys(anchors).forEach((anchor) => {
83
83
  if (anchor === "replace") {
84
84
  Object.keys(anchors[anchor]).forEach((replacer) => {
85
- replacers[replacer] = anchors[anchor][replacer];
85
+ if (!Object.prototype.hasOwnProperty.call(replacers, replacer)) {
86
+ replacers[replacer] = [];
87
+ }
88
+ replacers[replacer].push(anchors[anchor][replacer]);
86
89
  });
87
90
  return;
88
91
  }
@@ -190,8 +193,11 @@ export function ReplaceComponent(replacerName, OriginalComponent, componentName)
190
193
  }
191
194
  let FinalComponent;
192
195
  if (Replacer !== null) {
193
- const ReplacerComponent = replacers[Replacer];
194
- const FinalReplacedComponent = (props) => (_jsx(React.Suspense, Object.assign({ fallback: null }, { children: _jsx(ReplacerComponent, Object.assign({}, props, { OriginalComponent: OriginalComponent }, { children: props.children }), void 0) }), void 0));
196
+ const BaseComponent = (props) => (_jsx(OriginalComponent, Object.assign({}, props, { children: props.children }), void 0));
197
+ const FinalReplacedComponent = replacers[Replacer].reduce((PreviousReplacer, CurrentReplacer) => {
198
+ const ReplacedComponent = (props) => (_jsx(React.Suspense, Object.assign({ fallback: null }, { children: _jsx(CurrentReplacer, Object.assign({}, props, { OriginalComponent: PreviousReplacer }, { children: props.children }), void 0) }), void 0));
199
+ return ReplacedComponent;
200
+ }, BaseComponent);
195
201
  FinalComponent = FinalReplacedComponent;
196
202
  FinalComponent.displayName = `replacedComponent(${displayName})`;
197
203
  }
@@ -2,3 +2,4 @@ export * from "./outputsParsing";
2
2
  export * from "./preloadTheme";
3
3
  export * from "./scriptsLoader";
4
4
  export * from "./propsEqualityCheck";
5
+ export * from "./date.helper";
@@ -2,3 +2,4 @@ export * from "./outputsParsing";
2
2
  export * from "./preloadTheme";
3
3
  export * from "./scriptsLoader";
4
4
  export * from "./propsEqualityCheck";
5
+ export * from "./date.helper";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@legalplace/wizardx-core",
3
- "version": "2.14.1",
3
+ "version": "2.15.1",
4
4
  "author": "Moncef Hammou (moncef@legalplace.fr)",
5
5
  "license": "MIT",
6
6
  "files": [
@@ -93,5 +93,5 @@
93
93
  "*.test.ts",
94
94
  "*.test.tsx"
95
95
  ],
96
- "gitHead": "7905939c0106a35b983aaf2b57a19a5746a01fc0"
96
+ "gitHead": "8e377a599464d5885544773e3f9550bc33c5ae6c"
97
97
  }