@weng-lab/genomebrowser-ui 0.1.3 → 0.1.5

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,7 +1,7 @@
1
1
  {
2
2
  "name": "@weng-lab/genomebrowser-ui",
3
3
  "private": false,
4
- "version": "0.1.3",
4
+ "version": "0.1.5",
5
5
  "license": "MIT",
6
6
  "type": "module",
7
7
  "publishConfig": {
@@ -282,9 +282,9 @@ const TreeItemLabelText = styled(Typography)({
282
282
  fontFamily: "inherit",
283
283
  });
284
284
 
285
- function CustomLabel({ icon: Icon, children, ...other }: CustomLabelProps) {
286
- const variant = other.isAssayItem ? "subtitle2" : "body2";
287
- const fontWeight = other.isAssayItem ? "bold" : 500;
285
+ function CustomLabel({ icon: Icon, children, isAssayItem, ...other }: CustomLabelProps) {
286
+ const variant = isAssayItem ? "subtitle2" : "body2";
287
+ const fontWeight = isAssayItem ? "bold" : 500;
288
288
  return (
289
289
  <TreeItemLabel
290
290
  {...other}
@@ -306,7 +306,7 @@ function CustomLabel({ icon: Icon, children, ...other }: CustomLabelProps) {
306
306
  />
307
307
  )}
308
308
  <Stack direction="row" spacing={2} alignItems="center">
309
- { other.isAssayItem && AssayIcon(other.id) }
309
+ { isAssayItem && AssayIcon(other.id) }
310
310
  <TreeItemLabelText fontWeight={fontWeight} variant={variant}>{children}</TreeItemLabelText>
311
311
  </Stack>
312
312
  </TreeItemLabel>
@@ -5,10 +5,10 @@ export type SelectionStoreInstance = UseBoundStore<
5
5
  StoreApi<SelectionState & SelectionAction>
6
6
  >;
7
7
 
8
- export function createSelectionStore() {
8
+ export function createSelectionStore(initialTracks?: Map<string, RowInfo>) {
9
9
  return create<SelectionState & SelectionAction>((set, get) => ({
10
10
  maxTracks: 30,
11
- selectedTracks: new Map<string, RowInfo>(),
11
+ selectedTracks: initialTracks ? new Map(initialTracks) : new Map<string, RowInfo>(),
12
12
  selectedIds: () => new Set(get().selectedTracks.keys()),
13
13
  setSelected: (tracks: Map<string, RowInfo>) =>
14
14
  set(() => ({