@teselagen/ove 0.3.10 → 0.3.12

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 (148) hide show
  1. package/index.js +453 -319
  2. package/index.mjs +453 -319
  3. package/index.umd.js +397 -287
  4. package/package.json +2 -2
  5. package/src/AlignmentView/AlignmentVisibilityTool.js +1 -1
  6. package/src/AlignmentView/EditTrackNameDialog.js +1 -5
  7. package/src/AlignmentView/HorizontalPanelDragHandle.js +2 -2
  8. package/src/AlignmentView/Minimap.js +12 -12
  9. package/src/AlignmentView/PairwiseAlignmentView.js +1 -1
  10. package/src/AlignmentView/getGapMap.js +1 -1
  11. package/src/AlignmentView/getTrackFromEvent.js +1 -1
  12. package/src/AlignmentView/index.js +32 -37
  13. package/src/AutoAnnotate.js +48 -48
  14. package/src/CircularView/Cutsites.js +3 -3
  15. package/src/CircularView/Labels/index.js +7 -7
  16. package/src/CircularView/Labels/relaxLabels_DEPRECATED.js +5 -5
  17. package/src/CircularView/RotateCircularViewSlider.js +1 -1
  18. package/src/CircularView/SelectionLayer.js +2 -2
  19. package/src/CircularView/drawAnnotations.js +3 -3
  20. package/src/CircularView/getAngleForPositionMidpoint.js +1 -1
  21. package/src/CircularView/index.d.ts +11 -11
  22. package/src/CircularView/index.js +9 -9
  23. package/src/CreateAnnotationsPage.js +7 -5
  24. package/src/CreateCustomEnzyme/index.js +1 -5
  25. package/src/CutsiteFilter/AdditionalCutsiteInfoDialog.js +11 -11
  26. package/src/CutsiteFilter/index.js +12 -12
  27. package/src/DigestTool/AddLaddersDialog.js +1 -1
  28. package/src/DigestTool/DigestTool.js +3 -3
  29. package/src/DigestTool/Ladder.js +8 -8
  30. package/src/DigestTool/ladderDefaults.js +1 -2
  31. package/src/Editor/CommandHotkeyHandler.js +1 -1
  32. package/src/Editor/DropHandler.js +2 -2
  33. package/src/Editor/index.js +14 -14
  34. package/src/Editor/userDefinedHandlersAndOpts.js +2 -0
  35. package/src/FindBar/index.js +6 -6
  36. package/src/GlobalDialogUtils.js +6 -0
  37. package/src/LinearView/ZoomLinearView.js +1 -1
  38. package/src/LinearView/index.js +7 -7
  39. package/src/MenuBar/index.js +1 -1
  40. package/src/MenuBar/viewSubmenu.js +1 -1
  41. package/src/PCRTool/PCRTool.js +19 -19
  42. package/src/Reflex/Browser.js +4 -5
  43. package/src/Reflex/ReflexContainer.js +3 -3
  44. package/src/Reflex/ReflexElement.js +2 -2
  45. package/src/RowItem/Axis.js +1 -1
  46. package/src/RowItem/Caret/index.js +1 -1
  47. package/src/RowItem/Chromatograms/Chromatogram.js +3 -3
  48. package/src/RowItem/CutsiteSelectionLayers.js +1 -1
  49. package/src/RowItem/Cutsites.js +1 -1
  50. package/src/RowItem/Labels.js +2 -2
  51. package/src/RowItem/Orfs.js +2 -2
  52. package/src/RowItem/Sequence.js +4 -4
  53. package/src/RowItem/StackedAnnotations/PointedAnnotation.js +3 -3
  54. package/src/RowItem/StackedAnnotations/getStructuredBases.js +1 -1
  55. package/src/RowItem/Translations/AASliver.js +71 -75
  56. package/src/RowItem/Translations/index.js +1 -1
  57. package/src/RowItem/getCutsiteLabelHeights.js +1 -1
  58. package/src/RowItem/index.js +14 -8
  59. package/src/RowView/estimateRowHeight.js +5 -5
  60. package/src/RowView/index.d.ts +7 -7
  61. package/src/RowView/index.js +11 -12
  62. package/src/SimpleCircularOrLinearView.js +6 -6
  63. package/src/StatusBar/MeltingTemp.js +3 -3
  64. package/src/ToolBar/ToolbarItem.js +2 -2
  65. package/src/ToolBar/alignmentTool.js +9 -9
  66. package/src/ToolBar/editTool.js +1 -1
  67. package/src/ToolBar/findTool.js +2 -2
  68. package/src/ToolBar/importTool.js +1 -1
  69. package/src/ToolBar/index.js +2 -2
  70. package/src/ToolBar/oligoTool.js +1 -1
  71. package/src/ToolBar/orfTool.js +1 -6
  72. package/src/ToolBar/printTool.js +2 -2
  73. package/src/ToolBar/visibilityTool.js +1 -1
  74. package/src/VersionHistoryView/index.js +2 -2
  75. package/src/commands/index.js +236 -230
  76. package/src/createVectorEditor/index.js +4 -4
  77. package/src/fileUtils.js +18 -18
  78. package/src/helperComponents/AddOrEditAnnotationDialog/index.js +22 -15
  79. package/src/helperComponents/AddOrEditFeatureDialog/index.js +2 -2
  80. package/src/helperComponents/AddOrEditPartDialog/index.js +2 -2
  81. package/src/helperComponents/AddOrEditPrimerDialog/index.js +5 -5
  82. package/src/helperComponents/EnzymesDialog/index.js +17 -22
  83. package/src/helperComponents/GoToDialog.js +5 -1
  84. package/src/helperComponents/MergeFeaturesDialog/index.js +3 -3
  85. package/src/helperComponents/PinchHelper/PinchHelper.js +1 -1
  86. package/src/helperComponents/PrintDialog/index.js +4 -4
  87. package/src/helperComponents/PropertiesDialog/CutsiteProperties.js +3 -3
  88. package/src/helperComponents/PropertiesDialog/GenbankView.js +1 -1
  89. package/src/helperComponents/PropertiesDialog/GeneralProperties.js +5 -5
  90. package/src/helperComponents/PropertiesDialog/GenericAnnotationProperties.js +136 -138
  91. package/src/helperComponents/PropertiesDialog/OrfProperties.js +3 -3
  92. package/src/helperComponents/PropertiesDialog/PrimerProperties.js +1 -1
  93. package/src/helperComponents/PropertiesDialog/TranslationProperties.js +2 -2
  94. package/src/helperComponents/PropertiesDialog/index.js +3 -3
  95. package/src/helperComponents/RemoveDuplicates/index.js +3 -3
  96. package/src/helperComponents/SelectDialog.js +3 -3
  97. package/src/helperComponents/UncontrolledSliderWithPlusMinusBtns.js +5 -5
  98. package/src/helperComponents/createSimpleDialog.js +1 -1
  99. package/src/helperComponents/partTagSearch.js +2 -5
  100. package/src/helperComponents/withHover.js +3 -3
  101. package/src/redux/alignments.js +6 -6
  102. package/src/redux/annotationVisibility.js +4 -4
  103. package/src/redux/featureLengthsToHide.js +1 -1
  104. package/src/redux/frameTranslations.js +3 -3
  105. package/src/redux/middleware.js +2 -2
  106. package/src/redux/panelsShown.js +19 -19
  107. package/src/redux/partLengthsToHide.js +1 -1
  108. package/src/redux/primerLengthsToHide.js +1 -1
  109. package/src/redux/readOnly.js +1 -4
  110. package/src/redux/selectionLayer.js +1 -1
  111. package/src/redux/sequenceData/features.js +1 -1
  112. package/src/redux/sequenceData/upsertDeleteActionGenerator.js +1 -1
  113. package/src/redux/sequenceDataHistory.js +5 -5
  114. package/src/redux/toolBar.js +2 -4
  115. package/src/redux/utils/createMetaAction.js +2 -2
  116. package/src/redux/versionHistory.js +1 -2
  117. package/src/selectors/annotationSearchSelector.js +4 -4
  118. package/src/selectors/circularSelector.js +1 -1
  119. package/src/selectors/cutsiteLabelColorSelector.js +1 -1
  120. package/src/selectors/filteredCutsitesSelector.js +6 -6
  121. package/src/selectors/filteredFeaturesSelector.js +4 -4
  122. package/src/selectors/filteredPartsSelector.js +5 -5
  123. package/src/selectors/filteredPrimersSelector.js +3 -3
  124. package/src/selectors/isEnzymeFilterAndSelector.js +1 -1
  125. package/src/selectors/orfsSelector.js +1 -1
  126. package/src/selectors/restrictionEnzymesSelector.js +2 -2
  127. package/src/selectors/searchLayersSelector.js +7 -7
  128. package/src/selectors/sequenceLengthSelector.js +1 -1
  129. package/src/selectors/sequenceSelector.js +1 -1
  130. package/src/selectors/tagsToBoldSelector.js +1 -1
  131. package/src/selectors/translationsSelector.js +7 -7
  132. package/src/updateEditor.js +1 -1
  133. package/src/utils/PassThrough.js +1 -1
  134. package/src/utils/addWrappedAddons.js +1 -1
  135. package/src/utils/annotationTypes.js +2 -2
  136. package/src/utils/combineReducersDontIgnoreKeys.js +1 -1
  137. package/src/utils/editorUtils.js +2 -2
  138. package/src/utils/massageTickSpacing.js +1 -1
  139. package/src/utils/onlyUpdateForKeysDeep.js +1 -1
  140. package/src/utils/pureNoFunc.js +1 -1
  141. package/src/utils/shouldRerender.js +1 -1
  142. package/src/utils/showFileDialog.js +6 -7
  143. package/src/utils/updateLabelsForInViewFeatures.js +1 -1
  144. package/src/utils/useAnnotationLimits.js +1 -1
  145. package/src/withEditorInteractions/Keyboard.js +2 -3
  146. package/src/withEditorInteractions/createSequenceInputPopup.js +4 -4
  147. package/src/withEditorInteractions/index.js +93 -55
  148. package/src/withEditorProps/index.js +40 -37
