@teselagen/ove 0.5.3 → 0.5.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.umd.js CHANGED
@@ -10047,7 +10047,7 @@ var __async = (__this, __arguments, generator) => {
10047
10047
  }, _typeof$7(o2);
10048
10048
  }
10049
10049
  __name(_typeof$7, "_typeof$7");
10050
- function toPrimitive$4(t2, r2) {
10050
+ function toPrimitive$3(t2, r2) {
10051
10051
  if ("object" != _typeof$7(t2) || !t2)
10052
10052
  return t2;
10053
10053
  var e2 = t2[Symbol.toPrimitive];
@@ -10059,9 +10059,9 @@ var __async = (__this, __arguments, generator) => {
10059
10059
  }
10060
10060
  return ("string" === r2 ? String : Number)(t2);
10061
10061
  }
10062
- __name(toPrimitive$4, "toPrimitive$4");
10062
+ __name(toPrimitive$3, "toPrimitive$3");
10063
10063
  function toPropertyKey(t2) {
10064
- var i2 = toPrimitive$4(t2, "string");
10064
+ var i2 = toPrimitive$3(t2, "string");
10065
10065
  return "symbol" == _typeof$7(i2) ? i2 : String(i2);
10066
10066
  }
10067
10067
  __name(toPropertyKey, "toPropertyKey");
@@ -26006,10 +26006,10 @@ var __async = (__this, __arguments, generator) => {
26006
26006
  /* istanbul ignore next */
26007
26007
  Object.getOwnPropertyNames
26008
26008
  );
26009
- function toPrimitive$3(value) {
26009
+ function toPrimitive$2(value) {
26010
26010
  return value === null ? null : typeof value === "object" ? "" + value : value;
26011
26011
  }
26012
- __name(toPrimitive$3, "toPrimitive$3");
26012
+ __name(toPrimitive$2, "toPrimitive$2");
26013
26013
  function hasProp(target, prop2) {
26014
26014
  return objectPrototype$2.hasOwnProperty.call(target, prop2);
26015
26015
  }
@@ -27028,7 +27028,7 @@ var __async = (__this, __arguments, generator) => {
27028
27028
  return this.name_ + "[" + this.value_ + "]";
27029
27029
  }, "toString2");
27030
27030
  _proto.valueOf = /* @__PURE__ */ __name(function valueOf() {
27031
- return toPrimitive$3(this.get());
27031
+ return toPrimitive$2(this.get());
27032
27032
  }, "valueOf");
27033
27033
  _proto[_Symbol$toPrimitive] = function() {
27034
27034
  return this.valueOf();
@@ -27213,7 +27213,7 @@ var __async = (__this, __arguments, generator) => {
27213
27213
  return this.name_ + "[" + this.derivation.toString() + "]";
27214
27214
  }, "toString2");
27215
27215
  _proto.valueOf = /* @__PURE__ */ __name(function valueOf() {
27216
- return toPrimitive$3(this.get());
27216
+ return toPrimitive$2(this.get());
27217
27217
  }, "valueOf");
27218
27218
  _proto[_Symbol$toPrimitive$1] = function() {
27219
27219
  return this.valueOf();
@@ -43782,11 +43782,20 @@ ${latestSubscriptionCallbackError.current.stack}
43782
43782
  return true;
43783
43783
  }
43784
43784
  }, "_fails");
43785
- var _descriptors = !_fails(function() {
43786
- return Object.defineProperty({}, "a", { get: function() {
43787
- return 7;
43788
- } }).a != 7;
43789
- });
43785
+ var _descriptors;
43786
+ var hasRequired_descriptors;
43787
+ function require_descriptors() {
43788
+ if (hasRequired_descriptors)
43789
+ return _descriptors;
43790
+ hasRequired_descriptors = 1;
43791
+ _descriptors = !_fails(function() {
43792
+ return Object.defineProperty({}, "a", { get: function() {
43793
+ return 7;
43794
+ } }).a != 7;
43795
+ });
43796
+ return _descriptors;
43797
+ }
43798
+ __name(require_descriptors, "require_descriptors");
43790
43799
  var _domCreate;
43791
43800
  var hasRequired_domCreate;
