@pie-element/number-line 13.1.2-next.2 → 13.1.2

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 (191) hide show
  1. package/CHANGELOG.json +1247 -0
  2. package/CHANGELOG.md +2441 -0
  3. package/LICENSE.md +5 -0
  4. package/README.md +28 -0
  5. package/configure/CHANGELOG.json +827 -0
  6. package/configure/CHANGELOG.md +2088 -0
  7. package/configure/lib/arrows.js +89 -0
  8. package/configure/lib/arrows.js.map +1 -0
  9. package/configure/lib/card-bar.js +57 -0
  10. package/configure/lib/card-bar.js.map +1 -0
  11. package/configure/lib/defaults.js +177 -0
  12. package/configure/lib/defaults.js.map +1 -0
  13. package/configure/lib/domain.js +87 -0
  14. package/configure/lib/domain.js.map +1 -0
  15. package/configure/lib/index.js +176 -0
  16. package/configure/lib/index.js.map +1 -0
  17. package/configure/lib/main.js +815 -0
  18. package/configure/lib/main.js.map +1 -0
  19. package/configure/lib/number-text-field.js +26 -0
  20. package/configure/lib/number-text-field.js.map +1 -0
  21. package/configure/lib/point-config.js +84 -0
  22. package/configure/lib/point-config.js.map +1 -0
  23. package/configure/lib/size.js +66 -0
  24. package/configure/lib/size.js.map +1 -0
  25. package/configure/lib/ticks.js +234 -0
  26. package/configure/lib/ticks.js.map +1 -0
  27. package/configure/lib/utils.js +12 -0
  28. package/configure/lib/utils.js.map +1 -0
  29. package/configure/package.json +20 -0
  30. package/controller/CHANGELOG.json +332 -0
  31. package/controller/CHANGELOG.md +1360 -0
  32. package/controller/lib/defaults.js +56 -0
  33. package/controller/lib/defaults.js.map +1 -0
  34. package/controller/lib/index.js +430 -0
  35. package/controller/lib/index.js.map +1 -0
  36. package/controller/lib/tickUtils.js +294 -0
  37. package/controller/lib/tickUtils.js.map +1 -0
  38. package/controller/lib/utils.js +168 -0
  39. package/controller/lib/utils.js.map +1 -0
  40. package/controller/package.json +20 -0
  41. package/demo.gif +0 -0
  42. package/docs/config-schema.json +2532 -0
  43. package/docs/config-schema.json.md +1844 -0
  44. package/docs/demo/config.js +8 -0
  45. package/docs/demo/generate.js +39 -0
  46. package/docs/demo/index.html +1 -0
  47. package/docs/pie-schema.json +2461 -0
  48. package/docs/pie-schema.json.md +1228 -0
  49. package/docs/schemas/config.json +256 -0
  50. package/lib/data-converter.js +96 -0
  51. package/lib/data-converter.js.map +1 -0
  52. package/lib/draggable/index.js +114 -0
  53. package/lib/draggable/index.js.map +1 -0
  54. package/lib/index.js +196 -0
  55. package/lib/index.js.map +1 -0
  56. package/lib/number-line/colors.js +11 -0
  57. package/lib/number-line/colors.js.map +1 -0
  58. package/lib/number-line/feedback.js +92 -0
  59. package/lib/number-line/feedback.js.map +1 -0
  60. package/lib/number-line/graph/arrow.js +44 -0
  61. package/lib/number-line/graph/arrow.js.map +1 -0
  62. package/lib/number-line/graph/elements/base.js +20 -0
  63. package/lib/number-line/graph/elements/base.js.map +1 -0
  64. package/lib/number-line/graph/elements/builder.js +37 -0
  65. package/lib/number-line/graph/elements/builder.js.map +1 -0
  66. package/lib/number-line/graph/elements/line.js +259 -0
  67. package/lib/number-line/graph/elements/line.js.map +1 -0
  68. package/lib/number-line/graph/elements/point.js +204 -0
  69. package/lib/number-line/graph/elements/point.js.map +1 -0
  70. package/lib/number-line/graph/elements/ray.js +190 -0
  71. package/lib/number-line/graph/elements/ray.js.map +1 -0
  72. package/lib/number-line/graph/index.js +262 -0
  73. package/lib/number-line/graph/index.js.map +1 -0
  74. package/lib/number-line/graph/line.js +38 -0
  75. package/lib/number-line/graph/line.js.map +1 -0
  76. package/lib/number-line/graph/stacks.js +78 -0
  77. package/lib/number-line/graph/stacks.js.map +1 -0
  78. package/lib/number-line/graph/tick-utils.js +347 -0
  79. package/lib/number-line/graph/tick-utils.js.map +1 -0
  80. package/lib/number-line/graph/ticks.js +188 -0
  81. package/lib/number-line/graph/ticks.js.map +1 -0
  82. package/lib/number-line/index.js +384 -0
  83. package/lib/number-line/index.js.map +1 -0
  84. package/lib/number-line/point-chooser/button.js +49 -0
  85. package/lib/number-line/point-chooser/button.js.map +1 -0
  86. package/lib/number-line/point-chooser/img.js +8 -0
  87. package/lib/number-line/point-chooser/img.js.map +1 -0
  88. package/lib/number-line/point-chooser/index.js +197 -0
  89. package/lib/number-line/point-chooser/index.js.map +1 -0
  90. package/lib/number-line/point-chooser/styles.js +77 -0
  91. package/lib/number-line/point-chooser/styles.js.map +1 -0
  92. package/lib/number-line/transitions/fade.js +88 -0
  93. package/lib/number-line/transitions/fade.js.map +1 -0
  94. package/lib/number-line/transitions/index.js +14 -0
  95. package/lib/number-line/transitions/index.js.map +1 -0
  96. package/package.json +21 -86
  97. package/configure.js +0 -2
  98. package/controller.js +0 -1
  99. package/dist/_virtual/_rolldown/runtime.js +0 -11
  100. package/dist/author/arrows.d.ts +0 -28
  101. package/dist/author/arrows.js +0 -69
  102. package/dist/author/card-bar.d.ts +0 -20
  103. package/dist/author/card-bar.js +0 -41
  104. package/dist/author/defaults.d.ts +0 -178
  105. package/dist/author/defaults.js +0 -144
  106. package/dist/author/domain.d.ts +0 -15
  107. package/dist/author/domain.js +0 -54
  108. package/dist/author/index.d.ts +0 -23
  109. package/dist/author/index.js +0 -89
  110. package/dist/author/main.d.ts +0 -44
  111. package/dist/author/main.js +0 -485
  112. package/dist/author/number-text-field.d.ts +0 -13
  113. package/dist/author/number-text-field.js +0 -13
  114. package/dist/author/point-config.d.ts +0 -25
  115. package/dist/author/point-config.js +0 -69
  116. package/dist/author/size.d.ts +0 -24
  117. package/dist/author/size.js +0 -48
  118. package/dist/author/ticks.d.ts +0 -22
  119. package/dist/author/ticks.js +0 -115
  120. package/dist/author/utils.d.ts +0 -9
  121. package/dist/author/utils.js +0 -4
  122. package/dist/browser/author/index.js +0 -40259
  123. package/dist/browser/author/index.js.map +0 -1
  124. package/dist/browser/controller/index.js +0 -569
  125. package/dist/browser/controller/index.js.map +0 -1
  126. package/dist/browser/delivery/index.js +0 -2
  127. package/dist/browser/delivery-DWjDT9Sz.js +0 -17910
  128. package/dist/browser/delivery-DWjDT9Sz.js.map +0 -1
  129. package/dist/browser/dist-D5T-OaLo.js +0 -19038
  130. package/dist/browser/dist-D5T-OaLo.js.map +0 -1
  131. package/dist/browser/impureFunctionsAny.generated-Bqfato71.js +0 -10162
  132. package/dist/browser/impureFunctionsAny.generated-Bqfato71.js.map +0 -1
  133. package/dist/browser/number-line.css +0 -2
  134. package/dist/controller/defaults.d.ts +0 -58
  135. package/dist/controller/defaults.js +0 -50
  136. package/dist/controller/index.d.ts +0 -47
  137. package/dist/controller/index.js +0 -165
  138. package/dist/controller/tickUtils.d.ts +0 -21
  139. package/dist/controller/tickUtils.js +0 -252
  140. package/dist/controller/utils.d.ts +0 -9
  141. package/dist/controller/utils.js +0 -68
  142. package/dist/delivery/data-converter.d.ts +0 -64
  143. package/dist/delivery/data-converter.js +0 -70
  144. package/dist/delivery/draggable/index.d.ts +0 -33
  145. package/dist/delivery/draggable/index.js +0 -39
  146. package/dist/delivery/index.d.ts +0 -35
  147. package/dist/delivery/index.js +0 -109
  148. package/dist/delivery/number-line/colors.d.ts +0 -11
  149. package/dist/delivery/number-line/colors.js +0 -5
  150. package/dist/delivery/number-line/feedback.d.ts +0 -19
  151. package/dist/delivery/number-line/feedback.js +0 -57
  152. package/dist/delivery/number-line/graph/arrow.d.ts +0 -30
  153. package/dist/delivery/number-line/graph/arrow.js +0 -27
  154. package/dist/delivery/number-line/graph/elements/base.d.ts +0 -16
  155. package/dist/delivery/number-line/graph/elements/base.js +0 -11
  156. package/dist/delivery/number-line/graph/elements/builder.d.ts +0 -33
  157. package/dist/delivery/number-line/graph/elements/builder.js +0 -30
  158. package/dist/delivery/number-line/graph/elements/line.d.ts +0 -51
  159. package/dist/delivery/number-line/graph/elements/line.js +0 -188
  160. package/dist/delivery/number-line/graph/elements/point.d.ts +0 -43
  161. package/dist/delivery/number-line/graph/elements/point.js +0 -127
  162. package/dist/delivery/number-line/graph/elements/ray.d.ts +0 -43
  163. package/dist/delivery/number-line/graph/elements/ray.js +0 -130
  164. package/dist/delivery/number-line/graph/index.d.ts +0 -59
  165. package/dist/delivery/number-line/graph/index.js +0 -196
  166. package/dist/delivery/number-line/graph/line.d.ts +0 -46
  167. package/dist/delivery/number-line/graph/line.js +0 -27
  168. package/dist/delivery/number-line/graph/stacks.d.ts +0 -10
  169. package/dist/delivery/number-line/graph/stacks.js +0 -40
  170. package/dist/delivery/number-line/graph/tick-utils.d.ts +0 -80
  171. package/dist/delivery/number-line/graph/tick-utils.js +0 -295
  172. package/dist/delivery/number-line/graph/ticks.d.ts +0 -46
  173. package/dist/delivery/number-line/graph/ticks.js +0 -115
  174. package/dist/delivery/number-line/index.d.ts +0 -35
  175. package/dist/delivery/number-line/index.js +0 -215
  176. package/dist/delivery/number-line/point-chooser/button.d.ts +0 -31
  177. package/dist/delivery/number-line/point-chooser/button.js +0 -36
  178. package/dist/delivery/number-line/point-chooser/img.d.ts +0 -10
  179. package/dist/delivery/number-line/point-chooser/img.js +0 -4
  180. package/dist/delivery/number-line/point-chooser/index.d.ts +0 -37
  181. package/dist/delivery/number-line/point-chooser/index.js +0 -154
  182. package/dist/delivery/number-line/point-chooser/styles.d.ts +0 -192
  183. package/dist/delivery/number-line/transitions/fade.d.ts +0 -34
  184. package/dist/delivery/number-line/transitions/fade.js +0 -75
  185. package/dist/delivery/number-line/transitions/index.d.ts +0 -10
  186. package/dist/index.d.ts +0 -1
  187. package/dist/index.iife.d.ts +0 -8
  188. package/dist/index.iife.js +0 -197
  189. package/dist/index.js +0 -2
  190. package/dist/runtime-support.d.ts +0 -12
  191. package/dist/runtime-support.js +0 -12
