@teselagen/ove 0.3.6 → 0.3.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.umd.js +57 -51
- package/package.json +10 -7
- package/src/ToolBar/ToolbarItem.js +0 -2
- package/src/ToolBar/editTool.js +12 -5
    
        package/index.umd.js
    CHANGED
    
    | @@ -57197,20 +57197,12 @@ | |
| 57197 57197 | 
             
                return toString$4.call(it).slice(8, -1);
         | 
| 57198 57198 | 
             
              };
         | 
| 57199 57199 |  | 
| 57200 | 
            -
               | 
| 57201 | 
            -
              var  | 
| 57202 | 
            -
             | 
| 57203 | 
            -
               | 
| 57204 | 
            -
             | 
| 57205 | 
            -
             | 
| 57206 | 
            -
              	// fallback for non-array-like ES3 and non-enumerable old V8 strings
         | 
| 57207 | 
            -
              	var cof = _cof;
         | 
| 57208 | 
            -
              	// eslint-disable-next-line no-prototype-builtins
         | 
| 57209 | 
            -
              	_iobject = Object('z').propertyIsEnumerable(0) ? Object : function (it) {
         | 
| 57210 | 
            -
              	  return cof(it) == 'String' ? it.split('') : Object(it);
         | 
| 57211 | 
            -
              	};
         | 
| 57212 | 
            -
              	return _iobject;
         | 
| 57213 | 
            -
              }
         | 
| 57200 | 
            +
              // fallback for non-array-like ES3 and non-enumerable old V8 strings
         | 
| 57201 | 
            +
              var cof$2 = _cof;
         | 
| 57202 | 
            +
              // eslint-disable-next-line no-prototype-builtins
         | 
| 57203 | 
            +
              var _iobject = Object('z').propertyIsEnumerable(0) ? Object : function (it) {
         | 
| 57204 | 
            +
                return cof$2(it) == 'String' ? it.split('') : Object(it);
         | 
| 57205 | 
            +
              };
         | 
| 57214 57206 |  | 
| 57215 57207 | 
             
              // 7.2.1 RequireObjectCoercible(argument)
         | 
| 57216 57208 | 
             
              var _defined = function (it) {
         | 
| @@ -57219,7 +57211,7 @@ | |
| 57219 57211 | 
             
              };
         | 
| 57220 57212 |  | 
| 57221 57213 | 
             
              // to indexed object, toObject with fallback for non-array-like ES3 strings
         | 
| 57222 | 
            -
              var IObject =  | 
| 57214 | 
            +
              var IObject = _iobject;
         | 
| 57223 57215 | 
             
              var defined$2 = _defined;
         | 
| 57224 57216 | 
             
              var _toIobject = function (it) {
         | 
| 57225 57217 | 
             
                return IObject(defined$2(it));
         | 
| @@ -57326,11 +57318,11 @@ | |
| 57326 57318 | 
             
              ).split(',');
         | 
| 57327 57319 |  | 
| 57328 57320 | 
             
              // 19.1.2.14 / 15.2.3.14 Object.keys(O)
         | 
| 57329 | 
            -
              var $keys$ | 
| 57321 | 
            +
              var $keys$2 = _objectKeysInternal;
         | 
| 57330 57322 | 
             
              var enumBugKeys$1 = _enumBugKeys;
         | 
| 57331 57323 |  | 
| 57332 57324 | 
             
              var _objectKeys = Object.keys || function keys(O) {
         | 
| 57333 | 
            -
                return $keys$ | 
| 57325 | 
            +
                return $keys$2(O, enumBugKeys$1);
         | 
| 57334 57326 | 
             
              };
         | 
| 57335 57327 |  | 
| 57336 57328 | 
             
              var _objectGops = {};
         | 
| @@ -57366,7 +57358,7 @@ | |
| 57366 57358 | 
             
              	var gOPS = _objectGops;
         | 
| 57367 57359 | 
             
              	var pIE = require_objectPie();
         | 
| 57368 57360 | 
             
              	var toObject = _toObject;
         | 
| 57369 | 
            -
              	var IObject =  | 
| 57361 | 
            +
              	var IObject = _iobject;
         | 
| 57370 57362 | 
             
              	var $assign = Object.assign;
         | 
| 57371 57363 |  | 
| 57372 57364 | 
             
              	// should work with symbols and should have deterministic property order (V8 bug)
         | 
| @@ -58102,17 +58094,24 @@ | |
| 58102 58094 |  | 
| 58103 58095 | 
             
              var _objectGopn = {};
         | 
| 58104 58096 |  | 
| 58105 | 
            -
               | 