43792
43801
  function require_domCreate() {
@@ -43802,11 +43811,20 @@ ${latestSubscriptionCallbackError.current.stack}
43802
43811
  return _domCreate;
43803
43812
  }
43804
43813
  __name(require_domCreate, "require_domCreate");
43805
- var _ie8DomDefine = !_descriptors && !_fails(function() {
43806
- return Object.defineProperty(require_domCreate()("div"), "a", { get: function() {
43807
- return 7;
43808
- } }).a != 7;
43809
- });
43814
+ var _ie8DomDefine;
43815
+ var hasRequired_ie8DomDefine;
43816
+ function require_ie8DomDefine() {
43817
+ if (hasRequired_ie8DomDefine)
43818
+ return _ie8DomDefine;
43819
+ hasRequired_ie8DomDefine = 1;
43820
+ _ie8DomDefine = !require_descriptors() && !_fails(function() {
43821
+ return Object.defineProperty(require_domCreate()("div"), "a", { get: function() {
43822
+ return 7;
43823
+ } }).a != 7;
43824
+ });
43825
+ return _ie8DomDefine;
43826
+ }
43827
+ __name(require_ie8DomDefine, "require_ie8DomDefine");
43810
43828
  var isObject$6 = _isObject;
43811
43829
  var _toPrimitive$1 = /* @__PURE__ */ __name(function(it, S2) {
43812
43830
  if (!isObject$6(it))
@@ -43820,25 +43838,33 @@ ${latestSubscriptionCallbackError.current.stack}
43820
43838
  return val2;
43821
43839
  throw TypeError("Can't convert object to primitive value");
43822
43840
  }, "_toPrimitive$1");
43823
- var anObject$5 = _anObject;
43824
- var IE8_DOM_DEFINE$1 = _ie8DomDefine;
43825
- var toPrimitive$2 = _toPrimitive$1;
43826
- var dP$3 = Object.defineProperty;
43827
- _objectDp.f = _descriptors ? Object.defineProperty : /* @__PURE__ */ __name(function defineProperty2(O2, P2, Attributes) {
43828
- anObject$5(O2);
43829
- P2 = toPrimitive$2(P2, true);
43830
- anObject$5(Attributes);
43831
- if (IE8_DOM_DEFINE$1)
43832
- try {
43833
- return dP$3(O2, P2, Attributes);
43834
- } catch (e2) {
43835
- }
43836
- if ("get" in Attributes || "set" in Attributes)
43837
- throw TypeError("Accessors not supported!");
43838
- if ("value" in Attributes)
43839
- O2[P2] = Attributes.value;
43840
- return O2;
43841
- }, "defineProperty");
43841
+ var hasRequired_objectDp;
43842
+ function require_objectDp() {
43843
+ if (hasRequired_objectDp)
43844
+ return _objectDp;
43845
+ hasRequired_objectDp = 1;
43846
+ var anObject2 = _anObject;
43847
+ var IE8_DOM_DEFINE2 = require_ie8DomDefine();
43848
+ var toPrimitive2 = _toPrimitive$1;
43849
+ var dP2 = Object.defineProperty;
43850
+ _objectDp.f = require_descriptors() ? Object.defineProperty : /* @__PURE__ */ __name(function defineProperty2(O2, P2, Attributes) {
43851
+ anObject2(O2);
43852
+ P2 = toPrimitive2(P2, true);
43853
+ anObject2(Attributes);
43854
+ if (IE8_DOM_DEFINE2)
43855
+ try {
43856
+ return dP2(O2, P2, Attributes);
43857
+ } catch (e2) {
43858
+ }
43859
+ if ("get" in Attributes || "set" in Attributes)
43860
+ throw TypeError("Accessors not supported!");
43861
+ if ("value" in Attributes)
43862
+ O2[P2] = Attributes.value;
43863
+ return O2;
43864
+ }, "defineProperty");
43865
+ return _objectDp;
43866
+ }
43867
+ __name(require_objectDp, "require_objectDp");
43842
43868
  var _propertyDesc = /* @__PURE__ */ __name(function(bitmap, value) {
43843
43869
  return {
43844
43870
  enumerable: !(bitmap & 1),
@@ -43847,9 +43873,9 @@ ${latestSubscriptionCallbackError.current.stack}
43847
43873
  value
43848
43874
  };
43849
43875
  }, "_propertyDesc");
