@teselagen/ove 0.3.12 → 0.3.14

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
@@ -57061,17 +57061,17 @@
57061
57061
  throw TypeError("Can't convert object to primitive value");
57062
57062
  };
57063
57063
 
57064
- var anObject$5 = _anObject;
57064
+ var anObject$3 = _anObject;
57065
57065
  var IE8_DOM_DEFINE$1 = _ie8DomDefine;
57066
57066
  var toPrimitive$2 = _toPrimitive$1;
57067
- var dP$3 = Object.defineProperty;
57067
+ var dP$2 = Object.defineProperty;
57068
57068
 
57069
57069
  _objectDp.f = _descriptors ? Object.defineProperty : function defineProperty(O, P, Attributes) {
57070
- anObject$5(O);
57070
+ anObject$3(O);
57071
57071
  P = toPrimitive$2(P, true);
57072
- anObject$5(Attributes);
57072
+ anObject$3(Attributes);
57073
57073
  if (IE8_DOM_DEFINE$1) try {
57074
- return dP$3(O, P, Attributes);
57074
+ return dP$2(O, P, Attributes);
57075
57075
  } catch (e) { /* empty */ }
57076
57076
  if ('get' in Attributes || 'set' in Attributes) throw TypeError('Accessors not supported!');
57077
57077
  if ('value' in Attributes) O[P] = Attributes.value;
@@ -57087,10 +57087,10 @@
57087
57087
  };
57088
57088
  };
57089
57089
 
57090
- var dP$2 = _objectDp;
57090
+ var dP$1 = _objectDp;
57091
57091
  var createDesc$3 = _propertyDesc;
57092
57092
  var _hide = _descriptors ? function (object, key, value) {
57093
- return dP$2.f(object, key, createDesc$3(1, value));
57093
+ return dP$1.f(object, key, createDesc$3(1, value));
57094
57094
  } : function (object, key, value) {
57095
57095
  object[key] = value;
57096
57096
  return object;
@@ -57106,7 +57106,7 @@
57106
57106
  var ctx$1 = _ctx;
57107
57107
  var hide$2 = _hide;
57108
57108
  var has$d = _has;
57109
- var PROTOTYPE$2 = 'prototype';
57109
+ var PROTOTYPE$1 = 'prototype';
57110
57110
 
57111
57111
  var $export$8 = function (type, name, source) {
57112
57112
  var IS_FORCED = type & $export$8.F;
@@ -57116,8 +57116,8 @@
57116
57116
  var IS_BIND = type & $export$8.B;
57117
57117
  var IS_WRAP = type & $export$8.W;
57118
57118
  var exports = IS_GLOBAL ? core$3 : core$3[name] || (core$3[name] = {});
57119
- var expProto = exports[PROTOTYPE$2];
57120
- var target = IS_GLOBAL ? global$4 : IS_STATIC ? global$4[name] : (global$4[name] || {})[PROTOTYPE$2];
57119
+ var expProto = exports[PROTOTYPE$1];
57120
+ var target = IS_GLOBAL ? global$4 : IS_STATIC ? global$4[name] : (global$4[name] || {})[PROTOTYPE$1];
57121
57121
  var key, own, out;
57122
57122
  if (IS_GLOBAL) source = name;
57123
57123
  for (key in source) {
@@ -57141,7 +57141,7 @@
57141
57141
  } return new C(a, b, c);
57142
57142
  } return C.apply(this, arguments);
57143
57143
  };
57144
- F[PROTOTYPE$2] = C[PROTOTYPE$2];
57144
+ F[PROTOTYPE$1] = C[PROTOTYPE$1];
57145
57145
  return F;
57146
57146
  // make static versions for prototype methods
57147
57147
  })(out) : IS_PROTO && typeof out == 'function' ? ctx$1(Function.call, out) : out;
@@ -57170,12 +57170,20 @@
57170
57170
  return toString$4.call(it).slice(8, -1);
57171
57171
  };
57172
57172
 
57173
- // fallback for non-array-like ES3 and non-enumerable old V8 strings
57174
- var cof$2 = _cof;
57175
- // eslint-disable-next-line no-prototype-builtins
57176
- var _iobject = Object('z').propertyIsEnumerable(0) ? Object : function (it) {
57177
- return cof$2(it) == 'String' ? it.split('') : Object(it);
57178
- };
57173
+ var _iobject;
57174
+ var hasRequired_iobject;
57175
+
57176
+ function require_iobject () {
57177
+ if (hasRequired_iobject) return _iobject;
57178
+ hasRequired_iobject = 1;
57179
+ // fallback for non-array-like ES3 and non-enumerable old V8 strings
57180
+ var cof = _cof;
57181
+ // eslint-disable-next-line no-prototype-builtins
57182
+ _iobject = Object('z').propertyIsEnumerable(0) ? Object : function (it) {
57183
+ return cof(it) == 'String' ? it.split('') : Object(it);
57184
+ };
57185
+ return _iobject;
57186
+ }
57179
57187
 
57180
57188
  // 7.2.1 RequireObjectCoercible(argument)
57181
57189
  var _defined = function (it) {
@@ -57184,7 +57192,7 @@
57184
57192
  };
57185
57193
 
57186
57194
  // to indexed object, toObject with fallback for non-array-like ES3 strings
57187
- var IObject = _iobject;
57195
+ var IObject = require_iobject();
57188
57196
  var defined$2 = _defined;
