@teselagen/ove 0.8.28 → 0.8.30

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.
@@ -39,6 +39,7 @@ import { createSelector, defaultMemoize } from "reselect";
39
39
  import domtoimage from "dom-to-image";
40
40
  import {
41
41
  hideDialog,
42
+ dialogHolder,
42
43
  showAddOrEditAnnotationDialog,
43
44
  showDialog
44
45
  } from "../GlobalDialogUtils";
@@ -141,7 +142,8 @@ export const handleSave =
141
142
  readOnly,
142
143
  alwaysAllowSave,
143
144
  sequenceData,
144
- lastSavedIdUpdate
145
+ lastSavedIdUpdate,
146
+ getAcceptedInsertChars
145
147
  } = props;
146
148
  const saveHandler = opts.isSaveAs ? onSaveAs || onSave : onSave;
147
149
 
@@ -162,7 +164,8 @@ export const handleSave =
162
164
  opts,
163
165
  tidyUpSequenceData(sequenceData, {
164
166
  doNotRemoveInvalidChars: true,
165
- annotationsAsObjects: true
167
+ annotationsAsObjects: true,
168
+ getAcceptedInsertChars
166
169
  }),
167
170
  props,
168
171
  updateLastSavedIdToCurrent
@@ -367,8 +370,8 @@ export default compose(
367
370
  options
368
371
  } = props.beforeSequenceInsertOrDelete
369
372
  ? (await props.beforeSequenceInsertOrDelete(
370
- tidyUpSequenceData(_sequenceDataToInsert),
371
- tidyUpSequenceData(_existingSequenceData),
373
+ tidyUpSequenceData(_sequenceDataToInsert, { getAcceptedInsertChars: props.getAcceptedInsertChars }),
374
+ tidyUpSequenceData(_existingSequenceData, { getAcceptedInsertChars: props.getAcceptedInsertChars }),
372
375
  _caretPositionOrRange,
373
376
  _options
374
377
  )) || {}
@@ -555,7 +558,11 @@ const getEditorState = createSelector(
555
558
  state => state.VectorEditor,
556
559
  (state, editorName) => editorName,
557
560
  (VectorEditor, editorName) => {
558
- return VectorEditor[editorName];
561
+ const editorState = VectorEditor[editorName];
562
+ editorState && (editorState.editorSize = Object.values(VectorEditor).filter(
563
+ editorItem => editorItem?.sequenceData
564
+ ).length);
565
+ return editorState;
559
566
  }
560
567
  );
561
568
 
@@ -595,6 +602,10 @@ function mapStateToProps(state, ownProps) {
595
602
  annotationTypePlural,
596
603
  sequenceLength
597
604
  );
605
+ if (dialogHolder.editorName) {
606
+ annotationToAdd =
607
+ dialogHolder.editorName === editorName ? annotationToAdd : undefined;
608
+ }
598
609
  }
599
610
  });
600
611
 
@@ -623,7 +634,7 @@ function mapStateToProps(state, ownProps) {
623
634
  const selectedCutsites = s.selectedCutsitesSelector(editorState);
624
635
  const allCutsites = s.cutsitesSelector(
625
636
  editorState,
626
- ownProps.additionalEnzymes
637
+ ownProps.additionalEnzymes,
627
638
  );
628
639
 
629
640
  const { matchedSearchLayer, searchLayers, matchesTotal } =
@@ -887,13 +898,15 @@ export function getShowGCContent(state, ownProps) {
887
898
  return toRet;
888
899
  }
889
900
 
890
- function jsonToJson(incomingJson) {
901
+ function jsonToJson(incomingJson, options) {
902
+ const {getAcceptedInsertChars} = options || {};
891
903
  return JSON.stringify(
892
904
  omit(
893
905
  cleanUpTeselagenJsonForExport(
894
906
  tidyUpSequenceData(incomingJson, {
895
907
  doNotRemoveInvalidChars: true,
896
- annotationsAsObjects: false
908
+ annotationsAsObjects: false,
909
+ getAcceptedInsertChars
897
910
  })
898
911
  ),
899
912
  [