@openmrs/esm-styleguide 5.0.2 → 5.0.3-pre.826

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openmrs/esm-styleguide",
3
- "version": "5.0.2",
3
+ "version": "5.0.3-pre.826",
4
4
  "license": "MPL-2.0",
5
5
  "description": "The styleguide for OpenMRS SPA",
6
6
  "browser": "dist/openmrs-esm-styleguide.js",
@@ -51,9 +51,9 @@
51
51
  "rxjs": "6.x"
52
52
  },
53
53
  "devDependencies": {
54
- "@openmrs/esm-extensions": "^5.0.2",
55
- "@openmrs/esm-react-utils": "^5.0.2",
56
- "@openmrs/esm-state": "^5.0.2",
54
+ "@openmrs/esm-extensions": "^5.0.3-pre.826",
55
+ "@openmrs/esm-react-utils": "^5.0.3-pre.826",
56
+ "@openmrs/esm-state": "^5.0.3-pre.826",
57
57
  "autoprefixer": "^9.8.8",
58
58
  "css-minimizer-webpack-plugin": "^1.2.0",
59
59
  "i18next": "^19.6.0",
@@ -64,5 +64,5 @@
64
64
  "react-dom": "^18.1.0",
65
65
  "rxjs": "^6.5.3"
66
66
  },
67
- "gitHead": "0a5da41b12979457322425409fbed4195d5b13da"
67
+ "gitHead": "d0bef414e7decaaa709644212c6cfd50c62c211f"
68
68
  }
@@ -34,11 +34,13 @@ export function renderInlineNotifications(target: HTMLElement | null) {
34
34
  }
35
35
 
36
36
  function isNotEmpty(description: React.ReactNode) {
37
- return typeof description === "string"
38
- ? description.trim().length > 0
39
- : typeof description === "object"
40
- ? !isEmpty(description)
41
- : false;
37
+ if (typeof description === "string") {
38
+ return description.trim().length > 0;
39
+ } else if (typeof description === "object") {
40
+ return description instanceof Error || !isEmpty(description);
41
+ }
42
+
43
+ return false;
42
44
  }
43
45
 
44
46
  /**
@@ -47,6 +49,10 @@ function isNotEmpty(description: React.ReactNode) {
47
49
  */
48
50
  export function showNotification(notification: NotificationDescriptor) {
49
51
  if (notification && isNotEmpty(notification.description)) {
52
+ if (notification.description instanceof Error) {
53
+ notification.description = notification.description.toLocaleString();
54
+ }
55
+
50
56
  setTimeout(() => {
51
57
  // always use in subsequent cycle
52
58
  inlineNotificationsSubject.next({
package/webpack.config.js CHANGED
@@ -1,6 +1,5 @@
1
1
  const MiniCssExtractPlugin = require("mini-css-extract-plugin");
2
2
  const CssMinimizerPlugin = require("css-minimizer-webpack-plugin");
3
- const SystemJSPublicPathWebpackPlugin = require("systemjs-webpack-interop/SystemJSPublicPathWebpackPlugin");
4
3
  const { resolve } = require("path");
5
4
  const { BundleAnalyzerPlugin } = require("webpack-bundle-analyzer");
6
5
  const { CleanWebpackPlugin } = require("clean-webpack-plugin");
@@ -13,10 +12,10 @@ module.exports = (env) => ({
13
12
  resolve(__dirname, "src/_all.scss"),
14
13
  ],
15
14
  output: {
16
- libraryTarget: "system",
17
15
  filename: "openmrs-esm-styleguide.js",
18
16
  chunkFilename: "[name].js",
19
17
  path: resolve(__dirname, "dist"),
18
+ library: { type: "system" },
20
19
  },
21
20
  mode: "production",
22
21
  devtool: "source-map",
@@ -61,7 +60,6 @@ module.exports = (env) => ({
61
60
  minimizer: [new CssMinimizerPlugin(), "..."],
62
61
  },
63
62
  plugins: [
64
- new SystemJSPublicPathWebpackPlugin(),
65
63
  new CleanWebpackPlugin(),
66
64
  new MiniCssExtractPlugin({
67
65
  filename: "openmrs-esm-styleguide.css",