@pie-element/graphing 10.1.2-next.4 → 10.1.2-next.6
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.
- package/dist/author/configure.js +3 -3
- package/dist/author/correct-response.js +70 -69
- package/dist/author/graphing-config.js +1 -1
- package/dist/author/index.d.ts +1 -0
- package/dist/author/index.js +5 -2
- package/dist/author/utils.js +1 -1
- package/dist/browser/author/index.js +95 -92
- package/dist/browser/author/index.js.map +1 -1
- package/dist/browser/{container-CTkqz7Oi.js → container-y2dbRhO3.js} +22208 -24144
- package/dist/browser/container-y2dbRhO3.js.map +1 -0
- package/dist/browser/controller/index.js +3 -3
- package/dist/browser/controller/index.js.map +1 -1
- package/dist/browser/delivery/index.js +26 -9
- package/dist/browser/delivery/index.js.map +1 -1
- package/dist/browser/{dist-B7TYAggd.js → dist-Bqo4KUUX.js} +2 -2
- package/dist/browser/dist-Bqo4KUUX.js.map +1 -0
- package/dist/controller/utils.js +2 -2
- package/dist/delivery/index.d.ts +3 -0
- package/dist/delivery/index.js +25 -7
- package/dist/delivery/main.js +1 -1
- package/dist/index.iife.js +114 -118
- package/package.json +14 -9
- package/dist/browser/container-CTkqz7Oi.js.map +0 -1
- package/dist/browser/dist-B7TYAggd.js.map +0 -1
package/dist/author/configure.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import e from "./graphing-config.js";
|
|
2
|
-
import t from "./correct-response.js";
|
|
1
|
+
import { GraphingConfig as e } from "./graphing-config.js";
|
|
2
|
+
import { CorrectResponse as t } from "./correct-response.js";
|
|
3
3
|
import n from "react";
|
|
4
4
|
import r from "prop-types";
|
|
5
5
|
import { styled as i } from "@mui/material/styles";
|
|
@@ -205,4 +205,4 @@ var { Panel: ee, toggle: m, radio: h, checkboxes: te, textField: ne, dropdown: r
|
|
|
205
205
|
}
|
|
206
206
|
};
|
|
207
207
|
//#endregion
|
|
208
|
-
export { v as default };
|
|
208
|
+
export { v as Configure, v as default };
|
|
@@ -3,95 +3,96 @@ import { renderMath as t } from "@pie-element/shared-math-rendering-mathjax";
|
|
|
3
3
|
import n from "prop-types";
|
|
4
4
|
import { styled as r } from "@mui/material/styles";
|
|
5
5
|
import { GraphContainer as i } from "@pie-lib/graphing";
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import m from "
|
|
11
|
-
import h from "
|
|
12
|
-
import g from "@mui/icons-material/
|
|
6
|
+
import { color as a } from "@pie-lib/render-ui";
|
|
7
|
+
import { jsx as o, jsxs as s } from "react/jsx-runtime";
|
|
8
|
+
import { isEqual as c, set as l } from "@pie-element/shared-lodash";
|
|
9
|
+
import { AlertDialog as u } from "@pie-lib/config-ui";
|
|
10
|
+
import { MenuItem as d, Select as f, Tooltip as p, Typography as m } from "@mui/material";
|
|
11
|
+
import h from "react-dom";
|
|
12
|
+
import g from "@mui/icons-material/Delete";
|
|
13
|
+
import _ from "@mui/icons-material/Info";
|
|
13
14
|
//#region src/author/correct-response.tsx
|
|
14
|
-
var
|
|
15
|
+
var v = r("div")({ color: a.text() }), y = r("div")(({ theme: e }) => ({
|
|
15
16
|
margin: `${e.spacing(2.5)} 0`,
|
|
16
17
|
cursor: "pointer",
|
|
17
|
-
background:
|
|
18
|
+
background: a.backgroundDark(),
|
|
18
19
|
padding: e.spacing(1.5),
|
|
19
20
|
width: "fit-content",
|
|
20
21
|
borderRadius: "4px",
|
|
21
|
-
"&:hover": { background:
|
|
22
|
-
})),
|
|
22
|
+
"&:hover": { background: a.dropdownBackground() }
|
|
23
|
+
})), b = r("div")(({ theme: e }) => ({
|
|
23
24
|
marginTop: e.spacing(1),
|
|
24
25
|
display: "flex",
|
|
25
26
|
flexWrap: "wrap"
|
|
26
|
-
})),
|
|
27
|
+
})), x = r("div")(({ theme: e }) => ({
|
|
27
28
|
cursor: "pointer",
|
|
28
29
|
margin: e.spacing(1),
|
|
29
30
|
padding: e.spacing(1),
|
|
30
|
-
border: `2px solid ${
|
|
31
|
+
border: `2px solid ${a.background()}`,
|
|
31
32
|
textTransform: "capitalize",
|
|
32
|
-
"&:hover": { color:
|
|
33
|
-
})),
|
|
34
|
-
background:
|
|
35
|
-
border: `2px solid ${
|
|
36
|
-
}),
|
|
33
|
+
"&:hover": { color: a.text() }
|
|
34
|
+
})), S = r(x)({
|
|
35
|
+
background: a.dropdownBackground(),
|
|
36
|
+
border: `2px solid ${a.border()}`
|
|
37
|
+
}), C = r("div")(({ theme: e }) => ({
|
|
37
38
|
display: "flex",
|
|
38
39
|
alignItems: "center",
|
|
39
40
|
marginTop: e.spacing(2.5)
|
|
40
|
-
})),
|
|
41
|
+
})), w = r("div")(() => ({
|
|
41
42
|
marginLeft: "6px",
|
|
42
|
-
color:
|
|
43
|
+
color: a.borderGray(),
|
|
43
44
|
"&:hover": {
|
|
44
45
|
cursor: "pointer",
|
|
45
|
-
color:
|
|
46
|
+
color: a.text()
|
|
46
47
|
}
|
|
47
|
-
})),
|
|
48
|
+
})), T = r("div")(({ theme: e }) => ({ marginBottom: e.spacing(.5) })), E = r(({ className: e, ...t }) => /* @__PURE__ */ o(p, {
|
|
48
49
|
...t,
|
|
49
50
|
classes: { tooltip: e }
|
|
50
51
|
}))(({ theme: e }) => ({ "& .MuiTooltip-tooltip": {
|
|
51
52
|
fontSize: e.typography.fontSize - 2,
|
|
52
53
|
whiteSpace: "pre",
|
|
53
54
|
maxWidth: "500px"
|
|
54
|
-
} })),
|
|
55
|
+
} })), D = r(m)(({ theme: e }) => ({
|
|
55
56
|
marginTop: e.spacing(1.5),
|
|
56
57
|
marginBottom: e.spacing(1)
|
|
57
|
-
})),
|
|
58
|
+
})), O = r("div")({
|
|
58
59
|
display: "flex",
|
|
59
60
|
alignItems: "center",
|
|
60
61
|
justifyContent: "space-between"
|
|
61
|
-
}),
|
|
62
|
+
}), k = r("div")({
|
|
62
63
|
display: "flex",
|
|
63
64
|
alignItems: "center",
|
|
64
65
|
width: "300px"
|
|
65
|
-
}),
|
|
66
|
+
}), A = r(f)(({ theme: e }) => ({
|
|
66
67
|
marginLeft: e.spacing(1),
|
|
67
68
|
textTransform: "uppercase",
|
|
68
|
-
color:
|
|
69
|
-
})),
|
|
69
|
+
color: a.text()
|
|
70
|
+
})), j = r(d)({ textTransform: "uppercase" }), M = r("div")(({ theme: e }) => ({
|
|
70
71
|
fontSize: e.typography.fontSize - 2,
|
|
71
72
|
color: e.palette.error.main,
|
|
72
73
|
marginTop: e.spacing(1)
|
|
73
|
-
})),
|
|
74
|
+
})), N = ({ availableTools: e, defaultTool: t, hasErrors: n, toolbarTools: r, toggleToolBarTool: i, onDefaultToolChange: a }) => {
|
|
74
75
|
let c = e || [], l = c.includes("label"), u = (r || []).filter((e) => e !== "label");
|
|
75
|
-
return l && (c = [...c.filter((e) => e !== "label"), "label"]), /* @__PURE__ */
|
|
76
|
+
return l && (c = [...c.filter((e) => e !== "label"), "label"]), /* @__PURE__ */ s(v, { children: [/* @__PURE__ */ s(O, { children: [/* @__PURE__ */ o("span", { children: "GRAPHING TOOLS" }), u.length > 0 && /* @__PURE__ */ s(k, { children: [/* @__PURE__ */ o("span", { children: "Default graphing tool:" }), /* @__PURE__ */ o(A, {
|
|
76
77
|
variant: "standard",
|
|
77
|
-
onChange:
|
|
78
|
+
onChange: a,
|
|
78
79
|
value: t,
|
|
79
80
|
disableUnderline: !0,
|
|
80
81
|
MenuProps: { transitionDuration: {
|
|
81
82
|
enter: 225,
|
|
82
83
|
exit: 195
|
|
83
84
|
} },
|
|
84
|
-
children: u.map((e, t) => /* @__PURE__ */
|
|
85
|
+
children: u.map((e, t) => /* @__PURE__ */ o(j, {
|
|
85
86
|
value: e,
|
|
86
87
|
children: e
|
|
87
88
|
}, t))
|
|
88
|
-
})] })] }), /* @__PURE__ */
|
|
89
|
+
})] })] }), /* @__PURE__ */ o(b, { children: c.map((e) => /* @__PURE__ */ o(r.find((t) => t === e) ? S : x, {
|
|
89
90
|
style: { ...n && e !== "label" && { color: "red" } },
|
|
90
91
|
onClick: () => i(e),
|
|
91
92
|
children: e.toUpperCase()
|
|
92
93
|
}, e)) })] });
|
|
93
94
|
};
|
|
94
|
-
|
|
95
|
+
N.propTypes = {
|
|
95
96
|
toolbarTools: n.arrayOf(n.string),
|
|
96
97
|
toggleToolBarTool: n.func,
|
|
97
98
|
availableTools: n.array,
|
|
@@ -99,7 +100,7 @@ P.propTypes = {
|
|
|
99
100
|
hasErrors: n.number,
|
|
100
101
|
onDefaultToolChange: n.func
|
|
101
102
|
};
|
|
102
|
-
var
|
|
103
|
+
var P = class extends e.Component {
|
|
103
104
|
static propTypes = {
|
|
104
105
|
availableTools: n.array,
|
|
105
106
|
errors: n.object,
|
|
@@ -110,7 +111,7 @@ var F = class extends e.Component {
|
|
|
110
111
|
state = { dialog: { open: !1 } };
|
|
111
112
|
componentDidMount() {
|
|
112
113
|
try {
|
|
113
|
-
t(
|
|
114
|
+
t(h.findDOMNode(this));
|
|
114
115
|
} catch {
|
|
115
116
|
console.error("DOM not mounted");
|
|
116
117
|
}
|
|
@@ -118,7 +119,7 @@ var F = class extends e.Component {
|
|
|
118
119
|
handleAlertDialog = (e, t) => this.setState({ dialog: { open: e } }, t);
|
|
119
120
|
changeMarks = (e, t) => {
|
|
120
121
|
let { model: n, onChange: r } = this.props;
|
|
121
|
-
|
|
122
|
+
l(n, `answers.${e}.marks`, t), r(n);
|
|
122
123
|
};
|
|
123
124
|
filterMarks = (e) => {
|
|
124
125
|
let { model: { answers: t } } = this.props;
|
|
@@ -146,7 +147,7 @@ var F = class extends e.Component {
|
|
|
146
147
|
let e = (i || []).filter((e) => e !== "label");
|
|
147
148
|
a = e.length && e[0] || "";
|
|
148
149
|
}
|
|
149
|
-
if (!
|
|
150
|
+
if (!c(r, n)) {
|
|
150
151
|
this.setState({ dialog: {
|
|
151
152
|
open: !0,
|
|
152
153
|
title: "Warning",
|
|
@@ -172,7 +173,7 @@ var F = class extends e.Component {
|
|
|
172
173
|
};
|
|
173
174
|
addAlternateResponse = () => {
|
|
174
175
|
let { model: e, onChange: t } = this.props, { answers: n } = e || {}, r = Object.keys(n || {});
|
|
175
|
-
|
|
176
|
+
l(e, `answers.${`alternate${r.length}`}`, {
|
|
176
177
|
name: `Alternate ${r.length}`,
|
|
177
178
|
marks: []
|
|
178
179
|
}), t(e);
|
|
@@ -211,38 +212,38 @@ var F = class extends e.Component {
|
|
|
211
212
|
s();
|
|
212
213
|
};
|
|
213
214
|
render() {
|
|
214
|
-
let { availableTools: t, errors: n, model: r, mathMlOptions:
|
|
215
|
-
return /* @__PURE__ */
|
|
216
|
-
/* @__PURE__ */
|
|
215
|
+
let { availableTools: t, errors: n, model: r, mathMlOptions: a = {}, removeIncompleteTool: c } = this.props, { dialog: l } = this.state, { answers: d = {}, arrows: f, backgroundMarks: p, coordinatesOnHover: h, defaultTool: v, domain: b, graph: x = {}, labels: S, labelsEnabled: O, range: k, title: A, titleEnabled: j, toolbarTools: P } = r || {}, { correctAnswerErrors: F = {}, toolbarToolsError: I } = n || {};
|
|
216
|
+
return /* @__PURE__ */ s("div", { children: [
|
|
217
|
+
/* @__PURE__ */ o(m, {
|
|
217
218
|
component: "div",
|
|
218
219
|
variant: "h6",
|
|
219
220
|
children: "Define Tool Set and Correct Response"
|
|
220
221
|
}),
|
|
221
|
-
/* @__PURE__ */
|
|
222
|
+
/* @__PURE__ */ o(D, {
|
|
222
223
|
component: "div",
|
|
223
224
|
variant: "body1",
|
|
224
225
|
children: "Use this interface to choose which graphing tools students will be able to use, and to define the correct answer"
|
|
225
226
|
}),
|
|
226
|
-
/* @__PURE__ */
|
|
227
|
+
/* @__PURE__ */ o(N, {
|
|
227
228
|
availableTools: t,
|
|
228
229
|
defaultTool: v,
|
|
229
230
|
hasErrors: !!I,
|
|
230
231
|
onDefaultToolChange: this.onDefaultToolChange,
|
|
231
232
|
toggleToolBarTool: this.toggleToolBarTool,
|
|
232
|
-
toolbarTools:
|
|
233
|
+
toolbarTools: P
|
|
233
234
|
}),
|
|
234
|
-
I && /* @__PURE__ */
|
|
235
|
+
I && /* @__PURE__ */ o(M, { children: I }),
|
|
235
236
|
Object.entries(d || {}).map(([t, n]) => {
|
|
236
237
|
let { marks: r = [], name: l } = n || {};
|
|
237
|
-
return /* @__PURE__ */
|
|
238
|
-
/* @__PURE__ */
|
|
239
|
-
/* @__PURE__ */
|
|
240
|
-
t === "correctAnswer" && /* @__PURE__ */
|
|
238
|
+
return /* @__PURE__ */ s(e.Fragment, { children: [
|
|
239
|
+
/* @__PURE__ */ s(C, { children: [
|
|
240
|
+
/* @__PURE__ */ o(T, { children: l }),
|
|
241
|
+
t === "correctAnswer" && /* @__PURE__ */ o(E, {
|
|
241
242
|
disableFocusListener: !0,
|
|
242
243
|
disableTouchListener: !0,
|
|
243
244
|
placement: "right",
|
|
244
245
|
title: "At least 1 graph object should be defined.",
|
|
245
|
-
children: /* @__PURE__ */
|
|
246
|
+
children: /* @__PURE__ */ o(_, {
|
|
246
247
|
fontSize: "small",
|
|
247
248
|
color: "primary",
|
|
248
249
|
style: {
|
|
@@ -251,53 +252,53 @@ var F = class extends e.Component {
|
|
|
251
252
|
}
|
|
252
253
|
})
|
|
253
254
|
}),
|
|
254
|
-
t !== "correctAnswer" && /* @__PURE__ */
|
|
255
|
+
t !== "correctAnswer" && /* @__PURE__ */ o(w, {
|
|
255
256
|
onClick: () => this.deleteAlternateResponse(t, n),
|
|
256
|
-
children: /* @__PURE__ */
|
|
257
|
+
children: /* @__PURE__ */ o(g, {})
|
|
257
258
|
})
|
|
258
259
|
] }),
|
|
259
|
-
/* @__PURE__ */
|
|
260
|
+
/* @__PURE__ */ o(i, {
|
|
260
261
|
style: F[t] && { border: "2px solid red" },
|
|
261
262
|
axesSettings: { includeArrows: f },
|
|
262
|
-
backgroundMarks:
|
|
263
|
-
coordinatesOnHover:
|
|
263
|
+
backgroundMarks: p.filter((e) => !e.building),
|
|
264
|
+
coordinatesOnHover: h,
|
|
264
265
|
disabledLabels: !0,
|
|
265
266
|
disabledTitle: !0,
|
|
266
|
-
domain:
|
|
267
|
+
domain: b,
|
|
267
268
|
draggableTools: t === "correctAnswer",
|
|
268
269
|
labels: S,
|
|
269
270
|
marks: r,
|
|
270
271
|
onChangeMarks: (e) => this.changeMarks(t, e),
|
|
271
272
|
range: k,
|
|
272
|
-
showLabels:
|
|
273
|
+
showLabels: O,
|
|
273
274
|
showTitle: j,
|
|
274
275
|
size: {
|
|
275
276
|
width: x.width,
|
|
276
277
|
height: x.height
|
|
277
278
|
},
|
|
278
279
|
title: A,
|
|
279
|
-
toolbarTools:
|
|
280
|
+
toolbarTools: P,
|
|
280
281
|
onChangeTools: (e) => this.updateModel({ toolbarTools: e }),
|
|
281
|
-
mathMlOptions:
|
|
282
|
+
mathMlOptions: a,
|
|
282
283
|
removeIncompleteTool: c,
|
|
283
284
|
limitLabeling: !0
|
|
284
285
|
}),
|
|
285
|
-
F[t] && /* @__PURE__ */
|
|
286
|
+
F[t] && /* @__PURE__ */ o(M, { children: F[t] })
|
|
286
287
|
] }, `correct-response-graph-${l}`);
|
|
287
288
|
}),
|
|
288
|
-
/* @__PURE__ */
|
|
289
|
+
/* @__PURE__ */ o(y, {
|
|
289
290
|
onClick: this.addAlternateResponse,
|
|
290
291
|
children: "ADD ALTERNATE"
|
|
291
292
|
}),
|
|
292
|
-
/* @__PURE__ */
|
|
293
|
-
open:
|
|
294
|
-
title:
|
|
295
|
-
text:
|
|
296
|
-
onClose:
|
|
297
|
-
onConfirm:
|
|
293
|
+
/* @__PURE__ */ o(u, {
|
|
294
|
+
open: l.open,
|
|
295
|
+
title: l.title,
|
|
296
|
+
text: l.text,
|
|
297
|
+
onClose: l.onClose,
|
|
298
|
+
onConfirm: l.onConfirm
|
|
298
299
|
})
|
|
299
300
|
] });
|
|
300
301
|
}
|
|
301
302
|
};
|
|
302
303
|
//#endregion
|
|
303
|
-
export {
|
|
304
|
+
export { P as CorrectResponse, P as default, N as Tools };
|
package/dist/author/index.d.ts
CHANGED
package/dist/author/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import e from "./configure.js";
|
|
1
|
+
import { Configure as e } from "./configure.js";
|
|
2
2
|
import t from "./defaults.js";
|
|
3
3
|
import n from "react";
|
|
4
4
|
import { createRoot as r } from "react-dom/client";
|
|
@@ -88,8 +88,11 @@ var f = a("pie-elements:graphing:configure"), p = (e) => Object.keys(e || {}).so
|
|
|
88
88
|
});
|
|
89
89
|
}
|
|
90
90
|
}
|
|
91
|
+
connectedCallback() {
|
|
92
|
+
this._render();
|
|
93
|
+
}
|
|
91
94
|
disconnectedCallback() {
|
|
92
|
-
this._root
|
|
95
|
+
this._root &&= (this._root.unmount(), null);
|
|
93
96
|
}
|
|
94
97
|
};
|
|
95
98
|
//#endregion
|
package/dist/author/utils.js
CHANGED
|
@@ -257,4 +257,4 @@ var t = [
|
|
|
257
257
|
}, e), {});
|
|
258
258
|
};
|
|
259
259
|
//#endregion
|
|
260
|
-
export { o as applyConstraints, c as filterPlotableMarks, i as getGridValues, a as getLabelValues };
|
|
260
|
+
export { r as VALID_LABEL_VALUES, o as applyConstraints, c as filterPlotableMarks, i as getGridValues, a as getLabelValues };
|