@micromag/screen-contribution 0.3.686 → 0.3.693

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.
Files changed (2) hide show
  1. package/es/index.js +5 -2
  2. package/package.json +3 -2
package/es/index.js CHANGED
@@ -7,6 +7,7 @@ import { faRedo } from '@fortawesome/free-solid-svg-icons/faRedo';
7
7
  import { faSpinner } from '@fortawesome/free-solid-svg-icons/faSpinner';
8
8
  import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
9
9
  import classNames from 'classnames';
10
+ import DOMPurify from 'dompurify';
10
11
  import PropTypes from 'prop-types';
11
12
  import React, { useRef, useState, useCallback, useEffect } from 'react';
12
13
  import { PropTypes as PropTypes$1 } from '@micromag/core';
@@ -201,10 +202,12 @@ var ContributionScreen = function ContributionScreen(_ref) {
201
202
  }),
202
203
  contributions = _useContributions.contributions;
203
204
  var onNameChange = useCallback(function (e) {
204
- setUserName(e.currentTarget.value);
205
+ var value = DOMPurify.sanitize(e.currentTarget.value || '');
206
+ setUserName(value);
205
207
  }, [setUserName]);
206
208
  var onMessageChange = useCallback(function (e) {
207
- setUserMessage(e.currentTarget.value);
209
+ var value = DOMPurify.sanitize(e.currentTarget.value || '');
210
+ setUserMessage(value);
208
211
  }, [setUserMessage]);
209
212
  var onContributionReset = useCallback(function () {
210
213
  setUserName('');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@micromag/screen-contribution",
3
- "version": "0.3.686",
3
+ "version": "0.3.693",
4
4
  "private": false,
5
5
  "description": "",
6
6
  "keywords": [
@@ -78,6 +78,7 @@
78
78
  "@micromag/element-text-input": "^0.3.683",
79
79
  "@micromag/transforms": "^0.3.679",
80
80
  "classnames": "^2.2.6",
81
+ "dompurify": "^3.2.6",
81
82
  "lodash": "^4.17.21",
82
83
  "prop-types": "^15.7.2",
83
84
  "react-intl": "^6.6.4",
@@ -87,5 +88,5 @@
87
88
  "access": "public",
88
89
  "registry": "https://registry.npmjs.org/"
89
90
  },
90
- "gitHead": "5bc6e156b107a08b875192cf654a4506cfacd2ca"
91
+ "gitHead": "662297219d49d234efcc13ad507529d0ebff5427"
91
92
  }