@teselagen/ove 0.7.6 → 0.7.7

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,6 +1,6 @@
1
1
  {
2
2
  "name": "@teselagen/ove",
3
- "version": "0.7.6",
3
+ "version": "0.7.7",
4
4
  "main": "./src/index.js",
5
5
  "exports": {
6
6
  ".": {
@@ -12,12 +12,10 @@
12
12
  "dependencies": {
13
13
  "@teselagen/sequence-utils": "0.3.27",
14
14
  "@teselagen/range-utils": "0.3.7",
15
- "@teselagen/ui": "0.7.10",
15
+ "@teselagen/ui": "0.7.11",
16
16
  "@teselagen/file-utils": "0.3.16",
17
17
  "@teselagen/bounce-loader": "0.3.11",
18
18
  "@teselagen/bio-parsers": "0.4.22",
19
- "@blueprintjs/core": "3.54.0",
20
- "@blueprintjs/datetime": "^3.24.1",
21
19
  "@blueprintjs/icons": "3.33.0",
22
20
  "@blueprintjs/select": "3.18.11",
23
21
  "@dnd-kit/core": "^6.1.0",
@@ -71,7 +69,6 @@
71
69
  "react-dom": "^18.3.1",
72
70
  "react-draggable": "4.4.5",
73
71
  "react-dropzone": "^11.4.2",
74
- "react-markdown": "9.0.1",
75
72
  "react-measure": "^2.5.2",
76
73
  "react-redux": "^8.0.5",
77
74
  "react-rnd": "^10.2.4",
@@ -83,7 +80,6 @@
83
80
  "redux-act": "^1.8.0",
84
81
  "redux-form": "^8.3.10",
85
82
  "redux-thunk": "2.4.1",
86
- "remark-gfm": "^4.0.0",
87
83
  "reselect": "^4.1.7",
88
84
  "shortid": "^2.2.16",
89
85
  "tg-use-local-storage-state": "^16.0.3",
@@ -1,4 +1,4 @@
1
- import React from "react";
1
+ import React, { useEffect } from "react";
2
2
  import { useDebouncedCallback } from "use-debounce";
3
3
  import { SLIDER_NORM_WIDTH, SLIDER_SMALL_WIDTH } from "../constants/constants";
4
4
 
@@ -9,15 +9,23 @@ export function RotateCircularViewSlider({
9
9
  zoomLevel,
10
10
  maxZoomLevel,
11
11
  bindOutsideChangeHelper,
12
- smallSlider
12
+ smallSlider,
13
+ editorName
13
14
  }) {
14
15
  const target = React.useRef();
16
+ const svgEleRef = React.useRef();
17
+
18
+ useEffect(() => {
19
+ // use document.querySelector so that the code can still work after changing the parent node of this component
20
+ const svgEle = document
21
+ .querySelector(`.veEditor.${editorName}`)
22
+ ?.querySelector(".veCircularView .circularViewSvg");
23
+ svgEleRef.current = svgEle;
24
+ }, [editorName]);
25
+
15
26
  const showLabelsDebounced = useDebouncedCallback(
16
- () => {
27
+ el => {
17
28
  try {
18
- const el = target.current
19
- .closest(`.veCircularView`)
20
- .querySelector(`.circularViewSvg`);
21
29
  if (el) el.classList.remove("veHideLabels");
22
30
  else {
23
31
  console.error(`whoops we shouldn't be here`);
@@ -46,18 +54,19 @@ export function RotateCircularViewSlider({
46
54
  bindOutsideChangeHelper={bindOutsideChangeHelper}
47
55
  onChange={_val => {
48
56
  const val = 360 - _val;
49
- const el = target.current
50
- .closest(`.veCircularView`)
51
- .querySelector(`.circularViewSvg`);
52
- const innerEl = target.current
53
- .closest(`.veCircularView`)
54
- .querySelector(`.circularViewSvg g`);
57
+ if (!svgEleRef.current) {
58
+ svgEleRef.current = document
59
+ .querySelector(`.veEditor.${editorName}`)
60
+ ?.querySelector(".veCircularView .circularViewSvg");
61
+ }
62
+ const el = svgEleRef.current;
63
+ const innerEl = el?.querySelector("g");
55
64
  innerEl.style.transform = `rotate(${val}deg)`;
56
65
  setRotationRadians((val * Math.PI) / 180);
57
66
  if (zoomLevel <= 1) {
58
67
  el.classList.add("veHideLabels");
59
68
  }
60
- showLabelsDebounced();
69
+ showLabelsDebounced(el);
61
70
  }}
62
71
  smallSlider
63
72
  passedRef={target}
@@ -76,7 +85,7 @@ export function RotateCircularViewSlider({
76
85
  // initialValue={initialRotation || 0}
77
86
  max={360}
78
87
  min={0}
79
- ></UncontrolledSliderWithPlusMinusBtns>
88
+ />
80
89
  </div>
81
90
  );
82
91
  }
@@ -755,6 +755,7 @@ export function CircularView(props) {
755
755
  smallSlider={smallSlider}
756
756
  maxZoomLevel={maxZoomLevel}
757
757
  setRotationRadians={setRotationRadians}
758
+ editorName={editorName}
758
759
  ></RotateCircularViewSlider>
759
760
  )}
760
761
  {withZoomCircularView && hasZoomableLength && (