@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/index.es.js CHANGED
@@ -55,7 +55,7 @@ var __async = (__this, __arguments, generator) => {
55
55
  };
56
56
  var _C, _D, _G, _J, _K, _R;
57
57
  import { Icon, Classes, Button, Intent, MenuItem, Keys, Tag, Popover, Tooltip, Spinner, Checkbox, Switch, Position, FormGroup, InputGroup, TextArea, EditableText, NumericInput, RadioGroup, Menu, Toaster, MenuDivider, KeyCombo, ContextMenu, useHotkeys, Callout, Dialog, Card, Tabs, Tab, Colors, HTMLSelect, AnchorButton, Slider as Slider$1, ButtonGroup, Label, ResizeSensor, FocusStyleManager } from "@blueprintjs/core";
58
- import * as React$1 from "react";
58
+ import * as React from "react";
59
59
  import React__default, { useState, useEffect, forwardRef as forwardRef$2, useImperativeHandle, Fragment, useMemo as useMemo$1, useRef, useReducer, useCallback as useCallback$1, createElement, Component, useLayoutEffect as useLayoutEffect$1, createContext as createContext$1, memo, useContext, isValidElement, PureComponent } from "react";
60
60
  import { formValueSelector, initialize, change, Field, reduxForm, SubmissionError, destroy as destroy$1, touch, FormName, reducer as reducer$4, getFormValues, FieldArray } from "redux-form";
61
61
  import ReactDOM, { unstable_batchedUpdates, createPortal, flushSync, render as render$2, findDOMNode, unmountComponentAtNode } from "react-dom";
@@ -30424,19 +30424,19 @@ function dequal(foo, bar) {
30424
30424
  }
30425
30425
  __name(dequal, "dequal");
