Skip to content

Commit 9b60657

Browse files
authored
[WC-2844] Fix the compatibility with react client for Color Picker (#1499)
2 parents ef956ad + 8d7b5a5 commit 9b60657

File tree

4 files changed

+36
-3
lines changed

4 files changed

+36
-3
lines changed

packages/pluggableWidgets/color-picker-web/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66

77
## [Unreleased]
88

9+
### Fixed
10+
11+
- We fixed an issue with Color Picker not working in React client.
12+
913
## [2.1.2] - 2024-08-28
1014

1115
### Changed

packages/pluggableWidgets/color-picker-web/package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@mendix/color-picker-web",
33
"widgetName": "ColorPicker",
4-
"version": "2.1.2",
4+
"version": "2.1.3",
55
"description": "Change a color using a color input",
66
"copyright": "© Mendix Technology BV 2025. All rights reserved.",
77
"repository": {
@@ -21,7 +21,8 @@
2121
"marketplace": {
2222
"minimumMXVersion": "9.6.0",
2323
"appNumber": 107044,
24-
"appName": "Color Picker"
24+
"appName": "Color Picker",
25+
"reactReady": true
2526
},
2627
"packagePath": "com.mendix.widget.custom",
2728
"scripts": {
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
import commonjs from "@rollup/plugin-commonjs";
2+
3+
export default args => {
4+
const result = args.configDefaultConfig;
5+
return result.map((config, _index) => {
6+
if (config.output.format !== "es") {
7+
return config;
8+
}
9+
return {
10+
...config,
11+
plugins: config.plugins.map(plugin => {
12+
if (plugin && plugin.name === "commonjs") {
13+
// replace common js plugin that transforms
14+
// external requires to imports
15+
// this is needed in order to work with modern client
16+
return commonjs({
17+
extensions: [".js", ".jsx", ".tsx", ".ts"],
18+
transformMixedEsModules: true,
19+
requireReturnsDefault: "auto",
20+
esmExternals: true
21+
});
22+
}
23+
24+
return plugin;
25+
})
26+
};
27+
});
28+
};

packages/pluggableWidgets/color-picker-web/src/package.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="utf-8" ?>
22
<package xmlns="http://www.mendix.com/package/1.0/">
3-
<clientModule name="ColorPicker" version="2.1.2" xmlns="http://www.mendix.com/clientModule/1.0/">
3+
<clientModule name="ColorPicker" version="2.1.3" xmlns="http://www.mendix.com/clientModule/1.0/">
44
<widgetFiles>
55
<widgetFile path="ColorPicker.xml" />
66
</widgetFiles>

0 commit comments

Comments
 (0)