@complat/react-spectra-editor 1.5.3 → 1.5.4

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.
@@ -117,8 +117,9 @@ const normalizeQuillValue = val => {
117
117
  if (val === '<p><br></p>' || val === '<p></p>') return '';
118
118
  return val;
119
119
  };
120
- const handleDescriptionChanged = (value, onDescriptionChanged) => {
121
- onDescriptionChanged(normalizeQuillValue(value));
120
+ const handleDescriptionChanged = (content, delta, source, editor, onDescriptionChanged) => {
121
+ if (!onDescriptionChanged) return;
122
+ onDescriptionChanged(normalizeQuillValue(content), delta, source, editor);
122
123
  };
123
124
  const aucValue = integration => {
124
125
  if (!integration) {
@@ -442,11 +443,11 @@ const InfoPanel = ({
442
443
  className: (0, _classnames.default)(classes.quill, 'card-sv-quill'),
443
444
  value: normalizeQuillValue(descriptions),
444
445
  placeholder: canChangeDescription ? 'Peaks will be written here...' : undefined,
445
- readOnly: true,
446
+ readOnly: !canChangeDescription,
446
447
  modules: {
447
448
  toolbar: false
448
449
  },
449
- onChange: value => handleDescriptionChanged(value, onDescriptionChanged)
450
+ onChange: (content, delta, source, editor) => handleDescriptionChanged(content, delta, source, editor, onDescriptionChanged)
450
451
  })
451
452
  })]
452
453
  }) : null]
package/dist/index.js CHANGED
@@ -500,7 +500,7 @@ class DemoWriteIr extends _react.default.Component {
500
500
  console.log(analysis);
501
501
  console.log(integration);
502
502
  console.log(multiplicity);
503
- if (shift.ref.label) {
503
+ if (shift?.ref?.label) {
504
504
  const label = this.rmDollarSign(shift.ref.label);
505
505
  alert(`Peaks: ${body}` + '\n' + '- - - - - - - - - - -' + '\n' + `Shift solvent = ${label}, ${shift.ref.value}ppm` + '\n');
506
506
  } else {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@complat/react-spectra-editor",
3
- "version": "1.5.3",
3
+ "version": "1.5.4",
4
4
  "description": "An editor to View and Edit Chemical Spectra data (NMR, IR, MS, CV, UIVIS, XRD, GC, and DSC).",
5
5
  "repository": {
6
6
  "type": "git",