@pie-lib/graphing 4.0.5-next.30 → 4.0.5-next.32

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.
Files changed (53) hide show
  1. package/dist/_virtual/_rolldown/runtime.js +3 -3
  2. package/dist/axis/arrow.js +1 -1
  3. package/dist/axis/axes.js +6 -6
  4. package/dist/container/index.js +4 -4
  5. package/dist/container/reducer.js +1 -1
  6. package/dist/coordinates-label.js +1 -1
  7. package/dist/graph-with-controls.js +4 -4
  8. package/dist/graph.js +2 -2
  9. package/dist/grid-setup.js +8 -8
  10. package/dist/grid.js +1 -1
  11. package/dist/index.js +2 -2
  12. package/dist/labels.js +1 -1
  13. package/dist/mark-label.d.ts +2 -0
  14. package/dist/mark-label.js +99 -69
  15. package/dist/node_modules/.bun/@visx_axis@3.12.0_f4eacebf2041cd4f/node_modules/@visx/axis/esm/axis/Axis.js +1 -1
  16. package/dist/node_modules/.bun/@visx_axis@3.12.0_f4eacebf2041cd4f/node_modules/@visx/axis/esm/utils/createPoint.js +1 -1
  17. package/dist/node_modules/.bun/@visx_grid@3.12.0_f4eacebf2041cd4f/node_modules/@visx/grid/esm/grids/GridColumns.js +1 -1
  18. package/dist/node_modules/.bun/@visx_grid@3.12.0_f4eacebf2041cd4f/node_modules/@visx/grid/esm/grids/GridRows.js +1 -1
  19. package/dist/node_modules/.bun/@visx_point@3.12.0/node_modules/@visx/point/esm/Point.js +1 -1
  20. package/dist/node_modules/.bun/@visx_text@3.12.0_f4eacebf2041cd4f/node_modules/@visx/text/esm/hooks/useText.js +1 -1
  21. package/dist/node_modules/.bun/@visx_vendor@4.0.0/node_modules/@visx/vendor/esm/d3-shape.js +8 -0
  22. package/dist/node_modules/.bun/clsx@2.1.1/node_modules/clsx/dist/clsx.js +1 -1
  23. package/dist/node_modules/.bun/react-redux@9.3.0_9e2203c65d1d5fa1/node_modules/react-redux/dist/react-redux.js +7 -7
  24. package/dist/node_modules/.bun/redux-undo@1.1.0/node_modules/redux-undo/dist/redux-undo.js +1 -1
  25. package/dist/node_modules/.bun/redux@5.0.1/node_modules/redux/dist/redux.js +2 -2
  26. package/dist/toggle-bar.js +1 -1
  27. package/dist/tool-menu.js +3 -3
  28. package/dist/tools/circle/bg-circle.js +2 -2
  29. package/dist/tools/circle/component.d.ts +5 -0
  30. package/dist/tools/circle/component.js +30 -17
  31. package/dist/tools/index.js +1 -1
  32. package/dist/tools/line/component.js +2 -2
  33. package/dist/tools/point/component.d.ts +2 -0
  34. package/dist/tools/point/component.js +16 -10
  35. package/dist/tools/point/index.js +1 -1
  36. package/dist/tools/polygon/component.d.ts +5 -0
  37. package/dist/tools/polygon/component.js +27 -18
  38. package/dist/tools/polygon/index.js +1 -1
  39. package/dist/tools/polygon/line.js +1 -1
  40. package/dist/tools/polygon/polygon.js +3 -3
  41. package/dist/tools/ray/component.js +2 -2
  42. package/dist/tools/segment/component.js +1 -1
  43. package/dist/tools/shared/line/index.d.ts +10 -4
  44. package/dist/tools/shared/line/index.js +27 -14
  45. package/dist/tools/shared/line/line-path.js +2 -2
  46. package/dist/tools/shared/line/with-root-edge.d.ts +10 -4
  47. package/dist/tools/shared/line/with-root-edge.js +3 -3
  48. package/dist/tools/shared/point/base-point.js +1 -1
  49. package/dist/tools/vector/component.js +1 -1
  50. package/dist/undo-redo.js +2 -2
  51. package/dist/utils.js +1 -1
  52. package/package.json +16 -11
  53. package/dist/node_modules/.bun/@visx_curve@3.12.0/node_modules/@visx/curve/esm/index.js +0 -2
@@ -12,12 +12,12 @@ var e = Object.create, t = Object.defineProperty, n = Object.getOwnPropertyDescr
12
12
  enumerable: !(s = n(i, d)) || s.enumerable
13
13
  });
14
14
  return e;