@@ -1,485 +0,0 @@
1
- import { data_converter_exports as e } from "../delivery/data-converter.js";
2
- import { generateMajorValuesForMinor as t, generateMinorValues as n, getMinorLimits as r, snapElements as i } from "../delivery/number-line/graph/tick-utils.js";
3
- import a from "../delivery/number-line/index.js";
4
- import o from "./number-text-field.js";
5
- import s from "./card-bar.js";
6
- import ee from "./size.js";
7
- import c from "./domain.js";
8
- import l from "./arrows.js";
9
- import te from "./point-config.js";
10
- import ne from "./ticks.js";
11
- import { model as u } from "./defaults.js";
12
- import { generateValidationMessage as re } from "./utils.js";
13
- import d from "react";
14
- import { styled as f } from "@mui/material/styles";
15
- import p from "prop-types";
16
- import { jsx as m, jsxs as h } from "react/jsx-runtime";
17
- import * as g from "mathjs";
18
- import { cloneDeep as _ } from "@pie-element/shared-lodash";
19
- import { AlertDialog as v, FormSection as y, InputContainer as b, layout as ie, settings as x } from "@pie-lib/config-ui";
20
- import S from "@pie-lib/editable-html-tip-tap";
21
- import ae from "@mui/material/Tooltip";
22
- import C from "@mui/material/Typography";
23
- import oe from "@mui/icons-material/Info";
24
- //#region src/author/main.tsx
25
- var w = (e) => ({
26
- ...e,
27
- feedback: void 0,
28
- prompt: void 0,
29
- teacherInstructions: void 0,
30
- graph: {
31
- ...e.graph,
32
- title: void 0,
33
- disabled: !0
34
- },
35
- correctResponse: void 0
36
- }), { lineIsSwitched: T, switchGraphLine: E, toGraphFormat: se, toSessionFormat: D } = e, { Panel: ce, toggle: O } = x, k = {}, A = {}, j = {}, le = f(o)({
37
- width: "150px",
38
- ".MuiInputBase-input": { padding: "16.5px 14px" }
39
- }), ue = f("div")(({ theme: e }) => ({
40
- display: "flex",
41
- flexWrap: "wrap",
42
- "& > *": { paddingRight: e.spacing(2) }
43
- })), de = f("div")(({ theme: e }) => ({ margin: `${e.spacing(2.5)} 0` })), M = f(b)(({ theme: e }) => ({
44
- paddingTop: e.spacing(2),
45
- marginBottom: e.spacing(2),
46
- width: "100%"
47
- })), fe = f(y)(({ theme: e }) => ({ marginBottom: e.spacing(4) })), N = f("div")(({ theme: e }) => ({
48
- fontSize: e.typography.fontSize - 2,
49
- color: e.palette.error.main,
50
- paddingTop: e.spacing(1)
51
- })), pe = f("div")({
52
- display: "flex",
53
- alignItems: "center",
54
- gap: "10px"
55
- }), me = f(y)({
56
- display: "flex",
57
- alignItems: "center",
58
- gap: "10px"
59
- }), he = f(C)(({ theme: e }) => ({ marginBottom: e.spacing(2.5) })), P = (e) => {
60
- function t(e) {
61
- return e.pointType ? e.direction ? `${e.pointType[0]}${e.direction[0]}` : e.pointType[0] : `${e.leftPoint[0]}${e.rightPoint[0]}`;
62
- }
63
- return `${e.type[0]}${t(e)}`.toUpperCase();
64
- }, F = class extends d.Component {
65
- static propTypes = {
66
- model: p.object.isRequired,
67
- configuration: p.object.isRequired,
68
- onConfigurationChanged: p.func.isRequired,
69
- onChange: p.func.isRequired,
70
- imageSupport: p.object.isRequired,
71
- uploadSoundSupport: p.object.isRequired
72
- };
73
- constructor(e) {
74
- super(e);
75
- let { model: { graph: { availableTypes: t, maxNumberOfPoints: n } } } = e, r = this.getAdjustedHeight(t, n);
76
- this.state = {
77
- dialog: {
78
- open: !1,
79
- text: ""
80
- },
81
- correctAnswerDialog: {
82
- open: !1,
83
- text: ""
84
- }
85
- }, this.graphChange({ height: r });
86
- }
87
- componentDidMount() {
88
- let { configuration: e, model: t, onChange: n } = this.props, { title: r } = e || {}, { titleEnabled: i } = t || {}, a = i ?? r.enabled;
89
- n && n({
90
- ...t,
91
- titleEnabled: a
92
- });
93
- }
94
- graphChange = (e) => {
95
- let { model: t, onChange: n } = this.props, r = {
96
- ...t.graph,
97
- ...e
98
- }, i = [];
99
- t.correctResponse.forEach((e, t) => {
100
- (e.domainPosition < r.domain.min || e.domainPosition > r.domain.max || e.size && (e.domainPosition + e.size < r.domain.min || e.domainPosition + e.size > r.domain.max)) && i.push(t);
101
- }), i.length > 0 && this.setState({ correctAnswerDialog: {
102
- open: !0,
103
- text: "This\nchange would make it impossible for students to plot one or more elements in the current\ncorrect answer. If you proceed, all such elements will be removed from the correct\nanswer.",
104
- indices: i,
105
- graph: t.graph
106
- } }), r = this.reloadTicksData(r), n({ graph: r });
107
- };
108
- changeSize = ({ width: e, height: t }) => this.graphChange({
109
- width: e,
110
- height: t
111
- });
112
- getAdjustedHeight = (e, t) => {
113
- let n = !0;
114
- return Object.entries(e || {}).forEach(([e, t]) => {
115
- if (e !== "PF" && t) {
116
- n = !1;
117
- return;
118
- }
119
- }), t && (t === 1 || n) ? 100 : 50 + (t || 20) * 25;
120
- };
121
- changeMaxNoOfPoints = (e, t) => {
122
- if (t = Math.floor(t), this.props.model.correctResponse.length > t) {
123
- this.setState({ dialog: {
124
- open: !0,
125
- text: "To use this value, you must first remove one or more elements from the correct answers."
126
- } });
127
- return;
128
- }
129
- let { model: { graph: { availableTypes: n } } } = this.props, r = this.getAdjustedHeight(n, t);
130
- this.graphChange({
131
- maxNumberOfPoints: t,
132
- height: r
133
- });
134
- };
135
- changeGraphTitle = (e) => this.graphChange({ title: e });
136
- changeTicks = (e) => {
137
- let { model: t, onChange: n } = this.props, { ticks: r } = e, a = i(t.graph.domain, r, t.correctResponse), o = t.graph.initialElements ? i(t.graph.domain, r, t.graph.initialElements) : [];
138
- n({
139
- graph: {
140
- ...this.updateMajorValue({
141
- ...t.graph,
142
- ticks: r
143
- }),
144
- initialElements: o
145
- },
146
- correctResponse: a
147
- });
148
- };
149
- reloadTicksData = (e) => {
150
- let { domain: t, ticks: i, width: a } = e;
151
- if (i.tickIntervalType || (i.minor > .5 ? i.tickIntervalType = "Integer" : i.tickIntervalType = "Decimal"), k = r(t, a), k.min >= 1) i.tickIntervalType = "Integer", i.minor = i.minor < 1 ? g.number(g.ceil(k.min)) : i.minor >= g.number(g.ceil(k.min)) && i.minor <= g.number(g.floor(k.max)) ? i.minor : g.number(g.ceil(k.min)), i.integerTick = i.minor, A = {
152
- decimal: [],
153
- fraction: []
154
- }, i.fractionTick = "0", i.decimalTick = 0;
155
- else if (k.min >= 0 && k.max < 1) {
156
- i.tickIntervalType === "Integer" && (i.tickIntervalType = "Fraction"), A = n(k);
157
- let e = g.number(g.fraction(A.fraction[0])), t = g.number(g.fraction(A.fraction[A.fraction.length - 1]));
158
- if (i.minor < e || i.minor > t) switch (i.tickIntervalType) {
159
- case "Fraction":
160
- i.minor = g.number(g.fraction(A.fraction[A.fraction.length - 1])), i.fractionTick = A.fraction[A.fraction.length - 1], i.decimalTick = A.decimal[0];
161
- break;
162
- case "Decimal":
163
- case "Integer": i.minor = A.decimal[A.decimal.length - 1], i.decimalTick = A.decimal[A.decimal.length - 1], i.fractionTick = A.fraction[0];
164
- }
165
- else switch (i.tickIntervalType) {
166
- case "Fraction":
167
- let e = g.fraction(g.number(i.minor));
168
- i.fractionTick = e.n + "/" + e.d, i.decimalTick = i.decimalTick ? i.decimalTick : A.decimal[0];
169
- break;
170
- case "Decimal":
171
- case "Integer": i.decimalTick = i.minor, i.fractionTick = i.fractionTick ? i.fractionTick : A.fraction[0];
172
- }
173
- i.integerTick = 1;
174
- } else if (k.min < 1 && k.max >= 1) if (A = n(k), i.minor >= k.min && i.minor <= k.max) switch (i.tickIntervalType) {
175
- case "Integer":
176
- i.integerTick = i.minor, i.decimalTick = k.min > .5 ? 0 : A.decimal[0], i.fractionTick = k.min > .5 ? "0" : A.fraction[0];
177
- break;
178
- case "Decimal":
179
- i.integerTick = 1, i.decimalTick = i.minor, i.fractionTick = A.fraction[0];
180
- break;
181
- case "Fraction":
182
- i.integerTick = 1, i.decimalTick = A.decimal[0];
183
- let e = g.fraction(g.number(i.minor));
184
- i.fractionTick = e.n + "/" + e.d;
185
- }
186
- else switch (k.min > .5 && (i.tickIntervalType = "Integer"), i.tickIntervalType) {
187
- case "Integer":
188
- i.minor = g.number(g.ceil(k.min)), i.integerTick = i.minor, i.decimalTick = k.min > .5 ? 0 : A.decimal[0], i.fractionTick = k.min > .5 ? "0" : A.fraction[0];
189
- break;
190
- case "Decimal":
191
- i.minor = A.decimal[0], i.integerTick = 1, i.decimalTick = i.minor, i.fractionTick = A.fraction[0];
192
- break;
193
- case "Fraction": i.minor = g.number(g.fraction(A.fraction[0])), i.integerTick = 1, i.decimalTick = A.decimal[0], i.fractionTick = A.fraction[0];
194
- }
195
- return this.updateMajorValue({
196
- ...e,
197
- ticks: i
198
- });
199
- };
200
- updateMajorValue = (e) => {
201
- let { domain: n, ticks: r, width: i } = e;
202
- if (j = t(r.minor, n, i), j.decimal.indexOf(r.major) === -1) {
203
- let e = 0;
204
- e = r.tickIntervalType === "Integer" && j.decimal.length > 4 ? 4 : j.decimal.length - 1, r.major = j.decimal[e];
205
- }
206
- return e.fraction = r.tickIntervalType === "Fraction" && r.major < 1, {
207
- ...e,
208
- ticks: r
209
- };
210
- };
211
- changeArrows = (e) => this.graphChange({ arrows: e });
212
- setDefaults = () => {
213
- let { graph: { availableTypes: e, maxNumberOfPoints: t } } = u, n = this.getAdjustedHeight(e, t), r = {
214
- ..._(u.graph),
215
- height: n
216
- };
217
- this.props.onChange({ graph: r });
218
- };
219
- moveCorrectResponse = (e, t, n) => {
220
- t.position = n;
221
- let { onChange: r, model: i } = this.props, a = D(t.type === "line" && T(t) ? E(t) : t), o = [...i.correctResponse];
222
- o[e] = a, r({ correctResponse: o });
223
- };
224
- availableTypesChange = (e) => {
225
- let { model: t, onChange: n } = this.props, { correctResponse: r, graph: { maxNumberOfPoints: i } } = t;
226
- new Set(r.map(P)).forEach((t) => {
227
- e[t] = !0;
228
- });
229
- let a = this.getAdjustedHeight(e, i);
230
- n({ graph: {
231
- ...t.graph,
232
- availableTypes: e,
233
- height: a
234
- } });
235
- };
236
- deleteCorrectResponse = (e) => {
237
- let { model: t, onChange: n } = this.props;
238
- n({ correctResponse: t.correctResponse.filter((t, n) => !e.some((e) => e === n)) });
239
- };
240
- addCorrectResponse = (e) => {
241
- let { model: t, onChange: n } = this.props, r = [...t.correctResponse];
242
- r.push(D(e)), n({ correctResponse: r });
243
- };
244
- clearCorrectResponse = () => {
245
- let { onChange: e } = this.props;
246
- e({ correctResponse: [] });
247
- };
248
- undoCorrectResponse = () => {
249
- let { model: e, onChange: t } = this.props, n = [...e.correctResponse];
250
- n.pop(), t({ correctResponse: n });
251
- };
252
- render() {
253
- let { model: e, onChange: t, configuration: n, onConfigurationChanged: r, uploadSoundSupport: i, imageSupport: o } = this.props, { baseInputConfiguration: u = {}, contentDimensions: f = {}, instruction: p = {}, teacherInstructions: g = {}, title: b = {}, prompt: x = {}, rationale: C = {}, spellCheck: T = {}, mathMlOptions: E = {}, numberLineDimensions: D = {}, maxMaxElements: P = 20, hidePointConfigButtons: F = !1, availableTools: I = ["PF"], settingsPanelDisabled: L = !1 } = n || {}, { errors: R = {}, extraCSSRules: ge, spellCheckEnabled: z, toolbarEditorPosition: _e, teacherInstructionsEnabled: ve, titleEnabled: ye, promptEnabled: be, rationaleEnabled: xe } = e || {}, { graph: B } = e;
254
- B = this.reloadTicksData(B);
255
- let { dialog: V, correctAnswerDialog: H } = this.state, { correctResponseError: U, domainError: W, maxError: G, pointsError: K, prompt: q, rationale: J, teacherInstructions: Y, widthError: X } = R || {}, Se = re(), Ce = _(e.correctResponse || []).map(se), Z = _(e);
256
- Z.disabled = !0;
257
- let Q = { position: _e === "top" ? "top" : "bottom" }, we = {
258
- teacherInstructionsEnabled: g.settings && O(g.label),
259
- titleEnabled: b.settings && O(b.label),
260
- promptEnabled: x.settings && O(x.label),
261
- rationaleEnabled: C.settings && O(C.label),
262
- spellCheckEnabled: T.settings && O(T.label)
263
- }, $ = (e = {}) => ({
264
- ...u,
265
- ...e
266
- });
267
- return /* @__PURE__ */ h(ie.ConfigLayout, {
268
- extraCSSRules: ge,
269
- dimensions: f,
270
- hideSettings: L,
271
- settings: /* @__PURE__ */ m(ce, {
272
- model: e,
273
- configuration: n,
274
- onChangeModel: t,
275
- onChangeConfiguration: r,
276
- groups: { Properties: we }
277
- }),
278
- children: [
279
- /* @__PURE__ */ m(he, {
280
- component: "div",
281
- type: "body1",
282
- children: p.label
283
- }),
284
- ve && /* @__PURE__ */ h(M, {
285
- label: g.label,
286
- children: [/* @__PURE__ */ m(S, {
287
- markup: e.teacherInstructions || "",
288
- onChange: (e) => t({ teacherInstructions: e }),
289
- nonEmpty: !1,
290
- disableUnderline: !0,
291
- error: Y,
292
- toolbarOpts: Q,
293
- pluginProps: $(g?.inputConfiguration),
294
- spellCheck: z,
295
- imageSupport: o,
296
- uploadSoundSupport: i,
297
- languageCharactersProps: [{ language: "spanish" }, { language: "special" }],
298
- mathMlOptions: E
299
- }), Y && /* @__PURE__ */ m(N, { children: Y })]
300
- }),
301
- be && /* @__PURE__ */ h(M, {
302
- label: x.label,
303
- children: [/* @__PURE__ */ m(S, {
304
- markup: e.prompt || "",
305
- onChange: (e) => t({ prompt: e }),
306
- nonEmpty: !1,
307
- disableUnderline: !0,
308
- error: q,
309
- toolbarOpts: Q,
310
- pluginProps: $(x?.inputConfiguration),
311
- spellCheck: z,
312
- imageSupport: o,
313
- uploadSoundSupport: i,
314
- languageCharactersProps: [{ language: "spanish" }, { language: "special" }],
315
- mathMlOptions: E
316
- }), q && /* @__PURE__ */ m(N, { children: q })]
317
- }),
318
- /* @__PURE__ */ m(s, {
319
- header: "Set Up Number Line",
320
- info: /* @__PURE__ */ m(ae, {
321
- disableFocusListener: !0,
322
- disableTouchListener: !0,
323
- placement: "right",
324
- title: Se,
325
- slotProps: { tooltip: { sx: (e) => ({
326
- fontSize: e.typography.fontSize - 2,
327
- whiteSpace: "pre",
328
- maxWidth: "500px"
329
- }) } },
330
- children: /* @__PURE__ */ m(oe, {
331
- fontSize: "small",
332
- color: "primary",
333
- style: { marginLeft: "8px" }
334
- })
335
- }),
336
- children: "Set up the number line by entering the domain and number of tick marks to display. Labels on the number line can be edited or removed by clicking on the label."
337
- }),
338
- /* @__PURE__ */ m(ue, { children: /* @__PURE__ */ m(c, {
339
- domain: B.domain,
340
- errors: R,
341
- onChange: (e) => this.graphChange({ domain: e })
342
- }) }),
343
- G && /* @__PURE__ */ m(N, { children: G }),
344
- W && /* @__PURE__ */ m(N, { children: W }),
345
- /* @__PURE__ */ m("div", { children: /* @__PURE__ */ m(y, { children: /* @__PURE__ */ m(ne, {
346
- ticks: B.ticks,
347
- minorLimits: k,
348
- minorValues: A,
349
- majorValues: j,
350
- onChange: this.changeTicks
351
- }) }) }),
352
- /* @__PURE__ */ h(pe, { children: [
353
- e.widthEnabled && /* @__PURE__ */ m(ee, {
354
- size: B,
355
- min: D.min,
356
- max: D.max,
357
- step: D.step,
358
- onChange: this.changeSize
359
- }),
360
- /* @__PURE__ */ m("div", {}),
361
- /* @__PURE__ */ m(l, {
362
- arrows: B.arrows,
363
- onChange: this.changeArrows
364
- })
365
- ] }),
366
- X && /* @__PURE__ */ m(N, { children: X }),
367
- /* @__PURE__ */ m(a, {
368
- onMoveElement: () => {},
369
- onDeleteElements: () => {},
370
- onAddElement: () => {},
371
- onClearElements: () => {},
372
- onUndoElement: () => {},
373
- minWidth: D.min,
374
- maxWidth: D.max,
375
- maxHeight: 70,
376
- model: w(Z)
377
- }),
378
- ye && /* @__PURE__ */ m(fe, {
379
- label: b?.label || "Title",
380
- children: /* @__PURE__ */ m(S, {
381
- markup: B.title || "",
382
- onChange: this.changeGraphTitle,
383
- toolbarOpts: Q,
384
- activePlugins: [
385
- "bold",
386
- "html",
387
- "italic",
388
- "underline",
389
- "strikethrough",
390
- "image",
391
- "math",
392
- "languageCharacters",
393
- "responseArea"
394
- ],
395
- pluginProps: $(b?.inputConfiguration),
396
- spellCheck: z,
397
- imageSupport: o,
398
- uploadSoundSupport: i,
399
- languageCharactersProps: [{ language: "spanish" }, { language: "special" }],
400
- mathMlOptions: E
401
- })
402
- }),
403
- !B.exhibitOnly && /* @__PURE__ */ h(d.Fragment, { children: [
404
- /* @__PURE__ */ h(s, {
405
- header: "Define Tool Set and Correct Response",
406
- children: ["Select answer type and place it on the number line. Intersecting points, line segments and/or rays will appear above the number line. ", /* @__PURE__ */ m("i", { children: "Note: A maximum of 20 points, line segments or rays may be plotted." })]
407
- }),
408
- /* @__PURE__ */ m(s, {
409
- header: "Available Tools",
410
- mini: !0,
411
- children: "Click on the input options to be displayed to the students. All inputs will display by default."
412
- }),
413
- /* @__PURE__ */ m(de, { children: /* @__PURE__ */ m(te, {
414
- onSelectionChange: this.availableTypesChange,
415
- selection: B.availableTypes,
416
- availableTools: I,
417
- hideButtons: F
418
- }) }),
419
- /* @__PURE__ */ h(me, { children: [
420
- /* @__PURE__ */ m("label", { children: "Max No of Elements" }),
421
- /* @__PURE__ */ m(le, {
422
- min: 1,
423
- max: P,
424
- onlyIntegersAllowed: !0,
425
- value: B.maxNumberOfPoints,
426
- onChange: this.changeMaxNoOfPoints
427
- }),
428
- K && /* @__PURE__ */ m(N, { children: K })
429
- ] }),
430
- /* @__PURE__ */ m("label", { children: "Correct Answer" }),
431
- /* @__PURE__ */ m(a, {
432
- onMoveElement: this.moveCorrectResponse,
433
- onDeleteElements: this.deleteCorrectResponse,
434
- onAddElement: this.addCorrectResponse,
435
- onClearElements: this.clearCorrectResponse,
436
- onUndoElement: this.undoCorrectResponse,
437
- minWidth: D.min,
438
- maxWidth: D.max,
439
- answer: Ce,
440
- model: w(e)
441
- }),
442
- U && /* @__PURE__ */ m(N, { children: U })
443
- ] }),
444
- /* @__PURE__ */ m(v, {
445
- open: V.open,
446
- title: "Warning",
447
- text: V.text,
448
- onConfirm: () => this.setState({ dialog: { open: !1 } })
449
- }),
450
- /* @__PURE__ */ m(v, {
451
- open: H.open,
452
- title: "Warning",
453
- text: H.text,
454
- onConfirm: () => {
455
- let e = this.state.correctAnswerDialog.indices;
456
- e && e.length > 0 && this.deleteCorrectResponse(e), this.setState({ correctAnswerDialog: { open: !1 } });
457
- },
458
- onClose: () => {
459
- let e = this.state.correctAnswerDialog.graph;
460
- t({ graph: e }), this.setState({ correctAnswerDialog: { open: !1 } });
461
- },
462
- onConfirmText: "OK",
463
- onCloseText: "Cancel"
464
- }),
465
- xe && /* @__PURE__ */ h(M, {
466
- label: C.label || "Rationale",
467
- children: [/* @__PURE__ */ m(S, {
468
- markup: e.rationale || "",
469
- onChange: (e) => t({ rationale: e }),
470
- error: J,
471
- toolbarOpts: Q,
472
- spellCheck: z,
473
- pluginProps: $(C?.inputConfiguration),
474
- imageSupport: o,
475
- uploadSoundSupport: i,
476
- languageCharactersProps: [{ language: "spanish" }, { language: "special" }],
477
- mathMlOptions: E
478
- }), J && /* @__PURE__ */ m(N, { children: J })]
479
- })
480
- ]
481
- });
482
- }
483
- };
484
- //#endregion
485
- export { F as default };
@@ -1,13 +0,0 @@
1
- /**
2
- * @synced-from pie-elements/packages/number-line/configure/src/number-text-field.jsx
3
- * @auto-generated
4
- *
5
- * This file is automatically synced from pie-elements and converted to TypeScript.
6
- * Manual edits will be overwritten on next sync.
7
- * To make changes, edit the upstream JavaScript file and run sync again.
8
- */
9
- import React from 'react';
10
- declare const MiniField: any;
11
- declare const NumberTextField: (props: any) => React.JSX.Element;
12
- export { MiniField };
13
- export default NumberTextField;
@@ -1,13 +0,0 @@
1
- import "react";
2
- import { styled as e } from "@mui/material/styles";
3
- import { jsx as t } from "react/jsx-runtime";
4
- import { NumberTextField as n } from "@pie-lib/config-ui";
5
- //#region src/author/number-text-field.tsx
6
- var r = e(n)(({ theme: e }) => ({ marginLeft: e.spacing(1) }));
7
- e(n)({ maxWidth: "100px" });
8
- var i = (e) => /* @__PURE__ */ t(r, {
9
- ...e,
10
- variant: "outlined"
11
- });
12
- //#endregion
13
- export { i as default };
@@ -1,25 +0,0 @@
1
- /**
2
- * @synced-from pie-elements/packages/number-line/configure/src/point-config.jsx
3
- * @auto-generated
4
- *
5
- * This file is automatically synced from pie-elements and converted to TypeScript.
6
- * Manual edits will be overwritten on next sync.
7
- * To make changes, edit the upstream JavaScript file and run sync again.
8
- */
9
- import React from 'react';
10
- import PropTypes from 'prop-types';
11
- declare class PointConfig extends React.Component {
12
- static propTypes: {
13
- onSelectionChange: PropTypes.Requireable<(...args: any[]) => any>;
14
- selection: PropTypes.Requireable<object>;
15
- availableTools: PropTypes.Requireable<any[]>;
16
- hideButtons: PropTypes.Requireable<boolean>;
17
- };
18
- constructor(props: any);
19
- toggle(point: any): void;
20
- toggleAll(value: any): void;
21
- _propsUpdate(selection: any): void;
22
- active(point: any): boolean;
23
- render(): React.JSX.Element;
24
- }
25
- export default PointConfig;
@@ -1,69 +0,0 @@
1
- import { point_chooser_exports as e } from "../delivery/number-line/point-chooser/index.js";
2
- import t from "react";
3
- import { styled as n } from "@mui/material/styles";
4
- import r from "prop-types";
5
- import i from "@mui/material/Button";
6
- import { jsx as a, jsxs as o } from "react/jsx-runtime";
7
- //#region src/author/point-config.tsx
8
- var { Point: s } = e, c = n("div")(({ theme: e }) => ({
9
- paddingTop: e.spacing(2.5),
10
- "& > :first-child": { marginRight: e.spacing(1) }
11
- })), l = class e extends t.Component {
12
- static propTypes = {
13
- onSelectionChange: r.func,
14
- selection: r.object,
15
- availableTools: r.array,
16
- hideButtons: r.bool
17
- };
18
- constructor(e) {
19
- super(e);
20
- }
21
- toggle(e) {
22
- let t = { ...this.props.selection };
23
- t[e] = !t[e], this._propsUpdate(t);
24
- }
25
- toggleAll(t) {
26
- let n = [...e.types].reduce((e, n) => (e[n] = t, e), {});
27
- this._propsUpdate(n);
28
- }
29
- _propsUpdate(e) {
30
- this.props.onSelectionChange(e);
31
- }
32
- active(e) {
33
- return this.props.selection[e] === !0;
34
- }
35
- render() {
36
- let { availableTools: e, hideButtons: t = !1 } = this.props;
37
- return /* @__PURE__ */ o("div", { children: [/* @__PURE__ */ a("div", { children: (e || []).map((e) => /* @__PURE__ */ a(s, {
38
- iconKey: e.toLowerCase(),
39
- onClick: this.toggle.bind(this, e),
40
- active: this.active(e)
41
- }, e.toLowerCase())) }), /* @__PURE__ */ o(c, {
42
- hidden: t,
43
- children: [/* @__PURE__ */ a(i, {
44
- variant: "outlined",
45
- size: "small",
46
- onClick: this.toggleAll.bind(this, !0),
47
- children: "Select All"
48
- }), /* @__PURE__ */ a(i, {
49
- variant: "outlined",
50
- size: "small",
51
- onClick: this.toggleAll.bind(this, !1),
52
- children: "None"
53
- })]
54
- })] });
55
- }
56
- };
57
- l.types = [
58
- "PF",
59
- "LFF",
60
- "LEF",
61
- "LFE",
62
- "LEE",
63
- "RFN",
64
- "RFP",
65
- "REN",
66
- "REP"
67
- ];
68
- //#endregion
69
- export { l as default };
@@ -1,24 +0,0 @@
1
- /**
2
- * @synced-from pie-elements/packages/number-line/configure/src/size.jsx
3
- * @auto-generated
4
- *
5
- * This file is automatically synced from pie-elements and converted to TypeScript.
6
- * Manual edits will be overwritten on next sync.
7
- * To make changes, edit the upstream JavaScript file and run sync again.
8
- */
9
- import React from 'react';
10
- import PropTypes from 'prop-types';
11
- declare const Size: {
12
- (props: any): React.JSX.Element;
13
- propTypes: {
14
- size: PropTypes.Requireable<PropTypes.InferProps<{
15
- width: PropTypes.Requireable<number>;
16
- height: PropTypes.Requireable<number>;
17
- }>>;
18
- min: PropTypes.Requireable<number>;
19
- max: PropTypes.Requireable<number>;
20
- step: PropTypes.Requireable<number>;
21
- onChange: PropTypes.Validator<(...args: any[]) => any>;
22
- };
23
- };
24
- export default Size;
@@ -1,48 +0,0 @@
1
- import "react";
2
- import { styled as e } from "@mui/material/styles";
3
- import t from "prop-types";
4
- import { jsx as n, jsxs as r } from "react/jsx-runtime";
5
- import { NumberTextFieldCustom as i } from "@pie-lib/config-ui";
6
- //#region src/author/size.tsx
7
- var a = e("div")({
8
- display: "flex",
9
- alignItems: "center",
10
- gap: "10px"
11
- }), o = e("div")({
12
- display: "flex",
13
- flexFlow: "column"
14
- }), s = e("label")({
15
- fontSize: "small",
16
- color: "gray"
17
- }), c = e(i)({ "& input": { cursor: "default" } }), l = (e) => {
18
- let { size: t = { width: 500 }, min: i = 150, max: l = 800, step: u = 20, onChange: d } = e;
19
- return /* @__PURE__ */ r(a, { children: [/* @__PURE__ */ r(o, { children: [/* @__PURE__ */ n("label", { children: "Width (px)" }), /* @__PURE__ */ r(s, { children: [
20
- "Min ",
21
- i,
22
- ", Max ",
23
- l
24
- ] })] }), /* @__PURE__ */ n(c, {
25
- value: t.width,
26
- min: i,
27
- max: l,
28
- step: u,
29
- onlyIntegersAllowed: !0,
30
- onChange: (t, n) => d({
31
- ...e.size,
32
- width: n
33
- }),
34
- variant: "outlined"
35
- })] });
36
- };
37
- l.propTypes = {
38
- size: t.shape({
39
- width: t.number,
40
- height: t.number
41
- }),
42
- min: t.number,
43
- max: t.number,
44
- step: t.number,
45
- onChange: t.func.isRequired
46
- };
47
- //#endregion
48
- export { l as default };