From c6a93f036d82d7558b9e87ff9ca7b616e00cc72c Mon Sep 17 00:00:00 2001 From: Thomas Rich Date: Fri, 17 Dec 2021 12:08:49 -0800 Subject: [PATCH 1/6] improving demo link clicking to close sidebar --- demo/src/index.js | 558 +++++++++++++++++++++++----------------------- 1 file changed, 273 insertions(+), 285 deletions(-) diff --git a/demo/src/index.js b/demo/src/index.js index 4b9c38ed3..b9fcf5cbb 100644 --- a/demo/src/index.js +++ b/demo/src/index.js @@ -1,4 +1,4 @@ -import React from "react"; +import React, { useMemo, useState } from "react"; import { Provider } from "react-redux"; import { HashRouter as Router, Route, Link, Redirect } from "react-router-dom"; import { Button, Drawer, Tooltip } from "@blueprintjs/core"; @@ -23,313 +23,301 @@ import AlignmentDemo from "./AlignmentDemo"; import VersionHistoryView from "../../src/VersionHistoryView"; import pjson from "../../package.json"; import EditorDemo from "./EditorDemo"; - -// import GenbankView from "../../src/helperComponents/PropertiesDialog/GenbankView"; - -// import _CutsiteProperties from "../../src/helperComponents/PropertiesDialog/CutsiteProperties"; -// import withEditorProps from "../../src/withEditorProps"; -// import _OrfProperties from "../../src/helperComponents/PropertiesDialog/OrfProperties"; import "./style.css"; -const links = [ - { name: "Editor", url: "Editor" }, - { name: "Standalone", url: "Standalone" }, - { name: "VersionHistoryView", url: "VersionHistoryView" }, - { name: "StandaloneAlignment", url: "StandaloneAlignment" }, - { name: "Alignment", url: "Alignment" }, - { name: "SimpleCircularOrLinearView", url: "SimpleCircularOrLinearView" }, - { name: "DigestTool", url: "DigestTool" }, - { name: "EnzymeViewer", url: "EnzymeViewer" }, - { name: "CircularView", url: "CircularView" }, - { name: "RowView", url: "RowView" }, - { name: "LinearView", url: "LinearView" }, - { name: "ToolBar", url: "ToolBar" } -].map(({ url, name }) => { - return ( -
- {name} -
+const Demo = () => { + const [isDarkMode, setDarkMode] = useState( + document.body.className.includes("bp3-dark") ); -}); -links.push( - - UMD demo - -); + const [isSidebarOpen, setSidebarOpen] = useState(); -class Demo extends React.Component { - constructor(props) { - super(props); - - this.state = { - darkMode: document.body.className.includes("bp3-dark") - }; - } - - changeDarkMode = () => { - this.setState({ - darkMode: !this.state.darkMode - }); + const changeDarkMode = () => { + setDarkMode(!isDarkMode); document.body.classList.toggle("bp3-dark"); }; - render() { - const { darkMode } = this.state; - return ( - - -
{ + const links = [ + { name: "Editor", url: "Editor" }, + { name: "Standalone", url: "Standalone" }, + { name: "VersionHistoryView", url: "VersionHistoryView" }, + { name: "StandaloneAlignment", url: "StandaloneAlignment" }, + { name: "Alignment", url: "Alignment" }, + { name: "SimpleCircularOrLinearView", url: "SimpleCircularOrLinearView" }, + { name: "DigestTool", url: "DigestTool" }, + { name: "EnzymeViewer", url: "EnzymeViewer" }, + { name: "CircularView", url: "CircularView" }, + { name: "RowView", url: "RowView" }, + { name: "LinearView", url: "LinearView" }, + { name: "ToolBar", url: "ToolBar" } + ].map(({ url, name }) => { + return ( +
+ {name} +
+ ); + }); + links.push( + + UMD demo + + ); + return links.map((l, i) => ( + setSidebarOpen(false)} key={i}> + {l} + + )); + }, []); + + return ( + + +
+ { + setSidebarOpen(false); }} + position="left" > - { - this.setState({ sidebarOpen: false }); - }} - position="left" - > -
- -
- {links} -
- - Version: {pjson.version} - {" "} - - This is a developer demo. Get the App? - {" "} - -
- } /> - { - return ; - }} - path="/Editor" - /> - { - return ( -
- { - window.alert("onSave triggered!"); - // console.info("onSave triggered:", args); - }} - exitVersionHistoryView={() => { - window.alert("exit requested!"); - }} - getSequenceAtVersion={(versionId) => { - // in a real version we'd go to server and get a real sequence based on the version id - // const seq = await api.getSeqAtVersion() - // return seq - if (versionId === 2) { - return { - sequence: "thomaswashere" - }; - } else if ((versionId = 3)) { - return { - features: [{ start: 4, end: 6 }], - sequence: - "GGGAAAagagagtgagagagtagagagagaccacaccccccGGGAAAagagagtgagagagtagagagagaccacaccccccGGGAAAagagagtgagagagtagagagagaccacaccccccGGGAAAagagagtgagagagtagagagagaccacacccccc" - }; - } else { - console.error("we shouldn't be here..."); - return { - sequence: "taa" - }; - } - }} - getVersionList={() => { - //fake talking to some api - return new Promise((resolve) => { - setTimeout(() => { - resolve([ - { - dateChanged: "12/30/2211", - editedBy: "Nara", - // revisionType: "Sequence Deletion", - versionId: 2 - }, - { - dateChanged: "8/30/2211", - editedBy: "Ralph", - // revisionType: "Feature Edit", - versionId: 3 - } - ]); - }, 100); - }); - }} - /> -
- ); - }} - path="/VersionHistoryView" - /> - { - return ; - }} - path="/Standalone" - /> - { - return ; - }} - path="/StandaloneAlignment" - /> - { - return ; - }} - path="/Alignment" - /> - { - return ( - - - - ); - }} - path="/CircularView" - /> - ( - - )} - path="/SimpleCircularOrLinearView" - /> - { - return ( - - - - ); - }} - path="/DigestTool" - /> - { - const enzyme = { - name: "BsaI", - site: "ggtctc", - forwardRegex: "g{2}tctc", - reverseRegex: "gagac{2}", - topSnipOffset: 7, - bottomSnipOffset: 11 - }; - return ( - - - - ); - }} - path="/EnzymeViewer" - /> - { - return ( - - - - ); - }} - path="/RowView" - /> - { - return ( - - - - ); - }} - path="/LinearView" - /> + {links} +
+
+ + + Version: {pjson.version} + {" "} + + This is a developer demo. Get the App? + {" "} + +
- - - ); - } -} + } /> + { + return ; + }} + path="/Editor" + /> + { + return ( +
+ { + window.alert("onSave triggered!"); + // console.info("onSave triggered:", args); + }} + exitVersionHistoryView={() => { + window.alert("exit requested!"); + }} + getSequenceAtVersion={(versionId) => { + // in a real version we'd go to server and get a real sequence based on the version id + // const seq = await api.getSeqAtVersion() + // return seq + if (versionId === 2) { + return { + sequence: "thomaswashere" + }; + } else if ((versionId = 3)) { + return { + features: [{ start: 4, end: 6 }], + sequence: + "GGGAAAagagagtgagagagtagagagagaccacaccccccGGGAAAagagagtgagagagtagagagagaccacaccccccGGGAAAagagagtgagagagtagagagagaccacaccccccGGGAAAagagagtgagagagtagagagagaccacacccccc" + }; + } else { + console.error("we shouldn't be here..."); + return { + sequence: "taa" + }; + } + }} + getVersionList={() => { + //fake talking to some api + return new Promise((resolve) => { + setTimeout(() => { + resolve([ + { + dateChanged: "12/30/2211", + editedBy: "Nara", + // revisionType: "Sequence Deletion", + versionId: 2 + }, + { + dateChanged: "8/30/2211", + editedBy: "Ralph", + // revisionType: "Feature Edit", + versionId: 3 + } + ]); + }, 100); + }); + }} + /> +
+ ); + }} + path="/VersionHistoryView" + /> + { + return ; + }} + path="/Standalone" + /> + { + return ; + }} + path="/StandaloneAlignment" + /> + { + return ; + }} + path="/Alignment" + /> + { + return ( + + + + ); + }} + path="/CircularView" + /> + ( + + )} + path="/SimpleCircularOrLinearView" + /> + { + return ( + + + + ); + }} + path="/DigestTool" + /> + { + const enzyme = { + name: "BsaI", + site: "ggtctc", + forwardRegex: "g{2}tctc", + reverseRegex: "gagac{2}", + topSnipOffset: 7, + bottomSnipOffset: 11 + }; + return ( + + + + ); + }} + path="/EnzymeViewer" + /> + { + return ( + + + + ); + }} + path="/RowView" + /> + { + return ( + + + + ); + }} + path="/LinearView" + /> +
+
+
+ ); +}; -class WrapSimpleDemo extends React.Component { - constructor(props) { - super(props); +const WrapSimpleDemo = ({ children }) => { + useMemo(() => { updateEditor(store, "DemoEditor", { readOnly: false, sequenceData: exampleSequenceData }); - } - render() { - return this.props.children; - } -} + }, []); + return children; +}; render(, document.querySelector("#demo")); From 1243a781175f12466cc27544d55f480b1193d8a3 Mon Sep 17 00:00:00 2001 From: Thomas Rich Date: Mon, 20 Dec 2021 09:29:58 -0800 Subject: [PATCH 2/6] publishing new patch --- package.json | 2 +- yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index 7953c19b4..618fa7ffb 100644 --- a/package.json +++ b/package.json @@ -69,7 +69,7 @@ "tg-react-reflex": "^2.0.10", "use-local-storage-state": "^10.0.0", "ve-range-utils": "^2.6.5", - "ve-sequence-utils": "^5.1.12" + "ve-sequence-utils": "^5.1.13" }, "peerDependencies": { "react": "^16.10.2", diff --git a/yarn.lock b/yarn.lock index 4b5eb55fe..cace0e4a2 100644 --- a/yarn.lock +++ b/yarn.lock @@ -12403,10 +12403,10 @@ ve-range-utils@^2.6.5: dependencies: lodash "^4.17.4" -ve-sequence-utils@^5.1.12: - version "5.1.12" - resolved "https://registry.yarnpkg.com/ve-sequence-utils/-/ve-sequence-utils-5.1.12.tgz#bbeaf480e370db97e5a297894c67c1ebfab484b6" - integrity sha512-QJVnlQUnr6B2n6MVuJXRUvQ7p8dEWbuzti3czcjr4kUYJ7eLCISPQA//a73ymH7xqu//0i3y7T3dR8FxM/QoEQ== +ve-sequence-utils@^5.1.13: + version "5.1.13" + resolved "https://registry.yarnpkg.com/ve-sequence-utils/-/ve-sequence-utils-5.1.13.tgz#7f0a5aaccd9d4cdc09173b6154f5cde10da55ba6" + integrity sha512-tLLFhVQ+FuU09Agp/XG129gQ75fA35Ct46udvT1zPwkBhtDo7mRJDk3E8tJYxak6MSn2r8XwQOaxkmRebTPeTA== dependencies: bson-objectid "^1.1.1" escape-string-regexp "^1.0.5" From 27c66ba795589f6f463b101dda6a615b172085be Mon Sep 17 00:00:00 2001 From: Thomas Rich Date: Mon, 20 Dec 2021 09:30:19 -0800 Subject: [PATCH 3/6] 17.0.5 --- CHANGELOG.md | 18 ++++++++++++++++++ package.json | 2 +- 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 618d1c813..fe137d755 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,8 +4,26 @@ All notable changes to this project will be documented in this file. Dates are d Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). +#### [v17.0.5](https://github.com/TeselaGen/openVectorEditor/compare/v17.0.5...v17.0.5) + +- Create CODE_OF_CONDUCT.md [`#796`](https://github.com/TeselaGen/openVectorEditor/pull/796) +- CLN-35253: add extra length on non en letters. (#14) [`#795`](https://github.com/TeselaGen/openVectorEditor/pull/795) +- improving demo link clicking to close sidebar [`c6a93f0`](https://github.com/TeselaGen/openVectorEditor/commit/c6a93f036d82d7558b9e87ff9ca7b616e00cc72c) +- publishing new patch [`1243a78`](https://github.com/TeselaGen/openVectorEditor/commit/1243a781175f12466cc27544d55f480b1193d8a3) +- testing vscode in browser [`fd318fa`](https://github.com/TeselaGen/openVectorEditor/commit/fd318faed69bc1372fe3dd488431f9aa050b517d) + +#### [v17.0.5](https://github.com/TeselaGen/openVectorEditor/compare/v17.0.4...v17.0.5) + +> 14 December 2021 + +- a bunch more work on improving primer base editing [`0efe5e4`](https://github.com/TeselaGen/openVectorEditor/commit/0efe5e48f245389d5793de7315b54651be8f17d2) +- updating blueprint and TRC and fixing focus issue with popover [`253160a`](https://github.com/TeselaGen/openVectorEditor/commit/253160a692ae7787c06a10d03b3eb880e9f51865) +- attempting to fix test [`6436c36`](https://github.com/TeselaGen/openVectorEditor/commit/6436c36ebd183d2467c7662a9c29228175f1666a) + #### [v17.0.4](https://github.com/TeselaGen/openVectorEditor/compare/v17.0.3...v17.0.4) +> 6 December 2021 + - fixing issue with alignment minimap being messed up from react-draggable update [`a340f4a`](https://github.com/TeselaGen/openVectorEditor/commit/a340f4a581798ce5596cf3a22a15171ef294d2e4) #### [v17.0.3](https://github.com/TeselaGen/openVectorEditor/compare/v17.0.2...v17.0.3) diff --git a/package.json b/package.json index 618fa7ffb..cef194033 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "open-vector-editor", - "version": "17.0.4", + "version": "17.0.5", "description": "Teselagen's Open Source Vector Editor", "main": "lib/index.js", "module": "es/index.js", From 77b5d8382dd621095680de7af225c6634e00528b Mon Sep 17 00:00:00 2001 From: Thomas Rich Date: Mon, 20 Dec 2021 09:31:05 -0800 Subject: [PATCH 4/6] publishing new patch --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index cef194033..bf715125a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "open-vector-editor", - "version": "17.0.5", + "version": "17.0.10", "description": "Teselagen's Open Source Vector Editor", "main": "lib/index.js", "module": "es/index.js", From 6825933124319c17b9a4920952e8bf1c48816367 Mon Sep 17 00:00:00 2001 From: Thomas Rich Date: Mon, 20 Dec 2021 09:31:46 -0800 Subject: [PATCH 5/6] updating --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index bf715125a..176e9546b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "open-vector-editor", - "version": "17.0.10", + "version": "17.0.11", "description": "Teselagen's Open Source Vector Editor", "main": "lib/index.js", "module": "es/index.js", From b86c89dc0352a710f65851b881bd165d13d40684 Mon Sep 17 00:00:00 2001 From: Thomas Rich Date: Mon, 20 Dec 2021 09:31:49 -0800 Subject: [PATCH 6/6] 17.0.12 --- CHANGELOG.md | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index fe137d755..7c1ca6177 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,13 +4,13 @@ All notable changes to this project will be documented in this file. Dates are d Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). -#### [v17.0.5](https://github.com/TeselaGen/openVectorEditor/compare/v17.0.5...v17.0.5) +#### [v17.0.12](https://github.com/TeselaGen/openVectorEditor/compare/v17.0.5...v17.0.12) - Create CODE_OF_CONDUCT.md [`#796`](https://github.com/TeselaGen/openVectorEditor/pull/796) - CLN-35253: add extra length on non en letters. (#14) [`#795`](https://github.com/TeselaGen/openVectorEditor/pull/795) - improving demo link clicking to close sidebar [`c6a93f0`](https://github.com/TeselaGen/openVectorEditor/commit/c6a93f036d82d7558b9e87ff9ca7b616e00cc72c) - publishing new patch [`1243a78`](https://github.com/TeselaGen/openVectorEditor/commit/1243a781175f12466cc27544d55f480b1193d8a3) -- testing vscode in browser [`fd318fa`](https://github.com/TeselaGen/openVectorEditor/commit/fd318faed69bc1372fe3dd488431f9aa050b517d) +- updating [`6825933`](https://github.com/TeselaGen/openVectorEditor/commit/6825933124319c17b9a4920952e8bf1c48816367) #### [v17.0.5](https://github.com/TeselaGen/openVectorEditor/compare/v17.0.4...v17.0.5) diff --git a/package.json b/package.json index 176e9546b..f452d3f95 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "open-vector-editor", - "version": "17.0.11", + "version": "17.0.12", "description": "Teselagen's Open Source Vector Editor", "main": "lib/index.js", "module": "es/index.js",