15
- }, l = (n, r, a) => (a = n == null ? {} : e(i(n)), c(r || !n || !n.__esModule ? t(a, "default", {
15
+ }, l = (e, t, n) => (c(e, t, "default"), n && c(n, t, "default")), u = (n, r, a) => (a = n == null ? {} : e(i(n)), c(r || !n || !n.__esModule ? t(a, "default", {
16
16
  value: n,
17
17
  enumerable: !0
18
- }) : a, n)), u = /* @__PURE__ */ ((e) => typeof require < "u" ? require : typeof Proxy < "u" ? new Proxy(e, { get: (e, t) => (typeof require < "u" ? require : e)[t] }) : e)(function(e) {
18
+ }) : a, n)), d = /* @__PURE__ */ ((e) => typeof require < "u" ? require : typeof Proxy < "u" ? new Proxy(e, { get: (e, t) => (typeof require < "u" ? require : e)[t] }) : e)(function(e) {
19
19
  if (typeof require < "u") return require.apply(this, arguments);
20
20
  throw Error("Calling `require` for \"" + e + "\" in an environment that doesn't expose the `require` function. See https://rolldown.rs/in-depth/bundling-cjs#require-external-modules for more details.");
21
21
  });
22
22
  //#endregion
23
- export { o as __commonJSMin, s as __exportAll, u as __require, l as __toESM };
23
+ export { o as __commonJSMin, s as __exportAll, l as __reExport, d as __require, u as __toESM };
@@ -31,4 +31,4 @@ o.propTypes = {
31
31
  direction: "left"
32
32
  };
33
33
  //#endregion
34
- export { o as default };
34
+ export { o as Arrow, o as default };
package/dist/axis/axes.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import e from "../node_modules/.bun/@visx_axis@3.12.0_f4eacebf2041cd4f/node_modules/@visx/axis/esm/axis/Axis.js";
2
- import t from "./arrow.js";
2
+ import { Arrow as t } from "./arrow.js";
3
3
  import { amountToIncreaseWidth as n, countWords as r, findLongestWord as i, getTickValues as a } from "../utils.js";
4
4
  import o from "react";
5
5
  import s from "prop-types";
@@ -102,7 +102,7 @@ var _ = g(p, "Readable") || g(b.Readable, "Readable"), v = f, y = v.default, b =
102
102
  })
103
103
  ] });
104
104
  }
105
- }, A = class extends o.Component {
105
+ }, A = k, j = class extends o.Component {
106
106
  static propTypes = {
107
107
  ...x,
108
108
  graphProps: c.GraphPropsType.isRequired
@@ -162,7 +162,7 @@ var _ = g(p, "Readable") || g(b.Readable, "Readable"), v = f, y = v.default, b =
162
162
  })
163
163
  ] });
164
164
  }
