@teselagen/ove 0.7.33 → 0.7.35

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.cjs.js CHANGED
@@ -36818,6 +36818,9 @@ const defaultValidators = {
36818
36818
  }, "dropdownMulti"),
36819
36819
  number: /* @__PURE__ */ __name((newVal2, field) => {
36820
36820
  if (isValueEmpty(newVal2) && !field.isRequired) return;
36821
+ if (field.allowNaN && Number.isNaN(newVal2)) {
36822
+ return;
36823
+ }
36821
36824
  if (isNaN(newVal2) || !isNumber$2(newVal2)) {
36822
36825
  return "Must be a number";
36823
36826
  }
@@ -82982,6 +82985,14 @@ const proteinAlphabet = {
82982
82985
  color: "hsl(264.7, 100%, 69%)",
82983
82986
  mass: 128.17228
82984
82987
  },
82988
+ O: {
82989
+ value: "O",
82990
+ name: "Pyrrolysine",
82991
+ threeLettersName: "Pyl",
82992
+ colorByFamily: "#FFC0CB",
82993
+ color: "hsl(264.7, 100%, 69%)",
82994
+ mass: 255.313
82995
+ },
82985
82996
  M: {
82986
82997
  value: "M",
82987
82998
  name: "Methionine",
@@ -83516,7 +83527,7 @@ function getAcceptedChars({
83516
83527
  isRna: isRna2,
83517
83528
  isMixedRnaAndDna
83518
83529
  } = {}) {
83519
- return isProtein2 ? `${extended_protein_letters.toLowerCase()}}` : isOligo2 ? ambiguous_rna_letters.toLowerCase() + "t" : isRna2 ? ambiguous_rna_letters.toLowerCase() + "t" : isMixedRnaAndDna ? ambiguous_rna_letters.toLowerCase() + ambiguous_dna_letters.toLowerCase() : (
83530
+ return isProtein2 ? `${extended_protein_letters.toLowerCase()}` : isOligo2 ? ambiguous_rna_letters.toLowerCase() + "t" : isRna2 ? ambiguous_rna_letters.toLowerCase() + "t" : isMixedRnaAndDna ? ambiguous_rna_letters.toLowerCase() + ambiguous_dna_letters.toLowerCase() : (
83520
83531
  //just plain old dna
83521
83532
  ambiguous_rna_letters.toLowerCase() + ambiguous_dna_letters.toLowerCase()
83522
83533
  );
@@ -84530,7 +84541,7 @@ function adjustAnnotationsToDelete(annotationsToBeAdjusted, range2, maxLength) {
84530
84541
  return __spreadValues(__spreadProps(__spreadValues({}, newRange), {
84531
84542
  start: newLocations[0].start,
84532
84543
  end: newLocations[newLocations.length - 1].end
84533
- }), newLocations.length > 1 && { locations: newLocations });
84544
+ }), newLocations.length > 0 && { locations: newLocations });
84534
84545
  } else {
84535
84546
  return newRange;
84536
84547
  }
@@ -117456,6 +117467,7 @@ function SelectionLayer$2(props) {
117456
117467
  __spreadValues({
117457
117468
  key: key + "caret1"
117458
117469
  }, {
117470
+ isProtein: isProtein2,
117459
117471
  leftMargin,
117460
117472
  onClick: _onClick || preventDefaultStopPropagation,
117461
117473
  onRightClick: onSelectionContextMenu,
@@ -117475,6 +117487,7 @@ function SelectionLayer$2(props) {
117475
117487
  __spreadValues({
117476
117488
  key: key + "caret2"
117477
117489
  }, {
117490
+ isProtein: isProtein2,
117478
117491
  leftMargin,
117479
117492
  onClick: _onClick || preventDefaultStopPropagation,
117480
117493
  onRightClick: onSelectionContextMenu,
@@ -122498,7 +122511,8 @@ function Chromatogram(props) {
122498
122511
  noQualityScores: !showChromQualScores
122499
122512
  }),
122500
122513
  style: {
122501
- position: "relative"
122514
+ position: "relative",
122515
+ textAlign: "left"
122502
122516
  },
122503
122517
  onContextMenu: /* @__PURE__ */ __name((e) => {
122504
122518
  showContextMenu([chromatogramMenu], void 0, e);
@@ -123355,7 +123369,8 @@ function RowItem(props) {
123355
123369
  ), caretPosition2 > -1 && /* @__PURE__ */ React.createElement(
123356
123370
  Caret$2,
123357
123371
  __spreadProps(__spreadValues({
123358
- caretPosition: caretPosition2
123372
+ caretPosition: caretPosition2,
123373
+ isProtein: isProtein2
123359
123374
  }, __spreadValues(__spreadValues({}, annotationCommonProps), { getGaps: void 0 })), {
123360
123375
  row: alignmentData ? { start: 0, end: alignmentData.sequence.length - 1 } : row
123361
123376
  })
@@ -124880,7 +124895,7 @@ function showFileDialog({ multiple = false, onSelect }) {
124880
124895
  input.click();
124881
124896
  }
124882
124897
  __name(showFileDialog, "showFileDialog");
124883
- const version = "0.7.32";
124898
+ const version = "0.7.34";
124884
124899
  const packageJson = {
124885
124900
  version
124886
124901
  };
@@ -128593,7 +128608,8 @@ const _SequenceInputNoHotkeys = class _SequenceInputNoHotkeys extends React.Comp
128593
128608
  return;
128594
128609
  }
128595
128610
  const seqToInsert = isProtein2 ? {
128596
- proteinSequence: charsToInsert
128611
+ proteinSequence: charsToInsert,
128612
+ isProtein: true
128597
128613
  } : {
128598
128614
  sequence: charsToInsert
128599
128615
  };
@@ -128655,10 +128671,9 @@ const _SequenceInputNoHotkeys = class _SequenceInputNoHotkeys extends React.Comp
128655
128671
  });
128656
128672
  }, 200);
128657
128673
  }
128658
- if (maxInsertSize && sanitizedVal.lenth > maxInsertSize) {
128674
+ if (maxInsertSize && sanitizedVal.length > maxInsertSize) {
128659
128675
  return window.toastr.error(
128660
- "Sorry, your insert is greater than ",
128661
- maxInsertSize
128676
+ `Sorry, your insert is greater than ${maxInsertSize}`
128662
128677
  );
128663
128678
  }
128664
128679
  e.target.value = sanitizedVal;
@@ -129518,7 +129533,8 @@ function VectorInteractionHOC(Component) {
129518
129533
  readOnly: readOnly2,
129519
129534
  onPaste,
129520
129535
  disableBpEditing,
129521
- sequenceData: sequenceData2
129536
+ sequenceData: sequenceData2,
129537
+ maxInsertSize
129522
129538
  } = this.props;
129523
129539
  if (disableBpEditing) {
129524
129540
  return this.createDisableBpEditingMsg();
@@ -129545,6 +129561,11 @@ function VectorInteractionHOC(Component) {
129545
129561
  if (sequenceData2.isProtein && !seqDataToInsert.proteinSequence) {
129546
129562
  seqDataToInsert.proteinSequence = seqDataToInsert.sequence;
129547
129563
  }
129564
+ if (maxInsertSize && (seqDataToInsert.proteinSequence || seqDataToInsert.sequence).length > maxInsertSize) {
129565
+ return window.toastr.error(
129566
+ `Sorry, the pasted sequence exceeds the maximum allowed length of ${maxInsertSize}`
129567
+ );
129568
+ }
129548
129569
  seqDataToInsert = tidyUpSequenceData(seqDataToInsert, {
129549
129570
  topLevelSeqData: sequenceData2,
129550
129571
  provideNewIdsForAnnotations: true,
@@ -129659,7 +129680,8 @@ function VectorInteractionHOC(Component) {
129659
129680
  selectionLayer: selectionLayer2 = { start: -1, end: -1 },
129660
129681
  sequenceData: sequenceData2 = { sequence: "" },
129661
129682
  readOnly: readOnly2,
129662
- disableBpEditing
129683
+ disableBpEditing,
129684
+ maxInsertSize
129663
129685
  // updateSequenceData,
129664
129686
  // wrappedInsertSequenceDataAtPositionOrRange
129665
129687
  // handleInsert
@@ -129680,6 +129702,7 @@ function VectorInteractionHOC(Component) {
129680
129702
  selectionLayer: selectionLayer2,
129681
129703
  sequenceLength,
129682
129704
  caretPosition: caretPosition2,
129705
+ maxInsertSize,
129683
129706
  handleInsert: /* @__PURE__ */ __name((seqDataToInsert) => __async(this, null, function* () {
129684
129707
  yield insertAndSelectHelper({
129685
129708
  props: this.props,
@@ -133585,6 +133608,7 @@ function SelectionLayer({
133585
133608
  onClick: onClick ? noop$4 : preventDefaultStopPropagation,
133586
133609
  selectionMessage,
133587
133610
  caretPosition: start2,
133611
+ isProtein: isProtein2,
133588
133612
  sequenceLength,
133589
133613
  innerRadius,
133590
133614
  outerRadius: radius
@@ -133599,6 +133623,7 @@ function SelectionLayer({
133599
133623
  onClick: onClick ? noop$4 : preventDefaultStopPropagation,
133600
133624
  selectionMessage,
133601
133625
  caretPosition: end2 + 1,
133626
+ isProtein: isProtein2,
133602
133627
  sequenceLength,
133603
133628
  innerRadius,
133604
133629
  outerRadius: radius
@@ -150300,11 +150325,23 @@ const inlineFindTool = connectToEditor(({ findTool: findTool2 = {} }) => {
150300
150325
  return {
150301
150326
  isOpen: findTool2.isOpen
150302
150327
  };
150303
- })(({ toolbarItemProps, editorName, toggleFindTool: toggleFindTool2, isOpen }) => {
150328
+ })(({
150329
+ toolbarItemProps,
150330
+ editorName,
150331
+ toggleFindTool: toggleFindTool2,
150332
+ isOpen,
150333
+ additionalEnzymes
150334
+ }) => {
150304
150335
  return /* @__PURE__ */ React.createElement(
150305
150336
  ToolbarItem$1,
150306
150337
  __spreadValues({}, __spreadValues({
150307
- Icon: !isOpen ? /* @__PURE__ */ React.createElement("div", null, /* @__PURE__ */ React.createElement(core.Icon, { "data-test": "ve-find-tool-toggle", icon: "search" }), /* @__PURE__ */ React.createElement(core.Icon, { icon: "caret-right" })) : /* @__PURE__ */ React.createElement(FindBar$1, { editorName }),
150338
+ Icon: !isOpen ? /* @__PURE__ */ React.createElement("div", null, /* @__PURE__ */ React.createElement(core.Icon, { "data-test": "ve-find-tool-toggle", icon: "search" }), /* @__PURE__ */ React.createElement(core.Icon, { icon: "caret-right" })) : /* @__PURE__ */ React.createElement(
150339
+ FindBar$1,
150340
+ {
150341
+ editorName,
150342
+ additionalEnzymes
150343
+ }
150344
+ ),
150308
150345
  renderIconAbove: isOpen,
150309
150346
  onIconClick: toggleFindTool2,
150310
150347
  tooltip: isOpen ? /* @__PURE__ */ React.createElement("span", null, "Hide Find Tool ", /* @__PURE__ */ React.createElement("span", { style: { fontSize: 10 } }, "(Cmd/Ctrl+F)")) : /* @__PURE__ */ React.createElement("span", null, "Show Find Tool ", /* @__PURE__ */ React.createElement("span", { style: { fontSize: 10 } }, "(Cmd/Ctrl+F)"))
@@ -152946,6 +152983,7 @@ const _Editor = class _Editor extends React.Component {
152946
152983
  hideStatusBar,
152947
152984
  hoveredId,
152948
152985
  isFullscreen,
152986
+ maxInsertSize,
152949
152987
  maxAnnotationsToDisplay,
152950
152988
  minHeight = 400,
152951
152989
  onlyShowLabelsThatDoNotFit = true,
@@ -153133,6 +153171,7 @@ const _Editor = class _Editor extends React.Component {
153133
153171
  doubleClickOverrides: this.props.doubleClickOverrides
153134
153172
  }), panelPropsToSpread), {
153135
153173
  editorName,
153174
+ maxInsertSize,
153136
153175
  isProtein: sequenceData2.isProtein,
153137
153176
  onlyShowLabelsThatDoNotFit,
153138
153177
  tabHeight,
package/index.es.js CHANGED
@@ -36800,6 +36800,9 @@ const defaultValidators = {
36800
36800
  }, "dropdownMulti"),
36801
36801
  number: /* @__PURE__ */ __name((newVal2, field) => {
36802
36802
  if (isValueEmpty(newVal2) && !field.isRequired) return;
36803
+ if (field.allowNaN && Number.isNaN(newVal2)) {
36804
+ return;
36805
+ }
36803
36806
  if (isNaN(newVal2) || !isNumber$2(newVal2)) {
36804
36807
  return "Must be a number";
36805
36808
  }
@@ -82964,6 +82967,14 @@ const proteinAlphabet = {
82964
82967
  color: "hsl(264.7, 100%, 69%)",
82965
82968
  mass: 128.17228
82966
82969
  },
82970
+ O: {
82971
+ value: "O",
82972
+ name: "Pyrrolysine",
82973
+ threeLettersName: "Pyl",
82974
+ colorByFamily: "#FFC0CB",
82975
+ color: "hsl(264.7, 100%, 69%)",
82976
+ mass: 255.313
82977
+ },
82967
82978
  M: {
82968
82979
  value: "M",
82969
82980
  name: "Methionine",
@@ -83498,7 +83509,7 @@ function getAcceptedChars({
83498
83509
  isRna: isRna2,
83499
83510
  isMixedRnaAndDna
83500
83511
  } = {}) {
83501
- return isProtein2 ? `${extended_protein_letters.toLowerCase()}}` : isOligo2 ? ambiguous_rna_letters.toLowerCase() + "t" : isRna2 ? ambiguous_rna_letters.toLowerCase() + "t" : isMixedRnaAndDna ? ambiguous_rna_letters.toLowerCase() + ambiguous_dna_letters.toLowerCase() : (
83512
+ return isProtein2 ? `${extended_protein_letters.toLowerCase()}` : isOligo2 ? ambiguous_rna_letters.toLowerCase() + "t" : isRna2 ? ambiguous_rna_letters.toLowerCase() + "t" : isMixedRnaAndDna ? ambiguous_rna_letters.toLowerCase() + ambiguous_dna_letters.toLowerCase() : (
83502
83513
  //just plain old dna
83503
83514
  ambiguous_rna_letters.toLowerCase() + ambiguous_dna_letters.toLowerCase()
83504
83515
  );
@@ -84512,7 +84523,7 @@ function adjustAnnotationsToDelete(annotationsToBeAdjusted, range2, maxLength) {
84512
84523
  return __spreadValues(__spreadProps(__spreadValues({}, newRange), {
84513
84524
  start: newLocations[0].start,
84514
84525
  end: newLocations[newLocations.length - 1].end
84515
- }), newLocations.length > 1 && { locations: newLocations });
84526
+ }), newLocations.length > 0 && { locations: newLocations });
84516
84527
  } else {
84517
84528
  return newRange;
84518
84529
  }
@@ -117438,6 +117449,7 @@ function SelectionLayer$2(props) {
117438
117449
  __spreadValues({
117439
117450
  key: key + "caret1"
117440
117451
  }, {
117452
+ isProtein: isProtein2,
117441
117453
  leftMargin,
117442
117454
  onClick: _onClick || preventDefaultStopPropagation,
117443
117455
  onRightClick: onSelectionContextMenu,
@@ -117457,6 +117469,7 @@ function SelectionLayer$2(props) {
117457
117469
  __spreadValues({
117458
117470
  key: key + "caret2"
117459
117471
  }, {
117472
+ isProtein: isProtein2,
117460
117473
  leftMargin,
117461
117474
  onClick: _onClick || preventDefaultStopPropagation,
117462
117475
  onRightClick: onSelectionContextMenu,
@@ -122480,7 +122493,8 @@ function Chromatogram(props) {
122480
122493
  noQualityScores: !showChromQualScores
122481
122494
  }),
122482
122495
  style: {
122483
- position: "relative"
122496
+ position: "relative",
122497
+ textAlign: "left"
122484
122498
  },
122485
122499
  onContextMenu: /* @__PURE__ */ __name((e) => {
122486
122500
  showContextMenu([chromatogramMenu], void 0, e);
@@ -123337,7 +123351,8 @@ function RowItem(props) {
123337
123351
  ), caretPosition2 > -1 && /* @__PURE__ */ React__default.createElement(
123338
123352
  Caret$2,
123339
123353
  __spreadProps(__spreadValues({
123340
- caretPosition: caretPosition2
123354
+ caretPosition: caretPosition2,
123355
+ isProtein: isProtein2
123341
123356
  }, __spreadValues(__spreadValues({}, annotationCommonProps), { getGaps: void 0 })), {
123342
123357
  row: alignmentData ? { start: 0, end: alignmentData.sequence.length - 1 } : row
123343
123358
  })
@@ -124862,7 +124877,7 @@ function showFileDialog({ multiple = false, onSelect }) {
124862
124877
  input.click();
124863
124878
  }
124864
124879
  __name(showFileDialog, "showFileDialog");
124865
- const version = "0.7.32";
124880
+ const version = "0.7.34";
124866
124881
  const packageJson = {
124867
124882
  version
124868
124883
  };
@@ -128575,7 +128590,8 @@ const _SequenceInputNoHotkeys = class _SequenceInputNoHotkeys extends React__def
128575
128590
  return;
128576
128591
  }
128577
128592
  const seqToInsert = isProtein2 ? {
128578
- proteinSequence: charsToInsert
128593
+ proteinSequence: charsToInsert,
128594
+ isProtein: true
128579
128595
  } : {
128580
128596
  sequence: charsToInsert
128581
128597
  };
@@ -128637,10 +128653,9 @@ const _SequenceInputNoHotkeys = class _SequenceInputNoHotkeys extends React__def
128637
128653
  });
128638
128654
  }, 200);
128639
128655
  }
128640
- if (maxInsertSize && sanitizedVal.lenth > maxInsertSize) {
128656
+ if (maxInsertSize && sanitizedVal.length > maxInsertSize) {
128641
128657
  return window.toastr.error(
128642
- "Sorry, your insert is greater than ",
128643
- maxInsertSize
128658
+ `Sorry, your insert is greater than ${maxInsertSize}`
128644
128659
  );
128645
128660
  }
128646
128661
  e.target.value = sanitizedVal;
@@ -129500,7 +129515,8 @@ function VectorInteractionHOC(Component2) {
129500
129515
  readOnly: readOnly2,
129501
129516
  onPaste,
129502
129517
  disableBpEditing,
129503
- sequenceData: sequenceData2
129518
+ sequenceData: sequenceData2,
129519
+ maxInsertSize
129504
129520
  } = this.props;
129505
129521
  if (disableBpEditing) {
129506
129522
  return this.createDisableBpEditingMsg();
@@ -129527,6 +129543,11 @@ function VectorInteractionHOC(Component2) {
129527
129543
  if (sequenceData2.isProtein && !seqDataToInsert.proteinSequence) {
129528
129544
  seqDataToInsert.proteinSequence = seqDataToInsert.sequence;
129529
129545
  }
129546
+ if (maxInsertSize && (seqDataToInsert.proteinSequence || seqDataToInsert.sequence).length > maxInsertSize) {
129547
+ return window.toastr.error(
129548
+ `Sorry, the pasted sequence exceeds the maximum allowed length of ${maxInsertSize}`
129549
+ );
129550
+ }
129530
129551
  seqDataToInsert = tidyUpSequenceData(seqDataToInsert, {
129531
129552
  topLevelSeqData: sequenceData2,
129532
129553
  provideNewIdsForAnnotations: true,
@@ -129641,7 +129662,8 @@ function VectorInteractionHOC(Component2) {
129641
129662
  selectionLayer: selectionLayer2 = { start: -1, end: -1 },
129642
129663
  sequenceData: sequenceData2 = { sequence: "" },
129643
129664
  readOnly: readOnly2,
129644
- disableBpEditing
129665
+ disableBpEditing,
129666
+ maxInsertSize
129645
129667
  // updateSequenceData,
129646
129668
  // wrappedInsertSequenceDataAtPositionOrRange
129647
129669
  // handleInsert
@@ -129662,6 +129684,7 @@ function VectorInteractionHOC(Component2) {
129662
129684
  selectionLayer: selectionLayer2,
129663
129685
  sequenceLength,
129664
129686
  caretPosition: caretPosition2,
129687
+ maxInsertSize,
129665
129688
  handleInsert: /* @__PURE__ */ __name((seqDataToInsert) => __async(this, null, function* () {
129666
129689
  yield insertAndSelectHelper({
129667
129690
  props: this.props,
@@ -133567,6 +133590,7 @@ function SelectionLayer({
133567
133590
  onClick: onClick ? noop$4 : preventDefaultStopPropagation,
133568
133591
  selectionMessage,
133569
133592
  caretPosition: start2,
133593
+ isProtein: isProtein2,
133570
133594
  sequenceLength,
133571
133595
  innerRadius,
133572
133596
  outerRadius: radius
@@ -133581,6 +133605,7 @@ function SelectionLayer({
133581
133605
  onClick: onClick ? noop$4 : preventDefaultStopPropagation,
133582
133606
  selectionMessage,
133583
133607
  caretPosition: end2 + 1,
133608
+ isProtein: isProtein2,
133584
133609
  sequenceLength,
133585
133610
  innerRadius,
133586
133611
  outerRadius: radius
@@ -150282,11 +150307,23 @@ const inlineFindTool = connectToEditor(({ findTool: findTool2 = {} }) => {
150282
150307
  return {
150283
150308
  isOpen: findTool2.isOpen
150284
150309
  };
150285
- })(({ toolbarItemProps, editorName, toggleFindTool: toggleFindTool2, isOpen }) => {
150310
+ })(({
150311
+ toolbarItemProps,
150312
+ editorName,
150313
+ toggleFindTool: toggleFindTool2,
150314
+ isOpen,
150315
+ additionalEnzymes
150316
+ }) => {
150286
150317
  return /* @__PURE__ */ React__default.createElement(
150287
150318
  ToolbarItem$1,
150288
150319
  __spreadValues({}, __spreadValues({
150289
- Icon: !isOpen ? /* @__PURE__ */ React__default.createElement("div", null, /* @__PURE__ */ React__default.createElement(Icon, { "data-test": "ve-find-tool-toggle", icon: "search" }), /* @__PURE__ */ React__default.createElement(Icon, { icon: "caret-right" })) : /* @__PURE__ */ React__default.createElement(FindBar$1, { editorName }),
150320
+ Icon: !isOpen ? /* @__PURE__ */ React__default.createElement("div", null, /* @__PURE__ */ React__default.createElement(Icon, { "data-test": "ve-find-tool-toggle", icon: "search" }), /* @__PURE__ */ React__default.createElement(Icon, { icon: "caret-right" })) : /* @__PURE__ */ React__default.createElement(
150321
+ FindBar$1,
150322
+ {
150323
+ editorName,
150324
+ additionalEnzymes
150325
+ }
150326
+ ),
150290
150327
  renderIconAbove: isOpen,
150291
150328
  onIconClick: toggleFindTool2,
150292
150329
  tooltip: isOpen ? /* @__PURE__ */ React__default.createElement("span", null, "Hide Find Tool ", /* @__PURE__ */ React__default.createElement("span", { style: { fontSize: 10 } }, "(Cmd/Ctrl+F)")) : /* @__PURE__ */ React__default.createElement("span", null, "Show Find Tool ", /* @__PURE__ */ React__default.createElement("span", { style: { fontSize: 10 } }, "(Cmd/Ctrl+F)"))
@@ -152928,6 +152965,7 @@ const _Editor = class _Editor extends React__default.Component {
152928
152965
  hideStatusBar,
152929
152966
  hoveredId,
152930
152967
  isFullscreen,
152968
+ maxInsertSize,
152931
152969
  maxAnnotationsToDisplay,
152932
152970
  minHeight = 400,
152933
152971
  onlyShowLabelsThatDoNotFit = true,
@@ -153115,6 +153153,7 @@ const _Editor = class _Editor extends React__default.Component {
153115
153153
  doubleClickOverrides: this.props.doubleClickOverrides
153116
153154
  }), panelPropsToSpread), {
153117
153155
  editorName,
153156
+ maxInsertSize,
153118
153157
  isProtein: sequenceData2.isProtein,
153119
153158
  onlyShowLabelsThatDoNotFit,
153120
153159
  tabHeight,
package/index.umd.js CHANGED
@@ -65806,6 +65806,9 @@ ${latestSubscriptionCallbackError.current.stack}
65806
65806
  }, "dropdownMulti"),
65807
65807
  number: /* @__PURE__ */ __name((newVal2, field) => {
65808
65808
  if (isValueEmpty(newVal2) && !field.isRequired) return;
65809
+ if (field.allowNaN && Number.isNaN(newVal2)) {
65810
+ return;
65811
+ }
65809
65812
  if (isNaN(newVal2) || !isNumber$2(newVal2)) {
65810
65813
  return "Must be a number";
65811
65814
  }
@@ -111885,6 +111888,14 @@ ${latestSubscriptionCallbackError.current.stack}
111885
111888
  color: "hsl(264.7, 100%, 69%)",
111886
111889
  mass: 128.17228
111887
111890
  },
111891
+ O: {
111892
+ value: "O",
111893
+ name: "Pyrrolysine",
111894
+ threeLettersName: "Pyl",
111895
+ colorByFamily: "#FFC0CB",
111896
+ color: "hsl(264.7, 100%, 69%)",
111897
+ mass: 255.313
111898
+ },
111888
111899
  M: {
111889
111900
  value: "M",
111890
111901
  name: "Methionine",
@@ -112419,7 +112430,7 @@ ${latestSubscriptionCallbackError.current.stack}
112419
112430
  isRna: isRna2,
112420
112431
  isMixedRnaAndDna
112421
112432
  } = {}) {
112422
- return isProtein2 ? `${extended_protein_letters.toLowerCase()}}` : isOligo2 ? ambiguous_rna_letters.toLowerCase() + "t" : isRna2 ? ambiguous_rna_letters.toLowerCase() + "t" : isMixedRnaAndDna ? ambiguous_rna_letters.toLowerCase() + ambiguous_dna_letters.toLowerCase() : (
112433
+ return isProtein2 ? `${extended_protein_letters.toLowerCase()}` : isOligo2 ? ambiguous_rna_letters.toLowerCase() + "t" : isRna2 ? ambiguous_rna_letters.toLowerCase() + "t" : isMixedRnaAndDna ? ambiguous_rna_letters.toLowerCase() + ambiguous_dna_letters.toLowerCase() : (
112423
112434
  //just plain old dna
112424
112435
  ambiguous_rna_letters.toLowerCase() + ambiguous_dna_letters.toLowerCase()
112425
112436
  );
@@ -113433,7 +113444,7 @@ ${latestSubscriptionCallbackError.current.stack}
113433
113444
  return __spreadValues(__spreadProps(__spreadValues({}, newRange), {
113434
113445
  start: newLocations[0].start,
113435
113446
  end: newLocations[newLocations.length - 1].end
113436
- }), newLocations.length > 1 && { locations: newLocations });
113447
+ }), newLocations.length > 0 && { locations: newLocations });
113437
113448
  } else {
113438
113449
  return newRange;
113439
113450
  }
@@ -145604,6 +145615,7 @@ ${seq.sequence}
145604
145615
  __spreadValues({
145605
145616
  key: key + "caret1"
145606
145617
  }, {
145618
+ isProtein: isProtein2,
145607
145619
  leftMargin,
145608
145620
  onClick: _onClick || preventDefaultStopPropagation,
145609
145621
  onRightClick: onSelectionContextMenu,
@@ -145623,6 +145635,7 @@ ${seq.sequence}
145623
145635
  __spreadValues({
145624
145636
  key: key + "caret2"
145625
145637
  }, {
145638
+ isProtein: isProtein2,
145626
145639
  leftMargin,
145627
145640
  onClick: _onClick || preventDefaultStopPropagation,
145628
145641
  onRightClick: onSelectionContextMenu,
@@ -150596,7 +150609,8 @@ Part of ${annotation.translationType} Translation from BPs ${annotation.start +
150596
150609
  noQualityScores: !showChromQualScores
150597
150610
  }),
150598
150611
  style: {
150599
- position: "relative"
150612
+ position: "relative",
150613
+ textAlign: "left"
150600
150614
  },
150601
150615
  onContextMenu: /* @__PURE__ */ __name((e2) => {
150602
150616
  showContextMenu([chromatogramMenu], void 0, e2);
@@ -151453,7 +151467,8 @@ Part of ${annotation.translationType} Translation from BPs ${annotation.start +
151453
151467
  ), caretPosition2 > -1 && /* @__PURE__ */ React.createElement(
151454
151468
  Caret$2,
151455
151469
  __spreadProps(__spreadValues({
151456
- caretPosition: caretPosition2
151470
+ caretPosition: caretPosition2,
151471
+ isProtein: isProtein2
151457
151472
  }, __spreadValues(__spreadValues({}, annotationCommonProps), { getGaps: void 0 })), {
151458
151473
  row: alignmentData ? { start: 0, end: alignmentData.sequence.length - 1 } : row
151459
151474
  })
@@ -152978,7 +152993,7 @@ Part of ${annotation.translationType} Translation from BPs ${annotation.start +
152978
152993
  input.click();
152979
152994
  }
152980
152995
  __name(showFileDialog, "showFileDialog");
152981
- const version = "0.7.32";
152996
+ const version = "0.7.34";
152982
152997
  const packageJson = {
152983
152998
  version
152984
152999
  };
@@ -155089,7 +155104,8 @@ Part of ${annotation.translationType} Translation from BPs ${annotation.start +
155089
155104
  return;
155090
155105
  }
155091
155106
  const seqToInsert = isProtein2 ? {
155092
- proteinSequence: charsToInsert
155107
+ proteinSequence: charsToInsert,
155108
+ isProtein: true
155093
155109
  } : {
155094
155110
  sequence: charsToInsert
155095
155111
  };
@@ -155151,10 +155167,9 @@ Part of ${annotation.translationType} Translation from BPs ${annotation.start +
155151
155167
  });
155152
155168
  }, 200);
155153
155169
  }
155154
- if (maxInsertSize && sanitizedVal.lenth > maxInsertSize) {
155170
+ if (maxInsertSize && sanitizedVal.length > maxInsertSize) {
155155
155171
  return window.toastr.error(
155156
- "Sorry, your insert is greater than ",
155157
- maxInsertSize
155172
+ `Sorry, your insert is greater than ${maxInsertSize}`
155158
155173
  );
155159
155174
  }
155160
155175
  e2.target.value = sanitizedVal;
@@ -156014,7 +156029,8 @@ Part of ${annotation.translationType} Translation from BPs ${annotation.start +
156014
156029
  readOnly: readOnly2,
156015
156030
  onPaste,
156016
156031
  disableBpEditing,
156017
- sequenceData: sequenceData2
156032
+ sequenceData: sequenceData2,
156033
+ maxInsertSize
156018
156034
  } = this.props;
156019
156035
  if (disableBpEditing) {
156020
156036
  return this.createDisableBpEditingMsg();
@@ -156041,6 +156057,11 @@ Part of ${annotation.translationType} Translation from BPs ${annotation.start +
156041
156057
  if (sequenceData2.isProtein && !seqDataToInsert.proteinSequence) {
156042
156058
  seqDataToInsert.proteinSequence = seqDataToInsert.sequence;
156043
156059
  }
156060
+ if (maxInsertSize && (seqDataToInsert.proteinSequence || seqDataToInsert.sequence).length > maxInsertSize) {
156061
+ return window.toastr.error(
156062
+ `Sorry, the pasted sequence exceeds the maximum allowed length of ${maxInsertSize}`
156063
+ );
156064
+ }
156044
156065
  seqDataToInsert = tidyUpSequenceData(seqDataToInsert, {
156045
156066
  topLevelSeqData: sequenceData2,
156046
156067
  provideNewIdsForAnnotations: true,
@@ -156155,7 +156176,8 @@ Part of ${annotation.translationType} Translation from BPs ${annotation.start +
156155
156176
  selectionLayer: selectionLayer2 = { start: -1, end: -1 },
156156
156177
  sequenceData: sequenceData2 = { sequence: "" },
156157
156178
  readOnly: readOnly2,
156158
- disableBpEditing
156179
+ disableBpEditing,
156180
+ maxInsertSize
156159
156181
  // updateSequenceData,
156160
156182
  // wrappedInsertSequenceDataAtPositionOrRange
156161
156183
  // handleInsert
@@ -156176,6 +156198,7 @@ Part of ${annotation.translationType} Translation from BPs ${annotation.start +
156176
156198
  selectionLayer: selectionLayer2,
156177
156199
  sequenceLength,
156178
156200
  caretPosition: caretPosition2,
156201
+ maxInsertSize,
156179
156202
  handleInsert: /* @__PURE__ */ __name((seqDataToInsert) => __async(this, null, function* () {
156180
156203
  yield insertAndSelectHelper({
156181
156204
  props: this.props,
@@ -160081,6 +160104,7 @@ Part of ${annotation.translationType} Translation from BPs ${annotation.start +
160081
160104
  onClick: onClick ? noop$4 : preventDefaultStopPropagation,
160082
160105
  selectionMessage,
160083
160106
  caretPosition: start2,
160107
+ isProtein: isProtein2,
160084
160108
  sequenceLength,
160085
160109
  innerRadius,
160086
160110
  outerRadius: radius
@@ -160095,6 +160119,7 @@ Part of ${annotation.translationType} Translation from BPs ${annotation.start +
160095
160119
  onClick: onClick ? noop$4 : preventDefaultStopPropagation,
160096
160120
  selectionMessage,
160097
160121
  caretPosition: end2 + 1,
160122
+ isProtein: isProtein2,
160098
160123
  sequenceLength,
160099
160124
  innerRadius,
160100
160125
  outerRadius: radius
@@ -176796,11 +176821,23 @@ ${seqDataToCopy}\r
176796
176821
  return {
176797
176822
  isOpen: findTool2.isOpen
176798
176823
  };
176799
- })(({ toolbarItemProps, editorName, toggleFindTool: toggleFindTool2, isOpen: isOpen2 }) => {
176824
+ })(({
176825
+ toolbarItemProps,
176826
+ editorName,
176827
+ toggleFindTool: toggleFindTool2,
176828
+ isOpen: isOpen2,
176829
+ additionalEnzymes
176830
+ }) => {
176800
176831
  return /* @__PURE__ */ React.createElement(
176801
176832
  ToolbarItem$1,
176802
176833
  __spreadValues({}, __spreadValues({
176803
- Icon: !isOpen2 ? /* @__PURE__ */ React.createElement("div", null, /* @__PURE__ */ React.createElement(Icon, { "data-test": "ve-find-tool-toggle", icon: "search" }), /* @__PURE__ */ React.createElement(Icon, { icon: "caret-right" })) : /* @__PURE__ */ React.createElement(FindBar$1, { editorName }),
176834
+ Icon: !isOpen2 ? /* @__PURE__ */ React.createElement("div", null, /* @__PURE__ */ React.createElement(Icon, { "data-test": "ve-find-tool-toggle", icon: "search" }), /* @__PURE__ */ React.createElement(Icon, { icon: "caret-right" })) : /* @__PURE__ */ React.createElement(
176835
+ FindBar$1,
176836
+ {
176837
+ editorName,
176838
+ additionalEnzymes
176839
+ }
176840
+ ),
176804
176841
  renderIconAbove: isOpen2,
176805
176842
  onIconClick: toggleFindTool2,
176806
176843
  tooltip: isOpen2 ? /* @__PURE__ */ React.createElement("span", null, "Hide Find Tool ", /* @__PURE__ */ React.createElement("span", { style: { fontSize: 10 } }, "(Cmd/Ctrl+F)")) : /* @__PURE__ */ React.createElement("span", null, "Show Find Tool ", /* @__PURE__ */ React.createElement("span", { style: { fontSize: 10 } }, "(Cmd/Ctrl+F)"))
@@ -179442,6 +179479,7 @@ ${seqDataToCopy}\r
179442
179479
  hideStatusBar,
179443
179480
  hoveredId,
179444
179481
  isFullscreen,
179482
+ maxInsertSize,
179445
179483
  maxAnnotationsToDisplay,
179446
179484
  minHeight = 400,
179447
179485
  onlyShowLabelsThatDoNotFit = true,
@@ -179629,6 +179667,7 @@ ${seqDataToCopy}\r
179629
179667
  doubleClickOverrides: this.props.doubleClickOverrides
179630
179668
  }), panelPropsToSpread), {
179631
179669
  editorName,
179670
+ maxInsertSize,
179632
179671
  isProtein: sequenceData2.isProtein,
179633
179672
  onlyShowLabelsThatDoNotFit,
179634
179673
  tabHeight,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@teselagen/ove",
3
- "version": "0.7.33",
3
+ "version": "0.7.35",
4
4
  "main": "./src/index.js",
5
5
  "type": "module",
6
6
  "exports": {
@@ -19,7 +19,7 @@
19
19
  "@teselagen/range-utils": "0.3.13",
20
20
  "@teselagen/react-list": "0.8.18",
21
21
  "@teselagen/sequence-utils": "0.3.32",
22
- "@teselagen/ui": "0.9.4",
22
+ "@teselagen/ui": "0.9.5",
23
23
  "@use-gesture/react": "10.3.0",
24
24
  "biomsa": "^0.2.4",
25
25
  "classnames": "^2.3.2",
@@ -103,6 +103,7 @@ function SelectionLayer({
103
103
  onClick={onClick ? noop : preventDefaultStopPropagation}
104
104
  selectionMessage={selectionMessage}
105
105
  caretPosition={start}
106
+ isProtein={isProtein}
106
107
  sequenceLength={sequenceLength}
107
108
  innerRadius={innerRadius}
108
109
  outerRadius={radius}
@@ -120,6 +121,7 @@ function SelectionLayer({
120
121
  onClick={onClick ? noop : preventDefaultStopPropagation}
121
122
  selectionMessage={selectionMessage}
122
123
  caretPosition={end + 1}
124
+ isProtein={isProtein}
123
125
  sequenceLength={sequenceLength}
124
126
  innerRadius={innerRadius}
125
127
  outerRadius={radius}
@@ -360,6 +360,7 @@ export class Editor extends React.Component {
360
360
  hideStatusBar,
361
361
  hoveredId,
362
362
  isFullscreen,
363
+ maxInsertSize,
363
364
  maxAnnotationsToDisplay,
364
365
  minHeight = 400,
365
366
  onlyShowLabelsThatDoNotFit = true,
@@ -592,6 +593,7 @@ export class Editor extends React.Component {
592
593
  doubleClickOverrides={this.props.doubleClickOverrides}
593
594
  {...panelPropsToSpread}
594
595
  editorName={editorName}
596
+ maxInsertSize={maxInsertSize}
595
597
  isProtein={sequenceData.isProtein}
596
598
  onlyShowLabelsThatDoNotFit={onlyShowLabelsThatDoNotFit}
597
599
  tabHeight={tabHeight}
@@ -63,7 +63,8 @@ export default function Chromatogram(props) {
63
63
  noQualityScores: !showChromQualScores
64
64
  })}
65
65
  style={{
66
- position: "relative"
66
+ position: "relative",
67
+ textAlign: "left"
67
68
  }}
68
69
  onContextMenu={e => {
69
70
  showContextMenu([chromatogramMenu], undefined, e);
@@ -107,6 +107,7 @@ function SelectionLayer(props) {
107
107
  <Caret
108
108
  key={key + "caret1"}
109
109
  {...{
110
+ isProtein,
110
111
  leftMargin,
111
112
  onClick: _onClick || preventDefaultStopPropagation,
112
113
  onRightClick: onSelectionContextMenu,
@@ -129,6 +130,7 @@ function SelectionLayer(props) {
129
130
  <Caret
130
131
  key={key + "caret2"}
131
132
  {...{
133
+ isProtein,
132
134
  leftMargin,
133
135
  onClick: _onClick || preventDefaultStopPropagation,
134
136
  onRightClick: onSelectionContextMenu,
@@ -618,6 +618,7 @@ export default function RowItem(props) {
618
618
  {caretPosition > -1 && (
619
619
  <Caret
620
620
  caretPosition={caretPosition}
621
+ isProtein={isProtein}
621
622
  {...{ ...annotationCommonProps, ...{ getGaps: undefined } }}
622
623
  row={
623
624
  alignmentData
@@ -8,7 +8,13 @@ export default connectToEditor(({ findTool = {} }) => {
8
8
  return {
9
9
  isOpen: findTool.isOpen
10
10
  };
11
- })(({ toolbarItemProps, editorName, toggleFindTool, isOpen }) => {
11
+ })(({
12
+ toolbarItemProps,
13
+ editorName,
14
+ toggleFindTool,
15
+ isOpen,
16
+ additionalEnzymes
17
+ }) => {
12
18
  return (
13
19
  <ToolbarItem
14
20
  {...{
@@ -18,7 +24,10 @@ export default connectToEditor(({ findTool = {} }) => {
18
24
  <Icon icon="caret-right" />
19
25
  </div>
20
26
  ) : (
21
- <FindBar editorName={editorName} />
27
+ <FindBar
28
+ editorName={editorName}
29
+ additionalEnzymes={additionalEnzymes}
30
+ />
22
31
  ),
23
32
  renderIconAbove: isOpen,
24
33
  onIconClick: toggleFindTool,
@@ -65,7 +65,8 @@ class SequenceInputNoHotkeys extends React.Component {
65
65
  }
66
66
  const seqToInsert = isProtein
67
67
  ? {
68
- proteinSequence: charsToInsert
68
+ proteinSequence: charsToInsert,
69
+ isProtein: true
69
70
  }
70
71
  : {
71
72
  sequence: charsToInsert
@@ -153,10 +154,9 @@ class SequenceInputNoHotkeys extends React.Component {
153
154
  });
154
155
  }, 200);
155
156
  }
156
- if (maxInsertSize && sanitizedVal.lenth > maxInsertSize) {
157
+ if (maxInsertSize && sanitizedVal.length > maxInsertSize) {
157
158
  return window.toastr.error(
158
- "Sorry, your insert is greater than ",
159
- maxInsertSize
159
+ `Sorry, your insert is greater than ${maxInsertSize}`,
160
160
  );
161
161
  }
162
162
  e.target.value = sanitizedVal;
@@ -211,7 +211,8 @@ function VectorInteractionHOC(Component /* options */) {
211
211
  readOnly,
212
212
  onPaste,
213
213
  disableBpEditing,
214
- sequenceData
214
+ sequenceData,
215
+ maxInsertSize
215
216
  } = this.props;
216
217
 
217
218
  if (disableBpEditing) {
@@ -241,6 +242,12 @@ function VectorInteractionHOC(Component /* options */) {
241
242
  seqDataToInsert.proteinSequence = seqDataToInsert.sequence;
242
243
  }
243
244
 
245
+ if (maxInsertSize && (seqDataToInsert.proteinSequence || seqDataToInsert.sequence).length > maxInsertSize) {
246
+ return window.toastr.error(
247
+ `Sorry, the pasted sequence exceeds the maximum allowed length of ${maxInsertSize}`
248
+ );
249
+ }
250
+
244
251
  seqDataToInsert = tidyUpSequenceData(seqDataToInsert, {
245
252
  topLevelSeqData: sequenceData,
246
253
  provideNewIdsForAnnotations: true,
@@ -387,7 +394,8 @@ function VectorInteractionHOC(Component /* options */) {
387
394
  selectionLayer = { start: -1, end: -1 },
388
395
  sequenceData = { sequence: "" },
389
396
  readOnly,
390
- disableBpEditing
397
+ disableBpEditing,
398
+ maxInsertSize,
391
399
  // updateSequenceData,
392
400
  // wrappedInsertSequenceDataAtPositionOrRange
393
401
  // handleInsert
@@ -408,6 +416,7 @@ function VectorInteractionHOC(Component /* options */) {
408
416
  selectionLayer,
409
417
  sequenceLength,
410
418
  caretPosition,
419
+ maxInsertSize,
411
420
  handleInsert: async seqDataToInsert => {
412
421
  await insertAndSelectHelper({
413
422
  props: this.props,