@@ -41,7 +41,7 @@ export const AdditionalCutsiteInfoDialog = compose(
41
41
  withRestrictionEnzymes,
42
42
  wrapDialog({
43
43
  isDraggable: true,
44
- getDialogProps: (props) => {
44
+ getDialogProps: props => {
45
45
  if (isGroup(props)) {
46
46
  return {
47
47
  title: (
@@ -224,7 +224,7 @@ export const AdditionalCutsiteInfoDialog = compose(
224
224
 
225
225
  forEach(userEnzymeGroups, (nameArray, name) => {
226
226
  let isInGroup;
227
- forEach(nameArray, (n) => {
227
+ forEach(nameArray, n => {
228
228
  if (n.toLowerCase() === enzymeName.toLowerCase()) {
229
229
  isInGroup = true;
230
230
  }
@@ -289,7 +289,7 @@ export const CompareEnzymeGroupsDialog = compose(
289
289
  ...props,
290
290
  cutsiteOrGroupKey: group2
291
291
  });
292
- const byNameLower = (n) => n.name.toLowerCase();
292
+ const byNameLower = n => n.name.toLowerCase();
293
293
  const shared = intersectionBy(
294
294
  g1.allEnzymesInGroup,
295
295
  g2.allEnzymesInGroup,
@@ -380,19 +380,19 @@ const getGroupElAndCutsites = ({
380
380
 
381
381
  const enzymesThatDontCutInSeq = [];
382
382
  let enzymesThatCutInSeq = [];
383
- forEach(filteredRestrictionEnzymes, (g) => {
383
+ forEach(filteredRestrictionEnzymes, g => {
384
384
  if (g.value === cutsiteOrGroupKey) {
385
385
  isGroupActive = true;
386
386
  }
387
387
  });
388
388
 
389
389
  if (cutsiteOrGroupKey === "type2s") {
390
- const nameArray = flatMap(defaultEnzymesByName, (e) =>
390
+ const nameArray = flatMap(defaultEnzymesByName, e =>
391
391
  e.isType2S ? e.name : []
392
392
  );
393
393
  label = "Type IIS Enzymes";
394
394
 
395
- sortBy(nameArray).forEach((name) => {
395
+ sortBy(nameArray).forEach(name => {
396
396
  const cutsites = allCutsites.cutsitesByName[name.toLowerCase()];
397
397
  if (!cutsites) {
398
398
  enzymesThatDontCutInSeq.push({ name, sites: [] });
@@ -405,7 +405,7 @@ const getGroupElAndCutsites = ({
405
405
  const nameArray = userEnzymeGroups[name];
406
406
  label = getUserGroupLabel({ name, nameArray });
407
407
 
408
- sortBy(nameArray).forEach((name) => {
408
+ sortBy(nameArray).forEach(name => {
409
409
  const cutsites = allCutsites.cutsitesByName[name.toLowerCase()];
410
410
  if (!cutsites) {
411
411
  enzymesThatDontCutInSeq.push({ name, sites: [] });
@@ -418,11 +418,11 @@ const getGroupElAndCutsites = ({
418
418
  const specialCutsiteFilterOption =
419
419
  specialCutsiteFilterOptions[cutsiteOrGroupKey];
420
420
  label = specialCutsiteFilterOption.label;
421
- enzymesThatCutInSeq = map(allCutsites.cutsitesByName, (cutsites) =>
421
+ enzymesThatCutInSeq = map(allCutsites.cutsitesByName, cutsites =>
422
422
  cutsites.length === specialCutsiteFilterOption.cutsThisManyTimes
423
423
  ? { name: cutsites[0].name, sites: cutsites }
424
424
  : null
425
- ).filter((n) => n !== null);
425
+ ).filter(n => n !== null);
426
426
  }
427
427
  const title = (
428
428
  <div style={{ display: "flex" }}>
@@ -466,7 +466,7 @@ export const CutsiteTag = ({
466
466
  let numCuts = (cutsitesByName[name.toLowerCase()] || []).length;
467
467
 
468
468
  const aliases = getEnzymeAliases(name);
469
- aliases.forEach((alias) => {
469
+ aliases.forEach(alias => {
470
470
  if (numCuts === 0) {
471
471
  numCuts = (cutsitesByName[alias.toLowerCase()] || []).length;
472
472
  }
@@ -552,7 +552,7 @@ export const addCutsiteGroupClickHandler = ({
552
552
  onClick={
553
553
  noClick
554
554
  ? undefined
555
- : (e) => {
555
+ : e => {
556
556
  const isInMultiSelect = e.target.closest(
557
557
  ".bp3-multi-select-popover"
558
558
  );
@@ -24,7 +24,7 @@ import {
24
24
  defaultEnzymesByName
25
25
  } from "@teselagen/sequence-utils";
26
26
 
27
- const NoResults = withRestrictionEnzymes((props) => {
27
+ const NoResults = withRestrictionEnzymes(props => {
28
28
  const {
29
29
  inputSequenceToTestAgainst,
30
30
  cutsitesByName,
@@ -167,11 +167,11 @@ export function CutsiteFilter(props) {
167
167
  {label}{" "}
168
168
  {canBeHidden && (
169
169
  <Icon
170
- onClick={(e) => {
170
+ onClick={e => {
171
171
  e.stopPropagation();
172
172
 
173
173
  filteredRestrictionEnzymesUpdate(
174
- flatMap(filteredRestrictionEnzymes, (e) => {
174
+ flatMap(filteredRestrictionEnzymes, e => {
175
175
  if (e.value === value) return [];
176
176
  return e;
177
177
  }).concat({
@@ -194,14 +194,14 @@ export function CutsiteFilter(props) {
194
194
  </div>
195
195
  );
196
196
  };
197
- const filteredRestrictionEnzymesUpdate = (enzymes) => {
197
+ const filteredRestrictionEnzymesUpdate = enzymes => {
198
198
  _filteredRestrictionEnzymesUpdate(enzymes);
199
199
  if (sequenceData?.id) {
200
200
  try {
201
201
  window.localStorage.setItem(
202
202
  `tgInitialCutsiteFilter-${sequenceData.id}`,
203
203
  JSON.stringify(
204
- enzymes.map((e) => omit(e, "canBeHidden", "nameArray", "label"))
204
+ enzymes.map(e => omit(e, "canBeHidden", "nameArray", "label"))
205
205
  )
206
206
  );
207
207
  } catch (err) {
@@ -213,7 +213,7 @@ export function CutsiteFilter(props) {
213
213
  const userEnzymeGroups =
214
214
  enzymeGroupsOverride || window.getExistingEnzymeGroups();
215
215
  const options = [
216
- ...map(specialCutsiteFilterOptions, (opt) => opt),
216
+ ...map(specialCutsiteFilterOptions, opt => opt),
217
217
  ...map(userEnzymeGroups, (nameArray, name) => {
218
218
  return {
219
219
  label: getUserGroupLabel({ nameArray, name }),
@@ -236,9 +236,9 @@ export function CutsiteFilter(props) {
236
236
  value: key
237
237
  };
238
238
  })
239
- ].map((n) => addClickableLabel(n, { closeDropDown }));
239
+ ].map(n => addClickableLabel(n, { closeDropDown }));
240
240
 
241
- const value = filteredRestrictionEnzymes.map((filteredOpt) => {
241
+ const value = filteredRestrictionEnzymes.map(filteredOpt => {
242
242
  let toRet;
243
243
  if (filteredOpt.cutsThisManyTimes || filteredOpt.isSpecialGroup) {
244
244
  toRet = filteredOpt;
@@ -314,7 +314,7 @@ export function CutsiteFilter(props) {
314
314
  minimal
315
315
  interactive
316
316
  style={{ display: "flex", marginTop: 5 }}
317
- onClick={(e) => {
317
+ onClick={e => {
318
318
  e.stopPropagation();
319
319
  isEnzymeFilterAndUpdate(!isEnzymeFilterAnd);
320
320
  }}
@@ -359,7 +359,7 @@ export function CutsiteFilter(props) {
359
359
  }}
360
360
  ></NoResults>
361
361
  }
362
- onInputChange={(queryTracker) => {
362
+ onInputChange={queryTracker => {
363
363
  setQueryTracker(queryTracker);
364
364
  }}
365
365
  placeholder="Filter cut sites..."
@@ -368,10 +368,10 @@ export function CutsiteFilter(props) {
368
368
  filteredRestrictionEnzymesUpdate={filteredRestrictionEnzymesUpdate}
369
369
  optionRenderer={renderOptions}
370
370
  isSimpleSearch
371
- onChange={(filteredRestrictionEnzymes) => {
371
+ onChange={filteredRestrictionEnzymes => {
372
372
  onChangeHook && onChangeHook(filteredRestrictionEnzymes);
373
373
  filteredRestrictionEnzymesUpdate(
374
- map(filteredRestrictionEnzymes, (r) => {
374
+ map(filteredRestrictionEnzymes, r => {
375
375
  return omit(r, ["label"]);
376
376
  })
377
377
  );
@@ -42,7 +42,7 @@ export const AddLaddersDialog = compose(
42
42
  accept={[".json"]}
43
43
  readBeforeUpload
44
44
  style={{ maxWidth: 400 }}
45
- beforeUpload={async (files) => {
45
+ beforeUpload={async files => {
46
46
  try {
47
47
  const newLadder = JSON.parse(files[0].parsedString);
48
48
  if (!newLadder) {
@@ -109,7 +109,7 @@ export class DigestTool extends React.Component {
109
109
  )}
110
110
  <Tabs
111
111
  selectedTabId={selectedTab}
112
- onChange={(id) => {
112
+ onChange={id => {
113
113
  this.setState({ selectedTab: id });
114
114
  }}
115
115
  >
@@ -179,7 +179,7 @@ const schema = {
179
179
 
180
180
  export default compose(
181
181
  withEditorInteractions,
182
- withProps((props) => {
182
+ withProps(props => {
183
183
  const {
184
184
  sequenceData,
185
185
  sequenceLength,
@@ -205,7 +205,7 @@ export default compose(
205
205
  computePartialDigestDisabled,
206
206
  computeDigestDisabled,
207
207
  lanes: [
208
- fragments.map((f) => ({
208
+ fragments.map(f => ({
209
209
  ...f,
210
210
  onFragmentSelect: () => {
211
211
  selectionLayerUpdate({
@@ -37,7 +37,7 @@ export default function Ladder({
37
37
  >
38
38
  {l.label}{" "}
39
39
  <Button
40
- onClick={async (e) => {
40
+ onClick={async e => {
41
41
  e.preventDefault();
42
42
  e.stopPropagation();
43
43
  const confirm = await showConfirmationDialog({
@@ -52,7 +52,7 @@ export default function Ladder({
52
52
  }
53
53
  setSelectedLadder(ladders[0].value);
54
54
  setLadders(
55
- filter(additionalLadders, (lad) => lad.value !== l.value)
55
+ filter(additionalLadders, lad => lad.value !== l.value)
56
56
  );
57
57
  }}
58
58
  intent="danger"
@@ -67,7 +67,7 @@ export default function Ladder({
67
67
  const [highlightedFragment, setHighlightedFragment] = useState();
68
68
  const [selectedLadder, setSelectedLadder] = useState(ladders[0].value);
69
69
  let ladderInfo;
70
- laddersToUse.forEach((ladder) => {
70
+ laddersToUse.forEach(ladder => {
71
71
  if (ladder.value === selectedLadder)
72
72
  ladderInfo = {
73
73
  ...ladder,
@@ -88,7 +88,7 @@ export default function Ladder({
88
88
  <TgSelect
89
89
  className="tg-ladder-selector"
90
90
  value={selectedLadder}
91
- onChange={(val) => setSelectedLadder(val.value)}
91
+ onChange={val => setSelectedLadder(val.value)}
92
92
  options={laddersToUse}
93
93
  />
94
94
  <Button
@@ -127,8 +127,8 @@ export default function Ladder({
127
127
  try {
128
128
  html2canvas(
129
129
  document.querySelector(".ve-digest-container")
130
- ).then((canvas) => {
131
- canvas.toBlob((blob) =>
130
+ ).then(canvas => {
131
+ canvas.toBlob(blob =>
132
132
  navigator.clipboard.write([
133
133
  new window.ClipboardItem({ "image/png": blob })
134
134
  ])
@@ -210,7 +210,7 @@ export default function Ladder({
210
210
  <Lane
211
211
  key={index}
212
212
  {...{
213
- onMouseOver: (fragment) => setHighlightedFragment(fragment),
213
+ onMouseOver: fragment => setHighlightedFragment(fragment),
214
214
  onMouseOut: () => setHighlightedFragment(undefined),
215
215
  digestLaneRightClicked,
216
216
  laneNumber: index + 1,
@@ -263,7 +263,7 @@ function Lane({
263
263
  onClick={() => {
264
264
  fragment.onFragmentSelect();
265
265
  }}
266
- onContextMenu={(e) => {
266
+ onContextMenu={e => {
267
267
  fragment.onFragmentSelect();
268
268
  digestLaneRightClicked(e);
269
269
  }}
@@ -11,8 +11,7 @@ export const ladderDefaults = [
11
11
  value: "geneRuler100BP",
12
12
  label: "GeneRuler 100bp + DNA 100-3000 bp",
13
13
  markings: [
14
- 3000, 2000, 1500, 1200, 1000, 900, 800, 700, 600, 500, 400, 300, 200,
15
- 100
14
+ 3000, 2000, 1500, 1200, 1000, 900, 800, 700, 600, 500, 400, 300, 200, 100
16
15
  ]
17
16
  },
18
17
  {
@@ -14,7 +14,7 @@ class CommandHotkeyHandler extends React.Component {
14
14
  super(props);
15
15
  const commands = getCommands(this);
16
16
  // Don't bind clipboard shortcuts (use native ones directly)
17
- ["cut", "copy", "paste"].forEach((cmdId) => delete commands[cmdId]);
17
+ ["cut", "copy", "paste"].forEach(cmdId => delete commands[cmdId]);
18
18
  this.hotkeyDefs = getCommandHotkeys(commands);
19
19
  this.handlers = getCommandHotkeyHandlers(commands);
20
20
 
@@ -4,7 +4,7 @@ import classNames from "classnames";
4
4
  import "./DropHandler.css";
5
5
 
6
6
  export default class DropHandler extends React.Component {
7
- handleDrop = (files) => {
7
+ handleDrop = files => {
8
8
  if (!files || !files.length) {
9
9
  return window.toastr.warning("Unrecognized File Type");
10
10
  }
@@ -15,7 +15,7 @@ export default class DropHandler extends React.Component {
15
15
  return (
16
16
  <Dropzone
17
17
  disabled={disabled}
18
- onClick={(evt) => evt.preventDefault()}
18
+ onClick={evt => evt.preventDefault()}
19
19
  multiple={false}
20
20
  accept={[
21
21
  ".gb",
@@ -132,14 +132,14 @@ export class Editor extends React.Component {
132
132
  !this.hasShownInitialAnnotationToEditDialog &&
133
133
  !this.inPreviewMode
134
134
  ) {
135
- ["part", "feature", "primer"].forEach((type) => {
135
+ ["part", "feature", "primer"].forEach(type => {
136
136
  if (this.props.initialAnnotationToEdit.startsWith(type)) {
137
137
  const annid = this.props.initialAnnotationToEdit.replace(
138
138
  type + "-",
139
139
  ""
140
140
  );
141
141
  const anns = this.props.sequenceData[type + "s"];
142
- const annotation = find(anns, (a) => a.id === annid);
142
+ const annotation = find(anns, a => a.id === annid);
143
143
  if (annotation) {
144
144
  showAddOrEditAnnotationDialog({ type, annotation });
145
145
  this.hasShownInitialAnnotationToEditDialog = true;
@@ -166,7 +166,7 @@ export class Editor extends React.Component {
166
166
  componentDidMount() {
167
167
  if (isMobile()) {
168
168
  let firstActivePanelId;
169
- some(this.getPanelsToShow()[0], (panel) => {
169
+ some(this.getPanelsToShow()[0], panel => {
170
170
  if (panel.active) {
171
171
  firstActivePanelId = panel.id;
172
172
  return true;
@@ -221,7 +221,7 @@ export class Editor extends React.Component {
221
221
  this.setState({ tabDragging: true });
222
222
  };
223
223
 
224
- onTabDragEnd = (result) => {
224
+ onTabDragEnd = result => {
225
225
  this.setState({ tabDragging: false });
226
226
  const { panelsShownUpdate, panelsShown } = this.props;
227
227
  // dropped outside the list
@@ -245,7 +245,7 @@ export class Editor extends React.Component {
245
245
  ) {
246
246
  //we're adding to this group
247
247
  return insertItem(
248
- panelGroup.map((tabPanel) => ({ ...tabPanel, active: false })),
248
+ panelGroup.map(tabPanel => ({ ...tabPanel, active: false })),
249
249
  { ...panelToMove, active: true },
250
250
  result.destination.index
251
251
  );
@@ -288,7 +288,7 @@ export class Editor extends React.Component {
288
288
  return panelGroup;
289
289
  });
290
290
  }
291
- filter(newPanelsShown, (panelGroup) => {
291
+ filter(newPanelsShown, panelGroup => {
292
292
  return panelGroup.length;
293
293
  });
294
294
  panelsShownUpdate(newPanelsShown);
@@ -300,7 +300,7 @@ export class Editor extends React.Component {
300
300
  return map(panelsShown);
301
301
  };
302
302
 
303
- onPreviewModeButtonContextMenu = (event) => {
303
+ onPreviewModeButtonContextMenu = event => {
304
304
  const { previewModeButtonMenu } = this.props;
305
305
  event.preventDefault();
306
306
  if (previewModeButtonMenu) {
@@ -515,7 +515,7 @@ export class Editor extends React.Component {
515
515
 
516
516
  const panelsToShow = this.getPanelsToShow();
517
517
  this.hasFullscreenPanel = false;
518
- map(panelsToShow, (panelGroup) => {
518
+ map(panelsToShow, panelGroup => {
519
519
  panelGroup.forEach(({ fullScreen }) => {
520
520
  if (fullScreen) this.hasFullscreenPanel = true;
521
521
  });
@@ -530,7 +530,7 @@ export class Editor extends React.Component {
530
530
  let activePanelType;
531
531
  let isFullScreen;
532
532
  let panelPropsToSpread = {};
533
- panelGroup.forEach((panelProps) => {
533
+ panelGroup.forEach(panelProps => {
534
534
  const { type, id, active, fullScreen } = panelProps;
535
535
  if (fullScreen) isFullScreen = true;
536
536
  if (active) {
@@ -577,11 +577,11 @@ export class Editor extends React.Component {
577
577
  return acc;
578
578
  }, {}))}
579
579
  circ_rotationRadians={this.state.rotationRadians}
580
- circ_setRotationRadians={(val) => {
580
+ circ_setRotationRadians={val => {
581
581
  this.setState({ rotationRadians: val });
582
582
  }}
583
583
  circ_zoomLevel={this.state.zoomLevel}
584
- circ_setZoomLevel={(val) => {
584
+ circ_setZoomLevel={val => {
585
585
  this.setState({ zoomLevel: val });
586
586
  }}
587
587
  maxAnnotationsToDisplay={maxAnnotationsToDisplay}
@@ -681,7 +681,7 @@ export class Editor extends React.Component {
681
681
  index={index}
682
682
  draggableId={id}
683
683
  >
684
- {(provided) => (
684
+ {provided => (
685
685
  <div
686
686
  style={{
687
687
  wordWrap: "normal",
@@ -694,7 +694,7 @@ export class Editor extends React.Component {
694
694
  }}
695
695
  >
696
696
  <div
697
- onContextMenu={(e) => {
697
+ onContextMenu={e => {
698
698
  showTabRightClickContextMenu(e, id);
699
699
  }}
700
700
  ref={provided.innerRef}
@@ -743,7 +743,7 @@ export class Editor extends React.Component {
743
743
  <Button
744
744
  minimal
745
745
  icon="minimize"
746
- onClick={(e) => {
746
+ onClick={e => {
747
747
  e.stopPropagation();
748
748
  togglePanelFullScreen(activePanelId);
749
749
  }}
@@ -20,6 +20,8 @@ export const userDefinedHandlersAndOpts = [
20
20
  "hideSingleImport",
21
21
  "beforeAnnotationCreate",
22
22
  "disableSetReadOnly",
23
+ "allowAnnotationEditLocking",
24
+ "disableBpEditing",
23
25
  "showReadOnly",
24
26
  "showCircularity",
25
27
  "onHiddenEnzymeAdd",
@@ -88,7 +88,7 @@ export class FindBar extends React.Component {
88
88
  options={opts}
89
89
  name="dnaOrAA"
90
90
  value={dnaOrAA}
91
- onChange={(e) => {
91
+ onChange={e => {
92
92
  updateDnaOrAA(e.target.value);
93
93
  }}
94
94
  />,
@@ -100,7 +100,7 @@ export class FindBar extends React.Component {
100
100
  { label: "Ambiguous", value: "AMBIGUOUS" }
101
101
  ]}
102
102
  value={ambiguousOrLiteral}
103
- onChange={(e) => {
103
+ onChange={e => {
104
104
  updateAmbiguousOrLiteral(e.target.value);
105
105
  }}
106
106
  />
@@ -268,10 +268,10 @@ export class FindBar extends React.Component {
268
268
  ...(!isInline && { width: 350, minHeight: 70 })
269
269
  }}
270
270
  className="tg-find-tool-input"
271
- inputRef={(n) => {
271
+ inputRef={n => {
272
272
  if (n) this.inputEl = n;
273
273
  }}
274
- onKeyDown={(e) => {
274
+ onKeyDown={e => {
275
275
  e.persist();
276
276
  if (e.metaKey && e.keyCode === 70) {
277
277
  //cmd-f
@@ -291,7 +291,7 @@ export class FindBar extends React.Component {
291
291
  }
292
292
  }}
293
293
  rightElement={rightEl}
294
- onChange={(e) => {
294
+ onChange={e => {
295
295
  return updateSearchText(e.target.value.replace(/\s/g, ""));
296
296
  }}
297
297
  value={searchText}
@@ -302,7 +302,7 @@ export class FindBar extends React.Component {
302
302
  minimal
303
303
  isOpen={
304
304
  annotationSearchMatches &&
305
- annotationSearchMatches.filter((m) => m.length).length
305
+ annotationSearchMatches.filter(m => m.length).length
306
306
  }
307
307
  content={
308
308
  <AnnotationSearchMatchComp
@@ -63,6 +63,12 @@ export function showAddOrEditAnnotationDialog({
63
63
  overrideName: `AddOrEdit${nameUpper}DialogOverride`,
64
64
  dialogType,
65
65
  props: {
66
+ ...(annotation.isEditLocked && {
67
+ readOnly:
68
+ typeof annotation.isEditLocked === "string"
69
+ ? annotation.isEditLocked
70
+ : "This annotation is locked"
71
+ }),
66
72
  dialogProps: {
67
73
  title:
68
74
  annotation && annotation.id ? `Edit ${nameUpper}` : `New ${nameUpper}`
@@ -18,7 +18,7 @@ export function ZoomLinearView({
18
18
  onClick={() => {
19
19
  setTimeout(scrollToCaret, 0);
20
20
  }}
21
- onChange={(zoomLvl) => {
21
+ onChange={zoomLvl => {
22
22
  //zoomLvl is in the range of 0 to 10
23
23
  const scaleFactor = Math.pow(12 / minCharWidth, 1 / 10);
24
24
  const newCharWidth = minCharWidth * Math.pow(scaleFactor, zoomLvl);
@@ -218,14 +218,14 @@ class _LinearView extends React.Component {
218
218
  <Draggable
219
219
  enableUserSelectHack={false} //needed to prevent the input bubble from losing focus post user drag
220
220
  bounds={{ top: 0, left: 0, right: 0, bottom: 0 }}
221
- onDrag={(event) => {
221
+ onDrag={event => {
222
222
  this.getNearestCursorPositionToMouseEvent(
223
223
  rowData,
224
224
  event,
225
225
  this.props.editorDragged || editorDragged
226
226
  );
227
227
  }}
228
- onStart={(event) => {
228
+ onStart={event => {
229
229
  this.getNearestCursorPositionToMouseEvent(
230
230
  rowData,
231
231
  event,
@@ -235,7 +235,7 @@ class _LinearView extends React.Component {
235
235
  onStop={this.props.editorDragStopped || editorDragStopped}
236
236
  >
237
237
  <div
238
- ref={(ref) => (this.linearView = ref)}
238
+ ref={ref => (this.linearView = ref)}
239
239
  className={classNames("veLinearView", className, {
240
240
  isLinViewZoomed
241
241
  })}
@@ -245,14 +245,14 @@ class _LinearView extends React.Component {
245
245
  paddingLeft: marginWidth / 2,
246
246
  ...(paddingBottom && { paddingBottom })
247
247
  }}
248
- onContextMenu={(event) => {
248
+ onContextMenu={event => {
249
249
  this.getNearestCursorPositionToMouseEvent(
250
250
  rowData,
251
251
  event,
252
252
  backgroundRightClicked
253
253
  );
254
254
  }}
255
- onClick={(event) => {
255
+ onClick={event => {
256
256
  this.getNearestCursorPositionToMouseEvent(
257
257
  rowData,
258
258
  event,
@@ -267,7 +267,7 @@ class _LinearView extends React.Component {
267
267
  minCharWidth={minCharWidth}
268
268
  smallSlider={smallSlider}
269
269
  editorName={editorName}
270
- setCharWidth={(v) => {
270
+ setCharWidth={v => {
271
271
  this.setState({
272
272
  charWidthInLinearView: v === initialCharWidth ? undefined : v
273
273
  });
@@ -354,7 +354,7 @@ class _LinearView extends React.Component {
354
354
  }
355
355
  }
356
356
 
357
- const WithAnnotationLimitsHoc = (Component) => (props) => {
357
+ const WithAnnotationLimitsHoc = Component => props => {
358
358
  // eslint-disable-next-line react-hooks/rules-of-hooks
359
359
  const [limits = {}] = useAnnotationLimits();
360
360
  return <Component limits={limits} {...props}></Component>;
@@ -7,7 +7,7 @@ import menuDef from "./defaultConfig";
7
7
  import getCommands from "../commands";
8
8
  import { Icon, Spinner } from "@blueprintjs/core";
9
9
 
10
- const ident = (x) => x;
10
+ const ident = x => x;
11
11
 
12
12
  class OveMenuBar extends React.Component {
13
13
  constructor(props) {
@@ -64,7 +64,7 @@ export const featuresSubmenu = [
64
64
  shouldDismissPopover: false
65
65
  }
66
66
  ];
67
- export const partsSubmenu = (props) => {
67
+ export const partsSubmenu = props => {
68
68
  return [
69
69
  {
70
70
  cmd: "toggleParts",
@@ -23,7 +23,7 @@ function PCRTool(props) {
23
23
  primerClicked
24
24
  } = props;
25
25
  const origSeqLen = sequenceData.sequence.length;
26
- forEach(sequenceData.primers, (p) => (p.originalId = p.id));
26
+ forEach(sequenceData.primers, p => (p.originalId = p.id));
27
27
  const fPrimer = sequenceData.primers[forwardPrimer];
28
28
  const rPrimer = sequenceData.primers[reversePrimer];
29
29
  let seqBetween;
@@ -77,7 +77,7 @@ function PCRTool(props) {
77
77
  });
78
78
  seqBetween.name = `PCR Product from ${sequenceData.name} `;
79
79
  }
80
- const getPrimers = (opts) => {
80
+ const getPrimers = opts => {
81
81
  return flatMap(
82
82
  sequenceData.primers,
83
83
  ({ name, id, forward, start, end }) => {
@@ -139,23 +139,23 @@ function PCRTool(props) {
139
139
  <div style={{ fontWeight: "600", fontSize: 13 }}>Output Product:</div>
140
140
  {seqBetween ? (
141
141
  <SimpleCircularOrLinearView
142
- noWarnings
143
- withZoomLinearView
144
- withZoomCircularView
145
- withChoosePreviewType
146
- withDownload
147
- smallSlider
148
- withCaretEnabled
149
- width={width - 50}
150
- height={Math.max(height - 250, 400)}
151
- sequenceData={seqBetween}
152
- primerClicked={(args) => {
153
- primerClicked({
154
- ...args,
155
- annotation: sequenceData.primers[args.annotation.originalId]
156
- });
157
- }}
158
- ></SimpleCircularOrLinearView>
142
+ noWarnings
143
+ withZoomLinearView
144
+ withZoomCircularView
145
+ withChoosePreviewType
146
+ withDownload
147
+ smallSlider
148
+ withCaretEnabled
149
+ width={width - 50}
150
+ height={Math.max(height - 250, 400)}
151
+ sequenceData={seqBetween}
152
+ primerClicked={args => {
153
+ primerClicked({
154
+ ...args,
155
+ annotation: sequenceData.primers[args.annotation.originalId]
156
+ });
157
+ }}
158
+ ></SimpleCircularOrLinearView>
159
159
  ) : (
160
160
  <div style={{ marginTop: 5, fontStyle: "italic", color: "grey" }}>
161
161
  Please choose a forward and reverse primer to see the resulting PCR