165
- }, j = class extends o.Component {
165
+ }, M = j, N = class extends o.Component {
166
166
  static propTypes = {
167
167
  ...x,
168
168
  graphProps: c.GraphPropsType.isRequired
@@ -196,13 +196,13 @@ var _ = g(p, "Readable") || g(b.Readable, "Readable"), v = f, y = v.default, b =
196
196
  };
197
197
  render() {
198
198
  let { graphProps: e } = this.props, { domain: t, range: n } = e || {}, { columnTicksValues: r, firstNegativeX: i, distanceFromOriginToFirstNegativeX: a } = this.xValues(), { rowTickValues: o, firstNegativeY: s, distanceFromOriginToFirstNegativeY: c } = this.yValues(), l = D(i, s, a, c, 6, 25);
199
- return /* @__PURE__ */ d(T, { children: [n.min <= 0 ? /* @__PURE__ */ u(k, {
199
+ return /* @__PURE__ */ d(T, { children: [n.min <= 0 ? /* @__PURE__ */ u(A, {
200
200
  ...this.props,
201
201
  skipValues: l,
202
202
  columnTicksValues: r,
203
203
  distanceFromOriginToFirstNegativeY: c,
204
204
  dy: 25
205
- }) : null, t.min <= 0 ? /* @__PURE__ */ u(A, {
205
+ }) : null, t.min <= 0 ? /* @__PURE__ */ u(M, {
206
206
  ...this.props,
207
207
  skipValues: l,
208
208
  rowTickValues: o,
@@ -211,4 +211,4 @@ var _ = g(p, "Readable") || g(b.Readable, "Readable"), v = f, y = v.default, b =
211
211
  }
212
212
  };
213
213
  //#endregion
214
- export { x as AxisPropTypes, j as default };
214
+ export { x as AxisPropTypes, k as RawXAxis, j as RawYAxis, N as default, O as firstNegativeValue, D as sharedValues };
@@ -1,9 +1,9 @@
1
- import { Provider_default as e, connect as t } from "../node_modules/.bun/react-redux@9.3.0_9e2203c65d1d5fa1/node_modules/react-redux/dist/react-redux.js";
1
+ import { Provider as e, connect as t } from "../node_modules/.bun/react-redux@9.3.0_9e2203c65d1d5fa1/node_modules/react-redux/dist/react-redux.js";
2
2
  import { applyMiddleware as n, createStore as r } from "../node_modules/.bun/redux@5.0.1/node_modules/redux/dist/redux.js";
3
- import { M as i } from "../node_modules/.bun/redux-undo@1.1.0/node_modules/redux-undo/dist/redux-undo.js";
3
+ import { ActionCreators as i } from "../node_modules/.bun/redux-undo@1.1.0/node_modules/redux-undo/dist/redux-undo.js";
4
4
  import a from "./reducer.js";
5
5
  import { changeMarks as o } from "./actions.js";
6
- import s from "../graph-with-controls.js";
6
+ import { GraphWithControls as s } from "../graph-with-controls.js";
7
7
  import { lastActionMiddleware as c } from "./middleware.js";
8
8
  import l from "react";
9
9
  import u from "prop-types";
@@ -45,4 +45,4 @@ var p = t((e) => ({ marks: e.marks.present }), (e) => ({
45
45
  }
46
46
  };
47
47
  //#endregion
48
- export { m as default };
48
+ export { p as GraphContainer, m as default };
@@ -1,6 +1,6 @@
1
1
  import { combineReducers as e } from "../node_modules/.bun/redux@5.0.1/node_modules/redux/dist/redux.js";
2
2
  import t from "./marks.js";
3
- import { C as n } from "../node_modules/.bun/redux-undo@1.1.0/node_modules/redux-undo/dist/redux-undo.js";
3
+ import n from "../node_modules/.bun/redux-undo@1.1.0/node_modules/redux-undo/dist/redux-undo.js";
4
4
  //#region src/container/reducer.ts
5
5
  var r = () => e({ marks: n(t, { debug: !1 }) });
6
6
  //#endregion
@@ -43,4 +43,4 @@ l.propTypes = {
43
43
  y: t.number
44
44
  };
45
45
  //#endregion
46
- export { l as default };
46
+ export { l as CoordinatesLabel, l as default, c as getLabelPosition };
@@ -1,7 +1,7 @@
1
- import e, { graphPropTypes as t } from "./graph.js";
1
+ import { Graph as e, graphPropTypes as t } from "./graph.js";
2
2
  import { allTools as n, toolsArr as r } from "./tools/index.js";
3
- import i from "./tool-menu.js";
4
- import a from "./undo-redo.js";
3
+ import { ToolMenu as i } from "./tool-menu.js";
4
+ import { UndoRedo as a } from "./undo-redo.js";
5
5
  import o from "react";
6
6
  import s from "prop-types";
7
7
  import { isString as c, uniq as l } from "@pie-element/shared-lodash";
@@ -151,4 +151,4 @@ var j = class extends o.Component {
151
151
  }
152
152
  };
153
153
  //#endregion
154
- export { j as default };
154
+ export { j as GraphWithControls, j as default, D as filterByValidToolTypes, O as filterByVisibleToolTypes, E as getAvailableTool, w as setToolbarAvailability, T as toolIsAvailable };
package/dist/graph.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { isDuplicatedMark as e } from "./utils.js";
2
2
  import t, { AxisPropTypes as n } from "./axis/axes.js";
3
- import r from "./grid.js";
3
+ import { Grid as r } from "./grid.js";
4
4
  import { LabelType as i } from "./labels.js";
5
5
  import a from "./bg.js";
6
6
  import o from "react";
@@ -206,4 +206,4 @@ var g = p("pie-lib:graphing:graph"), _ = {
206
206
  }
207
207
  };
208
208
  //#endregion
209
- export { b as default, _ as graphPropTypes };
209
+ export { b as Graph, b as default, _ as graphPropTypes, y as removeBuildingToolIfCurrentToolDiffers };
@@ -144,17 +144,17 @@ var F = (e) => {
144
144
  step: 1,
145
145
  labelStep: 0
146
146
  };
147
+ }, r = {
148
+ ...v,
149
+ ...e ? { labelStep: 1 } : n("range")
150
+ }, i = {
151
+ ...t,
152
+ ...e ? { labelStep: 1 } : n("domain")
147
153
  };
148
154
  g({
149
155
  includeAxes: e,
150
- range: {
151
- ...v,
152
- ...e ? { labelStep: 1 } : n("range")
153
- },
154
- domain: {
155
- ...t,
156
- ...e ? { labelStep: 1 } : n("domain")
157
- }
156
+ range: r,
157
+ domain: i
158
158
  });
159
159
  }, K = (e) => {
160
160
  g({
package/dist/grid.js CHANGED
@@ -56,4 +56,4 @@ var u = class extends i.Component {
56
56
  }
57
57
  };
58
58
  //#endregion
59
- export { u as default };
59
+ export { u as Grid, u as default };
package/dist/index.js CHANGED
@@ -1,6 +1,6 @@
1
- import e from "./graph.js";
1
+ import { Graph as e } from "./graph.js";
2
2
  import { tools_exports as t } from "./tools/index.js";
3
- import n from "./tool-menu.js";
3
+ import { ToolMenu as n } from "./tool-menu.js";
4
4
  import r from "./container/index.js";
5
5
  import i from "./grid-setup.js";
6
6
  import a from "./key-legend.js";
package/dist/labels.js CHANGED
@@ -149,4 +149,4 @@ var d = u(s, "Readable") || u(m.Readable, "Readable"), f = o, p = f.default, m =
149
149
  }
150
150
  });
151
151
  //#endregion
152
- export { b as LabelType };
152
+ export { b as LabelType, g as getTransform };
@@ -25,7 +25,9 @@ export declare const coordinates: (graphProps: any, mark: any, rect: {
25
25
  export declare const MarkLabel: {
26
26
  (props: any): React.JSX.Element | null;
27
27
  propTypes: {
28
+ autoFocus: PropTypes.Requireable<boolean>;
28
29
  disabled: PropTypes.Requireable<boolean>;
30
+ onBlur: PropTypes.Requireable<(...args: any[]) => any>;
29
31
  onChange: PropTypes.Requireable<(...args: any[]) => any>;
30
32
  graphProps: PropTypes.Requireable<PropTypes.InferProps<{
31
33
  scale: PropTypes.Validator<NonNullable<PropTypes.InferProps<{
@@ -1,14 +1,20 @@
1
1
  import { AutosizeInput as e } from "./autosize-input.js";
2
2
  import { useDebounce as t } from "./use-debounce.js";
3
3
  import n from "./label-svg-icon.js";
4
- import { useCallback as r, useEffect as i, useState as a } from "react";
5
- import o from "prop-types";
6
- import { types as s } from "@pie-lib/plot";
7
- import { styled as c, useTheme as l } from "@mui/material/styles";
8
- import { Fragment as u, jsx as d, jsxs as f } from "react/jsx-runtime";
4
+ import { useCallback as r, useEffect as i, useRef as a, useState as o } from "react";
5
+ import s from "prop-types";
6
+ import { types as c } from "@pie-lib/plot";
7
+ import { styled as l, useTheme as u } from "@mui/material/styles";
8
+ import { Fragment as ee, jsx as d, jsxs as f } from "react/jsx-runtime";
9
9
  import { color as p } from "@pie-lib/render-ui";
10
10
  //#region src/mark-label.tsx
11
- var m = c("div")(({ theme: e }) => ({
11
+ var m = 500, h = 500, g = [
12
+ 0,
13
+ 50,
14
+ 120,
15
+ 250,
16
+ 400
17
+ ], _ = l("div")(({ theme: e }) => ({
12
18
  float: "right",
13
19
  padding: e.spacing(.5),
14
20
  borderRadius: "4px",
@@ -16,7 +22,7 @@ var m = c("div")(({ theme: e }) => ({
16
22
  backgroundColor: p.defaults.WHITE,
17
23
  color: p.defaults.CORRECT_WITH_ICON,
18
24
  border: `solid 1px ${p.defaults.CORRECT_WITH_ICON}`
19
- })), h = c("div")(({ theme: e }) => ({
25
+ })), v = l("div")(({ theme: e }) => ({
20
26
  float: "right",
21
27
  padding: e.spacing(.5),
22
28
  borderRadius: "4px",
@@ -24,7 +30,7 @@ var m = c("div")(({ theme: e }) => ({
24
30
  backgroundColor: p.defaults.WHITE,
25
31
  color: p.defaults.INCORRECT_WITH_ICON,
26
32
  border: `solid 1px ${p.defaults.INCORRECT_WITH_ICON}`
27
- })), g = c("div")(({ theme: e }) => ({
33
+ })), y = l("div")(({ theme: e }) => ({
28
34
  float: "right",
29
35
  padding: e.spacing(.5),
30
36
  borderRadius: "4px",
@@ -33,7 +39,7 @@ var m = c("div")(({ theme: e }) => ({
33
39
  color: p.defaults.MISSING_WITH_ICON,
34
40
  border: `solid 1px ${p.defaults.MISSING_WITH_ICON}`,
35
41
  fontWeight: "bold"
36
- })), _ = c("div")(() => ({
42
+ })), b = l("div")(() => ({
37
43
  float: "right",
38
44
  padding: 0,
39
45
  borderRadius: "4px",
@@ -41,7 +47,7 @@ var m = c("div")(({ theme: e }) => ({
41
47
  backgroundColor: p.defaults.WHITE,
42
48
  color: p.defaults.INCORRECT_WITH_ICON,
43
49
  fontWeight: "bold"
44
- })), v = (e, t, n) => ({
50
+ })), x = (e, t, n) => ({
45
51
  float: "right",
46
52
  padding: e.spacing(.5),
47
53
  fontFamily: e.typography.fontFamily,
@@ -52,18 +58,18 @@ var m = c("div")(({ theme: e }) => ({
52
58
  backgroundColor: p.defaults.WHITE,
53
59
  WebkitOpacity: t ? "1" : void 0,
54
60
  WebkitTextFillColor: n ? p.disabled() : void 0
55
- }), y = () => ({
61
+ }), S = () => ({
56
62
  padding: "0",
57
63
  border: "none",
58
64
  color: "inherit",
59
65
  fontWeight: "bold"
60
- }), b = (e, t, n = {
66
+ }), C = (e, t, n = {
61
67
  width: 0,
62
68
  height: 0
63
69
  }) => {
64
70
  let { scale: r, domain: i, range: a } = e, o = r.x(t.x) + n.width + 5, s = r.y(t.y) + n.height + 5, c = o >= r.x(i.max) ? "left" : "right";
65
71
  return `${s >= r.y(a.min) ? "top" : "bottom"}-${c}`;
66
- }, x = (e, t, n = {
72
+ }, w = (e, t, n = {
67
73
  width: 0,
68
74
  height: 0
69
75
  }, r) => {
@@ -87,7 +93,7 @@ var m = c("div")(({ theme: e }) => ({
87
93
  };
88
94
  default: return {};
89
95
  }
90
- }, S = ({ _ref: t, externalInputRef: n, label: r, disabled: i, inputStyle: a, onChange: o, onBlur: s }) => /* @__PURE__ */ d(e, {
96
+ }, T = ({ _ref: t, externalInputRef: n, label: r, disabled: i, inputStyle: a, onChange: o, onBlur: s }) => /* @__PURE__ */ d(e, {
91
97
  inputRef: (e) => {
92
98
  t(e), n(e);
93
99
  },
@@ -97,75 +103,99 @@ var m = c("div")(({ theme: e }) => ({
97
103
  onChange: o,
98
104
  onBlur: s
99
105
  });
100
- S.propTypes = {
101
- _ref: o.func,
102
- externalInputRef: o.func,
103
- label: o.string,
104
- disabled: o.bool,
105
- inputStyle: o.object,
106
- onChange: o.func,
107
- onBlur: o.func
106
+ T.propTypes = {
107
+ _ref: s.func,
108
+ externalInputRef: s.func,
109
+ label: s.string,
110
+ disabled: s.bool,
111
+ inputStyle: s.object,
112
+ onChange: s.func,
113
+ onBlur: s.func
108
114
  };
109
- var C = (e) => {
110
- let [o, s] = a(null), c = r((e) => s(e)), p = l(), { mark: C, graphProps: w, disabled: T, inputRef: E } = e, [D, O] = a(C.label), { correctness: k, correctnesslabel: A, correctlabel: j } = C, M = (e) => O(e.target.value), N = r(() => {
111
- D === "" && e.onChange("");
112
- }, [D, e.onChange]), P = t(D, 200);
115
+ var E = (e) => {
116
+ let s = a(null), [c, l] = o(null), p = r((e) => {
117
+ s.current = e, l(e);
118
+ }, []), E = u(), { mark: D, graphProps: O, disabled: k, autoFocus: A, inputRef: j } = e, [M, N] = o(D.label), { correctness: P, correctnesslabel: F, correctlabel: I } = D, L = () => !!s.current && typeof document < "u" && document.activeElement === s.current, R = a(D.label === "" && !k && !D.disabled), z = a(0), B = a(D.label), V = () => Date.now() < z.current && !(s.current && s.current.value), H = (e) => N(e.target.value), U = (t) => {
119
+ t !== B.current && (B.current = t, e.onChange(t));
120
+ }, W = r(() => {
121
+ V() || (R.current = !1, M === "" ? e.onChange("") : M !== D.label && U(M), e.onBlur && e.onBlur());
122
+ }, [
123
+ M,
124
+ D.label,
125
+ e.onChange,
126
+ e.onBlur
127
+ ]), G = t(M, m);
113
128
  i(() => {
114
- O(C.label);
115
- }, [C.label]), i(() => {
116
- typeof P == "string" && P !== C.label && e.onChange(P);
117
- }, [P]);
118
- let F = o ? o.getBoundingClientRect() : {
129
+ L() || N(D.label);
130
+ }, [D.label]), i(() => {
131
+ typeof G == "string" && G !== D.label && U(G);
132
+ }, [G]);
133
+ let K = () => {
134
+ let e = s.current;
135
+ if (!A && !R.current && !V() || !e || e.disabled || L()) return;
136
+ e.focus(), L() && (R.current = !1);
137
+ let t = (e.value || "").length;
138
+ e.setSelectionRange && e.setSelectionRange(t, t);
139
+ };
140
+ i(() => K()), i(() => {
141
+ if (!A && !R.current) return;
142
+ z.current ||= Date.now() + h;
143
+ let e = g.map((e) => setTimeout(K, e));
144
+ return () => e.forEach((e) => clearTimeout(e));
145
+ }, [A]);
146
+ let q = c ? c.getBoundingClientRect() : {
119
147
  width: 0,
120
148
  height: 0
121
- }, I = x(w, C, F, b(w, C, F)), L = {
149
+ }, J = w(O, D, q, C(O, D, q)), Y = {
122
150
  position: "fixed",
123
151
  pointerEvents: "auto",
124
152
  display: "flex",
125
153
  alignItems: "center",
126
154
  gap: "3px",
127
- ...I
128
- }, R = {
129
- ...L,
130
- top: I.top + 25
131
- }, z = T || C.disabled, B = (e, t) => /* @__PURE__ */ d(S, {
132
- _ref: c,
133
- externalInputRef: E,
155
+ ...J
156
+ }, X = {
157
+ ...Y,
158
+ top: J.top + 25
159
+ }, Z = k || D.disabled, Q = (e, t) => /* @__PURE__ */ d(T, {
160
+ _ref: p,
161
+ externalInputRef: j,
134
162
  label: t,
135
- disabled: z,
163
+ disabled: Z,
136
164
  inputStyle: e,
137
- onChange: M,
138
- onBlur: N
139
- }), V = y();
140
- return k === "correct" && A === "correct" && j ? /* @__PURE__ */ f(m, {
141
- style: L,
142
- children: [/* @__PURE__ */ d(n, { type: "correct" }), B(V, j)]
143
- }) : k === "correct" && A === "correct" && !j ? null : k === "correct" && A === "incorrect" ? /* @__PURE__ */ f(u, { children: [/* @__PURE__ */ f(h, {
144
- style: L,
145
- children: [/* @__PURE__ */ d(n, { type: "incorrect" }), D === "" ? /* @__PURE__ */ d(n, {
165
+ onChange: H,
166
+ onBlur: W
167
+ }), $ = S();
168
+ return P === "correct" && F === "correct" && I ? /* @__PURE__ */ f(_, {
169
+ style: Y,
170
+ children: [/* @__PURE__ */ d(n, { type: "correct" }), Q($, I)]
171
+ }) : P === "correct" && F === "correct" && !I ? null : P === "correct" && F === "incorrect" ? /* @__PURE__ */ f(ee, { children: [/* @__PURE__ */ f(v, {
172
+ style: Y,
173
+ children: [/* @__PURE__ */ d(n, { type: "incorrect" }), M === "" ? /* @__PURE__ */ d(n, {
146
174
  type: "empty",
147
175
  style: { marginLeft: "3px" }
148
- }) : B(V, D)]
149
- }), /* @__PURE__ */ d(g, {
150
- style: R,
151
- children: B(V, j)
152
- })] }) : k === "missing" ? /* @__PURE__ */ d(g, {
153
- style: L,
154
- children: B(V, D)
155
- }) : k === "incorrect" ? /* @__PURE__ */ d(_, {
156
- style: L,
157
- children: B(V, D)
158
- }) : /* @__PURE__ */ d("div", {
159
- style: L,
160
- children: B(v(p, T, C.disabled), D)
176
+ }) : Q($, M)]
177
+ }), /* @__PURE__ */ d(y, {
178
+ style: X,
179
+ children: Q($, I)
180
+ })] }) : P === "missing" ? /* @__PURE__ */ d(y, {
181
+ style: Y,
182
+ children: Q($, M)
183
+ }) : P === "incorrect" ? /* @__PURE__ */ d(b, {
184
+ style: Y,
185
+ children: Q($, M)
186
+ }) : Z && !M ? null : /* @__PURE__ */ d("div", {
187
+ style: Y,
188
+ children: Q(x(E, k, D.disabled), M)
161
189
  });
162
190
  };
163
- C.propTypes = {
164
- disabled: o.bool,
165
- onChange: o.func,
166
- graphProps: s.GraphPropsType,
167
- inputRef: o.func,
168
- mark: o.object
191
+ E.propTypes = {
192
+ autoFocus: s.bool,
193
+ disabled: s.bool,
194
+ onBlur: s.func,
195
+ onChange: s.func,
196
+ graphProps: c.GraphPropsType,
197
+ inputRef: s.func,
198
+ mark: s.object
169
199
  };
170
200
  //#endregion
171
- export { C as default };
201
+ export { E as MarkLabel, E as default, w as coordinates, C as position };
@@ -45,7 +45,7 @@ function h(e, t) {
45
45
  return n;
46
46
  }
47
47
  function g(e) {
48
- var t = e.children, g = t === void 0 ? o : t, _ = e.axisClassName, v = e.hideAxisLine, y = v === void 0 ? !1 : v, b = e.hideTicks, x = b === void 0 ? !1 : b, S = e.hideZero, C = S === void 0 ? !1 : S, w = e.innerRef, T = e.left, E = T === void 0 ? 0 : T, D = e.numTicks, O = D === void 0 ? 10 : D, k = e.orientation, A = k === void 0 ? a.bottom : k, j = e.rangePadding, M = j === void 0 ? 0 : j, N = e.scale, P = e.tickFormat, F = e.tickLength, I = F === void 0 ? 8 : F, L = e.tickValues, R = e.top, z = R === void 0 ? 0 : R, B = h(e, p), V = P ?? c(N), H = A === a.left, U = A === a.top, W = U || A === a.bottom, G = s(N), K = H || U ? -1 : 1, q = N.range(), J = u(M), Y = l({
48
+ var t = e.children, g = t === void 0 ? o : t, _ = e.axisClassName, v = e.hideAxisLine, y = v !== void 0 && v, b = e.hideTicks, x = b !== void 0 && b, S = e.hideZero, C = S !== void 0 && S, w = e.innerRef, T = e.left, E = T === void 0 ? 0 : T, D = e.numTicks, O = D === void 0 ? 10 : D, k = e.orientation, A = k === void 0 ? a.bottom : k, j = e.rangePadding, M = j === void 0 ? 0 : j, N = e.scale, P = e.tickFormat, F = e.tickLength, I = F === void 0 ? 8 : F, L = e.tickValues, R = e.top, z = R === void 0 ? 0 : R, B = h(e, p), V = P ?? c(N), H = A === a.left, U = A === a.top, W = U || A === a.bottom, G = s(N), K = H || U ? -1 : 1, q = N.range(), J = u(M), Y = l({
49
49
  x: Number(q[0]) + .5 - J.start,
50
50
  y: 0
51
51
  }, W), X = l({
@@ -1,4 +1,4 @@
1
- import { Point as e } from "../../../../../../@visx_point@3.12.0/node_modules/@visx/point/esm/Point.js";
1
+ import e from "../../../../../../@visx_point@3.12.0/node_modules/@visx/point/esm/Point.js";
2
2
  //#region ../../../node_modules/.bun/@visx+axis@3.12.0+f4eacebf2041cd4f/node_modules/@visx/axis/esm/utils/createPoint.js
3
3
  function t(t, n) {
4
4
  var r = t.x, i = t.y;
@@ -3,7 +3,7 @@ import { require_classnames as t } from "../../../../../../classnames@2.5.1/node
3
3
  import n from "../../../../../../@visx_group@3.12.0_f4eacebf2041cd4f/node_modules/@visx/group/esm/Group.js";
4
4
  import r from "../../../../../../@visx_scale@3.12.0/node_modules/@visx/scale/esm/utils/coerceNumber.js";
5
5
  import i from "../../../../../../@visx_scale@3.12.0/node_modules/@visx/scale/esm/utils/getTicks.js";
6
- import { Point as a } from "../../../../../../@visx_point@3.12.0/node_modules/@visx/point/esm/Point.js";
6
+ import a from "../../../../../../@visx_point@3.12.0/node_modules/@visx/point/esm/Point.js";
7
7
  import { require_Line as o } from "../../../../../../@visx_shape@3.12.0_f4eacebf2041cd4f/node_modules/@visx/shape/lib/shapes/Line.js";
8
8
  import s from "../utils/getScaleBandwidth.js";
9
9
  import c from "react";
@@ -3,7 +3,7 @@ import { require_classnames as t } from "../../../../../../classnames@2.5.1/node
3
3
  import n from "../../../../../../@visx_group@3.12.0_f4eacebf2041cd4f/node_modules/@visx/group/esm/Group.js";
4
4
  import r from "../../../../../../@visx_scale@3.12.0/node_modules/@visx/scale/esm/utils/coerceNumber.js";
5
5
  import i from "../../../../../../@visx_scale@3.12.0/node_modules/@visx/scale/esm/utils/getTicks.js";
6
- import { Point as a } from "../../../../../../@visx_point@3.12.0/node_modules/@visx/point/esm/Point.js";
6
+ import a from "../../../../../../@visx_point@3.12.0/node_modules/@visx/point/esm/Point.js";
7
7
  import { require_Line as o } from "../../../../../../@visx_shape@3.12.0_f4eacebf2041cd4f/node_modules/@visx/shape/lib/shapes/Line.js";
8
8
  import s from "../utils/getScaleBandwidth.js";
9
9
  import c from "react";
@@ -15,4 +15,4 @@ var e = /*#__PURE__*/ function() {
15
15
  }, e;
16
16
  }();
17
17
  //#endregion
18
- export { e as Point };
18
+ export { e as default };
@@ -26,7 +26,7 @@ function c(e) {
26
26
  return typeof e == "number" && Number.isFinite(e) || typeof e == "string";
27
27
  }
28
28
  function l(e) {
29
- var t = e.verticalAnchor, l = t === void 0 ? "end" : t, u = e.scaleToFit, d = u === void 0 ? !1 : u, f = e.angle, p = e.width, m = e.lineHeight, h = m === void 0 ? "1em" : m, g = e.capHeight, _ = g === void 0 ? "0.71em" : g, v = e.children, y = e.style, b = o(e, a), x = b.x, S = x === void 0 ? 0 : x, C = b.y, w = C === void 0 ? 0 : C, T = !c(S) || !c(w), E = r(function() {
29
+ var t = e.verticalAnchor, l = t === void 0 ? "end" : t, u = e.scaleToFit, d = u !== void 0 && u, f = e.angle, p = e.width, m = e.lineHeight, h = m === void 0 ? "1em" : m, g = e.capHeight, _ = g === void 0 ? "0.71em" : g, v = e.children, y = e.style, b = o(e, a), x = b.x, S = x === void 0 ? 0 : x, C = b.y, w = C === void 0 ? 0 : C, T = !c(S) || !c(w), E = r(function() {
30
30
  return {
31
31
  wordsWithWidth: (v == null ? [] : v.toString().split(/(?:(?!\u00A0+)\s+)/)).map(function(e) {
32
32
  return {
@@ -0,0 +1,8 @@
1
+ import { __exportAll as e, __reExport as t } from "../../../../../../../_virtual/_rolldown/runtime.js";
2
+ export * from "d3-shape";
3
+ //#region ../../../node_modules/.bun/@visx+vendor@4.0.0/node_modules/@visx/vendor/esm/d3-shape.js
4
+ var n = /* @__PURE__ */ e({});
5
+ import * as r from "d3-shape";
6
+ t(n, r);
7
+ //#endregion
8
+ export { n as d3_shape_exports };
@@ -13,4 +13,4 @@ function t() {
13
13
  return i;
14
14
  }
15
15
  //#endregion
16
- export { t as default };
16
+ export { t as clsx, t as default };
@@ -443,17 +443,17 @@ ${T.current.stack}
443
443
  var be = ye;
444
444
  function xe(e) {
445
445
  let { children: n, context: r, serverState: i, store: a } = e, o = t.useMemo(() => {
446
- let t = {
446
+ let t = R(a), n = {
447
447
  store: a,
448
- subscription: R(a),
448
+ subscription: t,
449
449
  getServerState: i ? () => i : void 0
450
450
  };
451
- if (process.env.NODE_ENV === "production") return t;
451
+ if (process.env.NODE_ENV === "production") return n;
452
452
  {
453
- let { identityFunctionCheck: n = "once", stabilityCheck: r = "once" } = e;
454
- return /* @__PURE__ */ Object.assign(t, {
453
+ let { identityFunctionCheck: t = "once", stabilityCheck: r = "once" } = e;
454
+ return /* @__PURE__ */ Object.assign(n, {
455
455
  stabilityCheck: r,
456
- identityFunctionCheck: n
456
+ identityFunctionCheck: t
457
457
  });
458
458
  }
459
459
  }, [a, i]), s = t.useMemo(() => a.getState(), [a]);
@@ -468,4 +468,4 @@ function xe(e) {
468
468
  }
469
469
  var Se = xe;
470
470
  //#endregion
471
- export { Se as Provider_default, be as connect };
471
+ export { Se as Provider, Z as ReactReduxContext, be as connect, V as shallowEqual };
@@ -182,4 +182,4 @@ function x(t, a = {}) {
182
182
  };
183
183
  }
184
184
  //#endregion
185
- export { x as C, t as M };
185
+ export { t as ActionCreators, e as ActionTypes, x as default, r as isHistory, i as newHistory, n as parseActions };
@@ -45,7 +45,7 @@ function s(e) {
45
45
  return e instanceof Error || typeof e.message == "string" && e.constructor && typeof e.constructor.stackTraceLimit == "number";
46
46
  }
47
47
  function c(e) {
48
- return e instanceof Date ? !0 : typeof e.toDateString == "function" && typeof e.getDate == "function" && typeof e.setDate == "function";
48
+ return e instanceof Date || typeof e.toDateString == "function" && typeof e.getDate == "function" && typeof e.setDate == "function";
49
49
  }
50
50
  function l(e) {
51
51
  let t = typeof e;
@@ -195,4 +195,4 @@ function g(...t) {
195
195
  };
196
196
  }
197
197
  //#endregion
198
- export { g as applyMiddleware, m as combineReducers, u as createStore };
198
+ export { r as __DO_NOT_USE__ActionTypes, g as applyMiddleware, m as combineReducers, h as compose, u as createStore, i as isPlainObject };
@@ -152,4 +152,4 @@ b.propTypes = {
152
152
  value: n.string
153
153
  };
154
154
  //#endregion
155
- export { y as default };
155
+ export { h as MiniButton, y as ToggleBar, y as default };
package/dist/tool-menu.js CHANGED
@@ -1,5 +1,5 @@
1
- import e from "./node_modules/.bun/clsx@2.1.1/node_modules/clsx/dist/clsx.js";
2
- import t from "./toggle-bar.js";
1
+ import { clsx as e } from "./node_modules/.bun/clsx@2.1.1/node_modules/clsx/dist/clsx.js";
2
+ import { ToggleBar as t } from "./toggle-bar.js";
3
3
  import n from "react";
4
4
  import r from "prop-types";
5
5
  import { jsx as i } from "react/jsx-runtime";
@@ -38,4 +38,4 @@ var a = class extends n.Component {
38
38
  }
39
39
  };
40
40
  //#endregion
41
- export { a as default };
41
+ export { a as ToolMenu, a as default };
@@ -1,5 +1,5 @@
1
1
  import { bounds as e, point as t } from "../../utils.js";
2
- import n from "../../node_modules/.bun/clsx@2.1.1/node_modules/clsx/dist/clsx.js";
2
+ import { clsx as n } from "../../node_modules/.bun/clsx@2.1.1/node_modules/clsx/dist/clsx.js";
3
3
  import { correct as r, disabled as i, disabledSecondary as a, incorrect as o, missing as s } from "../shared/styles.js";
4
4
  import c from "react";
5
5
  import l from "prop-types";
@@ -69,4 +69,4 @@ var h = class extends c.Component {
69
69
  fromDelta: (e, n) => t(e).add(t(n))
70
70
  })(v);
71
71
  //#endregion
72
- export { y as default };
72
+ export { v as BgCircle, y as default };
@@ -63,11 +63,16 @@ export declare class RawBaseCircle extends React.Component {
63
63
  static defaultProps: {
64
64
  onClick: () => {};
65
65
  };
66
+ state: {
67
+ editingLabel: null;
68
+ };
69
+ componentDidUpdate(prevProps: any): void;
66
70
  onChangePoint: any;
67
71
  dragFrom: any;
68
72
  dragTo: any;
69
73
  dragCircle: any;
70
74
  labelChange: any;
75
+ stopEditingLabel: any;
71
76
  clickPoint: any;
72
77
  input: {};
73
78
  render(): React.JSX.Element;