43850
- var dP$2 = _objectDp;
43876
+ var dP$2 = require_objectDp();
43851
43877
  var createDesc$3 = _propertyDesc;
43852
- var _hide = _descriptors ? function(object2, key2, value) {
43878
+ var _hide = require_descriptors() ? function(object2, key2, value) {
43853
43879
  return dP$2.f(object2, key2, createDesc$3(1, value));
43854
43880
  } : function(object2, key2, value) {
43855
43881
  object2[key2] = value;
@@ -44055,7 +44081,7 @@ ${latestSubscriptionCallbackError.current.stack}
44055
44081
  if (hasRequired_objectAssign)
44056
44082
  return _objectAssign;
44057
44083
  hasRequired_objectAssign = 1;
44058
- var DESCRIPTORS2 = _descriptors;
44084
+ var DESCRIPTORS2 = require_descriptors();
44059
44085
  var getKeys2 = _objectKeys;
44060
44086
  var gOPS2 = _objectGops;
44061
44087
  var pIE2 = require_objectPie();
@@ -44121,10 +44147,10 @@ ${latestSubscriptionCallbackError.current.stack}
44121
44147
  }, "_iterStep");
44122
44148
  var _iterators = {};
44123
44149
  var _redefine = _hide;
44124
- var dP$1 = _objectDp;
44150
+ var dP$1 = require_objectDp();
44125
44151
  var anObject$4 = _anObject;
44126
44152
  var getKeys$1 = _objectKeys;
