@portnet/ui 5.0.27 → 5.0.28

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.
@@ -34,6 +34,7 @@ var _reactFontawesome = require("@fortawesome/react-fontawesome");
34
34
  var _reactToastify = require("react-toastify");
35
35
  var _reactstrap = require("reactstrap");
36
36
  var _freeRegularSvgIcons = require("@fortawesome/free-regular-svg-icons");
37
+ var _dompurify = _interopRequireDefault(require("dompurify"));
37
38
  var _freeSolidSvgIcons = require("@fortawesome/free-solid-svg-icons");
38
39
  var _iconsMaterial = require("@mui/icons-material");
39
40
  var _material = require("@mui/material");
@@ -1828,6 +1829,7 @@ const ReclamationsList = _ref5 => {
1828
1829
  return "#757575";
1829
1830
  }
1830
1831
  };
1832
+ const isHtml = str => /<\/?[a-z][\s\S]*>/i.test(str);
1831
1833
  const renderTextWithLinks = text => {
1832
1834
  if (!text) return null;
1833
1835
  const parts = text.split(/(https?:\/\/[^\s)]+)/g);
@@ -2675,7 +2677,19 @@ const ReclamationsList = _ref5 => {
2675
2677
  marginBottom: "4px"
2676
2678
  },
2677
2679
  children: "\uD83D\uDCAC R\xE9ponse"
2678
- }), renderTextWithLinks(entry.reponse)]
2680
+ }), isHtml(entry.reponse) ? /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
2681
+ style: {
2682
+ whiteSpace: "normal"
2683
+ },
2684
+ dangerouslySetInnerHTML: {
2685
+ __html: _dompurify.default.sanitize(entry.reponse)
2686
+ }
2687
+ }) : /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
2688
+ style: {
2689
+ whiteSpace: "pre-line"
2690
+ },
2691
+ children: entry.reponse
2692
+ })]
2679
2693
  }), ((_entry$documents = entry.documents) === null || _entry$documents === void 0 ? void 0 : _entry$documents.length) > 0 && /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
2680
2694
  style: {
2681
2695
  marginTop: "8px",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@portnet/ui",
3
- "version": "5.0.27",
3
+ "version": "5.0.28",
4
4
  "description": "Portnet UI",
5
5
  "keywords": [
6
6
  "react",
@@ -30,8 +30,8 @@
30
30
  "@testing-library/jest-dom": "^5.16.5",
31
31
  "@testing-library/react": "^13.4.0",
32
32
  "@testing-library/user-event": "^13.5.0",
33
- "axios": "^1.13.2",
34
33
  "bootstrap": "^5.3.2",
34
+ "dompurify": "^3.4.12",
35
35
  "formik": "^2.2.9",
36
36
  "lodash": "^4.17.21",
37
37
  "moment": "^2.30.1",
@@ -48,6 +48,9 @@
48
48
  "web-vitals": "^2.1.4",
49
49
  "yup": "^0.32.11"
50
50
  },
51
+ "peerDependencies": {
52
+ "axios": "0.27.2"
53
+ },
51
54
  "scripts": {
52
55
  "start": "react-scripts start",
53
56
  "build": "rimraf dist && cross-env NODE_ENV=production babel src/lib --out-dir dist --copy-files",