| 58106 | 
            -
              var $keys$2 = _objectKeysInternal;
         | 
| 58107 | 
            -
              var hiddenKeys = _enumBugKeys.concat('length', 'prototype');
         | 
| 58097 | 
            +
              var hasRequired_objectGopn;
         | 
| 58108 58098 |  | 
| 58109 | 
            -
               | 
| 58110 | 
            -
             | 
| 58111 | 
            -
             | 
| 58099 | 
            +
              function require_objectGopn () {
         | 
| 58100 | 
            +
              	if (hasRequired_objectGopn) return _objectGopn;
         | 
| 58101 | 
            +
              	hasRequired_objectGopn = 1;
         | 
| 58102 | 
            +
              	// 19.1.2.7 / 15.2.3.4 Object.getOwnPropertyNames(O)
         | 
| 58103 | 
            +
              	var $keys = _objectKeysInternal;
         | 
| 58104 | 
            +
              	var hiddenKeys = _enumBugKeys.concat('length', 'prototype');
         | 
| 58105 | 
            +
             | 
| 58106 | 
            +
              	_objectGopn.f = Object.getOwnPropertyNames || function getOwnPropertyNames(O) {
         | 
| 58107 | 
            +
              	  return $keys(O, hiddenKeys);
         | 
| 58108 | 
            +
              	};
         | 
| 58109 | 
            +
              	return _objectGopn;
         | 
| 58110 | 
            +
              }
         | 
| 58112 58111 |  | 
| 58113 58112 | 
             
              // fallback for IE11 buggy Object.getOwnPropertyNames with iframe and window
         | 
| 58114 58113 | 
             
              var toIObject$2 = _toIobject;
         | 
| 58115 | 
            -
              var gOPN$1 =  | 
| 58114 | 
            +
              var gOPN$1 = require_objectGopn().f;
         | 
| 58116 58115 | 
             
              var toString$3 = {}.toString;
         | 
| 58117 58116 |  | 
| 58118 58117 | 
             
              var windowNames = typeof window == 'object' && window && Object.getOwnPropertyNames
         | 
| @@ -58299,7 +58298,7 @@ | |
| 58299 58298 |  | 
| 58300 58299 | 
             
                $GOPD.f = $getOwnPropertyDescriptor;
         | 
| 58301 58300 | 
             
                $DP.f = $defineProperty;
         | 
| 58302 | 
            -
                 | 
| 58301 | 
            +
                require_objectGopn().f = gOPNExt.f = $getOwnPropertyNames;
         | 
| 58303 58302 | 
             
                require_objectPie().f = $propertyIsEnumerable;
         | 
| 58304 58303 | 
             
                $GOPS.f = $getOwnPropertySymbols;
         | 
| 58305 58304 |  | 
| @@ -114222,6 +114221,8 @@ | |
| 114222 114221 | 
             
                  const selectedTr = table.querySelector(
         | 
| 114223 114222 | 
             
                    `.rt-tr-group.with-row-data[data-test-id="${rowId}"]`
         | 
| 114224 114223 | 
             
                  );
         | 
| 114224 | 
            +
                  if (!selectedTr)
         | 
| 114225 | 
            +
                    return;
         | 
| 114225 114226 | 
             
                  const selectedIndex = selectedTr.dataset.index;
         | 