44127
- var _objectDps = _descriptors ? Object.defineProperties : /* @__PURE__ */ __name(function defineProperties2(O2, Properties2) {
44153
+ var _objectDps = require_descriptors() ? Object.defineProperties : /* @__PURE__ */ __name(function defineProperties2(O2, Properties2) {
44128
44154
  anObject$4(O2);
44129
44155
  var keys2 = getKeys$1(Properties2);
44130
44156
  var length = keys2.length;
@@ -44191,7 +44217,7 @@ ${latestSubscriptionCallbackError.current.stack}
44191
44217
  };
44192
44218
  $exports.store = store$2;
44193
44219
  var _wksExports = _wks.exports;
44194
- var def = _objectDp.f;
44220
+ var def = require_objectDp().f;
44195
44221
  var has$b = _has;
44196
44222
  var TAG$1 = _wksExports("toStringTag");
44197
44223
  var _setToStringTag = /* @__PURE__ */ __name(function(it, tag, stat) {
@@ -44464,7 +44490,7 @@ ${latestSubscriptionCallbackError.current.stack}
44464
44490
  var _isArrayIter = /* @__PURE__ */ __name(function(it) {
44465
44491
  return it !== void 0 && (Iterators.Array === it || ArrayProto[ITERATOR] === it);
44466
44492
  }, "_isArrayIter");
44467
- var $defineProperty$1 = _objectDp;
44493
+ var $defineProperty$1 = require_objectDp();
44468
44494
  var createDesc$2 = _propertyDesc;
44469
44495
  var _createProperty = /* @__PURE__ */ __name(function(object2, index2, value) {
44470
44496
  if (index2 in object2)
@@ -44593,7 +44619,7 @@ ${latestSubscriptionCallbackError.current.stack}
44593
44619
  }
44594
44620
  }, "_default$8");
44595
44621
  var $export$3 = _export;
44596
- $export$3($export$3.S + $export$3.F * !_descriptors, "Object", { defineProperty: _objectDp.f });
44622
+ $export$3($export$3.S + $export$3.F * !require_descriptors(), "Object", { defineProperty: require_objectDp().f });
44597
44623
  var $Object$1 = _coreExports.Object;
44598
44624
  var defineProperty$5 = /* @__PURE__ */ __name(function defineProperty2(it, key2, desc) {
44599
44625
  return $Object$1.defineProperty(it, key2, desc);
@@ -44634,7 +44660,7 @@ ${latestSubscriptionCallbackError.current.stack}
44634
44660
  var META$1 = _uid("meta");
44635
44661
  var isObject$5 = _isObject;
44636
44662
  var has$9 = _has;
44637
- var setDesc = _objectDp.f;
44663
+ var setDesc = require_objectDp().f;
44638
44664
  var id$1 = 0;
44639
44665
  var isExtensible = Object.isExtensible || function() {
44640
44666
  return true;
@@ -44687,7 +44713,7 @@ ${latestSubscriptionCallbackError.current.stack}
44687
44713
  var _metaExports = _meta.exports;
44688
44714
  var core = _coreExports;
44689
44715
  var wksExt$1 = _wksExt;
44690
- var defineProperty$3 = _objectDp.f;
44716
+ var defineProperty$3 = require_objectDp().f;
44691
44717
  var _wksDefine = /* @__PURE__ */ __name(function(name2) {
44692
44718
  var $Symbol2 = core.Symbol || (core.Symbol = {});
44693
44719
  if (name2.charAt(0) != "_" && !(name2 in $Symbol2))
@@ -44741,9 +44767,9 @@ ${latestSubscriptionCallbackError.current.stack}
44741
44767
  var toIObject$1 = _toIobject;
44742
44768
  var toPrimitive$1 = _toPrimitive$1;
44743
44769
  var has$8 = _has;
44744
- var IE8_DOM_DEFINE = _ie8DomDefine;
44770
+ var IE8_DOM_DEFINE = require_ie8DomDefine();
44745
44771
  var gOPD$2 = Object.getOwnPropertyDescriptor;
44746
- _objectGopd.f = _descriptors ? gOPD$2 : /* @__PURE__ */ __name(function getOwnPropertyDescriptor2(O2, P2) {
44772
+ _objectGopd.f = require_descriptors() ? gOPD$2 : /* @__PURE__ */ __name(function getOwnPropertyDescriptor2(O2, P2) {
44747
44773
  O2 = toIObject$1(O2);
44748
44774
  P2 = toPrimitive$1(P2, true);
44749
44775
  if (IE8_DOM_DEFINE)
@@ -44756,7 +44782,7 @@ ${latestSubscriptionCallbackError.current.stack}
44756
44782
  }, "getOwnPropertyDescriptor");
44757
44783
  var global$1 = _globalExports;
44758
44784
  var has$7 = _has;
44759
- var DESCRIPTORS = _descriptors;
44785
+ var DESCRIPTORS = require_descriptors();
44760
44786
  var $export$2 = _export;
44761
44787
  var redefine = _redefine;
44762
44788
  var META = _metaExports.KEY;
@@ -44779,7 +44805,7 @@ ${latestSubscriptionCallbackError.current.stack}
44779
44805
  var gOPNExt = _objectGopnExt;
44780
44806
  var $GOPD = _objectGopd;
44781
44807
  var $GOPS = _objectGops;
44782
- var $DP = _objectDp;
44808
+ var $DP = require_objectDp();
44783
44809
  var $keys$1 = _objectKeys;
44784
44810
  var gOPD$1 = $GOPD.f;
44785
44811
  var dP = $DP.f;
@@ -82868,31 +82894,36 @@ ${latestSubscriptionCallbackError.current.stack}
82868
82894
  const optionsToUse = getOptions$1(options);
82869
82895
  if (options.some((opt) => {
82870
82896
  if (opt.value === "true") {
82871
- throw new Error('RadioGroup values cannot be strings of "true" or "false", they must be actual booleans');
82897
+ return true;
82872
82898
  }
82873
- }))
82874
- return /* @__PURE__ */ React$2.createElement(
82875
- RadioGroup,
82876
- __spreadProps(__spreadValues(__spreadValues({}, input), removeUnwantedProps(rest)), {
82877
- selectedValue: input.value,
82878
- label: void 0,
82879
- onChange: function(e2) {
82880
- let val2 = e2.target.value;
82881
- if (val2 === "true") {
82882
- val2 = true;
82883
- }
82884
- if (val2 === "false") {
82885
- val2 = false;
82886
- }
82887
- if (val2 === "") {
82888
- val2 = false;
82889
- }
82890
- input.onChange(val2);
82891
- onFieldSubmit(val2);
82892
- },
82893
- options: optionsToUse
82894
- })
82899
+ return false;
82900
+ })) {
82901
+ throw new Error(
82902
+ 'RadioGroup values cannot be strings of "true" or "false", they must be actual booleans'
82895
82903
  );
82904
+ }
82905
+ return /* @__PURE__ */ React$2.createElement(
82906
+ RadioGroup,
82907
+ __spreadProps(__spreadValues(__spreadValues({}, input), removeUnwantedProps(rest)), {
82908
+ selectedValue: input.value,
82909
+ label: void 0,
82910
+ onChange: function(e2) {
82911
+ let val2 = e2.target.value;
82912
+ if (val2 === "true") {
82913
+ val2 = true;
82914
+ }
82915
+ if (val2 === "false") {
82916
+ val2 = false;
82917
+ }
82918
+ if (val2 === "") {
82919
+ val2 = false;
82920
+ }
82921
+ input.onChange(val2);
82922
+ onFieldSubmit(val2);
82923
+ },
82924
+ options: optionsToUse
82925
+ })
82926
+ );
82896
82927
  }, "renderBlueprintRadioGroup");
82897
82928
  const _RenderReactColorPicker = class _RenderReactColorPicker extends React$2.Component {
82898
82929
  constructor() {
@@ -123400,19 +123431,38 @@ ${latestSubscriptionCallbackError.current.stack}
123400
123431
  return parsingResultArray;
123401
123432
  }
123402
123433
  __name(flattenSequenceArray, "flattenSequenceArray");
123434
+ function wrapOriginSpanningFeatures(locArrayInput, sequenceLength, inclusive1BasedStart, inclusive1BasedEnd) {
123435
+ const locArrayOutput = locArrayInput.map((loc) => __spreadValues({}, loc));
123436
+ for (let i2 = 0; i2 < locArrayOutput.length - 1; i2++) {
123437
+ const firstFeature = locArrayOutput[i2];
123438
+ const secondFeature = locArrayOutput[i2 + 1];
123439
+ if (firstFeature.end === sequenceLength - (inclusive1BasedEnd ? 0 : 1) && secondFeature.start === 1 - (inclusive1BasedStart ? 0 : 1)) {
123440
+ locArrayOutput[i2] = {
123441
+ start: firstFeature.start,
123442
+ end: secondFeature.end
123443
+ };
123444
+ locArrayOutput.splice(i2 + 1, 1);
123445
+ }
123446
+ }
123447
+ return locArrayOutput;
123448
+ }
123449
+ __name(wrapOriginSpanningFeatures, "wrapOriginSpanningFeatures");
123403
123450
  function parseFeatureLocation(locStr, isProtein2, inclusive1BasedStart, inclusive1BasedEnd, isCircular, sequenceLength) {
123404
123451
  locStr = locStr.trim();
123405
- const locArr = [];
123406
- locStr.replace(/(\d+)/g, function(string2, match2) {
123407
- locArr.push(match2);
123452
+ const positionsArray = [];
123453
+ const locationParts = locStr.split(",");
123454
+ locationParts.forEach((locPart) => {
123455
+ const extractedPositions = locPart.match(/(\d+)/g);
123456
+ if (extractedPositions === null) {
123457
+ return;
123458
+ }
123459
+ positionsArray.push(extractedPositions[0]);
123460
+ positionsArray.push(extractedPositions[1] || extractedPositions[0]);
123408
123461
  });
123409
123462
  const locArray = [];
123410
- for (let i2 = 0; i2 < locArr.length; i2 += 2) {
123411
- const start2 = parseInt(locArr[i2], 10) - (inclusive1BasedStart ? 0 : 1);
123412
- let end2 = parseInt(locArr[i2 + 1], 10) - (inclusive1BasedEnd ? 0 : 1);
123413
- if (isNaN(end2)) {
123414
- end2 = start2;
123415
- }
123463
+ for (let i2 = 0; i2 < positionsArray.length; i2 += 2) {
123464
+ const start2 = parseInt(positionsArray[i2], 10) - (inclusive1BasedStart ? 0 : 1);
123465
+ const end2 = parseInt(positionsArray[i2 + 1], 10) - (inclusive1BasedEnd ? 0 : 1);
123416
123466
  const location2 = {
123417
123467
  start: start2,
123418
123468
  end: end2
@@ -123421,20 +123471,16 @@ ${latestSubscriptionCallbackError.current.stack}
123421
123471
  isProtein2 ? convertAACaretPositionOrRangeToDna(location2) : location2
123422
123472
  );
123423
123473
  }
123424
- if (isCircular) {
123425
- for (let i2 = 0; i2 < locArray.length; i2 += 2) {
123426
- const firstFeature = locArray[i2];
123427
- const secondFeature = locArray[i2 + 1];
123428
- if (firstFeature.end === sequenceLength - (inclusive1BasedEnd ? 0 : 1) && secondFeature.start === 1 - (inclusive1BasedStart ? 0 : 1)) {
123429
- locArray[i2] = {
123430
- start: firstFeature.start,
123431
- end: secondFeature.end
123432
- };
123433
- locArray.splice(i2 + 1, 1);
123434
- }
123435
- }
123474
+ if (isCircular && sequenceLength) {
123475
+ return wrapOriginSpanningFeatures(
123476
+ locArray,
123477
+ sequenceLength,
123478
+ inclusive1BasedStart,
123479
+ inclusive1BasedEnd
123480
+ );
123481
+ } else {
123482
+ return locArray;
123436
123483
  }
123437
- return locArray;
123438
123484
  }
123439
123485
  __name(parseFeatureLocation, "parseFeatureLocation");
123440
123486
  function genbankToJson(string2, options = {}) {
@@ -123531,7 +123577,7 @@ ${latestSubscriptionCallbackError.current.stack}
123531
123577
  parseOrigin(line, key2);
123532
123578
  break;
123533
123579
  case genbankAnnotationKey.END_SEQUENCE_TAG:
123534
- endSeq();
123580
+ endSeq(options);
123535
123581
  break;
123536
123582
  case genbankAnnotationKey.DEFINITION_TAG:
123537
123583
  line = line.replace(/DEFINITION/, "");
@@ -123636,9 +123682,9 @@ ${latestSubscriptionCallbackError.current.stack}
123636
123682
  }
123637
123683
  });
123638
123684
  return results;
123639
- function endSeq() {
123685
+ function endSeq(options2) {
123640
123686
  hasFoundLocus = false;
123641
- postProcessCurSeq();
123687
+ postProcessCurSeq(options2);
123642
123688
  resultsArray.push(result || { success: false });
123643
123689
  }
123644
123690
  __name(endSeq, "endSeq");
@@ -123652,11 +123698,13 @@ ${latestSubscriptionCallbackError.current.stack}
123652
123698
  }
123653
123699
  }
123654
123700
  __name(addMessage, "addMessage");
123655
- function postProcessCurSeq() {
123701
+ function postProcessCurSeq(options2) {
123656
123702
  if (result && result.parsedSequence && result.parsedSequence.features) {
123657
123703
  for (let i2 = 0; i2 < result.parsedSequence.features.length; i2++) {
123658
123704
  result.parsedSequence.features[i2] = postProcessGenbankFeature(
123659
- result.parsedSequence.features[i2]
123705
+ result.parsedSequence.features[i2],
123706
+ result.parsedSequence,
123707
+ options2
123660
123708
  );
123661
123709
  }
123662
123710
  }
@@ -123902,7 +123950,7 @@ ${latestSubscriptionCallbackError.current.stack}
123902
123950
  return runon;
123903
123951
  }
123904
123952
  __name(isKeywordRunon, "isKeywordRunon");
123905
- function postProcessGenbankFeature(feat) {
123953
+ function postProcessGenbankFeature(feat, parsedSequence, options2) {
123906
123954
  if (feat.notes.label) {
123907
123955
  feat.name = feat.notes.label[0];
123908
123956
  } else if (feat.notes.gene) {
@@ -123935,6 +123983,15 @@ ${latestSubscriptionCallbackError.current.stack}
123935
123983
  feat.arrowheadType = feat.notes.direction[0].toUpperCase() === "BOTH" ? "BOTH" : feat.notes.direction[0].toUpperCase() === "NONE" ? "NONE" : void 0;
123936
123984
  delete feat.notes.direction;
123937
123985
  }
123986
+ if (parsedSequence.circular) {
123987
+ const { inclusive1BasedStart: inclusive1BasedStart2, inclusive1BasedEnd: inclusive1BasedEnd2 } = options2;
123988
+ feat.locations = wrapOriginSpanningFeatures(
123989
+ feat.locations,
123990
+ parsedSequence.sequence.length,
123991
+ inclusive1BasedStart2,
123992
+ inclusive1BasedEnd2
123993
+ );
123994
+ }
123938
123995
  return feat;
123939
123996
  }
123940
123997
  __name(postProcessGenbankFeature, "postProcessGenbankFeature");
@@ -139257,14 +139314,26 @@ ${seq.sequence}
139257
139314
  props,
139258
139315
  overrideName
139259
139316
  }) {
139317
+ var _a2;
139260
139318
  dialogHolder.dialogType = dialogType;
139261
139319
  if (!dialogHolder.dialogType && ModalComponent) {
139262
139320
  dialogHolder.dialogType = "TGCustomModal";
139263
139321
  }
139322
+ if (document.activeElement && document.activeElement.closest(".veEditor")) {
139323
+ let editorName;
139324
+ (_a2 = document.activeElement.closest(".veEditor")) == null ? void 0 : _a2.className.split(" ").forEach((c2) => {
139325
+ if (!c2.trim())
139326
+ return;
139327
+ if (!c2.trim().includes("veEditor")) {
139328
+ editorName = c2;
139329
+ }
139330
+ });
139331
+ dialogHolder.editorName = editorName;
139332
+ }
139264
139333
  dialogHolder.CustomModalComponent = ModalComponent;
139265
139334
  dialogHolder.props = props;
139266
139335
  dialogHolder.overrideName = overrideName;
139267
- dialogHolder.setUniqKey(uuid());
139336
+ dialogHolder.setUniqKeyToForceRerender(uuid());
139268
139337
  }
139269
139338
  __name(showDialog, "showDialog");
139270
139339
  function hideDialog() {
@@ -139272,7 +139341,7 @@ ${seq.sequence}
139272
139341
  delete dialogHolder.CustomModalComponent;
139273
139342
  delete dialogHolder.props;
139274
139343
  delete dialogHolder.overrideName;
139275
- dialogHolder.setUniqKey();
139344
+ dialogHolder.setUniqKeyToForceRerender();
139276
139345
  }
139277
139346
  __name(hideDialog, "hideDialog");
139278
139347
  const typeToDialogType = {
@@ -154625,7 +154694,7 @@ Part of ${annotation.translationType} Translation from BPs ${annotation.start +
154625
154694
  }
154626
154695
  __name(showFileDialog, "showFileDialog");
154627
154696
  const name = "@teselagen/ove";
154628
- const version = "0.5.2";
154697
+ const version = "0.5.4";
154629
154698
  const main = "./src/index.js";
154630
154699
  const exports$1 = {
154631
154700
  ".": {
@@ -169584,14 +169653,17 @@ Part of ${annotation.translationType} Translation from BPs ${annotation.start +
169584
169653
  AddOrEditPrimerDialog
169585
169654
  };
169586
169655
  function GlobalDialog(props) {
169587
- const { dialogOverrides = {} } = props;
169588
- const [uniqKey, setUniqKey] = reactExports.useState();
169656
+ const { dialogOverrides = {}, editorName } = props;
169657
+ const [uniqKey, setUniqKeyToForceRerender] = reactExports.useState();
169589
169658
  reactExports.useEffect(() => {
169590
169659
  return () => {
169591
169660
  hideDialog();
169592
169661
  };
169593
169662
  }, []);
169594
- dialogHolder.setUniqKey = setUniqKey;
169663
+ if (dialogHolder.editorName && editorName && dialogHolder.editorName !== editorName) {
169664
+ return null;
169665
+ }
169666
+ dialogHolder.setUniqKeyToForceRerender = setUniqKeyToForceRerender;
169595
169667
  const Comp = dialogHolder.CustomModalComponent || dialogOverrides[dialogHolder.overrideName] || Dialogs[dialogHolder.dialogType];
169596
169668
  if (!Comp)
169597
169669
  return null;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@teselagen/ove",
3
- "version": "0.5.3",
3
+ "version": "0.5.5",
4
4
  "main": "./src/index.js",
5
5
  "exports": {
6
6
  ".": {
@@ -12,10 +12,10 @@
12
12
  "dependencies": {
13
13
  "@teselagen/sequence-utils": "0.3.24",
14
14
  "@teselagen/range-utils": "0.3.7",
15
- "@teselagen/ui": "0.4.3",
15
+ "@teselagen/ui": "0.4.4",
16
16
  "@teselagen/file-utils": "0.3.16",
17
17
  "@teselagen/bounce-loader": "0.3.11",
18
- "@teselagen/bio-parsers": "0.4.15",
18
+ "@teselagen/bio-parsers": "0.4.16",
19
19
  "@blueprintjs/core": "3.52.0",
20
20
  "@blueprintjs/datetime": "3.23.19",
21
21
  "@blueprintjs/icons": "3.33.0",
@@ -39,15 +39,22 @@ const Dialogs = {
39
39
  };
40
40
 
41
41
  export function GlobalDialog(props) {
42
- const { dialogOverrides = {} } = props;
43
- const [uniqKey, setUniqKey] = useState();
42
+ const { dialogOverrides = {}, editorName } = props;
43
+ const [uniqKey, setUniqKeyToForceRerender] = useState();
44
44
  useEffect(() => {
45
45
  //on unmount, clear the global dialog state..
46
46
  return () => {
47
47
  hideDialog();
48
48
  };
49
49
  }, []);
50
- dialogHolder.setUniqKey = setUniqKey;
50
+ if (
51
+ dialogHolder.editorName &&
52
+ editorName &&
53
+ dialogHolder.editorName !== editorName
54
+ ) {
55
+ return null;
56
+ }
57
+ dialogHolder.setUniqKeyToForceRerender = setUniqKeyToForceRerender;
51
58
  const Comp =
52
59
  dialogHolder.CustomModalComponent ||
53
60
  dialogOverrides[dialogHolder.overrideName] ||
@@ -15,17 +15,32 @@ export function showDialog({
15
15
  if (!dialogHolder.dialogType && ModalComponent) {
16
16
  dialogHolder.dialogType = "TGCustomModal";
17
17
  }
18
+ // check if focused element in the dom is within a given editor and add an editor prop to the dialog
19
+ if (document.activeElement && document.activeElement.closest(".veEditor")) {
20
+ let editorName;
21
+ document.activeElement
22
+ .closest(".veEditor")
23
+ ?.className.split(" ")
24
+ .forEach(c => {
25
+ if (!c.trim()) return;
26
+ if (!c.trim().includes("veEditor")) {
27
+ editorName = c;
28
+ }
29
+ });
30
+ dialogHolder.editorName = editorName;
31
+ }
32
+
18
33
  dialogHolder.CustomModalComponent = ModalComponent;
19
34
  dialogHolder.props = props;
20
35
  dialogHolder.overrideName = overrideName;
21
- dialogHolder.setUniqKey(shortid());
36
+ dialogHolder.setUniqKeyToForceRerender(shortid());
22
37
  }
23
38
  export function hideDialog() {
24
39
  delete dialogHolder.dialogType;
25
40
  delete dialogHolder.CustomModalComponent;
26
41
  delete dialogHolder.props;
27
42
  delete dialogHolder.overrideName;
28
- dialogHolder.setUniqKey();
43
+ dialogHolder.setUniqKeyToForceRerender();
29
44
  }
30
45
 
31
46
  const typeToDialogType = {
@@ -57,8 +72,8 @@ export function showAddOrEditAnnotationDialog({
57
72
  annotation.strand === -1
58
73
  ? false
59
74
  : annotation.forward !== undefined
60
- ? !!annotation.forward
61
- : true;
75
+ ? !!annotation.forward
76
+ : true;
62
77
  showDialog({
63
78
  overrideName: `AddOrEdit${nameUpper}DialogOverride`,
64
79
  dialogType,