@pie-lib/graphing-solution-set 5.0.1-next.20261004041321 → 5.0.1-next.20261004165705

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,9 +1,9 @@
1
1
  import "react";
2
2
  import e from "prop-types";
3
- import { Fragment as t, jsx as n, jsxs as r } from "react/jsx-runtime";
4
- import { styled as i } from "@mui/material/styles";
5
- import * as a from "@pie-lib/render-ui";
6
- import { InputContainer as o, color as s } from "@pie-lib/render-ui";
3
+ import * as t from "@pie-lib/render-ui";
4
+ import { InputContainer as n, color as r } from "@pie-lib/render-ui";
5
+ import { Fragment as i, jsx as a, jsxs as o } from "react/jsx-runtime";
6
+ import { styled as s } from "@mui/material/styles";
7
7
  import c from "@pie-lib/editable-html-tip-tap";
8
8
  import { Accordion as l, AccordionDetails as u, AccordionSummary as d, Typography as f } from "@mui/material";
9
9
  import p from "@mui/icons-material/ExpandMore";
@@ -15,49 +15,49 @@ function g(e) {
15
15
  function _(e, t) {
16
16
  return !e || g(e) ? e : g(e.default) ? e.default : t && g(e[t]) ? e[t] : t && g(e[t]?.default) ? e[t].default : e;
17
17
  }
18
- var v = _(o, "InputContainer") || _(x.InputContainer, "InputContainer"), y = a, b = y.default, x = b && typeof b == "object" ? b : y, S = i("div")(() => ({ width: "450px" })), C = i("div")(() => ({
18
+ var v = _(n, "InputContainer") || _(x.InputContainer, "InputContainer"), y = t, b = y.default, x = b && typeof b == "object" ? b : y, S = s("div")(() => ({ width: "450px" })), C = s("div")(() => ({
19
19
  display: "flex",
20
20
  flexDirection: "column",
21
21
  width: "100%"
22
- })), w = i("div")(() => ({
22
+ })), w = s("div")(() => ({
23
23
  display: "flex",
24
24
  flexDirection: "column",
25
25
  alignItems: "center"
26
- })), T = i("div")(() => ({
26
+ })), T = s("div")(() => ({
27
27
  display: "flex",
28
28
  justifyContent: "space-around",
29
29
  alignItems: "center"
30
- })), E = i("div")(({ theme: e }) => ({
30
+ })), E = s("div")(({ theme: e }) => ({
31
31
  width: "130px",
32
32
  margin: `${e.spacing(1)} ${e.spacing(.5)}`
33
- })), D = i("div")(({ theme: e }) => ({
33
+ })), D = s("div")(({ theme: e }) => ({
34
34
  width: "160px",
35
35
  margin: `${e.spacing(1)} ${e.spacing(.5)}`,
36
36
  "& .MuiFormControl-root": { width: "100%" }
37
- })), O = i("div")(({ theme: e }) => ({
37
+ })), O = s("div")(({ theme: e }) => ({
38
38
  width: "230px",
39
39
  margin: `${e.spacing(1)} ${e.spacing(.5)}`,
40
40
  "& .MuiFormControl-root": { width: "100%" }
41
- })), k = i(f)(({ theme: e }) => ({
41
+ })), k = s(f)(({ theme: e }) => ({
42
42
  fontStyle: "italic",
43
43
  margin: `${e.spacing(1)} 0`
44
- })), A = i("div")(() => ({
44
+ })), A = s("div")(() => ({
45
45
  display: "flex",
46
46
  justifyContent: "space-between",
47
47
  alignItems: "center"
48
- })), j = i(f)(() => ({ color: s.disabled() })), M = i("div")(({ theme: e }) => ({ paddingTop: e.spacing(2) })), N = (e) => {
49
- let { disabled: t, displayedFields: i, labelValue: a, labelValues: o, gridValue: s, gridValues: c, onChange: l } = e, { labelStep: u = {}, step: d = {} } = i;
50
- return /* @__PURE__ */ r(w, { children: [d && d.enabled && /* @__PURE__ */ n(D, { children: /* @__PURE__ */ n(m, {
48
+ })), j = s(f)(() => ({ color: r.disabled() })), M = s("div")(({ theme: e }) => ({ paddingTop: e.spacing(2) })), N = (e) => {
49
+ let { disabled: t, displayedFields: n, labelValue: r, labelValues: i, gridValue: s, gridValues: c, onChange: l } = e, { labelStep: u = {}, step: d = {} } = n;
50
+ return /* @__PURE__ */ o(w, { children: [d && d.enabled && /* @__PURE__ */ a(D, { children: /* @__PURE__ */ a(m, {
51
51
  label: d.label || "",
52
52
  value: s,
53
53
  customValues: c,
54
54
  variant: "outlined",
55
55
  disabled: t,
56
56
  onChange: (e, t) => l("step", t)
57
- }) }), u && u.enabled && /* @__PURE__ */ n(D, { children: /* @__PURE__ */ n(m, {
57
+ }) }), u && u.enabled && /* @__PURE__ */ a(D, { children: /* @__PURE__ */ a(m, {
58
58
  label: u.label || "",
59
- value: a,
60
- customValues: o,
59
+ value: r,
60
+ customValues: i,
61
61
  variant: "outlined",
62
62
  disabled: t,
63
63
  onChange: (e, t) => l("labelStep", t)
@@ -73,13 +73,13 @@ N.propTypes = {
73
73
  onChange: e.func
74
74
  };
75
75
  var P = (e) => {
76
- let { disabled: t, displayedFields: i, displayHeader: a, label: o, maxValue: s, minValue: l, onChange: u, type: d } = e, { axisLabel: p = {}, min: h = {}, max: g = {} } = i;
77
- return /* @__PURE__ */ r(w, { children: [
78
- a && /* @__PURE__ */ r(f, {
76
+ let { disabled: t, displayedFields: n, displayHeader: r, label: i, maxValue: s, minValue: l, onChange: u, type: d } = e, { axisLabel: p = {}, min: h = {}, max: g = {} } = n;
77
+ return /* @__PURE__ */ o(w, { children: [
78
+ r && /* @__PURE__ */ o(f, {
79
79
  variant: "subtitle2",
80
- children: [/* @__PURE__ */ n("i", { children: d === "domain" ? "x" : "y" }), "-axis"]
80
+ children: [/* @__PURE__ */ a("i", { children: d === "domain" ? "x" : "y" }), "-axis"]
81
81
  }),
82
- h && h.enabled && /* @__PURE__ */ n(D, { children: /* @__PURE__ */ n(m, {
82
+ h && h.enabled && /* @__PURE__ */ a(D, { children: /* @__PURE__ */ a(m, {
83
83
  label: h.label || "",
84
84
  value: l,
85
85
  min: -1e4,
@@ -88,7 +88,7 @@ var P = (e) => {
88
88
  disabled: t,
89
89
  onChange: (e, t) => u("min", t)
90
90
  }) }),
91
- g && g.enabled && /* @__PURE__ */ n(D, { children: /* @__PURE__ */ n(m, {
91
+ g && g.enabled && /* @__PURE__ */ a(D, { children: /* @__PURE__ */ a(m, {
92
92
  label: g.label || "",
93
93
  value: s,
94
94
  min: l + .05,
@@ -97,11 +97,11 @@ var P = (e) => {
97
97
  disabled: t,
98
98
  onChange: (e, t) => u("max", t)
99
99
  }) }),
100
- p && p.enabled && /* @__PURE__ */ n(D, { children: /* @__PURE__ */ n(v, {
100
+ p && p.enabled && /* @__PURE__ */ a(D, { children: /* @__PURE__ */ a(v, {
101
101
  label: p.label || "",
102
- children: /* @__PURE__ */ n(M, { children: /* @__PURE__ */ n(c, {
102
+ children: /* @__PURE__ */ a(M, { children: /* @__PURE__ */ a(c, {
103
103
  onChange: (e) => u("axisLabel", e),
104
- markup: o || "",
104
+ markup: i || "",
105
105
  charactersLimit: 5,
106
106
  onKeyDown: (e) => e.key === "Enter",
107
107
  activePlugins: [
@@ -125,10 +125,10 @@ P.propTypes = {
125
125
  onChange: e.func
126
126
  };
127
127
  var F = (e) => {
128
- let { domain: i, displayedFields: a = {}, gridValues: o = {}, includeAxes: s, labelValues: c = {}, onChange: g, onChangeView: _, range: v, size: y, sizeConstraints: b, standardGrid: x } = e, D = {
128
+ let { domain: t, displayedFields: n = {}, gridValues: r = {}, includeAxes: s, labelValues: c = {}, onChange: g, onChangeView: _, range: v, size: y, sizeConstraints: b, standardGrid: x } = e, D = {
129
129
  min: 2,
130
130
  max: 41
131
- }, { axisLabel: M = {}, dimensionsEnabled: F, includeAxesEnabled: I, labelStep: L = {}, min: R = {}, max: z = {}, standardGridEnabled: B, step: V = {} } = a || {}, H = R.enabled || z.enabled || M.enabled || V.enabled || L.enabled, U = {
131
+ }, { axisLabel: M = {}, dimensionsEnabled: F, includeAxesEnabled: I, labelStep: L = {}, min: R = {}, max: z = {}, standardGridEnabled: B, step: V = {} } = n || {}, H = R.enabled || z.enabled || M.enabled || V.enabled || L.enabled, U = {
132
132
  step: V,
133
133
  labelStep: L
134
134
  }, W = {
@@ -136,31 +136,31 @@ var F = (e) => {
136
136
  max: z,
137
137
  axisLabel: M
138
138
  }, G = (e) => {
139
- let t = (e) => {
140
- let t = e === "domain" ? i : v;
139
+ let n = (e) => {
140
+ let n = e === "domain" ? t : v;
141
141
  return {
142
142
  min: 1,
143
- max: t.max < D.min || t.max > D.max ? 16 : t.max,
143
+ max: n.max < D.min || n.max > D.max ? 16 : n.max,
144
144
  step: 1,
145
145
  labelStep: 0
146
146
  };
147
- }, n = {
148
- ...v,
149
- ...e ? { labelStep: 1 } : t("range")
150
147
  }, r = {
151
- ...i,
152
- ...e ? { labelStep: 1 } : t("domain")
148
+ ...v,
149
+ ...e ? { labelStep: 1 } : n("range")
150
+ }, i = {
151
+ ...t,
152
+ ...e ? { labelStep: 1 } : n("domain")
153
153
  };
154
154
  g({
155
155
  includeAxes: e,
156
- range: n,
157
- domain: r
156
+ range: r,
157
+ domain: i
158
158
  });
159
159
  }, K = (e) => {
160
160
  g({
161
161
  standardGrid: e,
162
162
  range: {
163
- ...i,
163
+ ...t,
164
164
  axisLabel: v.axisLabel
165
165
  },
166
166
  graph: {
@@ -174,24 +174,24 @@ var F = (e) => {
174
174
  [e]: t
175
175
  };
176
176
  x && (n.height = t), g({ graph: n });
177
- }, J = (e, t) => {
178
- i[e] = t, x && e !== "axisLabel" && (v[e] = t), g({
179
- domain: i,
177
+ }, J = (e, n) => {
178
+ t[e] = n, x && e !== "axisLabel" && (v[e] = n), g({
179
+ domain: t,
180
180
  range: v
181
181
  });
182
182
  }, Y = (e, t) => {
183
183
  v[e] = t, g({ range: v });
184
- }, X = /* @__PURE__ */ r(t, { children: [
185
- /* @__PURE__ */ r(T, { children: [/* @__PURE__ */ n(P, {
184
+ }, X = /* @__PURE__ */ o(i, { children: [
185
+ /* @__PURE__ */ o(T, { children: [/* @__PURE__ */ a(P, {
186
186
  displayedFields: W,
187
187
  displayHeader: H,
188
188
  type: "domain",
189
- minValue: i.min,
190
- maxValue: i.max,
191
- label: i.axisLabel,
189
+ minValue: t.min,
190
+ maxValue: t.max,
191
+ label: t.axisLabel,
192
192
  includeAxes: s,
193
193
  onChange: J
194
- }), /* @__PURE__ */ n(P, {
194
+ }), /* @__PURE__ */ a(P, {
195
195
  displayedFields: W,
196
196
  displayHeader: H,
197
197
  type: "range",
@@ -202,32 +202,32 @@ var F = (e) => {
202
202
  includeAxes: s,
203
203
  onChange: Y
204
204
  })] }),
205
- (R.enabled || z.enabled) && /* @__PURE__ */ n(k, { children: "If you want the axis to be visible, use a zero or negative Min Value, and a positive Max Value" }),
206
- (V.enabled || L.enabled) && /* @__PURE__ */ r(T, { children: [/* @__PURE__ */ n(N, {
205
+ (R.enabled || z.enabled) && /* @__PURE__ */ a(k, { children: "If you want the axis to be visible, use a zero or negative Min Value, and a positive Max Value" }),
206
+ (V.enabled || L.enabled) && /* @__PURE__ */ o(T, { children: [/* @__PURE__ */ a(N, {
207
207
  displayedFields: U,
208
- gridValue: i.step,
209
- labelValue: i.labelStep,
210
- gridValues: o.domain || [],
208
+ gridValue: t.step,
209
+ labelValue: t.labelStep,
210
+ gridValues: r.domain || [],
211
211
  labelValues: c.domain || [],
212
212
  onChange: J
213
- }), /* @__PURE__ */ n(N, {
213
+ }), /* @__PURE__ */ a(N, {
214
214
  disabled: x,
215
215
  displayedFields: U,
216
216
  gridValue: v.step,
217
217
  labelValue: v.labelStep,
218
- gridValues: o.range || [],
218
+ gridValues: r.range || [],
219
219
  labelValues: c.range || [],
220
220
  onChange: Y
221
221
  })] }),
222
- L.enabled && /* @__PURE__ */ n(k, { children: "For unnumbered gridlines, enter a label interval of 0" })
223
- ] }), Z = z.enabled ? /* @__PURE__ */ r(w, { children: [/* @__PURE__ */ n(O, { children: /* @__PURE__ */ n(m, {
222
+ L.enabled && /* @__PURE__ */ a(k, { children: "For unnumbered gridlines, enter a label interval of 0" })
223
+ ] }), Z = z.enabled ? /* @__PURE__ */ o(w, { children: [/* @__PURE__ */ a(O, { children: /* @__PURE__ */ a(m, {
224
224
  label: "Number of Vertical Gridlines",
225
- value: i.max,
225
+ value: t.max,
226
226
  min: !s && D.min,
227
227
  max: !s && D.max,
228
228
  variant: "outlined",
229
229
  onChange: (e, t) => J("max", t)
230
- }) }), /* @__PURE__ */ n(O, { children: /* @__PURE__ */ n(m, {
230
+ }) }), /* @__PURE__ */ a(O, { children: /* @__PURE__ */ a(m, {
231
231
  label: "Number of Horizontal Gridlines",
232
232
  value: v.max,
233
233
  min: !s && D.min,
@@ -236,38 +236,38 @@ var F = (e) => {
236
236
  disabled: x,
237
237
  onChange: (e, t) => Y("max", t)
238
238
  }) })] }) : null;
239
- return /* @__PURE__ */ n(S, { children: /* @__PURE__ */ r(l, {
239
+ return /* @__PURE__ */ a(S, { children: /* @__PURE__ */ o(l, {
240
240
  onChange: _,
241
241
  TransitionProps: { timeout: {
242
242
  enter: 225,
243
243
  exit: 195
244
244
  } },
245
- children: [/* @__PURE__ */ n(d, {
246
- expandIcon: /* @__PURE__ */ n(p, {}),
247
- children: /* @__PURE__ */ n(f, {
245
+ children: [/* @__PURE__ */ a(d, {
246
+ expandIcon: /* @__PURE__ */ a(p, {}),
247
+ children: /* @__PURE__ */ a(f, {
248
248
  variant: "subtitle1",
249
249
  children: "Customize Grid Setup"
250
250
  })
251
- }), /* @__PURE__ */ n(u, { children: /* @__PURE__ */ r(C, { children: [
252
- I && /* @__PURE__ */ n(h, {
251
+ }), /* @__PURE__ */ a(u, { children: /* @__PURE__ */ o(C, { children: [
252
+ I && /* @__PURE__ */ a(h, {
253
253
  label: "Include axes and labels?",
254
254
  toggle: G,
255
255
  checked: s
256
256
  }),
257
- B && /* @__PURE__ */ n(h, {
257
+ B && /* @__PURE__ */ a(h, {
258
258
  label: "Constrain to standard coordinate grid?",
259
259
  toggle: K,
260
260
  checked: x
261
261
  }),
262
262
  s ? X : Z,
263
- F && /* @__PURE__ */ r(A, { children: [
264
- /* @__PURE__ */ r("div", { children: [/* @__PURE__ */ n(f, { children: "Dimensions(px)" }), /* @__PURE__ */ r(j, { children: [
263
+ F && /* @__PURE__ */ o(A, { children: [
264
+ /* @__PURE__ */ o("div", { children: [/* @__PURE__ */ a(f, { children: "Dimensions(px)" }), /* @__PURE__ */ o(j, { children: [
265
265
  "Min ",
266
266
  b.min,
267
267
  ", Max ",
268
268
  b.max
269
269
  ] })] }),
270
- /* @__PURE__ */ n(E, { children: /* @__PURE__ */ n(m, {
270
+ /* @__PURE__ */ a(E, { children: /* @__PURE__ */ a(m, {
271
271
  label: "Width",
272
272
  value: y.width,
273
273
  min: b.min,
@@ -276,7 +276,7 @@ var F = (e) => {
276
276
  variant: "outlined",
277
277
  onChange: (e, t) => q("width", t)
278
278
  }) }),
279
- /* @__PURE__ */ n(E, { children: /* @__PURE__ */ n(m, {
279
+ /* @__PURE__ */ a(E, { children: /* @__PURE__ */ a(m, {
280
280
  label: "Height",
281
281
  value: y.height,
282
282
  min: b.min,
package/dist/labels.js CHANGED
@@ -2,10 +2,10 @@ import { clsx as e } from "./node_modules/.bun/clsx@2.1.1/node_modules/clsx/dist
2
2
  import t from "react";
3
3
  import n from "prop-types";
4
4
  import { types as r } from "@pie-lib/plot";
5
- import { Fragment as i, jsx as a } from "react/jsx-runtime";
6
- import { styled as o } from "@mui/material/styles";
7
- import * as s from "@pie-lib/render-ui";
8
- import { Readable as c, color as l } from "@pie-lib/render-ui";
5
+ import * as i from "@pie-lib/render-ui";
6
+ import { Readable as a, color as o } from "@pie-lib/render-ui";
7
+ import { Fragment as s, jsx as c } from "react/jsx-runtime";
8
+ import { styled as l } from "@mui/material/styles";
9
9
  import u from "@pie-lib/editable-html-tip-tap";
10
10
  //#region src/labels.tsx
11
11
  function d(e) {
@@ -14,7 +14,7 @@ function d(e) {
14
14
  function f(e, t) {
15
15
  return !e || d(e) ? e : d(e.default) ? e.default : t && d(e[t]) ? e[t] : t && d(e[t]?.default) ? e[t].default : e;
16
16
  }
17
- var p = f(c, "Readable") || f(g.Readable, "Readable"), m = s, h = m.default, g = h && typeof h == "object" ? h : m, _ = {
17
+ var p = f(a, "Readable") || f(g.Readable, "Readable"), m = i, h = m.default, g = h && typeof h == "object" ? h : m, _ = {
18
18
  left: -90,
19
19
  top: 0,
20
20
  bottom: 0,
@@ -37,8 +37,8 @@ var p = f(c, "Readable") || f(g.Readable, "Readable"), m = s, h = m.default, g =
37
37
  axisLabel: `${b}-axisLabel`,
38
38
  disabledAxisLabel: `${b}-disabledAxisLabel`,
39
39
  bottomLabel: `${b}-bottomLabel`
40
- }, S = o("div")(({ theme: e }) => ({
41
- [`& .${x.label}`]: { fill: l.defaults.SECONDARY },
40
+ }, S = l("div")(({ theme: e }) => ({
41
+ [`& .${x.label}`]: { fill: o.defaults.SECONDARY },
42
42
  [`& .${x.axisLabel}`]: {
43
43
  fontSize: e.typography.fontSize - 2,
44
44
  textAlign: "center",
@@ -58,27 +58,27 @@ var p = f(c, "Readable") || f(g.Readable, "Readable"), m = s, h = m.default, g =
58
58
  };
59
59
  static defaultProps = { onChange: () => {} };
60
60
  render() {
61
- let { disabledLabel: t, placeholder: n, text: r, side: i, graphProps: o, onChange: s, mathMlOptions: c = {} } = this.props, { size: l, domain: d, range: f } = o, m = (l.height || 500) + (f.padding || 0) * 2, h = (l.width || 500) + (d.padding || 0) * 2, g = v(i, h, m), _ = i === "left" || i === "right" ? m : h, b = y(i, 36), C = i === "bottom" ? 58 : 54, w = [
61
+ let { disabledLabel: t, placeholder: n, text: r, side: i, graphProps: a, onChange: o, mathMlOptions: s = {} } = this.props, { size: l, domain: d, range: f } = a, m = (l.height || 500) + (f.padding || 0) * 2, h = (l.width || 500) + (d.padding || 0) * 2, g = v(i, h, m), _ = i === "left" || i === "right" ? m : h, b = y(i, 36), C = i === "bottom" ? 58 : 54, w = [
62
62
  "bold",
63
63
  "italic",
64
64
  "underline",
65
65
  "strikethrough",
66
66
  "math"
67
67
  ];
68
- return /* @__PURE__ */ a(S, { children: /* @__PURE__ */ a("foreignObject", {
68
+ return /* @__PURE__ */ c(S, { children: /* @__PURE__ */ c("foreignObject", {
69
69
  x: -(_ / 2),
70
70
  y: b,
71
71
  width: _,
72
72
  height: C,
73
73
  transform: g,
74
74
  textAnchor: "middle",
75
- children: /* @__PURE__ */ a(p, { children: /* @__PURE__ */ a(u, {
75
+ children: /* @__PURE__ */ c(p, { children: /* @__PURE__ */ c(u, {
76
76
  className: e({
77
77
  [x.bottomLabel]: i === "bottom",
78
78
  [x.disabledAxisLabel]: t
79
79
  }, x.axisLabel),
80
80
  markup: r || "",
81
- onChange: s,
81
+ onChange: o,
82
82
  placeholder: !t && n,
83
83
  toolbarOpts: {
84
84
  position: i === "bottom" ? "top" : "bottom",
@@ -86,7 +86,7 @@ var p = f(c, "Readable") || f(g.Readable, "Readable"), m = s, h = m.default, g =
86
86
  noBorder: !0
87
87
  },
88
88
  activePlugins: w,
89
- mathMlOptions: c
89
+ mathMlOptions: s
90
90
  }) })
91
91
  }) });
92
92
  }
@@ -113,21 +113,21 @@ var p = f(c, "Readable") || f(g.Readable, "Readable"), m = s, h = m.default, g =
113
113
  });
114
114
  };
115
115
  render() {
116
- let { disabledLabels: e, placeholders: t = {}, value: n = {}, graphProps: r, mathMlOptions: o = {} } = this.props;
117
- return /* @__PURE__ */ a(i, { children: [
116
+ let { disabledLabels: e, placeholders: t = {}, value: n = {}, graphProps: r, mathMlOptions: i = {} } = this.props;
117
+ return /* @__PURE__ */ c(s, { children: [
118
118
  "left",
119
119
  "top",
120
120
  "bottom",
121
121
  "right"
122
- ].map((i) => /* @__PURE__ */ a(C, {
123
- side: i,
124
- text: n[i],
122
+ ].map((a) => /* @__PURE__ */ c(C, {
123
+ side: a,
124
+ text: n[a],
125
125
  disabledLabel: e,
126
- placeholder: t[i],
126
+ placeholder: t[a],
127
127
  graphProps: r,
128
- onChange: (e) => this.onChangeLabel(e, i),
129
- mathMlOptions: o
130
- }, i)) });
128
+ onChange: (e) => this.onChangeLabel(e, a),
129
+ mathMlOptions: i
130
+ }, a)) });
131
131
  }
132
132
  });
133
133
  //#endregion
@@ -4,19 +4,19 @@ import { useDebounce as n } from "./use-debounce.js";
4
4
  import { useCallback as r, useEffect as i, useState as a } from "react";
5
5
  import o from "prop-types";
6
6
  import { types as s } from "@pie-lib/plot";
7
- import c from "@pie-lib/translator";
8
- import { jsx as l } from "react/jsx-runtime";
9
- import { styled as u } from "@mui/material/styles";
10
- import { color as d } from "@pie-lib/render-ui";
7
+ import { color as c } from "@pie-lib/render-ui";
8
+ import l from "@pie-lib/translator";
9
+ import { jsx as u } from "react/jsx-runtime";
10
+ import { styled as d } from "@mui/material/styles";
11
11
  //#region src/mark-label.tsx
12
- var { translator: f } = c, p = u(t, { shouldForwardProp: (e) => !["disabled", "markDisabled"].includes(e) })(({ theme: e, disabled: t, markDisabled: n }) => ({ "& input": {
12
+ var { translator: f } = l, p = d(t, { shouldForwardProp: (e) => !["disabled", "markDisabled"].includes(e) })(({ theme: e, disabled: t, markDisabled: n }) => ({ "& input": {
13
13
  float: "right",
14
14
  padding: e.spacing(.5),
15
15
  fontFamily: e.typography.fontFamily,
16
16
  fontSize: e.typography.fontSize,
17
- border: `solid 1px ${t ? d.defaults.PRIMARY_DARK : n ? d.disabled() : d.defaults.SECONDARY}`,
17
+ border: `solid 1px ${t ? c.defaults.PRIMARY_DARK : n ? c.disabled() : c.defaults.SECONDARY}`,
18
18
  borderRadius: "3px",
19
- color: n ? d.disabled() : d.defaults.PRIMARY_DARK,
19
+ color: n ? c.disabled() : c.defaults.PRIMARY_DARK,
20
20
  background: t || n ? e.palette.background.paper : "transparent"
21
21
  } })), m = (e, t, n) => {
22
22
  n ||= {
@@ -49,11 +49,11 @@ var { translator: f } = c, p = u(t, { shouldForwardProp: (e) => !["disabled", "m
49
49
  };
50
50
  }
51
51
  }, g = (t) => {
52
- let [o, s] = a(null), c = r((e) => s(e)), { mark: u, graphProps: d, disabled: g, inputRef: _, language: v } = t, [y, b] = a(u.label), x = (e) => b(e.target.value), S = n(y, 200);
52
+ let [o, s] = a(null), c = r((e) => s(e)), { mark: l, graphProps: d, disabled: g, inputRef: _, language: v } = t, [y, b] = a(l.label), x = (e) => b(e.target.value), S = n(y, 200);
53
53
  i(() => {
54
- b(u.label);
55
- }, [u.label]), i(() => {
56
- typeof S == "string" && S !== u.label && t.onChange(S);
54
+ b(l.label);
55
+ }, [l.label]), i(() => {
56
+ typeof S == "string" && S !== l.label && t.onChange(S);
57
57
  }, [S]);
58
58
  let C = o ? o.getBoundingClientRect() : {
59
59
  width: 0,
@@ -61,19 +61,19 @@ var { translator: f } = c, p = u(t, { shouldForwardProp: (e) => !["disabled", "m
61
61
  }, w = {
62
62
  position: "fixed",
63
63
  pointerEvents: "auto",
64
- ...h(d, u, C, m(d, u, C))
65
- }, T = g || u.disabled;
66
- return /* @__PURE__ */ l(p, {
64
+ ...h(d, l, C, m(d, l, C))
65
+ }, T = g || l.disabled;
66
+ return /* @__PURE__ */ u(p, {
67
67
  inputRef: (e) => {
68
68
  c(e), _(e);
69
69
  },
70
- "aria-label": Number.isFinite(u.x) && Number.isFinite(u.y) ? f.t("graphing.markLabel", {
70
+ "aria-label": Number.isFinite(l.x) && Number.isFinite(l.y) ? f.t("graphing.markLabel", {
71
71
  lng: v,
72
- x: e(u.x),
73
- y: e(u.y)
72
+ x: e(l.x),
73
+ y: e(l.y)
74
74
  }) : f.t("graphing.label", { lng: v }),
75
75
  disabled: T,
76
- markDisabled: u.disabled,
76
+ markDisabled: l.disabled,
77
77
  value: y,
78
78
  style: w,
79
79
  onChange: x
package/dist/tool-menu.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import e from "react";
2
2
  import t from "prop-types";
3
- import { uniqueId as n } from "@pie-element/shared-lodash";
3
+ import { createUniqueId as n } from "@pie-lib/render-ui";
4
4
  import { jsx as r, jsxs as i } from "react/jsx-runtime";
5
5
  import { styled as a } from "@mui/material/styles";
6
6
  import { Button as o, Radio as s, Typography as c } from "@mui/material";
@@ -11,7 +11,7 @@ var l = class extends e.Component {
11
11
  disabled: t.bool,
12
12
  onChange: t.func
13
13
  };
14
- idPrefix = n("gss-tool-menu-");
14
+ idPrefix = n("gss-tool-menu");
15
15
  onChangeRadioValue = (e) => {
16
16
  let { gssLineData: t, onChange: n } = this.props, r = t.selectedTool;
17
17
  t.selectedTool = e.target.value, n(t, r);
@@ -30,7 +30,7 @@ var l = class extends e.Component {
30
30
  children: [/* @__PURE__ */ i("div", {
31
31
  className: "radioFieldInner",
32
32
  children: [/* @__PURE__ */ r(s, {
33
- name: "select-line-radio-buttons",
33
+ name: `${this.idPrefix}-line`,
34
34
  onChange: this.onChangeRadioValue,
35
35
  value: "lineA",
36
36
  disabled: !!t,
@@ -68,7 +68,7 @@ var l = class extends e.Component {
68
68
  children: [/* @__PURE__ */ i("div", {
69
69
  className: "radioFieldInner",
70
70
  children: [/* @__PURE__ */ r(s, {
71
- name: "select-line-radio-buttons",
71
+ name: `${this.idPrefix}-line`,
72
72
  onChange: this.onChangeRadioValue,
73
73
  value: "lineB",
74
74
  disabled: !!t,
@@ -106,7 +106,7 @@ var l = class extends e.Component {
106
106
  children: /* @__PURE__ */ i("div", {
107
107
  className: "radioFieldInner",
108
108
  children: [/* @__PURE__ */ r(s, {
109
- name: "select-line-radio-buttons",
109
+ name: `${this.idPrefix}-line`,
110
110
  onChange: this.onChangeRadioValue,
111
111
  value: "solutionSet",
112
112
  disabled: !!t,
@@ -1,9 +1,10 @@
1
1
  import { getAdjustedGraphLimits as e, thinnerShapesNeeded as t } from "../../utils.js";
2
- import { ArrowMarker as n, genUid as r } from "../shared/arrow-head.js";
3
- import { lineBase as i, lineToolComponent as a, styles as o } from "../shared/line/index.js";
2
+ import { ArrowMarker as n } from "../shared/arrow-head.js";
3
+ import { lineBase as r, lineToolComponent as i, styles as a } from "../shared/line/index.js";
4
4
  import "react";
5
- import s from "prop-types";
6
- import { trig as c, types as l } from "@pie-lib/plot";
5
+ import o from "prop-types";
6
+ import { trig as s, types as c } from "@pie-lib/plot";
7
+ import { useUniqueId as l } from "@pie-lib/render-ui";
7
8
  import { jsx as u, jsxs as d } from "react/jsx-runtime";
8
9
  import { styled as f } from "@mui/material/styles";
9
10
  //#region src/tools/line/component.tsx
@@ -12,22 +13,22 @@ var p = f("line", { shouldForwardProp: (e) => ![
12
13
  "disabled",
13
14
  "correctness"
14
15
  ].includes(e) })(({ theme: e, fill: t, disabled: n, correctness: r }) => ({
15
- ...t === "Solid" ? o.line(e) : o.dashedLine(e),
16
- ...n && o.disabled(e),
17
- ...r === "correct" && o.correct(e, "stroke"),
18
- ...r === "incorrect" && o.incorrect(e, "stroke"),
19
- ...r === "missing" && o.missing(e, "stroke")
16
+ ...t === "Solid" ? a.line(e) : a.dashedLine(e),
17
+ ...n && a.disabled(e),
18
+ ...r === "correct" && a.correct(e, "stroke"),
19
+ ...r === "incorrect" && a.incorrect(e, "stroke"),
20
+ ...r === "missing" && a.missing(e, "stroke")
20
21
  })), m = f(n, { shouldForwardProp: (e) => !["suffix"].includes(e) })(({ theme: e, suffix: t }) => ({
21
- ...t === "enabled" && o.arrow(e),
22
- ...t === "disabled" && o.disabledArrow(e),
23
- ...t === "correct" && o.correct(e),
24
- ...t === "incorrect" && o.incorrect(e),
25
- ...t === "missing" && o.missing(e)
22
+ ...t === "enabled" && a.arrow(e),
23
+ ...t === "disabled" && a.disabledArrow(e),
24
+ ...t === "correct" && a.correct(e),
25
+ ...t === "incorrect" && a.incorrect(e),
26
+ ...t === "missing" && a.missing(e)
26
27
  })), h = (n) => {
27
- let i = r(), { className: a, correctness: o, disabled: s, graphProps: l, fill: f = "Solid", from: h, to: g, ..._ } = n, { scale: v } = l, { domain: y, range: b } = e(l), [x, S] = c.edges(y, b)(h, g), C = o || s && "disabled" || "enabled";
28
+ let r = l("arrow"), { className: i, correctness: a, disabled: o, graphProps: c, fill: f = "Solid", from: h, to: g, ..._ } = n, { scale: v } = c, { domain: y, range: b } = e(c), [x, S] = s.edges(y, b)(h, g), C = a || o && "disabled" || "enabled";
28
29
  return /* @__PURE__ */ d("g", { children: [/* @__PURE__ */ u("defs", { children: /* @__PURE__ */ u(m, {
29
- size: t(l) ? 4 : 5,
30
- id: `${n.markerId || i}-${C}`,
30
+ size: t(c) ? 4 : 5,
31
+ id: `${n.markerId || r}-${C}`,
31
32
  suffix: C
32
33
  }) }), /* @__PURE__ */ u(p, {
33
34
  x1: v.x(x.x),
@@ -35,24 +36,24 @@ var p = f("line", { shouldForwardProp: (e) => ![
35
36
  x2: v.x(S.x),
36
37
  y2: v.y(S.y),
37
38
  fill: f,
38
- disabled: s,
39
- correctness: o,
40
- className: a,
41
- markerEnd: `url(#${n.markerId || i}-${C})`,
42
- markerStart: `url(#${n.markerId || i}-${C})`,
39
+ disabled: o,
40
+ correctness: a,
41
+ className: i,
42
+ markerEnd: `url(#${n.markerId || r}-${C})`,
43
+ markerStart: `url(#${n.markerId || r}-${C})`,
43
44
  ..._
44
45
  })] });
45
46
  };
46
47
  h.propTypes = {
47
- className: s.string,
48
- fill: s.string,
49
- correctness: s.string,
50
- disabled: s.bool,
51
- graphProps: l.GraphPropsType,
52
- from: l.PointType,
53
- to: l.PointType,
54
- markerId: s.string
48
+ className: o.string,
49
+ fill: o.string,
50
+ correctness: o.string,
51
+ disabled: o.bool,
52
+ graphProps: c.GraphPropsType,
53
+ from: c.PointType,
54
+ to: c.PointType,
55
+ markerId: o.string
55
56
  };
56
- var g = a(i(h));
57
+ var g = i(r(h));
57
58
  //#endregion
58
59
  export { h as ArrowedLine, g as default };
@@ -17,7 +17,6 @@ export declare const ArrowHead: {
17
17
  transform: string;
18
18
  };
19
19
  };
20
- export declare const genUid: () => string;
21
20
  export declare const ArrowMarker: {
22
21
  ({ id, size, className }: {
23
22
  id: any;