@epam/ai-dial-modulify-ui 0.19.0-rc.8 → 0.19.0
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 +9 -8
- package/index.esm.js +7 -6
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -100,14 +100,15 @@ Provides an interface to interact with a registered component. It returns an obj
|
|
|
100
100
|
|
|
101
101
|
```tsx
|
|
102
102
|
// Accessing the original component and binding a new implementation
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
<
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
103
|
+
Inversify.resolve(MyComponent.original).bind((originalComponent) => (props) => (
|
|
104
|
+
// Accessing and using the original component within the factory
|
|
105
|
+
<div style={{ border: '2px solid red' }}>
|
|
106
|
+
<originalComponent {...props} />
|
|
107
|
+
</div>
|
|
108
|
+
));
|
|
109
|
+
|
|
110
|
+
// Rendering the component with the bound implementation
|
|
111
|
+
const RenderedComponent = Inversify.resolve(MyComponent.original).render();
|
|
111
112
|
|
|
112
113
|
// If you need to revert to the original component, unbind to the original
|
|
113
114
|
Inversify.resolve(MyComponent.original).unbind();
|
package/index.esm.js
CHANGED
|
@@ -10613,18 +10613,19 @@ class ComponentBuilder {
|
|
|
10613
10613
|
}
|
|
10614
10614
|
const customizeId = child.props[DATA_CUSTOMIZE_ID];
|
|
10615
10615
|
if (customizeId && this.htmlReplacements[customizeId]) {
|
|
10616
|
-
const replacedContent = this.htmlReplacements[customizeId](child,
|
|
10616
|
+
const replacedContent = this.htmlReplacements[customizeId](react.exports.cloneElement(child, {
|
|
10617
|
+
[DATA_CUSTOMIZE_ID]: undefined,
|
|
10618
|
+
}), state, handlers);
|
|
10617
10619
|
if (!react.exports.isValidElement(replacedContent)) {
|
|
10618
10620
|
return child;
|
|
10619
10621
|
}
|
|
10620
|
-
return react.exports.cloneElement(replacedContent, {
|
|
10621
|
-
[DATA_CUSTOMIZE_ID]: customizeId,
|
|
10622
|
+
return react.exports.cloneElement(replacedContent, Object.assign({ [DATA_CUSTOMIZE_ID]: customizeId }, (replacedContent.props.children && {
|
|
10622
10623
|
children: this.applyHTMLReplacements(replacedContent.props.children, state, handlers),
|
|
10623
|
-
});
|
|
10624
|
+
})));
|
|
10624
10625
|
}
|
|
10625
|
-
return react.exports.cloneElement(child, {
|
|
10626
|
+
return react.exports.cloneElement(child, Object.assign({}, (child.props.children && {
|
|
10626
10627
|
children: this.applyHTMLReplacements(child.props.children, state, handlers),
|
|
10627
|
-
});
|
|
10628
|
+
})));
|
|
10628
10629
|
});
|
|
10629
10630
|
}
|
|
10630
10631
|
}
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@epam/ai-dial-modulify-ui",
|
|
3
3
|
"description": "Modulify Toolkit (UI) for turning a monolith-like project into a modular one",
|
|
4
4
|
"homepage": "https://epam-rail.com",
|
|
5
|
-
"version": "0.19.0
|
|
5
|
+
"version": "0.19.0",
|
|
6
6
|
"dependencies": {},
|
|
7
7
|
"type": "module",
|
|
8
8
|
"bugs": {
|