authscape 1.0.618 → 1.0.620

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/index.js CHANGED
@@ -6406,7 +6406,9 @@ var Editor = (0, _dynamic["default"])(function () {
6406
6406
  });
6407
6407
  var RichTextEditor = function RichTextEditor(_ref) {
6408
6408
  var html = _ref.html,
6409
- onSave = _ref.onSave;
6409
+ onSave = _ref.onSave,
6410
+ _ref$isDisabled = _ref.isDisabled,
6411
+ isDisabled = _ref$isDisabled === void 0 ? false : _ref$isDisabled;
6410
6412
  var _useState = (0, _react.useState)(_draftJs.EditorState.createEmpty()),
6411
6413
  _useState2 = _slicedToArray(_useState, 2),
6412
6414
  editorState = _useState2[0],
@@ -6429,6 +6431,7 @@ var RichTextEditor = function RichTextEditor(_ref) {
6429
6431
  toolbarClassName: "toolbarClassName",
6430
6432
  wrapperClassName: "wrapperClassName",
6431
6433
  editorClassName: "editorClassName",
6434
+ readOnly: isDisabled,
6432
6435
  editorStyle: {
6433
6436
  height: 400
6434
6437
  },
@@ -6453,6 +6456,7 @@ var RichTextEditor = function RichTextEditor(_ref) {
6453
6456
  }
6454
6457
  }, /*#__PURE__*/_react["default"].createElement(_material.Button, {
6455
6458
  variant: "contained",
6459
+ disabled: isDisabled,
6456
6460
  onClick: /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
6457
6461
  return _regeneratorRuntime().wrap(function _callee$(_context) {
6458
6462
  while (1) switch (_context.prev = _context.next) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "authscape",
3
- "version": "1.0.618",
3
+ "version": "1.0.620",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -9,7 +9,7 @@ const Editor = dynamic(
9
9
  { ssr: false }
10
10
  )
11
11
 
12
- export const RichTextEditor = ({html, onSave}) => {
12
+ export const RichTextEditor = ({html, onSave, isDisabled = false}) => {
13
13
 
14
14
  const [editorState, setEditorState] = useState(EditorState.createEmpty());
15
15
  const onEditorStateChange = function (editorState) {
@@ -37,6 +37,7 @@ const Editor = dynamic(
37
37
  toolbarClassName="toolbarClassName"
38
38
  wrapperClassName="wrapperClassName"
39
39
  editorClassName="editorClassName"
40
+ readOnly={isDisabled}
40
41
  editorStyle={{height:400}}
41
42
  onEditorStateChange={onEditorStateChange}
42
43
  // mention={{
@@ -56,7 +57,7 @@ const Editor = dynamic(
56
57
  />
57
58
  <hr/>
58
59
  <Box sx={{textAlign:"right"}}>
59
- <Button variant="contained" onClick={async () => {
60
+ <Button variant="contained" disabled={isDisabled} onClick={async () => {
60
61
 
61
62
  await onSave(draftToHtml(convertToRaw(editorState.getCurrentContent())));
62
63