30426
30426
  function useDeepCompareMemoize(value) {
30427
- var ref2 = React$1.useRef(value);
30428
- var signalRef = React$1.useRef(0);
30427
+ var ref2 = React.useRef(value);
30428
+ var signalRef = React.useRef(0);
30429
30429
  if (!dequal(value, ref2.current)) {
30430
30430
  ref2.current = value;
30431
30431
  signalRef.current += 1;
30432
30432
  }
30433
- return React$1.useMemo(function() {
30433
+ return React.useMemo(function() {
30434
30434
  return ref2.current;
30435
30435
  }, [signalRef.current]);
30436
30436
  }
30437
30437
  __name(useDeepCompareMemoize, "useDeepCompareMemoize");
30438
30438
  function useDeepCompareEffect(callback2, dependencies) {
30439
- return React$1.useEffect(callback2, useDeepCompareMemoize(dependencies));
30439
+ return React.useEffect(callback2, useDeepCompareMemoize(dependencies));
30440
30440
  }
30441
30441
  __name(useDeepCompareEffect, "useDeepCompareEffect");
30442
30442
  var fuzzysearch_1;
@@ -34460,7 +34460,7 @@ const DraggableColumnOptions = /* @__PURE__ */ __name(({
34460
34460
  )
34461
34461
  );
34462
34462
  }, "DraggableColumnOptions");
34463
- const dragNoticeEl = /* @__PURE__ */ React.createElement(
34463
+ const dragNoticeEl = /* @__PURE__ */ React__default.createElement(
34464
34464
  "div",
34465
34465
  {
34466
34466
  className: Classes.TEXT_MUTED,
@@ -34469,7 +34469,7 @@ const dragNoticeEl = /* @__PURE__ */ React.createElement(
34469
34469
  fontSize: "12px"
34470
34470
  }
34471
34471
  },
34472
- /* @__PURE__ */ React.createElement(Icon, { icon: "info-sign", size: 12 }),
34472
+ /* @__PURE__ */ React__default.createElement(Icon, { icon: "info-sign", size: 12 }),
34473
34473
  " Drag columns to reorder them"
34474
34474
  );
34475
34475
  const DisplayOptions = /* @__PURE__ */ __name(({
@@ -68857,10 +68857,10 @@ var Resizer = (
68857
68857
  }
68858
68858
  __name(Resizer2, "Resizer");
68859
68859
  Resizer2.prototype.render = function() {
68860
- return React$1.createElement("div", { className: this.props.className || "", style: __assign$2(__assign$2({ position: "absolute", userSelect: "none" }, styles[this.props.direction]), this.props.replaceStyles || {}), onMouseDown: this.onMouseDown, onTouchStart: this.onTouchStart }, this.props.children);
68860
+ return React.createElement("div", { className: this.props.className || "", style: __assign$2(__assign$2({ position: "absolute", userSelect: "none" }, styles[this.props.direction]), this.props.replaceStyles || {}), onMouseDown: this.onMouseDown, onTouchStart: this.onTouchStart }, this.props.children);
68861
68861
  };
68862
68862
  return Resizer2;
68863
- }(React$1.PureComponent)
68863
+ }(React.PureComponent)
68864
68864
  );
68865
68865
  var src = { exports: {} };
68866
68866
  var hasRequiredSrc;
@@ -69637,11 +69637,11 @@ var Resizable = (
69637
69637
  }
69638
69638
  var resizers = Object.keys(enable).map(function(dir) {
69639
69639
  if (enable[dir] !== false) {
69640
- return React$1.createElement(Resizer, { key: dir, direction: dir, onResizeStart: _this.onResizeStart, replaceStyles: handleStyles && handleStyles[dir], className: handleClasses && handleClasses[dir] }, handleComponent && handleComponent[dir] ? handleComponent[dir] : null);
69640
+ return React.createElement(Resizer, { key: dir, direction: dir, onResizeStart: _this.onResizeStart, replaceStyles: handleStyles && handleStyles[dir], className: handleClasses && handleClasses[dir] }, handleComponent && handleComponent[dir] ? handleComponent[dir] : null);
69641
69641
  }
69642
69642
  return null;
69643
69643
  });
69644
- return React$1.createElement("div", { className: handleWrapperClass, style: handleWrapperStyle }, resizers);
69644
+ return React.createElement("div", { className: handleWrapperClass, style: handleWrapperStyle }, resizers);
69645
69645
  };
69646
69646
  Resizable2.prototype.render = function() {
69647
69647
  var _this = this;
@@ -69657,10 +69657,10 @@ var Resizable = (
69657
69657
  style2.flexBasis = this.state.flexBasis;
69658
69658
  }
69659
69659
  var Wrapper = this.props.as || "div";
69660
- return React$1.createElement(
69660
+ return React.createElement(
69661
69661
  Wrapper,
69662
69662
  __assign$1({ ref: this.ref, style: style2, className: this.props.className }, extendsProps),
69663
- this.state.isResizing && React$1.createElement("div", { style: this.state.backgroundStyle }),
69663
+ this.state.isResizing && React.createElement("div", { style: this.state.backgroundStyle }),
69664
69664
  this.props.children,
69665
69665
  this.renderResizer()
69666
69666
  );
@@ -69693,7 +69693,7 @@ var Resizable = (
69693
69693
  snapGap: 0
69694
69694
  };
69695
69695
  return Resizable2;
69696
- }(React$1.PureComponent)
69696
+ }(React.PureComponent)
69697
69697
  );