| 114226 114227 | 
             
                  if (selectedTr && trs.length) {
         | 
| 114227 114228 | 
             
                    let updateScrollIfNecessary = function() {
         | 
| @@ -114690,9 +114691,7 @@ | |
| 114690 114691 | 
             
                      entities,
         | 
| 114691 114692 | 
             
                      reduxFormEntitiesUndoRedoStack[reduxFormEntitiesUndoRedoStack.currentVersion].inversePatches
         | 
| 114692 114693 | 
             
                    );
         | 
| 114693 | 
            -
                    const { newEnts, validationErrors } = this.formatAndValidateEntities(
         | 
| 114694 | 
            -
                      nextState
         | 
| 114695 | 
            -
                    );
         | 
| 114694 | 
            +
                    const { newEnts, validationErrors } = this.formatAndValidateEntities(nextState);
         | 
| 114696 114695 | 
             
                    change("reduxFormEntities", newEnts);
         | 
| 114697 114696 | 
             
                    this.updateValidation(newEnts, validationErrors);
         | 
| 114698 114697 | 
             
                    change("reduxFormEntitiesUndoRedoStack", {
         | 
| @@ -114714,9 +114713,7 @@ | |
| 114714 114713 | 
             
                      entities,
         | 
| 114715 114714 | 
             
                      reduxFormEntitiesUndoRedoStack[nextV].patches
         | 
| 114716 114715 | 
             
                    );
         | 
| 114717 | 
            -
                    const { newEnts, validationErrors } = this.formatAndValidateEntities(
         | 
| 114718 | 
            -
                      nextState
         | 
| 114719 | 
            -
                    );
         | 
| 114716 | 
            +
                    const { newEnts, validationErrors } = this.formatAndValidateEntities(nextState);
         | 
| 114720 114717 | 
             
                    change("reduxFormEntities", newEnts);
         | 
| 114721 114718 | 
             
                    this.updateValidation(newEnts, validationErrors);
         | 
| 114722 114719 | 
             
                    change("reduxFormEntitiesUndoRedoStack", {
         | 
| @@ -115218,10 +115215,7 @@ | |
| 115218 115215 | 
             
                  this.handleCopyHelper(textToCopy, "Column copied");
         | 
| 115219 115216 | 
             
                };
         | 
| 115220 115217 | 
             
                updateEntitiesHelper = (ents, fn) => {
         | 
| 115221 | 
            -
                  const {
         | 
| 115222 | 
            -
                    change,
         | 
| 115223 | 
            -
                    reduxFormEntitiesUndoRedoStack = { currentVersion: 0 }
         | 
| 115224 | 
            -
                  } = this.props;
         | 
| 115218 | 
            +
                  const { change, reduxFormEntitiesUndoRedoStack = { currentVersion: 0 } } = this.props;
         | 
| 115225 115219 | 
             
                  const [nextState, patches, inversePatches] = cn(ents, fn);
         | 
| 115226 115220 | 
             
                  if (!inversePatches.length)
         | 
| 115227 115221 | 
             
                    return;
         | 
| @@ -115283,9 +115277,11 @@ | |
| 115283 115277 | 
             
                  }
         | 
| 115284 115278 | 
             
                };
         | 
| 115285 115279 | 
             
                handleCopySelectedCells = (e) => {
         | 
| 115286 | 
            -
                  const { | 
| 115287 | 
            -
                     | 
| 115288 | 
            -
             | 
| 115280 | 
            +
                  const {
         | 
| 115281 | 
            +
                    entities = [],
         | 
| 115282 | 
            +
                    reduxFormSelectedCells,
         | 
| 115283 | 
            +
                    schema
         | 
| 115284 | 
            +
                  } = computePresets(this.props);
         | 
| 115289 115285 | 
             
                  if (lodashExports.isEmpty(reduxFormSelectedCells))
         | 
| 115290 115286 | 
             
                    return;
         | 
| 115291 115287 | 
             
                  const pathToIndex = getFieldPathToIndex(schema);
         | 
| @@ -115571,7 +115567,9 @@ | |
| 115571 115567 | 
             
                  }
         | 
| 115572 115568 | 
             
                  const numRows = isInfinite ? entities.length : pageSize;
         | 
| 115573 115569 | 
             
                  const idMap = reduxFormSelectedEntityIdMap || {};
         | 
| 115574 | 
            -
                  const selectedRowCount = Object.keys(idMap).filter( | 
| 115570 | 
            +
                  const selectedRowCount = Object.keys(idMap).filter(
         | 
| 115571 | 
            +
                    (key) => idMap[key]
         | 
| 115572 | 
            +
                  ).length;
         | 
| 115575 115573 | 
             
                  let rowsToShow = doNotShowEmptyRows ? Math.min(numRows, entities.length) : numRows;
         | 
| 115576 115574 | 
             
                  if (entities.length === 0 && rowsToShow < 3)
         | 
| 115577 115575 | 
             
                    rowsToShow = 3;
         | 
| @@ -117067,9 +117065,7 @@ | |
| 117067 117065 | 
             
                      return getIdOrCodeOrIndex(e, i) === rowId;
         | 
| 117068 117066 | 
             
                    });
         | 
| 117069 117067 | 
             
                    const insertIndex = above ? indexToInsert : indexToInsert + 1;
         | 
| 117070 | 
            -
                    let { newEnts, validationErrors } = this.formatAndValidateEntities(
         | 
| 117071 | 
            -
                      newEntities
         | 
| 117072 | 
            -
                    );
         | 
| 117068 | 
            +
                    let { newEnts, validationErrors } = this.formatAndValidateEntities(newEntities);
         | 
| 117073 117069 | 
             
                    newEnts = newEnts.map((e) => ({
         | 
| 117074 117070 | 
             
                      ...e,
         | 
| 117075 117071 | 
             
                      _isClean: true
         | 
| @@ -151755,7 +151751,7 @@ | |
| 151755 151751 | 
             
                      (u) => u === "U" ? "T" : "t"
         | 
| 151756 151752 | 
             
                    );
         | 
| 151757 151753 | 
             
                  }
         | 
| 151758 | 
            -
                  if (temp !== sequence.sequence && !sequence.isDNA && !sequence.isProtein) {
         | 
| 151754 | 
            +
                  if (temp !== sequence.sequence && !sequence.isDNA && !sequence.isProtein && sequence.isRNA !== false) {
         | 
| 151759 151755 | 
             
                    sequence.type = "RNA";
         | 
| 151760 151756 | 
             
                    sequence.sequence = temp;
         | 
| 151761 151757 | 
             
                  } else {
         | 
| @@ -188653,12 +188649,16 @@ double click --> edit`}`; | |
| 188653 188649 | 
             
              }
         | 
| 188654 188650 |  | 
| 188655 188651 | 
             
              const name = "@teselagen/ove";
         | 
| 188656 | 
            -
              const version = "0.3. | 
| 188652 | 
            +
              const version = "0.3.7";
         | 
| 188657 188653 | 
             
              const main = "./src/index.js";
         | 
| 188654 | 
            +
              const volta = {
         | 
| 188655 | 
            +
              	node: "16.20.2"
         | 
| 188656 | 
            +
              };
         | 
| 188658 188657 | 
             
              const packageJson = {
         | 
| 188659 188658 | 
             
              	name: name,
         | 
| 188660 188659 | 
             
              	version: version,
         | 
| 188661 | 
            -
              	main: main
         | 
| 188660 | 
            +
              	main: main,
         | 
| 188661 | 
            +
              	volta: volta
         | 
| 188662 188662 | 
             
              };
         | 
| 188663 188663 |  | 
| 188664 188664 | 
             
              const PartTagSearch = withEditorProps(PartToolDropdown);
         | 
| @@ -207287,8 +207287,11 @@ ${seqDataToCopy}\r | |
| 207287 207287 | 
             
                  disableSetReadOnly,
         | 
| 207288 207288 | 
             
                  onChangeEditLock
         | 
| 207289 207289 | 
             
                }) => {
         | 
| 207290 | 
            +
                  const [isLoading, setIsLoading] = reactExports.useState(false);
         | 
| 207290 207291 | 
             
                  const readOnlyTooltip = ({ readOnly: readOnly2, disableSetReadOnly: disableSetReadOnly2 }) => {
         | 
| 207291 | 
            -
                    if ( | 
| 207292 | 
            +
                    if (isLoading) {
         | 
| 207293 | 
            +
                      return "Loading...";
         | 
| 207294 | 
            +
                    } else if (disableSetReadOnly2) {
         | 
| 207292 207295 | 
             
                      return "You do not have permission to edit locks on this sequence";
         | 
| 207293 207296 | 
             
                    }
         | 
| 207294 207297 | 
             
                    return readOnly2 ? "Click to enable editing" : "Click to disable editing";
         | 
| @@ -207297,11 +207300,14 @@ ${seqDataToCopy}\r | |
| 207297 207300 | 
             
                    ToolbarItem$1,
         | 
| 207298 207301 | 
             
                    {
         | 
| 207299 207302 | 
             
                      ...{
         | 
| 207300 | 
            -
                        disabled: disableSetReadOnly,
         | 
| 207303 | 
            +
                        disabled: isLoading || disableSetReadOnly,
         | 
| 207301 207304 | 
             
                        Icon: /* @__PURE__ */ React$3.createElement(Icon, { icon: readOnly ? "lock" : "unlock" }),
         | 
| 207302 | 
            -
                        onIconClick: () => {
         | 
| 207303 | 
            -
                          if (onChangeEditLock)
         | 
| 207304 | 
            -
                             | 
| 207305 | 
            +
                        onIconClick: async () => {
         | 
| 207306 | 
            +
                          if (onChangeEditLock) {
         | 
| 207307 | 
            +
                            setIsLoading(true);
         | 
| 207308 | 
            +
                            await onChangeEditLock(!readOnly);
         | 
| 207309 | 
            +
                            setIsLoading(false);
         | 
| 207310 | 
            +
                          }
         | 
| 207305 207311 | 
             
                          toggleReadOnlyMode();
         | 
| 207306 207312 | 
             
                        },
         | 
| 207307 207313 | 
             
                        tooltip: readOnlyTooltip({ readOnly, disableSetReadOnly }),
         | 
    
        package/package.json
    CHANGED
    
    | @@ -1,14 +1,17 @@ | |
| 1 1 | 
             
            {
         | 
| 2 2 | 
             
              "name": "@teselagen/ove",
         | 
| 3 | 
            -
              "version": "0.3. | 
| 3 | 
            +
              "version": "0.3.8",
         | 
| 4 4 | 
             
              "main": "./src/index.js",
         | 
| 5 | 
            +
              "volta": {
         | 
| 6 | 
            +
                "node": "16.20.2"
         | 
| 7 | 
            +
              },
         | 
| 5 8 | 
             
              "dependencies": {
         | 
| 6 | 
            -
                "@teselagen/sequence-utils": "0.3. | 
| 7 | 
            -
                "@teselagen/range-utils": "0.3. | 
| 8 | 
            -
                "@teselagen/ui": "0.3. | 
| 9 | 
            -
                "@teselagen/file-utils": "0.3. | 
| 10 | 
            -
                "@teselagen/bounce-loader": "0.3. | 
| 11 | 
            -
                "@teselagen/bio-parsers": "0.3. | 
| 9 | 
            +
                "@teselagen/sequence-utils": "0.3.7",
         | 
| 10 | 
            +
                "@teselagen/range-utils": "0.3.7",
         | 
| 11 | 
            +
                "@teselagen/ui": "0.3.7",
         | 
| 12 | 
            +
                "@teselagen/file-utils": "0.3.7",
         | 
| 13 | 
            +
                "@teselagen/bounce-loader": "0.3.7",
         | 
| 14 | 
            +
                "@teselagen/bio-parsers": "0.3.7",
         | 
| 12 15 | 
             
                "@blueprintjs/core": "3.52.0",
         | 
| 13 16 | 
             
                "@blueprintjs/datetime": "3.23.19",
         | 
| 14 17 | 
             
                "@blueprintjs/icons": "3.33.0",
         | 
    
        package/src/ToolBar/editTool.js
    CHANGED
    
    | @@ -1,4 +1,4 @@ | |
| 1 | 
            -
            import React from "react";
         | 
| 1 | 
            +
            import React, { useState } from "react";
         | 
| 2 2 | 
             
            import { Icon } from "@blueprintjs/core";
         | 
| 3 3 | 
             
            import ToolbarItem from "./ToolbarItem";
         | 
| 4 4 | 
             
            import { connectToEditor } from "../withEditorProps";
         | 
| @@ -15,8 +15,11 @@ export default connectToEditor((editorState) => { | |
| 15 15 | 
             
                disableSetReadOnly,
         | 
| 16 16 | 
             
                onChangeEditLock
         | 
| 17 17 | 
             
              }) => {
         | 
| 18 | 
            +
                const [isLoading, setIsLoading] = useState(false);
         | 
| 18 19 | 
             
                const readOnlyTooltip = ({ readOnly, disableSetReadOnly }) => {
         | 
| 19 | 
            -
                  if ( | 
| 20 | 
            +
                  if (isLoading) {
         | 
| 21 | 
            +
                    return "Loading...";
         | 
| 22 | 
            +
                  } else if (disableSetReadOnly) {
         | 
| 20 23 | 
             
                    return "You do not have permission to edit locks on this sequence";
         | 
| 21 24 | 
             
                  }
         | 
| 22 25 | 
             
                  return readOnly ? "Click to enable editing" : "Click to disable editing";
         | 
| @@ -24,10 +27,14 @@ export default connectToEditor((editorState) => { | |
| 24 27 | 
             
                return (
         | 
| 25 28 | 
             
                  <ToolbarItem
         | 
| 26 29 | 
             
                    {...{
         | 
| 27 | 
            -
                      disabled: disableSetReadOnly,
         | 
| 30 | 
            +
                      disabled: isLoading || disableSetReadOnly,
         | 
| 28 31 | 
             
                      Icon: <Icon icon={readOnly ? "lock" : "unlock"} />,
         | 
| 29 | 
            -
                      onIconClick: () => {
         | 
| 30 | 
            -
                        if (onChangeEditLock)  | 
| 32 | 
            +
                      onIconClick: async () => {
         | 
| 33 | 
            +
                        if (onChangeEditLock) {
         | 
| 34 | 
            +
                          setIsLoading(true);
         | 
| 35 | 
            +
                          await onChangeEditLock(!readOnly);
         | 
| 36 | 
            +
                          setIsLoading(false);
         | 
| 37 | 
            +
                        }
         | 
| 31 38 | 
             
                        toggleReadOnlyMode();
         | 
| 32 39 | 
             
                      },
         | 
| 33 40 | 
             
                      tooltip: readOnlyTooltip({ readOnly, disableSetReadOnly }),
         |