@pie-lib/graphing-solution-set 5.0.1-next.20261004003105 → 5.0.1-next.20261004011201

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.
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -145,7 +145,8 @@ var P = class extends s.Component {
145
145
  tools: Q,
146
146
  gssLineData: G,
147
147
  onSolutionSetSelected: q,
148
- disabled: !!g
148
+ disabled: !!g,
149
+ language: U
149
150
  })
150
151
  ]
151
152
  });
package/dist/graph.d.ts CHANGED
@@ -42,6 +42,7 @@ export declare const graphPropTypes: {
42
42
  showTitle: PropTypes.Requireable<boolean>;
43
43
  title: PropTypes.Requireable<string>;
44
44
  tools: PropTypes.Requireable<any[]>;
45
+ language: PropTypes.Requireable<string>;
45
46
  };
46
47
  export declare const removeBuildingToolIfCurrentToolDiffers: ({ marks, currentTool }: {
47
48
  marks: any;
@@ -92,6 +93,7 @@ export declare class Graph extends React.Component {
92
93
  showTitle: PropTypes.Requireable<boolean>;
93
94
  title: PropTypes.Requireable<string>;
94
95
  tools: PropTypes.Requireable<any[]>;
96
+ language: PropTypes.Requireable<string>;
95
97
  };
96
98
  static defaultProps: {
97
99
  onChangeMarks: () => void;
package/dist/graph.js CHANGED
@@ -6,11 +6,12 @@ import o from "./bg.js";
6
6
  import s from "react";
7
7
  import c from "prop-types";
8
8
  import { cloneDeep as l, isEqual as u } from "@pie-element/shared-lodash";
9
- import { Root as d, createGraphProps as f, types as p } from "@pie-lib/plot";
10
- import m from "debug";
11
- import { jsx as h, jsxs as g } from "react/jsx-runtime";
9
+ import { Root as d, createGraphProps as f, types as p, utils as m } from "@pie-lib/plot";
10
+ import h from "@pie-lib/translator";
11
+ import g from "debug";
12
+ import { jsx as _, jsxs as v } from "react/jsx-runtime";
12
13
  //#region src/graph.tsx
13
- var _ = m("pie-lib:graphing-solution-set:graph"), v = {
14
+ var { translator: y } = h, b = g("pie-lib:graphing-solution-set:graph"), x = {
14
15
  axesSettings: c.shape(r),
15
16
  backgroundMarks: c.array,
16
17
  className: c.string,
@@ -35,25 +36,44 @@ var _ = m("pie-lib:graphing-solution-set:graph"), v = {
35
36
  showPixelGuides: c.bool,
36
37
  showTitle: c.bool,
37
38
  title: c.string,
38
- tools: c.array
39
- }, y = (e) => ({
39
+ tools: c.array,
40
+ language: c.string
41
+ }, S = (e) => ({
40
42
  x: -23,
41
43
  y: -23,
42
44
  width: e.width + 46,
43
45
  height: e.height + 46
44
- }), b = ({ marks: e, currentTool: t }) => {
46
+ }), C = (e) => e ? m.extractTextFromHTML(e).trim() : "", w = ({ title: e, domain: t, range: n, marks: r, language: i }) => {
47
+ let a = {
48
+ lng: i,
49
+ interpolation: { escapeValue: !1 }
50
+ }, o = ({ axisLabel: e, min: t, max: n }, r) => y.t("graphing.axisRange", {
51
+ ...a,
52
+ axis: C(e) || r,
53
+ min: t,
54
+ max: n
55
+ }), s = r.filter((e) => !e.building && (e.type !== "polygon" || e.isSolution)), c = y.t("graphing.plotted", {
56
+ ...a,
57
+ count: s.length,
58
+ marks: s.map((e) => y.t(e.type === "polygon" ? "graphing.shadedRegion" : `graphing.${e.type}`, a).trim()).join(", ")
59
+ });
60
+ return {
61
+ ariaLabel: C(e) || y.t("graphing.graph", a),
62
+ ariaDescription: `${o(t, "x")} ${o(n, "y")} ${c}`
63
+ };
64
+ }, T = ({ marks: e, currentTool: t }) => {
45
65
  let n = e.filter((e) => e.building)[0], r = l(e);
46
66
  if (n && t && n.type !== t.type) {
47
67
  let e = r.findIndex((e) => u(e, n));
48
68
  e >= 0 && r.splice(e, 1);
49
69
  }
50
70
  return r;
51
- }, x = class extends s.Component {
71
+ }, E = class extends s.Component {
52
72
  constructor(e) {
53
73
  super(e), this.maskUid = this.generateMaskId();
54
74
  }
55
75
  static propTypes = {
56
- ...v,
76
+ ...x,
57
77
  currentTool: c.object
58
78
  };
59
79
  static defaultProps = {
@@ -99,7 +119,7 @@ var _ = m("pie-lib:graphing-solution-set:graph"), v = {
99
119
  if (o.numberOfLines === 1 && o.selectedTool === "lineA" && a.length === 1 && !a[0].building || o.numberOfLines === 2 && o.selectedTool === "lineA" && a.length === 2 || o.numberOfLines === 2 && o.selectedTool === "lineA" && a.length === 1 && !a[0].building || o.numberOfLines === 2 && o.selectedTool === "lineB" && a.length === 2 && !a[1].building) return;
100
120
  }
101
121
  if (r || !i || [null, void 0].includes(t) || [null, void 0].includes(n)) return;
102
- _("[onBgClick] x,y: ", t, n);
122
+ b("[onBgClick] x,y: ", t, n);
103
123
  let c = a.filter((e) => e.building)[0], l;
104
124
  l = c && i && c.type === i.type ? i.addPoint({
105
125
  x: t,
@@ -110,18 +130,19 @@ var _ = m("pie-lib:graphing-solution-set:graph"), v = {
110
130
  }, void 0), this.updateMarks(c, l, !0);
111
131
  };
112
132
  render() {
113
- let { axesSettings: t, currentTool: r, coordinatesOnHover: a, size: s, disabledLabels: c, disabledTitle: l, domain: u, backgroundMarks: p, range: m, title: _, labels: v, labelModeEnabled: x, labelsPlaceholders: S, showLabels: C, showPixelGuides: w, showTitle: T, titlePlaceholder: E, onChangeLabels: D, onChangeTitle: O, mathMlOptions: k = {}, gssLineData: A, disabled: j } = this.props, { marks: M } = this.props, N = f(u, m, s, () => this.rootNode), P = y(s), F = {
114
- graphProps: N,
115
- labelModeEnabled: x,
116
- gssLineData: A
133
+ let { axesSettings: t, currentTool: r, coordinatesOnHover: a, size: s, disabledLabels: c, disabledTitle: l, domain: u, backgroundMarks: p, range: m, title: h, labels: g, labelModeEnabled: y, labelsPlaceholders: b, showLabels: x, showPixelGuides: C, showTitle: E, titlePlaceholder: D, onChangeLabels: O, onChangeTitle: k, mathMlOptions: A = {}, gssLineData: j, disabled: M, language: N } = this.props, { marks: P } = this.props, F = f(u, m, s, () => this.rootNode), I = S(s), L = {
134
+ graphProps: F,
135
+ labelModeEnabled: y,
136
+ gssLineData: j,
137
+ language: N
117
138
  };
118
- M = b({
119
- marks: M || [],
139
+ P = T({
140
+ marks: P || [],
120
141
  currentTool: r
121
142
  });
122
- let I = M.filter((e) => e.type === "polygon");
123
- A && A.selectedTool === "solutionSet" && A.sections.forEach((t) => {
124
- if (I.length === 0 || !e(t, I[0].points)) {
143
+ let R = P.filter((e) => e.type === "polygon");
144
+ j && j.selectedTool === "solutionSet" && j.sections.forEach((t) => {
145
+ if (R.length === 0 || !e(t, R[0].points)) {
125
146
  let e = {
126
147
  type: "polygon",
127
148
  building: !1,
@@ -129,52 +150,62 @@ var _ = m("pie-lib:graphing-solution-set:graph"), v = {
129
150
  points: t,
130
151
  isSolution: !1
131
152
  };
132
- j || M.push(e);
153
+ M || P.push(e);
133
154
  }
134
155
  });
135
- let L = [];
136
- return L.push(...M.filter((e) => e.type === "polygon")), L.push(...M.filter((e) => e.type === "line")), /* @__PURE__ */ h(d, {
156
+ let z = [];
157
+ z.push(...P.filter((e) => e.type === "polygon")), z.push(...P.filter((e) => e.type === "line"));
158
+ let { ariaLabel: B, ariaDescription: V } = w({
159
+ title: h,
160
+ domain: u,
161
+ range: m,
162
+ marks: [...p || [], ...z],
163
+ language: N
164
+ });
165
+ return /* @__PURE__ */ _(d, {
137
166
  rootRef: (e) => this.rootNode = e,
138
167
  disabledTitle: l,
139
168
  disabledLabels: c,
140
- labels: v,
141
- labelsPlaceholders: S || {},
142
- showPixelGuides: w,
143
- showLabels: C,
144
- showTitle: T,
145
- title: _,
146
- titlePlaceholder: E,
147
- onChangeTitle: O,
148
- onChangeLabels: D,
149
- mathMlOptions: k,
150
- ...F,
151
- children: /* @__PURE__ */ g("g", {
169
+ labels: g,
170
+ labelsPlaceholders: b || {},
171
+ showPixelGuides: C,
172
+ showLabels: x,
173
+ showTitle: E,
174
+ title: h,
175
+ titlePlaceholder: D,
176
+ onChangeTitle: k,
177
+ onChangeLabels: O,
178
+ mathMlOptions: A,
179
+ ariaLabel: B,
180
+ ariaDescription: V,
181
+ ...L,
182
+ children: /* @__PURE__ */ v("g", {
152
183
  transform: u && u.padding && u.range ? `translate(${u.padding}, ${m.padding})` : void 0,
153
184
  children: [
154
- /* @__PURE__ */ h(i, { ...F }),
155
- /* @__PURE__ */ h(n, {
185
+ /* @__PURE__ */ _(i, { ...L }),
186
+ /* @__PURE__ */ _(n, {
156
187
  ...t,
157
- ...F
188
+ ...L
158
189
  }),
159
- /* @__PURE__ */ h(o, {
190
+ /* @__PURE__ */ _(o, {
160
191
  ...s,
161
192
  onClick: this.onBgClick,
162
- ...F
193
+ ...L
163
194
  }),
164
- /* @__PURE__ */ g("mask", {
195
+ /* @__PURE__ */ v("mask", {
165
196
  id: `${this.maskUid}`,
166
- children: [/* @__PURE__ */ h("rect", {
167
- ...P,
197
+ children: [/* @__PURE__ */ _("rect", {
198
+ ...I,
168
199
  fill: "white"
169
200
  }), " "]
170
201
  }),
171
- /* @__PURE__ */ g("g", {
202
+ /* @__PURE__ */ v("g", {
172
203
  id: "marks",
173
204
  mask: `url('#${this.maskUid}')`,
174
205
  children: [
175
206
  (p || []).map((e, t) => {
176
207
  let n = this.getComponent(e), r = e.type;
177
- return /* @__PURE__ */ h(n, {
208
+ return /* @__PURE__ */ _(n, {
178
209
  mark: {
179
210
  ...e,
180
211
  disabled: !0,
@@ -182,12 +213,12 @@ var _ = m("pie-lib:graphing-solution-set:graph"), v = {
182
213
  },
183
214
  labelNode: this.state.labelNode,
184
215
  onClick: this.onBgClick,
185
- ...F
216
+ ...L
186
217
  }, `${r}-${t}-bg`);
187
218
  }),
188
- L.map((e, t) => {
219
+ z.map((e, t) => {
189
220
  let n = this.getComponent(e), i = e.type;
190
- return /* @__PURE__ */ h(n, {
221
+ return /* @__PURE__ */ _(n, {
191
222
  mark: e,
192
223
  coordinatesOnHover: a,
193
224
  onChange: this.changeMark,
@@ -197,10 +228,10 @@ var _ = m("pie-lib:graphing-solution-set:graph"), v = {
197
228
  onDragStop: this.stopDrag,
198
229
  labelNode: this.state.labelNode,
199
230
  isToolActive: r && i === r.type,
200
- ...F
231
+ ...L
201
232
  }, `${i}-${t}`);
202
233
  }),
203
- /* @__PURE__ */ h("foreignObject", {
234
+ /* @__PURE__ */ _("foreignObject", {
204
235
  ref: (e) => this.labelNode = e,
205
236
  x: "0",
206
237
  y: "0",
@@ -218,4 +249,4 @@ var _ = m("pie-lib:graphing-solution-set:graph"), v = {
218
249
  }
219
250
  };
220
251
  //#endregion
221
- export { x as Graph, x as default, v as graphPropTypes, b as removeBuildingToolIfCurrentToolDiffers };
252
+ export { E as Graph, E as default, x as graphPropTypes, T as removeBuildingToolIfCurrentToolDiffers };
@@ -35,6 +35,7 @@ export declare const MarkLabel: {
35
35
  }>>>;
36
36
  }>>;
37
37
  inputRef: PropTypes.Requireable<(...args: any[]) => any>;
38
+ language: PropTypes.Requireable<string>;
38
39
  mark: PropTypes.Requireable<object>;
39
40
  theme: PropTypes.Requireable<object>;
40
41
  };
@@ -1,29 +1,31 @@
1
- import { AutosizeInput as e } from "./autosize-input.js";
2
- import { useDebounce as t } from "./use-debounce.js";
3
- import { useCallback as n, useEffect as r, useState as i } from "react";
4
- import a from "prop-types";
5
- import { types as o } from "@pie-lib/plot";
6
- import { jsx as s } from "react/jsx-runtime";
7
- import { styled as c } from "@mui/material/styles";
8
- import { color as l } from "@pie-lib/render-ui";
1
+ import { roundNumber as e } from "./utils.js";
2
+ import { AutosizeInput as t } from "./autosize-input.js";
3
+ import { useDebounce as n } from "./use-debounce.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 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";
9
11
  //#region src/mark-label.tsx
10
- var u = c(e, { shouldForwardProp: (e) => !["disabled", "markDisabled"].includes(e) })(({ theme: e, disabled: t, markDisabled: n }) => ({ "& input": {
12
+ var { translator: f } = c, p = u(t, { shouldForwardProp: (e) => !["disabled", "markDisabled"].includes(e) })(({ theme: e, disabled: t, markDisabled: n }) => ({ "& input": {
11
13
  float: "right",
12
14
  padding: e.spacing(.5),
13
15
  fontFamily: e.typography.fontFamily,
14
16
  fontSize: e.typography.fontSize,
15
- border: `solid 1px ${t ? l.defaults.PRIMARY_DARK : n ? l.disabled() : l.defaults.SECONDARY}`,
17
+ border: `solid 1px ${t ? d.defaults.PRIMARY_DARK : n ? d.disabled() : d.defaults.SECONDARY}`,
16
18
  borderRadius: "3px",
17
- color: n ? l.disabled() : l.defaults.PRIMARY_DARK,
19
+ color: n ? d.disabled() : d.defaults.PRIMARY_DARK,
18
20
  background: t || n ? e.palette.background.paper : "transparent"
19
- } })), d = (e, t, n) => {
21
+ } })), m = (e, t, n) => {
20
22
  n ||= {
21
23
  width: 0,
22
24
  height: 0
23
25
  };
24
26
  let { scale: r, domain: i, range: a } = e, o = r.x(t.x) + n.width + 10, s = r.y(t.y) + n.height + 10, c = o >= r.x(i.max) ? "left" : "right";
25
27
  return `${s >= r.y(a.min) ? "top" : "bottom"}-${c}`;
26
- }, f = (e, t, n, r) => {
28
+ }, h = (e, t, n, r) => {
27
29
  let { scale: i } = e;
28
30
  switch (n ||= {
29
31
  width: 0,
@@ -46,39 +48,45 @@ var u = c(e, { shouldForwardProp: (e) => !["disabled", "markDisabled"].includes(
46
48
  top: i.y(t.y) - 10 - n.height
47
49
  };
48
50
  }
49
- }, p = (e) => {
50
- let [a, o] = i(null), c = n((e) => o(e)), { mark: l, graphProps: p, disabled: m, inputRef: h } = e, [g, _] = i(l.label), v = (e) => _(e.target.value), y = t(g, 200);
51
- r(() => {
52
- _(l.label);
53
- }, [l.label]), r(() => {
54
- typeof y == "string" && y !== l.label && e.onChange(y);
55
- }, [y]);
56
- let b = a ? a.getBoundingClientRect() : {
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);
53
+ i(() => {
54
+ b(u.label);
55
+ }, [u.label]), i(() => {
56
+ typeof S == "string" && S !== u.label && t.onChange(S);
57
+ }, [S]);
58
+ let C = o ? o.getBoundingClientRect() : {
57
59
  width: 0,
58
60
  height: 0
59
- }, x = {
61
+ }, w = {
60
62
  position: "fixed",
61
63
  pointerEvents: "auto",
62
- ...f(p, l, b, d(p, l, b))
63
- };
64
- return /* @__PURE__ */ s(u, {
64
+ ...h(d, u, C, m(d, u, C))
65
+ }, T = g || u.disabled;
66
+ return /* @__PURE__ */ l(p, {
65
67
  inputRef: (e) => {
66
- c(e), h(e);
68
+ c(e), _(e);
67
69
  },
68
- disabled: m || l.disabled,
69
- markDisabled: l.disabled,
70
- value: g,
71
- style: x,
72
- onChange: v
70
+ "aria-label": Number.isFinite(u.x) && Number.isFinite(u.y) ? f.t("graphing.markLabel", {
71
+ lng: v,
72
+ x: e(u.x),
73
+ y: e(u.y)
74
+ }) : f.t("graphing.label", { lng: v }),
75
+ disabled: T,
76
+ markDisabled: u.disabled,
77
+ value: y,
78
+ style: w,
79
+ onChange: x
73
80
  });
74
81
  };
75
- p.propTypes = {
76
- disabled: a.bool,
77
- onChange: a.func,
78
- graphProps: o.GraphPropsType,
79
- inputRef: a.func,
80
- mark: a.object,
81
- theme: a.object
82
+ g.propTypes = {
83
+ disabled: o.bool,
84
+ onChange: o.func,
85
+ graphProps: s.GraphPropsType,
86
+ inputRef: o.func,
87
+ language: o.string,
88
+ mark: o.object,
89
+ theme: o.object
82
90
  };
83
91
  //#endregion
84
- export { p as MarkLabel, p as default, f as coordinates, d as position };
92
+ export { g as MarkLabel, g as default, h as coordinates, m as position };
@@ -6,6 +6,7 @@ export declare class ToolMenu extends React.Component {
6
6
  disabled: PropTypes.Requireable<boolean>;
7
7
  onChange: PropTypes.Requireable<(...args: any[]) => any>;
8
8
  };
9
+ idPrefix: string;
9
10
  onChangeRadioValue: any;
10
11
  lineTypeChange: any;
11
12
  render(): React.JSX.Element;
package/dist/tool-menu.js CHANGED
@@ -1,15 +1,17 @@
1
1
  import e from "react";
2
2
  import t from "prop-types";
3
- import { jsx as n, jsxs as r } from "react/jsx-runtime";
4
- import { styled as i } from "@mui/material/styles";
5
- import { Button as a, Radio as o, Typography as s } from "@mui/material";
3
+ import { uniqueId as n } from "@pie-element/shared-lodash";
4
+ import { jsx as r, jsxs as i } from "react/jsx-runtime";
5
+ import { styled as a } from "@mui/material/styles";
6
+ import { Button as o, Radio as s, Typography as c } from "@mui/material";
6
7
  //#region src/tool-menu.tsx
7
- var c = class extends e.Component {
8
+ var l = class extends e.Component {
8
9
  static propTypes = {
9
10
  gssLineData: t.object,
10
11
  disabled: t.bool,
11
12
  onChange: t.func
12
13
  };
14
+ idPrefix = n("gss-tool-menu-");
13
15
  onChangeRadioValue = (e) => {
14
16
  let { gssLineData: t, onChange: n } = this.props, r = t.selectedTool;
15
17
  t.selectedTool = e.target.value, n(t, r);
@@ -20,27 +22,29 @@ var c = class extends e.Component {
20
22
  };
21
23
  render() {
22
24
  let { gssLineData: e, disabled: t } = this.props;
23
- return /* @__PURE__ */ n(l, { children: /* @__PURE__ */ r("div", {
25
+ return /* @__PURE__ */ r(u, { children: /* @__PURE__ */ i("div", {
24
26
  className: "selectLineRadioGroup",
25
27
  children: [
26
- /* @__PURE__ */ r("div", {
28
+ /* @__PURE__ */ i("div", {
27
29
  className: "radioFieldOuter",
28
- children: [/* @__PURE__ */ r("div", {
30
+ children: [/* @__PURE__ */ i("div", {
29
31
  className: "radioFieldInner",
30
- children: [/* @__PURE__ */ n(o, {
32
+ children: [/* @__PURE__ */ r(s, {
31
33
  name: "select-line-radio-buttons",
32
34
  onChange: this.onChangeRadioValue,
33
35
  value: "lineA",
34
36
  disabled: !!t,
35
37
  checked: e.selectedTool === "lineA",
36
- className: "lineTypeRadio"
37
- }), /* @__PURE__ */ n(s, {
38
+ className: "lineTypeRadio",
39
+ inputProps: { "aria-labelledby": `${this.idPrefix}-lineA` }
40
+ }), /* @__PURE__ */ r(c, {
41
+ id: `${this.idPrefix}-lineA`,
38
42
  className: "lineNameFont",
39
43
  children: "Line A"
40
44
  })]
41
- }), /* @__PURE__ */ r("div", {
45
+ }), /* @__PURE__ */ i("div", {
42
46
  className: "radioFieldButtons",
43
- children: [/* @__PURE__ */ r(a, {
47
+ children: [/* @__PURE__ */ i(o, {
44
48
  size: "small",
45
49
  variant: "contained",
46
50
  color: e.lineA.lineType === "Solid" ? "primary" : "inherit",
@@ -48,7 +52,7 @@ var c = class extends e.Component {
48
52
  onClick: () => this.lineTypeChange("A", "Solid"),
49
53
  className: e.lineA.lineType === "Solid" ? t ? "lineTypeButtonLeftSelectedDisabled" : "lineTypeButtonLeftSelected" : t ? "lineTypeButtonLeftUnSelectedDisabled" : "lineTypeButtonLeftUnSelected",
50
54
  children: [e.lineA.lineType === "Solid" && "✔", " Solid"]
51
- }), /* @__PURE__ */ r(a, {
55
+ }), /* @__PURE__ */ i(o, {
52
56
  size: "small",
53
57
  variant: "contained",
54
58
  color: e.lineA.lineType === "Dashed" ? "primary" : "inherit",
@@ -59,24 +63,26 @@ var c = class extends e.Component {
59
63
  })]
60
64
  })]
61
65
  }),
62
- e.numberOfLines === 2 && /* @__PURE__ */ r("div", {
66
+ e.numberOfLines === 2 && /* @__PURE__ */ i("div", {
63
67
  className: "radioFieldOuter",
64
- children: [/* @__PURE__ */ r("div", {
68
+ children: [/* @__PURE__ */ i("div", {
65
69
  className: "radioFieldInner",
66
- children: [/* @__PURE__ */ n(o, {
70
+ children: [/* @__PURE__ */ r(s, {
67
71
  name: "select-line-radio-buttons",
68
72
  onChange: this.onChangeRadioValue,
69
73
  value: "lineB",
70
74
  disabled: !!t,
71
75
  checked: e.selectedTool === "lineB",
72
- className: "lineTypeRadio"
73
- }), /* @__PURE__ */ n(s, {
76
+ className: "lineTypeRadio",
77
+ inputProps: { "aria-labelledby": `${this.idPrefix}-lineB` }
78
+ }), /* @__PURE__ */ r(c, {
79
+ id: `${this.idPrefix}-lineB`,
74
80
  className: "lineNameFont",
75
81
  children: "Line B"
76
82
  })]
77
- }), /* @__PURE__ */ r("div", {
83
+ }), /* @__PURE__ */ i("div", {
78
84
  className: "radioFieldButtons",
79
- children: [/* @__PURE__ */ r(a, {
85
+ children: [/* @__PURE__ */ i(o, {
80
86
  size: "small",
81
87
  variant: "contained",
82
88
  color: e.lineB.lineType === "Solid" ? "primary" : "inherit",
@@ -84,7 +90,7 @@ var c = class extends e.Component {
84
90
  onClick: () => this.lineTypeChange("B", "Solid"),
85
91
  className: e.lineB.lineType === "Solid" ? t ? "lineTypeButtonLeftSelectedDisabled" : "lineTypeButtonLeftSelected" : t ? "lineTypeButtonLeftUnSelectedDisabled" : "lineTypeButtonLeftUnSelected",
86
92
  children: [e.lineB.lineType === "Solid" && "✔", " Solid"]
87
- }), /* @__PURE__ */ r(a, {
93
+ }), /* @__PURE__ */ i(o, {
88
94
  size: "small",
89
95
  variant: "contained",
90
96
  color: e.lineB.lineType === "Dashed" ? "primary" : "inherit",
@@ -95,18 +101,20 @@ var c = class extends e.Component {
95
101
  })]
96
102
  })]
97
103
  }),
98
- /* @__PURE__ */ n("div", {
104
+ /* @__PURE__ */ r("div", {
99
105
  className: "radioFieldOuter",
100
- children: /* @__PURE__ */ r("div", {
106
+ children: /* @__PURE__ */ i("div", {
101
107
  className: "radioFieldInner",
102
- children: [/* @__PURE__ */ n(o, {
108
+ children: [/* @__PURE__ */ r(s, {
103
109
  name: "select-line-radio-buttons",
104
110
  onChange: this.onChangeRadioValue,
105
111
  value: "solutionSet",
106
112
  disabled: !!t,
107
113
  checked: e.selectedTool === "solutionSet",
108
- className: "lineTypeRadio"
109
- }), /* @__PURE__ */ n(s, {
114
+ className: "lineTypeRadio",
115
+ inputProps: { "aria-labelledby": `${this.idPrefix}-solutionSet` }
116
+ }), /* @__PURE__ */ r(c, {
117
+ id: `${this.idPrefix}-solutionSet`,
110
118
  className: "lineNameFont",
111
119
  children: "Solution Set"
112
120
  })]
@@ -115,7 +123,7 @@ var c = class extends e.Component {
115
123
  ]
116
124
  }) });
117
125
  }
118
- }, l = i("div")(() => ({
126
+ }, u = a("div")(() => ({
119
127
  "& .selectLineRadioGroup": {
120
128
  display: "flex",
121
129
  flexWrap: "wrap",
@@ -185,4 +193,4 @@ var c = class extends e.Component {
185
193
  }
186
194
  }));
187
195
  //#endregion
188
- export { c as ToolMenu, c as default };
196
+ export { l as ToolMenu, l as default };
@@ -95,6 +95,7 @@ declare const Component: {
95
95
  height: PropTypes.Validator<number>;
96
96
  }>>>;
97
97
  }>>>;
98
+ language: PropTypes.Requireable<string>;
98
99
  mark: PropTypes.Requireable<object>;
99
100
  onChange: PropTypes.Requireable<(...args: any[]) => any>;
100
101
  onDelete: PropTypes.Requireable<(...args: any[]) => any>;
@@ -58,6 +58,7 @@ export declare const lineToolComponent: (Component: any) => {
58
58
  height: PropTypes.Validator<number>;
59
59
  }>>>;
60
60
  }>>>;
61
+ language: PropTypes.Requireable<string>;
61
62
  mark: PropTypes.Requireable<object>;
62
63
  onChange: PropTypes.Requireable<(...args: any[]) => any>;
63
64
  onDelete: PropTypes.Requireable<(...args: any[]) => any>;
@@ -181,6 +182,7 @@ export declare const lineBase: (Comp: any, opts: any) => {
181
182
  labelNode: PropTypes.Requireable<object>;
182
183
  labelModeEnabled: PropTypes.Requireable<boolean>;
183
184
  changeMarkProps: PropTypes.Requireable<(...args: any[]) => any>;
185
+ language: PropTypes.Requireable<string>;
184
186
  };
185
187
  contextType?: React.Context<any> | undefined;
186
188
  };
@@ -25,7 +25,8 @@ var S = (t, n) => () => ({
25
25
  }), C = (e) => class extends l.Component {
26
26
  static propTypes = {
27
27
  ...g.ToolPropTypeFields,
28
- graphProps: g.GraphPropsType.isRequired
28
+ graphProps: g.GraphPropsType.isRequired,
29
+ language: u.string
29
30
  };
30
31
  constructor(e) {
31
32
  super(e), this.state = {};
@@ -66,16 +67,16 @@ var S = (t, n) => () => ({
66
67
  }), p(i, a) || r(i, a);
67
68
  };
68
69
  render() {
69
- let { graphProps: t, onClick: n, labelNode: r, labelModeEnabled: i, coordinatesOnHover: a, gssLineData: o } = this.props, s = this.state.mark ? this.state.mark : this.props.mark, c = d(s.from), l = d(s.to), u = d(s.middle);
70
- return c && s.isBackground && (c.disabled = !0), l && s.isBackground && (l.disabled = !0), u && s.isBackground && (u.disabled = !0), /* @__PURE__ */ v(e, {
71
- disabled: s.disabled,
70
+ let { graphProps: t, onClick: n, labelNode: r, labelModeEnabled: i, coordinatesOnHover: a, gssLineData: o, language: s } = this.props, c = this.state.mark ? this.state.mark : this.props.mark, l = d(c.from), u = d(c.to), f = d(c.middle);
71
+ return l && c.isBackground && (l.disabled = !0), u && c.isBackground && (u.disabled = !0), f && c.isBackground && (f.disabled = !0), /* @__PURE__ */ v(e, {
72
+ disabled: c.disabled,
72
73
  coordinatesOnHover: a,
73
- correctness: s.correctness,
74
- from: c,
75
- to: l,
76
- middle: u,
74
+ correctness: c.correctness,
75
+ from: l,
76
+ to: u,
77
+ middle: f,
77
78
  graphProps: t,
78
- fill: s && s.fill,
79
+ fill: c && c.fill,
79
80
  gssLineData: o,
80
81
  onChange: this.changeMark,
81
82
  changeMarkProps: this.changeMarkProps,
@@ -83,7 +84,8 @@ var S = (t, n) => () => ({
83
84
  onDragStart: this.startDrag,
84
85
  onDragStop: this.stopDrag,
85
86
  labelNode: r,
86
- labelModeEnabled: i
87
+ labelModeEnabled: i,
88
+ language: s
87
89
  });
88
90
  }
89
91
  }, w = () => ({
@@ -121,7 +123,8 @@ var S = (t, n) => () => ({
121
123
  disabled: u.bool,
122
124
  labelNode: u.object,
123
125
  labelModeEnabled: u.bool,
124
- changeMarkProps: u.func
126
+ changeMarkProps: u.func,
127
+ language: u.string
125
128
  };
126
129
  onChangePoint = (n) => {
127
130
  let { middle: r, onChange: i } = this.props, { from: a, to: o } = n;
@@ -180,7 +183,7 @@ var S = (t, n) => () => ({
180
183
  };
181
184
  input = {};
182
185
  render() {
183
- let { coordinatesOnHover: e, graphProps: t, fill: n, gssLineData: r, onDragStart: c, onDragStop: l, from: u, to: d, middle: f, disabled: p, correctness: m, onClick: g, labelNode: _, labelModeEnabled: b } = this.props, S = {
186
+ let { coordinatesOnHover: e, graphProps: t, fill: n, gssLineData: r, onDragStart: c, onDragStop: l, from: u, to: d, middle: f, disabled: p, correctness: m, onClick: g, labelNode: _, labelModeEnabled: b, language: S } = this.props, C = {
184
187
  graphProps: t,
185
188
  fill: n,
186
189
  onDragStart: c,
@@ -189,37 +192,40 @@ var S = (t, n) => () => ({
189
192
  correctness: m,
190
193
  onClick: g
191
194
  };
192
- r && r.selectedTool === "solutionSet" && (S = {
195
+ r && r.selectedTool === "solutionSet" && (C = {
193
196
  graphProps: t,
194
197
  fill: n,
195
198
  disabled: p,
196
199
  correctness: m,
197
200
  onClick: g
198
201
  });
199
- let C = d ? h.toDegrees(h.angle(u, d)) : 0, w = null, T = null, E = null;
200
- return _ && (u && Object.prototype.hasOwnProperty.call(u, "label") && (w = x.createPortal(/* @__PURE__ */ v(s, {
202
+ let w = d ? h.toDegrees(h.angle(u, d)) : 0, T = null, E = null, D = null;
203
+ return _ && (u && Object.prototype.hasOwnProperty.call(u, "label") && (T = x.createPortal(/* @__PURE__ */ v(s, {
201
204
  inputRef: (e) => this.input.from = e,
202
205
  disabled: !b,
203
206
  mark: u,
204
207
  graphProps: t,
208
+ language: S,
205
209
  onChange: (e) => this.labelChange({
206
210
  ...u,
207
211
  label: e
208
212
  }, "from")
209
- }), _)), d && Object.prototype.hasOwnProperty.call(d, "label") && (T = x.createPortal(/* @__PURE__ */ v(s, {
213
+ }), _)), d && Object.prototype.hasOwnProperty.call(d, "label") && (E = x.createPortal(/* @__PURE__ */ v(s, {
210
214
  inputRef: (e) => this.input.to = e,
211
215
  disabled: !b,
212
216
  mark: d,
213
217
  graphProps: t,
218
+ language: S,
214
219
  onChange: (e) => this.labelChange({
215
220
  ...d,
216
221
  label: e
217
222
  }, "to")
218
- }), _)), f && Object.prototype.hasOwnProperty.call(f, "label") && (E = x.createPortal(/* @__PURE__ */ v(s, {
223
+ }), _)), f && Object.prototype.hasOwnProperty.call(f, "label") && (D = x.createPortal(/* @__PURE__ */ v(s, {
219
224
  inputRef: (e) => this.input.middle = e,
220
225
  disabled: !b,
221
226
  mark: f,
222
227
  graphProps: t,
228
+ language: S,
223
229
  onChange: (e) => this.labelChange({
224
230
  ...f,
225
231
  label: e
@@ -229,57 +235,57 @@ var S = (t, n) => () => ({
229
235
  from: u,
230
236
  to: d,
231
237
  middle: f,
232
- ...S
238
+ ...C
233
239
  }),
234
- E,
240
+ D,
235
241
  /* @__PURE__ */ v(a, {
236
242
  x: u.x,
237
243
  y: u.y,
238
244
  labelNode: _,
239
245
  coordinatesOnHover: e,
240
- ...S
246
+ ...C
241
247
  }),
242
- w,
248
+ T,
243
249
  d && /* @__PURE__ */ v(o, {
244
250
  x: d.x,
245
251
  y: d.y,
246
- angle: C,
252
+ angle: w,
247
253
  labelNode: _,
248
254
  coordinatesOnHover: e,
249
- ...S
255
+ ...C
250
256
  }),
251
- T
257
+ E
252
258
  ] }) : /* @__PURE__ */ y("g", { children: [
253
259
  d && /* @__PURE__ */ v(i, {
254
260
  from: u,
255
261
  to: d,
256
262
  middle: f,
257
263
  onDrag: this.dragComp,
258
- ...S,
264
+ ...C,
259
265
  onClick: (e) => this.clickPoint(f, "middle", e)
260
266
  }),
261
- E,
267
+ D,
262
268
  /* @__PURE__ */ v(a, {
263
269
  x: u.x,
264
270
  y: u.y,
265
271
  labelNode: _,
266
272
  coordinatesOnHover: e,
267
273
  onDrag: this.dragFrom,
268
- ...S,
274
+ ...C,
269
275
  onClick: (e) => this.clickPoint(u, "from", e)
270
276
  }),
271
- w,
277
+ T,
272
278
  d && /* @__PURE__ */ v(o, {
273
279
  x: d.x,
274
280
  y: d.y,
275
- angle: C,
281
+ angle: w,
276
282
  labelNode: _,
277
283
  coordinatesOnHover: e,
278
284
  onDrag: this.dragTo,
279
- ...S,
285
+ ...C,
280
286
  onClick: (e) => this.clickPoint(d, "to", e)
281
287
  }),
282
- T
288
+ E
283
289
  ] });
284
290
  }
285
291
  }
package/dist/undo-redo.js CHANGED
@@ -1,13 +1,13 @@
1
1
  import e from "react";
2
2
  import t from "prop-types";
3
- import { jsx as n } from "react/jsx-runtime";
4
- import { styled as r } from "@mui/material/styles";
5
- import { color as i } from "@pie-lib/render-ui";
6
- import a from "@mui/material/Button";
7
- import o from "@pie-lib/translator";
3
+ import n from "@pie-lib/translator";
4
+ import { jsx as r } from "react/jsx-runtime";
5
+ import { styled as i } from "@mui/material/styles";
6
+ import { color as a } from "@pie-lib/render-ui";
7
+ import o from "@mui/material/Button";
8
8
  //#region src/undo-redo.tsx
9
- var { translator: s } = o, c = r(a)(({ theme: e }) => ({
10
- color: i.text(),
9
+ var { translator: s } = n, c = i(o)(({ theme: e }) => ({
10
+ color: a.text(),
11
11
  fontWeight: "bold",
12
12
  marginBottom: e.spacing(.5),
13
13
  "&:not(:last-of-type)": { marginRight: e.spacing(.5) }
@@ -19,12 +19,12 @@ var { translator: s } = o, c = r(a)(({ theme: e }) => ({
19
19
  };
20
20
  static defaultProps = {};
21
21
  render() {
22
- let { className: e, onReset: t = !1, language: r } = this.props;
23
- return /* @__PURE__ */ n("div", {
22
+ let { className: e, onReset: t = !1, language: n } = this.props;
23
+ return /* @__PURE__ */ r("div", {
24
24
  className: e,
25
- children: /* @__PURE__ */ n(c, {
25
+ children: /* @__PURE__ */ r(c, {
26
26
  onClick: () => t(),
27
- children: s.t("graphing.reset", { lng: r })
27
+ children: s.t("graphing.reset", { lng: n })
28
28
  })
29
29
  });
30
30
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pie-lib/graphing-solution-set",
3
- "version": "5.0.1-next.20261004003105",
3
+ "version": "5.0.1-next.20261004011201",
4
4
  "description": "Graphing components",
5
5
  "repository": {
6
6
  "type": "git",
@@ -15,12 +15,12 @@
15
15
  "@mui/icons-material": "^7.3.4",
16
16
  "@mui/material": "^7.3.4",
17
17
  "@pie-lib/drag": "5.0.1-next.20261004003105",
18
- "@pie-lib/editable-html-tip-tap": "3.0.1-next.20261004003105",
18
+ "@pie-lib/editable-html-tip-tap": "3.0.1-next.20261004011201",
19
19
  "@pie-lib/graphing-utils": "4.0.1-next.20261002233132",
20
- "@pie-lib/plot": "5.0.1-next.20261004003105",
20
+ "@pie-lib/plot": "5.0.1-next.20261004011201",
21
21
  "@pie-lib/render-ui": "8.0.1-next.20261003161149",
22
22
  "@pie-lib/tools": "3.0.1-next.20261002233132",
23
- "@pie-lib/translator": "5.0.1-next.20261004003105",
23
+ "@pie-lib/translator": "5.0.1-next.20261004011201",
24
24
  "@visx/axis": "^4.0.0",
25
25
  "@visx/clip-path": "^4.0.0",
26
26
  "@visx/curve": "^4.0.0",
@@ -40,7 +40,7 @@
40
40
  "redux-undo": "^1.1.0",
41
41
  "@pie-element/shared-lodash": "0.1.2-next.20261002215153",
42
42
  "clsx": "^2.1.1",
43
- "@pie-lib/config-ui": "14.0.1-next.20261004003105",
43
+ "@pie-lib/config-ui": "14.0.1-next.20261004011201",
44
44
  "@dnd-kit/core": "^6.3.1",
45
45
  "@dnd-kit/utilities": "^3.2.2",
46
46
  "d3-shape": "^3.2.0"