69698
69698
  /*! *****************************************************************************
69699
69699
  Copyright (c) Microsoft Corporation. All rights reserved.
@@ -95192,7 +95192,7 @@ const togglePanelFullScreen = createMetaAction("togglePanelFullScreen");
95192
95192
  const collapsePanel = createMetaAction("collapsePanel");
95193
95193
  const closePanel = createMetaAction("closePanel");
95194
95194
  const _collapseSplitScreen = createMetaAction("_collapseSplitScreen");
95195
- const setPanelAsActive = createMetaAction("setPanelAsActive");
95195
+ const setPanelAsActive = createMetaAction("SET_PANEL_AS_ACTIVE");
95196
95196
  const flipActiveTabFromLinearOrCircularIfNecessary = createMetaAction(
95197
95197
  "flipActiveTabFromLinearOrCircularIfNecessary"
95198
95198
  );
@@ -99706,7 +99706,8 @@ function mapDispatchToActions(dispatch, ownProps) {
99706
99706
  editorName,
99707
99707
  actions,
99708
99708
  actionOverrides,
99709
- dispatch
99709
+ dispatch,
99710
+ ownProps
99710
99711
  );
99711
99712
  const updateSel = ownProps.selectionLayerUpdate || actionsToPass.selectionLayerUpdate;
99712
99713
  const updateCar = ownProps.caretPositionUpdate || actionsToPass.caretPositionUpdate;
@@ -99734,7 +99735,7 @@ function fakeActionOverrides() {
99734
99735
  return defaultOverrides;
99735
99736
  }
99736
99737
  __name(fakeActionOverrides, "fakeActionOverrides");
99737
- function getCombinedActions(editorName, actions2, actionOverrides, dispatch) {
99738
+ function getCombinedActions(editorName, actions2, actionOverrides, dispatch, ownProps) {
99738
99739
  const meta = { editorName };
99739
99740
  let metaActions = addMetaToActionCreators(actions2, meta);
99740
99741
  const overrides = {};
@@ -99759,6 +99760,21 @@ function getCombinedActions(editorName, actions2, actionOverrides, dispatch) {
99759
99760
  }, "redo")
99760
99761
  }, metaActions), overrides);
99761
99762
  const actionsToPass = __spreadValues({}, metaActions);
99763
+ function addGenericHook(hookName) {
99764
+ const oldHook = actionsToPass[hookName];
99765
+ actionsToPass[hookName] = (...args) => {
99766
+ const toRet = oldHook(...args);
99767
+ const newHookName = `on_${hookName}`;
99768
+ if (ownProps[newHookName]) {
99769
+ setTimeout(() => {
99770
+ ownProps[newHookName](...args);
99771
+ }, 0);
99772
+ }
99773
+ return toRet;
99774
+ };
99775
+ }
99776
+ __name(addGenericHook, "addGenericHook");
99777
+ ["setPanelAsActive", "propertiesViewTabUpdate"].forEach(addGenericHook);
99762
99778
  return bindActionCreators(actionsToPass, dispatch);
99763
99779
  }
99764
99780
  __name(getCombinedActions, "getCombinedActions");
@@ -116593,7 +116609,7 @@ function showFileDialog({ multiple = false, onSelect }) {
116593
116609
  input.click();
116594
116610
  }
116595
116611
  __name(showFileDialog, "showFileDialog");
116596
- const version = "0.8.5";
116612
+ const version = "0.8.7";
116597
116613
  const packageJson = {
116598
116614
  version
116599
116615
  };
@@ -123895,9 +123911,9 @@ function BarPlot({
123895
123911
  if (!data || data.length === 0) return null;
123896
123912
  const maxVal = Math.max(...data);
123897
123913
  const barWidth = width / data.length;
123898
- return /* @__PURE__ */ React.createElement("svg", { width, height, className }, data.map((val2, i) => {
123914
+ return /* @__PURE__ */ React__default.createElement("svg", { width, height, className }, data.map((val2, i) => {
123899
123915
  const barHeight = val2 / maxVal * (height - 2);
123900
- return /* @__PURE__ */ React.createElement(
123916
+ return /* @__PURE__ */ React__default.createElement(
123901
123917
  "rect",
123902
123918
  {
123903
123919
  "data-tip": `${val2 == null ? void 0 : val2.toFixed(1)}%`,
@@ -123910,7 +123926,7 @@ function BarPlot({
123910
123926
  rx: 2
123911
123927
  }
123912
123928
  );
123913
- }), /* @__PURE__ */ React.createElement(
123929
+ }), /* @__PURE__ */ React__default.createElement(
123914
123930
  "line",
123915
123931
  {
123916
123932
  x1: 1,
@@ -123921,7 +123937,7 @@ function BarPlot({
123921
123937
  strokeDasharray: "4,2",
123922
123938
  strokeWidth: 1
123923
123939
  }
123924
- ), /* @__PURE__ */ React.createElement(
123940
+ ), /* @__PURE__ */ React__default.createElement(
123925
123941
  "line",
123926
123942
  {
123927
123943
  x1: 0,
@@ -123943,7 +123959,7 @@ function AminoAcidCirclePlot({ data, width, className }) {
123943
123959
  const maxRadius = spacing / 2 - 2 > 0 ? spacing / 2 - 2 : 8;
123944
123960
  const radius = Math.max(8, Math.min(maxRadius, 20));
123945
123961
  const svgHeight = radius * 2 + 10;
123946
- return /* @__PURE__ */ React.createElement("svg", { width, height: svgHeight, className }, data.map((d2, idx) => /* @__PURE__ */ React.createElement("g", { key: idx }, /* @__PURE__ */ React.createElement(
123962
+ return /* @__PURE__ */ React__default.createElement("svg", { width, height: svgHeight, className }, data.map((d2, idx) => /* @__PURE__ */ React__default.createElement("g", { key: idx }, /* @__PURE__ */ React__default.createElement(
123947
123963
  "circle",
123948
123964
  {
123949
123965
  "data-tip": d2.group,
@@ -142356,6 +142372,8 @@ const userDefinedHandlersAndOpts = [
142356
142372
  "allowPrimerBasesToBeEdited",
142357
142373
  "truncateLabelsThatDoNotFit",
142358
142374
  "smartCircViewLabelRender",
142375
+ "on_setPanelAsActive",
142376
+ "on_propertiesViewTabUpdate",
142359
142377
  "onConfigureFeatureTypesClick",
142360
142378
  "allPartTags",
142361
142379
  "bpLimit",
@@ -144409,6 +144427,19 @@ const PropertiesDialog = /* @__PURE__ */ __name((props) => {
144409
144427
  if (propertiesList.map((nameOrOverride) => nameOrOverride.name || nameOrOverride).indexOf(tabId) === -1) {
144410
144428
  tabId = propertiesList[0].name || propertiesList[0];
144411
144429
  }
144430
+ const getAnnotationCount = /* @__PURE__ */ __name((name2) => {
144431
+ const annotations = props[name2] || props.sequenceData[name2];
144432
+ let count2;
144433
+ if (Array.isArray(annotations)) {
144434
+ count2 = annotations.length;
144435
+ } else if (annotations && typeof annotations === "object") {
144436
+ count2 = Object.keys(annotations).length;
144437
+ }
144438
+ if (isNumber$2(count2)) {
144439
+ return /* @__PURE__ */ React__default.createElement(Tag, { className: "tg-smallTag", round: true, style: { marginLeft: 1 } }, count2);
144440
+ }
144441
+ return null;
144442
+ }, "getAnnotationCount");
144412
144443
  const propertiesTabs = flatMap(propertiesList, (nameOrOverride) => {
144413
144444
  if (annotationsToSupport2[nameOrOverride] === false) {
144414
144445
  return [];
@@ -144420,12 +144451,16 @@ const PropertiesDialog = /* @__PURE__ */ __name((props) => {
144420
144451
  return null;
144421
144452
  }
144422
144453
  }
144423
- const title = (() => {
144454
+ const count2 = getAnnotationCount(name2);
144455
+ let title = (() => {
144424
144456
  if (nameOrOverride.Comp) return name2;
144425
144457
  if (name2 === "orfs") return "ORFs";
144426
144458
  if (name2 === "cutsites") return "Cut Sites";
144427
144459
  return startCase(name2);
144428
144460
  })();
144461
+ if (count2) {
144462
+ title = /* @__PURE__ */ React__default.createElement("div", { style: { display: "flex", alignItems: "center" } }, title, count2);
144463
+ }
144429
144464
  return /* @__PURE__ */ React__default.createElement(
144430
144465
  Tab,
144431
144466
  {
@@ -144485,11 +144520,7 @@ const PropertiesDialog = /* @__PURE__ */ __name((props) => {
144485
144520
  )
144486
144521
  );
144487
144522
  }, "PropertiesDialog");
144488
- const Properties = compose$1(
144489
- connectToEditor(({ propertiesTool: propertiesTool2, annotationsToSupport: annotationsToSupport2 }) => {
144490
- return { propertiesTool: propertiesTool2, annotationsToSupport: annotationsToSupport2 };
144491
- })
144492
- )(PropertiesDialog);
144523
+ const PropertiesDialog$1 = withEditorProps(PropertiesDialog);
144493
144524
  const useLadders = /* @__PURE__ */ __name(() => {
144494
144525
  return useLocalStorageState("tg-additional-ladder", { defaultValue: [] });
144495
144526
  }, "useLadders");
@@ -145391,7 +145422,7 @@ const _panelMap = {
145391
145422
  digestTool: DigestTool$1,
145392
145423
  pcrTool: PCRTool$1,
145393
145424
  properties: {
145394
- comp: Properties,
145425
+ comp: PropertiesDialog$1,
145395
145426
  panelSpecificProps: ["PropertiesProps"]
145396
145427
  },
145397
145428
  mismatches: Mismatches$1