hoodini-viz 0.1.4 → 0.2.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-DoUR8EOn.js";
1
+ import { g as getDefaultExportFromCjs } from "./index-CuEGSU4j.js";
2
2
  function _mergeNamespaces(K, D) {
3
3
  for (var d = 0; d < D.length; d++) {
4
4
  const E = D[d];
@@ -1,5 +1,7 @@
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-DoUR8EOn.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")({
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-CuEGSU4j.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")({
3
5
  name: "DataGridOverlayEditorStyle",
4
6
  class: "gdg-d19meir1",
5
7
  propsAsIs: !1,
@@ -30,8 +32,8 @@ function ce() {
30
32
  return;
31
33
  let a;
32
34
  const o = () => {
33
- const { right: x } = t.getBoundingClientRect();
34
- h((g) => Math.min(g + window.innerWidth - x - 10, 0)), a = requestAnimationFrame(o);
35
+ const { right: O } = t.getBoundingClientRect();
36
+ h((m) => Math.min(m + window.innerWidth - O - 10, 0)), a = requestAnimationFrame(o);
35
37
  };
36
38
  return a = requestAnimationFrame(o), () => {
37
39
  a !== void 0 && cancelAnimationFrame(a);
@@ -44,17 +46,17 @@ function ce() {
44
46
  };
45
47
  }
46
48
  const ge = (t) => {
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);
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);
48
50
  S.current = l ?? i;
49
- const [y, k] = r.useState(() => p === void 0 ? !0 : !(I(i) && p?.(m, i, S.current) === !1)), u = r.useCallback((e, n) => {
51
+ const [y, R] = r.useState(() => p === void 0 ? !0 : !(I(i) && p?.(g, i, S.current) === !1)), u = r.useCallback((e, n) => {
50
52
  h(y ? e : void 0, n);
51
53
  }, [y, h]), Y = r.useCallback((e) => {
52
54
  if (p !== void 0 && e !== void 0 && I(e)) {
53
- const n = p(m, e, S.current);
54
- n === !1 ? k(!1) : (typeof n == "object" && (e = n), k(!0));
55
+ const n = p(g, e, S.current);
56
+ n === !1 ? R(!1) : (typeof n == "object" && (e = n), R(!0));
55
57
  }
56
58
  K(e);
57
- }, [m, p]), E = r.useRef(!1), c = r.useRef(void 0), j = r.useCallback(() => {
59
+ }, [g, p]), E = r.useRef(!1), c = r.useRef(void 0), j = r.useCallback(() => {
58
60
  u(l, [0, 0]), E.current = !0;
59
61
  }, [l, u]), L = r.useCallback((e, n) => {
60
62
  u(e, n ?? c.current ?? [0, 0]), E.current = !0;
@@ -65,19 +67,19 @@ const ge = (t) => {
65
67
  !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(() => {
66
68
  !E.current && c.current !== void 0 && (u(n ? l : void 0, c.current), E.current = !0);
67
69
  }, 0);
68
- }, [u, l]), R = l ?? i, [d, B] = r.useMemo(() => {
69
- if (Q(i))
70
+ }, [u, l]), k = l ?? i, [d, B] = r.useMemo(() => {
71
+ if (U(i))
70
72
  return [];
71
- const e = { ...i, location: m, activation: O }, n = T?.(e);
73
+ const e = { ...i, location: g, activation: x }, n = T?.(e);
72
74
  return n !== void 0 ? [n, !1] : [P(i)?.provideEditor?.(e), !1];
73
- }, [m, i, P, T, O]), { ref: $, style: z } = ce();
75
+ }, [g, i, P, T, x]), { ref: $, style: z } = ce();
74
76
  let M = !0, _, N = !0, v;
75
77
  if (d !== void 0) {
76
78
  M = d.disablePadding !== !0, N = d.disableStyling !== !0;
77
- const e = U(d);
79
+ const e = Z(d);
78
80
  e && (v = d.styleOverride);
79
81
  const n = e ? d.editor : d;
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 });
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 });
81
83
  }
82
84
  v = { ...v, ...z };
83
85
  const V = F?.current ?? document.getElementById("portal");
@@ -86,12 +88,12 @@ const ge = (t) => {
86
88
  let D = N ? "gdg-style" : "gdg-unstyle";
87
89
  y || (D += " gdg-invalid"), M && (D += " gdg-pad");
88
90
  const G = w?.[0] ?? 1, H = w?.[1] ?? 1;
89
- return Z.createPortal(r.createElement(
91
+ return J(r.createElement(
90
92
  ee.Provider,
91
- { value: g },
93
+ { value: m },
92
94
  r.createElement(
93
95
  te,
94
- { style: re(g), className: x, onClickOutside: j, isOutsideClick: X, customEventTarget: A },
96
+ { style: re(m), className: O, onClickOutside: j, isOutsideClick: X, customEventTarget: A },
95
97
  r.createElement(
96
98
  de,
97
99
  { 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 },