@datarobot/design-system 30.1.1 → 30.1.2

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.
@@ -21,7 +21,16 @@ const Markdown = ({
21
21
  const {
22
22
  t
23
23
  } = (0, _useTranslation.useTranslation)();
24
+ const clearPrevChildrenState = () => {
25
+ if (error) {
26
+ setError('');
27
+ }
28
+ if (html) {
29
+ setHtml('');
30
+ }
31
+ };
24
32
  (0, _react.useEffect)(() => {
33
+ clearPrevChildrenState();
25
34
  Promise.all([Promise.resolve().then(() => _interopRequireWildcard(require(/* webpackChunkName: "unified" */'unified'))), Promise.resolve().then(() => _interopRequireWildcard(require(/* webpackChunkName: "remark-gfm" */'remark-gfm'))), Promise.resolve().then(() => _interopRequireWildcard(require(/* webpackChunkName: "remark-parse" */'remark-parse'))), Promise.resolve().then(() => _interopRequireWildcard(require(/* webpackChunkName: "remark-rehype" */'remark-rehype'))), Promise.resolve().then(() => _interopRequireWildcard(require(/* webpackChunkName: "rehype-sanitize" */'rehype-sanitize'))), Promise.resolve().then(() => _interopRequireWildcard(require(/* webpackChunkName: "rehype-stringify" */'rehype-stringify'))), Promise.resolve().then(() => _interopRequireWildcard(require(/* webpackChunkName: "rehype-highlight" */'rehype-highlight'))), Promise.resolve().then(() => _interopRequireWildcard(require(/* webpackChunkName: "rehype-katex" */'rehype-katex'))), Promise.resolve().then(() => _interopRequireWildcard(require(/* webpackChunkName: "remark-math" */'remark-math')))]).then(([{
26
35
  unified
27
36
  }, {
@@ -55,7 +64,7 @@ const Markdown = ({
55
64
  }).catch(err => {
56
65
  setError(err);
57
66
  });
58
- }, []);
67
+ }, [children]);
59
68
  if (error) {
60
69
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(_message.Message, {
61
70
  type: _message.MESSAGE_TYPES.ERROR,
@@ -13,7 +13,16 @@ const Markdown = ({
13
13
  const {
14
14
  t
15
15
  } = useTranslation();
16
+ const clearPrevChildrenState = () => {
17
+ if (error) {
18
+ setError('');
19
+ }
20
+ if (html) {
21
+ setHtml('');
22
+ }
23
+ };
16
24
  useEffect(() => {
25
+ clearPrevChildrenState();
17
26
  Promise.all([import(/* webpackChunkName: "unified" */'unified'), import(/* webpackChunkName: "remark-gfm" */'remark-gfm'), import(/* webpackChunkName: "remark-parse" */'remark-parse'), import(/* webpackChunkName: "remark-rehype" */'remark-rehype'), import(/* webpackChunkName: "rehype-sanitize" */'rehype-sanitize'), import(/* webpackChunkName: "rehype-stringify" */'rehype-stringify'), import(/* webpackChunkName: "rehype-highlight" */'rehype-highlight'), import(/* webpackChunkName: "rehype-katex" */'rehype-katex'), import(/* webpackChunkName: "remark-math" */'remark-math')]).then(([{
18
27
  unified
19
28
  }, {
@@ -47,7 +56,7 @@ const Markdown = ({
47
56
  }).catch(err => {
48
57
  setError(err);
49
58
  });
50
- }, []);
59
+ }, [children]);
51
60
  if (error) {
52
61
  return /*#__PURE__*/_jsx(Message, {
53
62
  type: MESSAGE_TYPES.ERROR,
@@ -69502,7 +69502,16 @@ var Markdown = function Markdown(_ref) {
69502
69502
  setError = _useState4[1];
69503
69503
  var _useTranslation = (0,_hooks_use_translation__WEBPACK_IMPORTED_MODULE_4__.useTranslation)(),
69504
69504
  t = _useTranslation.t;
69505
+ var clearPrevChildrenState = function clearPrevChildrenState() {
69506
+ if (error) {
69507
+ setError('');
69508
+ }
69509
+ if (html) {
69510
+ setHtml('');
69511
+ }
69512
+ };
69505
69513
  (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(function () {
69514
+ clearPrevChildrenState();
69506
69515
  Promise.all([Promise.resolve(/*! import() */).then(__webpack_require__.t.bind(__webpack_require__, /*! unified */ "unified", 23)), Promise.resolve(/*! import() */).then(__webpack_require__.t.bind(__webpack_require__, /*! remark-gfm */ "remark-gfm", 23)), Promise.resolve(/*! import() */).then(__webpack_require__.t.bind(__webpack_require__, /*! remark-parse */ "remark-parse", 23)), Promise.resolve(/*! import() */).then(__webpack_require__.t.bind(__webpack_require__, /*! remark-rehype */ "remark-rehype", 23)), Promise.resolve(/*! import() */).then(__webpack_require__.t.bind(__webpack_require__, /*! rehype-sanitize */ "rehype-sanitize", 23)), Promise.resolve(/*! import() */).then(__webpack_require__.t.bind(__webpack_require__, /*! rehype-stringify */ "rehype-stringify", 23)), Promise.resolve(/*! import() */).then(__webpack_require__.t.bind(__webpack_require__, /*! rehype-highlight */ "rehype-highlight", 23)), Promise.resolve(/*! import() */).then(__webpack_require__.t.bind(__webpack_require__, /*! rehype-katex */ "rehype-katex", 23)), Promise.resolve(/*! import() */).then(__webpack_require__.t.bind(__webpack_require__, /*! remark-math */ "remark-math", 23))]).then(function (_ref2) {
69507
69516
  var _ref3 = _slicedToArray(_ref2, 9),
69508
69517
  unified = _ref3[0].unified,
@@ -69528,7 +69537,7 @@ var Markdown = function Markdown(_ref) {
69528
69537
  })["catch"](function (err) {
69529
69538
  setError(err);
69530
69539
  });
69531
- }, []);
69540
+ }, [children]);
69532
69541
  if (error) {
69533
69542
  return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_message__WEBPACK_IMPORTED_MODULE_2__.Message, {
69534
69543
  type: _message__WEBPACK_IMPORTED_MODULE_2__.MESSAGE_TYPES.ERROR