@teselagen/ove 0.3.3 → 0.3.5

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.umd.js CHANGED
@@ -57088,17 +57088,17 @@
57088
57088
  throw TypeError("Can't convert object to primitive value");
57089
57089
  };
57090
57090
 
57091
- var anObject$5 = _anObject;
57091
+ var anObject$3 = _anObject;
57092
57092
  var IE8_DOM_DEFINE$1 = _ie8DomDefine;
57093
57093
  var toPrimitive$2 = _toPrimitive$1;
57094
- var dP$3 = Object.defineProperty;
57094
+ var dP$2 = Object.defineProperty;
57095
57095
 
57096
57096
  _objectDp.f = _descriptors ? Object.defineProperty : function defineProperty(O, P, Attributes) {
57097
- anObject$5(O);
57097
+ anObject$3(O);
57098
57098
  P = toPrimitive$2(P, true);
57099
- anObject$5(Attributes);
57099
+ anObject$3(Attributes);
57100
57100
  if (IE8_DOM_DEFINE$1) try {
57101
- return dP$3(O, P, Attributes);
57101
+ return dP$2(O, P, Attributes);
57102
57102
  } catch (e) { /* empty */ }
57103
57103
  if ('get' in Attributes || 'set' in Attributes) throw TypeError('Accessors not supported!');
57104
57104
  if ('value' in Attributes) O[P] = Attributes.value;
@@ -57114,10 +57114,10 @@
57114
57114
  };
57115
57115
  };
57116
57116
 
57117
- var dP$2 = _objectDp;
57117
+ var dP$1 = _objectDp;
57118
57118
  var createDesc$3 = _propertyDesc;
57119
57119
  var _hide = _descriptors ? function (object, key, value) {
57120
- return dP$2.f(object, key, createDesc$3(1, value));
57120
+ return dP$1.f(object, key, createDesc$3(1, value));
57121
57121
  } : function (object, key, value) {
57122
57122
  object[key] = value;
57123
57123
  return object;
@@ -57133,7 +57133,7 @@
57133
57133
  var ctx$1 = _ctx;
57134
57134
  var hide$2 = _hide;
57135
57135
  var has$d = _has;
57136
- var PROTOTYPE$2 = 'prototype';
57136
+ var PROTOTYPE$1 = 'prototype';
57137
57137
 
57138
57138
  var $export$8 = function (type, name, source) {
57139
57139
  var IS_FORCED = type & $export$8.F;
@@ -57143,8 +57143,8 @@
57143
57143
  var IS_BIND = type & $export$8.B;
57144
57144
  var IS_WRAP = type & $export$8.W;
57145
57145
  var exports = IS_GLOBAL ? core$3 : core$3[name] || (core$3[name] = {});
57146
- var expProto = exports[PROTOTYPE$2];
57147
- var target = IS_GLOBAL ? global$4 : IS_STATIC ? global$4[name] : (global$4[name] || {})[PROTOTYPE$2];
57146
+ var expProto = exports[PROTOTYPE$1];
57147
+ var target = IS_GLOBAL ? global$4 : IS_STATIC ? global$4[name] : (global$4[name] || {})[PROTOTYPE$1];
57148
57148
  var key, own, out;
57149
57149
  if (IS_GLOBAL) source = name;
57150
57150
  for (key in source) {
@@ -57168,7 +57168,7 @@
57168
57168
  } return new C(a, b, c);
57169
57169
  } return C.apply(this, arguments);
57170
57170
  };
57171
- F[PROTOTYPE$2] = C[PROTOTYPE$2];
57171
+ F[PROTOTYPE$1] = C[PROTOTYPE$1];
57172
57172
  return F;
57173
57173
  // make static versions for prototype methods
57174
57174
  })(out) : IS_PROTO && typeof out == 'function' ? ctx$1(Function.call, out) : out;
@@ -57305,14 +57305,14 @@
57305
57305
  var has$c = _has;
57306
57306
  var toIObject$4 = _toIobject;
57307
57307
  var arrayIndexOf = _arrayIncludes$1(false);
57308
- var IE_PROTO$2 = _sharedKey('IE_PROTO');
57308
+ var IE_PROTO$1 = _sharedKey('IE_PROTO');
57309
57309
 
