@teselagen/ove 0.8.7 → 0.8.8

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@teselagen/ove",
3
- "version": "0.8.7",
3
+ "version": "0.8.8",
4
4
  "main": "./src/index.js",
5
5
  "type": "module",
6
6
  "exports": {
@@ -6,7 +6,7 @@
6
6
  * @param {number} [props.height=150]
7
7
  * @param {string[]} [props.barColors]
8
8
  */
9
- import React from 'react'
9
+ import React from "react";
10
10
  export function BarPlot({
11
11
  data,
12
12
  width = 300,
@@ -41,7 +41,7 @@ import LinearView from "../LinearView";
41
41
  import RowView from "../RowView";
42
42
  import StatusBar from "../StatusBar";
43
43
  import DropHandler from "./DropHandler";
44
- import Properties from "../helperComponents/PropertiesDialog";
44
+ import PropertiesDialog from "../helperComponents/PropertiesDialog";
45
45
  import "./style.css";
46
46
  import { DragDropContext, Droppable, Draggable } from "@hello-pangea/dnd";
47
47
  import DigestTool from "../DigestTool/DigestTool";
@@ -76,7 +76,7 @@ const _panelMap = {
76
76
  digestTool: DigestTool,
77
77
  pcrTool: PCRTool,
78
78
  properties: {
79
- comp: Properties,
79
+ comp: PropertiesDialog,
80
80
  panelSpecificProps: ["PropertiesProps"]
81
81
  },
82
82
  mismatches: Mismatches
@@ -11,6 +11,8 @@ export const userDefinedHandlersAndOpts = [
11
11
  "allowPrimerBasesToBeEdited",
12
12
  "truncateLabelsThatDoNotFit",
13
13
  "smartCircViewLabelRender",
14
+ "on_setPanelAsActive",
15
+ "on_propertiesViewTabUpdate",
14
16
  "onConfigureFeatureTypesClick",
15
17
  "allPartTags",
16
18
  "bpLimit",
@@ -17,7 +17,7 @@ export const togglePanelFullScreen = createAction("togglePanelFullScreen");
17
17
  export const collapsePanel = createAction("collapsePanel");
18
18
  export const closePanel = createAction("closePanel");
19
19
  export const _collapseSplitScreen = createAction("_collapseSplitScreen");
20
- export const setPanelAsActive = createAction("setPanelAsActive");
20
+ export const setPanelAsActive = createAction("SET_PANEL_AS_ACTIVE");
21
21
  export const flipActiveTabFromLinearOrCircularIfNecessary = createAction(
22
22
  "flipActiveTabFromLinearOrCircularIfNecessary"
23
23
  );
@@ -677,7 +677,8 @@ export function mapDispatchToActions(dispatch, ownProps) {
677
677
  editorName,
678
678
  actions,
679
679
  actionOverrides,
680
- dispatch
680
+ dispatch,
681
+ ownProps
681
682
  );
682
683
  const updateSel =
683
684
  ownProps.selectionLayerUpdate || actionsToPass.selectionLayerUpdate;
@@ -717,7 +718,8 @@ export function getCombinedActions(
717
718
  editorName,
718
719
  actions,
719
720
  actionOverrides,
720
- dispatch
721
+ dispatch,
722
+ ownProps
721
723
  ) {
722
724
  const meta = { editorName };
723
725
 
@@ -758,6 +760,21 @@ export function getCombinedActions(
758
760
  ...metaActions
759
761
  // ...metaOverrides
760
762
  };
763
+ function addGenericHook(hookName) {
764
+ const oldHook = actionsToPass[hookName];
765
+ actionsToPass[hookName] = (...args) => {
766
+ const toRet = oldHook(...args);
767
+ const newHookName = `on_${hookName}`;
768
+ if (ownProps[newHookName]) {
769
+ setTimeout(() => {
770
+ ownProps[newHookName](...args);
771
+ }, 0);
772
+ }
773
+ return toRet;
774
+ };
775
+ }
776
+ ["setPanelAsActive", "propertiesViewTabUpdate"].forEach(addGenericHook);
777
+
761
778
  return bindActionCreators(actionsToPass, dispatch);
762
779
  }
763
780
 
@@ -4,7 +4,7 @@ export function mapDispatchToActions(dispatch: any, ownProps: any): {
4
4
  dispatch: any;
5
5
  };
6
6
  export function fakeActionOverrides(): {};
7
- export function getCombinedActions(editorName: any, actions: any, actionOverrides: any, dispatch: any): {};
7
+ export function getCombinedActions(editorName: any, actions: any, actionOverrides: any, dispatch: any, ownProps: any): {};
8
8
  export function getShowGCContent(state: any, ownProps: any): any;
9
9
  export function handleSave(props: any): (opts?: {}) => Promise<any>;
10
10
  export function handleInverse(props: any): () => false | undefined;