57189
57197
  var _toIobject = function (it) {
57190
57198
  return IObject(defined$2(it));
@@ -57270,14 +57278,14 @@
57270
57278
  var has$c = _has;
57271
57279
  var toIObject$4 = _toIobject;
57272
57280
  var arrayIndexOf = _arrayIncludes$1(false);
57273
- var IE_PROTO$2 = _sharedKey('IE_PROTO');
57281
+ var IE_PROTO$1 = _sharedKey('IE_PROTO');
57274
57282
 
57275
57283
  var _objectKeysInternal = function (object, names) {
57276
57284
  var O = toIObject$4(object);
57277
57285
  var i = 0;
57278
57286
  var result = [];
57279
57287
  var key;
57280
- for (key in O) if (key != IE_PROTO$2) has$c(O, key) && result.push(key);
57288
+ for (key in O) if (key != IE_PROTO$1) has$c(O, key) && result.push(key);
57281
57289
  // Don't enum bug & hidden keys
57282
57290
  while (names.length > i) if (has$c(O, key = names[i++])) {
57283
57291
  ~arrayIndexOf(result, key) || result.push(key);
@@ -57292,10 +57300,10 @@
57292
57300
 
57293
57301
  // 19.1.2.14 / 15.2.3.14 Object.keys(O)
57294
57302
  var $keys$3 = _objectKeysInternal;
57295
- var enumBugKeys$1 = _enumBugKeys;
57303
+ var enumBugKeys = _enumBugKeys;
57296
57304
 
57297
57305
  var _objectKeys = Object.keys || function keys(O) {
57298
- return $keys$3(O, enumBugKeys$1);
57306
+ return $keys$3(O, enumBugKeys);
57299
57307
  };
57300
57308
 
57301
57309
  var _objectGops = {};
@@ -57331,7 +57339,7 @@
57331
57339
  var gOPS = _objectGops;
57332
57340
  var pIE = require_objectPie();
57333
57341
  var toObject = _toObject;
57334
- var IObject = _iobject;
57342
+ var IObject = require_iobject();
57335
57343
  var $assign = Object.assign;
57336
57344
 
57337
57345
  // should work with symbols and should have deterministic property order (V8 bug)
@@ -57402,19 +57410,27 @@
57402
57410
 
57403
57411
  var _redefine = _hide;
57404
57412
 
57405
- var dP$1 = _objectDp;
57406
- var anObject$4 = _anObject;
57407
- var getKeys$1 = _objectKeys;
57413
+ var _objectDps;
57414
+ var hasRequired_objectDps;
57408
57415
 
57409
- var _objectDps = _descriptors ? Object.defineProperties : function defineProperties(O, Properties) {
57410
- anObject$4(O);
57411
- var keys = getKeys$1(Properties);
57412
- var length = keys.length;
57413
- var i = 0;
57414
- var P;
57415
- while (length > i) dP$1.f(O, P = keys[i++], Properties[P]);
57416
- return O;
57417
- };
57416
+ function require_objectDps () {
57417
+ if (hasRequired_objectDps) return _objectDps;
57418
+ hasRequired_objectDps = 1;
57419
+ var dP = _objectDp;
57420
+ var anObject = _anObject;
57421
+ var getKeys = _objectKeys;
57422
+
57423
+ _objectDps = _descriptors ? Object.defineProperties : function defineProperties(O, Properties) {
57424
+ anObject(O);
57425
+ var keys = getKeys(Properties);
57426
+ var length = keys.length;
57427
+ var i = 0;
57428
+ var P;
57429
+ while (length > i) dP.f(O, P = keys[i++], Properties[P]);
57430
+ return O;
57431
+ };
57432
+ return _objectDps;
57433
+ }
57418
57434
 
57419
57435
  var _html;
57420
57436
  var hasRequired_html;
@@ -57427,47 +57443,55 @@
57427
57443
  return _html;
57428
57444
  }
57429
57445
 
57430
- // 19.1.2.2 / 15.2.3.5 Object.create(O [, Properties])
57431
- var anObject$3 = _anObject;
57432
- var dPs = _objectDps;
57433
- var enumBugKeys = _enumBugKeys;
57434
- var IE_PROTO$1 = _sharedKey('IE_PROTO');
57435
- var Empty = function () { /* empty */ };
57436
- var PROTOTYPE$1 = 'prototype';
57446
+ var _objectCreate;
57447
+ var hasRequired_objectCreate;
57437
57448
 
57438
- // Create object with fake `null` prototype: use iframe Object with cleared prototype
57439
- var createDict = function () {
57440
- // Thrash, waste and sodomy: IE GC bug
57441
- var iframe = require_domCreate()('iframe');
57442
- var i = enumBugKeys.length;
57443
- var lt = '<';
57444
- var gt = '>';
57445
- var iframeDocument;
57446
- iframe.style.display = 'none';
57447
- require_html().appendChild(iframe);
57448
- iframe.src = 'javascript:'; // eslint-disable-line no-script-url
57449
- // createDict = iframe.contentWindow.Object;
57450
- // html.removeChild(iframe);
57451
- iframeDocument = iframe.contentWindow.document;
57452
- iframeDocument.open();
57453
- iframeDocument.write(lt + 'script' + gt + 'document.F=Object' + lt + '/script' + gt);
57454
- iframeDocument.close();
57455
- createDict = iframeDocument.F;
57456
- while (i--) delete createDict[PROTOTYPE$1][enumBugKeys[i]];
57457
- return createDict();
57458
- };
57459
-
57460
- var _objectCreate = Object.create || function create(O, Properties) {
57461
- var result;
57462
- if (O !== null) {
57463
- Empty[PROTOTYPE$1] = anObject$3(O);
57464
- result = new Empty();
57465
- Empty[PROTOTYPE$1] = null;
57466
- // add "__proto__" for Object.getPrototypeOf polyfill
57467
- result[IE_PROTO$1] = O;
57468
- } else result = createDict();
57469
- return Properties === undefined ? result : dPs(result, Properties);
57470
- };
57449
+ function require_objectCreate () {
57450
+ if (hasRequired_objectCreate) return _objectCreate;
57451
+ hasRequired_objectCreate = 1;
57452
+ // 19.1.2.2 / 15.2.3.5 Object.create(O [, Properties])
57453
+ var anObject = _anObject;
57454
+ var dPs = require_objectDps();
57455
+ var enumBugKeys = _enumBugKeys;
57456
+ var IE_PROTO = _sharedKey('IE_PROTO');
57457
+ var Empty = function () { /* empty */ };
57458
+ var PROTOTYPE = 'prototype';
57459
+
57460
+ // Create object with fake `null` prototype: use iframe Object with cleared prototype
57461
+ var createDict = function () {
57462
+ // Thrash, waste and sodomy: IE GC bug
57463
+ var iframe = require_domCreate()('iframe');
57464
+ var i = enumBugKeys.length;
57465
+ var lt = '<';
57466
+ var gt = '>';
57467
+ var iframeDocument;
57468
+ iframe.style.display = 'none';
57469
+ require_html().appendChild(iframe);
57470
+ iframe.src = 'javascript:'; // eslint-disable-line no-script-url
57471
+ // createDict = iframe.contentWindow.Object;
57472
+ // html.removeChild(iframe);
57473
+ iframeDocument = iframe.contentWindow.document;
57474
+ iframeDocument.open();
57475
+ iframeDocument.write(lt + 'script' + gt + 'document.F=Object' + lt + '/script' + gt);
57476
+ iframeDocument.close();
57477
+ createDict = iframeDocument.F;
57478
+ while (i--) delete createDict[PROTOTYPE][enumBugKeys[i]];
57479
+ return createDict();
57480
+ };
57481
+
57482
+ _objectCreate = Object.create || function create(O, Properties) {
57483
+ var result;
57484
+ if (O !== null) {
57485
+ Empty[PROTOTYPE] = anObject(O);
57486
+ result = new Empty();
57487
+ Empty[PROTOTYPE] = null;
57488
+ // add "__proto__" for Object.getPrototypeOf polyfill
57489
+ result[IE_PROTO] = O;
57490
+ } else result = createDict();
57491
+ return Properties === undefined ? result : dPs(result, Properties);
57492
+ };
57493
+ return _objectCreate;
57494
+ }
57471
57495
 
57472
57496
  var _wks = {exports: {}};
57473
57497
 
@@ -57493,7 +57517,7 @@
57493
57517
  if (it && !has$b(it = stat ? it : it.prototype, TAG$1)) def(it, TAG$1, { configurable: true, value: tag });
57494
57518
  };
57495
57519
 
57496
- var create$4 = _objectCreate;
57520
+ var create$4 = require_objectCreate();
57497
57521
  var descriptor = _propertyDesc;
57498
57522
  var setToStringTag$2 = _setToStringTag;
57499
57523
  var IteratorPrototype = {};
@@ -58136,7 +58160,7 @@
58136
58160
  var toIObject = _toIobject;
58137
58161
  var toPrimitive = _toPrimitive$1;
58138
58162
  var createDesc = _propertyDesc;
58139
- var _create$1 = _objectCreate;
58163
+ var _create$1 = require_objectCreate();
58140
58164
  var gOPNExt = _objectGopnExt;
58141
58165
  var $GOPD = _objectGopd;
58142
58166
  var $GOPS = _objectGops;
@@ -58446,7 +58470,7 @@
58446
58470
 
58447
58471
  var $export = _export;
58448
58472
  // 19.1.2.2 / 15.2.3.5 Object.create(O [, Properties])
58449
- $export($export.S, 'Object', { create: _objectCreate });
58473
+ $export($export.S, 'Object', { create: require_objectCreate() });
58450
58474
 
58451
58475
  var $Object = _coreExports.Object;
58452
58476
  var create$3 = function create(P, D) {
@@ -120374,6 +120398,8 @@
120374
120398
  userSchema = exampleData,
120375
120399
  initialEntities
120376
120400
  } = props;
120401
+ const rerenderKey = reactExports.useRef(0);
120402
+ rerenderKey.current = rerenderKey.current + 1;
120377
120403
  const data = userSchema.userData && userSchema.userData.length && userSchema.userData.map((row) => {
120378
120404
  const toRet = {
120379
120405
  _isClean: row._isClean
@@ -120420,6 +120446,7 @@
120420
120446
  {
120421
120447
  maxWidth: 800,
120422
120448
  maxHeight: 500,
120449
+ rerenderKey: rerenderKey.current,
120423
120450
  destroyOnUnmount: false,
120424
120451
  doNotValidateUntouchedRows: true,
120425
120452
  formName: datatableFormName || "editableCellTable",
@@ -134974,8 +135001,8 @@
134974
135001
  maxRangeLength
134975
135002
  );
134976
135003
  let overlaps = [];
134977
- normalizedRangeA.forEach(function(nonCircularRangeA, iA) {
134978
- normalizedRangeB.forEach(function(nonCircularRangeB, iB) {
135004
+ normalizedRangeA.forEach(function(nonCircularRangeA) {
135005
+ normalizedRangeB.forEach(function(nonCircularRangeB) {
134979
135006
  const overlap = getOverlapOfNonCircularRanges(
134980
135007
  nonCircularRangeA,
134981
135008
  nonCircularRangeB
@@ -134987,7 +135014,7 @@
134987
135014
  });
134988
135015
  if (joinIfPossible && normalizedRangeA.length === 2 && normalizedRangeB.length === 2 && maxRangeLength) {
134989
135016
  const joinedOverlap = {};
134990
- overlaps = lodashExports.flatMap(overlaps, (o, i) => {
135017
+ overlaps = lodashExports.flatMap(overlaps, (o) => {
134991
135018
  if (o.start === 0) {
134992
135019
  joinedOverlap.end = o.end;
134993
135020
  return [];
@@ -135477,7 +135504,7 @@
135477
135504
  });
135478
135505
  }
135479
135506
 
135480
- function flipRelativeRange(innerRange, outerRange, sequenceLength, options) {
135507
+ function flipRelativeRange(innerRange, outerRange, sequenceLength) {
135481
135508
  const isFullyContained = isRangeWithinRange(
135482
135509
  innerRange,
135483
135510
  outerRange,
@@ -135489,7 +135516,7 @@
135489
135516
  return flipNonFullyContainedRange(innerRange, outerRange, sequenceLength);
135490
135517
  }
135491
135518
  }
135492
- function flipNonFullyContainedRange(innerRange, outerRange, sequenceLength, options) {
135519
+ function flipNonFullyContainedRange(innerRange, outerRange, sequenceLength) {
135493
135520
  const outerFullyContained = isRangeWithinRange(
135494
135521
  outerRange,
135495
135522
  innerRange,
@@ -135530,9 +135557,8 @@
135530
135557
  sequenceLength
135531
135558
  );
135532
135559
  if (overlaps.length >= 1) {
135533
- let overlapExtendsForward;
135534
135560
  const firstOverlap = overlaps[0];
135535
- overlapExtendsForward = firstOverlap.start !== outerRange.start;
135561
+ const overlapExtendsForward = firstOverlap.start !== outerRange.start;
135536
135562
  const flippedTruncatedInner = flipFullyContainedRange(
135537
135563
  firstOverlap,
135538
135564
  outerRange,
@@ -135553,7 +135579,7 @@
135553
135579
  }
135554
135580
  return flippedInnerRange;
135555
135581
  }
135556
- function flipFullyContainedRange(innerRange, outerRange, sequenceLength, options) {
135582
+ function flipFullyContainedRange(innerRange, outerRange, sequenceLength) {
135557
135583
  const translateBy = -outerRange.start;
135558
135584
  const translatedOuterRange = translateRange(
135559
135585
  outerRange,
@@ -135681,6 +135707,7 @@
135681
135707
  rangesAlreadyAddedToYOffset.push(range);
135682
135708
  return true;
135683
135709
  }
135710
+ return false;
135684
135711
  });
135685
135712
  if (!openYOffsetFound) {
135686
135713
  yOffset = YOffsetLevelsWithRanges.length;
@@ -142151,9 +142178,9 @@
142151
142178
  function filterAminoAcidSequenceString(sequenceString, options) {
142152
142179
  options = options || {};
142153
142180
  if (options.includeStopCodon) {
142154
- return sequenceString.replace(/[^xtgalmfwkqespvicyhrndu.*]/gi, "");
142181
+ return sequenceString?.replace(/[^xtgalmfwkqespvicyhrndu.*]/gi, "");
142155
142182
  }
142156
- return sequenceString.replace(/[^xtgalmfwkqespvicyhrndu]/gi, "");
142183
+ return sequenceString?.replace(/[^xtgalmfwkqespvicyhrndu]/gi, "");
142157
142184
  }
142158
142185
 
142159
142186
  function getDegenerateDnaStringFromAAString(aaString) {
@@ -152384,7 +152411,6 @@
152384
152411
  }
152385
152412
  function parseLocus(line) {
152386
152413
  result = createInitialSequence(options);
152387
- let locusName;
152388
152414
  let circular;
152389
152415
  let gbDivision;
152390
152416
  let date;
@@ -152395,7 +152421,7 @@
152395
152421
  );
152396
152422
  addMessage("Import Warning: Locus line contains no values: " + line);
152397
152423
  }
152398
- locusName = lineArr[1];
152424
+ const locusName = lineArr[1];
152399
152425
  for (let i = 1; i < lineArr.length; i++) {
152400
152426
  if (lineArr[i].match(/circular/gi)) {
152401
152427
  circular = true;
@@ -152542,10 +152568,10 @@
152542
152568
  }
152543
152569
  }
152544
152570
  function parseFeatureNote(line) {
152545
- let newLine, lineArr;
152571
+ let newLine;
152546
152572
  newLine = line.trimLeft();
152547
152573
  newLine = newLine.replace(/^\/|"$/g, "");
152548
- lineArr = newLine.split(/="|=/);
152574
+ const lineArr = newLine.split(/="|=/);
152549
152575
  let val = lineArr.slice(1).join("=");
152550
152576
  if (val) {
152551
152577
  val = val.replace(/\\/g, " ");
@@ -166013,7 +166039,6 @@
166013
166039
  if (serSeq.sequence.symbols) {
166014
166040
  serSeq.sequence = serSeq.sequence.symbols.split("");
166015
166041
  }
166016
- let tmp;
166017
166042
  let dnaType;
166018
166043
  if (serSeq.isProtein) {
166019
166044
  dnaType = "";
@@ -166030,7 +166055,7 @@
166030
166055
  line += " ";
166031
166056
  line += StringUtil.lpad(String(serSeq.sequence.length), " ", 11);
166032
166057
  line += serSeq.isProtein ? " aa " : " bp ";
166033
- tmp = "";
166058
+ const tmp = "";
166034
166059
  line += StringUtil.lpad(tmp, " ", 3);
166035
166060
  line += StringUtil.rpad(dnaType, " ", 6);
166036
166061
  line += " ";
@@ -170530,6 +170555,7 @@
170530
170555
  if (!editorState) {
170531
170556
  return editorReducer({}, {});
170532
170557
  }
170558
+ const sequenceLength = selectors.sequenceLengthSelector(editorState);
170533
170559
  const { findTool, annotationsToSupport = {} } = editorState;
170534
170560
  const visibilities = getVisibilities(editorState);
170535
170561
  let annotationToAdd;
@@ -170540,7 +170566,13 @@
170540
170566
  ].forEach(([n, type, annotationTypePlural]) => {
170541
170567
  const vals = getFormValues(n)(state);
170542
170568
  if (vals) {
170543
- annotationToAdd = getAnnToAdd(vals, n, type, annotationTypePlural);
170569
+ annotationToAdd = getAnnToAdd(
170570
+ vals,
170571
+ n,
170572
+ type,
170573
+ annotationTypePlural,
170574
+ sequenceLength
170575
+ );
170544
170576
  }
170545
170577
  });
170546
170578
  const toReturn = {
@@ -170564,7 +170596,6 @@
170564
170596
  editorState,
170565
170597
  ownProps.additionalEnzymes
170566
170598
  );
170567
- const sequenceLength = selectors.sequenceLengthSelector(editorState);
170568
170599
  const { matchedSearchLayer, searchLayers, matchesTotal } = getSearchLayersAndMatch(editorState);
170569
170600
  const annotationSearchMatches = selectors.annotationSearchSelector(editorState);
170570
170601
  const _sequenceDataToUse = getSequenceDataToUse(
@@ -170840,21 +170871,26 @@
170840
170871
  };
170841
170872
  }
170842
170873
  );
170843
- const getAnnToAdd = defaultMemoize((vals, n, type, annotationTypePlural) => {
170844
- const annToAdd = {
170845
- color: getFeatureToColorMap({ includeHidden: true })[vals.type || "primer_bind"],
170846
- //we won't have the correct color yet so we set it here
170847
- ...vals,
170848
- formName: n,
170849
- type,
170850
- annotationTypePlural,
170851
- name: vals.name || "Untitled"
170852
- };
170853
- if (!vals.useLinkedOligo) {
170854
- delete annToAdd.bases;
170874
+ const getAnnToAdd = defaultMemoize(
170875
+ (vals, n, type, annotationTypePlural, sequenceLength) => {
170876
+ const annToAdd = normalizeRange(
170877
+ {
170878
+ color: getFeatureToColorMap({ includeHidden: true })[vals.type || "primer_bind"],
170879
+ //we won't have the correct color yet so we set it here
170880
+ ...vals,
170881
+ formName: n,
170882
+ type,
170883
+ annotationTypePlural,
170884
+ name: vals.name || "Untitled"
170885
+ },
170886
+ sequenceLength
170887
+ );
170888
+ if (!vals.useLinkedOligo) {
170889
+ delete annToAdd.bases;
170890
+ }
170891
+ return annToAdd;
170855
170892
  }
170856
- return annToAdd;
170857
- });
170893
+ );
170858
170894
  const getSeqDataWithAnnToAdd = defaultMemoize(
170859
170895
  (seqData, ann, allowMultipleFeatureDirections) => {
170860
170896
  if (ann) {
@@ -188727,7 +188763,7 @@ double click --> edit`}`;
188727
188763
  }
188728
188764
 
188729
188765
  const name = "@teselagen/ove";
188730
- const version = "0.3.11";
188766
+ const version = "0.3.13";
188731
188767
  const main = "./src/index.js";
188732
188768
  const exports$1 = {
188733
188769
  ".": {
@@ -189269,6 +189305,184 @@ double click --> edit`}`;
189269
189305
  );
189270
189306
  }
189271
189307
 
189308
+ const style$i = '';
189309
+
189310
+ class ToolbarItem extends React$3.Component {
189311
+ toggleDropdown = ({ forceClose } = {}) => {
189312
+ const { toolName, isOpen } = this.props;
189313
+ this.props.openToolbarItemUpdate(isOpen || forceClose ? "" : toolName);
189314
+ };
189315
+ render() {
189316
+ const { overrides = {} } = this.props;
189317
+ const {
189318
+ isOpen,
189319
+ index,
189320
+ Icon: Icon$1,
189321
+ // dynamicIcon,
189322
+ onIconClick = lodashExports.noop,
189323
+ tooltip = "",
189324
+ tooltipToggled,
189325
+ dropdowntooltip = "",
189326
+ Dropdown,
189327
+ disabled,
189328
+ isHidden,
189329
+ renderIconAbove,
189330
+ noDropdownIcon,
189331
+ IconWrapper,
189332
+ editorName,
189333
+ popoverDisabled,
189334
+ IconWrapperProps,
189335
+ toolName,
189336
+ dropdownicon,
189337
+ tooltipDisabled,
189338
+ toggled = false,
189339
+ ...rest
189340
+ } = { ...this.props, ...overrides };
189341
+ if (!toolName)
189342
+ console.warn("toolName is required!");
189343
+ if (isHidden)
189344
+ return null;
189345
+ let tooltipToDisplay = tooltip;
189346
+ if (toggled && tooltipToggled) {
189347
+ tooltipToDisplay = tooltipToggled;
189348
+ }
189349
+ const buttonTarget = /* @__PURE__ */ React$3.createElement(
189350
+ "div",
189351
+ {
189352
+ className: `veToolbarItemOuter ve-tool-container-${toolName}` + (disabled ? " disabled " : "")
189353
+ },
189354
+ renderIconAbove && /* @__PURE__ */ React$3.createElement("div", null, /* @__PURE__ */ React$3.createElement("div", { className: "veToolbarItem" }, Icon$1)),
189355
+ Icon$1 && !renderIconAbove && /* @__PURE__ */ React$3.createElement(
189356
+ Tooltip,
189357
+ {
189358
+ disabled: tooltipDisabled,
189359
+ portalClassName: "ve-toolbar-item-popover",
189360
+ content: tooltipToDisplay
189361
+ },
189362
+ /* @__PURE__ */ React$3.createElement(
189363
+ AnchorButton,
189364
+ {
189365
+ intent: Intent.PRIMARY,
189366
+ onClick: onIconClick === "toggleDropdown" ? this.toggleDropdown : onIconClick,
189367
+ active: toggled,
189368
+ disabled,
189369
+ minimal: true,
189370
+ icon: React$3.isValidElement(Icon$1) ? Icon$1 : /* @__PURE__ */ React$3.createElement(Icon$1, { toggleDropdown: this.toggleDropdown })
189371
+ }
189372
+ )
189373
+ ),
189374
+ Dropdown && !noDropdownIcon ? /* @__PURE__ */ React$3.createElement(Tooltip, { disabled: tooltipDisabled, content: dropdowntooltip }, /* @__PURE__ */ React$3.createElement(
189375
+ "div",
189376
+ {
189377
+ className: (isOpen ? " isOpen " : "") + (dropdownicon ? "" : " veToolbarDropdown"),
189378
+ onClick: this.toggleDropdown
189379
+ },
189380
+ dropdownicon ? /* @__PURE__ */ React$3.createElement("div", { className: "veToolbarIcon" }, /* @__PURE__ */ React$3.createElement("div", null, dropdownicon)) : isOpen ? /* @__PURE__ */ React$3.createElement(
189381
+ Icon,
189382
+ {
189383
+ "data-test": toolName + "Dropdown",
189384
+ iconSize: 13,
189385
+ icon: "caret-up"
189386
+ }
189387
+ ) : /* @__PURE__ */ React$3.createElement(
189388
+ Icon,
189389
+ {
189390
+ "data-test": toolName + "Dropdown",
189391
+ iconSize: 13,
189392
+ icon: "caret-down"
189393
+ }
189394
+ )
189395
+ )) : null
189396
+ );
189397
+ const content = /* @__PURE__ */ React$3.createElement(
189398
+ "div",
189399
+ {
189400
+ ref: (n) => {
189401
+ if (n)
189402
+ this.dropdownNode = n;
189403
+ },
189404
+ style: { padding: 10, minWidth: 250, maxWidth: 350 },
189405
+ className: "ve-toolbar-dropdown content"
189406
+ },
189407
+ Dropdown && /* @__PURE__ */ React$3.createElement(
189408
+ Dropdown,
189409
+ {
189410
+ ...rest,
189411
+ editorName,
189412
+ toggleDropdown: this.toggleDropdown
189413
+ }
189414
+ )
189415
+ );
189416
+ const target = IconWrapper ? /* @__PURE__ */ React$3.createElement(IconWrapper, { ...IconWrapperProps }, ({ getRootProps, getInputProps }) => /* @__PURE__ */ React$3.createElement("div", { ...getRootProps() }, /* @__PURE__ */ React$3.createElement("input", { ...getInputProps() }), buttonTarget)) : buttonTarget;
189417
+ return /* @__PURE__ */ React$3.createElement("div", { style: { display: "flex", alignItems: "center" } }, index !== 0 && /* @__PURE__ */ React$3.createElement("div", { className: "veToolbarSpacer" }), /* @__PURE__ */ React$3.createElement(
189418
+ Popover,
189419
+ {
189420
+ disabled: popoverDisabled,
189421
+ isOpen: !!Dropdown && isOpen,
189422
+ onClose: (e) => {
189423
+ let srcElement;
189424
+ if (e) {
189425
+ srcElement = e.srcElement || e.target;
189426
+ }
189427
+ if (e && srcElement && this.dropdownNode && (this.dropdownNode.contains(srcElement) || !document.body.contains(srcElement))) {
189428
+ return;
189429
+ }
189430
+ this.toggleDropdown({ forceClose: true });
189431
+ },
189432
+ canEscapeKeyClose: true,
189433
+ minimal: true,
189434
+ position: Position.BOTTOM,
189435
+ target,
189436
+ content
189437
+ }
189438
+ ));
189439
+ }
189440
+ }
189441
+ const ToolbarItem$1 = connectToEditor(({ toolBar = {} }, { toolName }) => ({
189442
+ isOpen: toolBar.openItem === toolName
189443
+ }))(ToolbarItem);
189444
+
189445
+ const editTool = connectToEditor((editorState) => {
189446
+ return {
189447
+ readOnly: editorState.readOnly
189448
+ };
189449
+ })((props) => {
189450
+ const { toolbarItemProps, readOnly, disableSetReadOnly } = props;
189451
+ const [isLoading, setIsLoading] = reactExports.useState(false);
189452
+ const readOnlyTooltip = ({ readOnly: readOnly2, disableSetReadOnly: disableSetReadOnly2 }) => {
189453
+ if (isLoading) {
189454
+ return "Loading...";
189455
+ } else if (disableSetReadOnly2) {
189456
+ return "You do not have permission to edit locks on this sequence";
189457
+ }
189458
+ return readOnly2 ? "Click to enable editing" : "Click to disable editing";
189459
+ };
189460
+ return /* @__PURE__ */ React$3.createElement(
189461
+ ToolbarItem$1,
189462
+ {
189463
+ ...{
189464
+ disabled: isLoading || disableSetReadOnly,
189465
+ Icon: /* @__PURE__ */ React$3.createElement(Icon, { icon: readOnly ? "lock" : "unlock" }),
189466
+ onIconClick: () => handleReadOnlyChange(!readOnly, { ...props, setIsLoading }),
189467
+ tooltip: readOnlyTooltip({ readOnly, disableSetReadOnly }),
189468
+ ...toolbarItemProps
189469
+ }
189470
+ }
189471
+ );
189472
+ });
189473
+ async function handleReadOnlyChange(newVal, { beforeReadOnlyChange, updateReadOnlyMode, setIsLoading = () => {
189474
+ } }) {
189475
+ if (beforeReadOnlyChange) {
189476
+ setIsLoading(true);
189477
+ const shouldChange = await beforeReadOnlyChange(newVal);
189478
+ setIsLoading(false);
189479
+ if (shouldChange === false) {
189480
+ return;
189481
+ }
189482
+ }
189483
+ updateReadOnlyMode(newVal);
189484
+ }
189485
+
189272
189486
  const isProtein = (props) => props.sequenceData && props.sequenceData.isProtein;
189273
189487
  const isOligo = (props) => props.sequenceData && props.sequenceData.isOligo;
189274
189488
  const isRna = (props) => props.sequenceData && props.sequenceData.isRna;
@@ -189352,7 +189566,7 @@ double click --> edit`}`;
189352
189566
  isDisabled: (props) => props.disableSetReadOnly || !props.onSave,
189353
189567
  isHidden: (props) => !props.toggleReadOnlyMode,
189354
189568
  isActive: (props) => props.readOnly,
189355
- handler: (props) => props.toggleReadOnlyMode()
189569
+ handler: (props) => handleReadOnlyChange(!props.readOnly, props)
189356
189570
  },
189357
189571
  importSequence: {
189358
189572
  isHidden: (props) => props.hideSingleImport,
@@ -192621,7 +192835,7 @@ double click --> edit`}`;
192621
192835
  ];
192622
192836
  }
192623
192837
 
192624
- const style$i = '';
192838
+ const style$h = '';
192625
192839
 
192626
192840
  function SequenceName({ sequenceName, sequenceLength, isProtein }) {
192627
192841
  return /* @__PURE__ */ React$3.createElement("div", { key: "circViewSvgCenterText", style: { textAlign: "center" } }, /* @__PURE__ */ React$3.createElement("span", null, sequenceName, " "), /* @__PURE__ */ React$3.createElement("br", null), /* @__PURE__ */ React$3.createElement("span", null, isProtein ? `${Math.floor(sequenceLength / 3)} AAs` : `${sequenceLength} bps`));
@@ -195007,7 +195221,7 @@ double click --> edit`}`;
195007
195221
  );
195008
195222
  }
195009
195223
 
195010
- const style$h = '';
195224
+ const style$g = '';
195011
195225
 
195012
195226
  const simpleDialog = '';
195013
195227
 
@@ -195284,7 +195498,7 @@ double click --> edit`}`;
195284
195498
  return combinedLabels;
195285
195499
  }
195286
195500
 
195287
- const style$g = '';
195501
+ const style$f = '';
195288
195502
 
195289
195503
  const fontWidthToFontSize = 1.75;
195290
195504
  const getTextLength = (text) => {
@@ -197487,7 +197701,7 @@ double click --> edit`}`;
197487
197701
  }
197488
197702
  const DrawAnnotation = withHover(DrawAnnotationInner);
197489
197703
 
197490
- const style$f = '';
197704
+ const style$e = '';
197491
197705
 
197492
197706
  function c(u,e,c){var i=this,a=reactExports.useRef(null),o=reactExports.useRef(0),f=reactExports.useRef(null),l=reactExports.useRef([]),m=reactExports.useRef(),v=reactExports.useRef(),d=reactExports.useRef(u),p=reactExports.useRef(!0);reactExports.useEffect(function(){d.current=u;},[u]);var g=!e&&0!==e&&"undefined"!=typeof window;if("function"!=typeof u)throw new TypeError("Expected a function");e=+e||0;var w=!!(c=c||{}).leading,s=!("trailing"in c)||!!c.trailing,x="maxWait"in c,y=x?Math.max(+c.maxWait||0,e):null;reactExports.useEffect(function(){return p.current=!0,function(){p.current=!1;}},[]);var h=reactExports.useMemo(function(){var r=function(r){var n=l.current,t=m.current;return l.current=m.current=null,o.current=r,v.current=d.current.apply(t,n)},n=function(r,n){g&&cancelAnimationFrame(f.current),f.current=g?requestAnimationFrame(r):setTimeout(r,n);},t=function(r){if(!p.current)return !1;var n=r-a.current;return !a.current||n>=e||n<0||x&&r-o.current>=y},u=function(n){return f.current=null,s&&l.current?r(n):(l.current=m.current=null,v.current)},c=function r(){var c=Date.now();if(t(c))return u(c);if(p.current){var i=e-(c-a.current),f=x?Math.min(i,y-(c-o.current)):i;n(r,f);}},h=function(){var u=Date.now(),d=t(u);if(l.current=[].slice.call(arguments),m.current=i,a.current=u,d){if(!f.current&&p.current)return o.current=a.current,n(c,e),w?r(a.current):v.current;if(x)return n(c,e),r(a.current)}return f.current||n(c,e),v.current};return h.cancel=function(){f.current&&(g?cancelAnimationFrame(f.current):clearTimeout(f.current)),o.current=0,l.current=a.current=m.current=f.current=null;},h.isPending=function(){return !!f.current},h.flush=function(){return f.current?u(Date.now()):v.current},h},[w,x,e,y,s,g]);return h}
197493
197707
 
@@ -198420,7 +198634,7 @@ double click --> edit`}`;
198420
198634
  }
198421
198635
  const CircularView$1 = withEditorInteractions(CircularView);
198422
198636
 
198423
- const style$e = '';
198637
+ const style$d = '';
198424
198638
 
198425
198639
  class PrintDialog extends React$3.Component {
198426
198640
  state = {
@@ -198901,7 +199115,7 @@ double click --> edit`}`;
198901
199115
  tgFormValues("ignoreName", "ignoreStrand", "ignoreStartAndEnd")
198902
199116
  )(RemoveDuplicatesDialog);
198903
199117
 
198904
- const style$d = '';
199118
+ const style$c = '';
198905
199119
 
198906
199120
  var isMobile$2 = {exports: {}};
198907
199121
 
@@ -199923,7 +200137,7 @@ double click --> edit`}`;
199923
200137
  return normalizedVal;
199924
200138
  };
199925
200139
 
199926
- const style$c = '';
200140
+ const style$b = '';
199927
200141
 
199928
200142
  const EnzymeViewer = ({
199929
200143
  extraClasses = "",
@@ -199998,7 +200212,7 @@ double click --> edit`}`;
199998
200212
  );
199999
200213
  };
200000
200214
 
200001
- const style$b = '';
200215
+ const style$a = '';
200002
200216
 
200003
200217
  const upsertLocalEnzymeGroups = (newGroups) => {
200004
200218
  const existingGroups = window.getExistingEnzymeGroups();
@@ -200694,7 +200908,7 @@ double click --> edit`}`;
200694
200908
  );
200695
200909
  });
200696
200910
 
200697
- const style$a = '';
200911
+ const style$9 = '';
200698
200912
 
200699
200913
  const CreateCustomEnzyme = function(props) {
200700
200914
  const paddingStart = "-------";
@@ -201519,143 +201733,6 @@ double click --> edit`}`;
201519
201733
  return isHidden;
201520
201734
  }
201521
201735
 
201522
- const style$9 = '';
201523
-
201524
- class ToolbarItem extends React$3.Component {
201525
- toggleDropdown = ({ forceClose } = {}) => {
201526
- const { toolName, isOpen } = this.props;
201527
- this.props.openToolbarItemUpdate(isOpen || forceClose ? "" : toolName);
201528
- };
201529
- render() {
201530
- const { overrides = {} } = this.props;
201531
- const {
201532
- isOpen,
201533
- index,
201534
- Icon: Icon$1,
201535
- // dynamicIcon,
201536
- onIconClick = lodashExports.noop,
201537
- tooltip = "",
201538
- tooltipToggled,
201539
- dropdowntooltip = "",
201540
- Dropdown,
201541
- disabled,
201542
- isHidden,
201543
- renderIconAbove,
201544
- noDropdownIcon,
201545
- IconWrapper,
201546
- editorName,
201547
- popoverDisabled,
201548
- IconWrapperProps,
201549
- toolName,
201550
- dropdownicon,
201551
- tooltipDisabled,
201552
- toggled = false,
201553
- ...rest
201554
- } = { ...this.props, ...overrides };
201555
- if (!toolName)
201556
- console.warn("toolName is required!");
201557
- if (isHidden)
201558
- return null;
201559
- let tooltipToDisplay = tooltip;
201560
- if (toggled && tooltipToggled) {
201561
- tooltipToDisplay = tooltipToggled;
201562
- }
201563
- const buttonTarget = /* @__PURE__ */ React$3.createElement(
201564
- "div",
201565
- {
201566
- className: `veToolbarItemOuter ve-tool-container-${toolName}` + (disabled ? " disabled " : "")
201567
- },
201568
- renderIconAbove && /* @__PURE__ */ React$3.createElement("div", null, /* @__PURE__ */ React$3.createElement("div", { className: "veToolbarItem" }, Icon$1)),
201569
- Icon$1 && !renderIconAbove && /* @__PURE__ */ React$3.createElement(
201570
- Tooltip,
201571
- {
201572
- disabled: tooltipDisabled,
201573
- portalClassName: "ve-toolbar-item-popover",
201574
- content: tooltipToDisplay
201575
- },
201576
- /* @__PURE__ */ React$3.createElement(
201577
- AnchorButton,
201578
- {
201579
- intent: Intent.PRIMARY,
201580
- onClick: onIconClick === "toggleDropdown" ? this.toggleDropdown : onIconClick,
201581
- active: toggled,
201582
- disabled,
201583
- minimal: true,
201584
- icon: React$3.isValidElement(Icon$1) ? Icon$1 : /* @__PURE__ */ React$3.createElement(Icon$1, { toggleDropdown: this.toggleDropdown })
201585
- }
201586
- )
201587
- ),
201588
- Dropdown && !noDropdownIcon ? /* @__PURE__ */ React$3.createElement(Tooltip, { disabled: tooltipDisabled, content: dropdowntooltip }, /* @__PURE__ */ React$3.createElement(
201589
- "div",
201590
- {
201591
- className: (isOpen ? " isOpen " : "") + (dropdownicon ? "" : " veToolbarDropdown"),
201592
- onClick: this.toggleDropdown
201593
- },
201594
- dropdownicon ? /* @__PURE__ */ React$3.createElement("div", { className: "veToolbarIcon" }, /* @__PURE__ */ React$3.createElement("div", null, dropdownicon)) : isOpen ? /* @__PURE__ */ React$3.createElement(
201595
- Icon,
201596
- {
201597
- "data-test": toolName + "Dropdown",
201598
- iconSize: 13,
201599
- icon: "caret-up"
201600
- }
201601
- ) : /* @__PURE__ */ React$3.createElement(
201602
- Icon,
201603
- {
201604
- "data-test": toolName + "Dropdown",
201605
- iconSize: 13,
201606
- icon: "caret-down"
201607
- }
201608
- )
201609
- )) : null
201610
- );
201611
- const content = /* @__PURE__ */ React$3.createElement(
201612
- "div",
201613
- {
201614
- ref: (n) => {
201615
- if (n)
201616
- this.dropdownNode = n;
201617
- },
201618
- style: { padding: 10, minWidth: 250, maxWidth: 350 },
201619
- className: "ve-toolbar-dropdown content"
201620
- },
201621
- Dropdown && /* @__PURE__ */ React$3.createElement(
201622
- Dropdown,
201623
- {
201624
- ...rest,
201625
- editorName,
201626
- toggleDropdown: this.toggleDropdown
201627
- }
201628
- )
201629
- );
201630
- const target = IconWrapper ? /* @__PURE__ */ React$3.createElement(IconWrapper, { ...IconWrapperProps }, ({ getRootProps, getInputProps }) => /* @__PURE__ */ React$3.createElement("div", { ...getRootProps() }, /* @__PURE__ */ React$3.createElement("input", { ...getInputProps() }), buttonTarget)) : buttonTarget;
201631
- return /* @__PURE__ */ React$3.createElement("div", { style: { display: "flex", alignItems: "center" } }, index !== 0 && /* @__PURE__ */ React$3.createElement("div", { className: "veToolbarSpacer" }), /* @__PURE__ */ React$3.createElement(
201632
- Popover,
201633
- {
201634
- disabled: popoverDisabled,
201635
- isOpen: !!Dropdown && isOpen,
201636
- onClose: (e) => {
201637
- let srcElement;
201638
- if (e) {
201639
- srcElement = e.srcElement || e.target;
201640
- }
201641
- if (e && srcElement && this.dropdownNode && (this.dropdownNode.contains(srcElement) || !document.body.contains(srcElement))) {
201642
- return;
201643
- }
201644
- this.toggleDropdown({ forceClose: true });
201645
- },
201646
- canEscapeKeyClose: true,
201647
- minimal: true,
201648
- position: Position.BOTTOM,
201649
- target,
201650
- content
201651
- }
201652
- ));
201653
- }
201654
- }
201655
- const ToolbarItem$1 = connectToEditor(({ toolBar = {} }, { toolName }) => ({
201656
- isOpen: toolBar.openItem === toolName
201657
- }))(ToolbarItem);
201658
-
201659
201736
  function array_move(arr, old_index, new_index) {
201660
201737
  if (new_index >= arr.length) {
201661
201738
  let k = new_index - arr.length + 1;
@@ -202309,30 +202386,30 @@ double click --> edit`}`;
202309
202386
  formatStart = (val) => {
202310
202387
  const { isProtein } = this.props.sequenceData || {};
202311
202388
  if (isProtein) {
202312
- return (val + 2) / 3;
202389
+ return lodashExports.round((val + 2) / 3);
202313
202390
  }
202314
- return val;
202391
+ return lodashExports.round(val);
202315
202392
  };
202316
202393
  formatEnd = (val) => {
202317
202394
  const { isProtein } = this.props.sequenceData || {};
202318
202395
  if (isProtein) {
202319
- return val / 3;
202396
+ return lodashExports.round(val / 3);
202320
202397
  }
202321
- return val;
202398
+ return lodashExports.round(val);
202322
202399
  };
202323
202400
  parseStart = (val) => {
202324
202401
  const { isProtein } = this.props.sequenceData || {};
202325
202402
  if (isProtein) {
202326
- return val * 3 - 2;
202403
+ return lodashExports.round(val * 3 - 2);
202327
202404
  }
202328
- return val;
202405
+ return lodashExports.round(val);
202329
202406
  };
202330
202407
  parseEnd = (val) => {
202331
202408
  const { isProtein } = this.props.sequenceData || {};
202332
202409
  if (isProtein) {
202333
- return val * 3;
202410
+ return lodashExports.round(val * 3);
202334
202411
  }
202335
- return val;
202412
+ return lodashExports.round(val);
202336
202413
  };
202337
202414
  renderLocations = (props) => {
202338
202415
  const { fields } = props;
@@ -207131,7 +207208,7 @@ ${seqDataToCopy}\r
207131
207208
  }
207132
207209
 
207133
207210
  const userDefinedHandlersAndOpts = [
207134
- "onChangeEditLock",
207211
+ "beforeReadOnlyChange",
207135
207212
  "defaultLinkedOligoMessage",
207136
207213
  "allowMultipleFeatureDirections",
207137
207214
  "getAdditionalEditAnnotationComps",
@@ -207394,49 +207471,6 @@ ${seqDataToCopy}\r
207394
207471
  }
207395
207472
  );
207396
207473
 
207397
- const editTool = connectToEditor((editorState) => {
207398
- return {
207399
- readOnly: editorState.readOnly
207400
- };
207401
- })(
207402
- ({
207403
- toolbarItemProps,
207404
- readOnly,
207405
- toggleReadOnlyMode,
207406
- disableSetReadOnly,
207407
- onChangeEditLock
207408
- }) => {
207409
- const [isLoading, setIsLoading] = reactExports.useState(false);
207410
- const readOnlyTooltip = ({ readOnly: readOnly2, disableSetReadOnly: disableSetReadOnly2 }) => {
207411
- if (isLoading) {
207412
- return "Loading...";
207413
- } else if (disableSetReadOnly2) {
207414
- return "You do not have permission to edit locks on this sequence";
207415
- }
207416
- return readOnly2 ? "Click to enable editing" : "Click to disable editing";
207417
- };
207418
- return /* @__PURE__ */ React$3.createElement(
207419
- ToolbarItem$1,
207420
- {
207421
- ...{
207422
- disabled: isLoading || disableSetReadOnly,
207423
- Icon: /* @__PURE__ */ React$3.createElement(Icon, { icon: readOnly ? "lock" : "unlock" }),
207424
- onIconClick: async () => {
207425
- if (onChangeEditLock) {
207426
- setIsLoading(true);
207427
- await onChangeEditLock(!readOnly);
207428
- setIsLoading(false);
207429
- }
207430
- toggleReadOnlyMode();
207431
- },
207432
- tooltip: readOnlyTooltip({ readOnly, disableSetReadOnly }),
207433
- ...toolbarItemProps
207434
- }
207435
- }
207436
- );
207437
- }
207438
- );
207439
-
207440
207474
  const style$4 = '';
207441
207475
 
207442
207476
  const opts = [
@@ -208057,31 +208091,22 @@ ${seqDataToCopy}\r
208057
208091
 
208058
208092
  const EditReadOnlyItem = connectToEditor(({ readOnly }) => ({
208059
208093
  readOnly
208060
- }))(
208061
- ({
208062
- onSave,
208063
- readOnly,
208064
- showReadOnly,
208065
- disableSetReadOnly,
208066
- updateReadOnlyMode
208067
- }) => {
208068
- return showReadOnly ? /* @__PURE__ */ React$3.createElement(StatusBarItem, { dataTest: "veStatusBar-readOnly" }, onSave ? /* @__PURE__ */ React$3.createElement(
208069
- HTMLSelect,
208070
- {
208071
- options: [
208072
- { label: "Read Only", value: "readOnly" },
208073
- { label: "Editable", value: "editable" }
208074
- ],
208075
- disabled: disableSetReadOnly || !onSave,
208076
- className: MINIMAL,
208077
- value: readOnly ? "readOnly" : "editable",
208078
- onChange: ({ target: { value } }) => {
208079
- updateReadOnlyMode(value === "readOnly");
208080
- }
208081
- }
208082
- ) : readOnly ? "Read Only" : "Editable") : null;
208083
- }
208084
- );
208094
+ }))((props) => {
208095
+ const { onSave, readOnly, showReadOnly, disableSetReadOnly } = props;
208096
+ return showReadOnly ? /* @__PURE__ */ React$3.createElement(StatusBarItem, { dataTest: "veStatusBar-readOnly" }, onSave ? /* @__PURE__ */ React$3.createElement(
208097
+ HTMLSelect,
208098
+ {
208099
+ options: [
208100
+ { label: "Read Only", value: "readOnly" },
208101
+ { label: "Editable", value: "editable" }
208102
+ ],
208103
+ disabled: disableSetReadOnly || !onSave,
208104
+ className: MINIMAL,
208105
+ value: readOnly ? "readOnly" : "editable",
208106
+ onChange: ({ target: { value } }) => handleReadOnlyChange(value === "readOnly", props)
208107
+ }
208108
+ ) : readOnly ? "Read Only" : "Editable") : null;
208109
+ });
208085
208110
  const ShowSelectionItem = compose(
208086
208111
  connectToEditor(
208087
208112
  ({ selectionLayer, caretPosition, sequenceData = { sequence: "" } }, ownProps, ...rest) => {
@@ -208228,11 +208253,13 @@ ${seqDataToCopy}\r
208228
208253
  showGCContentByDefault,
208229
208254
  onSelectionOrCaretChanged,
208230
208255
  GCDecimalDigits = 1,
208231
- isProtein
208256
+ isProtein,
208257
+ beforeReadOnlyChange
208232
208258
  }) {
208233
208259
  return /* @__PURE__ */ React$3.createElement("div", { className: "veStatusBar" }, showMoleculeType && /* @__PURE__ */ React$3.createElement(ShowTypeItem, { editorName }), /* @__PURE__ */ React$3.createElement(
208234
208260
  EditReadOnlyItem,
208235
208261
  {
208262
+ beforeReadOnlyChange,
208236
208263
  editorName,
208237
208264
  onSave,
208238
208265
  disableSetReadOnly,
@@ -208671,7 +208698,6 @@ ${seqDataToCopy}\r
208671
208698
  disableSetReadOnly,
208672
208699
  updateAvailability,
208673
208700
  sequenceData,
208674
- updateReadOnlyMode,
208675
208701
  onSave,
208676
208702
  showAvailability,
208677
208703
  sequenceNameUpdate
@@ -208726,10 +208752,9 @@ ${seqDataToCopy}\r
208726
208752
  ))), /* @__PURE__ */ React$3.createElement("div", { className: "ve-flex-row" }, /* @__PURE__ */ React$3.createElement("div", { className: "ve-column-left bp3-label" }, "Length"), " ", /* @__PURE__ */ React$3.createElement("div", { className: "ve-column-right" }, " ", isProtein ? proteinSequence.length : sequence.length)), showReadOnly && /* @__PURE__ */ React$3.createElement("div", { className: "ve-flex-row" }, /* @__PURE__ */ React$3.createElement("div", { className: "ve-column-left bp3-label" }, "Is Editable"), " ", /* @__PURE__ */ React$3.createElement("div", { className: "ve-column-right" }, " ", /* @__PURE__ */ React$3.createElement(
208727
208753
  BPSelect,
208728
208754
  {
208755
+ className: "veReadOnlySelect",
208729
208756
  disabled: !onSave || disableSetReadOnly,
208730
- onChange: (val) => {
208731
- updateReadOnlyMode(val === "readOnly");
208732
- },
208757
+ onChange: (val) => handleReadOnlyChange(val === "readOnly", this.props),
208733
208758
  value: readOnly ? "readOnly" : "editable",
208734
208759
  options: [
208735
208760
  { label: "Read Only", value: "readOnly" },
@@ -218802,7 +218827,7 @@ ${seqDataToCopy}\r
218802
218827
  contentLeft: this.props.contentLeft,
218803
218828
  editorName,
218804
218829
  withDigestTool: true,
218805
- onChangeEditLock: this.props.onChangeEditLock,
218830
+ beforeReadOnlyChange: this.props.beforeReadOnlyChange,
218806
218831
  ...ToolBarProps
218807
218832
  }
218808
218833
  ),