57310
57310
  var _objectKeysInternal = function (object, names) {
57311
57311
  var O = toIObject$4(object);
57312
57312
  var i = 0;
57313
57313
  var result = [];
57314
57314
  var key;
57315
- for (key in O) if (key != IE_PROTO$2) has$c(O, key) && result.push(key);
57315
+ for (key in O) if (key != IE_PROTO$1) has$c(O, key) && result.push(key);
57316
57316
  // Don't enum bug & hidden keys
57317
57317
  while (names.length > i) if (has$c(O, key = names[i++])) {
57318
57318
  ~arrayIndexOf(result, key) || result.push(key);
@@ -57327,10 +57327,10 @@
57327
57327
 
57328
57328
  // 19.1.2.14 / 15.2.3.14 Object.keys(O)
57329
57329
  var $keys$3 = _objectKeysInternal;
57330
- var enumBugKeys$1 = _enumBugKeys;
57330
+ var enumBugKeys = _enumBugKeys;
57331
57331
 
57332
57332
  var _objectKeys = Object.keys || function keys(O) {
57333
- return $keys$3(O, enumBugKeys$1);
57333
+ return $keys$3(O, enumBugKeys);
57334
57334
  };
57335
57335
 
57336
57336
  var _objectGops = {};
@@ -57437,19 +57437,27 @@
57437
57437
 
57438
57438
  var _redefine = _hide;
57439
57439
 
57440
- var dP$1 = _objectDp;
57441
- var anObject$4 = _anObject;
57442
- var getKeys$1 = _objectKeys;
57440
+ var _objectDps;
57441
+ var hasRequired_objectDps;
57443
57442
 
57444
- var _objectDps = _descriptors ? Object.defineProperties : function defineProperties(O, Properties) {
57445
- anObject$4(O);
57446
- var keys = getKeys$1(Properties);
57447
- var length = keys.length;
57448
- var i = 0;
57449
- var P;
57450
- while (length > i) dP$1.f(O, P = keys[i++], Properties[P]);
57451
- return O;
57452
- };
57443
+ function require_objectDps () {
57444
+ if (hasRequired_objectDps) return _objectDps;
57445
+ hasRequired_objectDps = 1;
57446
+ var dP = _objectDp;
57447
+ var anObject = _anObject;
57448
+ var getKeys = _objectKeys;
57449
+
57450
+ _objectDps = _descriptors ? Object.defineProperties : function defineProperties(O, Properties) {
57451
+ anObject(O);
57452
+ var keys = getKeys(Properties);
57453
+ var length = keys.length;
57454
+ var i = 0;
57455
+ var P;
57456
+ while (length > i) dP.f(O, P = keys[i++], Properties[P]);
57457
+ return O;
57458
+ };
57459
+ return _objectDps;
57460
+ }
57453
57461
 
57454
57462
  var _html;
57455
57463
  var hasRequired_html;
@@ -57462,47 +57470,55 @@
57462
57470
  return _html;
57463
57471
  }
57464
57472
 
57465
- // 19.1.2.2 / 15.2.3.5 Object.create(O [, Properties])
57466
- var anObject$3 = _anObject;
57467
- var dPs = _objectDps;
57468
- var enumBugKeys = _enumBugKeys;
57469
- var IE_PROTO$1 = _sharedKey('IE_PROTO');
57470
- var Empty = function () { /* empty */ };
57471
- var PROTOTYPE$1 = 'prototype';
57473
+ var _objectCreate;
57474
+ var hasRequired_objectCreate;
57472
57475
 
57473
- // Create object with fake `null` prototype: use iframe Object with cleared prototype
57474
- var createDict = function () {
57475
- // Thrash, waste and sodomy: IE GC bug
57476
- var iframe = require_domCreate()('iframe');
57477
- var i = enumBugKeys.length;
57478
- var lt = '<';
57479
- var gt = '>';
57480
- var iframeDocument;
57481
- iframe.style.display = 'none';
57482
- require_html().appendChild(iframe);
57483
- iframe.src = 'javascript:'; // eslint-disable-line no-script-url
57484
- // createDict = iframe.contentWindow.Object;
57485
- // html.removeChild(iframe);
57486
- iframeDocument = iframe.contentWindow.document;
57487
- iframeDocument.open();
57488
- iframeDocument.write(lt + 'script' + gt + 'document.F=Object' + lt + '/script' + gt);
57489
- iframeDocument.close();
57490
- createDict = iframeDocument.F;
57491
- while (i--) delete createDict[PROTOTYPE$1][enumBugKeys[i]];
57492
- return createDict();
57493
- };
57494
-
57495
- var _objectCreate = Object.create || function create(O, Properties) {
57496
- var result;
57497
- if (O !== null) {
57498
- Empty[PROTOTYPE$1] = anObject$3(O);
57499
- result = new Empty();
57500
- Empty[PROTOTYPE$1] = null;
57501
- // add "__proto__" for Object.getPrototypeOf polyfill
57502
- result[IE_PROTO$1] = O;
57503
- } else result = createDict();
57504
- return Properties === undefined ? result : dPs(result, Properties);
57505
- };
57476
+ function require_objectCreate () {
57477
+ if (hasRequired_objectCreate) return _objectCreate;
57478
+ hasRequired_objectCreate = 1;
57479
+ // 19.1.2.2 / 15.2.3.5 Object.create(O [, Properties])
57480
+ var anObject = _anObject;
57481
+ var dPs = require_objectDps();
57482
+ var enumBugKeys = _enumBugKeys;
57483
+ var IE_PROTO = _sharedKey('IE_PROTO');
57484
+ var Empty = function () { /* empty */ };
57485
+ var PROTOTYPE = 'prototype';
57486
+
57487
+ // Create object with fake `null` prototype: use iframe Object with cleared prototype
57488
+ var createDict = function () {
57489
+ // Thrash, waste and sodomy: IE GC bug
57490
+ var iframe = require_domCreate()('iframe');
57491
+ var i = enumBugKeys.length;
57492
+ var lt = '<';
57493
+ var gt = '>';
57494
+ var iframeDocument;
57495
+ iframe.style.display = 'none';
57496
+ require_html().appendChild(iframe);
57497
+ iframe.src = 'javascript:'; // eslint-disable-line no-script-url
57498
+ // createDict = iframe.contentWindow.Object;
57499
+ // html.removeChild(iframe);
57500
+ iframeDocument = iframe.contentWindow.document;
57501
+ iframeDocument.open();
57502
+ iframeDocument.write(lt + 'script' + gt + 'document.F=Object' + lt + '/script' + gt);
57503
+ iframeDocument.close();
57504
+ createDict = iframeDocument.F;
57505
+ while (i--) delete createDict[PROTOTYPE][enumBugKeys[i]];
57506
+ return createDict();
57507
+ };
57508
+
57509
+ _objectCreate = Object.create || function create(O, Properties) {
57510
+ var result;
57511
+ if (O !== null) {
57512
+ Empty[PROTOTYPE] = anObject(O);
57513
+ result = new Empty();
57514
+ Empty[PROTOTYPE] = null;
57515
+ // add "__proto__" for Object.getPrototypeOf polyfill
57516
+ result[IE_PROTO] = O;
57517
+ } else result = createDict();
57518
+ return Properties === undefined ? result : dPs(result, Properties);
57519
+ };
57520
+ return _objectCreate;
57521
+ }
57506
57522
 
57507
57523
  var _wks = {exports: {}};
57508
57524
 
@@ -57528,7 +57544,7 @@
57528
57544
  if (it && !has$b(it = stat ? it : it.prototype, TAG$1)) def(it, TAG$1, { configurable: true, value: tag });
57529
57545
  };
