@pie-lib/graphing 4.0.5-next.31 → 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 (93) 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_text@3.12.0_f4eacebf2041cd4f/node_modules/@visx/text/esm/util/getStringWidth.js +1 -1
  22. package/dist/node_modules/.bun/@visx_vendor@4.0.0/node_modules/@visx/vendor/esm/d3-shape.js +8 -0
  23. package/dist/node_modules/.bun/clsx@2.1.1/node_modules/clsx/dist/clsx.js +1 -1
  24. package/dist/node_modules/.bun/{lodash@4.17.21 → lodash@4.18.1}/node_modules/lodash/_Hash.js +1 -1
  25. package/dist/node_modules/.bun/{lodash@4.17.21 → lodash@4.18.1}/node_modules/lodash/_ListCache.js +1 -1
  26. package/dist/node_modules/.bun/{lodash@4.17.21 → lodash@4.18.1}/node_modules/lodash/_Map.js +1 -1
  27. package/dist/node_modules/.bun/{lodash@4.17.21 → lodash@4.18.1}/node_modules/lodash/_MapCache.js +1 -1
  28. package/dist/node_modules/.bun/{lodash@4.17.21 → lodash@4.18.1}/node_modules/lodash/_Symbol.js +1 -1
  29. package/dist/node_modules/.bun/{lodash@4.17.21 → lodash@4.18.1}/node_modules/lodash/_assocIndexOf.js +1 -1
  30. package/dist/node_modules/.bun/{lodash@4.17.21 → lodash@4.18.1}/node_modules/lodash/_baseGetTag.js +1 -1
  31. package/dist/node_modules/.bun/{lodash@4.17.21 → lodash@4.18.1}/node_modules/lodash/_baseIsNative.js +1 -1
  32. package/dist/node_modules/.bun/{lodash@4.17.21 → lodash@4.18.1}/node_modules/lodash/_coreJsData.js +1 -1
  33. package/dist/node_modules/.bun/{lodash@4.17.21 → lodash@4.18.1}/node_modules/lodash/_freeGlobal.js +1 -1
  34. package/dist/node_modules/.bun/{lodash@4.17.21 → lodash@4.18.1}/node_modules/lodash/_getMapData.js +1 -1
  35. package/dist/node_modules/.bun/{lodash@4.17.21 → lodash@4.18.1}/node_modules/lodash/_getNative.js +1 -1
  36. package/dist/node_modules/.bun/{lodash@4.17.21 → lodash@4.18.1}/node_modules/lodash/_getRawTag.js +1 -1
  37. package/dist/node_modules/.bun/{lodash@4.17.21 → lodash@4.18.1}/node_modules/lodash/_getValue.js +1 -1
  38. package/dist/node_modules/.bun/{lodash@4.17.21 → lodash@4.18.1}/node_modules/lodash/_hashClear.js +1 -1
  39. package/dist/node_modules/.bun/{lodash@4.17.21 → lodash@4.18.1}/node_modules/lodash/_hashDelete.js +1 -1
  40. package/dist/node_modules/.bun/{lodash@4.17.21 → lodash@4.18.1}/node_modules/lodash/_hashGet.js +1 -1
  41. package/dist/node_modules/.bun/{lodash@4.17.21 → lodash@4.18.1}/node_modules/lodash/_hashHas.js +1 -1
  42. package/dist/node_modules/.bun/{lodash@4.17.21 → lodash@4.18.1}/node_modules/lodash/_hashSet.js +1 -1
  43. package/dist/node_modules/.bun/{lodash@4.17.21 → lodash@4.18.1}/node_modules/lodash/_isKeyable.js +1 -1
  44. package/dist/node_modules/.bun/{lodash@4.17.21 → lodash@4.18.1}/node_modules/lodash/_isMasked.js +1 -1
  45. package/dist/node_modules/.bun/{lodash@4.17.21 → lodash@4.18.1}/node_modules/lodash/_listCacheClear.js +1 -1
  46. package/dist/node_modules/.bun/{lodash@4.17.21 → lodash@4.18.1}/node_modules/lodash/_listCacheDelete.js +1 -1
  47. package/dist/node_modules/.bun/{lodash@4.17.21 → lodash@4.18.1}/node_modules/lodash/_listCacheGet.js +1 -1
  48. package/dist/node_modules/.bun/{lodash@4.17.21 → lodash@4.18.1}/node_modules/lodash/_listCacheHas.js +1 -1
  49. package/dist/node_modules/.bun/{lodash@4.17.21 → lodash@4.18.1}/node_modules/lodash/_listCacheSet.js +1 -1
  50. package/dist/node_modules/.bun/{lodash@4.17.21 → lodash@4.18.1}/node_modules/lodash/_mapCacheClear.js +1 -1
  51. package/dist/node_modules/.bun/{lodash@4.17.21 → lodash@4.18.1}/node_modules/lodash/_mapCacheDelete.js +1 -1
  52. package/dist/node_modules/.bun/{lodash@4.17.21 → lodash@4.18.1}/node_modules/lodash/_mapCacheGet.js +1 -1
  53. package/dist/node_modules/.bun/{lodash@4.17.21 → lodash@4.18.1}/node_modules/lodash/_mapCacheHas.js +1 -1
  54. package/dist/node_modules/.bun/{lodash@4.17.21 → lodash@4.18.1}/node_modules/lodash/_mapCacheSet.js +1 -1
  55. package/dist/node_modules/.bun/{lodash@4.17.21 → lodash@4.18.1}/node_modules/lodash/_nativeCreate.js +1 -1
  56. package/dist/node_modules/.bun/{lodash@4.17.21 → lodash@4.18.1}/node_modules/lodash/_objectToString.js +1 -1
  57. package/dist/node_modules/.bun/{lodash@4.17.21 → lodash@4.18.1}/node_modules/lodash/_root.js +1 -1
  58. package/dist/node_modules/.bun/{lodash@4.17.21 → lodash@4.18.1}/node_modules/lodash/_toSource.js +1 -1
  59. package/dist/node_modules/.bun/{lodash@4.17.21 → lodash@4.18.1}/node_modules/lodash/eq.js +1 -1
  60. package/dist/node_modules/.bun/{lodash@4.17.21 → lodash@4.18.1}/node_modules/lodash/isFunction.js +1 -1
  61. package/dist/node_modules/.bun/{lodash@4.17.21 → lodash@4.18.1}/node_modules/lodash/isObject.js +1 -1
  62. package/dist/node_modules/.bun/{lodash@4.17.21 → lodash@4.18.1}/node_modules/lodash/memoize.js +1 -1
  63. package/dist/node_modules/.bun/react-redux@9.3.0_9e2203c65d1d5fa1/node_modules/react-redux/dist/react-redux.js +7 -7
  64. package/dist/node_modules/.bun/redux-undo@1.1.0/node_modules/redux-undo/dist/redux-undo.js +1 -1
  65. package/dist/node_modules/.bun/redux@5.0.1/node_modules/redux/dist/redux.js +2 -2
  66. package/dist/toggle-bar.js +1 -1
  67. package/dist/tool-menu.js +3 -3
  68. package/dist/tools/circle/bg-circle.js +2 -2
  69. package/dist/tools/circle/component.d.ts +5 -0
  70. package/dist/tools/circle/component.js +30 -17
  71. package/dist/tools/index.js +1 -1
  72. package/dist/tools/line/component.js +2 -2
  73. package/dist/tools/point/component.d.ts +2 -0
  74. package/dist/tools/point/component.js +16 -10
  75. package/dist/tools/point/index.js +1 -1
  76. package/dist/tools/polygon/component.d.ts +5 -0
  77. package/dist/tools/polygon/component.js +27 -18
  78. package/dist/tools/polygon/index.js +1 -1
  79. package/dist/tools/polygon/line.js +1 -1
  80. package/dist/tools/polygon/polygon.js +3 -3
  81. package/dist/tools/ray/component.js +2 -2
  82. package/dist/tools/segment/component.js +1 -1
  83. package/dist/tools/shared/line/index.d.ts +10 -4
  84. package/dist/tools/shared/line/index.js +27 -14
  85. package/dist/tools/shared/line/line-path.js +2 -2
  86. package/dist/tools/shared/line/with-root-edge.d.ts +10 -4
  87. package/dist/tools/shared/line/with-root-edge.js +3 -3
  88. package/dist/tools/shared/point/base-point.js +1 -1
  89. package/dist/tools/vector/component.js +1 -1
  90. package/dist/undo-redo.js +2 -2
  91. package/dist/utils.js +1 -1
  92. package/package.json +15 -10
  93. 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 {
@@ -1,5 +1,5 @@
1
1
  import { __toESM as e } from "../../../../../../../../_virtual/_rolldown/runtime.js";
2
- import { require_memoize as t } from "../../../../../../lodash@4.17.21/node_modules/lodash/memoize.js";
2
+ import { require_memoize as t } from "../../../../../../lodash@4.18.1/node_modules/lodash/memoize.js";
3
3
  //#region ../../../node_modules/.bun/@visx+text@3.12.0+f4eacebf2041cd4f/node_modules/@visx/text/esm/util/getStringWidth.js
4
4
  var n = /* @__PURE__ */ e(t()), r = "__react_svg_text_measurement_id";
5
5
  function i(e, t) {
@@ -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 };
@@ -4,7 +4,7 @@ import { require__hashDelete as n } from "./_hashDelete.js";
4
4
  import { require__hashGet as r } from "./_hashGet.js";
5
5
  import { require__hashHas as i } from "./_hashHas.js";
6
6
  import { require__hashSet as a } from "./_hashSet.js";
7
- //#region ../../../node_modules/.bun/lodash@4.17.21/node_modules/lodash/_Hash.js
7
+ //#region ../../../node_modules/.bun/lodash@4.18.1/node_modules/lodash/_Hash.js
8
8
  var o = /* @__PURE__ */ e(((e, o) => {
9
9
  var s = t(), c = n(), l = r(), u = i(), d = a();
10
10
  function f(e) {
@@ -4,7 +4,7 @@ import { require__listCacheDelete as n } from "./_listCacheDelete.js";
4
4
  import { require__listCacheGet as r } from "./_listCacheGet.js";
5
5
  import { require__listCacheHas as i } from "./_listCacheHas.js";
6
6
  import { require__listCacheSet as a } from "./_listCacheSet.js";
7
- //#region ../../../node_modules/.bun/lodash@4.17.21/node_modules/lodash/_ListCache.js
7
+ //#region ../../../node_modules/.bun/lodash@4.18.1/node_modules/lodash/_ListCache.js
8
8
  var o = /* @__PURE__ */ e(((e, o) => {
9
9
  var s = t(), c = n(), l = r(), u = i(), d = a();
10
10
  function f(e) {
@@ -1,7 +1,7 @@
1
1
  import { __commonJSMin as e } from "../../../../../_virtual/_rolldown/runtime.js";
2
2
  import { require__root as t } from "./_root.js";
3
3
  import { require__getNative as n } from "./_getNative.js";
4
- //#region ../../../node_modules/.bun/lodash@4.17.21/node_modules/lodash/_Map.js
4
+ //#region ../../../node_modules/.bun/lodash@4.18.1/node_modules/lodash/_Map.js
5
5
  var r = /* @__PURE__ */ e(((e, r) => {
6
6
  r.exports = n()(t(), "Map");
7
7
  }));
@@ -4,7 +4,7 @@ import { require__mapCacheDelete as n } from "./_mapCacheDelete.js";
4
4
  import { require__mapCacheGet as r } from "./_mapCacheGet.js";
5
5
  import { require__mapCacheHas as i } from "./_mapCacheHas.js";
6
6
  import { require__mapCacheSet as a } from "./_mapCacheSet.js";
7
- //#region ../../../node_modules/.bun/lodash@4.17.21/node_modules/lodash/_MapCache.js
7
+ //#region ../../../node_modules/.bun/lodash@4.18.1/node_modules/lodash/_MapCache.js
8
8
  var o = /* @__PURE__ */ e(((e, o) => {
9
9
  var s = t(), c = n(), l = r(), u = i(), d = a();
10
10
  function f(e) {
@@ -1,6 +1,6 @@
1
1
  import { __commonJSMin as e } from "../../../../../_virtual/_rolldown/runtime.js";
2
2
  import { require__root as t } from "./_root.js";
3
- //#region ../../../node_modules/.bun/lodash@4.17.21/node_modules/lodash/_Symbol.js
3
+ //#region ../../../node_modules/.bun/lodash@4.18.1/node_modules/lodash/_Symbol.js
4
4
  var n = /* @__PURE__ */ e(((e, n) => {
5
5
  n.exports = t().Symbol;
6
6
  }));
@@ -1,6 +1,6 @@
1
1
  import { __commonJSMin as e } from "../../../../../_virtual/_rolldown/runtime.js";
2
2
  import { require_eq as t } from "./eq.js";
3
- //#region ../../../node_modules/.bun/lodash@4.17.21/node_modules/lodash/_assocIndexOf.js
3
+ //#region ../../../node_modules/.bun/lodash@4.18.1/node_modules/lodash/_assocIndexOf.js
4
4
  var n = /* @__PURE__ */ e(((e, n) => {
5
5
  var r = t();
6
6
  function i(e, t) {
@@ -2,7 +2,7 @@ import { __commonJSMin as e } from "../../../../../_virtual/_rolldown/runtime.js
2
2
  import { require__Symbol as t } from "./_Symbol.js";
3
3
  import { require__getRawTag as n } from "./_getRawTag.js";
4
4
  import { require__objectToString as r } from "./_objectToString.js";
5
- //#region ../../../node_modules/.bun/lodash@4.17.21/node_modules/lodash/_baseGetTag.js
5
+ //#region ../../../node_modules/.bun/lodash@4.18.1/node_modules/lodash/_baseGetTag.js
6
6
  var i = /* @__PURE__ */ e(((e, i) => {
7
7
  var a = t(), o = n(), s = r(), c = "[object Null]", l = "[object Undefined]", u = a ? a.toStringTag : void 0;
8
8
  function d(e) {
@@ -3,7 +3,7 @@ import { require_isObject as t } from "./isObject.js";
3
3
  import { require_isFunction as n } from "./isFunction.js";
4
4
  import { require__isMasked as r } from "./_isMasked.js";
5
5
  import { require__toSource as i } from "./_toSource.js";
6
- //#region ../../../node_modules/.bun/lodash@4.17.21/node_modules/lodash/_baseIsNative.js
6
+ //#region ../../../node_modules/.bun/lodash@4.18.1/node_modules/lodash/_baseIsNative.js
7
7
  var a = /* @__PURE__ */ e(((e, a) => {
8
8
  var o = n(), s = r(), c = t(), l = i(), u = /[\\^$.*+?()[\]{}|]/g, d = /^\[object .+?Constructor\]$/, f = Function.prototype, p = Object.prototype, m = f.toString, h = p.hasOwnProperty, g = RegExp("^" + m.call(h).replace(u, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$");
9
9
  function _(e) {
@@ -1,6 +1,6 @@
1
1
  import { __commonJSMin as e } from "../../../../../_virtual/_rolldown/runtime.js";
2
2
  import { require__root as t } from "./_root.js";
3
- //#region ../../../node_modules/.bun/lodash@4.17.21/node_modules/lodash/_coreJsData.js
3
+ //#region ../../../node_modules/.bun/lodash@4.18.1/node_modules/lodash/_coreJsData.js
4
4
  var n = /* @__PURE__ */ e(((e, n) => {
5
5
  n.exports = t()["__core-js_shared__"];
6
6
  }));