@teselagen/ove 0.3.11 → 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 +529 -422
- package/index.mjs +530 -423
- package/index.umd.js +532 -402
- package/package.json +2 -2
- package/src/AlignmentView/AlignmentVisibilityTool.js +1 -1
- package/src/AlignmentView/EditTrackNameDialog.js +1 -5
- package/src/AlignmentView/HorizontalPanelDragHandle.js +2 -2
- package/src/AlignmentView/Minimap.js +12 -12
- package/src/AlignmentView/PairwiseAlignmentView.js +1 -1
- package/src/AlignmentView/getGapMap.js +1 -1
- package/src/AlignmentView/getTrackFromEvent.js +1 -1
- package/src/AlignmentView/index.js +32 -37
- package/src/AutoAnnotate.js +48 -48
- package/src/CircularView/Cutsites.js +3 -3
- package/src/CircularView/Labels/index.js +7 -7
- package/src/CircularView/Labels/relaxLabels_DEPRECATED.js +5 -5
- package/src/CircularView/RotateCircularViewSlider.js +1 -1
- package/src/CircularView/SelectionLayer.js +2 -2
- package/src/CircularView/drawAnnotations.js +3 -3
- package/src/CircularView/getAngleForPositionMidpoint.js +1 -1
- package/src/CircularView/index.d.ts +11 -11
- package/src/CircularView/index.js +9 -9
- package/src/CreateAnnotationsPage.js +7 -5
- package/src/CreateCustomEnzyme/index.js +1 -5
- package/src/CutsiteFilter/AdditionalCutsiteInfoDialog.js +11 -11
- package/src/CutsiteFilter/index.js +12 -12
- package/src/DigestTool/AddLaddersDialog.js +1 -1
- package/src/DigestTool/DigestTool.js +3 -3
- package/src/DigestTool/Ladder.js +8 -8
- package/src/DigestTool/ladderDefaults.js +1 -2
- package/src/Editor/CommandHotkeyHandler.js +1 -1
- package/src/Editor/DropHandler.js +2 -2
- package/src/Editor/index.js +15 -15
- package/src/Editor/userDefinedHandlersAndOpts.js +3 -1
- package/src/FindBar/index.js +6 -6
- package/src/GlobalDialogUtils.js +6 -0
- package/src/LinearView/ZoomLinearView.js +1 -1
- package/src/LinearView/index.js +7 -7
- package/src/MenuBar/index.js +1 -1
- package/src/MenuBar/viewSubmenu.js +1 -1
- package/src/PCRTool/PCRTool.js +19 -19
- package/src/Reflex/Browser.js +4 -5
- package/src/Reflex/ReflexContainer.js +3 -3
- package/src/Reflex/ReflexElement.js +2 -2
- package/src/RowItem/Axis.js +1 -1
- package/src/RowItem/Caret/index.js +1 -1
- package/src/RowItem/Chromatograms/Chromatogram.js +3 -3
- package/src/RowItem/CutsiteSelectionLayers.js +1 -1
- package/src/RowItem/Cutsites.js +1 -1
- package/src/RowItem/Labels.js +2 -2
- package/src/RowItem/Orfs.js +2 -2
- package/src/RowItem/Sequence.js +4 -4
- package/src/RowItem/StackedAnnotations/PointedAnnotation.js +3 -3
- package/src/RowItem/StackedAnnotations/getStructuredBases.js +1 -1
- package/src/RowItem/Translations/AASliver.js +71 -75
- package/src/RowItem/Translations/index.js +1 -1
- package/src/RowItem/getCutsiteLabelHeights.js +1 -1
- package/src/RowItem/index.js +14 -8
- package/src/RowView/estimateRowHeight.js +5 -5
- package/src/RowView/index.d.ts +7 -7
- package/src/RowView/index.js +11 -12
- package/src/SimpleCircularOrLinearView.js +6 -6
- package/src/StatusBar/MeltingTemp.js +3 -3
- package/src/StatusBar/index.js +29 -33
- package/src/ToolBar/ToolbarItem.js +2 -2
- package/src/ToolBar/alignmentTool.js +9 -9
- package/src/ToolBar/editTool.js +41 -37
- package/src/ToolBar/findTool.js +2 -2
- package/src/ToolBar/importTool.js +1 -1
- package/src/ToolBar/index.js +2 -2
- package/src/ToolBar/oligoTool.js +1 -1
- package/src/ToolBar/orfTool.js +1 -6
- package/src/ToolBar/printTool.js +2 -2
- package/src/ToolBar/visibilityTool.js +1 -1
- package/src/VersionHistoryView/index.js +2 -2
- package/src/commands/index.js +237 -230
- package/src/createVectorEditor/index.js +4 -4
- package/src/fileUtils.js +18 -18
- package/src/helperComponents/AddOrEditAnnotationDialog/index.js +22 -15
- package/src/helperComponents/AddOrEditFeatureDialog/index.js +2 -2
- package/src/helperComponents/AddOrEditPartDialog/index.js +2 -2
- package/src/helperComponents/AddOrEditPrimerDialog/index.js +5 -5
- package/src/helperComponents/EnzymesDialog/index.js +17 -22
- package/src/helperComponents/GoToDialog.js +5 -1
- package/src/helperComponents/MergeFeaturesDialog/index.js +3 -3
- package/src/helperComponents/PinchHelper/PinchHelper.js +1 -1
- package/src/helperComponents/PrintDialog/index.js +4 -4
- package/src/helperComponents/PropertiesDialog/CutsiteProperties.js +3 -3
- package/src/helperComponents/PropertiesDialog/GenbankView.js +1 -1
- package/src/helperComponents/PropertiesDialog/GeneralProperties.js +10 -8
- package/src/helperComponents/PropertiesDialog/GenericAnnotationProperties.js +136 -138
- package/src/helperComponents/PropertiesDialog/OrfProperties.js +3 -3
- package/src/helperComponents/PropertiesDialog/PrimerProperties.js +1 -1
- package/src/helperComponents/PropertiesDialog/TranslationProperties.js +2 -2
- package/src/helperComponents/PropertiesDialog/index.js +3 -3
- package/src/helperComponents/RemoveDuplicates/index.js +3 -3
- package/src/helperComponents/SelectDialog.js +3 -3
- package/src/helperComponents/UncontrolledSliderWithPlusMinusBtns.js +5 -5
- package/src/helperComponents/createSimpleDialog.js +1 -1
- package/src/helperComponents/partTagSearch.js +2 -5
- package/src/helperComponents/withHover.js +3 -3
- package/src/redux/alignments.js +6 -6
- package/src/redux/annotationVisibility.js +4 -4
- package/src/redux/featureLengthsToHide.js +1 -1
- package/src/redux/frameTranslations.js +3 -3
- package/src/redux/middleware.js +2 -2
- package/src/redux/panelsShown.js +19 -19
- package/src/redux/partLengthsToHide.js +1 -1
- package/src/redux/primerLengthsToHide.js +1 -1
- package/src/redux/readOnly.js +1 -4
- package/src/redux/selectionLayer.js +1 -1
- package/src/redux/sequenceData/features.js +1 -1
- package/src/redux/sequenceData/upsertDeleteActionGenerator.js +1 -1
- package/src/redux/sequenceDataHistory.js +5 -5
- package/src/redux/toolBar.js +2 -4
- package/src/redux/utils/createMetaAction.js +2 -2
- package/src/redux/versionHistory.js +1 -2
- package/src/selectors/annotationSearchSelector.js +4 -4
- package/src/selectors/circularSelector.js +1 -1
- package/src/selectors/cutsiteLabelColorSelector.js +1 -1
- package/src/selectors/filteredCutsitesSelector.js +6 -6
- package/src/selectors/filteredFeaturesSelector.js +4 -4
- package/src/selectors/filteredPartsSelector.js +5 -5
- package/src/selectors/filteredPrimersSelector.js +3 -3
- package/src/selectors/isEnzymeFilterAndSelector.js +1 -1
- package/src/selectors/orfsSelector.js +1 -1
- package/src/selectors/restrictionEnzymesSelector.js +2 -2
- package/src/selectors/searchLayersSelector.js +7 -7
- package/src/selectors/sequenceLengthSelector.js +1 -1
- package/src/selectors/sequenceSelector.js +1 -1
- package/src/selectors/tagsToBoldSelector.js +1 -1
- package/src/selectors/translationsSelector.js +7 -7
- package/src/updateEditor.js +1 -1
- package/src/utils/PassThrough.js +1 -1
- package/src/utils/addWrappedAddons.js +1 -1
- package/src/utils/annotationTypes.js +2 -2
- package/src/utils/combineReducersDontIgnoreKeys.js +1 -1
- package/src/utils/editorUtils.js +2 -2
- package/src/utils/massageTickSpacing.js +1 -1
- package/src/utils/onlyUpdateForKeysDeep.js +1 -1
- package/src/utils/pureNoFunc.js +1 -1
- package/src/utils/shouldRerender.js +1 -1
- package/src/utils/showFileDialog.js +6 -7
- package/src/utils/updateLabelsForInViewFeatures.js +1 -1
- package/src/utils/useAnnotationLimits.js +1 -1
- package/src/withEditorInteractions/Keyboard.js +2 -3
- package/src/withEditorInteractions/createSequenceInputPopup.js +4 -4
- package/src/withEditorInteractions/index.js +93 -55
- package/src/withEditorProps/index.js +39 -37
- package/style.css +138 -138
package/index.js
CHANGED
|
@@ -30426,20 +30426,12 @@ var _cof = function (it) {
|
|
|
30426
30426
|
return toString$6.call(it).slice(8, -1);
|
|
30427
30427
|
};
|
|
30428
30428
|
|
|
30429
|
-
|
|
30430
|
-
var
|
|
30431
|
-
|
|
30432
|
-
|
|
30433
|
-
|
|
30434
|
-
|
|
30435
|
-
// fallback for non-array-like ES3 and non-enumerable old V8 strings
|
|
30436
|
-
var cof = _cof;
|
|
30437
|
-
// eslint-disable-next-line no-prototype-builtins
|
|
30438
|
-
_iobject = Object('z').propertyIsEnumerable(0) ? Object : function (it) {
|
|
30439
|
-
return cof(it) == 'String' ? it.split('') : Object(it);
|
|
30440
|
-
};
|
|
30441
|
-
return _iobject;
|
|
30442
|
-
}
|
|
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
|
+
};
|
|
30443
30435
|
|
|
30444
30436
|
// 7.2.1 RequireObjectCoercible(argument)
|
|
30445
30437
|
var _defined = function (it) {
|
|
@@ -30448,7 +30440,7 @@ var _defined = function (it) {
|
|
|
30448
30440
|
};
|
|
30449
30441
|
|
|
30450
30442
|
// to indexed object, toObject with fallback for non-array-like ES3 strings
|
|
30451
|
-
var IObject =
|
|
30443
|
+
var IObject = _iobject;
|
|
30452
30444
|
var defined$2 = _defined;
|
|
30453
30445
|
var _toIobject = function (it) {
|
|
30454
30446
|
return IObject(defined$2(it));
|
|
@@ -30568,14 +30560,7 @@ _objectGops.f = Object.getOwnPropertySymbols;
|
|
|
30568
30560
|
|
|
30569
30561
|
var _objectPie = {};
|
|
30570
30562
|
|
|
30571
|
-
|
|
30572
|
-
|
|
30573
|
-
function require_objectPie () {
|
|
30574
|
-
if (hasRequired_objectPie) return _objectPie;
|
|
30575
|
-
hasRequired_objectPie = 1;
|
|
30576
|
-
_objectPie.f = {}.propertyIsEnumerable;
|
|
30577
|
-
return _objectPie;
|
|
30578
|
-
}
|
|
30563
|
+
_objectPie.f = {}.propertyIsEnumerable;
|
|
30579
30564
|
|
|
30580
30565
|
// 7.1.13 ToObject(argument)
|
|
30581
30566
|
var defined$1 = _defined;
|
|
@@ -30593,9 +30578,9 @@ function require_objectAssign () {
|
|
|
30593
30578
|
var DESCRIPTORS = _descriptors;
|
|
30594
30579
|
var getKeys = _objectKeys;
|
|
30595
30580
|
var gOPS = _objectGops;
|
|
30596
|
-
var pIE =
|
|
30581
|
+
var pIE = _objectPie;
|
|
30597
30582
|
var toObject = _toObject;
|
|
30598
|
-
var IObject =
|
|
30583
|
+
var IObject = _iobject;
|
|
30599
30584
|
var $assign = Object.assign;
|
|
30600
30585
|
|
|
30601
30586
|
// should work with symbols and should have deterministic property order (V8 bug)
|
|
@@ -31308,7 +31293,7 @@ var _wksDefine = function (name) {
|
|
|
31308
31293
|
// all enumerable object keys, includes symbols
|
|
31309
31294
|
var getKeys = _objectKeys;
|
|
31310
31295
|
var gOPS$1 = _objectGops;
|
|
31311
|
-
var pIE$1 =
|
|
31296
|
+
var pIE$1 = _objectPie;
|
|
31312
31297
|
var _enumKeys = function (it) {
|
|
31313
31298
|
var result = getKeys(it);
|
|
31314
31299
|
var getSymbols = gOPS$1.f;
|
|
@@ -31361,7 +31346,7 @@ _objectGopnExt.f = function getOwnPropertyNames(it) {
|
|
|
31361
31346
|
|
|
31362
31347
|
var _objectGopd = {};
|
|
31363
31348
|
|
|
31364
|
-
var pIE =
|
|
31349
|
+
var pIE = _objectPie;
|
|
31365
31350
|
var createDesc$1 = _propertyDesc;
|
|
31366
31351
|
var toIObject$1 = _toIobject;
|
|
31367
31352
|
var toPrimitive$1 = _toPrimitive$1;
|
|
@@ -31529,7 +31514,7 @@ if (!USE_NATIVE) {
|
|
|
31529
31514
|
$GOPD.f = $getOwnPropertyDescriptor;
|
|
31530
31515
|
$DP.f = $defineProperty$1;
|
|
31531
31516
|
_objectGopn.f = gOPNExt.f = $getOwnPropertyNames;
|
|
31532
|
-
|
|
31517
|
+
_objectPie.f = $propertyIsEnumerable;
|
|
31533
31518
|
$GOPS.f = $getOwnPropertySymbols;
|
|
31534
31519
|
|
|
31535
31520
|
if (DESCRIPTORS && !_library) {
|
|
@@ -85373,13 +85358,7 @@ function withTableParams(compOrOpts, pTopLevelOpts) {
|
|
|
85373
85358
|
return {};
|
|
85374
85359
|
}
|
|
85375
85360
|
const mergedOpts = getMergedOpts(topLevelOptions, ownProps);
|
|
85376
|
-
const {
|
|
85377
|
-
formName,
|
|
85378
|
-
urlConnected,
|
|
85379
|
-
history,
|
|
85380
|
-
defaults,
|
|
85381
|
-
onlyOneFilter
|
|
85382
|
-
} = mergedOpts;
|
|
85361
|
+
const { formName, urlConnected, history, defaults, onlyOneFilter } = mergedOpts;
|
|
85383
85362
|
function updateSearch(val) {
|
|
85384
85363
|
setTimeout(function() {
|
|
85385
85364
|
dispatch(reduxForm.change(formName, "reduxFormSearchInput", val || ""));
|
|
@@ -85418,12 +85397,7 @@ function withTableParams(compOrOpts, pTopLevelOpts) {
|
|
|
85418
85397
|
action(...args, currentParams);
|
|
85419
85398
|
};
|
|
85420
85399
|
});
|
|
85421
|
-
const {
|
|
85422
|
-
variables,
|
|
85423
|
-
selectedEntities,
|
|
85424
|
-
mergedOpts,
|
|
85425
|
-
...restStateProps
|
|
85426
|
-
} = stateProps;
|
|
85400
|
+
const { variables, selectedEntities, mergedOpts, ...restStateProps } = stateProps;
|
|
85427
85401
|
const changeFormValue = (...args) => dispatchProps.dispatch(reduxForm.change(formName, ...args));
|
|
85428
85402
|
const tableParams = {
|
|
85429
85403
|
changeFormValue,
|
|
@@ -89319,7 +89293,9 @@ const wrapDialog = (topLevelDialogProps = {}) => (Component) => (props) => {
|
|
|
89319
89293
|
return doNotTriggerClick();
|
|
89320
89294
|
}
|
|
89321
89295
|
const parentEl = r.current?.closest(".bp3-dialog-container");
|
|
89322
|
-
const dialogs = document.querySelectorAll(
|
|
89296
|
+
const dialogs = document.querySelectorAll(
|
|
89297
|
+
".bp3-dialog-container"
|
|
89298
|
+
);
|
|
89323
89299
|
const numDialogs = dialogs?.length;
|
|
89324
89300
|
if (numDialogs > 1) {
|
|
89325
89301
|
const topMostDialog = dialogs[numDialogs - 1];
|
|
@@ -89658,6 +89634,7 @@ function MatchHeaders({
|
|
|
89658
89634
|
marginBottom: 10,
|
|
89659
89635
|
marginLeft: 20,
|
|
89660
89636
|
fontSize: 10
|
|
89637
|
+
/* color: Colors.RED1 */
|
|
89661
89638
|
}
|
|
89662
89639
|
},
|
|
89663
89640
|
userMatchedHeader && [
|
|
@@ -91646,10 +91623,7 @@ const UploadCsvWizardDialog = compose(
|
|
|
91646
91623
|
if (props.filesWIssues.length > 0) {
|
|
91647
91624
|
const reduxFormEntitiesArray = [];
|
|
91648
91625
|
const finishedFiles = props.filesWIssues.map((f, i) => {
|
|
91649
|
-
const {
|
|
91650
|
-
reduxFormEntities,
|
|
91651
|
-
reduxFormCellValidation
|
|
91652
|
-
} = reduxForm.formValueSelector(`editableCellTable-${i}`)(
|
|
91626
|
+
const { reduxFormEntities, reduxFormCellValidation } = reduxForm.formValueSelector(`editableCellTable-${i}`)(
|
|
91653
91627
|
state,
|
|
91654
91628
|
"reduxFormEntities",
|
|
91655
91629
|
"reduxFormCellValidation"
|
|
@@ -92026,6 +92000,8 @@ const PreviewCsvData = observer(function(props) {
|
|
|
92026
92000
|
userSchema = exampleData,
|
|
92027
92001
|
initialEntities
|
|
92028
92002
|
} = props;
|
|
92003
|
+
const rerenderKey = React$3.useRef(0);
|
|
92004
|
+
rerenderKey.current = rerenderKey.current + 1;
|
|
92029
92005
|
const data = userSchema.userData && userSchema.userData.length && userSchema.userData.map((row) => {
|
|
92030
92006
|
const toRet = {
|
|
92031
92007
|
_isClean: row._isClean
|
|
@@ -92072,6 +92048,7 @@ const PreviewCsvData = observer(function(props) {
|
|
|
92072
92048
|
{
|
|
92073
92049
|
maxWidth: 800,
|
|
92074
92050
|
maxHeight: 500,
|
|
92051
|
+
rerenderKey: rerenderKey.current,
|
|
92075
92052
|
destroyOnUnmount: false,
|
|
92076
92053
|
doNotValidateUntouchedRows: true,
|
|
92077
92054
|
formName: datatableFormName || "editableCellTable",
|
|
@@ -103904,7 +103881,14 @@ const EnhancedMenuItem = compose(
|
|
|
103904
103881
|
}
|
|
103905
103882
|
}),
|
|
103906
103883
|
branch(({ navTo }) => navTo, withRouter$1)
|
|
103907
|
-
)(function({
|
|
103884
|
+
)(function({
|
|
103885
|
+
navTo,
|
|
103886
|
+
context,
|
|
103887
|
+
staticContext,
|
|
103888
|
+
didMount,
|
|
103889
|
+
willUnmount,
|
|
103890
|
+
...props
|
|
103891
|
+
}) {
|
|
103908
103892
|
let MenuItemComp = core$5.MenuItem;
|
|
103909
103893
|
if (navTo) {
|
|
103910
103894
|
MenuItemComp = MenuItemLink;
|
|
@@ -104962,11 +104946,7 @@ function getCommandHotkeyHandlers(commands) {
|
|
|
104962
104946
|
return handlers;
|
|
104963
104947
|
}
|
|
104964
104948
|
|
|
104965
|
-
const withCommand = (mappings) => (WrappedComponent) => ({
|
|
104966
|
-
cmd,
|
|
104967
|
-
cmdOptions = {},
|
|
104968
|
-
...props
|
|
104969
|
-
}) => {
|
|
104949
|
+
const withCommand = (mappings) => (WrappedComponent) => ({ cmd, cmdOptions = {}, ...props }) => {
|
|
104970
104950
|
const mappedProps = {};
|
|
104971
104951
|
Object.keys(mappings).forEach((k) => {
|
|
104972
104952
|
mappedProps[k] = mappings[k] === "execute" ? (event) => cmd.execute({ event }) : typeof mappings[k] === "function" ? mappings[k](cmd, props) : cmd[mappings[k]];
|
|
@@ -106113,9 +106093,9 @@ const frameTranslations = createReducer(
|
|
|
106113
106093
|
}
|
|
106114
106094
|
},
|
|
106115
106095
|
{
|
|
106116
|
-
|
|
106117
|
-
|
|
106118
|
-
|
|
106096
|
+
1: false,
|
|
106097
|
+
2: false,
|
|
106098
|
+
3: false,
|
|
106119
106099
|
"-1": false,
|
|
106120
106100
|
"-2": false,
|
|
106121
106101
|
"-3": false
|
|
@@ -106844,9 +106824,14 @@ function checkIfNonCircularRangesOverlap(range, comparisonRange) {
|
|
|
106844
106824
|
|
|
106845
106825
|
function checkIfPotentiallyCircularRangesOverlap(range, comparisonRange) {
|
|
106846
106826
|
return splitRangeIntoTwoPartsIfItIsCircular(range, Infinity).some(function(splitRange) {
|
|
106847
|
-
return splitRangeIntoTwoPartsIfItIsCircular(comparisonRange, Infinity).some(
|
|
106848
|
-
|
|
106849
|
-
|
|
106827
|
+
return splitRangeIntoTwoPartsIfItIsCircular(comparisonRange, Infinity).some(
|
|
106828
|
+
function(splitComparisonRange) {
|
|
106829
|
+
return checkIfNonCircularRangesOverlap(
|
|
106830
|
+
splitRange,
|
|
106831
|
+
splitComparisonRange
|
|
106832
|
+
);
|
|
106833
|
+
}
|
|
106834
|
+
);
|
|
106850
106835
|
});
|
|
106851
106836
|
}
|
|
106852
106837
|
|
|
@@ -106856,15 +106841,19 @@ function collapseOverlapsGeneratedFromRangeComparisonIfPossible(overlaps, sequen
|
|
|
106856
106841
|
return overlaps;
|
|
106857
106842
|
} else if (overlaps.length === 2) {
|
|
106858
106843
|
if (overlaps[0].start === 0 && overlaps[1].end + 1 === sequenceLength && !originalRangeLinear) {
|
|
106859
|
-
return [
|
|
106860
|
-
|
|
106861
|
-
|
|
106862
|
-
|
|
106844
|
+
return [
|
|
106845
|
+
{
|
|
106846
|
+
start: overlaps[1].start,
|
|
106847
|
+
end: overlaps[0].end
|
|
106848
|
+
}
|
|
106849
|
+
];
|
|
106863
106850
|
} else if (overlaps[1].start === 0 && overlaps[0].end + 1 === sequenceLength && !originalRangeLinear) {
|
|
106864
|
-
return [
|
|
106865
|
-
|
|
106866
|
-
|
|
106867
|
-
|
|
106851
|
+
return [
|
|
106852
|
+
{
|
|
106853
|
+
start: overlaps[0].start,
|
|
106854
|
+
end: overlaps[1].end
|
|
106855
|
+
}
|
|
106856
|
+
];
|
|
106868
106857
|
} else {
|
|
106869
106858
|
return overlaps;
|
|
106870
106859
|
}
|
|
@@ -106872,17 +106861,29 @@ function collapseOverlapsGeneratedFromRangeComparisonIfPossible(overlaps, sequen
|
|
|
106872
106861
|
const firstOverlap = overlaps[0];
|
|
106873
106862
|
const secondOverlap = overlaps[1];
|
|
106874
106863
|
const thirdOverlap = overlaps[2];
|
|
106875
|
-
let collapsedOverlaps = collapseOverlapsGeneratedFromRangeComparisonIfPossible(
|
|
106864
|
+
let collapsedOverlaps = collapseOverlapsGeneratedFromRangeComparisonIfPossible(
|
|
106865
|
+
[firstOverlap, secondOverlap],
|
|
106866
|
+
sequenceLength,
|
|
106867
|
+
optionalOriginalRange
|
|
106868
|
+
);
|
|
106876
106869
|
if (collapsedOverlaps.length === 1) {
|
|
106877
106870
|
collapsedOverlaps.push(thirdOverlap);
|
|
106878
106871
|
return collapsedOverlaps;
|
|
106879
106872
|
} else {
|
|
106880
|
-
collapsedOverlaps = collapseOverlapsGeneratedFromRangeComparisonIfPossible(
|
|
106873
|
+
collapsedOverlaps = collapseOverlapsGeneratedFromRangeComparisonIfPossible(
|
|
106874
|
+
[firstOverlap, thirdOverlap],
|
|
106875
|
+
sequenceLength,
|
|
106876
|
+
optionalOriginalRange
|
|
106877
|
+
);
|
|
106881
106878
|
if (collapsedOverlaps.length === 1) {
|
|
106882
106879
|
collapsedOverlaps.push(secondOverlap);
|
|
106883
106880
|
return collapsedOverlaps;
|
|
106884
106881
|
} else {
|
|
106885
|
-
collapsedOverlaps = collapseOverlapsGeneratedFromRangeComparisonIfPossible(
|
|
106882
|
+
collapsedOverlaps = collapseOverlapsGeneratedFromRangeComparisonIfPossible(
|
|
106883
|
+
[secondOverlap, thirdOverlap],
|
|
106884
|
+
sequenceLength,
|
|
106885
|
+
optionalOriginalRange
|
|
106886
|
+
);
|
|
106886
106887
|
if (collapsedOverlaps.length === 1) {
|
|
106887
106888
|
collapsedOverlaps.push(firstOverlap);
|
|
106888
106889
|
return collapsedOverlaps;
|
|
@@ -106904,11 +106905,18 @@ function convertRangeIndices(range, inputType, outputType) {
|
|
|
106904
106905
|
}
|
|
106905
106906
|
|
|
106906
106907
|
function convertRangeTo0Based(range) {
|
|
106907
|
-
return convertRangeIndices(range, {
|
|
106908
|
+
return convertRangeIndices(range, {
|
|
106909
|
+
inclusive1BasedStart: true,
|
|
106910
|
+
inclusive1BasedEnd: true
|
|
106911
|
+
});
|
|
106908
106912
|
}
|
|
106909
106913
|
|
|
106910
106914
|
function convertRangeTo1Based(range) {
|
|
106911
|
-
return convertRangeIndices(
|
|
106915
|
+
return convertRangeIndices(
|
|
106916
|
+
range,
|
|
106917
|
+
{},
|
|
106918
|
+
{ inclusive1BasedStart: true, inclusive1BasedEnd: true }
|
|
106919
|
+
);
|
|
106912
106920
|
}
|
|
106913
106921
|
|
|
106914
106922
|
function provideInclusiveOptions(funToWrap) {
|
|
@@ -107013,7 +107021,11 @@ function expandOrContractCircularRangeToPosition(range, position, maxLength) {
|
|
|
107013
107021
|
let endMoved = true;
|
|
107014
107022
|
if (range.end >= position) {
|
|
107015
107023
|
if (position + maxLength - range.start > range.end - position) {
|
|
107016
|
-
newRange.end = normalizePositionByRangeLength(
|
|
107024
|
+
newRange.end = normalizePositionByRangeLength(
|
|
107025
|
+
position - 1,
|
|
107026
|
+
maxLength,
|
|
107027
|
+
false
|
|
107028
|
+
);
|
|
107017
107029
|
} else {
|
|
107018
107030
|
newRange.start = position;
|
|
107019
107031
|
endMoved = false;
|
|
@@ -107086,19 +107098,31 @@ function expandOrContractRangeToPosition(range, position, maxLength) {
|
|
|
107086
107098
|
if (range.start > range.end) {
|
|
107087
107099
|
return expandOrContractCircularRangeToPosition(range, position, maxLength);
|
|
107088
107100
|
} else {
|
|
107089
|
-
return expandOrContractNonCircularRangeToPosition(
|
|
107101
|
+
return expandOrContractNonCircularRangeToPosition(
|
|
107102
|
+
range,
|
|
107103
|
+
position);
|
|
107090
107104
|
}
|
|
107091
107105
|
}
|
|
107092
107106
|
|
|
107093
107107
|
function translateRange(rangeToBeAdjusted, translateBy, rangeLength) {
|
|
107094
107108
|
return lodashExports.assign({}, rangeToBeAdjusted, {
|
|
107095
|
-
start: normalizePositionByRangeLength(
|
|
107096
|
-
|
|
107109
|
+
start: normalizePositionByRangeLength(
|
|
107110
|
+
rangeToBeAdjusted.start + translateBy,
|
|
107111
|
+
rangeLength
|
|
107112
|
+
),
|
|
107113
|
+
end: normalizePositionByRangeLength(
|
|
107114
|
+
rangeToBeAdjusted.end + translateBy,
|
|
107115
|
+
rangeLength
|
|
107116
|
+
)
|
|
107097
107117
|
});
|
|
107098
107118
|
}
|
|
107099
107119
|
|
|
107100
107120
|
function flipRelativeRange(innerRange, outerRange, sequenceLength, options) {
|
|
107101
|
-
const isFullyContained = isRangeWithinRange(
|
|
107121
|
+
const isFullyContained = isRangeWithinRange(
|
|
107122
|
+
innerRange,
|
|
107123
|
+
outerRange,
|
|
107124
|
+
sequenceLength
|
|
107125
|
+
);
|
|
107102
107126
|
if (isFullyContained) {
|
|
107103
107127
|
return flipFullyContainedRange(innerRange, outerRange, sequenceLength);
|
|
107104
107128
|
} else {
|
|
@@ -107106,40 +107130,91 @@ function flipRelativeRange(innerRange, outerRange, sequenceLength, options) {
|
|
|
107106
107130
|
}
|
|
107107
107131
|
}
|
|
107108
107132
|
function flipNonFullyContainedRange(innerRange, outerRange, sequenceLength, options) {
|
|
107109
|
-
const outerFullyContained = isRangeWithinRange(
|
|
107133
|
+
const outerFullyContained = isRangeWithinRange(
|
|
107134
|
+
outerRange,
|
|
107135
|
+
innerRange,
|
|
107136
|
+
sequenceLength
|
|
107137
|
+
);
|
|
107110
107138
|
let flippedInnerRange;
|
|
107111
107139
|
if (outerFullyContained) {
|
|
107112
|
-
const expandBy1 = getRangeLength(
|
|
107113
|
-
|
|
107114
|
-
|
|
107115
|
-
|
|
107116
|
-
|
|
107117
|
-
|
|
107118
|
-
|
|
107119
|
-
|
|
107120
|
-
|
|
107121
|
-
|
|
107140
|
+
const expandBy1 = getRangeLength(
|
|
107141
|
+
{
|
|
107142
|
+
start: innerRange.start,
|
|
107143
|
+
end: outerRange.start
|
|
107144
|
+
},
|
|
107145
|
+
sequenceLength
|
|
107146
|
+
) - 1;
|
|
107147
|
+
flippedInnerRange = expandOrContractRangeByLength(
|
|
107148
|
+
outerRange,
|
|
107149
|
+
expandBy1,
|
|
107150
|
+
false,
|
|
107151
|
+
sequenceLength
|
|
107152
|
+
);
|
|
107153
|
+
const expandBy2 = getRangeLength(
|
|
107154
|
+
{
|
|
107155
|
+
end: innerRange.end,
|
|
107156
|
+
start: outerRange.end
|
|
107157
|
+
},
|
|
107158
|
+
sequenceLength
|
|
107159
|
+
) - 1;
|
|
107160
|
+
flippedInnerRange = expandOrContractRangeByLength(
|
|
107161
|
+
flippedInnerRange,
|
|
107162
|
+
expandBy2,
|
|
107163
|
+
true,
|
|
107164
|
+
sequenceLength
|
|
107165
|
+
);
|
|
107122
107166
|
} else {
|
|
107123
|
-
const overlaps = getOverlapsOfPotentiallyCircularRanges(
|
|
107167
|
+
const overlaps = getOverlapsOfPotentiallyCircularRanges(
|
|
107168
|
+
innerRange,
|
|
107169
|
+
outerRange,
|
|
107170
|
+
sequenceLength
|
|
107171
|
+
);
|
|
107124
107172
|
if (overlaps.length >= 1) {
|
|
107125
107173
|
let overlapExtendsForward;
|
|
107126
107174
|
const firstOverlap = overlaps[0];
|
|
107127
107175
|
overlapExtendsForward = firstOverlap.start !== outerRange.start;
|
|
107128
|
-
const flippedTruncatedInner = flipFullyContainedRange(
|
|
107176
|
+
const flippedTruncatedInner = flipFullyContainedRange(
|
|
107177
|
+
firstOverlap,
|
|
107178
|
+
outerRange,
|
|
107179
|
+
sequenceLength
|
|
107180
|
+
);
|
|
107129
107181
|
const lengthToExtend = getRangeLength(innerRange, sequenceLength) - getRangeLength(flippedTruncatedInner, sequenceLength);
|
|
107130
|
-
flippedInnerRange = expandOrContractRangeByLength(
|
|
107182
|
+
flippedInnerRange = expandOrContractRangeByLength(
|
|
107183
|
+
flippedTruncatedInner,
|
|
107184
|
+
lengthToExtend,
|
|
107185
|
+
overlapExtendsForward,
|
|
107186
|
+
sequenceLength
|
|
107187
|
+
);
|
|
107131
107188
|
} else {
|
|
107132
|
-
throw new Error(
|
|
107189
|
+
throw new Error(
|
|
107190
|
+
"This case (relative ranges that do not overlap) is unsupported! "
|
|
107191
|
+
);
|
|
107133
107192
|
}
|
|
107134
107193
|
}
|
|
107135
107194
|
return flippedInnerRange;
|
|
107136
107195
|
}
|
|
107137
107196
|
function flipFullyContainedRange(innerRange, outerRange, sequenceLength, options) {
|
|
107138
107197
|
const translateBy = -outerRange.start;
|
|
107139
|
-
const translatedOuterRange = translateRange(
|
|
107140
|
-
|
|
107141
|
-
|
|
107142
|
-
|
|
107198
|
+
const translatedOuterRange = translateRange(
|
|
107199
|
+
outerRange,
|
|
107200
|
+
translateBy,
|
|
107201
|
+
sequenceLength
|
|
107202
|
+
);
|
|
107203
|
+
const translatedInnerRange = translateRange(
|
|
107204
|
+
innerRange,
|
|
107205
|
+
translateBy,
|
|
107206
|
+
sequenceLength
|
|
107207
|
+
);
|
|
107208
|
+
const translatedFlippedInnerRange = flipNonOriginSpanningContainedRange(
|
|
107209
|
+
translatedInnerRange,
|
|
107210
|
+
translatedOuterRange,
|
|
107211
|
+
sequenceLength
|
|
107212
|
+
);
|
|
107213
|
+
const flippedInnerRange = translateRange(
|
|
107214
|
+
translatedFlippedInnerRange,
|
|
107215
|
+
-translateBy,
|
|
107216
|
+
sequenceLength
|
|
107217
|
+
);
|
|
107143
107218
|
return flippedInnerRange;
|
|
107144
107219
|
}
|
|
107145
107220
|
function flipNonOriginSpanningContainedRange(innerRange, outerRange, sequenceLength) {
|
|
@@ -107311,9 +107386,15 @@ function trimNumberToFitWithin0ToAnotherNumber(numberToBeTrimmed, max) {
|
|
|
107311
107386
|
}
|
|
107312
107387
|
|
|
107313
107388
|
function zeroSubrangeByContainerRange(subRange, containerRange, sequenceLength) {
|
|
107314
|
-
const trimmedSubRange = trimRangeByAnotherRange(
|
|
107389
|
+
const trimmedSubRange = trimRangeByAnotherRange(
|
|
107390
|
+
subRange,
|
|
107391
|
+
containerRange,
|
|
107392
|
+
sequenceLength
|
|
107393
|
+
);
|
|
107315
107394
|
if (trimmedSubRange) {
|
|
107316
|
-
throw new Error(
|
|
107395
|
+
throw new Error(
|
|
107396
|
+
"subRange must be fully contained by containerRange! Otherwise this function does not make sense"
|
|
107397
|
+
);
|
|
107317
107398
|
}
|
|
107318
107399
|
const newSubrange = {};
|
|
107319
107400
|
newSubrange.start = subRange.start - containerRange.start;
|
|
@@ -107340,12 +107421,24 @@ function modulo(n, m) {
|
|
|
107340
107421
|
}
|
|
107341
107422
|
|
|
107342
107423
|
function getZeroedRangeOverlaps(annotation, selection, sequenceLength) {
|
|
107343
|
-
const overlaps = collapseOverlapsGeneratedFromRangeComparisonIfPossible(
|
|
107424
|
+
const overlaps = collapseOverlapsGeneratedFromRangeComparisonIfPossible(
|
|
107425
|
+
getOverlapsOfPotentiallyCircularRanges(
|
|
107426
|
+
annotation,
|
|
107427
|
+
selection,
|
|
107428
|
+
sequenceLength
|
|
107429
|
+
),
|
|
107430
|
+
sequenceLength,
|
|
107431
|
+
annotation
|
|
107432
|
+
);
|
|
107344
107433
|
const zeroedOverlaps = overlaps.map((overlap) => {
|
|
107345
|
-
return zeroSubrangeByContainerRange(
|
|
107346
|
-
|
|
107347
|
-
|
|
107348
|
-
|
|
107434
|
+
return zeroSubrangeByContainerRange(
|
|
107435
|
+
overlap,
|
|
107436
|
+
{
|
|
107437
|
+
start: selection.start,
|
|
107438
|
+
end: normalizePositionByRangeLength(selection.start - 1, sequenceLength)
|
|
107439
|
+
},
|
|
107440
|
+
sequenceLength
|
|
107441
|
+
);
|
|
107349
107442
|
});
|
|
107350
107443
|
return zeroedOverlaps;
|
|
107351
107444
|
}
|
|
@@ -113698,9 +113791,9 @@ function coerceLocation({
|
|
|
113698
113791
|
function filterAminoAcidSequenceString(sequenceString, options) {
|
|
113699
113792
|
options = options || {};
|
|
113700
113793
|
if (options.includeStopCodon) {
|
|
113701
|
-
return sequenceString
|
|
113794
|
+
return sequenceString?.replace(/[^xtgalmfwkqespvicyhrndu.*]/gi, "");
|
|
113702
113795
|
}
|
|
113703
|
-
return sequenceString
|
|
113796
|
+
return sequenceString?.replace(/[^xtgalmfwkqespvicyhrndu]/gi, "");
|
|
113704
113797
|
}
|
|
113705
113798
|
|
|
113706
113799
|
function getDegenerateDnaStringFromAAString(aaString) {
|
|
@@ -114051,7 +114144,7 @@ const calcTmMethods = {
|
|
|
114051
114144
|
calculateTemperature: function(sequence, type, A, R, C, Na) {
|
|
114052
114145
|
if (typeof type === "undefined") {
|
|
114053
114146
|
type = this.TABLE_BRESLAUER;
|
|
114054
|
-
} else if (type != this.TABLE_BRESLAUER &&
|
|
114147
|
+
} else if (type != this.TABLE_BRESLAUER && type != this.TABLE_UNIFIED && type != this.TABLE_SUGIMOTO) {
|
|
114055
114148
|
throw new Error("Invalid table type!");
|
|
114056
114149
|
}
|
|
114057
114150
|
if (!A) {
|
|
@@ -122310,12 +122403,7 @@ function findSequenceMatches(sequence, searchString, options = {}) {
|
|
|
122310
122403
|
return matches;
|
|
122311
122404
|
}
|
|
122312
122405
|
function findSequenceMatchesTopStrand(sequence, searchString, options = {}) {
|
|
122313
|
-
const {
|
|
122314
|
-
isCircular,
|
|
122315
|
-
isAmbiguous,
|
|
122316
|
-
isProteinSequence,
|
|
122317
|
-
isProteinSearch
|
|
122318
|
-
} = options;
|
|
122406
|
+
const { isCircular, isAmbiguous, isProteinSequence, isProteinSearch } = options;
|
|
122319
122407
|
let searchStringToUse = escapeStringRegexp(searchString);
|
|
122320
122408
|
if (isAmbiguous) {
|
|
122321
122409
|
if (isProteinSearch || isProteinSequence) {
|
|
@@ -122397,7 +122485,10 @@ function convertAmbiguousStringToRegex(string, isProtein) {
|
|
|
122397
122485
|
|
|
122398
122486
|
function getComplementSequenceString(sequence, isRna) {
|
|
122399
122487
|
let complementSeqString = "";
|
|
122400
|
-
const complementMap = lodashExports.merge(
|
|
122488
|
+
const complementMap = lodashExports.merge(
|
|
122489
|
+
DNAComplementMap,
|
|
122490
|
+
isRna ? { a: "u", A: "U" } : { a: "t", A: "T" }
|
|
122491
|
+
);
|
|
122401
122492
|
for (let i = 0; i < sequence.length; i++) {
|
|
122402
122493
|
let complementChar = complementMap[sequence[i]];
|
|
122403
122494
|
if (!complementChar) {
|
|
@@ -135068,10 +135159,7 @@ async function geneiousXmlToJson(string, options) {
|
|
|
135068
135159
|
});
|
|
135069
135160
|
}
|
|
135070
135161
|
});
|
|
135071
|
-
const toRet = lodashExports.filter(
|
|
135072
|
-
resultArray,
|
|
135073
|
-
(r) => r?.parsedSequence?.sequence?.length
|
|
135074
|
-
);
|
|
135162
|
+
const toRet = lodashExports.filter(resultArray, (r) => r?.parsedSequence?.sequence?.length);
|
|
135075
135163
|
if (toRet.length)
|
|
135076
135164
|
return toRet;
|
|
135077
135165
|
return onFileParsed(resultArray);
|
|
@@ -135173,10 +135261,7 @@ async function jbeiXmlToJson(string, options) {
|
|
|
135173
135261
|
messages: ["Error while parsing JBEI format"]
|
|
135174
135262
|
});
|
|
135175
135263
|
}
|
|
135176
|
-
const toRet = lodashExports.filter(
|
|
135177
|
-
resultArray,
|
|
135178
|
-
(r) => r?.parsedSequence?.sequence?.length
|
|
135179
|
-
);
|
|
135264
|
+
const toRet = lodashExports.filter(resultArray, (r) => r?.parsedSequence?.sequence?.length);
|
|
135180
135265
|
if (toRet.length)
|
|
135181
135266
|
return toRet;
|
|
135182
135267
|
return onFileParsed(resultArray);
|
|
@@ -138451,10 +138536,7 @@ const lastSavedId$1 = /*#__PURE__*/Object.freeze(/*#__PURE__*/Object.definePrope
|
|
|
138451
138536
|
lastSavedIdUpdate
|
|
138452
138537
|
}, Symbol.toStringTag, { value: 'Module' }));
|
|
138453
138538
|
|
|
138454
|
-
const toggleReadOnlyMode = createMetaAction(
|
|
138455
|
-
"TOGGLE_READ_ONLY_MODE",
|
|
138456
|
-
lodashExports.noop
|
|
138457
|
-
);
|
|
138539
|
+
const toggleReadOnlyMode = createMetaAction("TOGGLE_READ_ONLY_MODE", lodashExports.noop);
|
|
138458
138540
|
const updateReadOnlyMode = createMetaAction("UPDATE_READ_ONLY_MODE");
|
|
138459
138541
|
const readOnly = createReducer(
|
|
138460
138542
|
{
|
|
@@ -142167,6 +142249,9 @@ function showAddOrEditAnnotationDialog({
|
|
|
142167
142249
|
overrideName: `AddOrEdit${nameUpper}DialogOverride`,
|
|
142168
142250
|
dialogType,
|
|
142169
142251
|
props: {
|
|
142252
|
+
...annotation.isEditLocked && {
|
|
142253
|
+
readOnly: typeof annotation.isEditLocked === "string" ? annotation.isEditLocked : "This annotation is locked"
|
|
142254
|
+
},
|
|
142170
142255
|
dialogProps: {
|
|
142171
142256
|
title: annotation && annotation.id ? `Edit ${nameUpper}` : `New ${nameUpper}`
|
|
142172
142257
|
},
|
|
@@ -142808,7 +142893,8 @@ function mapStateToProps(state, ownProps) {
|
|
|
142808
142893
|
editorName,
|
|
142809
142894
|
sequenceData: sequenceDataFromProps,
|
|
142810
142895
|
allowSeqDataOverride,
|
|
142811
|
-
allowMultipleFeatureDirections
|
|
142896
|
+
allowMultipleFeatureDirections,
|
|
142897
|
+
readOnly
|
|
142812
142898
|
} = ownProps;
|
|
142813
142899
|
const editorState = getEditorState(state, editorName);
|
|
142814
142900
|
const meta = { editorName };
|
|
@@ -142868,6 +142954,7 @@ function mapStateToProps(state, ownProps) {
|
|
|
142868
142954
|
const f = getFindTool(findTool, matchesTotal);
|
|
142869
142955
|
return {
|
|
142870
142956
|
...editorState,
|
|
142957
|
+
readOnly: readOnly || editorState.readOnly,
|
|
142871
142958
|
meta,
|
|
142872
142959
|
annotationToAdd,
|
|
142873
142960
|
...newSelection && { selectionLayer: newSelection },
|
|
@@ -161052,7 +161139,7 @@ function showFileDialog({ multiple = false, onSelect }) {
|
|
|
161052
161139
|
}
|
|
161053
161140
|
|
|
161054
161141
|
const name = "@teselagen/ove";
|
|
161055
|
-
const version = "0.3.
|
|
161142
|
+
const version = "0.3.12";
|
|
161056
161143
|
const main = "./src/index.js";
|
|
161057
161144
|
const exports$1 = {
|
|
161058
161145
|
".": {
|
|
@@ -161594,6 +161681,184 @@ function ToggleShowMeltingTemp(props) {
|
|
|
161594
161681
|
);
|
|
161595
161682
|
}
|
|
161596
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
|
+
|
|
161597
161862
|
const isProtein = (props) => props.sequenceData && props.sequenceData.isProtein;
|
|
161598
161863
|
const isOligo = (props) => props.sequenceData && props.sequenceData.isOligo;
|
|
161599
161864
|
const isRna = (props) => props.sequenceData && props.sequenceData.isRna;
|
|
@@ -161662,7 +161927,7 @@ const fileCommandDefs = {
|
|
|
161662
161927
|
isHidden: isProtein
|
|
161663
161928
|
},
|
|
161664
161929
|
deleteSequence: {
|
|
161665
|
-
isDisabled: (props) => props.readOnly && readOnlyDisabledTooltip || !props.onDelete,
|
|
161930
|
+
isDisabled: (props) => props.disableBpEditing && bpEditingDisabledTooltip || props.readOnly && readOnlyDisabledTooltip || !props.onDelete,
|
|
161666
161931
|
isHidden: (props) => !props.onDelete,
|
|
161667
161932
|
handler: (props) => props.onDelete(props.sequenceData)
|
|
161668
161933
|
},
|
|
@@ -161677,7 +161942,7 @@ const fileCommandDefs = {
|
|
|
161677
161942
|
isDisabled: (props) => props.disableSetReadOnly || !props.onSave,
|
|
161678
161943
|
isHidden: (props) => !props.toggleReadOnlyMode,
|
|
161679
161944
|
isActive: (props) => props.readOnly,
|
|
161680
|
-
handler: (props) => props.
|
|
161945
|
+
handler: (props) => handleReadOnlyChange(!props.readOnly, props)
|
|
161681
161946
|
},
|
|
161682
161947
|
importSequence: {
|
|
161683
161948
|
isHidden: (props) => props.hideSingleImport,
|
|
@@ -161861,6 +162126,7 @@ Object.keys(defaultCopyOptions).forEach((type) => {
|
|
|
161861
162126
|
};
|
|
161862
162127
|
});
|
|
161863
162128
|
const readOnlyDisabledTooltip = "Sorry this function is not allowed in Read-Only Mode";
|
|
162129
|
+
const bpEditingDisabledTooltip = "Sequence Editing Disabled";
|
|
161864
162130
|
const noSelection = ({ selectionLayer = {} }) => !(selectionLayer.start > -1 && selectionLayer.end > -1) && "Selection Required";
|
|
161865
162131
|
const triggerClipboardCommand = (type) => {
|
|
161866
162132
|
const wrapper = document.querySelector(".veVectorInteractionWrapper");
|
|
@@ -161892,8 +162158,8 @@ const editCommandDefs = {
|
|
|
161892
162158
|
handler: lodashExports.noop
|
|
161893
162159
|
},
|
|
161894
162160
|
cut: {
|
|
161895
|
-
isDisabled: (props) => props.readOnly && readOnlyDisabledTooltip || props.sequenceLength === 0,
|
|
161896
|
-
isHidden: (props) => props.readOnly,
|
|
162161
|
+
isDisabled: (props) => props.disableBpEditing && bpEditingDisabledTooltip || props.readOnly && readOnlyDisabledTooltip || props.sequenceLength === 0,
|
|
162162
|
+
isHidden: (props) => props.readOnly || props.disableBpEditing,
|
|
161897
162163
|
handler: () => {
|
|
161898
162164
|
triggerClipboardCommand("cut");
|
|
161899
162165
|
},
|
|
@@ -161918,7 +162184,7 @@ const editCommandDefs = {
|
|
|
161918
162184
|
},
|
|
161919
162185
|
paste: {
|
|
161920
162186
|
isDisabled: (props) => props.readOnly && readOnlyDisabledTooltip,
|
|
161921
|
-
isHidden: (props) => props.readOnly,
|
|
162187
|
+
isHidden: (props) => props.readOnly || props.disableBpEditing,
|
|
161922
162188
|
handler: () => triggerClipboardCommand("paste"),
|
|
161923
162189
|
hotkey: "mod+v"
|
|
161924
162190
|
},
|
|
@@ -162072,12 +162338,12 @@ const editCommandDefs = {
|
|
|
162072
162338
|
hotkey: "mod+i"
|
|
162073
162339
|
},
|
|
162074
162340
|
complementSelection: {
|
|
162075
|
-
isHidden: (props) => props.readOnly || isProtein(props),
|
|
162341
|
+
isHidden: (props) => props.readOnly || isProtein(props) || props.disableBpEditing,
|
|
162076
162342
|
isDisabled: (props) => props.readOnly && readOnlyDisabledTooltip || noSelection(props),
|
|
162077
162343
|
handler: (props) => props.handleComplementSelection()
|
|
162078
162344
|
},
|
|
162079
162345
|
complementEntireSequence: {
|
|
162080
|
-
isHidden: (props) => props.readOnly || isProtein(props),
|
|
162346
|
+
isHidden: (props) => props.readOnly || isProtein(props) || props.disableBpEditing,
|
|
162081
162347
|
isDisabled: (props) => props.readOnly && readOnlyDisabledTooltip || props.sequenceLength === 0,
|
|
162082
162348
|
handler: (props) => props.handleComplementSequence()
|
|
162083
162349
|
},
|
|
@@ -162229,13 +162495,13 @@ const editCommandDefs = {
|
|
|
162229
162495
|
// }
|
|
162230
162496
|
// },
|
|
162231
162497
|
reverseComplementSelection: {
|
|
162232
|
-
isDisabled: (props) => props.readOnly && readOnlyDisabledTooltip || noSelection(props),
|
|
162498
|
+
isDisabled: (props) => props.readOnly && readOnlyDisabledTooltip || noSelection(props) || props.disableBpEditing,
|
|
162233
162499
|
isHidden: (props) => props.readOnly || isProtein(props),
|
|
162234
162500
|
handler: (props) => props.handleReverseComplementSelection(),
|
|
162235
162501
|
hotkey: "mod+e"
|
|
162236
162502
|
},
|
|
162237
162503
|
reverseComplementEntireSequence: {
|
|
162238
|
-
isHidden: (props) => props.readOnly || isProtein(props),
|
|
162504
|
+
isHidden: (props) => props.readOnly || isProtein(props) || props.disableBpEditing,
|
|
162239
162505
|
isDisabled: (props) => props.readOnly && readOnlyDisabledTooltip || props.sequenceLength === 0,
|
|
162240
162506
|
handler: (props) => props.handleReverseComplementSequence()
|
|
162241
162507
|
},
|
|
@@ -162385,7 +162651,7 @@ const editCommandDefs = {
|
|
|
162385
162651
|
isDisabled: (props) => props.readOnly && readOnlyDisabledTooltip || props.sequenceLength === 0
|
|
162386
162652
|
},
|
|
162387
162653
|
rotateToCaretPosition: {
|
|
162388
|
-
isHidden: (props) => props.readOnly || isProtein(props),
|
|
162654
|
+
isHidden: (props) => props.readOnly || isProtein(props) || props.disableBpEditing,
|
|
162389
162655
|
isDisabled: (props) => props.readOnly && readOnlyDisabledTooltip || props.caretPosition === -1 && "You must first place cursor" || !props.sequenceData.circular && "Disabled for Linear Sequences" || props.sequenceLength === 0,
|
|
162390
162656
|
handler: (props) => props.handleRotateToCaretPosition(),
|
|
162391
162657
|
hotkey: "mod+b"
|
|
@@ -162394,13 +162660,13 @@ const editCommandDefs = {
|
|
|
162394
162660
|
};
|
|
162395
162661
|
const cirularityCommandDefs = {
|
|
162396
162662
|
circular: {
|
|
162397
|
-
isHidden: (props) => props.readOnly || isProtein(props),
|
|
162663
|
+
isHidden: (props) => props.readOnly || isProtein(props) || props.disableBpEditing,
|
|
162398
162664
|
isDisabled: (props) => props.readOnly && readOnlyDisabledTooltip,
|
|
162399
162665
|
handler: (props) => props.updateCircular(true),
|
|
162400
162666
|
isActive: (props) => props && props.sequenceData.circular
|
|
162401
162667
|
},
|
|
162402
162668
|
linear: {
|
|
162403
|
-
isHidden: (props) => props.readOnly,
|
|
162669
|
+
isHidden: (props) => props.readOnly || props.disableBpEditing,
|
|
162404
162670
|
isDisabled: (props) => props.readOnly && readOnlyDisabledTooltip,
|
|
162405
162671
|
handler: (props) => props.updateCircular(false),
|
|
162406
162672
|
isActive: (props) => props && !props.sequenceData.circular
|
|
@@ -162427,29 +162693,27 @@ const nicheAnnotations = [
|
|
|
162427
162693
|
}
|
|
162428
162694
|
];
|
|
162429
162695
|
const labelToggleCommandDefs = {};
|
|
162430
|
-
["feature", "part", "cutsite", "primer", ...nicheAnnotations].forEach(
|
|
162431
|
-
|
|
162432
|
-
|
|
162433
|
-
|
|
162434
|
-
|
|
162435
|
-
|
|
162436
|
-
|
|
162437
|
-
|
|
162438
|
-
|
|
162439
|
-
|
|
162440
|
-
|
|
162441
|
-
|
|
162442
|
-
|
|
162443
|
-
|
|
162444
|
-
|
|
162445
|
-
|
|
162446
|
-
|
|
162447
|
-
|
|
162448
|
-
|
|
162449
|
-
|
|
162450
|
-
|
|
162451
|
-
}
|
|
162452
|
-
);
|
|
162696
|
+
["feature", "part", "cutsite", "primer", ...nicheAnnotations].forEach((_type) => {
|
|
162697
|
+
let rest = {};
|
|
162698
|
+
let type = _type;
|
|
162699
|
+
if (_type.type) {
|
|
162700
|
+
type = _type.type.slice(0, -1);
|
|
162701
|
+
rest = _type;
|
|
162702
|
+
}
|
|
162703
|
+
const cmdId = `toggle${lodashExports.upperFirst(type)}Labels`;
|
|
162704
|
+
const plural = type + "s";
|
|
162705
|
+
labelToggleCommandDefs[cmdId] = {
|
|
162706
|
+
toggle: ["show", "hide"],
|
|
162707
|
+
handler: (props) => props.annotationLabelVisibilityToggle(plural),
|
|
162708
|
+
isHidden: (props) => {
|
|
162709
|
+
return props && props.typesToOmit && props.typesToOmit[plural] === false;
|
|
162710
|
+
},
|
|
162711
|
+
...rest,
|
|
162712
|
+
isActive: (props) => {
|
|
162713
|
+
return props && props.annotationLabelVisibility[plural];
|
|
162714
|
+
}
|
|
162715
|
+
};
|
|
162716
|
+
});
|
|
162453
162717
|
const editAnnotationCommandDefs = ["feature", "part", "primer"].reduce(
|
|
162454
162718
|
(acc, key) => {
|
|
162455
162719
|
acc[`edit${lodashExports.upperFirst(key)}`] = {
|
|
@@ -166638,8 +166902,12 @@ function VectorInteractionHOC(Component) {
|
|
|
166638
166902
|
caretPosition = -1,
|
|
166639
166903
|
selectionLayer = { start: -1, end: -1 },
|
|
166640
166904
|
readOnly,
|
|
166641
|
-
onPaste
|
|
166905
|
+
onPaste,
|
|
166906
|
+
disableBpEditing
|
|
166642
166907
|
} = this.props;
|
|
166908
|
+
if (disableBpEditing) {
|
|
166909
|
+
return window.toastr.warning("Sorry the underlying sequence is locked");
|
|
166910
|
+
}
|
|
166643
166911
|
if (readOnly) {
|
|
166644
166912
|
return window.toastr.warning("Sorry the sequence is Read-Only");
|
|
166645
166913
|
}
|
|
@@ -166680,6 +166948,7 @@ function VectorInteractionHOC(Component) {
|
|
|
166680
166948
|
sequenceData,
|
|
166681
166949
|
selectionLayer,
|
|
166682
166950
|
copyOptions,
|
|
166951
|
+
disableBpEditing,
|
|
166683
166952
|
readOnly
|
|
166684
166953
|
} = this.props;
|
|
166685
166954
|
const onCut = this.props.onCut || this.props.onCopy || lodashExports.noop;
|
|
@@ -166705,7 +166974,7 @@ function VectorInteractionHOC(Component) {
|
|
|
166705
166974
|
);
|
|
166706
166975
|
if (!(this.sequenceDataToCopy || {}).textToCopy && !seqData.sequence.length)
|
|
166707
166976
|
return window.toastr.warning(
|
|
166708
|
-
`No Sequence Selected To ${isCut && !readOnly ? "Cut" : "Copy"}`
|
|
166977
|
+
`No Sequence Selected To ${isCut && !(readOnly || disableBpEditing) ? "Cut" : "Copy"}`
|
|
166709
166978
|
);
|
|
166710
166979
|
const clipboardData = e.clipboardData;
|
|
166711
166980
|
const textToCopy = (this.sequenceDataToCopy || {}).textToCopy !== void 0 ? this.sequenceDataToCopy.textToCopy : seqData.isProtein ? seqData.proteinSequence : seqData.sequence;
|
|
@@ -166713,7 +166982,7 @@ function VectorInteractionHOC(Component) {
|
|
|
166713
166982
|
clipboardData.setData("text/plain", textToCopy);
|
|
166714
166983
|
clipboardData.setData("application/json", JSON.stringify(seqData));
|
|
166715
166984
|
e.preventDefault();
|
|
166716
|
-
if (isCut && !readOnly) {
|
|
166985
|
+
if (isCut && !(readOnly || disableBpEditing) && !disableBpEditing) {
|
|
166717
166986
|
this.handleDnaDelete(false);
|
|
166718
166987
|
onCut(
|
|
166719
166988
|
e,
|
|
@@ -166726,7 +166995,7 @@ function VectorInteractionHOC(Component) {
|
|
|
166726
166995
|
document.body.removeEventListener("copy", this.handleCopy);
|
|
166727
166996
|
}
|
|
166728
166997
|
window.toastr.success(
|
|
166729
|
-
`Selection ${isCut && !readOnly ? "Cut" : "Copied"}`
|
|
166998
|
+
`Selection ${isCut && !(readOnly || disableBpEditing) && !disableBpEditing ? "Cut" : "Copied"}`
|
|
166730
166999
|
);
|
|
166731
167000
|
this.sequenceDataToCopy = void 0;
|
|
166732
167001
|
};
|
|
@@ -166737,14 +167006,18 @@ function VectorInteractionHOC(Component) {
|
|
|
166737
167006
|
caretPosition = -1,
|
|
166738
167007
|
selectionLayer = { start: -1, end: -1 },
|
|
166739
167008
|
sequenceData = { sequence: "" },
|
|
166740
|
-
readOnly
|
|
167009
|
+
readOnly,
|
|
167010
|
+
disableBpEditing
|
|
166741
167011
|
// updateSequenceData,
|
|
166742
167012
|
// wrappedInsertSequenceDataAtPositionOrRange
|
|
166743
167013
|
// handleInsert
|
|
166744
167014
|
} = this.props;
|
|
166745
167015
|
const sequenceLength = sequenceData.sequence.length;
|
|
166746
167016
|
const isReplace = selectionLayer.start > -1;
|
|
166747
|
-
if (
|
|
167017
|
+
if (disableBpEditing) {
|
|
167018
|
+
return window.toastr.warning("Sorry the underlying sequence is locked");
|
|
167019
|
+
}
|
|
167020
|
+
if (readOnly || disableBpEditing) {
|
|
166748
167021
|
window.toastr.warning("Sorry the sequence is Read-Only");
|
|
166749
167022
|
} else {
|
|
166750
167023
|
createSequenceInputPopup({
|
|
@@ -166772,13 +167045,17 @@ function VectorInteractionHOC(Component) {
|
|
|
166772
167045
|
selectionLayer = { start: -1, end: -1 },
|
|
166773
167046
|
sequenceData = { sequence: "" },
|
|
166774
167047
|
readOnly,
|
|
167048
|
+
disableBpEditing,
|
|
166775
167049
|
updateSequenceData,
|
|
166776
167050
|
wrappedInsertSequenceDataAtPositionOrRange,
|
|
166777
167051
|
caretPositionUpdate
|
|
166778
167052
|
// handleInsert
|
|
166779
167053
|
} = this.props;
|
|
166780
167054
|
const sequenceLength = sequenceData.sequence.length;
|
|
166781
|
-
if (
|
|
167055
|
+
if (disableBpEditing) {
|
|
167056
|
+
return window.toastr.warning("Sorry the underlying sequence is locked");
|
|
167057
|
+
}
|
|
167058
|
+
if (readOnly || disableBpEditing) {
|
|
166782
167059
|
return window.toastr.warning("Sorry the sequence is Read-Only");
|
|
166783
167060
|
}
|
|
166784
167061
|
if (sequenceLength > 0) {
|
|
@@ -166909,7 +167186,7 @@ function VectorInteractionHOC(Component) {
|
|
|
166909
167186
|
};
|
|
166910
167187
|
// eslint-disable-next-line no-unused-vars
|
|
166911
167188
|
getCopyOptions = (annotation) => {
|
|
166912
|
-
const { sequenceData, readOnly, selectionLayer } = this.props;
|
|
167189
|
+
const { sequenceData, readOnly, disableBpEditing, selectionLayer } = this.props;
|
|
166913
167190
|
const { isProtein } = sequenceData;
|
|
166914
167191
|
const makeTextCopyable = (transformFunc, className, action = "copy") => {
|
|
166915
167192
|
return new Clipboard$1(`.${className}`, {
|
|
@@ -166969,7 +167246,7 @@ function VectorInteractionHOC(Component) {
|
|
|
166969
167246
|
}
|
|
166970
167247
|
};
|
|
166971
167248
|
return [
|
|
166972
|
-
...readOnly ? [] : [
|
|
167249
|
+
...readOnly || disableBpEditing ? [] : [
|
|
166973
167250
|
{
|
|
166974
167251
|
text: "Replace",
|
|
166975
167252
|
...this.insertHelper
|
|
@@ -167043,21 +167320,14 @@ function VectorInteractionHOC(Component) {
|
|
|
167043
167320
|
this.openVeCopyAAReverse && this.openVeCopyAAReverse.destroy();
|
|
167044
167321
|
},
|
|
167045
167322
|
didMount: ({ className }) => {
|
|
167046
|
-
this.openVeCopyAAReverse = makeTextCopyable(
|
|
167047
|
-
(selectedSeqData)
|
|
167048
|
-
|
|
167049
|
-
|
|
167050
|
-
|
|
167051
|
-
|
|
167052
|
-
|
|
167053
|
-
|
|
167054
|
-
return {
|
|
167055
|
-
...revSeqData,
|
|
167056
|
-
textToCopy
|
|
167057
|
-
};
|
|
167058
|
-
},
|
|
167059
|
-
className
|
|
167060
|
-
);
|
|
167323
|
+
this.openVeCopyAAReverse = makeTextCopyable((selectedSeqData) => {
|
|
167324
|
+
const revSeqData = getReverseComplementSequenceAndAnnoations(selectedSeqData);
|
|
167325
|
+
const textToCopy = isProtein ? revSeqData.proteinSequence.toUpperCase() : getAminoAcidStringFromSequenceString(revSeqData.sequence);
|
|
167326
|
+
return {
|
|
167327
|
+
...revSeqData,
|
|
167328
|
+
textToCopy
|
|
167329
|
+
};
|
|
167330
|
+
}, className);
|
|
167061
167331
|
}
|
|
167062
167332
|
},
|
|
167063
167333
|
{
|
|
@@ -167164,11 +167434,12 @@ function VectorInteractionHOC(Component) {
|
|
|
167164
167434
|
({ nearestCaretPos, shiftHeld, event }) => {
|
|
167165
167435
|
this.updateSelectionOrCaret(shiftHeld, nearestCaretPos);
|
|
167166
167436
|
const {
|
|
167167
|
-
readOnly
|
|
167437
|
+
readOnly,
|
|
167438
|
+
disableBpEditing
|
|
167168
167439
|
// sequenceData: { circular }
|
|
167169
167440
|
} = this.props;
|
|
167170
167441
|
const menu = [
|
|
167171
|
-
...readOnly ? [] : [
|
|
167442
|
+
...readOnly || disableBpEditing ? [] : [
|
|
167172
167443
|
{
|
|
167173
167444
|
text: "Insert",
|
|
167174
167445
|
...this.insertHelper
|
|
@@ -167214,8 +167485,7 @@ function VectorInteractionHOC(Component) {
|
|
|
167214
167485
|
overlapsSelf: annotation.overlapsSelf
|
|
167215
167486
|
});
|
|
167216
167487
|
return [
|
|
167217
|
-
"
|
|
167218
|
-
"deletePart",
|
|
167488
|
+
...getEditDeleteHandlers("Part", annotation),
|
|
167219
167489
|
"--",
|
|
167220
167490
|
...this.getSelectionMenuOptions(annotation),
|
|
167221
167491
|
"--",
|
|
@@ -167257,8 +167527,7 @@ function VectorInteractionHOC(Component) {
|
|
|
167257
167527
|
event.persist();
|
|
167258
167528
|
const { readOnly, annotationsToSupport: { parts } = {} } = this.props;
|
|
167259
167529
|
return [
|
|
167260
|
-
"
|
|
167261
|
-
"deleteFeature",
|
|
167530
|
+
...getEditDeleteHandlers("Feature", annotation),
|
|
167262
167531
|
...this.getSelectionMenuOptions(annotation),
|
|
167263
167532
|
...readOnly ? [] : [
|
|
167264
167533
|
...parts && [
|
|
@@ -167325,8 +167594,7 @@ function VectorInteractionHOC(Component) {
|
|
|
167325
167594
|
end: annotation.end
|
|
167326
167595
|
});
|
|
167327
167596
|
return [
|
|
167328
|
-
"
|
|
167329
|
-
"deletePrimer",
|
|
167597
|
+
...getEditDeleteHandlers("Primer", annotation),
|
|
167330
167598
|
...this.getSelectionMenuOptions(annotation),
|
|
167331
167599
|
"showRemoveDuplicatesDialogPrimers",
|
|
167332
167600
|
"viewPrimerProperties"
|
|
@@ -167536,8 +167804,30 @@ const insertAndSelectHelper = ({ seqDataToInsert, props }) => {
|
|
|
167536
167804
|
end: newSelectionLayerEnd % newSeqData.sequence.length
|
|
167537
167805
|
});
|
|
167538
167806
|
};
|
|
167807
|
+
function getEditDeleteHandlers(type, annotation) {
|
|
167808
|
+
return [
|
|
167809
|
+
...annotation.isEditLocked ? [
|
|
167810
|
+
{
|
|
167811
|
+
shouldDismissPopover: false,
|
|
167812
|
+
text: /* @__PURE__ */ React$3.createElement(
|
|
167813
|
+
"div",
|
|
167814
|
+
{
|
|
167815
|
+
style: {
|
|
167816
|
+
fontSize: 11,
|
|
167817
|
+
fontStyle: "italic",
|
|
167818
|
+
color: "rgba(0,0,0,.5)"
|
|
167819
|
+
}
|
|
167820
|
+
},
|
|
167821
|
+
typeof annotation.isEditLocked === "string" ? annotation.isEditLocked : `Note: This Annotation is Locked`
|
|
167822
|
+
)
|
|
167823
|
+
}
|
|
167824
|
+
] : [],
|
|
167825
|
+
`edit${type}`,
|
|
167826
|
+
...annotation.isEditLocked ? [] : [`delete${type}`]
|
|
167827
|
+
];
|
|
167828
|
+
}
|
|
167539
167829
|
|
|
167540
|
-
const style$
|
|
167830
|
+
const style$h = '';
|
|
167541
167831
|
|
|
167542
167832
|
function SequenceName({ sequenceName, sequenceLength, isProtein }) {
|
|
167543
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`));
|
|
@@ -169923,7 +170213,7 @@ function VisibilityOptions$2({
|
|
|
169923
170213
|
);
|
|
169924
170214
|
}
|
|
169925
170215
|
|
|
169926
|
-
const style$
|
|
170216
|
+
const style$g = '';
|
|
169927
170217
|
|
|
169928
170218
|
const simpleDialog = '';
|
|
169929
170219
|
|
|
@@ -170200,7 +170490,7 @@ function combineLabels(labels, numberOfBuckets) {
|
|
|
170200
170490
|
return combinedLabels;
|
|
170201
170491
|
}
|
|
170202
170492
|
|
|
170203
|
-
const style$
|
|
170493
|
+
const style$f = '';
|
|
170204
170494
|
|
|
170205
170495
|
const fontWidthToFontSize = 1.75;
|
|
170206
170496
|
const getTextLength = (text) => {
|
|
@@ -172403,7 +172693,7 @@ function DrawAnnotationInner({
|
|
|
172403
172693
|
}
|
|
172404
172694
|
const DrawAnnotation = withHover(DrawAnnotationInner);
|
|
172405
172695
|
|
|
172406
|
-
const style$
|
|
172696
|
+
const style$e = '';
|
|
172407
172697
|
|
|
172408
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}
|
|
172409
172699
|
|
|
@@ -173336,7 +173626,7 @@ function CircularView(props) {
|
|
|
173336
173626
|
}
|
|
173337
173627
|
const CircularView$1 = withEditorInteractions(CircularView);
|
|
173338
173628
|
|
|
173339
|
-
const style$
|
|
173629
|
+
const style$d = '';
|
|
173340
173630
|
|
|
173341
173631
|
class PrintDialog extends React$3.Component {
|
|
173342
173632
|
state = {
|
|
@@ -173817,7 +174107,7 @@ const RemoveDuplicates = redux.compose(
|
|
|
173817
174107
|
tgFormValues("ignoreName", "ignoreStrand", "ignoreStartAndEnd")
|
|
173818
174108
|
)(RemoveDuplicatesDialog);
|
|
173819
174109
|
|
|
173820
|
-
const style$
|
|
174110
|
+
const style$c = '';
|
|
173821
174111
|
|
|
173822
174112
|
var isMobile$2 = {exports: {}};
|
|
173823
174113
|
|
|
@@ -174693,7 +174983,11 @@ const GoToDialog = createSimpleDialog({
|
|
|
174693
174983
|
}
|
|
174694
174984
|
}
|
|
174695
174985
|
],
|
|
174696
|
-
withDialogProps: {
|
|
174986
|
+
withDialogProps: {
|
|
174987
|
+
title: "Go To",
|
|
174988
|
+
height: 190,
|
|
174989
|
+
onCloseHook: tryToRefocusEditor
|
|
174990
|
+
}
|
|
174697
174991
|
});
|
|
174698
174992
|
|
|
174699
174993
|
const validate$1 = (val, vals, props) => {
|
|
@@ -174835,7 +175129,7 @@ const normalizeToInt = (val) => {
|
|
|
174835
175129
|
return normalizedVal;
|
|
174836
175130
|
};
|
|
174837
175131
|
|
|
174838
|
-
const style$
|
|
175132
|
+
const style$b = '';
|
|
174839
175133
|
|
|
174840
175134
|
const EnzymeViewer = ({
|
|
174841
175135
|
extraClasses = "",
|
|
@@ -174910,7 +175204,7 @@ const EnzymeViewer = ({
|
|
|
174910
175204
|
);
|
|
174911
175205
|
};
|
|
174912
175206
|
|
|
174913
|
-
const style$
|
|
175207
|
+
const style$a = '';
|
|
174914
175208
|
|
|
174915
175209
|
const upsertLocalEnzymeGroups = (newGroups) => {
|
|
174916
175210
|
const existingGroups = window.getExistingEnzymeGroups();
|
|
@@ -175606,7 +175900,7 @@ const HoverView = view(({ allEnzymesByName }) => {
|
|
|
175606
175900
|
);
|
|
175607
175901
|
});
|
|
175608
175902
|
|
|
175609
|
-
const style$
|
|
175903
|
+
const style$9 = '';
|
|
175610
175904
|
|
|
175611
175905
|
const CreateCustomEnzyme = function(props) {
|
|
175612
175906
|
const paddingStart = "-------";
|
|
@@ -176431,143 +176725,6 @@ function getIsEnzymeHidden({ name, allRestrictionEnzymes }) {
|
|
|
176431
176725
|
return isHidden;
|
|
176432
176726
|
}
|
|
176433
176727
|
|
|
176434
|
-
const style$9 = '';
|
|
176435
|
-
|
|
176436
|
-
class ToolbarItem extends React$3.Component {
|
|
176437
|
-
toggleDropdown = ({ forceClose } = {}) => {
|
|
176438
|
-
const { toolName, isOpen } = this.props;
|
|
176439
|
-
this.props.openToolbarItemUpdate(isOpen || forceClose ? "" : toolName);
|
|
176440
|
-
};
|
|
176441
|
-
render() {
|
|
176442
|
-
const { overrides = {} } = this.props;
|
|
176443
|
-
const {
|
|
176444
|
-
isOpen,
|
|
176445
|
-
index,
|
|
176446
|
-
Icon,
|
|
176447
|
-
// dynamicIcon,
|
|
176448
|
-
onIconClick = lodashExports.noop,
|
|
176449
|
-
tooltip = "",
|
|
176450
|
-
tooltipToggled,
|
|
176451
|
-
dropdowntooltip = "",
|
|
176452
|
-
Dropdown,
|
|
176453
|
-
disabled,
|
|
176454
|
-
isHidden,
|
|
176455
|
-
renderIconAbove,
|
|
176456
|
-
noDropdownIcon,
|
|
176457
|
-
IconWrapper,
|
|
176458
|
-
editorName,
|
|
176459
|
-
popoverDisabled,
|
|
176460
|
-
IconWrapperProps,
|
|
176461
|
-
toolName,
|
|
176462
|
-
dropdownicon,
|
|
176463
|
-
tooltipDisabled,
|
|
176464
|
-
toggled = false,
|
|
176465
|
-
...rest
|
|
176466
|
-
} = { ...this.props, ...overrides };
|
|
176467
|
-
if (!toolName)
|
|
176468
|
-
console.warn("toolName is required!");
|
|
176469
|
-
if (isHidden)
|
|
176470
|
-
return null;
|
|
176471
|
-
let tooltipToDisplay = tooltip;
|
|
176472
|
-
if (toggled && tooltipToggled) {
|
|
176473
|
-
tooltipToDisplay = tooltipToggled;
|
|
176474
|
-
}
|
|
176475
|
-
const buttonTarget = /* @__PURE__ */ React$3.createElement(
|
|
176476
|
-
"div",
|
|
176477
|
-
{
|
|
176478
|
-
className: `veToolbarItemOuter ve-tool-container-${toolName}` + (disabled ? " disabled " : "")
|
|
176479
|
-
},
|
|
176480
|
-
renderIconAbove && /* @__PURE__ */ React$3.createElement("div", null, /* @__PURE__ */ React$3.createElement("div", { className: "veToolbarItem" }, Icon)),
|
|
176481
|
-
Icon && !renderIconAbove && /* @__PURE__ */ React$3.createElement(
|
|
176482
|
-
core$5.Tooltip,
|
|
176483
|
-
{
|
|
176484
|
-
disabled: tooltipDisabled,
|
|
176485
|
-
portalClassName: "ve-toolbar-item-popover",
|
|
176486
|
-
content: tooltipToDisplay
|
|
176487
|
-
},
|
|
176488
|
-
/* @__PURE__ */ React$3.createElement(
|
|
176489
|
-
core$5.AnchorButton,
|
|
176490
|
-
{
|
|
176491
|
-
intent: core$5.Intent.PRIMARY,
|
|
176492
|
-
onClick: onIconClick === "toggleDropdown" ? this.toggleDropdown : onIconClick,
|
|
176493
|
-
active: toggled,
|
|
176494
|
-
disabled,
|
|
176495
|
-
minimal: true,
|
|
176496
|
-
icon: React$3.isValidElement(Icon) ? Icon : /* @__PURE__ */ React$3.createElement(Icon, { toggleDropdown: this.toggleDropdown })
|
|
176497
|
-
}
|
|
176498
|
-
)
|
|
176499
|
-
),
|
|
176500
|
-
Dropdown && !noDropdownIcon ? /* @__PURE__ */ React$3.createElement(core$5.Tooltip, { disabled: tooltipDisabled, content: dropdowntooltip }, /* @__PURE__ */ React$3.createElement(
|
|
176501
|
-
"div",
|
|
176502
|
-
{
|
|
176503
|
-
className: (isOpen ? " isOpen " : "") + (dropdownicon ? "" : " veToolbarDropdown"),
|
|
176504
|
-
onClick: this.toggleDropdown
|
|
176505
|
-
},
|
|
176506
|
-
dropdownicon ? /* @__PURE__ */ React$3.createElement("div", { className: "veToolbarIcon" }, /* @__PURE__ */ React$3.createElement("div", null, dropdownicon)) : isOpen ? /* @__PURE__ */ React$3.createElement(
|
|
176507
|
-
core$5.Icon,
|
|
176508
|
-
{
|
|
176509
|
-
"data-test": toolName + "Dropdown",
|
|
176510
|
-
iconSize: 13,
|
|
176511
|
-
icon: "caret-up"
|
|
176512
|
-
}
|
|
176513
|
-
) : /* @__PURE__ */ React$3.createElement(
|
|
176514
|
-
core$5.Icon,
|
|
176515
|
-
{
|
|
176516
|
-
"data-test": toolName + "Dropdown",
|
|
176517
|
-
iconSize: 13,
|
|
176518
|
-
icon: "caret-down"
|
|
176519
|
-
}
|
|
176520
|
-
)
|
|
176521
|
-
)) : null
|
|
176522
|
-
);
|
|
176523
|
-
const content = /* @__PURE__ */ React$3.createElement(
|
|
176524
|
-
"div",
|
|
176525
|
-
{
|
|
176526
|
-
ref: (n) => {
|
|
176527
|
-
if (n)
|
|
176528
|
-
this.dropdownNode = n;
|
|
176529
|
-
},
|
|
176530
|
-
style: { padding: 10, minWidth: 250, maxWidth: 350 },
|
|
176531
|
-
className: "ve-toolbar-dropdown content"
|
|
176532
|
-
},
|
|
176533
|
-
Dropdown && /* @__PURE__ */ React$3.createElement(
|
|
176534
|
-
Dropdown,
|
|
176535
|
-
{
|
|
176536
|
-
...rest,
|
|
176537
|
-
editorName,
|
|
176538
|
-
toggleDropdown: this.toggleDropdown
|
|
176539
|
-
}
|
|
176540
|
-
)
|
|
176541
|
-
);
|
|
176542
|
-
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;
|
|
176543
|
-
return /* @__PURE__ */ React$3.createElement("div", { style: { display: "flex", alignItems: "center" } }, index !== 0 && /* @__PURE__ */ React$3.createElement("div", { className: "veToolbarSpacer" }), /* @__PURE__ */ React$3.createElement(
|
|
176544
|
-
core$5.Popover,
|
|
176545
|
-
{
|
|
176546
|
-
disabled: popoverDisabled,
|
|
176547
|
-
isOpen: !!Dropdown && isOpen,
|
|
176548
|
-
onClose: (e) => {
|
|
176549
|
-
let srcElement;
|
|
176550
|
-
if (e) {
|
|
176551
|
-
srcElement = e.srcElement || e.target;
|
|
176552
|
-
}
|
|
176553
|
-
if (e && srcElement && this.dropdownNode && (this.dropdownNode.contains(srcElement) || !document.body.contains(srcElement))) {
|
|
176554
|
-
return;
|
|
176555
|
-
}
|
|
176556
|
-
this.toggleDropdown({ forceClose: true });
|
|
176557
|
-
},
|
|
176558
|
-
canEscapeKeyClose: true,
|
|
176559
|
-
minimal: true,
|
|
176560
|
-
position: core$5.Position.BOTTOM,
|
|
176561
|
-
target,
|
|
176562
|
-
content
|
|
176563
|
-
}
|
|
176564
|
-
));
|
|
176565
|
-
}
|
|
176566
|
-
}
|
|
176567
|
-
const ToolbarItem$1 = connectToEditor(({ toolBar = {} }, { toolName }) => ({
|
|
176568
|
-
isOpen: toolBar.openItem === toolName
|
|
176569
|
-
}))(ToolbarItem);
|
|
176570
|
-
|
|
176571
176728
|
function array_move(arr, old_index, new_index) {
|
|
176572
176729
|
if (new_index >= arr.length) {
|
|
176573
176730
|
let k = new_index - arr.length + 1;
|
|
@@ -177353,6 +177510,7 @@ class AddOrEditAnnotationDialog extends React$3.Component {
|
|
|
177353
177510
|
overlapsSelf,
|
|
177354
177511
|
start,
|
|
177355
177512
|
end,
|
|
177513
|
+
readOnly,
|
|
177356
177514
|
getAdditionalEditAnnotationComps,
|
|
177357
177515
|
advancedOptions,
|
|
177358
177516
|
advancedDefaultOpen,
|
|
@@ -177447,10 +177605,11 @@ class AddOrEditAnnotationDialog extends React$3.Component {
|
|
|
177447
177605
|
"tg-upsert-annotation"
|
|
177448
177606
|
)
|
|
177449
177607
|
},
|
|
177608
|
+
typeof readOnly === "string" ? /* @__PURE__ */ React$3.createElement(core$5.Callout, { intent: "primary", style: { marginBottom: 10 } }, readOnly) : null,
|
|
177450
177609
|
/* @__PURE__ */ React$3.createElement(
|
|
177451
177610
|
InputField,
|
|
177452
177611
|
{
|
|
177453
|
-
disabled:
|
|
177612
|
+
disabled: readOnly,
|
|
177454
177613
|
inlineLabel: true,
|
|
177455
177614
|
tooltipError: true,
|
|
177456
177615
|
autoFocus: true,
|
|
@@ -180388,15 +180547,15 @@ class Browser {
|
|
|
180388
180547
|
}
|
|
180389
180548
|
// Edge 20+
|
|
180390
180549
|
static isEdge() {
|
|
180391
|
-
return Browser.isBrowser() &&
|
|
180550
|
+
return Browser.isBrowser() && !Browser.isIE() && !!window.StyleMedia;
|
|
180392
180551
|
}
|
|
180393
180552
|
// Chrome 1+
|
|
180394
180553
|
static isChrome() {
|
|
180395
|
-
return Browser.isBrowser() &&
|
|
180554
|
+
return Browser.isBrowser() && !!window.chrome && !!window.chrome.webstore;
|
|
180396
180555
|
}
|
|
180397
180556
|
// Blink engine detection
|
|
180398
180557
|
static isBlink() {
|
|
180399
|
-
return Browser.isBrowser() && (
|
|
180558
|
+
return Browser.isBrowser() && (Browser.isChrome() || Browser.isOpera()) && !!window.CSS;
|
|
180400
180559
|
}
|
|
180401
180560
|
static getUserAgent() {
|
|
180402
180561
|
return typeof navigator === "undefined" ? "" : navigator.userAgent;
|
|
@@ -182968,7 +183127,7 @@ function addClickableLabel(toRet, { closeDropDown }) {
|
|
|
182968
183127
|
}
|
|
182969
183128
|
|
|
182970
183129
|
const userDefinedHandlersAndOpts = [
|
|
182971
|
-
"
|
|
183130
|
+
"beforeReadOnlyChange",
|
|
182972
183131
|
"defaultLinkedOligoMessage",
|
|
182973
183132
|
"allowMultipleFeatureDirections",
|
|
182974
183133
|
"getAdditionalEditAnnotationComps",
|
|
@@ -182989,6 +183148,8 @@ const userDefinedHandlersAndOpts = [
|
|
|
182989
183148
|
"hideSingleImport",
|
|
182990
183149
|
"beforeAnnotationCreate",
|
|
182991
183150
|
"disableSetReadOnly",
|
|
183151
|
+
"allowAnnotationEditLocking",
|
|
183152
|
+
"disableBpEditing",
|
|
182992
183153
|
"showReadOnly",
|
|
182993
183154
|
"showCircularity",
|
|
182994
183155
|
"onHiddenEnzymeAdd",
|
|
@@ -183229,49 +183390,6 @@ const OrfToolDropdown = withEditorProps(
|
|
|
183229
183390
|
}
|
|
183230
183391
|
);
|
|
183231
183392
|
|
|
183232
|
-
const editTool = connectToEditor((editorState) => {
|
|
183233
|
-
return {
|
|
183234
|
-
readOnly: editorState.readOnly
|
|
183235
|
-
};
|
|
183236
|
-
})(
|
|
183237
|
-
({
|
|
183238
|
-
toolbarItemProps,
|
|
183239
|
-
readOnly,
|
|
183240
|
-
toggleReadOnlyMode,
|
|
183241
|
-
disableSetReadOnly,
|
|
183242
|
-
onChangeEditLock
|
|
183243
|
-
}) => {
|
|
183244
|
-
const [isLoading, setIsLoading] = React$3.useState(false);
|
|
183245
|
-
const readOnlyTooltip = ({ readOnly: readOnly2, disableSetReadOnly: disableSetReadOnly2 }) => {
|
|
183246
|
-
if (isLoading) {
|
|
183247
|
-
return "Loading...";
|
|
183248
|
-
} else if (disableSetReadOnly2) {
|
|
183249
|
-
return "You do not have permission to edit locks on this sequence";
|
|
183250
|
-
}
|
|
183251
|
-
return readOnly2 ? "Click to enable editing" : "Click to disable editing";
|
|
183252
|
-
};
|
|
183253
|
-
return /* @__PURE__ */ React$3.createElement(
|
|
183254
|
-
ToolbarItem$1,
|
|
183255
|
-
{
|
|
183256
|
-
...{
|
|
183257
|
-
disabled: isLoading || disableSetReadOnly,
|
|
183258
|
-
Icon: /* @__PURE__ */ React$3.createElement(core$5.Icon, { icon: readOnly ? "lock" : "unlock" }),
|
|
183259
|
-
onIconClick: async () => {
|
|
183260
|
-
if (onChangeEditLock) {
|
|
183261
|
-
setIsLoading(true);
|
|
183262
|
-
await onChangeEditLock(!readOnly);
|
|
183263
|
-
setIsLoading(false);
|
|
183264
|
-
}
|
|
183265
|
-
toggleReadOnlyMode();
|
|
183266
|
-
},
|
|
183267
|
-
tooltip: readOnlyTooltip({ readOnly, disableSetReadOnly }),
|
|
183268
|
-
...toolbarItemProps
|
|
183269
|
-
}
|
|
183270
|
-
}
|
|
183271
|
-
);
|
|
183272
|
-
}
|
|
183273
|
-
);
|
|
183274
|
-
|
|
183275
183393
|
const style$4 = '';
|
|
183276
183394
|
|
|
183277
183395
|
const opts = [
|
|
@@ -183892,31 +184010,22 @@ const style$3 = '';
|
|
|
183892
184010
|
|
|
183893
184011
|
const EditReadOnlyItem = connectToEditor(({ readOnly }) => ({
|
|
183894
184012
|
readOnly
|
|
183895
|
-
}))(
|
|
183896
|
-
|
|
183897
|
-
|
|
183898
|
-
|
|
183899
|
-
|
|
183900
|
-
|
|
183901
|
-
|
|
183902
|
-
|
|
183903
|
-
|
|
183904
|
-
|
|
183905
|
-
|
|
183906
|
-
|
|
183907
|
-
|
|
183908
|
-
|
|
183909
|
-
|
|
183910
|
-
|
|
183911
|
-
className: core$5.Classes.MINIMAL,
|
|
183912
|
-
value: readOnly ? "readOnly" : "editable",
|
|
183913
|
-
onChange: ({ target: { value } }) => {
|
|
183914
|
-
updateReadOnlyMode(value === "readOnly");
|
|
183915
|
-
}
|
|
183916
|
-
}
|
|
183917
|
-
) : readOnly ? "Read Only" : "Editable") : null;
|
|
183918
|
-
}
|
|
183919
|
-
);
|
|
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
|
+
});
|
|
183920
184029
|
const ShowSelectionItem = compose(
|
|
183921
184030
|
connectToEditor(
|
|
183922
184031
|
({ selectionLayer, caretPosition, sequenceData = { sequence: "" } }, ownProps, ...rest) => {
|
|
@@ -184063,11 +184172,13 @@ function StatusBar({
|
|
|
184063
184172
|
showGCContentByDefault,
|
|
184064
184173
|
onSelectionOrCaretChanged,
|
|
184065
184174
|
GCDecimalDigits = 1,
|
|
184066
|
-
isProtein
|
|
184175
|
+
isProtein,
|
|
184176
|
+
beforeReadOnlyChange
|
|
184067
184177
|
}) {
|
|
184068
184178
|
return /* @__PURE__ */ React$3.createElement("div", { className: "veStatusBar" }, showMoleculeType && /* @__PURE__ */ React$3.createElement(ShowTypeItem, { editorName }), /* @__PURE__ */ React$3.createElement(
|
|
184069
184179
|
EditReadOnlyItem,
|
|
184070
184180
|
{
|
|
184181
|
+
beforeReadOnlyChange,
|
|
184071
184182
|
editorName,
|
|
184072
184183
|
onSave,
|
|
184073
184184
|
disableSetReadOnly,
|
|
@@ -184402,9 +184513,7 @@ const genericAnnotationProperties = ({
|
|
|
184402
184513
|
core$5.AnchorButton,
|
|
184403
184514
|
{
|
|
184404
184515
|
onClick: () => {
|
|
184405
|
-
deleteAnnotation(
|
|
184406
|
-
annotationPropertiesSelectedEntities
|
|
184407
|
-
);
|
|
184516
|
+
deleteAnnotation(annotationPropertiesSelectedEntities);
|
|
184408
184517
|
},
|
|
184409
184518
|
className: "tgDeleteAnnsBtn",
|
|
184410
184519
|
intent: "danger",
|
|
@@ -184508,7 +184617,6 @@ class GeneralProperties extends React$3.Component {
|
|
|
184508
184617
|
disableSetReadOnly,
|
|
184509
184618
|
updateAvailability,
|
|
184510
184619
|
sequenceData,
|
|
184511
|
-
updateReadOnlyMode,
|
|
184512
184620
|
onSave,
|
|
184513
184621
|
showAvailability,
|
|
184514
184622
|
sequenceNameUpdate
|
|
@@ -184563,10 +184671,9 @@ class GeneralProperties extends React$3.Component {
|
|
|
184563
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(
|
|
184564
184672
|
BPSelect,
|
|
184565
184673
|
{
|
|
184674
|
+
className: "veReadOnlySelect",
|
|
184566
184675
|
disabled: !onSave || disableSetReadOnly,
|
|
184567
|
-
onChange: (val) =>
|
|
184568
|
-
updateReadOnlyMode(val === "readOnly");
|
|
184569
|
-
},
|
|
184676
|
+
onChange: (val) => console.log(`val:`, val) || handleReadOnlyChange(val === "readOnly", this.props),
|
|
184570
184677
|
value: readOnly ? "readOnly" : "editable",
|
|
184571
184678
|
options: [
|
|
184572
184679
|
{ label: "Read Only", value: "readOnly" },
|
|
@@ -194639,7 +194746,7 @@ class Editor extends React$3.Component {
|
|
|
194639
194746
|
contentLeft: this.props.contentLeft,
|
|
194640
194747
|
editorName,
|
|
194641
194748
|
withDigestTool: true,
|
|
194642
|
-
|
|
194749
|
+
beforeReadOnlyChange: this.props.beforeReadOnlyChange,
|
|
194643
194750
|
...ToolBarProps
|
|
194644
194751
|
}
|
|
194645
194752
|
),
|