hoodini-viz 0.1.0 → 0.1.1

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.
@@ -1,4 +1,4 @@
1
- import { g as getDefaultExportFromCjs } from "./index-CLh4oIT4.js";
1
+ import { g as getDefaultExportFromCjs } from "./index-CgEGAnfh.js";
2
2
  function _mergeNamespaces(K, D) {
3
3
  for (var d = 0; d < D.length; d++) {
4
4
  const E = D[d];
@@ -1,7 +1,5 @@
1
- import * as r from "react";
2
- import { createPortal as J } from "react-dom";
3
- import { s as Q, i as I, a as U, b as Z, T as ee, C as te, m as re } from "./index-CLh4oIT4.js";
4
- const ne = () => (t) => t.targetX, ie = () => (t) => t.targetY, se = () => (t) => t.targetWidth, ae = () => (t) => t.targetHeight, oe = () => (t) => t.targetY + 10, le = () => (t) => Math.max(0, (t.targetHeight - 28) / 2), de = /* @__PURE__ */ Q("div")({
1
+ import { s as J, r, i as I, a as Q, b as U, c as Z, T as ee, C as te, m as re } from "./index-CgEGAnfh.js";
2
+ const ne = () => (t) => t.targetX, ie = () => (t) => t.targetY, se = () => (t) => t.targetWidth, ae = () => (t) => t.targetHeight, oe = () => (t) => t.targetY + 10, le = () => (t) => Math.max(0, (t.targetHeight - 28) / 2), de = /* @__PURE__ */ J("div")({
5
3
  name: "DataGridOverlayEditorStyle",
6
4
  class: "gdg-d19meir1",
7
5
  propsAsIs: !1,
@@ -32,8 +30,8 @@ function ce() {
32
30
  return;
33
31
  let a;
34
32
  const o = () => {
35
- const { right: O } = t.getBoundingClientRect();
36
- h((m) => Math.min(m + window.innerWidth - O - 10, 0)), a = requestAnimationFrame(o);
33
+ const { right: x } = t.getBoundingClientRect();
34
+ h((g) => Math.min(g + window.innerWidth - x - 10, 0)), a = requestAnimationFrame(o);
37
35
  };
38
36
  return a = requestAnimationFrame(o), () => {
39
37
  a !== void 0 && cancelAnimationFrame(a);
@@ -46,17 +44,17 @@ function ce() {
46
44
  };
47
45
  }
48
46
  const ge = (t) => {
49
- const { target: s, content: i, onFinishEditing: h, forceEditMode: f, initialValue: b, imageEditorOverride: C, markdownDivCreateNode: a, highlight: o, className: O, theme: m, id: W, cell: g, bloom: w, portalElementRef: F, validateCell: p, getCellRenderer: P, provideEditor: T, isOutsideClick: X, customEventTarget: A, activation: x } = t, [l, K] = r.useState(f ? i : void 0), S = r.useRef(l ?? i);
47
+ const { target: s, content: i, onFinishEditing: h, forceEditMode: f, initialValue: b, imageEditorOverride: C, markdownDivCreateNode: a, highlight: o, className: x, theme: g, id: W, cell: m, bloom: w, portalElementRef: F, validateCell: p, getCellRenderer: P, provideEditor: T, isOutsideClick: X, customEventTarget: A, activation: O } = t, [l, K] = r.useState(f ? i : void 0), S = r.useRef(l ?? i);
50
48
  S.current = l ?? i;
51
- const [y, R] = r.useState(() => p === void 0 ? !0 : !(I(i) && p?.(g, i, S.current) === !1)), u = r.useCallback((e, n) => {
49
+ const [y, k] = r.useState(() => p === void 0 ? !0 : !(I(i) && p?.(m, i, S.current) === !1)), u = r.useCallback((e, n) => {
52
50
  h(y ? e : void 0, n);
53
51
  }, [y, h]), Y = r.useCallback((e) => {
54
52
  if (p !== void 0 && e !== void 0 && I(e)) {
55
- const n = p(g, e, S.current);
56
- n === !1 ? R(!1) : (typeof n == "object" && (e = n), R(!0));
53
+ const n = p(m, e, S.current);
54
+ n === !1 ? k(!1) : (typeof n == "object" && (e = n), k(!0));
57
55
  }
58
56
  K(e);
59
- }, [g, p]), E = r.useRef(!1), c = r.useRef(void 0), j = r.useCallback(() => {
57
+ }, [m, p]), E = r.useRef(!1), c = r.useRef(void 0), j = r.useCallback(() => {
60
58
  u(l, [0, 0]), E.current = !0;
61
59
  }, [l, u]), L = r.useCallback((e, n) => {
62
60
  u(e, n ?? c.current ?? [0, 0]), E.current = !0;
@@ -67,19 +65,19 @@ const ge = (t) => {
67
65
  !e.shiftKey ? (e.stopPropagation(), e.preventDefault(), c.current = [0, 1], n = !0) : e.key === "Tab" && (e.stopPropagation(), e.preventDefault(), c.current = [e.shiftKey ? -1 : 1, 0], n = !0), window.setTimeout(() => {
68
66
  !E.current && c.current !== void 0 && (u(n ? l : void 0, c.current), E.current = !0);
69
67
  }, 0);
70
- }, [u, l]), k = l ?? i, [d, B] = r.useMemo(() => {
71
- if (U(i))
68
+ }, [u, l]), R = l ?? i, [d, B] = r.useMemo(() => {
69
+ if (Q(i))
72
70
  return [];
73
- const e = { ...i, location: g, activation: x }, n = T?.(e);
71
+ const e = { ...i, location: m, activation: O }, n = T?.(e);
74
72
  return n !== void 0 ? [n, !1] : [P(i)?.provideEditor?.(e), !1];
75
- }, [g, i, P, T, x]), { ref: $, style: z } = ce();
73
+ }, [m, i, P, T, O]), { ref: $, style: z } = ce();
76
74
  let M = !0, _, N = !0, v;
77
75
  if (d !== void 0) {
78
76
  M = d.disablePadding !== !0, N = d.disableStyling !== !0;
79
- const e = Z(d);
77
+ const e = U(d);
80
78
  e && (v = d.styleOverride);
81
79
  const n = e ? d.editor : d;
82
- _ = r.createElement(n, { portalElementRef: F, isHighlighted: o, activation: x, onChange: Y, value: k, initialValue: b, onFinishedEditing: L, validatedSelection: I(k) ? k.selectionRange : void 0, forceEditMode: f, target: s, imageEditorOverride: C, markdownDivCreateNode: a, isValid: y, theme: m });
80
+ _ = r.createElement(n, { portalElementRef: F, isHighlighted: o, activation: O, onChange: Y, value: R, initialValue: b, onFinishedEditing: L, validatedSelection: I(R) ? R.selectionRange : void 0, forceEditMode: f, target: s, imageEditorOverride: C, markdownDivCreateNode: a, isValid: y, theme: g });
83
81
  }
84
82
  v = { ...v, ...z };
85
83
  const V = F?.current ?? document.getElementById("portal");
@@ -88,12 +86,12 @@ const ge = (t) => {
88
86
  let D = N ? "gdg-style" : "gdg-unstyle";
89
87
  y || (D += " gdg-invalid"), M && (D += " gdg-pad");
90
88
  const G = w?.[0] ?? 1, H = w?.[1] ?? 1;
91
- return J(r.createElement(
89
+ return Z.createPortal(r.createElement(
92
90
  ee.Provider,
93
- { value: m },
91
+ { value: g },
94
92
  r.createElement(
95
93
  te,
96
- { style: re(m), className: O, onClickOutside: j, isOutsideClick: X, customEventTarget: A },
94
+ { style: re(g), className: x, onClickOutside: j, isOutsideClick: X, customEventTarget: A },
97
95
  r.createElement(
98
96
  de,
99
97
  { ref: $, id: W, className: D, style: v, as: B === !0 ? "label" : void 0, targetX: s.x - G, targetY: s.y - H, targetWidth: s.width + G * 2, targetHeight: s.height + H * 2 },
@@ -1,16 +1,18 @@
1
- import { D as s, c as o, F as t, G as i, d as l, H as d, H as n, e as P, P as r, f as D, h, j as H, k as F } from "./index-CLh4oIT4.js";
1
+ import { D as s, d as o, F as t, G as i, e as l, H as n, H as d, f as D, P, h as r, R as h, j as H, k as R, l as F, n as G } from "./index-CgEGAnfh.js";
2
2
  export {
3
3
  s as DEFAULT_CONFIG,
4
4
  o as Domain,
5
5
  t as FORMAT_PRESETS,
6
6
  i as Gene,
7
7
  l as GenomeView,
8
- d as HoodiniDashboard,
9
- n as HoodiniDashboardDefault,
10
- P as HoodiniViz,
11
- r as PhyloNode,
12
- D as PhyloTree,
13
- h as getPaletteColors,
14
- H as getQualitativePalettes,
15
- F as getSequentialPalettes
8
+ n as HoodiniDashboard,
9
+ d as HoodiniDashboardDefault,
10
+ D as HoodiniViz,
11
+ P as PhyloNode,
12
+ r as PhyloTree,
13
+ h as React,
14
+ H as ReactDOM,
15
+ R as getPaletteColors,
16
+ F as getQualitativePalettes,
17
+ G as getSequentialPalettes
16
18
  };