@teselagen/ove 0.0.13 → 0.0.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.umd.js +164751 -135808
- package/package.json +78 -2
- package/src/AlignmentTool/index.js +16 -0
- package/src/AlignmentView/AlignmentVisibilityTool.js +105 -0
- package/src/AlignmentView/EditTrackNameDialog.js +34 -0
- package/src/AlignmentView/HorizontalPanelDragHandle.js +35 -0
- package/src/AlignmentView/Minimap.js +520 -0
- package/src/AlignmentView/Mismatches.js +134 -0
- package/src/AlignmentView/PairwiseAlignmentView.js +68 -0
- package/src/AlignmentView/PerformantSelectionLayer.js +32 -0
- package/src/AlignmentView/coerceInitialValue.js +7 -0
- package/src/AlignmentView/getGapMap.js +12 -0
- package/src/AlignmentView/getGaps.js +27 -0
- package/src/AlignmentView/getPairwiseOverviewLinearViewOptions.js +38 -0
- package/src/AlignmentView/getTrackFromEvent.js +25 -0
- package/src/AlignmentView/index.js +2058 -0
- package/src/AlignmentView/isTargetWithinEl.js +6 -0
- package/src/AlignmentView/style.css +100 -0
- package/src/AlignmentView/updateTrackHelper.js +58 -0
- package/src/AutoAnnotate.js +500 -0
- package/src/AutoAnnotateBpMatchingDialog.js +208 -0
- package/src/CircularView/Axis.js +40 -0
- package/src/CircularView/AxisNumbers.js +35 -0
- package/src/CircularView/Caret.js +63 -0
- package/src/CircularView/CircularDnaSequence.js +73 -0
- package/src/CircularView/CircularZoomMinimap.js +16 -0
- package/src/CircularView/Cutsite.js +18 -0
- package/src/CircularView/Cutsites.js +113 -0
- package/src/CircularView/DeletionLayer.js +28 -0
- package/src/CircularView/Feature.js +83 -0
- package/src/CircularView/Labels/index.js +536 -0
- package/src/CircularView/Labels/relaxLabelAngles.js +157 -0
- package/src/CircularView/Labels/relaxLabels_DEPRECATED.js +105 -0
- package/src/CircularView/Labels/style.css +55 -0
- package/src/CircularView/Orf.js +25 -0
- package/src/CircularView/Part.js +34 -0
- package/src/CircularView/PositionAnnotationOnCircle.js +26 -0
- package/src/CircularView/Primer.js +41 -0
- package/src/CircularView/RotateCircularViewSlider.js +82 -0
- package/src/CircularView/SelectionLayer.js +132 -0
- package/src/CircularView/VeTopRightContainer.js +12 -0
- package/src/CircularView/ZoomCircularViewSlider.js +62 -0
- package/src/CircularView/drawAnnotations.js +433 -0
- package/src/CircularView/drawDirectedPiePiece.js +142 -0
- package/src/CircularView/getAngleForPositionMidpoint.js +3 -0
- package/src/CircularView/getInternalLabel.js +40 -0
- package/src/CircularView/getRangeAnglesSpecial.js +12 -0
- package/src/CircularView/getYOffset.js +15 -0
- package/src/CircularView/index.d.ts +20 -0
- package/src/CircularView/index.js +930 -0
- package/src/CircularView/normalizeAngle.js +3 -0
- package/src/CircularView/normalizeAngleRange.js +9 -0
- package/src/CircularView/positionCutsites.js +6 -0
- package/src/CircularView/shouldFlipText.js +4 -0
- package/src/CircularView/style.css +47 -0
- package/src/CircularView/utils/polarToSpecialCartesian.js +7 -0
- package/src/CreateAnnotationsPage.js +96 -0
- package/src/CreateCustomEnzyme/index.js +337 -0
- package/src/CreateCustomEnzyme/style.css +100 -0
- package/src/CutsiteFilter/AdditionalCutsiteInfoDialog.js +599 -0
- package/src/CutsiteFilter/index.js +408 -0
- package/src/CutsiteFilter/style.css +23 -0
- package/src/CutsiteFilter/withRestrictionEnzymes.js +15 -0
- package/src/DigestTool/AddLaddersDialog.js +82 -0
- package/src/DigestTool/DigestTool.js +223 -0
- package/src/DigestTool/Ladder.css +20 -0
- package/src/DigestTool/Ladder.js +303 -0
- package/src/DigestTool/createFragmentLines.js +120 -0
- package/src/DigestTool/ladderDefaults.js +26 -0
- package/src/DigestTool/ruler.css +89 -0
- package/src/Editor/CommandHotkeyHandler.js +44 -0
- package/src/Editor/DropHandler.css +21 -0
- package/src/Editor/DropHandler.js +64 -0
- package/src/Editor/FillWindow.js +46 -0
- package/src/Editor/darkmode.css +98 -0
- package/src/Editor/index.js +1005 -0
- package/src/Editor/style.css +235 -0
- package/src/Editor/userDefinedHandlersAndOpts.js +56 -0
- package/src/EnzymeViewer/index.js +81 -0
- package/src/EnzymeViewer/style.css +6 -0
- package/src/FindBar/index.js +411 -0
- package/src/FindBar/style.css +46 -0
- package/src/GlobalDialog.js +66 -0
- package/src/GlobalDialogUtils.js +85 -0
- package/src/LinearView/SequenceName.js +15 -0
- package/src/LinearView/ZoomLinearView.js +47 -0
- package/src/LinearView/index.js +374 -0
- package/src/LinearView/style.css +12 -0
- package/src/ManageEnzymes/index.js +326 -0
- package/src/ManageEnzymes/style.css +100 -0
- package/src/MenuBar/defaultConfig.js +149 -0
- package/src/MenuBar/index.js +98 -0
- package/src/MenuBar/viewSubmenu.js +479 -0
- package/src/PCRTool/PCRTool.js +173 -0
- package/src/Reflex/Browser.js +107 -0
- package/src/Reflex/ReflexContainer.js +802 -0
- package/src/Reflex/ReflexElement.js +160 -0
- package/src/Reflex/ReflexEvents.js +77 -0
- package/src/Reflex/ReflexSplitter.js +205 -0
- package/src/Reflex/index.js +5 -0
- package/src/Reflex/reflex-styles.css +128 -0
- package/src/Reflex/reflex-styles.css.map +9 -0
- package/src/RowItem/AnnotationContainerHolder.js +20 -0
- package/src/RowItem/AnnotationPositioner.js +27 -0
- package/src/RowItem/Axis.js +149 -0
- package/src/RowItem/Caret/index.js +64 -0
- package/src/RowItem/Caret/style.css +8 -0
- package/src/RowItem/Chromatograms/Chromatogram.js +289 -0
- package/src/RowItem/CutsiteSelectionLayers.js +47 -0
- package/src/RowItem/Cutsites.js +271 -0
- package/src/RowItem/DeletionLayers/index.js +113 -0
- package/src/RowItem/DeletionLayers/style.css +5 -0
- package/src/RowItem/Labels.js +327 -0
- package/src/RowItem/Orf.js +109 -0
- package/src/RowItem/Orfs.js +35 -0
- package/src/RowItem/ReplacementLayers/style.css +5 -0
- package/src/RowItem/SelectionLayer/index.js +184 -0
- package/src/RowItem/SelectionLayer/style.css +21 -0
- package/src/RowItem/Sequence.js +269 -0
- package/src/RowItem/StackedAnnotations/PointedAnnotation.js +347 -0
- package/src/RowItem/StackedAnnotations/getStructuredBases.js +97 -0
- package/src/RowItem/StackedAnnotations/index.js +182 -0
- package/src/RowItem/StackedAnnotations/primerBases.js +218 -0
- package/src/RowItem/StackedAnnotations/style.css +14 -0
- package/src/RowItem/Translations/AASliver.js +190 -0
- package/src/RowItem/Translations/Translation.js +162 -0
- package/src/RowItem/Translations/index.js +54 -0
- package/src/RowItem/Translations/style.css +3 -0
- package/src/RowItem/constants.js +3 -0
- package/src/RowItem/getCutsiteLabelHeights.js +56 -0
- package/src/RowItem/getXStartAndWidthFromNonCircularRange.js +12 -0
- package/src/RowItem/getXStartAndWidthOfRangeWrtRow.js +27 -0
- package/src/RowItem/getXStartAndWidthOfRowAnnotation.js +19 -0
- package/src/RowItem/index.js +647 -0
- package/src/RowItem/partOverhangs.js +6 -0
- package/src/RowItem/style.css +103 -0
- package/src/RowItem/utils.js +32 -0
- package/src/RowView/estimateRowHeight.js +184 -0
- package/src/RowView/index.d.ts +10 -0
- package/src/RowView/index.js +554 -0
- package/src/RowView/style.css +12 -0
- package/src/SimpleCircularOrLinearView.js +379 -0
- package/src/SimpleOligoPreview.js +39 -0
- package/src/StatusBar/MeltingTemp.js +81 -0
- package/src/StatusBar/index.js +275 -0
- package/src/StatusBar/style.css +38 -0
- package/src/ToolBar/ToolbarItem.js +194 -0
- package/src/ToolBar/alignmentTool.js +503 -0
- package/src/ToolBar/array_move.js +10 -0
- package/src/ToolBar/cutsiteTool.js +88 -0
- package/src/ToolBar/downloadTool.js +38 -0
- package/src/ToolBar/editTool.js +26 -0
- package/src/ToolBar/featureTool.js +34 -0
- package/src/ToolBar/findTool.js +2 -0
- package/src/ToolBar/importTool.js +27 -0
- package/src/ToolBar/index.js +231 -0
- package/src/ToolBar/inlineFindTool.js +38 -0
- package/src/ToolBar/oligoTool.js +30 -0
- package/src/ToolBar/orfTool.js +141 -0
- package/src/ToolBar/partTool.js +47 -0
- package/src/ToolBar/printTool.js +31 -0
- package/src/ToolBar/redoTool.js +30 -0
- package/src/ToolBar/saveTool.js +48 -0
- package/src/ToolBar/style.css +138 -0
- package/src/ToolBar/undoTool.js +30 -0
- package/src/ToolBar/veToolbarIcons/find.png +0 -0
- package/src/ToolBar/veToolbarIcons/fullscreen.png +0 -0
- package/src/ToolBar/veToolbarIcons/linear.png +0 -0
- package/src/ToolBar/veToolbarIcons/pie.png +0 -0
- package/src/ToolBar/veToolbarIcons/print.png +0 -0
- package/src/ToolBar/veToolbarIcons/save.png +0 -0
- package/src/ToolBar/veToolbarIcons/show_cut_sites.png +0 -0
- package/src/ToolBar/veToolbarIcons/show_features.png +0 -0
- package/src/ToolBar/veToolbarIcons/show_orfs.png +0 -0
- package/src/ToolBar/veToolbarIcons/show_primers.png +0 -0
- package/src/ToolBar/veToolbarIcons/toggle_views.svg +1 -0
- package/src/ToolBar/versionHistoryTool.js +20 -0
- package/src/ToolBar/visibilityTool.js +39 -0
- package/src/VersionHistoryView/index.js +215 -0
- package/src/addAlignment.js +6 -0
- package/src/commands/getOveHotkeyDefs.js +12 -0
- package/src/commands/index.js +1585 -0
- package/src/constants/constants.js +2 -0
- package/src/constants/dnaToColor.js +17 -0
- package/src/constants/draggableClassnames.js +5 -0
- package/src/constants/findToolConstants.js +1 -0
- package/src/constants/orfFrameToColorMap.js +10 -0
- package/src/constants/rowviewContants.js +3 -0
- package/src/constants/specialCutsiteFilterOptions.js +22 -0
- package/src/constants.js +1 -0
- package/src/createVectorEditor/index.js +138 -0
- package/src/createVectorEditor/makeStore.js +34 -0
- package/src/fileUtils.js +103 -0
- package/src/helperComponents/AddOrEditAnnotationDialog/index.js +711 -0
- package/src/helperComponents/AddOrEditAnnotationDialog/style.css +11 -0
- package/src/helperComponents/AddOrEditFeatureDialog/index.js +58 -0
- package/src/helperComponents/AddOrEditPartDialog/index.js +101 -0
- package/src/helperComponents/AddOrEditPrimerDialog/EditCaretPosition.js +234 -0
- package/src/helperComponents/AddOrEditPrimerDialog/index.js +329 -0
- package/src/helperComponents/AddOrEditPrimerDialog/style.css +41 -0
- package/src/helperComponents/EnzymesDialog/index.js +904 -0
- package/src/helperComponents/EnzymesDialog/style.css +21 -0
- package/src/helperComponents/GoToDialog.js +21 -0
- package/src/helperComponents/MergeFeaturesDialog/index.js +253 -0
- package/src/helperComponents/MergeFeaturesDialog/style.css +3 -0
- package/src/helperComponents/MultipleSeqsDetectedOnImportDialog.js +74 -0
- package/src/helperComponents/PinchHelper/PinchHelper.js +24 -0
- package/src/helperComponents/PrintDialog/index.js +396 -0
- package/src/helperComponents/PrintDialog/style.css +4 -0
- package/src/helperComponents/PropertiesDialog/ColorPicker.js +30 -0
- package/src/helperComponents/PropertiesDialog/CutsiteProperties.js +185 -0
- package/src/helperComponents/PropertiesDialog/FeatureProperties.js +6 -0
- package/src/helperComponents/PropertiesDialog/GenbankView.js +74 -0
- package/src/helperComponents/PropertiesDialog/GeneralProperties.js +140 -0
- package/src/helperComponents/PropertiesDialog/GenericAnnotationProperties.js +406 -0
- package/src/helperComponents/PropertiesDialog/OrfProperties.js +117 -0
- package/src/helperComponents/PropertiesDialog/PartProperties.js +9 -0
- package/src/helperComponents/PropertiesDialog/PrimerProperties.js +19 -0
- package/src/helperComponents/PropertiesDialog/SingleEnzymeCutsiteInfo.js +131 -0
- package/src/helperComponents/PropertiesDialog/TranslationProperties.js +149 -0
- package/src/helperComponents/PropertiesDialog/index.js +166 -0
- package/src/helperComponents/PropertiesDialog/style.css +68 -0
- package/src/helperComponents/PropertiesDialog/typeField.js +24 -0
- package/src/helperComponents/PropertiesDialog/utils.js +37 -0
- package/src/helperComponents/RemoveDuplicates/index.js +194 -0
- package/src/helperComponents/RenameSequenceDialog.js +7 -0
- package/src/helperComponents/SelectDialog.js +150 -0
- package/src/helperComponents/UncontrolledSliderWithPlusMinusBtns.css +5 -0
- package/src/helperComponents/UncontrolledSliderWithPlusMinusBtns.js +134 -0
- package/src/helperComponents/VeWarning/index.js +22 -0
- package/src/helperComponents/VeWarning/style.css +10 -0
- package/src/helperComponents/createSimpleDialog.js +89 -0
- package/src/helperComponents/partTagSearch.js +72 -0
- package/src/helperComponents/simpleDialog.css +13 -0
- package/src/helperComponents/withHover.js +90 -0
- package/src/index.js +60 -0
- package/src/redux/alignments.js +373 -0
- package/src/redux/annotationLabelVisibility.js +53 -0
- package/src/redux/annotationVisibility.js +196 -0
- package/src/redux/annotationsToSupport.js +104 -0
- package/src/redux/caretPosition.js +27 -0
- package/src/redux/charWidth.js +22 -0
- package/src/redux/copyOptions.js +34 -0
- package/src/redux/createYourOwnEnzyme.js +39 -0
- package/src/redux/deletionLayers.js +36 -0
- package/src/redux/digestTool.js +34 -0
- package/src/redux/featureLengthsToHide.js +27 -0
- package/src/redux/findTool.js +79 -0
- package/src/redux/frameTranslations.js +52 -0
- package/src/redux/hoveredAnnotation.js +24 -0
- package/src/redux/index.js +196 -0
- package/src/redux/labelLineIntensity.js +25 -0
- package/src/redux/labelSize.js +23 -0
- package/src/redux/lastSavedId.js +20 -0
- package/src/redux/middleware.js +112 -0
- package/src/redux/minimumOrfSize.js +24 -0
- package/src/redux/modalActions.js +3 -0
- package/src/redux/panelsShown.js +273 -0
- package/src/redux/partLengthsToHide.js +23 -0
- package/src/redux/primerLengthsToHide.js +27 -0
- package/src/redux/propertiesTool.js +40 -0
- package/src/redux/readOnly.js +28 -0
- package/src/redux/replacementLayers.js +36 -0
- package/src/redux/restrictionEnzymes.js +52 -0
- package/src/redux/selectedAnnotations.js +89 -0
- package/src/redux/selectedPartTags.js +21 -0
- package/src/redux/selectionLayer.js +46 -0
- package/src/redux/sequenceData/circular.js +19 -0
- package/src/redux/sequenceData/description.js +21 -0
- package/src/redux/sequenceData/features.js +19 -0
- package/src/redux/sequenceData/index.js +81 -0
- package/src/redux/sequenceData/lineageLines.js +11 -0
- package/src/redux/sequenceData/materiallyAvailable.js +19 -0
- package/src/redux/sequenceData/name.js +19 -0
- package/src/redux/sequenceData/parts.js +19 -0
- package/src/redux/sequenceData/primers.js +19 -0
- package/src/redux/sequenceData/sequence.js +12 -0
- package/src/redux/sequenceData/sharedActionCreators.js +0 -0
- package/src/redux/sequenceData/translations.js +20 -0
- package/src/redux/sequenceData/upsertDeleteActionGenerator.js +31 -0
- package/src/redux/sequenceDataHistory.js +43 -0
- package/src/redux/showGCContent.js +23 -0
- package/src/redux/toolBar.js +25 -0
- package/src/redux/uppercaseSequenceMapFont.js +25 -0
- package/src/redux/useAdditionalOrfStartCodons.js +24 -0
- package/src/redux/utils/addDashesForMatchStartAndEndForTracks/index.js +71 -0
- package/src/redux/utils/addMetaToActionCreators.js +12 -0
- package/src/redux/utils/createMergedDefaultStateReducer.js +30 -0
- package/src/redux/utils/createMetaAction.js +12 -0
- package/src/redux/versionHistory.js +27 -0
- package/src/selectors/annotationLabelVisibility.js +2 -0
- package/src/selectors/annotationSearchSelector.js +24 -0
- package/src/selectors/cdsFeaturesSelector.js +9 -0
- package/src/selectors/circularSelector.js +4 -0
- package/src/selectors/cutsiteLabelColorSelector.js +6 -0
- package/src/selectors/cutsitesByRangeSelector.js +5 -0
- package/src/selectors/cutsitesSelector.js +61 -0
- package/src/selectors/editorSelector.js +2 -0
- package/src/selectors/featuresSelector.js +8 -0
- package/src/selectors/filteredCutsitesSelector.js +137 -0
- package/src/selectors/filteredFeaturesSelector.js +32 -0
- package/src/selectors/filteredPartsSelector.js +57 -0
- package/src/selectors/filteredPrimersSelector.js +27 -0
- package/src/selectors/filteredRestrictionEnzymesSelector.js +1 -0
- package/src/selectors/getAdditionalEnzymesSelector.js +46 -0
- package/src/selectors/index.js +41 -0
- package/src/selectors/isEnzymeFilterAndSelector.js +1 -0
- package/src/selectors/minimumOrfSizeSelector.js +2 -0
- package/src/selectors/orfsSelector.js +15 -0
- package/src/selectors/partsSelector.js +8 -0
- package/src/selectors/primersSelector.js +8 -0
- package/src/selectors/restrictionEnzymesSelector.js +34 -0
- package/src/selectors/searchLayersSelector.js +71 -0
- package/src/selectors/selectedAnnotationsSelector.js +1 -0
- package/src/selectors/selectedCutsitesSelector.js +21 -0
- package/src/selectors/sequenceDataSelector.js +2 -0
- package/src/selectors/sequenceLengthSelector.js +5 -0
- package/src/selectors/sequenceSelector.js +4 -0
- package/src/selectors/tagsToBoldSelector.js +2 -0
- package/src/selectors/translationSearchMatchesSelector.js +14 -0
- package/src/selectors/translationsRawSelector.js +8 -0
- package/src/selectors/translationsSelector.js +137 -0
- package/src/style.css +82 -0
- package/src/updateEditor.js +198 -0
- package/src/utils/PassThrough.js +3 -0
- package/src/utils/addWrappedAddons.js +20 -0
- package/src/utils/annotationTypes.js +37 -0
- package/src/utils/arrayUtils.js +19 -0
- package/src/utils/calculateTickMarkPositionsForGivenRange.js +47 -0
- package/src/utils/cleanSequenceData_DEPRECATED/arrayToObjWithIds.js +17 -0
- package/src/utils/combineReducersDontIgnoreKeys.js +12 -0
- package/src/utils/commandUtils.js +18 -0
- package/src/utils/editorUtils.js +223 -0
- package/src/utils/getAnnotationClassnames.js +12 -0
- package/src/utils/getAnnotationNameAndStartStopString.js +61 -0
- package/src/utils/getVisibleStartEnd.js +7 -0
- package/src/utils/massageTickSpacing.js +19 -0
- package/src/utils/onlyUpdateForKeysDeep.js +31 -0
- package/src/utils/prepareRowData.js +64 -0
- package/src/utils/proteinUtils.js +3 -0
- package/src/utils/pureNoFunc.js +18 -0
- package/src/utils/selectionLayer.js +25 -0
- package/src/utils/shouldRerender.js +27 -0
- package/src/utils/showFileDialog.js +26 -0
- package/src/utils/updateLabelsForInViewFeatures.js +55 -0
- package/src/utils/updateLabelsForInViewFeaturesCircView.js +41 -0
- package/src/utils/useAAColorType.js +8 -0
- package/src/utils/useAnnotationLimits.js +42 -0
- package/src/utils/useChromatogramPrefs.js +31 -0
- package/src/utils/useLadders.js +6 -0
- package/src/utils/useMeltingTemp.js +7 -0
- package/src/utils/useTmType.js +10 -0
- package/src/withEditorInteractions/Keyboard.js +86 -0
- package/src/withEditorInteractions/clickAndDragUtils.js +576 -0
- package/src/withEditorInteractions/createSequenceInputPopup.js +296 -0
- package/src/withEditorInteractions/createSequenceInputPopupStyle.css +85 -0
- package/src/withEditorInteractions/getBpsPerRow.js +19 -0
- package/src/withEditorInteractions/index.js +1252 -0
- package/src/withEditorInteractions/isElementInViewport.js +29 -0
- package/src/withEditorInteractions/moveCaret.js +58 -0
- package/src/withEditorProps/index.js +1010 -0
- package/index.mjs +0 -193201
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { Icon } from "@blueprintjs/core";
|
|
3
|
+
import Dropzone from "react-dropzone";
|
|
4
|
+
import ToolbarItem from "./ToolbarItem";
|
|
5
|
+
import { compose, withHandlers } from "recompose";
|
|
6
|
+
import { importSequenceFromFile, connectToEditor } from "../withEditorProps";
|
|
7
|
+
|
|
8
|
+
export default compose(
|
|
9
|
+
connectToEditor(),
|
|
10
|
+
withHandlers({ importSequenceFromFile })
|
|
11
|
+
)(({ toolbarItemProps, importSequenceFromFile }) => {
|
|
12
|
+
return (
|
|
13
|
+
<ToolbarItem
|
|
14
|
+
{...{
|
|
15
|
+
Icon: <Icon data-test="veImportTool" icon="export" />,
|
|
16
|
+
IconWrapper: Dropzone,
|
|
17
|
+
IconWrapperProps: {
|
|
18
|
+
multiple: false,
|
|
19
|
+
style: {},
|
|
20
|
+
onDrop: (files) => importSequenceFromFile(files[0])
|
|
21
|
+
},
|
|
22
|
+
tooltip: "Click or drag to import and view files (.fasta .gb .dna)",
|
|
23
|
+
...toolbarItemProps
|
|
24
|
+
}}
|
|
25
|
+
/>
|
|
26
|
+
);
|
|
27
|
+
});
|
|
@@ -0,0 +1,231 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { flatMap, isString, pick } from "lodash";
|
|
3
|
+
import versionHistoryTool from "./versionHistoryTool";
|
|
4
|
+
// import {connectToEditor} from "../withEditorProps";
|
|
5
|
+
import MenuBar from "../MenuBar";
|
|
6
|
+
import "./style.css";
|
|
7
|
+
import { Button, Tooltip } from "@blueprintjs/core";
|
|
8
|
+
|
|
9
|
+
import downloadTool from "./downloadTool";
|
|
10
|
+
import importTool from "./importTool";
|
|
11
|
+
import cutsiteTool from "./cutsiteTool";
|
|
12
|
+
import featureTool from "./featureTool";
|
|
13
|
+
import partTool from "./partTool";
|
|
14
|
+
import oligoTool from "./oligoTool";
|
|
15
|
+
import orfTool from "./orfTool";
|
|
16
|
+
import editTool from "./editTool";
|
|
17
|
+
import findTool from "./findTool";
|
|
18
|
+
import inlineFindTool from "./inlineFindTool";
|
|
19
|
+
import alignmentTool from "./alignmentTool";
|
|
20
|
+
import saveTool from "./saveTool";
|
|
21
|
+
import visibilityTool from "./visibilityTool";
|
|
22
|
+
import undoTool from "./undoTool";
|
|
23
|
+
import redoTool from "./redoTool";
|
|
24
|
+
import isMobile from "is-mobile";
|
|
25
|
+
import { useMemo } from "react";
|
|
26
|
+
|
|
27
|
+
const allTools = {
|
|
28
|
+
downloadTool,
|
|
29
|
+
importTool,
|
|
30
|
+
cutsiteTool,
|
|
31
|
+
alignmentTool,
|
|
32
|
+
featureTool,
|
|
33
|
+
partTool,
|
|
34
|
+
oligoTool,
|
|
35
|
+
orfTool,
|
|
36
|
+
editTool,
|
|
37
|
+
findTool,
|
|
38
|
+
inlineFindTool,
|
|
39
|
+
versionHistoryTool,
|
|
40
|
+
saveTool,
|
|
41
|
+
visibilityTool,
|
|
42
|
+
undoTool,
|
|
43
|
+
redoTool
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
export function ToolBar(props) {
|
|
47
|
+
const {
|
|
48
|
+
modifyTools,
|
|
49
|
+
contentLeft,
|
|
50
|
+
showMenuBar,
|
|
51
|
+
displayMenuBarAboveTools,
|
|
52
|
+
isProtein,
|
|
53
|
+
openHotkeyDialog,
|
|
54
|
+
onSave,
|
|
55
|
+
userDefinedHandlersAndOpts,
|
|
56
|
+
editorName,
|
|
57
|
+
annotationsToSupport,
|
|
58
|
+
handleFullscreenClose,
|
|
59
|
+
closeFullscreen,
|
|
60
|
+
additionalTopRightToolbarButtons,
|
|
61
|
+
toolList = defaultToolList,
|
|
62
|
+
...rest
|
|
63
|
+
} = props;
|
|
64
|
+
const userDefinedProps = {
|
|
65
|
+
...pick(props, userDefinedHandlersAndOpts)
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
const toolListToUse = useMemo(() => {
|
|
69
|
+
return flatMap(toolList, (toolNameOrOverrides) => {
|
|
70
|
+
let toolName;
|
|
71
|
+
let toolOverride;
|
|
72
|
+
if (isString(toolNameOrOverrides)) {
|
|
73
|
+
toolName = toolNameOrOverrides;
|
|
74
|
+
} else {
|
|
75
|
+
toolOverride = toolNameOrOverrides;
|
|
76
|
+
toolName = toolNameOrOverrides.name;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
if (
|
|
80
|
+
toolName === "oligoTool" &&
|
|
81
|
+
annotationsToSupport &&
|
|
82
|
+
annotationsToSupport.primers === false
|
|
83
|
+
)
|
|
84
|
+
return [];
|
|
85
|
+
|
|
86
|
+
const Tool = toolOverride
|
|
87
|
+
? allTools[toolOverride.name]
|
|
88
|
+
: allTools[toolName];
|
|
89
|
+
if (!Tool) {
|
|
90
|
+
console.error(
|
|
91
|
+
"You're trying to load a tool that doesn't appear to exist: " +
|
|
92
|
+
toolName
|
|
93
|
+
);
|
|
94
|
+
return [];
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
if (isProtein) {
|
|
98
|
+
if (
|
|
99
|
+
toolName === "cutsiteTool" ||
|
|
100
|
+
toolName === "orfTool" ||
|
|
101
|
+
toolName === "alignmentTool"
|
|
102
|
+
) {
|
|
103
|
+
return [];
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
if (toolName === "saveTool" && !onSave) {
|
|
107
|
+
return [];
|
|
108
|
+
} //don't show the option to save if no onSave handler is passed
|
|
109
|
+
|
|
110
|
+
return { toolName, toolOverride, Tool };
|
|
111
|
+
});
|
|
112
|
+
}, [toolList, annotationsToSupport, isProtein, onSave]);
|
|
113
|
+
|
|
114
|
+
let items = flatMap(
|
|
115
|
+
toolListToUse,
|
|
116
|
+
({ toolName, toolOverride, Tool }, index) => {
|
|
117
|
+
if (!Tool) return [];
|
|
118
|
+
return (
|
|
119
|
+
<Tool
|
|
120
|
+
{...rest}
|
|
121
|
+
{...userDefinedProps}
|
|
122
|
+
toolbarItemProps={{
|
|
123
|
+
...userDefinedProps,
|
|
124
|
+
index,
|
|
125
|
+
toolName,
|
|
126
|
+
editorName,
|
|
127
|
+
...toolOverride
|
|
128
|
+
}}
|
|
129
|
+
editorName={editorName}
|
|
130
|
+
key={toolName}
|
|
131
|
+
/>
|
|
132
|
+
);
|
|
133
|
+
}
|
|
134
|
+
);
|
|
135
|
+
|
|
136
|
+
if (modifyTools) {
|
|
137
|
+
items = modifyTools(items);
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
return (
|
|
141
|
+
<div className="veToolbar-outer" style={{ display: "flex" }}>
|
|
142
|
+
{contentLeft}
|
|
143
|
+
<div
|
|
144
|
+
style={{
|
|
145
|
+
...(displayMenuBarAboveTools && showMenuBar
|
|
146
|
+
? {
|
|
147
|
+
display: "flex",
|
|
148
|
+
width: "100%",
|
|
149
|
+
flexDirection: "column",
|
|
150
|
+
alignItems: "flex-start"
|
|
151
|
+
}
|
|
152
|
+
: {
|
|
153
|
+
display: "flex",
|
|
154
|
+
width: "100%",
|
|
155
|
+
justifyContent: "center",
|
|
156
|
+
flexWrap: "wrap"
|
|
157
|
+
})
|
|
158
|
+
}}
|
|
159
|
+
className="veToolbar"
|
|
160
|
+
>
|
|
161
|
+
{showMenuBar && (
|
|
162
|
+
<MenuBar
|
|
163
|
+
openHotkeyDialog={openHotkeyDialog}
|
|
164
|
+
{...userDefinedProps}
|
|
165
|
+
onSave={onSave} //needs to be passed so that editor commands will have it
|
|
166
|
+
style={{ marginLeft: 0 }}
|
|
167
|
+
editorName={editorName}
|
|
168
|
+
/>
|
|
169
|
+
)}
|
|
170
|
+
{displayMenuBarAboveTools && showMenuBar ? (
|
|
171
|
+
<div
|
|
172
|
+
className="veTools-displayMenuBarAboveTools"
|
|
173
|
+
style={{
|
|
174
|
+
display: "flex",
|
|
175
|
+
paddingLeft: 15,
|
|
176
|
+
paddingRight: 15,
|
|
177
|
+
flexWrap: "wrap",
|
|
178
|
+
...(isMobile() && {
|
|
179
|
+
overflow: "auto",
|
|
180
|
+
flexWrap: "nowrap",
|
|
181
|
+
width: "100%"
|
|
182
|
+
})
|
|
183
|
+
// width: "100%"
|
|
184
|
+
}}
|
|
185
|
+
>
|
|
186
|
+
{items}
|
|
187
|
+
</div>
|
|
188
|
+
) : (
|
|
189
|
+
items
|
|
190
|
+
)}
|
|
191
|
+
</div>
|
|
192
|
+
{additionalTopRightToolbarButtons}
|
|
193
|
+
{closeFullscreen && (
|
|
194
|
+
<CloseFullscreenButton onClick={handleFullscreenClose} />
|
|
195
|
+
)}
|
|
196
|
+
</div>
|
|
197
|
+
);
|
|
198
|
+
}
|
|
199
|
+
const CloseFullscreenButton = (props) => {
|
|
200
|
+
return (
|
|
201
|
+
<Tooltip content="Close Fullscreen Mode">
|
|
202
|
+
<Button
|
|
203
|
+
minimal
|
|
204
|
+
style={{
|
|
205
|
+
marginTop: 2,
|
|
206
|
+
marginRight: 2
|
|
207
|
+
}}
|
|
208
|
+
onClick={props.onClick}
|
|
209
|
+
className="ve-close-fullscreen-button"
|
|
210
|
+
icon="minimize"
|
|
211
|
+
/>
|
|
212
|
+
</Tooltip>
|
|
213
|
+
);
|
|
214
|
+
};
|
|
215
|
+
|
|
216
|
+
const defaultToolList = [
|
|
217
|
+
"saveTool",
|
|
218
|
+
"downloadTool",
|
|
219
|
+
"importTool",
|
|
220
|
+
"undoTool",
|
|
221
|
+
"redoTool",
|
|
222
|
+
"cutsiteTool",
|
|
223
|
+
"featureTool",
|
|
224
|
+
"partTool",
|
|
225
|
+
"oligoTool",
|
|
226
|
+
"orfTool",
|
|
227
|
+
"alignmentTool",
|
|
228
|
+
"editTool",
|
|
229
|
+
"findTool",
|
|
230
|
+
"visibilityTool"
|
|
231
|
+
];
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { Icon } from "@blueprintjs/core";
|
|
3
|
+
import FindBar from "../FindBar";
|
|
4
|
+
import ToolbarItem from "./ToolbarItem";
|
|
5
|
+
import { connectToEditor } from "../withEditorProps";
|
|
6
|
+
|
|
7
|
+
export default connectToEditor(({ findTool = {} }) => {
|
|
8
|
+
return {
|
|
9
|
+
isOpen: findTool.isOpen
|
|
10
|
+
};
|
|
11
|
+
})(({ toolbarItemProps, editorName, toggleFindTool, isOpen }) => {
|
|
12
|
+
return (
|
|
13
|
+
<ToolbarItem
|
|
14
|
+
{...{
|
|
15
|
+
Icon: !isOpen ? (
|
|
16
|
+
<div>
|
|
17
|
+
<Icon data-test="ve-find-tool-toggle" icon="search" />
|
|
18
|
+
<Icon icon="caret-right" />
|
|
19
|
+
</div>
|
|
20
|
+
) : (
|
|
21
|
+
<FindBar editorName={editorName} />
|
|
22
|
+
),
|
|
23
|
+
renderIconAbove: isOpen,
|
|
24
|
+
onIconClick: toggleFindTool,
|
|
25
|
+
tooltip: isOpen ? (
|
|
26
|
+
<span>
|
|
27
|
+
Hide Find Tool <span style={{ fontSize: 10 }}>(Cmd/Ctrl+F)</span>
|
|
28
|
+
</span>
|
|
29
|
+
) : (
|
|
30
|
+
<span>
|
|
31
|
+
Show Find Tool <span style={{ fontSize: 10 }}>(Cmd/Ctrl+F)</span>
|
|
32
|
+
</span>
|
|
33
|
+
),
|
|
34
|
+
...toolbarItemProps
|
|
35
|
+
}}
|
|
36
|
+
/>
|
|
37
|
+
);
|
|
38
|
+
});
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { Icon } from "@blueprintjs/core";
|
|
2
|
+
import React from "react";
|
|
3
|
+
import ToolbarItem from "./ToolbarItem";
|
|
4
|
+
import { connectToEditor } from "../withEditorProps";
|
|
5
|
+
|
|
6
|
+
export default connectToEditor(editorState => {
|
|
7
|
+
return {
|
|
8
|
+
isHidden: editorState.sequenceData && editorState.sequenceData.isProtein,
|
|
9
|
+
|
|
10
|
+
toggled:
|
|
11
|
+
editorState.annotationVisibility &&
|
|
12
|
+
editorState.annotationVisibility.primers
|
|
13
|
+
};
|
|
14
|
+
})(({ toolbarItemProps, isHidden, toggled, annotationVisibilityToggle }) => {
|
|
15
|
+
return (
|
|
16
|
+
<ToolbarItem
|
|
17
|
+
{...{
|
|
18
|
+
Icon: <Icon icon="swap-horizontal" />,
|
|
19
|
+
onIconClick: function() {
|
|
20
|
+
annotationVisibilityToggle("primers");
|
|
21
|
+
},
|
|
22
|
+
isHidden,
|
|
23
|
+
toggled,
|
|
24
|
+
tooltip: "Show Primers",
|
|
25
|
+
tooltipToggled: "Hide Primers",
|
|
26
|
+
...toolbarItemProps
|
|
27
|
+
}}
|
|
28
|
+
/>
|
|
29
|
+
);
|
|
30
|
+
});
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
import { Icon } from "@blueprintjs/core";
|
|
2
|
+
import React from "react";
|
|
3
|
+
import {
|
|
4
|
+
orfIcon,
|
|
5
|
+
CmdCheckbox,
|
|
6
|
+
CmdDiv,
|
|
7
|
+
InfoHelper
|
|
8
|
+
} from "@teselagen/ui";
|
|
9
|
+
import ToolbarItem from "./ToolbarItem";
|
|
10
|
+
import { connectToEditor } from "../withEditorProps";
|
|
11
|
+
import withEditorProps from "../withEditorProps";
|
|
12
|
+
import getCommands from "../commands";
|
|
13
|
+
|
|
14
|
+
export default connectToEditor(
|
|
15
|
+
({ annotationVisibility = {}, toolBar = {} }) => {
|
|
16
|
+
return {
|
|
17
|
+
toggled: annotationVisibility.orfs,
|
|
18
|
+
isOpen: toolBar.openItem === "orfTool"
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
)(({ toolbarItemProps, toggled, annotationVisibilityToggle, isOpen }) => {
|
|
22
|
+
return (
|
|
23
|
+
<ToolbarItem
|
|
24
|
+
{...{
|
|
25
|
+
Icon: <Icon data-test="orfTool" icon={orfIcon} />,
|
|
26
|
+
onIconClick: function () {
|
|
27
|
+
annotationVisibilityToggle("orfs");
|
|
28
|
+
},
|
|
29
|
+
toggled,
|
|
30
|
+
tooltip: "Show Open Reading Frames",
|
|
31
|
+
tooltipToggled: "Hide Open Reading Frames",
|
|
32
|
+
Dropdown: OrfToolDropdown,
|
|
33
|
+
dropdowntooltip:
|
|
34
|
+
(!isOpen ? "Show" : "Hide") + " Open Reading Frame Options",
|
|
35
|
+
...toolbarItemProps
|
|
36
|
+
}}
|
|
37
|
+
/>
|
|
38
|
+
);
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
const OrfToolDropdown = withEditorProps(
|
|
42
|
+
class OrfDropdown extends React.Component {
|
|
43
|
+
constructor(props) {
|
|
44
|
+
super(props);
|
|
45
|
+
this.commands = getCommands(this);
|
|
46
|
+
}
|
|
47
|
+
render() {
|
|
48
|
+
return (
|
|
49
|
+
<div className="veToolbarOrfOptionsHolder">
|
|
50
|
+
<CmdCheckbox
|
|
51
|
+
prefix="Show "
|
|
52
|
+
cmd={this.commands.toggleOrfTranslations}
|
|
53
|
+
/>
|
|
54
|
+
<CmdCheckbox
|
|
55
|
+
prefix="Show "
|
|
56
|
+
cmd={this.commands.useGtgAndCtgAsStartCodons}
|
|
57
|
+
/>
|
|
58
|
+
<CmdDiv cmd={this.commands.minOrfSizeCmd} />
|
|
59
|
+
<div className="vespacer" />
|
|
60
|
+
|
|
61
|
+
<InfoHelper
|
|
62
|
+
displayToSide
|
|
63
|
+
content="To translate an arbitrary area, right click a selection."
|
|
64
|
+
/>
|
|
65
|
+
</div>
|
|
66
|
+
);
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
);
|
|
70
|
+
// const OrfToolDropdown = withEditorProps(function({
|
|
71
|
+
// useAdditionalOrfStartCodons,
|
|
72
|
+
// useAdditionalOrfStartCodonsToggle,
|
|
73
|
+
// annotationVisibility,
|
|
74
|
+
// annotationVisibilityToggle,
|
|
75
|
+
// editorName
|
|
76
|
+
// }) {
|
|
77
|
+
// return (
|
|
78
|
+
// <div className="veToolbarOrfOptionsHolder">
|
|
79
|
+
// {/* <div className="vespacer" />
|
|
80
|
+
// <MinOrfSize editorName={editorName} />
|
|
81
|
+
// <Checkbox
|
|
82
|
+
// onChange={function() {
|
|
83
|
+
// annotationVisibilityToggle("orfTranslations");
|
|
84
|
+
// }}
|
|
85
|
+
// disabled={!annotationVisibility.orfs}
|
|
86
|
+
// checked={annotationVisibility.orfTranslations}
|
|
87
|
+
// label="Show translations for ORFs"
|
|
88
|
+
// />
|
|
89
|
+
// <Checkbox
|
|
90
|
+
// onChange={function() {
|
|
91
|
+
// annotationVisibilityToggle("cdsFeatureTranslations");
|
|
92
|
+
// }}
|
|
93
|
+
// checked={annotationVisibility.cdsFeatureTranslations}
|
|
94
|
+
// label="Show translations for CDS features"
|
|
95
|
+
// />
|
|
96
|
+
// <Checkbox
|
|
97
|
+
// onChange={useAdditionalOrfStartCodonsToggle}
|
|
98
|
+
// checked={useAdditionalOrfStartCodons}
|
|
99
|
+
// label="Use GTG and CTG as start codons"
|
|
100
|
+
// /> */}
|
|
101
|
+
// <div className="vespacer" />
|
|
102
|
+
|
|
103
|
+
// <InfoHelper
|
|
104
|
+
// displayToSide
|
|
105
|
+
// content="To translate an arbitrary area, right click a selection."
|
|
106
|
+
// />
|
|
107
|
+
// </div>
|
|
108
|
+
// );
|
|
109
|
+
// });
|
|
110
|
+
|
|
111
|
+
// export const MinOrfSize = connectToEditor(editorState => {
|
|
112
|
+
// return {
|
|
113
|
+
// sequenceLength: selectors.sequenceLengthSelector(editorState),
|
|
114
|
+
// minimumOrfSize: editorState.minimumOrfSize
|
|
115
|
+
// };
|
|
116
|
+
// })(
|
|
117
|
+
// ({
|
|
118
|
+
// minimumOrfSizeUpdate,
|
|
119
|
+
// sequenceLength,
|
|
120
|
+
// annotationVisibilityShow,
|
|
121
|
+
// minimumOrfSize
|
|
122
|
+
// }) => {
|
|
123
|
+
// return (
|
|
124
|
+
// <div data-test="min-orf-size" style={{ display: "flex" }}>
|
|
125
|
+
// Minimum ORF Size:
|
|
126
|
+
// <input
|
|
127
|
+
// type="number"
|
|
128
|
+
// className={classNames(Classes.INPUT, "minOrfSizeInput")}
|
|
129
|
+
// onChange={function(event) {
|
|
130
|
+
// let minimumOrfSize = parseInt(event.target.value, 10);
|
|
131
|
+
// if (!(minimumOrfSize > -1)) return;
|
|
132
|
+
// if (minimumOrfSize > sequenceLength) return;
|
|
133
|
+
// annotationVisibilityShow("orfs");
|
|
134
|
+
// minimumOrfSizeUpdate(minimumOrfSize);
|
|
135
|
+
// }}
|
|
136
|
+
// value={minimumOrfSize}
|
|
137
|
+
// />
|
|
138
|
+
// </div>
|
|
139
|
+
// );
|
|
140
|
+
// }
|
|
141
|
+
// );
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { Icon } from "@blueprintjs/core";
|
|
2
|
+
// import { Checkbox, Button } from "@blueprintjs/core";
|
|
3
|
+
import React from "react";
|
|
4
|
+
// import { connect } from "react-redux";
|
|
5
|
+
// import { convertRangeTo1Based } from "@teselagen/range-utils";
|
|
6
|
+
//import { partIcon } from "@teselagen/ui";
|
|
7
|
+
import ToolbarItem from "./ToolbarItem";
|
|
8
|
+
import { connectToEditor } from "../withEditorProps";
|
|
9
|
+
import { PartTagSearch } from "../helperComponents/partTagSearch";
|
|
10
|
+
|
|
11
|
+
export default connectToEditor(
|
|
12
|
+
({ annotationVisibility = {}, toolBar = {} }) => {
|
|
13
|
+
return {
|
|
14
|
+
toggled: annotationVisibility.parts,
|
|
15
|
+
isOpen: toolBar.openItem === "partTool"
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
)(
|
|
19
|
+
({
|
|
20
|
+
allPartTags,
|
|
21
|
+
editTagsLink,
|
|
22
|
+
toolbarItemProps,
|
|
23
|
+
toggled,
|
|
24
|
+
annotationVisibilityToggle,
|
|
25
|
+
isOpen
|
|
26
|
+
}) => {
|
|
27
|
+
return (
|
|
28
|
+
<ToolbarItem
|
|
29
|
+
{...{
|
|
30
|
+
Icon: <Icon icon="doughnut-chart" />,
|
|
31
|
+
onIconClick: function () {
|
|
32
|
+
annotationVisibilityToggle("parts");
|
|
33
|
+
},
|
|
34
|
+
toggled,
|
|
35
|
+
editTagsLink,
|
|
36
|
+
allPartTags,
|
|
37
|
+
tooltip: "Show parts",
|
|
38
|
+
tooltipToggled: "Hide parts",
|
|
39
|
+
noDropdownIcon: !allPartTags,
|
|
40
|
+
Dropdown: PartTagSearch,
|
|
41
|
+
dropdowntooltip: (!isOpen ? "Show" : "Hide") + " Part Options",
|
|
42
|
+
...toolbarItemProps
|
|
43
|
+
}}
|
|
44
|
+
/>
|
|
45
|
+
);
|
|
46
|
+
}
|
|
47
|
+
);
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
//TNRTODO this needs to be fixed and implemented
|
|
2
|
+
import React from "react";
|
|
3
|
+
import print from "./veToolbarIcons/print.png";
|
|
4
|
+
|
|
5
|
+
export default () => {
|
|
6
|
+
return {
|
|
7
|
+
Icon: <img src={print} alt="Print Vector" />,
|
|
8
|
+
onIconClick: function() {
|
|
9
|
+
// var myPrintContent = document.getElementById('printdiv');
|
|
10
|
+
// var myPrintWindow = window.open(windowUrl, windowName, 'left=300,top=100,width=400,height=400');
|
|
11
|
+
// myPrintWindow.document.write(myPrintContent.innerHTML);
|
|
12
|
+
// myPrintWindow.document.getElementById('hidden_div').style.display='block'
|
|
13
|
+
// myPrintWindow.document.close();
|
|
14
|
+
// myPrintWindow.focus();
|
|
15
|
+
// myPrintWindow.print();
|
|
16
|
+
// myPrintWindow.close();
|
|
17
|
+
// return false;
|
|
18
|
+
// print();
|
|
19
|
+
// var content = document.getElementById("divcontents");
|
|
20
|
+
// document.appendChild(con)
|
|
21
|
+
// var pri = document.getElementById("ifmcontentstoprint").contentWindow;
|
|
22
|
+
// pri.document.open();
|
|
23
|
+
// pri.document.write(content.innerHTML);
|
|
24
|
+
// pri.document.close();
|
|
25
|
+
// pri.focus();
|
|
26
|
+
// pri.print();
|
|
27
|
+
// downloadSequenceData(sequenceData || )
|
|
28
|
+
},
|
|
29
|
+
tooltip: "Print Vector"
|
|
30
|
+
};
|
|
31
|
+
};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { Icon } from "@blueprintjs/core";
|
|
3
|
+
import ToolbarItem from "./ToolbarItem";
|
|
4
|
+
import { connectToEditor } from "../withEditorProps";
|
|
5
|
+
|
|
6
|
+
export default connectToEditor(editorState => {
|
|
7
|
+
return {
|
|
8
|
+
disabled: !(
|
|
9
|
+
editorState.sequenceDataHistory &&
|
|
10
|
+
editorState.sequenceDataHistory.future &&
|
|
11
|
+
editorState.sequenceDataHistory.future.length
|
|
12
|
+
)
|
|
13
|
+
};
|
|
14
|
+
})(({ toolbarItemProps, redo, disabled }) => {
|
|
15
|
+
return (
|
|
16
|
+
<ToolbarItem
|
|
17
|
+
{...{
|
|
18
|
+
Icon: <Icon data-test="veRedoTool" icon="redo" />,
|
|
19
|
+
disabled,
|
|
20
|
+
onIconClick: redo,
|
|
21
|
+
tooltip: (
|
|
22
|
+
<span>
|
|
23
|
+
Redo <span style={{ fontSize: 10 }}>(Cmd/Ctrl+Shift+Z)</span>
|
|
24
|
+
</span>
|
|
25
|
+
),
|
|
26
|
+
...toolbarItemProps
|
|
27
|
+
}}
|
|
28
|
+
/>
|
|
29
|
+
);
|
|
30
|
+
});
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { Icon } from "@blueprintjs/core";
|
|
3
|
+
import ToolbarItem from "./ToolbarItem";
|
|
4
|
+
import { connectToEditor, handleSave } from "../withEditorProps";
|
|
5
|
+
import { withHandlers } from "recompose";
|
|
6
|
+
import { compose } from "redux";
|
|
7
|
+
|
|
8
|
+
export default compose(
|
|
9
|
+
connectToEditor(
|
|
10
|
+
({ readOnly, sequenceData = {}, lastSavedId = "134%!@#%!@#%!@%" }) => {
|
|
11
|
+
return {
|
|
12
|
+
readOnly: readOnly,
|
|
13
|
+
sequenceData: sequenceData,
|
|
14
|
+
hasBeenSaved:
|
|
15
|
+
sequenceData.stateTrackingId === "initialLoadId" ||
|
|
16
|
+
sequenceData.stateTrackingId === lastSavedId
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
),
|
|
20
|
+
withHandlers({ handleSave })
|
|
21
|
+
)(
|
|
22
|
+
({
|
|
23
|
+
toolbarItemProps,
|
|
24
|
+
alwaysAllowSave,
|
|
25
|
+
handleSave,
|
|
26
|
+
readOnly,
|
|
27
|
+
hasBeenSaved,
|
|
28
|
+
onSave
|
|
29
|
+
}) => {
|
|
30
|
+
return (
|
|
31
|
+
<ToolbarItem
|
|
32
|
+
{...{
|
|
33
|
+
Icon: <Icon data-test="saveTool" icon="floppy-disk" />,
|
|
34
|
+
onIconClick: handleSave,
|
|
35
|
+
disabled: alwaysAllowSave
|
|
36
|
+
? false
|
|
37
|
+
: !onSave || hasBeenSaved || readOnly,
|
|
38
|
+
tooltip: (
|
|
39
|
+
<span>
|
|
40
|
+
Save <span style={{ fontSize: 10 }}>(Cmd/Ctrl+S)</span>
|
|
41
|
+
</span>
|
|
42
|
+
),
|
|
43
|
+
...toolbarItemProps
|
|
44
|
+
}}
|
|
45
|
+
/>
|
|
46
|
+
);
|
|
47
|
+
}
|
|
48
|
+
);
|