@teselagen/ove 0.5.14 → 0.5.16
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.cjs.js +129 -185
- package/index.es.js +129 -185
- package/index.umd.js +105 -127
- package/package.json +2 -2
- package/src/GlobalDialogUtils.js +4 -1
- package/src/ToolBar/index.js +7 -4
- package/src/helperComponents/AddOrEditAnnotationDialog/index.js +0 -8
- package/src/withEditorInteractions/index.js +19 -33
- package/src/withEditorProps/index.js +7 -7
- package/style.css +7 -0
|
@@ -202,7 +202,7 @@ function VectorInteractionHOC(Component /* options */) {
|
|
|
202
202
|
});
|
|
203
203
|
};
|
|
204
204
|
|
|
205
|
-
handlePaste = e => {
|
|
205
|
+
handlePaste = async e => {
|
|
206
206
|
const {
|
|
207
207
|
caretPosition = -1,
|
|
208
208
|
selectionLayer = { start: -1, end: -1 },
|
|
@@ -248,7 +248,7 @@ function VectorInteractionHOC(Component /* options */) {
|
|
|
248
248
|
if (!seqDataToInsert.sequence.length)
|
|
249
249
|
return window.toastr.warning("Sorry no valid base pairs to paste");
|
|
250
250
|
|
|
251
|
-
insertAndSelectHelper({
|
|
251
|
+
await insertAndSelectHelper({
|
|
252
252
|
seqDataToInsert,
|
|
253
253
|
props: this.props
|
|
254
254
|
});
|
|
@@ -344,7 +344,7 @@ function VectorInteractionHOC(Component /* options */) {
|
|
|
344
344
|
|
|
345
345
|
handleCopy = this.handleCutOrCopy();
|
|
346
346
|
|
|
347
|
-
handleDnaInsert = ({ useEventPositioning }) => {
|
|
347
|
+
handleDnaInsert = async ({ useEventPositioning }) => {
|
|
348
348
|
const {
|
|
349
349
|
caretPosition = -1,
|
|
350
350
|
selectionLayer = { start: -1, end: -1 },
|
|
@@ -371,8 +371,8 @@ function VectorInteractionHOC(Component /* options */) {
|
|
|
371
371
|
selectionLayer,
|
|
372
372
|
sequenceLength,
|
|
373
373
|
caretPosition,
|
|
374
|
-
handleInsert: seqDataToInsert => {
|
|
375
|
-
insertAndSelectHelper({
|
|
374
|
+
handleInsert: async seqDataToInsert => {
|
|
375
|
+
await insertAndSelectHelper({
|
|
376
376
|
props: this.props,
|
|
377
377
|
seqDataToInsert
|
|
378
378
|
});
|
|
@@ -383,7 +383,7 @@ function VectorInteractionHOC(Component /* options */) {
|
|
|
383
383
|
}
|
|
384
384
|
};
|
|
385
385
|
|
|
386
|
-
handleDnaDelete = (showToast = true) => {
|
|
386
|
+
handleDnaDelete = async (showToast = true) => {
|
|
387
387
|
const {
|
|
388
388
|
caretPosition = -1,
|
|
389
389
|
selectionLayer = { start: -1, end: -1 },
|
|
@@ -424,11 +424,13 @@ function VectorInteractionHOC(Component /* options */) {
|
|
|
424
424
|
isCaretAtEndOfSeq = true;
|
|
425
425
|
}
|
|
426
426
|
}
|
|
427
|
-
const [newSeqData] =
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
427
|
+
const [newSeqData, { abortSeqChange }] =
|
|
428
|
+
await wrappedInsertSequenceDataAtPositionOrRange(
|
|
429
|
+
{},
|
|
430
|
+
sequenceData,
|
|
431
|
+
rangeToDelete
|
|
432
|
+
);
|
|
433
|
+
if (abortSeqChange) return;
|
|
432
434
|
updateSequenceData(newSeqData);
|
|
433
435
|
caretPositionUpdate(
|
|
434
436
|
isCaretAtEndOfSeq
|
|
@@ -1197,7 +1199,7 @@ function getGenbankFromSelection(selectedSeqData, sequenceData) {
|
|
|
1197
1199
|
};
|
|
1198
1200
|
}
|
|
1199
1201
|
|
|
1200
|
-
const insertAndSelectHelper = ({ seqDataToInsert, props }) => {
|
|
1202
|
+
const insertAndSelectHelper = async ({ seqDataToInsert, props }) => {
|
|
1201
1203
|
const {
|
|
1202
1204
|
updateSequenceData,
|
|
1203
1205
|
wrappedInsertSequenceDataAtPositionOrRange,
|
|
@@ -1207,31 +1209,15 @@ const insertAndSelectHelper = ({ seqDataToInsert, props }) => {
|
|
|
1207
1209
|
selectionLayer,
|
|
1208
1210
|
bpLimit
|
|
1209
1211
|
} = props;
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
// caretPosition,
|
|
1213
|
-
// selectionLayer
|
|
1214
|
-
|
|
1215
|
-
// updateSequenceData(
|
|
1216
|
-
// wrappedInsertSequenceDataAtPositionOrRange(
|
|
1217
|
-
// seqDataToInsert,
|
|
1218
|
-
// sequenceData,
|
|
1219
|
-
// caretPosition > -1 ? caretPosition : selectionLayer
|
|
1220
|
-
// )
|
|
1221
|
-
// );
|
|
1222
|
-
|
|
1223
|
-
// const newSelectionLayerStart =
|
|
1224
|
-
// caretPosition > -1 ? caretPosition : (selectionLayer.start > selectionLayer.end ? 0 : selectionLayer.start);
|
|
1225
|
-
// selectionLayerUpdate({
|
|
1226
|
-
// start: newSelectionLayerStart,
|
|
1227
|
-
// end: newSelectionLayerStart + seqDataToInsert.sequence.length - 1
|
|
1228
|
-
// });
|
|
1229
|
-
const [newSeqData, { maintainOriginSplit }] =
|
|
1230
|
-
wrappedInsertSequenceDataAtPositionOrRange(
|
|
1212
|
+
const [newSeqData, { maintainOriginSplit, abortSeqChange }] =
|
|
1213
|
+
await wrappedInsertSequenceDataAtPositionOrRange(
|
|
1231
1214
|
seqDataToInsert,
|
|
1232
1215
|
sequenceData,
|
|
1233
1216
|
caretPosition > -1 ? caretPosition : selectionLayer
|
|
1234
1217
|
);
|
|
1218
|
+
if (abortSeqChange) {
|
|
1219
|
+
throw new Error("abortSeqChange");
|
|
1220
|
+
}
|
|
1235
1221
|
if (bpLimit) {
|
|
1236
1222
|
if (newSeqData.sequence.length > bpLimit) {
|
|
1237
1223
|
window.toastr.error(
|
|
@@ -354,7 +354,7 @@ export default compose(
|
|
|
354
354
|
),
|
|
355
355
|
withHandlers({
|
|
356
356
|
wrappedInsertSequenceDataAtPositionOrRange: props => {
|
|
357
|
-
return (
|
|
357
|
+
return async (
|
|
358
358
|
_sequenceDataToInsert,
|
|
359
359
|
_existingSequenceData,
|
|
360
360
|
_caretPositionOrRange,
|
|
@@ -366,12 +366,12 @@ export default compose(
|
|
|
366
366
|
caretPositionOrRange,
|
|
367
367
|
options
|
|
368
368
|
} = props.beforeSequenceInsertOrDelete
|
|
369
|
-
? props.beforeSequenceInsertOrDelete(
|
|
369
|
+
? (await props.beforeSequenceInsertOrDelete(
|
|
370
370
|
tidyUpSequenceData(_sequenceDataToInsert),
|
|
371
371
|
tidyUpSequenceData(_existingSequenceData),
|
|
372
372
|
_caretPositionOrRange,
|
|
373
373
|
_options
|
|
374
|
-
) || {}
|
|
374
|
+
)) || {}
|
|
375
375
|
: {};
|
|
376
376
|
return [
|
|
377
377
|
insertSequenceDataAtPositionOrRange(
|
|
@@ -483,7 +483,7 @@ export default compose(
|
|
|
483
483
|
caretPositionUpdate(0);
|
|
484
484
|
},
|
|
485
485
|
|
|
486
|
-
handleReverseComplementSelection: props => () => {
|
|
486
|
+
handleReverseComplementSelection: props => async () => {
|
|
487
487
|
const {
|
|
488
488
|
sequenceData,
|
|
489
489
|
updateSequenceData,
|
|
@@ -499,7 +499,7 @@ export default compose(
|
|
|
499
499
|
range: selectionLayer
|
|
500
500
|
}
|
|
501
501
|
);
|
|
502
|
-
const [newSeqData] = wrappedInsertSequenceDataAtPositionOrRange(
|
|
502
|
+
const [newSeqData] = await wrappedInsertSequenceDataAtPositionOrRange(
|
|
503
503
|
reversedSeqData,
|
|
504
504
|
sequenceData,
|
|
505
505
|
selectionLayer,
|
|
@@ -510,7 +510,7 @@ export default compose(
|
|
|
510
510
|
updateSequenceData(newSeqData);
|
|
511
511
|
},
|
|
512
512
|
|
|
513
|
-
handleComplementSelection: props => () => {
|
|
513
|
+
handleComplementSelection: props => async () => {
|
|
514
514
|
const {
|
|
515
515
|
sequenceData,
|
|
516
516
|
updateSequenceData,
|
|
@@ -523,7 +523,7 @@ export default compose(
|
|
|
523
523
|
const comp = getComplementSequenceAndAnnotations(sequenceData, {
|
|
524
524
|
range: selectionLayer
|
|
525
525
|
});
|
|
526
|
-
const [newSeqData] = wrappedInsertSequenceDataAtPositionOrRange(
|
|
526
|
+
const [newSeqData] = await wrappedInsertSequenceDataAtPositionOrRange(
|
|
527
527
|
comp,
|
|
528
528
|
sequenceData,
|
|
529
529
|
selectionLayer,
|
package/style.css
CHANGED
|
@@ -9086,6 +9086,13 @@ button:not(:disabled):active {
|
|
|
9086
9086
|
width: 100%;
|
|
9087
9087
|
min-width: 170px;
|
|
9088
9088
|
}
|
|
9089
|
+
.tg-select.tg-select-as-tag {
|
|
9090
|
+
/* background-color: red; */
|
|
9091
|
+
border-radius: 4px;
|
|
9092
|
+
width: fit-content;
|
|
9093
|
+
color: white;
|
|
9094
|
+
border: 2px solid white;
|
|
9095
|
+
}
|
|
9089
9096
|
.tg-select.tg-select-as-tag .bp3-tag.bp3-minimal.bp3-intent-primary {
|
|
9090
9097
|
color: white !important;
|
|
9091
9098
|
}
|