57530
57546
 
57531
- var create$4 = _objectCreate;
57547
+ var create$4 = require_objectCreate();
57532
57548
  var descriptor = _propertyDesc;
57533
57549
  var setToStringTag$2 = _setToStringTag;
57534
57550
  var IteratorPrototype = {};
@@ -58171,7 +58187,7 @@
58171
58187
  var toIObject = _toIobject;
58172
58188
  var toPrimitive = _toPrimitive$1;
58173
58189
  var createDesc = _propertyDesc;
58174
- var _create$1 = _objectCreate;
58190
+ var _create$1 = require_objectCreate();
58175
58191
  var gOPNExt = _objectGopnExt;
58176
58192
  var $GOPD = _objectGopd;
58177
58193
  var $GOPS = _objectGops;
@@ -58481,7 +58497,7 @@
58481
58497
 
58482
58498
  var $export = _export;
58483
58499
  // 19.1.2.2 / 15.2.3.5 Object.create(O [, Properties])
58484
- $export($export.S, 'Object', { create: _objectCreate });
58500
+ $export($export.S, 'Object', { create: require_objectCreate() });
58485
58501
 
58486
58502
  var $Object = _coreExports.Object;
58487
58503
  var create$3 = function create(P, D) {
@@ -151662,9 +151678,7 @@
151662
151678
  };
151663
151679
 
