@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.umd.js CHANGED
@@ -23998,7 +23998,7 @@
23998
23998
  var ownKeys$9 = typeof Reflect !== "undefined" && Reflect.ownKeys ? Reflect.ownKeys : hasGetOwnPropertySymbols ? function (obj) {
23999
23999
  return Object.getOwnPropertyNames(obj).concat(Object.getOwnPropertySymbols(obj));
24000
24000
  } : /* istanbul ignore next */Object.getOwnPropertyNames;
24001
- function toPrimitive$3(value) {
24001
+ function toPrimitive$2(value) {
24002
24002
  return value === null ? null : typeof value === "object" ? "" + value : value;
24003
24003
  }
24004
24004
  function hasProp(target, prop) {
@@ -24927,7 +24927,7 @@
24927
24927
  return this.name_ + "[" + this.value_ + "]";
24928
24928
  };
24929
24929
  _proto.valueOf = function valueOf() {
24930
- return toPrimitive$3(this.get());
24930
+ return toPrimitive$2(this.get());
24931
24931
  };
24932
24932
  _proto[_Symbol$toPrimitive] = function () {
24933
24933
  return this.valueOf();
@@ -25155,7 +25155,7 @@
25155
25155
  return this.name_ + "[" + this.derivation.toString() + "]";
25156
25156
  };
25157
25157
  _proto.valueOf = function valueOf() {
25158
- return toPrimitive$3(this.get());
25158
+ return toPrimitive$2(this.get());
25159
25159
  };
25160
25160
  _proto[_Symbol$toPrimitive$1] = function () {
25161
25161
  return this.valueOf();
@@ -57023,10 +57023,18 @@
57023
57023
  }
57024
57024
  };
57025
57025
 
57026
- // Thank's IE8 for his funny defineProperty
57027
- var _descriptors = !_fails(function () {
57028
- return Object.defineProperty({}, 'a', { get: function () { return 7; } }).a != 7;
57029
- });
57026
+ var _descriptors;
57027
+ var hasRequired_descriptors;
57028
+
57029
+ function require_descriptors () {
57030
+ if (hasRequired_descriptors) return _descriptors;
57031
+ hasRequired_descriptors = 1;
57032
+ // Thank's IE8 for his funny defineProperty
57033
+ _descriptors = !_fails(function () {
57034
+ return Object.defineProperty({}, 'a', { get: function () { return 7; } }).a != 7;
57035
+ });
57036
+ return _descriptors;
57037
+ }
57030
57038
 
57031
57039
  var _domCreate;
57032
57040
  var hasRequired_domCreate;
@@ -57044,9 +57052,17 @@
57044
57052
  return _domCreate;
57045
57053
  }
57046
57054
 
57047
- var _ie8DomDefine = !_descriptors && !_fails(function () {
57048
- return Object.defineProperty(require_domCreate()('div'), 'a', { get: function () { return 7; } }).a != 7;
57049
- });
57055
+ var _ie8DomDefine;
57056
+ var hasRequired_ie8DomDefine;
57057
+
57058
+ function require_ie8DomDefine () {
57059
+ if (hasRequired_ie8DomDefine) return _ie8DomDefine;
57060
+ hasRequired_ie8DomDefine = 1;
57061
+ _ie8DomDefine = !require_descriptors() && !_fails(function () {
57062
+ return Object.defineProperty(require_domCreate()('div'), 'a', { get: function () { return 7; } }).a != 7;
57063
+ });
57064
+ return _ie8DomDefine;
57065
+ }
57050
57066
 
57051
57067
  // 7.1.1 ToPrimitive(input [, PreferredType])
57052
57068
  var isObject$6 = _isObject;
@@ -57061,22 +57077,29 @@
57061
57077
  throw TypeError("Can't convert object to primitive value");
57062
57078
  };
57063
57079
 
57064
- var anObject$5 = _anObject;
57065
- var IE8_DOM_DEFINE$1 = _ie8DomDefine;
57066
- var toPrimitive$2 = _toPrimitive$1;
57067
- var dP$3 = Object.defineProperty;
57080
+ var hasRequired_objectDp;
57068
57081
 
