@teselagen/ove 0.3.12 → 0.3.13

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.js CHANGED
@@ -7425,7 +7425,7 @@ function getPlainObjectKeys(object) {
7425
7425
  var ownKeys$8 = typeof Reflect !== "undefined" && Reflect.ownKeys ? Reflect.ownKeys : hasGetOwnPropertySymbols ? function (obj) {
7426
7426
  return Object.getOwnPropertyNames(obj).concat(Object.getOwnPropertySymbols(obj));
7427
7427
  } : /* istanbul ignore next */Object.getOwnPropertyNames;
7428
- function toPrimitive$2(value) {
7428
+ function toPrimitive$3(value) {
7429
7429
  return value === null ? null : typeof value === "object" ? "" + value : value;
7430
7430
  }
7431
7431
  function hasProp(target, prop) {
@@ -8354,7 +8354,7 @@ var ObservableValue = /*#__PURE__*/function (_Atom) {
8354
8354
  return this.name_ + "[" + this.value_ + "]";
8355
8355
  };
8356
8356
  _proto.valueOf = function valueOf() {
8357
- return toPrimitive$2(this.get());
8357
+ return toPrimitive$3(this.get());
8358
8358
  };
8359
8359
  _proto[_Symbol$toPrimitive] = function () {
8360
8360
  return this.valueOf();
@@ -8582,7 +8582,7 @@ var ComputedValue = /*#__PURE__*/function () {
8582
8582
  return this.name_ + "[" + this.derivation.toString() + "]";
8583
8583
  };
8584
8584
  _proto.valueOf = function valueOf() {
8585
- return toPrimitive$2(this.get());
8585
+ return toPrimitive$3(this.get());
8586
8586
  };
8587
8587
  _proto[_Symbol$toPrimitive$1] = function () {
8588
8588
  return this.valueOf();
@@ -30279,18 +30279,10 @@ var _fails = function (exec) {
30279
30279
  }
30280
30280
  };
30281
30281
 
30282
- var _descriptors;
30283
- var hasRequired_descriptors;
30284
-
30285
- function require_descriptors () {
30286
- if (hasRequired_descriptors) return _descriptors;
30287
- hasRequired_descriptors = 1;
30288
- // Thank's IE8 for his funny defineProperty
30289
- _descriptors = !_fails(function () {
30290
- return Object.defineProperty({}, 'a', { get: function () { return 7; } }).a != 7;
30291
- });
30292
- return _descriptors;
30293
- }
30282
+ // Thank's IE8 for his funny defineProperty
30283
+ var _descriptors = !_fails(function () {
30284
+ return Object.defineProperty({}, 'a', { get: function () { return 7; } }).a != 7;
30285
+ });
30294
30286
 
30295
30287
  var _domCreate;
30296
30288
  var hasRequired_domCreate;
@@ -30308,17 +30300,9 @@ function require_domCreate () {
30308
30300
  return _domCreate;
30309
30301
  }
30310
30302
 
30311
- var _ie8DomDefine;
30312
- var hasRequired_ie8DomDefine;
30313
-
30314
- function require_ie8DomDefine () {
30315
- if (hasRequired_ie8DomDefine) return _ie8DomDefine;
30316
- hasRequired_ie8DomDefine = 1;
30317
- _ie8DomDefine = !require_descriptors() && !_fails(function () {
30318
- return Object.defineProperty(require_domCreate()('div'), 'a', { get: function () { return 7; } }).a != 7;
30319
- });
30320
- return _ie8DomDefine;
30321
- }
30303
+ var _ie8DomDefine = !_descriptors && !_fails(function () {
30304
+ return Object.defineProperty(require_domCreate()('div'), 'a', { get: function () { return 7; } }).a != 7;
30305
+ });
30322
30306
 
30323
30307
  // 7.1.1 ToPrimitive(input [, PreferredType])
30324
30308
  var isObject$d = _isObject;
@@ -30333,29 +30317,22 @@ var _toPrimitive$1 = function (it, S) {
30333
30317
  throw TypeError("Can't convert object to primitive value");
30334
30318
  };
30335
30319
 
30336
- var hasRequired_objectDp;
30337
-
30338
- function require_objectDp () {
30339
- if (hasRequired_objectDp) return _objectDp;
30340
- hasRequired_objectDp = 1;
30341
- var anObject = _anObject;
30342
- var IE8_DOM_DEFINE = require_ie8DomDefine();
30343
- var toPrimitive = _toPrimitive$1;
30344
- var dP = Object.defineProperty;
30320
+ var anObject$5 = _anObject;
30321
+ var IE8_DOM_DEFINE$1 = _ie8DomDefine;
30322
+ var toPrimitive$2 = _toPrimitive$1;
30323
+ var dP$3 = Object.defineProperty;
30345
30324
 
30346
- _objectDp.f = require_descriptors() ? Object.defineProperty : function defineProperty(O, P, Attributes) {
30347
- anObject(O);
30348
- P = toPrimitive(P, true);
30349
- anObject(Attributes);
30350
- if (IE8_DOM_DEFINE) try {
30351
- return dP(O, P, Attributes);
30352
- } catch (e) { /* empty */ }
30353
- if ('get' in Attributes || 'set' in Attributes) throw TypeError('Accessors not supported!');
30354
- if ('value' in Attributes) O[P] = Attributes.value;
30355
- return O;
30356
- };
30357
- return _objectDp;
30358
- }
30325
+ _objectDp.f = _descriptors ? Object.defineProperty : function defineProperty(O, P, Attributes) {
30326
+ anObject$5(O);
30327
+ P = toPrimitive$2(P, true);
30328
+ anObject$5(Attributes);
30329
+ if (IE8_DOM_DEFINE$1) try {
30330
+ return dP$3(O, P, Attributes);
30331
+ } catch (e) { /* empty */ }
30332
+ if ('get' in Attributes || 'set' in Attributes) throw TypeError('Accessors not supported!');
30333
+ if ('value' in Attributes) O[P] = Attributes.value;
30334
+ return O;
30335
+ };
30359
30336
 
30360
30337
  var _propertyDesc = function (bitmap, value) {
30361
30338
  return {
@@ -30366,9 +30343,9 @@ var _propertyDesc = function (bitmap, value) {
30366
30343
  };
30367
30344
  };
30368
30345
 
30369
- var dP$2 = require_objectDp();
30346
+ var dP$2 = _objectDp;
30370
30347
  var createDesc$3 = _propertyDesc;
30371
- var _hide = require_descriptors() ? function (object, key, value) {
30348
+ var _hide = _descriptors ? function (object, key, value) {
30372
30349
  return dP$2.f(object, key, createDesc$3(1, value));
30373
30350
  } : function (object, key, value) {
30374
30351
  object[key] = value;
@@ -30449,20 +30426,12 @@ var _cof = function (it) {
30449
30426
  return toString$6.call(it).slice(8, -1);
30450
30427
  };
30451
30428
 
30452
- var _iobject;
30453
- var hasRequired_iobject;
30454
-
30455
- function require_iobject () {
30456
- if (hasRequired_iobject) return _iobject;
30457
- hasRequired_iobject = 1;
30458
- // fallback for non-array-like ES3 and non-enumerable old V8 strings
30459
- var cof = _cof;
30460
- // eslint-disable-next-line no-prototype-builtins
30461
- _iobject = Object('z').propertyIsEnumerable(0) ? Object : function (it) {
30462
- return cof(it) == 'String' ? it.split('') : Object(it);
30463
- };
30464
- return _iobject;
30465
- }
30429
+ // fallback for non-array-like ES3 and non-enumerable old V8 strings
30430
+ var cof$2 = _cof;
30431
+ // eslint-disable-next-line no-prototype-builtins
30432
+ var _iobject = Object('z').propertyIsEnumerable(0) ? Object : function (it) {
30433
+ return cof$2(it) == 'String' ? it.split('') : Object(it);
30434
+ };
30466
30435
 
30467
30436
  // 7.2.1 RequireObjectCoercible(argument)
30468
30437
  var _defined = function (it) {
@@ -30471,7 +30440,7 @@ var _defined = function (it) {
30471
30440
  };
30472
30441
 
30473
30442
  // to indexed object, toObject with fallback for non-array-like ES3 strings
30474
- var IObject = require_iobject();
30443
+ var IObject = _iobject;
30475
30444
  var defined$2 = _defined;
30476
30445
  var _toIobject = function (it) {
30477
30446
  return IObject(defined$2(it));
@@ -30591,14 +30560,7 @@ _objectGops.f = Object.getOwnPropertySymbols;
30591
30560
 
30592
30561
  var _objectPie = {};
30593
30562
 
30594
- var hasRequired_objectPie;
30595
-
30596
- function require_objectPie () {
30597
- if (hasRequired_objectPie) return _objectPie;
30598
- hasRequired_objectPie = 1;
30599
- _objectPie.f = {}.propertyIsEnumerable;
30600
- return _objectPie;
30601
- }
30563
+ _objectPie.f = {}.propertyIsEnumerable;
30602
30564
 
30603
30565
  // 7.1.13 ToObject(argument)
30604
30566
  var defined$1 = _defined;
@@ -30613,12 +30575,12 @@ function require_objectAssign () {
30613
30575
  if (hasRequired_objectAssign) return _objectAssign;
30614
30576
  hasRequired_objectAssign = 1;
30615
30577
  // 19.1.2.1 Object.assign(target, source, ...)
30616
- var DESCRIPTORS = require_descriptors();
30578
+ var DESCRIPTORS = _descriptors;
30617
30579
  var getKeys = _objectKeys;
30618
30580
  var gOPS = _objectGops;
30619
- var pIE = require_objectPie();
30581
+ var pIE = _objectPie;
30620
30582
  var toObject = _toObject;
30621
- var IObject = require_iobject();
30583
+ var IObject = _iobject;
30622
30584
  var $assign = Object.assign;
30623
30585
 
30624
30586
  // should work with symbols and should have deterministic property order (V8 bug)
@@ -30689,11 +30651,11 @@ var _iterators = {};
30689
30651
 
30690
30652
  var _redefine = _hide;
30691
30653
 
30692
- var dP$1 = require_objectDp();
30654
+ var dP$1 = _objectDp;
30693
30655
  var anObject$4 = _anObject;
30694
30656
  var getKeys$1 = _objectKeys;
30695
30657
 
30696
- var _objectDps = require_descriptors() ? Object.defineProperties : function defineProperties(O, Properties) {
30658
+ var _objectDps = _descriptors ? Object.defineProperties : function defineProperties(O, Properties) {
30697
30659
  anObject$4(O);
30698
30660
  var keys = getKeys$1(Properties);
30699
30661
  var length = keys.length;
@@ -30772,7 +30734,7 @@ $exports.store = store$2;
30772
30734
 
30773
30735
  var _wksExports = _wks.exports;
30774
30736
 
30775
- var def = require_objectDp().f;
30737
+ var def = _objectDp.f;
30776
30738
  var has$c = _has;
30777
30739
  var TAG$1 = _wksExports('toStringTag');
30778
30740
 
@@ -31086,7 +31048,7 @@ var _isArrayIter = function (it) {
31086
31048
  return it !== undefined && (Iterators.Array === it || ArrayProto[ITERATOR] === it);
31087
31049
  };
31088
31050
 
31089
- var $defineProperty$2 = require_objectDp();
31051
+ var $defineProperty$2 = _objectDp;
31090
31052
  var createDesc$2 = _propertyDesc;
31091
31053
 
31092
31054
  var _createProperty = function (object, index, value) {
@@ -31219,7 +31181,7 @@ var _default$9 = function (instance, Constructor) {
31219
31181
 
31220
31182
  var $export$3 = _export;
31221
31183
  // 19.1.2.4 / 15.2.3.6 Object.defineProperty(O, P, Attributes)
31222
- $export$3($export$3.S + $export$3.F * !require_descriptors(), 'Object', { defineProperty: require_objectDp().f });
31184
+ $export$3($export$3.S + $export$3.F * !_descriptors, 'Object', { defineProperty: _objectDp.f });
31223
31185
 
31224
31186
  var $Object$2 = _coreExports.Object;
31225
31187
  var defineProperty$c = function defineProperty(it, key, desc) {
@@ -31267,7 +31229,7 @@ var _meta = {exports: {}};
31267
31229
  var META$1 = _uid('meta');
31268
31230
  var isObject$c = _isObject;
31269
31231
  var has$a = _has;
31270
- var setDesc = require_objectDp().f;
31232
+ var setDesc = _objectDp.f;
31271
31233
  var id$1 = 0;
31272
31234
  var isExtensible = Object.isExtensible || function () {
31273
31235
  return true;
@@ -31322,7 +31284,7 @@ var _metaExports = _meta.exports;
31322
31284
 
31323
31285
  var core = _coreExports;
31324
31286
  var wksExt$1 = _wksExt;
31325
- var defineProperty$a = require_objectDp().f;
31287
+ var defineProperty$a = _objectDp.f;
31326
31288
  var _wksDefine = function (name) {
31327
31289
  var $Symbol = core.Symbol || (core.Symbol = {} );
31328
31290
  if (name.charAt(0) != '_' && !(name in $Symbol)) defineProperty$a($Symbol, name, { value: wksExt$1.f(name) });
@@ -31331,7 +31293,7 @@ var _wksDefine = function (name) {
31331
31293
  // all enumerable object keys, includes symbols
31332
31294
  var getKeys = _objectKeys;
31333
31295
  var gOPS$1 = _objectGops;
31334
- var pIE$1 = require_objectPie();
31296
+ var pIE$1 = _objectPie;
31335
31297
  var _enumKeys = function (it) {
31336
31298
  var result = getKeys(it);
31337
31299
  var getSymbols = gOPS$1.f;
@@ -31384,15 +31346,15 @@ _objectGopnExt.f = function getOwnPropertyNames(it) {
31384
31346
 
31385
31347
  var _objectGopd = {};
31386
31348
 
31387
- var pIE = require_objectPie();
31349
+ var pIE = _objectPie;
31388
31350
  var createDesc$1 = _propertyDesc;
31389
31351
  var toIObject$1 = _toIobject;
31390
31352
  var toPrimitive$1 = _toPrimitive$1;
31391
31353
  var has$9 = _has;
31392
- var IE8_DOM_DEFINE = require_ie8DomDefine();
31354
+ var IE8_DOM_DEFINE = _ie8DomDefine;
31393
31355
  var gOPD$5 = Object.getOwnPropertyDescriptor;
31394
31356
 
31395
- _objectGopd.f = require_descriptors() ? gOPD$5 : function getOwnPropertyDescriptor(O, P) {
31357
+ _objectGopd.f = _descriptors ? gOPD$5 : function getOwnPropertyDescriptor(O, P) {
31396
31358
  O = toIObject$1(O);
31397
31359
  P = toPrimitive$1(P, true);
31398
31360
  if (IE8_DOM_DEFINE) try {
@@ -31404,7 +31366,7 @@ _objectGopd.f = require_descriptors() ? gOPD$5 : function getOwnPropertyDescript
31404
31366
  // ECMAScript 6 symbols shim
31405
31367
  var global$2 = _globalExports;
31406
31368
  var has$8 = _has;
31407
- var DESCRIPTORS = require_descriptors();
31369
+ var DESCRIPTORS = _descriptors;
31408
31370
  var $export$2 = _export;
31409
31371
  var redefine = _redefine;
31410
31372
  var META = _metaExports.KEY;
@@ -31427,7 +31389,7 @@ var _create$1 = _objectCreate;
31427
31389
  var gOPNExt = _objectGopnExt;
31428
31390
  var $GOPD = _objectGopd;
31429
31391
  var $GOPS = _objectGops;
31430
- var $DP = require_objectDp();
31392
+ var $DP = _objectDp;
31431
31393
  var $keys$1 = _objectKeys;
31432
31394
  var gOPD$4 = $GOPD.f;
31433
31395
  var dP = $DP.f;
@@ -31552,7 +31514,7 @@ if (!USE_NATIVE) {
31552
31514
  $GOPD.f = $getOwnPropertyDescriptor;
31553
31515
  $DP.f = $defineProperty$1;
31554
31516
  _objectGopn.f = gOPNExt.f = $getOwnPropertyNames;
31555
- require_objectPie().f = $propertyIsEnumerable;
31517
+ _objectPie.f = $propertyIsEnumerable;
31556
31518
  $GOPS.f = $getOwnPropertySymbols;
31557
31519
 
31558
31520
  if (DESCRIPTORS && !_library) {
@@ -92038,6 +92000,8 @@ const PreviewCsvData = observer(function(props) {
92038
92000
  userSchema = exampleData,
92039
92001
  initialEntities
92040
92002
  } = props;
92003
+ const rerenderKey = React$3.useRef(0);
92004
+ rerenderKey.current = rerenderKey.current + 1;
92041
92005
  const data = userSchema.userData && userSchema.userData.length && userSchema.userData.map((row) => {
92042
92006
  const toRet = {
92043
92007
  _isClean: row._isClean
@@ -92084,6 +92048,7 @@ const PreviewCsvData = observer(function(props) {
92084
92048
  {
92085
92049
  maxWidth: 800,
92086
92050
  maxHeight: 500,
92051
+ rerenderKey: rerenderKey.current,
92087
92052
  destroyOnUnmount: false,
92088
92053
  doNotValidateUntouchedRows: true,
92089
92054
  formName: datatableFormName || "editableCellTable",
@@ -113826,9 +113791,9 @@ function coerceLocation({
113826
113791
  function filterAminoAcidSequenceString(sequenceString, options) {
113827
113792
  options = options || {};
113828
113793
  if (options.includeStopCodon) {
113829
- return sequenceString.replace(/[^xtgalmfwkqespvicyhrndu.*]/gi, "");
113794
+ return sequenceString?.replace(/[^xtgalmfwkqespvicyhrndu.*]/gi, "");
113830
113795
  }
113831
- return sequenceString.replace(/[^xtgalmfwkqespvicyhrndu]/gi, "");
113796
+ return sequenceString?.replace(/[^xtgalmfwkqespvicyhrndu]/gi, "");
113832
113797
  }
113833
113798
 
113834
113799
  function getDegenerateDnaStringFromAAString(aaString) {
@@ -161174,7 +161139,7 @@ function showFileDialog({ multiple = false, onSelect }) {
161174
161139
  }
161175
161140
 
161176
161141
  const name = "@teselagen/ove";
161177
- const version = "0.3.11";
161142
+ const version = "0.3.12";
161178
161143
  const main = "./src/index.js";
161179
161144
  const exports$1 = {
161180
161145
  ".": {
@@ -161716,6 +161681,184 @@ function ToggleShowMeltingTemp(props) {
161716
161681
  );
161717
161682
  }
161718
161683
 
161684
+ const style$i = '';
161685
+
161686
+ class ToolbarItem extends React$3.Component {
161687
+ toggleDropdown = ({ forceClose } = {}) => {
161688
+ const { toolName, isOpen } = this.props;
161689
+ this.props.openToolbarItemUpdate(isOpen || forceClose ? "" : toolName);
161690
+ };
161691
+ render() {
161692
+ const { overrides = {} } = this.props;
161693
+ const {
161694
+ isOpen,
161695
+ index,
161696
+ Icon,
161697
+ // dynamicIcon,
161698
+ onIconClick = lodashExports.noop,
161699
+ tooltip = "",
161700
+ tooltipToggled,
161701
+ dropdowntooltip = "",
161702
+ Dropdown,
161703
+ disabled,
161704
+ isHidden,
161705
+ renderIconAbove,
161706
+ noDropdownIcon,
161707
+ IconWrapper,
161708
+ editorName,
161709
+ popoverDisabled,
161710
+ IconWrapperProps,
161711
+ toolName,
161712
+ dropdownicon,
161713
+ tooltipDisabled,
161714
+ toggled = false,
161715
+ ...rest
161716
+ } = { ...this.props, ...overrides };
161717
+ if (!toolName)
161718
+ console.warn("toolName is required!");
161719
+ if (isHidden)
161720
+ return null;
161721
+ let tooltipToDisplay = tooltip;
161722
+ if (toggled && tooltipToggled) {
161723
+ tooltipToDisplay = tooltipToggled;
161724
+ }
161725
+ const buttonTarget = /* @__PURE__ */ React$3.createElement(
161726
+ "div",
161727
+ {
161728
+ className: `veToolbarItemOuter ve-tool-container-${toolName}` + (disabled ? " disabled " : "")
161729
+ },
161730
+ renderIconAbove && /* @__PURE__ */ React$3.createElement("div", null, /* @__PURE__ */ React$3.createElement("div", { className: "veToolbarItem" }, Icon)),
161731
+ Icon && !renderIconAbove && /* @__PURE__ */ React$3.createElement(
161732
+ core$5.Tooltip,
161733
+ {
161734
+ disabled: tooltipDisabled,
161735
+ portalClassName: "ve-toolbar-item-popover",
161736
+ content: tooltipToDisplay
161737
+ },
161738
+ /* @__PURE__ */ React$3.createElement(
161739
+ core$5.AnchorButton,
161740
+ {
161741
+ intent: core$5.Intent.PRIMARY,
161742
+ onClick: onIconClick === "toggleDropdown" ? this.toggleDropdown : onIconClick,
161743
+ active: toggled,
161744
+ disabled,
161745
+ minimal: true,
161746
+ icon: React$3.isValidElement(Icon) ? Icon : /* @__PURE__ */ React$3.createElement(Icon, { toggleDropdown: this.toggleDropdown })
161747
+ }
161748
+ )
161749
+ ),
161750
+ Dropdown && !noDropdownIcon ? /* @__PURE__ */ React$3.createElement(core$5.Tooltip, { disabled: tooltipDisabled, content: dropdowntooltip }, /* @__PURE__ */ React$3.createElement(
161751
+ "div",
161752
+ {
161753
+ className: (isOpen ? " isOpen " : "") + (dropdownicon ? "" : " veToolbarDropdown"),
161754
+ onClick: this.toggleDropdown
161755
+ },
161756
+ dropdownicon ? /* @__PURE__ */ React$3.createElement("div", { className: "veToolbarIcon" }, /* @__PURE__ */ React$3.createElement("div", null, dropdownicon)) : isOpen ? /* @__PURE__ */ React$3.createElement(
161757
+ core$5.Icon,
161758
+ {
161759
+ "data-test": toolName + "Dropdown",
161760
+ iconSize: 13,
161761
+ icon: "caret-up"
161762
+ }
161763
+ ) : /* @__PURE__ */ React$3.createElement(
161764
+ core$5.Icon,
161765
+ {
161766
+ "data-test": toolName + "Dropdown",
161767
+ iconSize: 13,
161768
+ icon: "caret-down"
161769
+ }
161770
+ )
161771
+ )) : null
161772
+ );
161773
+ const content = /* @__PURE__ */ React$3.createElement(
161774
+ "div",
161775
+ {
161776
+ ref: (n) => {
161777
+ if (n)
161778
+ this.dropdownNode = n;
161779
+ },
161780
+ style: { padding: 10, minWidth: 250, maxWidth: 350 },
161781
+ className: "ve-toolbar-dropdown content"
161782
+ },
161783
+ Dropdown && /* @__PURE__ */ React$3.createElement(
161784
+ Dropdown,
161785
+ {
161786
+ ...rest,
161787
+ editorName,
161788
+ toggleDropdown: this.toggleDropdown
161789
+ }
161790
+ )
161791
+ );
161792
+ 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;
161793
+ return /* @__PURE__ */ React$3.createElement("div", { style: { display: "flex", alignItems: "center" } }, index !== 0 && /* @__PURE__ */ React$3.createElement("div", { className: "veToolbarSpacer" }), /* @__PURE__ */ React$3.createElement(
161794
+ core$5.Popover,
161795
+ {
161796
+ disabled: popoverDisabled,
161797
+ isOpen: !!Dropdown && isOpen,
161798
+ onClose: (e) => {
161799
+ let srcElement;
161800
+ if (e) {
161801
+ srcElement = e.srcElement || e.target;
161802
+ }
161803
+ if (e && srcElement && this.dropdownNode && (this.dropdownNode.contains(srcElement) || !document.body.contains(srcElement))) {
161804
+ return;
161805
+ }
161806
+ this.toggleDropdown({ forceClose: true });
161807
+ },
161808
+ canEscapeKeyClose: true,
161809
+ minimal: true,
161810
+ position: core$5.Position.BOTTOM,
161811
+ target,
161812
+ content
161813
+ }
161814
+ ));
161815
+ }
161816
+ }
161817
+ const ToolbarItem$1 = connectToEditor(({ toolBar = {} }, { toolName }) => ({
161818
+ isOpen: toolBar.openItem === toolName
161819
+ }))(ToolbarItem);
161820
+
161821
+ const editTool = connectToEditor((editorState) => {
161822
+ return {
161823
+ readOnly: editorState.readOnly
161824
+ };
161825
+ })((props) => {
161826
+ const { toolbarItemProps, readOnly, disableSetReadOnly } = props;
161827
+ const [isLoading, setIsLoading] = React$3.useState(false);
161828
+ const readOnlyTooltip = ({ readOnly: readOnly2, disableSetReadOnly: disableSetReadOnly2 }) => {
161829
+ if (isLoading) {
161830
+ return "Loading...";
161831
+ } else if (disableSetReadOnly2) {
161832
+ return "You do not have permission to edit locks on this sequence";
161833
+ }
161834
+ return readOnly2 ? "Click to enable editing" : "Click to disable editing";
161835
+ };
161836
+ return /* @__PURE__ */ React$3.createElement(
161837
+ ToolbarItem$1,
161838
+ {
161839
+ ...{
161840
+ disabled: isLoading || disableSetReadOnly,
161841
+ Icon: /* @__PURE__ */ React$3.createElement(core$5.Icon, { icon: readOnly ? "lock" : "unlock" }),
161842
+ onIconClick: () => handleReadOnlyChange(!readOnly, { ...props, setIsLoading }),
161843
+ tooltip: readOnlyTooltip({ readOnly, disableSetReadOnly }),
161844
+ ...toolbarItemProps
161845
+ }
161846
+ }
161847
+ );
161848
+ });
161849
+ async function handleReadOnlyChange(newVal, { beforeReadOnlyChange, updateReadOnlyMode, setIsLoading = () => {
161850
+ } }) {
161851
+ if (beforeReadOnlyChange) {
161852
+ setIsLoading(true);
161853
+ const shouldChange = await beforeReadOnlyChange(newVal);
161854
+ setIsLoading(false);
161855
+ if (shouldChange === false) {
161856
+ return;
161857
+ }
161858
+ }
161859
+ updateReadOnlyMode(newVal);
161860
+ }
161861
+
161719
161862
  const isProtein = (props) => props.sequenceData && props.sequenceData.isProtein;
161720
161863
  const isOligo = (props) => props.sequenceData && props.sequenceData.isOligo;
161721
161864
  const isRna = (props) => props.sequenceData && props.sequenceData.isRna;
@@ -161799,7 +161942,7 @@ const fileCommandDefs = {
161799
161942
  isDisabled: (props) => props.disableSetReadOnly || !props.onSave,
161800
161943
  isHidden: (props) => !props.toggleReadOnlyMode,
161801
161944
  isActive: (props) => props.readOnly,
161802
- handler: (props) => props.toggleReadOnlyMode()
161945
+ handler: (props) => handleReadOnlyChange(!props.readOnly, props)
161803
161946
  },
161804
161947
  importSequence: {
161805
161948
  isHidden: (props) => props.hideSingleImport,
@@ -167684,7 +167827,7 @@ function getEditDeleteHandlers(type, annotation) {
167684
167827
  ];
167685
167828
  }
167686
167829
 
167687
- const style$i = '';
167830
+ const style$h = '';
167688
167831
 
167689
167832
  function SequenceName({ sequenceName, sequenceLength, isProtein }) {
167690
167833
  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`));
@@ -170070,7 +170213,7 @@ function VisibilityOptions$2({
170070
170213
  );
170071
170214
  }
170072
170215
 
170073
- const style$h = '';
170216
+ const style$g = '';
170074
170217
 
170075
170218
  const simpleDialog = '';
170076
170219
 
@@ -170347,7 +170490,7 @@ function combineLabels(labels, numberOfBuckets) {
170347
170490
  return combinedLabels;
170348
170491
  }
170349
170492
 
170350
- const style$g = '';
170493
+ const style$f = '';
170351
170494
 
170352
170495
  const fontWidthToFontSize = 1.75;
170353
170496
  const getTextLength = (text) => {
@@ -172550,7 +172693,7 @@ function DrawAnnotationInner({
172550
172693
  }
172551
172694
  const DrawAnnotation = withHover(DrawAnnotationInner);
172552
172695
 
172553
- const style$f = '';
172696
+ const style$e = '';
172554
172697
 
172555
172698
  function c(u,e,c){var i=this,a=React$3.useRef(null),o=React$3.useRef(0),f=React$3.useRef(null),l=React$3.useRef([]),m=React$3.useRef(),v=React$3.useRef(),d=React$3.useRef(u),p=React$3.useRef(!0);React$3.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;React$3.useEffect(function(){return p.current=!0,function(){p.current=!1;}},[]);var h=React$3.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}
172556
172699
 
@@ -173483,7 +173626,7 @@ function CircularView(props) {
173483
173626
  }
173484
173627
  const CircularView$1 = withEditorInteractions(CircularView);
173485
173628
 
173486
- const style$e = '';
173629
+ const style$d = '';
173487
173630
 
173488
173631
  class PrintDialog extends React$3.Component {
173489
173632
  state = {
@@ -173964,7 +174107,7 @@ const RemoveDuplicates = redux.compose(
173964
174107
  tgFormValues("ignoreName", "ignoreStrand", "ignoreStartAndEnd")
173965
174108
  )(RemoveDuplicatesDialog);
173966
174109
 
173967
- const style$d = '';
174110
+ const style$c = '';
173968
174111
 
173969
174112
  var isMobile$2 = {exports: {}};
173970
174113
 
@@ -174986,7 +175129,7 @@ const normalizeToInt = (val) => {
174986
175129
  return normalizedVal;
174987
175130
  };
174988
175131
 
174989
- const style$c = '';
175132
+ const style$b = '';
174990
175133
 
174991
175134
  const EnzymeViewer = ({
174992
175135
  extraClasses = "",
@@ -175061,7 +175204,7 @@ const EnzymeViewer = ({
175061
175204
  );
175062
175205
  };
175063
175206
 
175064
- const style$b = '';
175207
+ const style$a = '';
175065
175208
 
175066
175209
  const upsertLocalEnzymeGroups = (newGroups) => {
175067
175210
  const existingGroups = window.getExistingEnzymeGroups();
@@ -175757,7 +175900,7 @@ const HoverView = view(({ allEnzymesByName }) => {
175757
175900
  );
175758
175901
  });
175759
175902
 
175760
- const style$a = '';
175903
+ const style$9 = '';
175761
175904
 
175762
175905
  const CreateCustomEnzyme = function(props) {
175763
175906
  const paddingStart = "-------";
@@ -176582,143 +176725,6 @@ function getIsEnzymeHidden({ name, allRestrictionEnzymes }) {
176582
176725
  return isHidden;
176583
176726
  }
176584
176727
 
176585
- const style$9 = '';
176586
-
176587
- class ToolbarItem extends React$3.Component {
176588
- toggleDropdown = ({ forceClose } = {}) => {
176589
- const { toolName, isOpen } = this.props;
176590
- this.props.openToolbarItemUpdate(isOpen || forceClose ? "" : toolName);
176591
- };
176592
- render() {
176593
- const { overrides = {} } = this.props;
176594
- const {
176595
- isOpen,
176596
- index,
176597
- Icon,
176598
- // dynamicIcon,
176599
- onIconClick = lodashExports.noop,
176600
- tooltip = "",
176601
- tooltipToggled,
176602
- dropdowntooltip = "",
176603
- Dropdown,
176604
- disabled,
176605
- isHidden,
176606
- renderIconAbove,
176607
- noDropdownIcon,
176608
- IconWrapper,
176609
- editorName,
176610
- popoverDisabled,
176611
- IconWrapperProps,
176612
- toolName,
176613
- dropdownicon,
176614
- tooltipDisabled,
176615
- toggled = false,
176616
- ...rest
176617
- } = { ...this.props, ...overrides };
176618
- if (!toolName)
176619
- console.warn("toolName is required!");
176620
- if (isHidden)
176621
- return null;
176622
- let tooltipToDisplay = tooltip;
176623
- if (toggled && tooltipToggled) {
176624
- tooltipToDisplay = tooltipToggled;
176625
- }
176626
- const buttonTarget = /* @__PURE__ */ React$3.createElement(
176627
- "div",
176628
- {
176629
- className: `veToolbarItemOuter ve-tool-container-${toolName}` + (disabled ? " disabled " : "")
176630
- },
176631
- renderIconAbove && /* @__PURE__ */ React$3.createElement("div", null, /* @__PURE__ */ React$3.createElement("div", { className: "veToolbarItem" }, Icon)),
176632
- Icon && !renderIconAbove && /* @__PURE__ */ React$3.createElement(
176633
- core$5.Tooltip,
176634
- {
176635
- disabled: tooltipDisabled,
176636
- portalClassName: "ve-toolbar-item-popover",
176637
- content: tooltipToDisplay
176638
- },
176639
- /* @__PURE__ */ React$3.createElement(
176640
- core$5.AnchorButton,
176641
- {
176642
- intent: core$5.Intent.PRIMARY,
176643
- onClick: onIconClick === "toggleDropdown" ? this.toggleDropdown : onIconClick,
176644
- active: toggled,
176645
- disabled,
176646
- minimal: true,
176647
- icon: React$3.isValidElement(Icon) ? Icon : /* @__PURE__ */ React$3.createElement(Icon, { toggleDropdown: this.toggleDropdown })
176648
- }
176649
- )
176650
- ),
176651
- Dropdown && !noDropdownIcon ? /* @__PURE__ */ React$3.createElement(core$5.Tooltip, { disabled: tooltipDisabled, content: dropdowntooltip }, /* @__PURE__ */ React$3.createElement(
176652
- "div",
176653
- {
176654
- className: (isOpen ? " isOpen " : "") + (dropdownicon ? "" : " veToolbarDropdown"),
176655
- onClick: this.toggleDropdown
176656
- },
176657
- dropdownicon ? /* @__PURE__ */ React$3.createElement("div", { className: "veToolbarIcon" }, /* @__PURE__ */ React$3.createElement("div", null, dropdownicon)) : isOpen ? /* @__PURE__ */ React$3.createElement(
176658
- core$5.Icon,
176659
- {
176660
- "data-test": toolName + "Dropdown",
176661
- iconSize: 13,
176662
- icon: "caret-up"
176663
- }
176664
- ) : /* @__PURE__ */ React$3.createElement(
176665
- core$5.Icon,
176666
- {
176667
- "data-test": toolName + "Dropdown",
176668
- iconSize: 13,
176669
- icon: "caret-down"
176670
- }
176671
- )
176672
- )) : null
176673
- );
176674
- const content = /* @__PURE__ */ React$3.createElement(
176675
- "div",
176676
- {
176677
- ref: (n) => {
176678
- if (n)
176679
- this.dropdownNode = n;
176680
- },
176681
- style: { padding: 10, minWidth: 250, maxWidth: 350 },
176682
- className: "ve-toolbar-dropdown content"
176683
- },
176684
- Dropdown && /* @__PURE__ */ React$3.createElement(
176685
- Dropdown,
176686
- {
176687
- ...rest,
176688
- editorName,
176689
- toggleDropdown: this.toggleDropdown
176690
- }
176691
- )
176692
- );
176693
- 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;
176694
- return /* @__PURE__ */ React$3.createElement("div", { style: { display: "flex", alignItems: "center" } }, index !== 0 && /* @__PURE__ */ React$3.createElement("div", { className: "veToolbarSpacer" }), /* @__PURE__ */ React$3.createElement(
176695
- core$5.Popover,
176696
- {
176697
- disabled: popoverDisabled,
176698
- isOpen: !!Dropdown && isOpen,
176699
- onClose: (e) => {
176700
- let srcElement;
176701
- if (e) {
176702
- srcElement = e.srcElement || e.target;
176703
- }
176704
- if (e && srcElement && this.dropdownNode && (this.dropdownNode.contains(srcElement) || !document.body.contains(srcElement))) {
176705
- return;
176706
- }
176707
- this.toggleDropdown({ forceClose: true });
176708
- },
176709
- canEscapeKeyClose: true,
176710
- minimal: true,
176711
- position: core$5.Position.BOTTOM,
176712
- target,
176713
- content
176714
- }
176715
- ));
176716
- }
176717
- }
176718
- const ToolbarItem$1 = connectToEditor(({ toolBar = {} }, { toolName }) => ({
176719
- isOpen: toolBar.openItem === toolName
176720
- }))(ToolbarItem);
176721
-
176722
176728
  function array_move(arr, old_index, new_index) {
176723
176729
  if (new_index >= arr.length) {
176724
176730
  let k = new_index - arr.length + 1;
@@ -183121,7 +183127,7 @@ function addClickableLabel(toRet, { closeDropDown }) {
183121
183127
  }
183122
183128
 
183123
183129
  const userDefinedHandlersAndOpts = [
183124
- "onChangeEditLock",
183130
+ "beforeReadOnlyChange",
183125
183131
  "defaultLinkedOligoMessage",
183126
183132
  "allowMultipleFeatureDirections",
183127
183133
  "getAdditionalEditAnnotationComps",
@@ -183384,49 +183390,6 @@ const OrfToolDropdown = withEditorProps(
183384
183390
  }
183385
183391
  );
183386
183392
 
183387
- const editTool = connectToEditor((editorState) => {
183388
- return {
183389
- readOnly: editorState.readOnly
183390
- };
183391
- })(
183392
- ({
183393
- toolbarItemProps,
183394
- readOnly,
183395
- toggleReadOnlyMode,
183396
- disableSetReadOnly,
183397
- onChangeEditLock
183398
- }) => {
183399
- const [isLoading, setIsLoading] = React$3.useState(false);
183400
- const readOnlyTooltip = ({ readOnly: readOnly2, disableSetReadOnly: disableSetReadOnly2 }) => {
183401
- if (isLoading) {
183402
- return "Loading...";
183403
- } else if (disableSetReadOnly2) {
183404
- return "You do not have permission to edit locks on this sequence";
183405
- }
183406
- return readOnly2 ? "Click to enable editing" : "Click to disable editing";
183407
- };
183408
- return /* @__PURE__ */ React$3.createElement(
183409
- ToolbarItem$1,
183410
- {
183411
- ...{
183412
- disabled: isLoading || disableSetReadOnly,
183413
- Icon: /* @__PURE__ */ React$3.createElement(core$5.Icon, { icon: readOnly ? "lock" : "unlock" }),
183414
- onIconClick: async () => {
183415
- if (onChangeEditLock) {
183416
- setIsLoading(true);
183417
- await onChangeEditLock(!readOnly);
183418
- setIsLoading(false);
183419
- }
183420
- toggleReadOnlyMode();
183421
- },
183422
- tooltip: readOnlyTooltip({ readOnly, disableSetReadOnly }),
183423
- ...toolbarItemProps
183424
- }
183425
- }
183426
- );
183427
- }
183428
- );
183429
-
183430
183393
  const style$4 = '';
183431
183394
 
183432
183395
  const opts = [
@@ -184047,31 +184010,22 @@ const style$3 = '';
184047
184010
 
184048
184011
  const EditReadOnlyItem = connectToEditor(({ readOnly }) => ({
184049
184012
  readOnly
184050
- }))(
184051
- ({
184052
- onSave,
184053
- readOnly,
184054
- showReadOnly,
184055
- disableSetReadOnly,
184056
- updateReadOnlyMode
184057
- }) => {
184058
- return showReadOnly ? /* @__PURE__ */ React$3.createElement(StatusBarItem, { dataTest: "veStatusBar-readOnly" }, onSave ? /* @__PURE__ */ React$3.createElement(
184059
- core$5.HTMLSelect,
184060
- {
184061
- options: [
184062
- { label: "Read Only", value: "readOnly" },
184063
- { label: "Editable", value: "editable" }
184064
- ],
184065
- disabled: disableSetReadOnly || !onSave,
184066
- className: core$5.Classes.MINIMAL,
184067
- value: readOnly ? "readOnly" : "editable",
184068
- onChange: ({ target: { value } }) => {
184069
- updateReadOnlyMode(value === "readOnly");
184070
- }
184071
- }
184072
- ) : readOnly ? "Read Only" : "Editable") : null;
184073
- }
184074
- );
184013
+ }))((props) => {
184014
+ const { onSave, readOnly, showReadOnly, disableSetReadOnly } = props;
184015
+ return showReadOnly ? /* @__PURE__ */ React$3.createElement(StatusBarItem, { dataTest: "veStatusBar-readOnly" }, onSave ? /* @__PURE__ */ React$3.createElement(
184016
+ core$5.HTMLSelect,
184017
+ {
184018
+ options: [
184019
+ { label: "Read Only", value: "readOnly" },
184020
+ { label: "Editable", value: "editable" }
184021
+ ],
184022
+ disabled: disableSetReadOnly || !onSave,
184023
+ className: core$5.Classes.MINIMAL,
184024
+ value: readOnly ? "readOnly" : "editable",
184025
+ onChange: ({ target: { value } }) => handleReadOnlyChange(value === "readOnly", props)
184026
+ }
184027
+ ) : readOnly ? "Read Only" : "Editable") : null;
184028
+ });
184075
184029
  const ShowSelectionItem = compose(
184076
184030
  connectToEditor(
184077
184031
  ({ selectionLayer, caretPosition, sequenceData = { sequence: "" } }, ownProps, ...rest) => {
@@ -184218,11 +184172,13 @@ function StatusBar({
184218
184172
  showGCContentByDefault,
184219
184173
  onSelectionOrCaretChanged,
184220
184174
  GCDecimalDigits = 1,
184221
- isProtein
184175
+ isProtein,
184176
+ beforeReadOnlyChange
184222
184177
  }) {
184223
184178
  return /* @__PURE__ */ React$3.createElement("div", { className: "veStatusBar" }, showMoleculeType && /* @__PURE__ */ React$3.createElement(ShowTypeItem, { editorName }), /* @__PURE__ */ React$3.createElement(
184224
184179
  EditReadOnlyItem,
184225
184180
  {
184181
+ beforeReadOnlyChange,
184226
184182
  editorName,
184227
184183
  onSave,
184228
184184
  disableSetReadOnly,
@@ -184661,7 +184617,6 @@ class GeneralProperties extends React$3.Component {
184661
184617
  disableSetReadOnly,
184662
184618
  updateAvailability,
184663
184619
  sequenceData,
184664
- updateReadOnlyMode,
184665
184620
  onSave,
184666
184621
  showAvailability,
184667
184622
  sequenceNameUpdate
@@ -184716,10 +184671,9 @@ class GeneralProperties extends React$3.Component {
184716
184671
  ))), /* @__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(
184717
184672
  BPSelect,
184718
184673
  {
184674
+ className: "veReadOnlySelect",
184719
184675
  disabled: !onSave || disableSetReadOnly,
184720
- onChange: (val) => {
184721
- updateReadOnlyMode(val === "readOnly");
184722
- },
184676
+ onChange: (val) => console.log(`val:`, val) || handleReadOnlyChange(val === "readOnly", this.props),
184723
184677
  value: readOnly ? "readOnly" : "editable",
184724
184678
  options: [
184725
184679
  { label: "Read Only", value: "readOnly" },
@@ -194792,7 +194746,7 @@ class Editor extends React$3.Component {
194792
194746
  contentLeft: this.props.contentLeft,
194793
194747
  editorName,
194794
194748
  withDigestTool: true,
194795
- onChangeEditLock: this.props.onChangeEditLock,
194749
+ beforeReadOnlyChange: this.props.beforeReadOnlyChange,
194796
194750
  ...ToolBarProps
194797
194751
  }
194798
194752
  ),