@teselagen/ove 0.7.3-beta.6 → 0.7.3
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/AlignmentView/index.d.ts +0 -4
- package/DigestTool/DigestTool.d.ts +1 -1
- package/helperComponents/PropertiesDialog/index.d.ts +2 -7
- package/index.cjs.js +6573 -1325
- package/index.es.js +6574 -1326
- package/index.umd.js +6565 -1306
- package/package.json +2 -3
- package/src/AlignmentView/index.js +83 -45
- package/src/CreateAnnotationsPage.js +1 -1
- package/src/DigestTool/DigestTool.js +78 -75
- package/src/GlobalDialogUtils.js +1 -0
- package/src/helperComponents/PropertiesDialog/CutsiteProperties.js +126 -135
- package/src/helperComponents/PropertiesDialog/SingleEnzymeCutsiteInfo.js +59 -51
- package/src/helperComponents/PropertiesDialog/index.js +115 -114
- package/src/helperComponents/RemoveDuplicates/index.js +144 -160
- package/src/utils/useFormValue.js +7 -0
- package/src/withEditorInteractions/Keyboard.js +2 -2
- package/src/withEditorInteractions/index.js +18 -10
- package/utils/useFormValue.d.ts +1 -0
- package/withEditorInteractions/Keyboard.d.ts +2 -2
|
@@ -4,7 +4,6 @@ import {
|
|
|
4
4
|
getAminoAcidStringFromSequenceString
|
|
5
5
|
} from "@teselagen/sequence-utils";
|
|
6
6
|
import { getSequenceWithinRange } from "@teselagen/range-utils";
|
|
7
|
-
import * as ClipboardJS from "clipboard";
|
|
8
7
|
import { compose } from "redux";
|
|
9
8
|
import {
|
|
10
9
|
getReverseComplementSequenceAndAnnotations,
|
|
@@ -599,11 +598,10 @@ function VectorInteractionHOC(Component /* options */) {
|
|
|
599
598
|
this.props;
|
|
600
599
|
const { isProtein } = sequenceData;
|
|
601
600
|
const makeTextCopyable = (transformFunc, className, action = "copy") => {
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
const {
|
|
606
|
-
const { sequenceData, copyOptions } =
|
|
601
|
+
document.querySelectorAll(`.${className}`).forEach(element => {
|
|
602
|
+
element.addEventListener("click", async () => {
|
|
603
|
+
const { editorName, store } = this.props;
|
|
604
|
+
const { sequenceData, copyOptions, selectionLayer } =
|
|
607
605
|
store.getState().VectorEditor[editorName];
|
|
608
606
|
|
|
609
607
|
const selectedSeqData = getSequenceDataBetweenRange(
|
|
@@ -623,24 +621,36 @@ function VectorInteractionHOC(Component /* options */) {
|
|
|
623
621
|
}
|
|
624
622
|
}
|
|
625
623
|
);
|
|
624
|
+
|
|
626
625
|
const sequenceDataToCopy = transformFunc(
|
|
627
626
|
selectedSeqData,
|
|
628
627
|
sequenceData
|
|
629
628
|
);
|
|
630
629
|
this.sequenceDataToCopy = sequenceDataToCopy;
|
|
630
|
+
|
|
631
|
+
const textToCopy =
|
|
632
|
+
sequenceDataToCopy.textToCopy || sequenceDataToCopy.sequence;
|
|
633
|
+
|
|
634
|
+
try {
|
|
635
|
+
await navigator.clipboard.writeText(textToCopy);
|
|
636
|
+
} catch (err) {
|
|
637
|
+
console.error("Failed to copy text:", err);
|
|
638
|
+
}
|
|
639
|
+
|
|
631
640
|
if (action === "copy") {
|
|
632
641
|
document.body.addEventListener("copy", this.handleCopy);
|
|
633
642
|
} else {
|
|
634
643
|
document.body.addEventListener("cut", this.handleCut);
|
|
635
644
|
}
|
|
645
|
+
|
|
636
646
|
if (window.Cypress) {
|
|
637
647
|
window.Cypress.textToCopy = sequenceDataToCopy.textToCopy;
|
|
638
648
|
window.Cypress.seqDataToCopy = sequenceDataToCopy;
|
|
639
649
|
}
|
|
640
|
-
|
|
641
|
-
}
|
|
650
|
+
});
|
|
642
651
|
});
|
|
643
652
|
};
|
|
653
|
+
|
|
644
654
|
const aaCopy = {
|
|
645
655
|
text: "Copy AA Sequence",
|
|
646
656
|
className: "openVeCopyAA",
|
|
@@ -659,8 +669,6 @@ function VectorInteractionHOC(Component /* options */) {
|
|
|
659
669
|
}, className);
|
|
660
670
|
}
|
|
661
671
|
};
|
|
662
|
-
// TODO: maybe stop using Clipboard.js and unify clipboard handling with
|
|
663
|
-
// a more versatile approach
|
|
664
672
|
return [
|
|
665
673
|
...(readOnly || disableBpEditing
|
|
666
674
|
? []
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export function useFormValue(formName: any, field: any): any;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { default as React } from '../../../../node_modules/react';
|
|
2
|
-
export default
|
|
3
|
-
declare class
|
|
2
|
+
export default Keyboard;
|
|
3
|
+
declare class Keyboard extends React.Component<any, any, any> {
|
|
4
4
|
static defaultProps: {
|
|
5
5
|
className: string;
|
|
6
6
|
};
|