57069
- _objectDp.f = _descriptors ? Object.defineProperty : function defineProperty(O, P, Attributes) {
57070
- anObject$5(O);
57071
- P = toPrimitive$2(P, true);
57072
- anObject$5(Attributes);
57073
- if (IE8_DOM_DEFINE$1) try {
57074
- return dP$3(O, P, Attributes);
57075
- } catch (e) { /* empty */ }
57076
- if ('get' in Attributes || 'set' in Attributes) throw TypeError('Accessors not supported!');
57077
- if ('value' in Attributes) O[P] = Attributes.value;
57078
- return O;
57079
- };
57082
+ function require_objectDp () {
57083
+ if (hasRequired_objectDp) return _objectDp;
57084
+ hasRequired_objectDp = 1;
57085
+ var anObject = _anObject;
57086
+ var IE8_DOM_DEFINE = require_ie8DomDefine();
57087
+ var toPrimitive = _toPrimitive$1;
57088
+ var dP = Object.defineProperty;
57089
+
57090
+ _objectDp.f = require_descriptors() ? Object.defineProperty : function defineProperty(O, P, Attributes) {
57091
+ anObject(O);
57092
+ P = toPrimitive(P, true);
57093
+ anObject(Attributes);
57094
+ if (IE8_DOM_DEFINE) try {
57095
+ return dP(O, P, Attributes);
57096
+ } catch (e) { /* empty */ }
57097
+ if ('get' in Attributes || 'set' in Attributes) throw TypeError('Accessors not supported!');
57098
+ if ('value' in Attributes) O[P] = Attributes.value;
57099
+ return O;
57100
+ };
57101
+ return _objectDp;
57102
+ }
57080
57103
 
57081
57104
  var _propertyDesc = function (bitmap, value) {
57082
57105
  return {
@@ -57087,9 +57110,9 @@
57087
57110
  };
57088
57111
  };
57089
57112
 
57090
- var dP$2 = _objectDp;
57113
+ var dP$2 = require_objectDp();
57091
57114
  var createDesc$3 = _propertyDesc;
57092
- var _hide = _descriptors ? function (object, key, value) {
57115
+ var _hide = require_descriptors() ? function (object, key, value) {
57093
57116
  return dP$2.f(object, key, createDesc$3(1, value));
57094
57117
  } : function (object, key, value) {
57095
57118
  object[key] = value;
@@ -57170,12 +57193,20 @@
57170
57193
  return toString$4.call(it).slice(8, -1);
57171
57194
  };
57172
57195
 
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
- };
57196
+ var _iobject;
57197
+ var hasRequired_iobject;
57198
+
57199
+ function require_iobject () {
57200
+ if (hasRequired_iobject) return _iobject;
57201
+ hasRequired_iobject = 1;
57202
+ // fallback for non-array-like ES3 and non-enumerable old V8 strings
57203
+ var cof = _cof;
57204
+ // eslint-disable-next-line no-prototype-builtins
57205
+ _iobject = Object('z').propertyIsEnumerable(0) ? Object : function (it) {
57206
+ return cof(it) == 'String' ? it.split('') : Object(it);
57207
+ };
57208
+ return _iobject;
57209
+ }
57179
57210
 
57180
57211
  // 7.2.1 RequireObjectCoercible(argument)
57181
57212
  var _defined = function (it) {
@@ -57184,7 +57215,7 @@
57184
57215
  };
57185
57216
 
57186
57217
  // to indexed object, toObject with fallback for non-array-like ES3 strings
57187
- var IObject = _iobject;
57218
+ var IObject = require_iobject();
57188
57219
  var defined$2 = _defined;