151664
151680
  function validateSequence(sequence, options = {}) {
151665
- let {
151666
- isProtein,
151667
- isOligo,
151681
+ const {
151668
151682
  guessIfProtein,
151669
151683
  guessIfProteinOptions,
151670
151684
  reformatSeqName,
@@ -151674,6 +151688,19 @@
151674
151688
  allowOverflowAnnotations,
151675
151689
  coerceFeatureTypes
151676
151690
  } = options;
151691
+ [
151692
+ "isDNA",
151693
+ "isOligo",
151694
+ "isRNA",
151695
+ "isDoubleStrandedDNA",
151696
+ "isSingleStrandedDNA",
151697
+ "isDoubleStrandedRNA",
151698
+ "isProtein"
151699
+ ].forEach((k) => {
151700
+ if (options[k] !== void 0 && sequence[k] === void 0) {
151701
+ sequence[k] = options[k];
151702
+ }
151703
+ });
151677
151704
  const response = {
151678
151705
  validatedAndCleanedSequence: {},
151679
151706
  messages: []
@@ -151710,13 +151737,13 @@
151710
151737
  sequence.sequence = "";
151711
151738
  }
151712
151739
  let validChars;
151713
- if (isProtein === void 0 && guessIfProtein) {
151714
- isProtein = !guessIfSequenceIsDnaAndNotProtein(
151740
+ if (sequence.isProtein === void 0 && guessIfProtein) {
151741
+ sequence.isProtein = !guessIfSequenceIsDnaAndNotProtein(
151715
151742
  sequence.sequence,
151716
151743
  guessIfProteinOptions
151717
151744
  );
151718
151745
  }
151719
- if (isProtein) {
151746
+ if (sequence.isProtein) {
151720
151747
  validChars = filterAminoAcidSequenceString(sequence.sequence);
151721
151748
  if (validChars !== sequence.sequence) {
151722
151749
  sequence.sequence = validChars;
@@ -151732,14 +151759,15 @@
151732
151759
  sequence.proteinSize = sequence.proteinSequence.length;
151733
151760
  } else {
151734
151761
  const temp = sequence.sequence;
151735
- if (!isOligo) {
151762
+ if (!sequence.isOligo) {
151736
151763
  sequence.sequence = sequence.sequence.replace(
151737
151764
  /u/gi,
151738
151765
  (u) => u === "U" ? "T" : "t"
151739
151766
  );
151740
151767
  }
151741
- if (temp !== sequence.sequence) {
151768
+ if (temp !== sequence.sequence && !sequence.isDNA && !sequence.isProtein) {
151742
151769
  sequence.type = "RNA";
151770
+ sequence.sequence = temp;
151743
151771
  } else {
151744
151772
  sequence.type = "DNA";
151745
151773
  }
@@ -151752,7 +151780,7 @@
151752
151780
  }
151753
151781
  }
151754
151782
  if (!sequence.size) {
151755
- sequence.size = isProtein ? sequence.proteinSequence.length * 3 : sequence.sequence.length;
151783
+ sequence.size = sequence.isProtein ? sequence.proteinSequence.length * 3 : sequence.sequence.length;
151756
151784
  }
151757
151785
  let circularityExplicitlyDefined;
151758
151786
  if (sequence.circular === false || sequence.circular === "false" || sequence.circular === -1) {
@@ -152317,7 +152345,13 @@
152317
152345
  }
152318
152346
  options.sequenceTypeFromLocus = item;
152319
152347
  if (item.match(/ss-dna/i)) {
152348
+ options.isDNA = true;
152320
152349
  options.isSingleStrandedDNA = true;
152350
+ } else if (item.match(/rna/i)) {
152351
+ options.isRna = true;
152352
+ } else if (item.match(/ds-dna/i) || item.match(/dna/i)) {
152353
+ options.isDNA = true;
152354
+ options.isDoubleStrandedDNA = true;
152321
152355
  }
152322
152356
  if (item.match(/rna/i) && !item.match(/ss-rna/i)) {
152323
152357
  options.isDoubleStrandedRNA = true;
@@ -152332,7 +152366,10 @@
152332
152366
  }
152333
152367
  result.parsedSequence.gbDivision = gbDivision;
152334
152368
  result.parsedSequence.sequenceTypeFromLocus = options.sequenceTypeFromLocus;
152369
+ result.parsedSequence.isDNA = options.isDNA;
152370
+ result.parsedSequence.isDoubleStrandedDNA = options.isDoubleStrandedDNA;
152335
152371
  result.parsedSequence.isSingleStrandedDNA = options.isSingleStrandedDNA;
152372
+ result.parsedSequence.isRna = options.isRna;
152336
152373
  result.parsedSequence.isDoubleStrandedRNA = options.isDoubleStrandedRNA;
152337
152374
  result.parsedSequence.date = date;
152338
152375
  result.parsedSequence.circular = circular;
@@ -169896,7 +169933,7 @@
169896
169933
  caret: true,
169897
169934
  sequence: true,
169898
169935
  cutsites: false,
169899
- reverseSequence: sequenceData?.isDoubleStrandedRNA,
169936
+ reverseSequence: Boolean(sequenceData?.isDoubleStrandedRNA),
169900
169937
  translations: false,
169901
169938
  aminoAcidNumbers: false,
169902
169939
  primaryProteinSequence: false,
@@ -188626,7 +188663,7 @@ double click --> edit`}`;
188626
188663
  }
188627
188664
 
188628
188665
  const name = "@teselagen/ove";
188629
- const version = "0.3.2";
188666
+ const version = "0.3.4";
188630
188667
  const main = "./src/index.js";
188631
188668
  const packageJson = {
188632
188669
  name: name,
@@ -206987,6 +207024,7 @@ ${seqDataToCopy}\r
206987
207024
  }
206988
207025
 
206989
207026
  const userDefinedHandlersAndOpts = [
207027
+ "onChangeEditLock",
206990
207028
  "defaultLinkedOligoMessage",
206991
207029
  "allowMultipleFeatureDirections",
206992
207030
  "getAdditionalEditAnnotationComps",
@@ -207251,20 +207289,38 @@ ${seqDataToCopy}\r
207251
207289
  return {
207252
207290
  readOnly: editorState.readOnly
207253
207291
  };
207254
- })(({ toolbarItemProps, readOnly, toggleReadOnlyMode, disableSetReadOnly }) => {
207255
- return /* @__PURE__ */ React$3.createElement(
207256
- ToolbarItem$1,
207257
- {
207258
- ...{
207259
- disabled: disableSetReadOnly,
207260
- Icon: /* @__PURE__ */ React$3.createElement(Icon, { icon: readOnly ? "lock" : "unlock" }),
207261
- onIconClick: toggleReadOnlyMode,
207262
- tooltip: readOnly ? /* @__PURE__ */ React$3.createElement("span", null, "Switch to edit mode") : /* @__PURE__ */ React$3.createElement("span", null, "Switch to read only mode"),
207263
- ...toolbarItemProps
207292
+ })(
207293
+ ({
207294
+ toolbarItemProps,
207295
+ readOnly,
207296
+ toggleReadOnlyMode,
207297
+ disableSetReadOnly,
207298
+ onChangeEditLock
207299
+ }) => {
207300
+ const readOnlyTooltip = ({ readOnly: readOnly2, disableSetReadOnly: disableSetReadOnly2 }) => {
207301
+ if (disableSetReadOnly2) {
207302
+ return "You do not have permission to edit locks on this sequence";
207264
207303
  }
207265
- }
207266
- );
207267
- });
207304
+ return readOnly2 ? "Click to enable editing" : "Click to disable editing";
207305
+ };
207306
+ return /* @__PURE__ */ React$3.createElement(
207307
+ ToolbarItem$1,
207308
+ {
207309
+ ...{
207310
+ disabled: disableSetReadOnly,
207311
+ Icon: /* @__PURE__ */ React$3.createElement(Icon, { icon: readOnly ? "lock" : "unlock" }),
207312
+ onIconClick: () => {
207313
+ if (onChangeEditLock)
207314
+ onChangeEditLock(!readOnly);
207315
+ toggleReadOnlyMode();
207316
+ },
207317
+ tooltip: readOnlyTooltip({ readOnly, disableSetReadOnly }),
207318
+ ...toolbarItemProps
207319
+ }
207320
+ }
207321
+ );
207322
+ }
207323
+ );
207268
207324
 
207269
207325
  const style$4 = '';
207270
207326
 
@@ -208063,11 +208119,9 @@ ${seqDataToCopy}\r
208063
208119
  EditReadOnlyItem,
208064
208120
  {
208065
208121
  editorName,
208066
- ...{
208067
- onSave,
208068
- disableSetReadOnly,
208069
- showReadOnly
208070
- }
208122
+ onSave,
208123
+ disableSetReadOnly,
208124
+ showReadOnly
208071
208125
  }
208072
208126
  ), /* @__PURE__ */ React$3.createElement(
208073
208127
  EditCircularityItem,
@@ -218108,46 +218162,46 @@ ${seqDataToCopy}\r
218108
218162
  render() {
218109
218163
  const { previewModeFullscreen: uncontrolledPreviewModeFullscreen } = this.state;
218110
218164
  const {
218111
- ToolBarProps = {},
218112
- StatusBarProps = {},
218113
- extraRightSidePanel,
218165
+ allowPanelTabDraggable = true,
218166
+ annotationsToSupport,
218167
+ caretPositionUpdate,
218168
+ closePanel,
218169
+ collapseSplitScreen,
218170
+ displayMenuBarAboveTools = true,
218114
218171
  editorName,
218172
+ fullScreenOffsets,
218173
+ expandTabToSplitScreen,
218174
+ extraRightSidePanel,
218175
+ getSequenceAtVersion,
218176
+ getVersionList,
218177
+ handleFullscreenClose,
218115
218178
  height: _height,
218116
- showCircularity,
218117
218179
  hideSingleImport,
218180
+ hideStatusBar,
218181
+ hoveredId,
218182
+ isFullscreen,
218183
+ maxAnnotationsToDisplay,
218118
218184
  minHeight = 400,
218119
- showMenuBar,
218120
- annotationsToSupport,
218121
- withRotateCircularView = true,
218122
- withZoomCircularView = true,
218123
- withZoomLinearView = true,
218124
- displayMenuBarAboveTools = true,
218125
- updateSequenceData,
218185
+ onlyShowLabelsThatDoNotFit = true,
218186
+ onSave,
218187
+ previewModeButtonMenu,
218188
+ previewModeFullscreen: controlledPreviewModeFullscreen,
218126
218189
  readOnly,
218190
+ selectionLayer,
218191
+ sequenceData = {},
218127
218192
  setPanelAsActive,
218193
+ showCircularity,
218194
+ showMenuBar,
218195
+ StatusBarProps = {},
218128
218196
  style = {},
218129
- maxAnnotationsToDisplay,
218130
218197
  togglePanelFullScreen,
218131
- collapseSplitScreen,
218132
- expandTabToSplitScreen,
218133
- closePanel,
218134
- onSave,
218135
- hideStatusBar,
218136
- caretPositionUpdate,
218137
- getVersionList,
218138
- getSequenceAtVersion,
218139
- selectionLayer,
218198
+ ToolBarProps = {},
218199
+ updateSequenceData,
218140
218200
  VersionHistoryViewProps,
218141
- sequenceData = {},
218142
- fullScreenOffsets,
218143
- withPreviewMode,
218144
- isFullscreen,
218145
- hoveredId,
218146
- handleFullscreenClose,
218147
- onlyShowLabelsThatDoNotFit = true,
218148
- previewModeFullscreen: controlledPreviewModeFullscreen,
218149
- previewModeButtonMenu,
218150
- allowPanelTabDraggable = true
218201
+ withRotateCircularView = true,
218202
+ withZoomCircularView = true,
218203
+ withZoomLinearView = true,
218204
+ withPreviewMode
218151
218205
  } = this.props;
218152
218206
  if (!this.props.noVersionHistory && this.props.versionHistory && this.props.versionHistory.viewVersionHistory) {
218153
218207
  return /* @__PURE__ */ React$3.createElement(
@@ -218631,12 +218685,11 @@ ${seqDataToCopy}\r
218631
218685
  userDefinedHandlersAndOpts,
218632
218686
  annotationsToSupport,
218633
218687
  closeFullscreen: !!(isFullscreen ? handleFullscreenClose : previewModeFullscreen),
218634
- ...{
218635
- modifyTools: this.props.modifyTools,
218636
- contentLeft: this.props.contentLeft,
218637
- editorName
218638
- },
218688
+ modifyTools: this.props.modifyTools,
218689
+ contentLeft: this.props.contentLeft,
218690
+ editorName,
218639
218691
  withDigestTool: true,
218692
+ onChangeEditLock: this.props.onChangeEditLock,
218640
218693
  ...ToolBarProps
218641
218694
  }
218642
218695
  ),
package/package.json CHANGED
@@ -1,14 +1,14 @@
1
1
  {
2
2
  "name": "@teselagen/ove",
3
- "version": "0.3.3",
3
+ "version": "0.3.5",
4
4
  "main": "./src/index.js",
5
5
  "dependencies": {
6
- "@teselagen/sequence-utils": "0.3.3",
7
- "@teselagen/range-utils": "0.3.3",
8
- "@teselagen/ui": "0.3.3",
9
- "@teselagen/file-utils": "0.3.3",
10
- "@teselagen/bounce-loader": "0.3.3",
11
- "@teselagen/bio-parsers": "0.3.3",
6
+ "@teselagen/sequence-utils": "0.3.5",
7
+ "@teselagen/range-utils": "0.3.5",
8
+ "@teselagen/ui": "0.3.5",
9
+ "@teselagen/file-utils": "0.3.5",
10
+ "@teselagen/bounce-loader": "0.3.5",
11
+ "@teselagen/bio-parsers": "0.3.5",
12
12
  "@blueprintjs/core": "3.52.0",
13
13
  "@blueprintjs/datetime": "3.23.19",
14
14
  "@blueprintjs/icons": "3.33.0",
@@ -342,46 +342,46 @@ export class Editor extends React.Component {
342
342
  const { previewModeFullscreen: uncontrolledPreviewModeFullscreen } =
343
343
  this.state;
344
344
  const {
345
- ToolBarProps = {},
346
- StatusBarProps = {},
347
- extraRightSidePanel,
345
+ allowPanelTabDraggable = true,
346
+ annotationsToSupport,
347
+ caretPositionUpdate,
348
+ closePanel,
349
+ collapseSplitScreen,
350
+ displayMenuBarAboveTools = true,
348
351
  editorName,
352
+ fullScreenOffsets,
353
+ expandTabToSplitScreen,
354
+ extraRightSidePanel,
355
+ getSequenceAtVersion,
356
+ getVersionList,
357
+ handleFullscreenClose,
349
358
  height: _height,
350
- showCircularity,
351
359
  hideSingleImport,
360
+ hideStatusBar,
361
+ hoveredId,
362
+ isFullscreen,
363
+ maxAnnotationsToDisplay,
352
364
  minHeight = 400,
353
- showMenuBar,
354
- annotationsToSupport,
355
- withRotateCircularView = true,
356
- withZoomCircularView = true,
357
- withZoomLinearView = true,
358
- displayMenuBarAboveTools = true,
359
- updateSequenceData,
365
+ onlyShowLabelsThatDoNotFit = true,
366
+ onSave,
367
+ previewModeButtonMenu,
368
+ previewModeFullscreen: controlledPreviewModeFullscreen,
360
369
  readOnly,
370
+ selectionLayer,
371
+ sequenceData = {},
361
372
  setPanelAsActive,
373
+ showCircularity,
374
+ showMenuBar,
375
+ StatusBarProps = {},
362
376
  style = {},
363
- maxAnnotationsToDisplay,
364
377
  togglePanelFullScreen,
365
- collapseSplitScreen,
366
- expandTabToSplitScreen,
367
- closePanel,
368
- onSave,
369
- hideStatusBar,
370
- caretPositionUpdate,
371
- getVersionList,
372
- getSequenceAtVersion,
373
- selectionLayer,
378
+ ToolBarProps = {},
379
+ updateSequenceData,
374
380
  VersionHistoryViewProps,
375
- sequenceData = {},
376
- fullScreenOffsets,
377
- withPreviewMode,
378
- isFullscreen,
379
- hoveredId,
380
- handleFullscreenClose,
381
- onlyShowLabelsThatDoNotFit = true,
382
- previewModeFullscreen: controlledPreviewModeFullscreen,
383
- previewModeButtonMenu,
384
- allowPanelTabDraggable = true
381
+ withRotateCircularView = true,
382
+ withZoomCircularView = true,
383
+ withZoomLinearView = true,
384
+ withPreviewMode
385
385
  } = this.props;
386
386
  if (
387
387
  !this.props.noVersionHistory &&
@@ -898,12 +898,11 @@ export class Editor extends React.Component {
898
898
  closeFullscreen={
899
899
  !!(isFullscreen ? handleFullscreenClose : previewModeFullscreen)
900
900
  }
901
- {...{
902
- modifyTools: this.props.modifyTools,
903
- contentLeft: this.props.contentLeft,
904
- editorName
905
- }}
901
+ modifyTools={this.props.modifyTools}
902
+ contentLeft={this.props.contentLeft}
903
+ editorName={editorName}
906
904
  withDigestTool
905
+ onChangeEditLock={this.props.onChangeEditLock}
907
906
  {...ToolBarProps}
908
907
  />
909
908
 
@@ -1,4 +1,5 @@
1
1
  export const userDefinedHandlersAndOpts = [
2
+ "onChangeEditLock",
2
3
  "defaultLinkedOligoMessage",
3
4
  "allowMultipleFeatureDirections",
4
5
  "getAdditionalEditAnnotationComps",
@@ -235,11 +235,9 @@ export function StatusBar({
235
235
  )}
236
236
  <EditReadOnlyItem
237
237
  editorName={editorName}
238
- {...{
239
- onSave,
240
- disableSetReadOnly,
241
- showReadOnly
242
- }}
238
+ onSave={onSave}
239
+ disableSetReadOnly={disableSetReadOnly}
240
+ showReadOnly={showReadOnly}
243
241
  />
244
242
  <EditCircularityItem
245
243
  editorName={editorName}
@@ -1,5 +1,5 @@
1
- import { Icon } from "@blueprintjs/core";
2
1
  import React from "react";
2
+ import { Icon } from "@blueprintjs/core";
3
3
  import ToolbarItem from "./ToolbarItem";
4
4
  import { connectToEditor } from "../withEditorProps";
5
5
 
@@ -7,20 +7,33 @@ export default connectToEditor((editorState) => {
7
7
  return {
8
8
  readOnly: editorState.readOnly
9
9
  };
10
- })(({ toolbarItemProps, readOnly, toggleReadOnlyMode, disableSetReadOnly }) => {
11
- return (
12
- <ToolbarItem
13
- {...{
14
- disabled: disableSetReadOnly,
15
- Icon: <Icon icon={readOnly ? "lock" : "unlock"} />,
16
- onIconClick: toggleReadOnlyMode,
17
- tooltip: readOnly ? (
18
- <span>Switch to edit mode</span>
19
- ) : (
20
- <span>Switch to read only mode</span>
21
- ),
22
- ...toolbarItemProps
23
- }}
24
- />
25
- );
26
- });
10
+ })(
11
+ ({
12
+ toolbarItemProps,
13
+ readOnly,
14
+ toggleReadOnlyMode,
15
+ disableSetReadOnly,
16
+ onChangeEditLock
17
+ }) => {
18
+ const readOnlyTooltip = ({ readOnly, disableSetReadOnly }) => {
19
+ if (disableSetReadOnly) {
20
+ return "You do not have permission to edit locks on this sequence";
21
+ }
22
+ return readOnly ? "Click to enable editing" : "Click to disable editing";
23
+ };
24
+ return (
25
+ <ToolbarItem
26
+ {...{
27
+ disabled: disableSetReadOnly,
28
+ Icon: <Icon icon={readOnly ? "lock" : "unlock"} />,
29
+ onIconClick: () => {
30
+ if (onChangeEditLock) onChangeEditLock(!readOnly);
31
+ toggleReadOnlyMode();
32
+ },
33
+ tooltip: readOnlyTooltip({ readOnly, disableSetReadOnly }),
34
+ ...toolbarItemProps
35
+ }}
36
+ />
37
+ );
38
+ }
39
+ );
@@ -1,9 +1,5 @@
1
1
  import React from "react";
2
- import {
3
- InputField,
4
- BPSelect,
5
- TextareaField
6
- } from "@teselagen/ui";
2
+ import { InputField, BPSelect, TextareaField } from "@teselagen/ui";
7
3
  import { reduxForm } from "redux-form";
8
4
  import withEditorProps from "../../withEditorProps";
9
5
  import { compose } from "recompose";
@@ -118,7 +118,7 @@ export default function updateEditor(
118
118
  caret: true,
119
119
  sequence: true,
120
120
  cutsites: false,
121
- reverseSequence: sequenceData?.isDoubleStrandedRNA,
121
+ reverseSequence: Boolean(sequenceData?.isDoubleStrandedRNA),
122
122
  translations: false,
123
123
  aminoAcidNumbers: false,
124
124
  primaryProteinSequence: false,
@@ -261,7 +261,7 @@ function VectorInteractionHOC(Component /* options */) {
261
261
  copyOptions,
262
262
  readOnly
263
263
  } = this.props;
264
- const onCut = this.props.onCut || this.props.onCopy || (noop);
264
+ const onCut = this.props.onCut || this.props.onCopy || noop;
265
265
  const seqData = tidyUpSequenceData(
266
266
  this.sequenceDataToCopy ||
267
267
  getSequenceDataBetweenRange(
@@ -516,9 +516,9 @@ function VectorInteractionHOC(Component /* options */) {
516
516
  // onCancel: undefined,
517
517
  text: (
518
518
  <div style={{ wordBreak: "break-word" }}>
519
- <h3>{annotation.name}:</h3>
520
- {annotation.message}
521
- </div>
519
+ <h3>{annotation.name}:</h3>
520
+ {annotation.message}
521
+ </div>
522
522
  )
523
523
  });
524
524
  this.updateSelectionOrCaret(event.shiftKey, annotation);
@@ -1223,14 +1223,14 @@ const insertAndSelectHelper = ({ seqDataToInsert, props }) => {
1223
1223
  sequenceData,
1224
1224
  caretPosition > -1 ? caretPosition : selectionLayer
1225
1225
  );
1226
- if (bpLimit) {
1227
- if (newSeqData.sequence.length > bpLimit) {
1228
- window.toastr.error(
1229
- `Sorry, you cannot go over the limit of ${bpLimit} base pairs`
1230
- );
1231
- throw new Error('bpLimit exceeded')
1232
- }
1226
+ if (bpLimit) {
1227
+ if (newSeqData.sequence.length > bpLimit) {
1228
+ window.toastr.error(
1229
+ `Sorry, you cannot go over the limit of ${bpLimit} base pairs`
1230
+ );
1231
+ throw new Error("bpLimit exceeded");
1233
1232
  }
1233
+ }
1234
1234
  updateSequenceData(newSeqData);
1235
1235
  const seqDataInsertLength = seqDataToInsert.sequence
1236
1236
  ? seqDataToInsert.sequence.length