@teselagen/ove 0.8.6 → 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/ove.css CHANGED
@@ -10391,7 +10391,16 @@ body:not(.drag-active)
10391
10391
  0 1px 3px rgba(0, 0, 0, 0.12),
10392
10392
  0 1px 2px rgba(0, 0, 0, 0.18);
10393
10393
  }
10394
-
10394
+ .no-card .tg-card {
10395
+ border-radius: unset;
10396
+ box-shadow: none;
10397
+ padding: 0;
10398
+ margin-bottom: 0;
10399
+ background: inherit;
10400
+ }
10401
+ .bp3-dark .no-card .tg-card {
10402
+ background: inherit !important;
10403
+ }
10395
10404
  .tg-card-header {
10396
10405
  display: flex;
10397
10406
  flex-direction: row;
@@ -11790,9 +11799,6 @@ h5 {
11790
11799
  width: fit-content;
11791
11800
  }
11792
11801
 
11793
- .ve-propertiesPanel .data-table-container {
11794
- min-height: 250px;
11795
- }
11796
11802
  .ve-propertiesPanel .data-table-footer {
11797
11803
  margin-top: 5px;
11798
11804
  margin-bottom: 5px;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@teselagen/ove",
3
- "version": "0.8.6",
3
+ "version": "0.8.8",
4
4
  "main": "./src/index.js",
5
5
  "type": "module",
6
6
  "exports": {
@@ -19,7 +19,7 @@
19
19
  "@teselagen/range-utils": "0.3.13",
20
20
  "@teselagen/react-list": "0.8.18",
21
21
  "@teselagen/sequence-utils": "0.3.35",
22
- "@teselagen/ui": "0.10.7",
22
+ "@teselagen/ui": "0.10.8",
23
23
  "@use-gesture/react": "10.3.0",
24
24
  "biomsa": "^0.2.4",
25
25
  "classnames": "^2.3.2",
@@ -6,6 +6,7 @@
6
6
  * @param {number} [props.height=150]
7
7
  * @param {string[]} [props.barColors]
8
8
  */
9
+ import React from "react";
9
10
  export function BarPlot({
10
11
  data,
11
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",
@@ -1,7 +1,6 @@
1
1
  import React from "react";
2
- import { compose } from "redux";
3
- import { Tab, Tabs } from "@blueprintjs/core";
4
- import { flatMap, startCase } from "lodash-es";
2
+ import { Tab, Tabs, Tag } from "@blueprintjs/core";
3
+ import { flatMap, isNumber, startCase } from "lodash-es";
5
4
  import FeatureProperties from "./FeatureProperties";
6
5
  import GeneralProperties from "./GeneralProperties";
7
6
  import CutsiteProperties from "./CutsiteProperties";
@@ -10,7 +9,7 @@ import GenbankView from "./GenbankView";
10
9
  import TranslationProperties from "./TranslationProperties";
11
10
  import PrimerProperties from "./PrimerProperties";
12
11
  import PartProperties from "./PartProperties";
13
- import { connectToEditor } from "../../withEditorProps";
12
+ import withEditorProps from "../../withEditorProps";
14
13
  import "./style.css";
15
14
  import { userDefinedHandlersAndOpts } from "../../Editor/userDefinedHandlersAndOpts";
16
15
  import { pick } from "lodash-es";
@@ -74,6 +73,26 @@ export const PropertiesDialog = props => {
74
73
  tabId = propertiesList[0].name || propertiesList[0];
75
74
  }
76
75
 
76
+ // Helper to get count for each annotation type
77
+ const getAnnotationCount = name => {
78
+ // Try to get from props, fallback to 0 if not found or not array
79
+ const annotations = props[name] || props.sequenceData[name];
80
+ let count;
81
+ if (Array.isArray(annotations)) {
82
+ count = annotations.length;
83
+ } else if (annotations && typeof annotations === "object") {
84
+ count = Object.keys(annotations).length;
85
+ }
86
+ if (isNumber(count)) {
87
+ return (
88
+ <Tag className="tg-smallTag" round style={{ marginLeft: 1 }}>
89
+ {count}
90
+ </Tag>
91
+ );
92
+ }
93
+ return null;
94
+ };
95
+
77
96
  const propertiesTabs = flatMap(propertiesList, nameOrOverride => {
78
97
  if (annotationsToSupport[nameOrOverride] === false) {
79
98
  return [];
@@ -91,12 +110,21 @@ export const PropertiesDialog = props => {
91
110
  return null;
92
111
  }
93
112
  }
94
- const title = (() => {
113
+ const count = getAnnotationCount(name);
114
+ let title = (() => {
95
115
  if (nameOrOverride.Comp) return name; //just use the user supplied name because this is a custom panel
96
116
  if (name === "orfs") return "ORFs";
97
117
  if (name === "cutsites") return "Cut Sites";
98
118
  return startCase(name);
99
119
  })();
120
+ if (count) {
121
+ title = (
122
+ <div style={{ display: "flex", alignItems: "center" }}>
123
+ {title}
124
+ {count}
125
+ </div>
126
+ );
127
+ }
100
128
 
101
129
  return (
102
130
  <Tab
@@ -162,8 +190,4 @@ export const PropertiesDialog = props => {
162
190
  );
163
191
  };
164
192
 
165
- export default compose(
166
- connectToEditor(({ propertiesTool, annotationsToSupport }) => {
167
- return { propertiesTool, annotationsToSupport };
168
- })
169
- )(PropertiesDialog);
193
+ export default withEditorProps(PropertiesDialog);
@@ -45,9 +45,6 @@
45
45
  width: fit-content;
46
46
  }
47
47
 
48
- .ve-propertiesPanel .data-table-container {
49
- min-height: 250px;
50
- }
51
48
  .ve-propertiesPanel .data-table-footer {
52
49
  margin-top: 5px;
53
50
  margin-bottom: 5px;
@@ -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;