57189
57220
  var _toIobject = function (it) {
57190
57221
  return IObject(defined$2(it));
@@ -57326,12 +57357,12 @@
57326
57357
  if (hasRequired_objectAssign) return _objectAssign;
57327
57358
  hasRequired_objectAssign = 1;
57328
57359
  // 19.1.2.1 Object.assign(target, source, ...)
57329
- var DESCRIPTORS = _descriptors;
57360
+ var DESCRIPTORS = require_descriptors();
57330
57361
  var getKeys = _objectKeys;
57331
57362
  var gOPS = _objectGops;
57332
57363
  var pIE = require_objectPie();
57333
57364
  var toObject = _toObject;
57334
- var IObject = _iobject;
57365
+ var IObject = require_iobject();
57335
57366
  var $assign = Object.assign;
57336
57367
 
57337
57368
  // should work with symbols and should have deterministic property order (V8 bug)
@@ -57402,11 +57433,11 @@
57402
57433
 
57403
57434
  var _redefine = _hide;
57404
57435
 
57405
- var dP$1 = _objectDp;
57436
+ var dP$1 = require_objectDp();
57406
57437
  var anObject$4 = _anObject;
57407
57438
  var getKeys$1 = _objectKeys;
57408
57439
 
57409
- var _objectDps = _descriptors ? Object.defineProperties : function defineProperties(O, Properties) {
57440
+ var _objectDps = require_descriptors() ? Object.defineProperties : function defineProperties(O, Properties) {
57410
57441
  anObject$4(O);
57411
57442
  var keys = getKeys$1(Properties);
57412
57443
  var length = keys.length;
@@ -57485,7 +57516,7 @@
57485
57516
 
57486
57517
  var _wksExports = _wks.exports;
57487
57518
 
57488
- var def = _objectDp.f;
57519
+ var def = require_objectDp().f;
57489
57520
  var has$b = _has;
57490
57521
  var TAG$1 = _wksExports('toStringTag');
57491
57522
 
@@ -57799,7 +57830,7 @@
57799
57830
  return it !== undefined && (Iterators.Array === it || ArrayProto[ITERATOR] === it);
57800
57831
  };
57801
57832
 
57802
- var $defineProperty$1 = _objectDp;
57833
+ var $defineProperty$1 = require_objectDp();
57803
57834
  var createDesc$2 = _propertyDesc;
57804
57835
 
57805
57836
  var _createProperty = function (object, index, value) {
@@ -57932,7 +57963,7 @@
57932
57963
 
57933
57964
  var $export$3 = _export;
57934
57965
  // 19.1.2.4 / 15.2.3.6 Object.defineProperty(O, P, Attributes)
57935
- $export$3($export$3.S + $export$3.F * !_descriptors, 'Object', { defineProperty: _objectDp.f });
57966
+ $export$3($export$3.S + $export$3.F * !require_descriptors(), 'Object', { defineProperty: require_objectDp().f });
57936
57967
 
57937
57968
  var $Object$1 = _coreExports.Object;
57938
57969
  var defineProperty$6 = function defineProperty(it, key, desc) {
@@ -57980,7 +58011,7 @@
57980
58011
  var META$1 = _uid('meta');
57981
58012
  var isObject$5 = _isObject;
57982
58013
  var has$9 = _has;
57983
- var setDesc = _objectDp.f;
58014
+ var setDesc = require_objectDp().f;
57984
58015
  var id$1 = 0;
57985
58016
  var isExtensible = Object.isExtensible || function () {
57986
58017
  return true;
@@ -58035,7 +58066,7 @@
58035
58066
 
58036
58067
  var core = _coreExports;
58037
58068
  var wksExt$1 = _wksExt;
58038
- var defineProperty$4 = _objectDp.f;
58069
+ var defineProperty$4 = require_objectDp().f;
58039
58070
  var _wksDefine = function (name) {
58040
58071
  var $Symbol = core.Symbol || (core.Symbol = {} );
58041
58072
  if (name.charAt(0) != '_' && !(name in $Symbol)) defineProperty$4($Symbol, name, { value: wksExt$1.f(name) });
@@ -58102,10 +58133,10 @@
58102
58133
  var toIObject$1 = _toIobject;
58103
58134
  var toPrimitive$1 = _toPrimitive$1;
58104
58135
  var has$8 = _has;
58105
- var IE8_DOM_DEFINE = _ie8DomDefine;
58136
+ var IE8_DOM_DEFINE = require_ie8DomDefine();
58106
58137
  var gOPD$2 = Object.getOwnPropertyDescriptor;
58107
58138
 
58108
- _objectGopd.f = _descriptors ? gOPD$2 : function getOwnPropertyDescriptor(O, P) {
58139
+ _objectGopd.f = require_descriptors() ? gOPD$2 : function getOwnPropertyDescriptor(O, P) {
58109
58140
  O = toIObject$1(O);
58110
58141
  P = toPrimitive$1(P, true);
58111
58142
  if (IE8_DOM_DEFINE) try {
@@ -58117,7 +58148,7 @@
58117
58148
  // ECMAScript 6 symbols shim
58118
58149
  var global$1 = _globalExports;
58119
58150
  var has$7 = _has;
58120
- var DESCRIPTORS = _descriptors;
58151
+ var DESCRIPTORS = require_descriptors();
58121
58152
  var $export$2 = _export;
58122
58153
  var redefine = _redefine;
58123
58154
  var META = _metaExports.KEY;
@@ -58140,7 +58171,7 @@
58140
58171
  var gOPNExt = _objectGopnExt;
58141
58172
  var $GOPD = _objectGopd;
58142
58173
  var $GOPS = _objectGops;
58143
- var $DP = _objectDp;
58174
+ var $DP = require_objectDp();
58144
58175
  var $keys$1 = _objectKeys;
58145
58176
  var gOPD$1 = $GOPD.f;
58146
58177
  var dP = $DP.f;
@@ -120374,6 +120405,8 @@
120374
120405
  userSchema = exampleData,
120375
120406
  initialEntities
120376
120407
  } = props;
120408
+ const rerenderKey = reactExports.useRef(0);
120409
+ rerenderKey.current = rerenderKey.current + 1;
120377
120410
  const data = userSchema.userData && userSchema.userData.length && userSchema.userData.map((row) => {
120378
120411
  const toRet = {
120379
120412
  _isClean: row._isClean
@@ -120420,6 +120453,7 @@
120420
120453
  {
120421
120454
  maxWidth: 800,
120422
120455
  maxHeight: 500,
120456
+ rerenderKey: rerenderKey.current,
120423
120457
  destroyOnUnmount: false,
120424
120458
  doNotValidateUntouchedRows: true,
120425
120459
  formName: datatableFormName || "editableCellTable",
@@ -142151,9 +142185,9 @@
142151
142185
  function filterAminoAcidSequenceString(sequenceString, options) {
142152
142186
  options = options || {};
142153
142187
  if (options.includeStopCodon) {
142154
- return sequenceString.replace(/[^xtgalmfwkqespvicyhrndu.*]/gi, "");
142188
+ return sequenceString?.replace(/[^xtgalmfwkqespvicyhrndu.*]/gi, "");
142155
142189
  }
142156
- return sequenceString.replace(/[^xtgalmfwkqespvicyhrndu]/gi, "");
142190
+ return sequenceString?.replace(/[^xtgalmfwkqespvicyhrndu]/gi, "");
142157
142191
  }
142158
142192
 
142159
142193
  function getDegenerateDnaStringFromAAString(aaString) {
@@ -188727,7 +188761,7 @@ double click --> edit`}`;
188727
188761
  }
188728
188762
 
188729
188763
  const name = "@teselagen/ove";
188730
- const version = "0.3.11";
188764
+ const version = "0.3.12";
188731
188765
  const main = "./src/index.js";
188732
188766
  const exports$1 = {
188733
188767
  ".": {
@@ -189269,6 +189303,184 @@ double click --> edit`}`;
189269
189303
  );
189270
189304
  }
189271
189305
 
189306
+ const style$i = '';
189307
+
189308
+ class ToolbarItem extends React$3.Component {
189309
+ toggleDropdown = ({ forceClose } = {}) => {
189310
+ const { toolName, isOpen } = this.props;
189311
+ this.props.openToolbarItemUpdate(isOpen || forceClose ? "" : toolName);
189312
+ };
189313
+ render() {
189314
+ const { overrides = {} } = this.props;
189315
+ const {
189316
+ isOpen,
189317
+ index,
189318
+ Icon: Icon$1,
189319
+ // dynamicIcon,
189320
+ onIconClick = lodashExports.noop,
189321
+ tooltip = "",
189322
+ tooltipToggled,
189323
+ dropdowntooltip = "",
189324
+ Dropdown,
189325
+ disabled,
189326
+ isHidden,
189327
+ renderIconAbove,
189328
+ noDropdownIcon,
189329
+ IconWrapper,
189330
+ editorName,
189331
+ popoverDisabled,
189332
+ IconWrapperProps,
189333
+ toolName,
189334
+ dropdownicon,
189335
+ tooltipDisabled,
189336
+ toggled = false,
189337
+ ...rest
189338
+ } = { ...this.props, ...overrides };
189339
+ if (!toolName)
189340
+ console.warn("toolName is required!");
189341
+ if (isHidden)
189342
+ return null;
189343
+ let tooltipToDisplay = tooltip;
189344
+ if (toggled && tooltipToggled) {
189345
+ tooltipToDisplay = tooltipToggled;
189346
+ }
189347
+ const buttonTarget = /* @__PURE__ */ React$3.createElement(
189348
+ "div",
189349
+ {
189350
+ className: `veToolbarItemOuter ve-tool-container-${toolName}` + (disabled ? " disabled " : "")
189351
+ },
189352
+ renderIconAbove && /* @__PURE__ */ React$3.createElement("div", null, /* @__PURE__ */ React$3.createElement("div", { className: "veToolbarItem" }, Icon$1)),
189353
+ Icon$1 && !renderIconAbove && /* @__PURE__ */ React$3.createElement(
189354
+ Tooltip,
189355
+ {
189356
+ disabled: tooltipDisabled,
189357
+ portalClassName: "ve-toolbar-item-popover",
189358
+ content: tooltipToDisplay
189359
+ },
189360
+ /* @__PURE__ */ React$3.createElement(
189361
+ AnchorButton,
189362
+ {
189363
+ intent: Intent.PRIMARY,
189364
+ onClick: onIconClick === "toggleDropdown" ? this.toggleDropdown : onIconClick,
189365
+ active: toggled,
189366
+ disabled,
189367
+ minimal: true,
189368
+ icon: React$3.isValidElement(Icon$1) ? Icon$1 : /* @__PURE__ */ React$3.createElement(Icon$1, { toggleDropdown: this.toggleDropdown })
189369
+ }
189370
+ )
189371
+ ),
189372
+ Dropdown && !noDropdownIcon ? /* @__PURE__ */ React$3.createElement(Tooltip, { disabled: tooltipDisabled, content: dropdowntooltip }, /* @__PURE__ */ React$3.createElement(
189373
+ "div",
189374
+ {
189375
+ className: (isOpen ? " isOpen " : "") + (dropdownicon ? "" : " veToolbarDropdown"),
189376
+ onClick: this.toggleDropdown
189377
+ },
189378
+ dropdownicon ? /* @__PURE__ */ React$3.createElement("div", { className: "veToolbarIcon" }, /* @__PURE__ */ React$3.createElement("div", null, dropdownicon)) : isOpen ? /* @__PURE__ */ React$3.createElement(
189379
+ Icon,
189380
+ {
189381
+ "data-test": toolName + "Dropdown",
189382
+ iconSize: 13,
189383
+ icon: "caret-up"
189384
+ }
189385
+ ) : /* @__PURE__ */ React$3.createElement(
189386
+ Icon,
189387
+ {
189388
+ "data-test": toolName + "Dropdown",
189389
+ iconSize: 13,
189390
+ icon: "caret-down"
189391
+ }
189392
+ )
189393
+ )) : null
189394
+ );
189395
+ const content = /* @__PURE__ */ React$3.createElement(
189396
+ "div",
189397
+ {
189398
+ ref: (n) => {
189399
+ if (n)
189400
+ this.dropdownNode = n;
189401
+ },
189402
+ style: { padding: 10, minWidth: 250, maxWidth: 350 },
189403
+ className: "ve-toolbar-dropdown content"
189404
+ },
189405
+ Dropdown && /* @__PURE__ */ React$3.createElement(
189406
+ Dropdown,
189407
+ {
189408
+ ...rest,
189409
+ editorName,
189410
+ toggleDropdown: this.toggleDropdown
189411
+ }
189412
+ )
189413
+ );
189414
+ 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;
189415
+ return /* @__PURE__ */ React$3.createElement("div", { style: { display: "flex", alignItems: "center" } }, index !== 0 && /* @__PURE__ */ React$3.createElement("div", { className: "veToolbarSpacer" }), /* @__PURE__ */ React$3.createElement(
189416
+ Popover,
189417
+ {
189418
+ disabled: popoverDisabled,
189419
+ isOpen: !!Dropdown && isOpen,
189420
+ onClose: (e) => {
189421
+ let srcElement;
189422
+ if (e) {
189423
+ srcElement = e.srcElement || e.target;
189424
+ }
189425
+ if (e && srcElement && this.dropdownNode && (this.dropdownNode.contains(srcElement) || !document.body.contains(srcElement))) {
189426
+ return;
189427
+ }
189428
+ this.toggleDropdown({ forceClose: true });
189429
+ },
189430
+ canEscapeKeyClose: true,
189431
+ minimal: true,
189432
+ position: Position.BOTTOM,
189433
+ target,
189434
+ content
189435
+ }
189436
+ ));
189437
+ }
189438
+ }
189439
+ const ToolbarItem$1 = connectToEditor(({ toolBar = {} }, { toolName }) => ({
189440
+ isOpen: toolBar.openItem === toolName
189441
+ }))(ToolbarItem);
189442
+
189443
+ const editTool = connectToEditor((editorState) => {
189444
+ return {
189445
+ readOnly: editorState.readOnly
189446
+ };
189447
+ })((props) => {
189448
+ const { toolbarItemProps, readOnly, disableSetReadOnly } = props;
189449
+ const [isLoading, setIsLoading] = reactExports.useState(false);
189450
+ const readOnlyTooltip = ({ readOnly: readOnly2, disableSetReadOnly: disableSetReadOnly2 }) => {
189451
+ if (isLoading) {
189452
+ return "Loading...";
189453
+ } else if (disableSetReadOnly2) {
189454
+ return "You do not have permission to edit locks on this sequence";
189455
+ }
189456
+ return readOnly2 ? "Click to enable editing" : "Click to disable editing";
189457
+ };
189458
+ return /* @__PURE__ */ React$3.createElement(
189459
+ ToolbarItem$1,
189460
+ {
189461
+ ...{
189462
+ disabled: isLoading || disableSetReadOnly,
189463
+ Icon: /* @__PURE__ */ React$3.createElement(Icon, { icon: readOnly ? "lock" : "unlock" }),
189464
+ onIconClick: () => handleReadOnlyChange(!readOnly, { ...props, setIsLoading }),
189465
+ tooltip: readOnlyTooltip({ readOnly, disableSetReadOnly }),
189466
+ ...toolbarItemProps
189467
+ }
189468
+ }
189469
+ );
189470
+ });
189471
+ async function handleReadOnlyChange(newVal, { beforeReadOnlyChange, updateReadOnlyMode, setIsLoading = () => {
189472
+ } }) {
189473
+ if (beforeReadOnlyChange) {
189474
+ setIsLoading(true);
189475
+ const shouldChange = await beforeReadOnlyChange(newVal);
189476
+ setIsLoading(false);
189477
+ if (shouldChange === false) {
189478
+ return;
189479
+ }
189480
+ }
189481
+ updateReadOnlyMode(newVal);
189482
+ }
189483
+
189272
189484
  const isProtein = (props) => props.sequenceData && props.sequenceData.isProtein;
189273
189485
  const isOligo = (props) => props.sequenceData && props.sequenceData.isOligo;
189274
189486
  const isRna = (props) => props.sequenceData && props.sequenceData.isRna;
@@ -189352,7 +189564,7 @@ double click --> edit`}`;
189352
189564
  isDisabled: (props) => props.disableSetReadOnly || !props.onSave,
189353
189565
  isHidden: (props) => !props.toggleReadOnlyMode,
189354
189566
  isActive: (props) => props.readOnly,
189355
- handler: (props) => props.toggleReadOnlyMode()
189567
+ handler: (props) => handleReadOnlyChange(!props.readOnly, props)
189356
189568
  },
189357
189569
  importSequence: {
189358
189570
  isHidden: (props) => props.hideSingleImport,
@@ -192621,7 +192833,7 @@ double click --> edit`}`;
192621
192833
  ];
192622
192834
  }
192623
192835
 
192624
- const style$i = '';
192836
+ const style$h = '';
192625
192837
 
192626
192838
  function SequenceName({ sequenceName, sequenceLength, isProtein }) {
192627
192839
  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 +195219,7 @@ double click --> edit`}`;
195007
195219
  );
195008
195220
  }
195009
195221
 
195010
- const style$h = '';
195222
+ const style$g = '';
195011
195223
 
195012
195224
  const simpleDialog = '';
195013
195225
 
@@ -195284,7 +195496,7 @@ double click --> edit`}`;
195284
195496
  return combinedLabels;
195285
195497
  }
195286
195498
 
195287
- const style$g = '';
195499
+ const style$f = '';
195288
195500
 
195289
195501
  const fontWidthToFontSize = 1.75;
195290
195502
  const getTextLength = (text) => {
@@ -197487,7 +197699,7 @@ double click --> edit`}`;
197487
197699
  }
197488
197700
  const DrawAnnotation = withHover(DrawAnnotationInner);
197489
197701
 
197490
- const style$f = '';
197702
+ const style$e = '';
197491
197703
 
197492
197704
  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
197705
 
@@ -198420,7 +198632,7 @@ double click --> edit`}`;
198420
198632
  }
198421
198633
  const CircularView$1 = withEditorInteractions(CircularView);
198422
198634
 
198423
- const style$e = '';
198635
+ const style$d = '';
198424
198636
 
198425
198637
  class PrintDialog extends React$3.Component {
198426
198638
  state = {
@@ -198901,7 +199113,7 @@ double click --> edit`}`;
198901
199113
  tgFormValues("ignoreName", "ignoreStrand", "ignoreStartAndEnd")
198902
199114
  )(RemoveDuplicatesDialog);
198903
199115
 
198904
- const style$d = '';
199116
+ const style$c = '';
198905
199117
 
198906
199118
  var isMobile$2 = {exports: {}};
198907
199119
 
@@ -199923,7 +200135,7 @@ double click --> edit`}`;
199923
200135
  return normalizedVal;
199924
200136
  };
199925
200137
 
199926
- const style$c = '';
200138
+ const style$b = '';
199927
200139
 
199928
200140
  const EnzymeViewer = ({
199929
200141
  extraClasses = "",
@@ -199998,7 +200210,7 @@ double click --> edit`}`;
199998
200210
  );
199999
200211
  };
200000
200212
 
200001
- const style$b = '';
200213
+ const style$a = '';
200002
200214
 
200003
200215
  const upsertLocalEnzymeGroups = (newGroups) => {
200004
200216
  const existingGroups = window.getExistingEnzymeGroups();
@@ -200694,7 +200906,7 @@ double click --> edit`}`;
200694
200906
  );
200695
200907
  });
200696
200908
 
200697
- const style$a = '';
200909
+ const style$9 = '';
200698
200910
 
200699
200911
  const CreateCustomEnzyme = function(props) {
200700
200912
  const paddingStart = "-------";
@@ -201519,143 +201731,6 @@ double click --> edit`}`;
201519
201731
  return isHidden;
201520
201732
  }
201521
201733
 
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
201734
  function array_move(arr, old_index, new_index) {
201660
201735
  if (new_index >= arr.length) {
201661
201736
  let k = new_index - arr.length + 1;
@@ -207131,7 +207206,7 @@ ${seqDataToCopy}\r
207131
207206
  }
207132
207207
 
207133
207208
  const userDefinedHandlersAndOpts = [
207134
- "onChangeEditLock",
207209
+ "beforeReadOnlyChange",
207135
207210
  "defaultLinkedOligoMessage",
207136
207211
  "allowMultipleFeatureDirections",
207137
207212
  "getAdditionalEditAnnotationComps",
@@ -207394,49 +207469,6 @@ ${seqDataToCopy}\r
207394
207469
  }
207395
207470
  );
207396
207471
 
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
207472
  const style$4 = '';
207441
207473
 
207442
207474
  const opts = [
@@ -208057,31 +208089,22 @@ ${seqDataToCopy}\r
208057
208089
 
208058
208090
  const EditReadOnlyItem = connectToEditor(({ readOnly }) => ({
208059
208091
  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
- );
208092
+ }))((props) => {
208093
+ const { onSave, readOnly, showReadOnly, disableSetReadOnly } = props;
208094
+ return showReadOnly ? /* @__PURE__ */ React$3.createElement(StatusBarItem, { dataTest: "veStatusBar-readOnly" }, onSave ? /* @__PURE__ */ React$3.createElement(
208095
+ HTMLSelect,
208096
+ {
208097
+ options: [
208098
+ { label: "Read Only", value: "readOnly" },
208099
+ { label: "Editable", value: "editable" }
208100
+ ],
208101
+ disabled: disableSetReadOnly || !onSave,
208102
+ className: MINIMAL,
208103
+ value: readOnly ? "readOnly" : "editable",
208104
+ onChange: ({ target: { value } }) => handleReadOnlyChange(value === "readOnly", props)
208105
+ }
208106
+ ) : readOnly ? "Read Only" : "Editable") : null;
208107
+ });
208085
208108
  const ShowSelectionItem = compose(
208086
208109
  connectToEditor(
208087
208110
  ({ selectionLayer, caretPosition, sequenceData = { sequence: "" } }, ownProps, ...rest) => {
@@ -208228,11 +208251,13 @@ ${seqDataToCopy}\r
208228
208251
  showGCContentByDefault,
208229
208252
  onSelectionOrCaretChanged,
208230
208253
  GCDecimalDigits = 1,
208231
- isProtein
208254
+ isProtein,
208255
+ beforeReadOnlyChange
208232
208256
  }) {
208233
208257
  return /* @__PURE__ */ React$3.createElement("div", { className: "veStatusBar" }, showMoleculeType && /* @__PURE__ */ React$3.createElement(ShowTypeItem, { editorName }), /* @__PURE__ */ React$3.createElement(
208234
208258
  EditReadOnlyItem,
208235
208259
  {
208260
+ beforeReadOnlyChange,
208236
208261
  editorName,
208237
208262
  onSave,
208238
208263
  disableSetReadOnly,
@@ -208671,7 +208696,6 @@ ${seqDataToCopy}\r
208671
208696
  disableSetReadOnly,
208672
208697
  updateAvailability,
208673
208698
  sequenceData,
208674
- updateReadOnlyMode,
208675
208699
  onSave,
208676
208700
  showAvailability,
208677
208701
  sequenceNameUpdate
@@ -208726,10 +208750,9 @@ ${seqDataToCopy}\r
208726
208750
  ))), /* @__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
208751
  BPSelect,
208728
208752
  {
208753
+ className: "veReadOnlySelect",
208729
208754
  disabled: !onSave || disableSetReadOnly,
208730
- onChange: (val) => {
208731
- updateReadOnlyMode(val === "readOnly");
208732
- },
208755
+ onChange: (val) => console.log(`val:`, val) || handleReadOnlyChange(val === "readOnly", this.props),
208733
208756
  value: readOnly ? "readOnly" : "editable",
208734
208757
  options: [
208735
208758
  { label: "Read Only", value: "readOnly" },
@@ -218802,7 +218825,7 @@ ${seqDataToCopy}\r
218802
218825
  contentLeft: this.props.contentLeft,
218803
218826
  editorName,
218804
218827
  withDigestTool: true,
218805
- onChangeEditLock: this.props.onChangeEditLock,
218828
+ beforeReadOnlyChange: this.props.beforeReadOnlyChange,
218806
218829
  ...ToolBarProps
218807
218830
  }
218808
218831
  ),